1
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2
dnl vi: set tabstop=4 shiftwidth=4 expandtab:
3
dnl ***** BEGIN LICENSE BLOCK *****
4
dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
6
dnl The contents of this file are subject to the Mozilla Public License Version
7
dnl 1.1 (the "License"); you may not use this file except in compliance with
8
dnl the License. You may obtain a copy of the License at
9
dnl http://www.mozilla.org/MPL/
11
dnl Software distributed under the License is distributed on an "AS IS" basis,
12
dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13
dnl for the specific language governing rights and limitations under the
16
dnl The Original Code is this file as it was released upon August 6, 1998.
18
dnl The Initial Developer of the Original Code is
19
dnl Christopher Seawood.
20
dnl Portions created by the Initial Developer are Copyright (C) 1998-2001
21
dnl the Initial Developer. All Rights Reserved.
24
dnl Jamie Zawinski <jwz@jwz.org>
25
dnl gettimeofday args check
26
dnl Christopher Blizzard <blizzard@appliedtheory.com>
27
dnl gnomefe update & enable-pthreads
28
dnl Ramiro Estrugo <ramiro@netscape.com>
29
dnl X11 makedepend support
31
dnl Henry Sobotka <sobotka@axess.com>
33
dnl Dan Mosedale <dmose@mozilla.org>
35
dnl Seth Spitzer <sspitzer@netscape.com>
37
dnl Benjamin Smedberg <benjamin@smedbergs.us>
38
dnl Howard Chu <hyc@symas.com>
40
dnl Mark Mentovai <mark@moxienet.com>:
41
dnl Mac OS X 10.4 support
42
dnl Giorgio Maone <g.maone@informaction.com>
43
dnl MSVC l10n compatible version check
44
dnl Ben Turner <mozilla@songbirdnest.com>
46
dnl Alternatively, the contents of this file may be used under the terms of
47
dnl either the GNU General Public License Version 2 or later (the "GPL"), or
48
dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
49
dnl in which case the provisions of the GPL or the LGPL are applicable instead
50
dnl of those above. If you wish to allow use of your version of this file only
51
dnl under the terms of either the GPL or the LGPL, and not to allow others to
52
dnl use your version of this file under the terms of the MPL, indicate your
53
dnl decision by deleting the provisions above and replace them with the notice
54
dnl and other provisions required by the GPL or the LGPL. If you do not delete
55
dnl the provisions above, a recipient may use your version of this file under
56
dnl the terms of any one of the MPL, the GPL or the LGPL.
58
dnl ***** END LICENSE BLOCK *****
60
dnl Process this file with autoconf to produce a configure script.
61
dnl ========================================================
64
AC_INIT(config/config.mk)
65
AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
67
TARGET_CPU="${target_cpu}"
68
TARGET_VENDOR="${target_vendor}"
69
TARGET_OS="${target_os}"
72
MOZ_DEB_TIMESTAMP=`date +"%a, %d %b %Y %T %z" 2>&1`
73
AC_SUBST(MOZ_DEB_TIMESTAMP)
76
dnl ========================================================
78
dnl = Don't change the following two lines. Doing so breaks:
80
dnl = CFLAGS="-foo" ./configure
82
dnl ========================================================
84
CPPFLAGS="${CPPFLAGS=}"
85
CXXFLAGS="${CXXFLAGS=}"
87
HOST_CFLAGS="${HOST_CFLAGS=}"
88
HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
89
HOST_LDFLAGS="${HOST_LDFLAGS=}"
91
dnl ========================================================
92
dnl = Preserve certain environment flags passed to configure
93
dnl = We want sub projects to receive the same flags
94
dnl = untainted by this configure script
95
dnl ========================================================
98
_SUBDIR_CFLAGS="$CFLAGS"
99
_SUBDIR_CPPFLAGS="$CPPFLAGS"
100
_SUBDIR_CXXFLAGS="$CXXFLAGS"
101
_SUBDIR_LDFLAGS="$LDFLAGS"
102
_SUBDIR_HOST_CC="$HOST_CC"
103
_SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
104
_SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
105
_SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
106
_SUBDIR_CONFIG_ARGS="$ac_configure_args"
108
dnl Set the version number of the libs included with mozilla
109
dnl ========================================================
116
dnl Set the minimum version of toolkit libs used by mozilla
117
dnl ========================================================
125
WINDRES_VERSION=2.14.90
128
GNOMEUI_VERSION=2.2.0
131
STARTUP_NOTIFICATION_VERSION=0.8
133
SQLITE_VERSION=3.6.16.1
134
LIBNOTIFY_VERSION=0.4
138
dnl Set various checks
139
dnl ========================================================
143
dnl Initialize the Pthread test variables early so they can be
144
dnl overridden by each platform.
145
dnl ========================================================
149
dnl Do not allow a separate objdir build if a srcdir build exists.
150
dnl ==============================================================
151
_topsrcdir=`cd \`dirname $0\`; pwd`
154
if test "$_topsrcdir" != "$_objdir"
156
# Check for a couple representative files in the source tree
158
for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
159
if test -f $file; then
160
_conflict_files="$_conflict_files $file"
163
if test "$_conflict_files"; then
165
echo "* Your source tree contains these files:"
166
for file in $_conflict_files; do
170
* This indicates that you previously built in the source tree.
171
* A source tree build can confuse the separate objdir build.
173
* To clean up the source tree:
184
dnl Default to MSVC for win32
185
dnl ==============================================================
186
if test -z "$CROSS_COMPILE"; then
188
*-cygwin*|*-mingw*|*-msvc*|*-mks*)
189
if test -z "$CC"; then CC=cl; fi
190
if test -z "$CXX"; then CXX=cl; fi
191
if test -z "$CPP"; then CPP="cl -E -nologo"; fi
192
if test -z "$CXXCPP"; then CXXCPP="cl -TP -E -nologo"; ac_cv_prog_CXXCPP="$CXXCPP"; fi
193
if test -z "$LD"; then LD=link; fi
194
if test -z "$AS"; then AS=ml; fi
195
if test -z "$MIDL"; then MIDL=midl; fi
200
COMPILE_ENVIRONMENT=1
201
MOZ_ARG_ENABLE_BOOL(compile-environment,
202
[ --disable-compile-environment
203
Disable compiler/library checks.],
204
COMPILE_ENVIRONMENT=1,
205
COMPILE_ENVIRONMENT= )
206
AC_SUBST(COMPILE_ENVIRONMENT)
208
MOZ_ARG_WITH_STRING(l10n-base,
209
[ --with-l10n-base=DIR path to l10n repositories],
210
L10NBASEDIR=$withval)
211
if test ! -z "$L10NBASEDIR"; then
212
if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
213
AC_MSG_ERROR([--with-l10n-base must specify a path])
214
elif test -d "$L10NBASEDIR"; then
215
L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
217
AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
220
AC_SUBST(L10NBASEDIR)
222
dnl Check for Perl first -- needed for win32 SDK checks
223
MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
224
if test -z "$PERL" || test "$PERL" = ":"; then
225
AC_MSG_ERROR([perl not found in \$PATH])
228
dnl ========================================================
229
dnl Checks for compilers.
230
dnl ========================================================
231
dnl Set CROSS_COMPILE in the environment when running configure
232
dnl to use the cross-compile setup for now
233
dnl ========================================================
235
if test "$COMPILE_ENVIRONMENT"; then
237
dnl Do some special WinCE toolchain stuff
241
MOZ_ARG_WITH_STRING(wince-sdk,
242
[ --with-wince-sdk=WINCE_SDK_DIR
243
The path to the Windows CE SDK],
244
WINCE_SDK_DIR=$withval)
246
MOZ_ARG_WITH_STRING(ogles-sdk,
247
[ --with-ogles-sdk=OGLES_SDK_DIR
248
The path to the OGLES SDK],
249
OGLES_SDK_DIR=$withval)
251
dnl Default to Windows Mobile components enabled
252
WINCE_WINDOWS_MOBILE=1
254
MOZ_ARG_DISABLE_BOOL(windows-mobile-components,
255
[ --disable-windows-mobile-components
256
Disable Windows Mobile specific components from CE build],
257
WINCE_WINDOWS_MOBILE=,
258
WINCE_WINDOWS_MOBILE=1)
260
if test "$WINCE_WINDOWS_MOBILE"; then
261
AC_DEFINE(WINCE_WINDOWS_MOBILE)
268
echo -----------------------------------------------------------------------------
269
echo Building Windows CE Shunt Library and Tool Chain
276
_topsrcdirwin=`cd \`dirname $0\`; pwd -W`
277
make OGLES_SDK_DIR="$OGLES_SDK_DIR" WINCE_SDK_DIR="$WINCE_SDK_DIR" TOPSRCDIR="$_topsrcdirwin" OBJDIR="$_pwd" -C $srcdir/build/wince/tools
279
CC="$_pwd/dist/sdk/bin/arm-wince-gcc.exe"
280
CXX="$_pwd/dist/sdk/bin/arm-wince-gcc.exe"
281
CPP="$_pwd/dist/sdk/bin/arm-wince-gcc.exe -E -nologo"
282
CXXCPP="$_pwd/dist/sdk/bin/arm-wince-gcc.exe -TP -E -nologo"
283
LD="$_pwd/dist/sdk/bin/arm-wince-link.exe"
284
AR="$_pwd/dist/sdk/bin/arm-wince-lib.exe"
285
AS="$_pwd/dist/sdk/bin/arm-wince-as.exe"
286
RC="$_pwd/dist/sdk/bin/arm-wince-res.exe"
289
echo -----------------------------------------------------------------------------
294
if test -n "$CROSS_COMPILE" && test "$target" != "$host"; then
295
echo "cross compiling from $host to $target"
299
_SAVE_CFLAGS="$CFLAGS"
300
_SAVE_LDFLAGS="$LDFLAGS"
302
AC_MSG_CHECKING([for host c compiler])
303
AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
304
if test -z "$HOST_CC"; then
305
AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
307
AC_MSG_RESULT([$HOST_CC])
308
AC_MSG_CHECKING([for host c++ compiler])
309
AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
310
if test -z "$HOST_CXX"; then
311
AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
313
AC_MSG_RESULT([$HOST_CXX])
315
if test -z "$HOST_CFLAGS"; then
316
HOST_CFLAGS="$CFLAGS"
318
if test -z "$HOST_CXXFLAGS"; then
319
HOST_CXXFLAGS="$CXXFLAGS"
321
if test -z "$HOST_LDFLAGS"; then
322
HOST_LDFLAGS="$LDFLAGS"
324
AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
325
AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
327
CFLAGS="$HOST_CFLAGS"
328
LDFLAGS="$HOST_LDFLAGS"
330
AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
331
AC_TRY_COMPILE([], [return(0);],
332
[ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
333
AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
336
CFLAGS="$HOST_CXXFLAGS"
338
AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
339
AC_TRY_COMPILE([], [return(0);],
340
[ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
341
AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
345
LDFLAGS=$_SAVE_LDFLAGS
347
case "$build:$target" in
348
powerpc-apple-darwin8*:i?86-apple-darwin*)
349
dnl The Darwin cross compiler doesn't necessarily point itself at a
350
dnl root that has libraries for the proper architecture, it defaults
351
dnl to the system root. The libraries in the system root on current
352
dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
353
dnl checks will fail. Fake a working SDK in that case.
355
_SAVE_CXXFLAGS=$CXXLAGS
356
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
357
CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
361
AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
364
AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
368
case "$build:$target" in
369
powerpc-apple-darwin8*:i?86-apple-darwin*)
370
dnl Revert the changes made above. From this point on, the target
371
dnl compiler will never be used without applying the SDK to CFLAGS
372
dnl (see --with-macos-sdk below).
374
CXXFLAGS=$_SAVE_CXXFLAGS
378
AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
379
AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
380
MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
381
AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
382
AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
383
AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
384
AC_DEFINE(CROSS_COMPILE)
389
MOZ_PATH_PROGS(AS, $AS as, $CC)
390
AC_CHECK_PROGS(AR, ar, :)
391
AC_CHECK_PROGS(LD, ld, :)
392
AC_CHECK_PROGS(STRIP, strip, :)
393
AC_CHECK_PROGS(WINDRES, windres, :)
394
if test -z "$HOST_CC"; then
397
if test -z "$HOST_CFLAGS"; then
398
HOST_CFLAGS="$CFLAGS"
400
if test -z "$HOST_CXX"; then
403
if test -z "$HOST_CXXFLAGS"; then
404
HOST_CXXFLAGS="$CXXFLAGS"
406
if test -z "$HOST_LDFLAGS"; then
407
HOST_LDFLAGS="$LDFLAGS"
409
if test -z "$HOST_RANLIB"; then
410
HOST_RANLIB="$RANLIB"
412
if test -z "$HOST_AR"; then
423
if test "$GCC" = "yes"; then
425
CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
427
if test "$GXX" = "yes"; then
429
CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
431
if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
434
if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
437
if test "$GNU_CC"; then
438
if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
445
if test "$GCC" = yes; then
446
if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
451
if test "$GXX" = yes; then
452
if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
457
dnl Special win32 checks
458
dnl ========================================================
464
if test -n "$GNU_CC"; then
472
dnl Target the Windows 7 SDK by default
475
MOZ_ARG_WITH_STRING(windows-version,
476
[ --with-windows-version=WINSDK_TARGETVER
477
Highest Windows version to target using this SDK
478
502: Windows Server 2003
481
WINSDK_TARGETVER=$withval)
483
case "$WINSDK_TARGETVER" in
485
MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
489
AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]);
494
dnl Vista SDK specific api (deprecated)
495
MOZ_ARG_DISABLE_BOOL(vista-sdk-requirements,
496
[ --disable-vista-sdk-requirements
497
Do not build Vista SDK specific code],
498
MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1,
499
MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=)
500
if test -n "$COMPILE_ENVIRONMENT"; then
501
if test -n "$MOZ_DISABLE_VISTA_SDK_REQUIREMENTS"; then
502
AC_MSG_WARN([--disable-vista-sdk-requirements is deprecated, use --with-windows-version=502 instead])
503
MOZ_WINSDK_TARGETVER=05020000
506
if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
507
MOZ_DISABLE_VISTA_SDK_REQUIREMENTS=1
508
AC_DEFINE(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
509
# We can't build parental controls either
510
MOZ_DISABLE_PARENTAL_CONTROLS=1
514
AC_SUBST(MOZ_DISABLE_VISTA_SDK_REQUIREMENTS)
517
*-cygwin*|*-mingw*|*-msvc*|*-mks*|*-wince)
518
if test "$GCC" != "yes"; then
519
# Check to see if we are really running in a msvc environemnt
521
AC_CHECK_PROGS(MIDL, midl)
523
# Make sure compilers are valid
524
CFLAGS="$CFLAGS -TC -nologo"
525
CXXFLAGS="$CXXFLAGS -TP -nologo"
528
AC_TRY_COMPILE([#include <stdio.h>],
529
[ printf("Hello World\n"); ],,
530
AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
533
AC_TRY_COMPILE([#include <new.h>],
534
[ unsigned *test = new unsigned(42); ],,
535
AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
539
_MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
542
# Determine compiler version
543
CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
544
_CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
545
_CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
546
_CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
547
_CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
548
_MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
550
CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
551
_CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
553
if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
554
AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
556
if test "$_CC_MAJOR_VERSION" = "13"; then
558
elif test "$_CC_MAJOR_VERSION" = "14"; then
560
CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
561
dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
562
dnl so be very specific here!
563
dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
564
if test $_CC_RELEASE -gt 50727; then
566
elif test $_CC_BUILD -ge 762; then
569
AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
570
AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
571
elif test "$_CC_MAJOR_VERSION" = "15"; then
573
CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
574
LDFLAGS="$LDFLAGS -MANIFESTUAC:NO"
576
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
577
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
579
AC_MSG_ERROR([This version of the MSVC compiler, $CC_VERSION , is unsupported.])
582
_MOZ_RTTI_FLAGS_ON='-GR'
583
_MOZ_RTTI_FLAGS_OFF='-GR-'
584
_MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
585
_MOZ_EXCEPTIONS_FLAGS_OFF=''
587
if test -n "$WIN32_REDIST_DIR"; then
588
WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
592
# ensure that mt.exe is Microsoft (R) Manifest Tool and not magnetic tape manipulation utility (or something else)
593
if test "$_CC_SUITE" -ge "8"; then
595
_MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
598
MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
599
if test -n "$MSMT_TOOL"; then
600
MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
601
if test -z "$MSMANIFEST_TOOL_VERSION"; then
602
AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
607
AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
611
# Check linker version
612
_LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
613
_LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
614
if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
615
AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
620
_MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
621
_MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
622
_MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
623
_MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
624
# Add flags if necessary
625
AC_MSG_CHECKING([for midl flags])
628
if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
629
# MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
630
# MIDL version 7.00.0500 or later has no problem.
631
MIDL_FLAGS="${MIDL_FLAGS} -env win32"
632
AC_MSG_RESULT([need -env win32])
634
AC_MSG_RESULT([none needed])
638
AC_MSG_RESULT([none needed])
642
# Identify which version of the SDK we're building with
643
# Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
645
AC_CHECK_HEADERS([winsdkver.h])
646
if test "$ac_cv_header_winsdkver_h" = "yes"; then
647
# Get the highest _WIN32_WINNT and NTDDI versions supported
648
# Take the higher of the two
649
# This is done because the Windows 7 beta SDK reports its
650
# NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
651
AC_CACHE_CHECK(for highest Windows version supported by this SDK,
653
[cat > conftest.h <<EOF
654
#include <winsdkver.h>
655
#include <sdkddkver.h>
657
#if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
658
#define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
660
#define WINSDK_MAXVER NTDDI_MAXVER
665
ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
668
MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
670
# The Vista SDK is the only one to have sdkddkver.h but not
672
AC_CHECK_HEADERS([sdkddkver.h])
673
if test "$ac_cv_header_sdkddkver_h" = "yes"; then
674
MOZ_WINSDK_MAXVER=0x06000000
676
# Assume the Server 2003 Platform SDK
677
MOZ_WINSDK_MAXVER=0x05020000
681
unset _MSVC_VER_FILTER
684
# Check w32api version
685
_W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
686
_W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
687
AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
688
AC_TRY_COMPILE([#include <w32api.h>],
689
#if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
690
(__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
691
__W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
692
#error "test failed."
694
, [ res=yes ], [ res=no ])
695
AC_MSG_RESULT([$res])
696
if test "$res" != "yes"; then
697
AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
699
# Check windres version
700
AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
701
_WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
702
AC_MSG_RESULT([$_WINDRES_VERSION])
703
_WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
704
_WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
705
_WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
706
WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
707
WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
708
WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
709
if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
710
"$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
711
"$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
712
"$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
713
"$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
714
"$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
716
AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
719
# Server 2003 is the highest version supported
720
MOZ_WINSDK_MAXVER=0x05020000
723
AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
724
AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
725
# Require OS features provided by IE 5.0
726
AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
728
# If the maximum version supported by this SDK is lower than the target
730
AC_MSG_CHECKING([for Windows SDK being recent enough])
731
if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
735
AC_MSG_ERROR([You are targeting Windows version 0x$MOZ_WINSDK_TARGETVER, but your SDK only supports up to version $MOZ_WINSDK_MAXVER. Install and use an updated SDK, or target a lower version using --with-windows-version. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
738
AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
739
# Definitions matching sdkddkver.h
740
AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
741
AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
742
AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
746
dnl Test breaks icc on OS/2 && MSVC
747
if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
749
if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
753
CC="${srcdir}/build/hcc '$CC'"
754
CXX="${srcdir}/build/hcpp '$CXX'"
761
if test -n "$_WIN32_MSVC"; then
763
SKIP_COMPILER_CHECKS=1
764
SKIP_LIBRARY_CHECKS=1
766
# Since we're skipping compiler and library checks, hard-code
773
AC_DEFINE(HAVE_SETBUF)
774
AC_DEFINE(HAVE_ISATTY)
779
fi # COMPILE_ENVIRONMENT
791
dnl ========================================================
792
dnl Checks for programs.
793
dnl ========================================================
797
if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
798
AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
799
_perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
801
AC_MSG_RESULT([$_perl_version])
803
if test "$_perl_res" != 0; then
804
AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
808
AC_MSG_CHECKING([for full perl installation])
809
_perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
811
if test "$_perl_res" != 0; then
813
AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
818
MOZ_PATH_PROGS(PYTHON, $PYTHON python2.5 python2.4 python)
819
if test -z "$PYTHON"; then
820
AC_MSG_ERROR([python was not found in \$PATH])
823
if test -z "$COMPILE_ENVIRONMENT"; then
824
NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
826
AC_SUBST(NSINSTALL_BIN)
828
MOZ_PATH_PROG(DOXYGEN, doxygen, :)
829
MOZ_PATH_PROG(WHOAMI, whoami, :)
830
MOZ_PATH_PROG(AUTOCONF, autoconf, :)
831
MOZ_PATH_PROG(UNZIP, unzip, :)
832
MOZ_PATH_PROGS(ZIP, zip)
833
if test -z "$ZIP" || test "$ZIP" = ":"; then
834
AC_MSG_ERROR([zip not found in \$PATH])
836
MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
837
MOZ_PATH_PROG(XARGS, xargs)
838
if test -z "$XARGS" || test "$XARGS" = ":"; then
839
AC_MSG_ERROR([xargs not found in \$PATH .])
842
if test "$COMPILE_ENVIRONMENT"; then
844
dnl ========================================================
845
dnl = Mac OS X toolchain support
846
dnl ========================================================
850
dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
851
dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
852
dnl the environment and includedir purposes (when using an SDK, below),
853
dnl but remember the full version number for the libdir (SDK).
855
GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
856
GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
858
if test "$GCC_VERSION_FULL" = "4.0.0" ; then
859
dnl Bug 280479, but this keeps popping up in bug 292530 too because
860
dnl 4.0.0/4061 is the default compiler in Tiger.
862
GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
864
if test "$GCC_BUILD" = "4061" ; then
865
AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
866
This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
867
from building Mozilla. Upgrade to Xcode 2.1 or later.])
871
dnl xcodebuild needs GCC_VERSION defined in the environment, since it
872
dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
873
dnl /usr/bin/g(cc|++)-$GCC_VERSION.
874
MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
879
XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
881
if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
887
dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
888
dnl it has moved into /usr/bin.
889
MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
893
AC_SUBST(GCC_VERSION)
894
AC_SUBST(XCODEBUILD_VERSION)
895
AC_SUBST(HAS_XCODE_2_1)
897
dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
898
dnl that a universal binary is being produced.
899
AC_SUBST(UNIVERSAL_BINARY)
901
dnl ========================================================
902
dnl Check for MacOS deployment target version
903
dnl ========================================================
905
MOZ_ARG_ENABLE_STRING(macos-target,
906
[ --enable-macos-target=VER (default=10.4)
907
Set the minimum MacOS version needed at runtime],
908
[_MACOSX_DEPLOYMENT_TARGET=$enableval])
912
if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
913
dnl Use the specified value
914
export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
915
AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
916
elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
917
dnl No value specified on the command line or in the environment,
918
dnl use architecture minimum.
919
case "${target_cpu}" in
921
export MACOSX_DEPLOYMENT_TARGET=10.5
924
export MACOSX_DEPLOYMENT_TARGET=10.4
931
AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
933
dnl ========================================================
934
dnl = Mac OS X SDK support
935
dnl ========================================================
938
MOZ_ARG_WITH_STRING(macos-sdk,
939
[ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
940
MACOS_SDK_DIR=$withval)
942
dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
943
dnl NEXT_ROOT will be set and exported only if it's needed.
944
AC_SUBST(MACOS_SDK_DIR)
947
if test "$MACOS_SDK_DIR"; then
948
dnl Sync this section with the ones in NSPR and NSS.
949
dnl Changes to the cross environment here need to be accounted for in
950
dnl the libIDL checks (below) and xpidl build.
952
if test ! -d "$MACOS_SDK_DIR"; then
953
AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
954
specify a valid SDK. SDKs are installed when the optional cross-development
955
tools are selected during the Xcode/Developer Tools installation.])
958
GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
959
if test "$GCC_VERSION_MAJOR" -lt "4" ; then
960
AC_MSG_ERROR([You need to upgrade the compiler version to 4.x])
962
CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
963
CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
965
dnl CPP/CXXCPP needs to be set for AC_CHECK_HEADER.
966
CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
967
CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
969
if test "$GCC_VERSION_FULL" = "4.0.0" ; then
970
dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
971
dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
972
dnl be ignored and cause warnings when -syslibroot is specified.
973
dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
974
dnl the -isysroot it receives, so this is only needed with 4.0.0.
975
LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
980
AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
982
AC_TRY_COMPILE([#include <new>
983
int main() { return 0; }],
987
AC_MSG_RESULT($result)
989
if test "$result" = "no" ; then
990
AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
994
fi # COMPILE_ENVIRONMENT
996
dnl Be sure the make we use is GNU make.
997
dnl on win32, gmake.exe is the generally the wrong version
998
if test -n "$MAKE"; then
999
if test `echo $MAKE | grep -c make.py` != 1; then
1005
cygwin*|mingw*|mks*|msvc*)
1006
MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
1009
MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
1012
if test "$GMAKE" = ":"; then
1013
AC_MSG_ERROR([GNU make not found])
1017
if test "$COMPILE_ENVIRONMENT"; then
1021
dnl Check in X11 include directory too.
1022
if test "$no_x" != "yes"; then
1023
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
1028
fi # COMPILE_ENVIRONMENT
1030
dnl ========================================================
1031
dnl set the defaults first
1032
dnl ========================================================
1036
AR_EXTRACT='$(AR) x'
1051
MOZ_USER_DIR=".mozilla"
1053
HOST_AR_FLAGS='$(AR_FLAGS)'
1056
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
1058
MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
1060
MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1062
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
1064
MOZ_JS_LIBS='-L$(LIBXUL_DIST)/bin -lmozjs'
1065
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core'
1066
MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1067
XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom'
1068
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1069
XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1070
XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1074
MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1075
MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
1077
USE_DEPENDENT_LIBS=1
1079
_PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1080
MOZ_GFX_TOOLKIT='$(MOZ_WIDGET_TOOLKIT)'
1082
MOZ_ENABLE_POSTSCRIPT=1
1084
if test -n "$CROSS_COMPILE"; then
1085
OS_TARGET="${target_os}"
1086
OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1088
case "${target_os}" in
1089
linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1090
kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1091
solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1092
mingw*) OS_ARCH=WINNT ;;
1093
wince*) OS_ARCH=WINCE ;;
1094
darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1097
OS_TARGET=`uname -s`
1098
OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1099
OS_RELEASE=`uname -r`
1102
# Before this used `uname -m` when not cross compiling
1103
# but that breaks when you have a 64 bit kernel with a 32 bit userland.
1104
OS_TEST="${target_cpu}"
1108
HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1110
#######################################################################
1111
# Master "Core Components" macros for getting the OS target #
1112
#######################################################################
1115
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1116
# cross-compilation.
1120
# Define and override various archtecture-specific variables, including
1129
case "$HOST_OS_ARCH" in
1130
cygwin*|mingw*|mks*|msvc*)
1140
if test -z "$GNU_CC"; then
1141
if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1146
if test -z "$GNU_CXX"; then
1147
if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1148
SOLARIS_SUNPRO_CXX=1
1151
AC_SUBST(SOLARIS_SUNPRO_CC)
1152
AC_SUBST(SOLARIS_SUNPRO_CXX)
1164
if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1167
HOST_OS_ARCH=UNIXWARE
1179
HOST_OS_ARCH=OpenVMS
1189
SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1193
HOST_OS_ARCH=UNIXWARE
1203
# If uname -s returns "Windows_NT", we assume that we are using
1204
# the uname.exe in MKS toolkit.
1206
# The -r option of MKS uname only returns the major version number.
1207
# So we need to use its -v option to get the minor version number.
1208
# Moreover, it doesn't have the -p option, so we need to use uname -m.
1212
OS_MINOR_RELEASE=`uname -v`
1213
if test "$OS_MINOR_RELEASE" = "00"; then
1216
OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1218
CYGWIN32_NT|CYGWIN_NT*|MINGW*_NT*)
1220
# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
1221
# the uname.exe in the Cygwin tools.
1222
# Prior to the Beta 20 release, Cygwin was called GNU-Win32.
1223
# If uname -s returns "CYGWIN32/NT", we assume that we are using
1224
# the uname.exe in the GNU-Win32 tools.
1225
# If uname -s returns MINGW32_NT-5.1, we assume that we are using
1226
# the uname.exe in the MSYS tools.
1228
OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1233
OS_RELEASE=`uname -v`.`uname -r`
1234
OS_TEST=${target_cpu}
1246
if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1250
OS_RELEASE=`uname -v`
1274
OS_RELEASE=`uname -v`
1280
OS_RELEASE=`uname -v`
1283
if test "$OS_TARGET" != "NTO"; then
1285
OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1294
SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1300
OS_RELEASE=`uname -v`
1307
case "${target_cpu}" in
1318
if test -z "$CROSS_COMPILE" ; then
1326
if test "$OS_ARCH" = "NCR"; then
1328
OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1332
# Only set CPU_ARCH if we recognize the value of OS_TEST
1343
powerpc | ppc | rs6000)
1347
Alpha | alpha | ALPHA)
1372
if test "$OS_TARGET" = "WINCE"; then
1378
if test -z "$OS_TARGET"; then
1381
OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1383
dnl ========================================================
1384
dnl GNU specific defaults
1385
dnl ========================================================
1386
if test "$GNU_CC"; then
1387
# FIXME: Let us build with strict aliasing. bug 414641.
1388
CFLAGS="$CFLAGS -fno-strict-aliasing"
1389
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1390
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1391
DSO_LDOPTS='-shared'
1392
if test "$GCC_USE_GNU_LD"; then
1393
# Don't allow undefined symbols in libraries
1394
DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1396
WARNINGS_AS_ERRORS='-Werror'
1398
DSO_PIC_CFLAGS='-fPIC'
1399
ASFLAGS="$ASFLAGS -fPIC"
1400
_MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1401
_MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1402
_MOZ_EXCEPTIONS_FLAGS_ON='-fhandle-exceptions'
1403
_MOZ_EXCEPTIONS_FLAGS_OFF='-fno-handle-exceptions'
1405
# Turn on GNU specific features
1406
# -Wall - turn on all warnings
1407
# -pedantic - make compiler warn about non-ANSI stuff, and
1408
# be a little bit stricter
1409
# Warnings slamm took out for now (these were giving more noise than help):
1410
# -Wbad-function-cast - warns when casting a function to a new return type
1411
# -Wshadow - removed because it generates more noise than help --pete
1412
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1413
if test -z "$INTEL_CC"; then
1414
# Don't use -Wcast-align with ICC
1416
# And don't use it on hppa, ia64, sparc, since it's noisy there
1417
hppa | ia64 | sparc)
1420
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1425
dnl Turn pedantic on but disable the warnings for long long
1428
if test -z "$INTEL_CC"; then
1429
_IGNORE_LONG_LONG_WARNINGS=1
1430
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1432
_IGNORE_LONG_LONG_WARNINGS=
1436
_DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1437
_USE_CPP_INCLUDE_FLAG=1
1438
elif test "$SOLARIS_SUNPRO_CC"; then
1439
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1440
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1442
DSO_LDOPTS='-shared'
1443
if test "$GNU_LD"; then
1444
# Don't allow undefined symbols in libraries
1445
DSO_LDOPTS="$DSO_LDOPTS -z defs"
1449
if test "$CPU_ARCH" = "sparc"; then
1450
# for Sun Studio on Solaris/SPARC
1451
DSO_PIC_CFLAGS='-xcode=pic32'
1453
DSO_PIC_CFLAGS='-KPIC'
1455
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1457
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1458
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1460
DSO_LDOPTS='-shared'
1461
if test "$GNU_LD"; then
1462
# Don't allow undefined symbols in libraries
1463
DSO_LDOPTS="$DSO_LDOPTS -z defs"
1467
DSO_PIC_CFLAGS='-KPIC'
1468
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1471
if test "$GNU_CXX"; then
1472
# FIXME: Let us build with strict aliasing. bug 414641.
1473
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1474
# Turn on GNU specific features
1475
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1476
if test -z "$INTEL_CC"; then
1477
# Don't use -Wcast-align with ICC
1479
# And don't use it on hppa, ia64, sparc, since it's noisy there
1480
hppa | ia64 | sparc)
1483
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1488
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1489
_USE_CPP_INCLUDE_FLAG=1
1491
AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1492
ac_has_wno_invalid_offsetof,
1496
_SAVE_CXXFLAGS="$CXXFLAGS"
1497
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1500
ac_has_wno_invalid_offsetof="yes",
1501
ac_has_wno_invalid_offsetof="no")
1502
CXXFLAGS="$_SAVE_CXXFLAGS"
1505
if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1506
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1509
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1512
dnl gcc can come with its own linker so it is better to use the pass-thru calls
1513
dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1514
dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1515
dnl normal behavior.
1516
dnl ========================================================
1518
MKSHLIB_UNFORCE_ALL=
1520
if test "$COMPILE_ENVIRONMENT"; then
1521
if test "$GNU_CC"; then
1522
AC_MSG_CHECKING(whether ld has archive extraction flags)
1523
AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1524
[_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1525
ac_cv_mkshlib_force_and_unforce="no"
1526
exec 3<&0 <<LOOP_INPUT
1527
force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1528
force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1529
force="-Wl,-all"; unforce="-Wl,-none"
1536
AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1539
LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1541
if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1545
eval $ac_cv_mkshlib_force_and_unforce
1546
MKSHLIB_FORCE_ALL=$force
1547
MKSHLIB_UNFORCE_ALL=$unforce
1550
fi # COMPILE_ENVIRONMENT
1552
dnl =================================================================
1553
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1554
dnl which is bad when cross compiling.
1555
dnl =================================================================
1556
if test "$COMPILE_ENVIRONMENT"; then
1557
configure_static_assert_macros='
1558
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1559
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1560
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1563
dnl test that the macros actually work:
1564
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1565
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1568
ac_cv_static_assertion_macros_work="yes"
1569
AC_TRY_COMPILE([$configure_static_assert_macros],
1570
[CONFIGURE_STATIC_ASSERT(1)],
1572
ac_cv_static_assertion_macros_work="no")
1573
AC_TRY_COMPILE([$configure_static_assert_macros],
1574
[CONFIGURE_STATIC_ASSERT(0)],
1575
ac_cv_static_assertion_macros_work="no",
1578
AC_TRY_COMPILE([$configure_static_assert_macros],
1579
[CONFIGURE_STATIC_ASSERT(1)],
1581
ac_cv_static_assertion_macros_work="no")
1582
AC_TRY_COMPILE([$configure_static_assert_macros],
1583
[CONFIGURE_STATIC_ASSERT(0)],
1584
ac_cv_static_assertion_macros_work="no",
1588
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1589
if test "$ac_cv_static_assertion_macros_work" = "no"; then
1590
AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1592
fi # COMPILE_ENVIRONMENT
1594
dnl ========================================================
1595
dnl Checking for 64-bit OS
1596
dnl ========================================================
1597
if test "$COMPILE_ENVIRONMENT"; then
1600
AC_MSG_CHECKING(for 64-bit OS)
1601
AC_TRY_COMPILE([$configure_static_assert_macros],
1602
[CONFIGURE_STATIC_ASSERT(sizeof(long) == 8)],
1603
result="yes", result="no")
1604
AC_MSG_RESULT("$result")
1605
if test "$result" = "yes"; then
1606
AC_DEFINE(HAVE_64BIT_OS)
1609
AC_SUBST(HAVE_64BIT_OS)
1611
fi # COMPILE_ENVIRONMENT
1613
dnl ========================================================
1614
dnl Enable high-memory support on OS/2 by default.
1615
dnl ========================================================
1616
MOZ_OS2_HIGH_MEMORY=1
1617
MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1618
[ --disable-os2-high-mem Disable high-memory support on OS/2],
1619
MOZ_OS2_HIGH_MEMORY=,
1620
MOZ_OS2_HIGH_MEMORY=1 )
1621
AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1623
dnl ========================================================
1624
dnl System overrides of the defaults for host
1625
dnl ========================================================
1628
HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE -DNO_X11"
1629
HOST_NSPR_MDCPUCFG='\"md/_beos.cfg\"'
1630
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1633
*cygwin*|*mingw*|*mks*|*msvc*|*wince)
1634
# we need Python 2.5 on Windows
1636
if test -n "$_WIN32_MSVC"; then
1638
HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1639
HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1640
HOST_RANLIB='echo ranlib'
1642
HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1644
HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11"
1645
HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1646
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1647
HOST_BIN_SUFFIX=.exe
1650
dnl MinGW/MSYS does not need CYGWIN_WRAPPER
1653
CYGWIN_WRAPPER="${srcdir}/build/cygwin-wrapper"
1654
if test "`echo ${srcdir} | grep -c ^/ 2>/dev/null`" = 0; then
1656
CYGWIN_WRAPPER="${_pwd}/${srcdir}/build/cygwin-wrapper"
1658
if test "`${PERL} -v | grep -c cygwin 2>/dev/null`" = 0; then
1660
PERL="${CYGWIN_WRAPPER} $PERL"
1663
if test "`${PYTHON} -c 'import sys; print sys.platform;'`" != "cygwin"; then
1664
PYTHON="${CYGWIN_WRAPPER} $PYTHON"
1671
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1672
HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1673
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1674
MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1677
*-linux*|*-kfreebsd*-gnu)
1678
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1679
HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1680
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1684
HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1685
HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1686
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1687
HOST_BIN_SUFFIX=.exe
1692
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1693
HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1694
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1698
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1699
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1703
dnl We require version 2.4 or newer of Python to build,
1704
dnl and 2.5 or newer on Windows.
1705
AC_MSG_CHECKING([for minimum required Python version >= $PYTHON_VERSION])
1707
$PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1])" $PYTHON_VERSION
1710
if test "$_python_res" != 0; then
1711
AC_MSG_ERROR([Python $PYTHON_VERSION or higher is required.])
1713
AC_MSG_RESULT([yes])
1715
dnl Get mozilla version from central milestone file
1716
MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1718
dnl Get version of various core apps from the version files.
1719
FIREFOX_VERSION=`cat $topsrcdir/browser/config/version.txt`
1721
AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1722
AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1724
dnl ========================================================
1725
dnl System overrides of the defaults for target
1726
dnl ========================================================
1731
if test ! "$GNU_CC"; then
1732
if test ! "$HAVE_64BIT_OS"; then
1733
# Compiling with Visual Age C++ object model compat is the
1734
# default. To compile with object model ibm, add
1735
# AIX_OBJMODEL=ibm to .mozconfig.
1736
if test "$AIX_OBJMODEL" = "ibm"; then
1737
CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1744
AC_SUBST(AIX_OBJMODEL)
1745
DSO_LDOPTS='-qmkshrobj=1'
1746
DSO_CFLAGS='-qflag=w:w'
1748
LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1749
AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS till we can fix bug 332075.])
1751
MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1752
MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1753
if test "$COMPILE_ENVIRONMENT"; then
1756
AC_MSG_CHECKING([for VisualAge C++ compiler version >= 6.0.0.3])
1758
[#if (__IBMCPP__ < 600)
1759
#error "Bad compiler"
1761
_BAD_COMPILER=,_BAD_COMPILER=1)
1762
if test -n "$_BAD_COMPILER"; then
1764
AC_MSG_ERROR([VisualAge C++ version 6.0.0.3 or higher is required to build.])
1766
AC_MSG_RESULT([yes])
1769
TARGET_COMPILER_ABI="ibmc"
1770
CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1771
CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1774
case "${target_os}" in
1779
if test "$COMPILE_ENVIRONMENT"; then
1780
AC_CHECK_HEADERS(sys/inttypes.h)
1782
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1787
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1788
_PLATFORM_DEFAULT_TOOLKIT="cairo-beos"
1789
DSO_LDOPTS='-nostart'
1790
TK_LIBS='-lbe -lroot'
1792
if test "$COMPILE_ENVIRONMENT"; then
1793
AC_CHECK_LIB(bind,main,LIBS="$LIBS -lbind")
1794
AC_CHECK_LIB(zeta,main,LIBS="$LIBS -lzeta")
1796
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-multichar"
1797
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-multichar"
1800
MOZ_USER_DIR="Mozilla"
1804
dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1806
_IGNORE_LONG_LONG_WARNINGS=
1814
_WARNINGS_CFLAGS="-Wall"
1815
_WARNINGS_CXXFLAGS="-Wall"
1816
# The test above doesn't work properly, at least on 3.1.
1817
MKSHLIB_FORCE_ALL=''
1818
MKSHLIB_UNFORCE_ALL=''
1824
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1825
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1826
MOZ_OPTIMIZE_FLAGS="-O3"
1828
CFLAGS="$CFLAGS -fpascal-strings -fno-common"
1829
CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
1832
STRIP="$STRIP -x -S"
1833
_PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1834
MOZ_ENABLE_POSTSCRIPT=
1835
TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1836
# The ExceptionHandling framework is needed for Objective-C exception
1837
# logging code in nsObjCExceptions.h. Currently we only use that in debug
1839
MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
1841
dnl DTrace and -dead_strip don't interact well. See bug 403132.
1842
dnl ===================================================================
1843
if test "x$enable_dtrace" = "xyes"; then
1844
echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1846
dnl check for the presence of the -dead_strip linker flag
1847
AC_MSG_CHECKING([for -dead_strip option to ld])
1848
_SAVE_LDFLAGS=$LDFLAGS
1849
LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1850
AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1851
if test -n "$_HAVE_DEAD_STRIP" ; then
1852
AC_MSG_RESULT([yes])
1853
MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1858
LDFLAGS=$_SAVE_LDFLAGS
1863
if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
1864
DLL_SUFFIX=".so.1.0"
1865
DSO_LDOPTS="-shared"
1867
if test ! "$GNU_CC"; then
1868
DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
1870
# Can't have force w/o an unforce.
1871
# # Hack for FreeBSD 2.2
1872
# if test -z "$MKSHLIB_FORCE_ALL"; then
1873
# MKSHLIB_FORCE_ALL='-Wl,-Bforcearchive'
1874
# MKSHLIB_UNFORCE_ALL=''
1880
if test ! "$GNU_CC"; then
1881
DSO_LDOPTS='-b -Wl,+s'
1884
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
1885
MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
1886
CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
1888
DSO_LDOPTS='-b -E +s'
1889
MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1890
MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
1892
MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
1893
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1898
DSO_LDOPTS='-elf -shared'
1900
if test "$GNU_CC"; then
1901
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1902
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1903
MKSHLIB_FORCE_ALL='-Wl,-all'
1904
MKSHLIB_UNFORCE_ALL='-Wl,-none'
1905
CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1907
MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1908
MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
1909
MKSHLIB_FORCE_ALL='-all'
1910
MKSHLIB_UNFORCE_ALL='-none'
1916
dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
1917
dnl compile and link using -n32
1919
TARGET_COMPILER_ABI=n32
1920
DSO_LDOPTS='-elf -shared'
1921
MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1922
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1923
_MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
1924
_MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
1925
if test "$GNU_CC"; then
1926
MKSHLIB_FORCE_ALL='-Wl,-all'
1927
MKSHLIB_UNFORCE_ALL='-Wl,-none'
1928
_WARNINGS_CFLAGS="-Wall"
1929
_WARNINGS_CXXFLAGS="-Wall"
1930
CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
1932
MKSHLIB_FORCE_ALL='-all'
1933
MKSHLIB_UNFORCE_ALL='-none'
1939
CFLAGS="$CFLAGS -woff 3262 -G 4"
1940
CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
1941
if test -n "$USE_N32"; then
1942
ASFLAGS="$ASFLAGS -n32"
1943
CFLAGS="$CFLAGS -n32"
1944
CXXFLAGS="$CXXFLAGS -n32"
1945
LDFLAGS="$LDFLAGS -n32"
1947
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1948
AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
1951
if test -z "$GNU_CXX"; then
1957
# Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
1958
# Similarly for GNU_CXX and INTEL_CXX.
1959
if test "$INTEL_CC" || test "$INTEL_CXX"; then
1960
# -Os has been broken on Intel's C/C++ compilers for quite a
1961
# while; Intel recommends against using it.
1962
MOZ_OPTIMIZE_FLAGS="-O2"
1963
MOZ_DEBUG_FLAGS="-g -fno-inline"
1964
elif test "$GNU_CC" || test "$GNU_CXX"; then
1965
GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
1966
case $GCC_VERSION in
1968
# -Os is broken on gcc 4.1.x and 4.2.x, we need to tweak it to get good results.
1969
MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
1971
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions $MOZ_OPTIMIZE_SIZE_TWEAK"
1972
MOZ_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb,
1973
# and that combo is not yet good at
1974
# debugging inlined functions (even
1975
# when using DWARF2 as the debugging
1979
TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1983
case "${target_cpu}" in
1985
CFLAGS="$CFLAGS -mieee"
1986
CXXFLAGS="$CXXFLAGS -mieee"
1990
MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1
1993
MOZ_DEBUG_FLAGS="-g" # We want inlining
1999
TARGET_COMPILER_ABI=msvc
2000
MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2001
MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2003
AR_EXTRACT="$AR -extract"
2005
AR_FLAGS='-OUT:"$@"'
2007
if test "$AS_BIN"; then
2014
if test -z "$RC"; then
2017
# certain versions of cygwin's makedepend barf on the
2018
# #include <string> vs -I./dist/include/string issue so don't use it
2024
HOST_AR='lib -OUT:$@'
2025
HOST_RANLIB='echo ranlib'
2026
HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
2029
WARNINGS_AS_ERRORS='-WX'
2030
MOZ_OPTIMIZE_FLAGS='-Ox'
2031
AR_FLAGS='-NOLOGO -OUT:"$@"'
2033
CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2034
CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2037
DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
2038
DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2040
IMPORT_LIB_SUFFIX=lib
2042
LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2045
MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2046
MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2048
MKSHLIB_UNFORCE_ALL=
2049
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2050
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2051
MOZ_DEBUG_FLAGS='-Zi'
2052
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2054
MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2055
MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2057
RANLIB='echo not_ranlib'
2058
STRIP='echo not_strip'
2059
TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
2062
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2064
LIBIDL_CFLAGS="-I$MOZ_TOOLS_DIR/include ${GLIB_CFLAGS}"
2065
LIBIDL_LIBS="$MOZ_TOOLS_DIR/lib/libidl-0.6_s.lib $MOZ_TOOLS_DIR/lib/glib-1.2_s.lib"
2069
AC_DEFINE(HAVE_SNPRINTF)
2074
AC_DEFINE(HW_THREADS)
2075
AC_DEFINE(STDC_HEADERS)
2076
AC_DEFINE(NEW_H, <new>)
2077
AC_DEFINE(WIN32_LEAN_AND_MEAN)
2078
AC_DEFINE(HAVE_LOCALTIME_R)
2080
TARGET_MD_ARCH=win32
2081
_PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2084
MOZ_ENABLE_POSTSCRIPT=
2085
MOZ_USER_DIR="Mozilla"
2087
MOZ_GFX_OPTIMIZE_MOBILE=1
2089
# Sanity check for WINCE_WINDOWS_MOBILE
2090
# XXX disabled until we can fix the mobile tinderbox
2091
##if test "$WINCE_WINDOWS_MOBILE"; then
2092
## AC_CHECK_HEADER(tpcshell.h, [],
2093
## AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
2098
*-mingw*|*-cygwin*|*-msvc*|*-mks*)
2103
# certain versions of cygwin's makedepend barf on the
2104
# #include <string> vs -I./dist/include/string issue so don't use it
2106
if test -n "$GNU_CC"; then
2107
CC="$CC -mno-cygwin"
2108
CXX="$CXX -mno-cygwin"
2109
CPP="$CPP -mno-cygwin"
2110
CFLAGS="$CFLAGS -mms-bitfields"
2111
CXXFLAGS="$CXXFLAGS -mms-bitfields"
2112
DSO_LDOPTS='-shared'
2113
MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2114
MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2116
# Use temp file for windres (bug 213281)
2117
RCFLAGS='-O coff --use-temp-file'
2118
# mingw doesn't require kernel32, user32, and advapi32 explicitly
2119
LIBS="$LIBS -lgdi32 -lwinmm -lwsock32"
2120
MOZ_JS_LIBS='-L$(LIBXUL_DIST)/lib -ljs$(MOZ_BITS)$(VERSION_NUMBER)'
2122
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core'
2123
XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom'
2125
IMPORT_LIB_SUFFIX=dll.a
2127
TARGET_COMPILER_ABI=msvc
2131
AR='lib -NOLOGO -OUT:"$@"'
2133
RANLIB='echo not_ranlib'
2134
STRIP='echo not_strip'
2139
GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
2144
IMPORT_LIB_SUFFIX=lib
2145
MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2146
MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2148
MKSHLIB_UNFORCE_ALL=
2149
DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2150
CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2151
CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2152
LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2153
MOZ_DEBUG_FLAGS='-Zi'
2154
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2155
WARNINGS_AS_ERRORS='-WX'
2156
MOZ_OPTIMIZE_FLAGS='-O1'
2157
MOZ_JS_LIBS='$(LIBXUL_DIST)/lib/js$(MOZ_BITS)$(VERSION_NUMBER).lib'
2159
DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib'
2160
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib'
2161
LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2162
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2163
MOZ_XPCOM_OBSOLETE_LIBS='$(LIBXUL_DIST)/lib/xpcom_compat.lib'
2164
if test $_MSC_VER -ge 1400; then
2165
LDFLAGS="$LDFLAGS -NXCOMPAT -SAFESEH"
2166
dnl For profile-guided optimization
2167
PROFILE_GEN_CFLAGS="-GL"
2168
PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2169
dnl XXX: PGO builds can fail with warnings treated as errors,
2170
dnl specifically "no profile data available" appears to be
2171
dnl treated as an error sometimes. This might be a consequence
2172
dnl of using WARNINGS_AS_ERRORS in some modules, combined
2173
dnl with the linker doing most of the work in the whole-program
2174
dnl optimization/PGO case. I think it's probably a compiler bug,
2175
dnl but we work around it here.
2176
PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2177
dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2178
dnl Probably also a compiler bug, but what can you do?
2179
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2180
if test -n "$_USE_DYNAMICBASE"; then
2181
LDFLAGS="$LDFLAGS -DYNAMICBASE"
2185
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg$(MOZ_BITS)$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2186
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2187
AC_DEFINE(HAVE_SNPRINTF)
2192
AC_DEFINE(HW_THREADS)
2193
AC_DEFINE(STDC_HEADERS)
2194
AC_DEFINE(NEW_H, <new>)
2195
AC_DEFINE(WIN32_LEAN_AND_MEAN)
2196
TARGET_MD_ARCH=win32
2197
_PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2200
MOZ_ENABLE_POSTSCRIPT=
2201
MOZ_USER_DIR="Mozilla"
2203
dnl Hardcode to win95 for now - cls
2204
TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2206
dnl set NO_X11 defines here as the general check is skipped on win32
2210
dnl MinGW/MSYS doesn't provide or need cygpath
2215
MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2217
*-cygwin*|*-msvc*|*-mks*)
2218
CYGPATH_W="cygpath -a -w"
2219
CYGPATH_S="sed -e s|\\\\|/|g"
2220
MOZ_BUILD_ROOT=`$CYGPATH_W $MOZ_BUILD_ROOT | $CYGPATH_S`
2224
*-mingw*|*-cygwin*|*-msvc*|*-mks*)
2226
if test -z "$MOZ_TOOLS"; then
2227
AC_MSG_ERROR([MOZ_TOOLS is not set])
2230
MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2231
if test "$?" != "0" || test -z "$MOZ_TOOLS_DIR"; then
2232
AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2234
MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2235
if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2236
AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2238
MOZ_TOOLS_DIR=`$CYGPATH_W $MOZ_TOOLS_DIR | $CYGPATH_S`
2240
if test -n "$GLIB_PREFIX"; then
2241
_GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd -W`
2242
if test "$?" = "0"; then
2243
if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
2244
AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
2246
_GLIB_PREFIX_DIR=`$CYGPATH_W $_GLIB_PREFIX_DIR | $CYGPATH_S`
2248
AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
2251
_GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
2253
if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
2254
AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
2256
GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
2257
if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
2258
GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
2259
elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
2260
GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
2262
AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
2265
if test -n "$LIBIDL_PREFIX"; then
2266
_LIBIDL_PREFIX_DIR=`cd $LIBIDL_PREFIX && pwd -W`
2267
if test "$?" = "0"; then
2268
if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
2269
AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
2271
_LIBIDL_PREFIX_DIR=`$CYGPATH_W $_LIBIDL_PREFIX_DIR | $CYGPATH_S`
2273
AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
2276
_LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
2278
if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
2279
AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
2281
LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
2282
if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
2283
LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
2285
elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
2286
LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
2288
AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
2290
LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2293
*) # else cross-compiling
2294
if test -n "$GLIB_PREFIX"; then
2295
GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
2296
if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
2297
GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
2298
elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
2299
GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
2301
AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
2304
if test -n "$LIBIDL_PREFIX"; then
2305
LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
2306
if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
2307
LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
2309
elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
2310
LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
2312
AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
2315
LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
2322
AC_MSG_WARN([Using a cygwin build environment is unsupported. Configure cannot check for the presence of necessary headers. Please upgrade to MozillaBuild; see http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites])
2326
AC_CHECK_HEADERS(mmintrin.h oleacc.idl)
2330
AC_CHECK_HEADERS(atlbase.h wpcapi.h)
2346
AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2353
CFLAGS="$CFLAGS -Dunix"
2354
CXXFLAGS="$CXXFLAGS -Dunix"
2355
if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2357
DSO_PIC_CFLAGS='-fPIC -DPIC'
2358
DSO_LDOPTS='-shared'
2359
BIN_FLAGS='-Wl,--export-dynamic'
2361
DSO_PIC_CFLAGS='-fPIC -DPIC'
2362
DLL_SUFFIX=".so.1.0"
2363
DSO_LDOPTS='-shared'
2365
# This will fail on a.out systems prior to 1.5.1_ALPHA.
2366
MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2367
MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2368
if test "$LIBRUNPATH"; then
2369
DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2371
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2372
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2377
AC_DEFINE(_QNX_SOURCE)
2380
WARNINGS_AS_ERRORS=''
2381
MOZ_OPTIMIZE_FLAGS="-O"
2382
MOZ_DEBUG_FLAGS="-gstabs"
2385
LIBS="$LIBS -lsocket -lstdc++"
2386
_DEFINES_CFLAGS='-Wp,-include -Wp,$(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2387
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -Wp,-include -Wp,$(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2388
if test "$with_x" != "yes"
2390
_PLATFORM_DEFAULT_TOOLKIT="photon"
2391
TK_CFLAGS='-I/usr/include/photon'
2394
case "${target_cpu}" in
2396
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2399
case "${host_cpu}" in
2407
DLL_SUFFIX=".so.1.0"
2409
DSO_PIC_CFLAGS='-fPIC'
2410
DSO_LDOPTS='-shared -fPIC'
2411
if test "$LIBRUNPATH"; then
2412
DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2417
AC_DEFINE(NO_PW_GECOS)
2418
AC_DEFINE(NO_UDSOCK)
2419
AC_DEFINE(POLL_WITH_XCONNECTIONNUMBER)
2421
MKSHLIB_FORCE_ALL='-all'
2422
MKSHLIB_UNFORCE_ALL='-none'
2424
AS_DASH_C_FLAG='-Wc/names=as_is'
2426
DSO_LDOPTS='-shared -auto_symvec'
2428
MOZ_DEBUG_LDFLAGS='-g'
2430
CC_VERSION=`$CC -V 2>&1 | awk '/ C / { print $3 }'`
2431
CXX_VERSION=`$CXX -V 2>&1 | awk '/ C\+\+ / { print $3 }'`
2436
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2437
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2440
AC_DEFINE(OS2EMX_PLAIN_CHAR)
2441
AC_DEFINE(TCPV40HDRS)
2448
IMPORT_LIB_SUFFIX=lib
2452
CFLAGS="$CFLAGS -Zomf"
2453
CXXFLAGS="$CXXFLAGS -Zomf"
2455
BIN_FLAGS='-Zlinker /ST:0x100000'
2459
WARNINGS_AS_ERRORS='-Werror'
2460
MOZ_DEBUG_FLAGS="-g -fno-inline"
2461
MOZ_OPTIMIZE_FLAGS="-O2"
2462
MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2463
MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcomct.lib'
2464
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcomcor.lib'
2465
LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib'
2467
_PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2468
MOZ_ENABLE_POSTSCRIPT=
2471
MOZ_USER_DIR="Mozilla"
2473
if test "$MOZTOOLS"; then
2474
MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2476
AC_MSG_ERROR([MOZTOOLS is not set])
2478
if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2479
DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2480
LDFLAGS="$LDFLAGS -Zhigh-mem"
2481
MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2482
AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2485
# GCC for OS/2 currently predefines these, but we don't want them
2486
_DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2487
_DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2489
AC_CACHE_CHECK(for __declspec(dllexport),
2491
[AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2493
ac_os2_declspec="yes",
2494
ac_os2_declspec="no")])
2495
if test "$ac_os2_declspec" = "yes"; then
2497
MOZ_OS2_USE_DECLSPEC='1'
2502
if test "$GNU_CC"; then
2503
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2504
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2507
MOZ_DEBUG_FLAGS='-g'
2508
ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2509
CFLAGS="$CFLAGS -ieee"
2510
CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2511
DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2514
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2515
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2516
MKSHLIB_FORCE_ALL='-all'
2517
MKSHLIB_UNFORCE_ALL='-none'
2518
dnl Might fix the libxpcom.so breakage on this platform as well....
2519
AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2520
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2522
if test -z "$GNU_CXX"; then
2525
AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2529
DIRENT_INO=d_stat.st_ino
2530
dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2531
AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2532
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2533
dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2534
AC_DEFINE(STDC_HEADERS)
2535
if test "$no_x" = "yes"; then
2536
_PLATFORM_DEFAULT_TOOLKIT='photon'
2537
TK_CFLAGS='-I/usr/nto/include/photon'
2538
TK_LIBS='-lphoton -lphrender'
2543
AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2544
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2545
CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2546
if test ! "$GNU_CC"; then
2551
dnl the qsort routine under solaris is faulty
2554
TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2556
# $ORIGIN/.. is for shared libraries under components/ to locate shared
2557
# libraries one level up (e.g. libnspr4.so)
2558
LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
2560
if test "$SOLARIS_SUNPRO_CC"; then
2561
LIBS="-lCrun -lCstd $LIBS"
2564
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2565
CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
2566
CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
2567
LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
2568
if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
2569
_SAVE_LDFLAGS=$LDFLAGS
2570
LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2571
AC_TRY_LINK([#include <stdio.h>],
2572
[printf("Hello World\n");],
2574
[LDFLAGS=$_SAVE_LDFLAGS])
2576
WARNINGS_AS_ERRORS='-Werror'
2577
MOZ_OPTIMIZE_FLAGS="-xO4"
2578
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2579
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) -G -z muldefs -h $@ -o $@'
2580
MKSHLIB_FORCE_ALL='-z allextract'
2581
MKSHLIB_UNFORCE_ALL='-z defaultextract'
2582
DSO_LDOPTS='-G -z muldefs'
2588
AS='/usr/ccs/bin/as'
2589
ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2591
TARGET_COMPILER_ABI="sunc"
2592
CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2593
CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2594
AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2598
[#if (__SUNPRO_CC < 0x590)
2601
_BAD_COMPILER=,_BAD_COMPILER=1)
2602
if test -n "$_BAD_COMPILER"; then
2604
AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2608
AC_MSG_RESULT([$_res])
2611
ASFLAGS="$ASFLAGS -fPIC"
2614
_WARNINGS_CXXFLAGS=''
2615
if test "$OS_RELEASE" = "5.3"; then
2616
AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2619
if test "$OS_RELEASE" = "5.5.1"; then
2620
AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2625
DSO_LDOPTS='-Bdynamic'
2626
MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2627
MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2629
AC_DEFINE(SPRINTF_RETURNS_STRING)
2630
case "$(target_os)" in
2632
DLL_SUFFIX='.so.1.0'
2638
NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2642
HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2647
dnl Only one oddball right now (QNX), but this gives us flexibility
2648
dnl if any other platforms need to override this in the future.
2649
AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2651
dnl ========================================================
2652
dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2653
dnl by now will not have any way to link most binaries (tests
2654
dnl as well as viewer, apprunner, etc.), because some symbols
2655
dnl will be left out of the "composite" .so's by ld as unneeded.
2656
dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2657
dnl they can link in the static libs that provide the missing
2659
dnl ========================================================
2660
NO_LD_ARCHIVE_FLAGS=
2661
if test -z "$MKSHLIB_FORCE_ALL" || test -z "$MKSHLIB_UNFORCE_ALL"; then
2662
NO_LD_ARCHIVE_FLAGS=1
2666
NO_LD_ARCHIVE_FLAGS=
2669
NO_LD_ARCHIVE_FLAGS=
2672
NO_LD_ARCHIVE_FLAGS=
2674
*-msvc*|*-mks*|*-mingw*|*-cygwin*|*-wince)
2675
if test -z "$GNU_CC"; then
2676
NO_LD_ARCHIVE_FLAGS=
2680
AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2682
dnl ========================================================
2683
dnl = Flags to strip unused symbols from .so components
2684
dnl ========================================================
2686
*-linux*|*-kfreebsd*-gnu)
2687
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2690
if test -z "$GNU_CC"; then
2691
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2693
if test -z "$GCC_USE_GNU_LD"; then
2694
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2696
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2701
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2704
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2706
*-cygwin*|*-mingw*|*-mks*|*-msvc|*-wince)
2707
if test -n "$GNU_CC"; then
2708
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2713
if test -z "$COMPILE_ENVIRONMENT"; then
2714
SKIP_COMPILER_CHECKS=1
2715
SKIP_LIBRARY_CHECKS=1
2718
if test -z "$SKIP_COMPILER_CHECKS"; then
2719
dnl Checks for typedefs, structures, and compiler characteristics.
2720
dnl ========================================================
2728
AC_STRUCT_ST_BLKSIZE
2729
AC_MSG_CHECKING(for siginfo_t)
2730
AC_CACHE_VAL(ac_cv_siginfo_t,
2731
[AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2732
#include <signal.h>],
2734
[ac_cv_siginfo_t=true],
2735
[ac_cv_siginfo_t=false])])
2736
if test "$ac_cv_siginfo_t" = true ; then
2737
AC_DEFINE(HAVE_SIGINFO_T)
2743
dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
2744
dnl ========================================================
2745
AC_MSG_CHECKING(for int16_t)
2746
AC_CACHE_VAL(ac_cv_int16_t,
2747
[AC_TRY_COMPILE([#include <stdio.h>
2748
#include <sys/types.h>],
2750
[ac_cv_int16_t=true],
2751
[ac_cv_int16_t=false])])
2752
if test "$ac_cv_int16_t" = true ; then
2753
AC_DEFINE(HAVE_INT16_T)
2758
AC_MSG_CHECKING(for int32_t)
2759
AC_CACHE_VAL(ac_cv_int32_t,
2760
[AC_TRY_COMPILE([#include <stdio.h>
2761
#include <sys/types.h>],
2763
[ac_cv_int32_t=true],
2764
[ac_cv_int32_t=false])])
2765
if test "$ac_cv_int32_t" = true ; then
2766
AC_DEFINE(HAVE_INT32_T)
2771
AC_MSG_CHECKING(for int64_t)
2772
AC_CACHE_VAL(ac_cv_int64_t,
2773
[AC_TRY_COMPILE([#include <stdio.h>
2774
#include <sys/types.h>],
2776
[ac_cv_int64_t=true],
2777
[ac_cv_int64_t=false])])
2778
if test "$ac_cv_int64_t" = true ; then
2779
AC_DEFINE(HAVE_INT64_T)
2784
AC_MSG_CHECKING(for int64)
2785
AC_CACHE_VAL(ac_cv_int64,
2786
[AC_TRY_COMPILE([#include <stdio.h>
2787
#include <sys/types.h>],
2790
[ac_cv_int64=false])])
2791
if test "$ac_cv_int64" = true ; then
2792
AC_DEFINE(HAVE_INT64)
2797
AC_MSG_CHECKING(for uint)
2798
AC_CACHE_VAL(ac_cv_uint,
2799
[AC_TRY_COMPILE([#include <stdio.h>
2800
#include <sys/types.h>],
2803
[ac_cv_uint=false])])
2804
if test "$ac_cv_uint" = true ; then
2805
AC_DEFINE(HAVE_UINT)
2810
AC_MSG_CHECKING(for uint_t)
2811
AC_CACHE_VAL(ac_cv_uint_t,
2812
[AC_TRY_COMPILE([#include <stdio.h>
2813
#include <sys/types.h>],
2815
[ac_cv_uint_t=true],
2816
[ac_cv_uint_t=false])])
2817
if test "$ac_cv_uint_t" = true ; then
2818
AC_DEFINE(HAVE_UINT_T)
2823
AC_MSG_CHECKING(for uint16_t)
2824
AC_CACHE_VAL(ac_cv_uint16_t,
2825
[AC_TRY_COMPILE([#include <stdio.h>
2826
#include <sys/types.h>],
2827
[uint16_t foo = 0;],
2828
[ac_cv_uint16_t=true],
2829
[ac_cv_uint16_t=false])])
2830
if test "$ac_cv_uint16_t" = true ; then
2831
AC_DEFINE(HAVE_UINT16_T)
2837
dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2838
dnl are defined when compiling C++ but not C. Since the result of this
2839
dnl test is used only in C++, do it in C++.
2842
AC_MSG_CHECKING(for uname.domainname)
2843
AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2844
[AC_TRY_COMPILE([#include <sys/utsname.h>],
2845
[ struct utsname *res; char *domain;
2846
(void)uname(res); if (res != 0) { domain = res->domainname; } ],
2847
[ac_cv_have_uname_domainname_field=true],
2848
[ac_cv_have_uname_domainname_field=false])])
2850
if test "$ac_cv_have_uname_domainname_field" = "true"; then
2851
AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2857
AC_MSG_CHECKING(for uname.__domainname)
2858
AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2859
[AC_TRY_COMPILE([#include <sys/utsname.h>],
2860
[ struct utsname *res; char *domain;
2861
(void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2862
[ac_cv_have_uname_us_domainname_field=true],
2863
[ac_cv_have_uname_us_domainname_field=false])])
2865
if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2866
AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2874
dnl Check for usable char16_t (2 bytes, unsigned)
2875
dnl (we might not need the unsignedness check anymore)
2876
AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
2877
ac_cv_have_usable_char16_t,
2878
[AC_TRY_COMPILE([$configure_static_assert_macros],
2879
[CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
2880
CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
2881
CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
2882
CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
2883
CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
2884
ac_cv_have_usable_char16_t="yes",
2885
ac_cv_have_usable_char16_t="no")])
2886
if test "$ac_cv_have_usable_char16_t" = "yes"; then
2887
AC_DEFINE(HAVE_CPP_CHAR16_T)
2891
dnl Check for usable wchar_t (2 bytes, unsigned)
2892
dnl (we really don't need the unsignedness check anymore)
2893
dnl ========================================================
2895
AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2896
ac_cv_have_usable_wchar_v2,
2897
[AC_TRY_COMPILE([#include <stddef.h>
2898
$configure_static_assert_macros],
2899
[CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2900
CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2901
ac_cv_have_usable_wchar_v2="yes",
2902
ac_cv_have_usable_wchar_v2="no")])
2903
if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2904
AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2905
HAVE_CPP_2BYTE_WCHAR_T=1
2906
elif test "$ac_cv_have_usable_char16_t" != "yes"; then
2907
dnl This is really gcc-only
2908
dnl Do this test using CXX only since some versions of gcc
2909
dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2910
dnl only have short-wchar support for c++.
2911
dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2913
_SAVE_CXXFLAGS=$CXXFLAGS
2914
CXXFLAGS="$CXXFLAGS -fshort-wchar"
2916
AC_CACHE_CHECK(for compiler -fshort-wchar option,
2917
ac_cv_have_usable_wchar_option_v2,
2918
[AC_TRY_LINK([#include <stddef.h>
2919
$configure_static_assert_macros],
2920
[CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2921
CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2922
ac_cv_have_usable_wchar_option_v2="yes",
2923
ac_cv_have_usable_wchar_option_v2="no")])
2925
if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2926
AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2927
HAVE_CPP_2BYTE_WCHAR_T=1
2928
WCHAR_CFLAGS="-fshort-wchar"
2930
CXXFLAGS=$_SAVE_CXXFLAGS
2936
dnl Check for .hidden assembler directive and visibility attribute.
2937
dnl Borrowed from glibc configure.in
2938
dnl ===============================================================
2939
if test "$GNU_CC"; then
2940
AC_CACHE_CHECK(for visibility(hidden) attribute,
2941
ac_cv_visibility_hidden,
2942
[cat > conftest.c <<EOF
2943
int foo __attribute__ ((visibility ("hidden"))) = 1;
2945
ac_cv_visibility_hidden=no
2946
if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2947
if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2948
ac_cv_visibility_hidden=yes
2953
if test "$ac_cv_visibility_hidden" = "yes"; then
2954
AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2956
AC_CACHE_CHECK(for visibility(default) attribute,
2957
ac_cv_visibility_default,
2958
[cat > conftest.c <<EOF
2959
int foo __attribute__ ((visibility ("default"))) = 1;
2961
ac_cv_visibility_default=no
2962
if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2963
if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2964
ac_cv_visibility_default=yes
2969
if test "$ac_cv_visibility_default" = "yes"; then
2970
AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2972
AC_CACHE_CHECK(for visibility pragma support,
2973
ac_cv_visibility_pragma,
2974
[cat > conftest.c <<EOF
2975
#pragma GCC visibility push(hidden)
2977
#pragma GCC visibility push(default)
2978
int foo_default = 1;
2980
ac_cv_visibility_pragma=no
2981
if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2982
if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2983
if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2984
ac_cv_visibility_pragma=yes
2990
if test "$ac_cv_visibility_pragma" = "yes"; then
2991
AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2992
ac_cv_have_visibility_class_bug,
2993
[cat > conftest.c <<EOF
2994
#pragma GCC visibility push(hidden)
2995
struct __attribute__ ((visibility ("default"))) TestStruct {
2998
__attribute__ ((visibility ("default"))) void TestFunc() {
3002
ac_cv_have_visibility_class_bug=no
3003
if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3004
ac_cv_have_visibility_class_bug=yes
3006
if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
3007
ac_cv_have_visibility_class_bug=yes
3010
rm -rf conftest.{c,S}
3013
AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
3014
ac_cv_have_visibility_builtin_bug,
3015
[cat > conftest.c <<EOF
3016
#pragma GCC visibility push(hidden)
3017
#pragma GCC visibility push(default)
3019
#pragma GCC visibility pop
3021
__attribute__ ((visibility ("default"))) void Func() {
3023
memset(c, 0, sizeof(c));
3026
ac_cv_have_visibility_builtin_bug=no
3027
if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3028
ac_cv_have_visibility_builtin_bug=yes
3030
if test `grep -c "@PLT" conftest.S` = 0; then
3031
ac_cv_visibility_builtin_bug=yes
3034
rm -f conftest.{c,S}
3036
if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
3037
"$ac_cv_have_visibility_class_bug" = "no"; then
3038
VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
3039
WRAP_SYSTEM_INCLUDES=1
3041
VISIBILITY_FLAGS='-fvisibility=hidden'
3042
fi # have visibility pragma bug
3043
fi # have visibility pragma
3044
fi # have visibility(default) attribute
3045
fi # have visibility(hidden) attribute
3048
# visibility hidden flag for Sun Studio on Solaris
3049
if test "$SOLARIS_SUNPRO_CC"; then
3050
VISIBILITY_FLAGS='-xldscope=hidden'
3051
fi # Sun Studio on Solaris
3053
AC_SUBST(WRAP_SYSTEM_INCLUDES)
3054
AC_SUBST(VISIBILITY_FLAGS)
3056
dnl Checks for header files.
3057
dnl ========================================================
3059
case "$target_os" in
3061
# for stuff like -lXshm
3062
CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
3065
AC_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
3066
AC_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
3067
AC_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
3068
AC_CHECK_HEADERS(malloc.h)
3069
AC_CHECK_HEADERS(X11/XKBlib.h)
3070
AC_CHECK_HEADERS(io.h)
3072
dnl These are all the places some variant of statfs can be hiding.
3073
AC_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
3075
dnl Try for MMX support
3076
dnl NB - later gcc versions require -mmmx for this header to be successfully
3077
dnl included (or another option which implies it, such as -march=pentium-mmx)
3078
AC_CHECK_HEADERS(mmintrin.h)
3080
dnl Check whether the compiler supports the new-style C++ standard
3081
dnl library headers (i.e. <new>) or needs the old "new.h"
3084
AC_CHECK_HEADER(new, [NEW_H=new])
3085
AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
3088
AC_ARG_ENABLE(dtrace,
3089
[ --enable-dtrace build with dtrace support if available (default=no)],
3090
[enable_dtrace="yes"],)
3091
if test "x$enable_dtrace" = "xyes"; then
3092
AC_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
3093
if test -n "$HAVE_DTRACE"; then
3094
AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
3096
AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
3099
AC_SUBST(HAVE_DTRACE)
3105
AC_CHECK_HEADERS(sys/cdefs.h)
3109
dnl Checks for libraries.
3110
dnl ========================================================
3115
AC_CHECK_LIB(c_r, gethostbyname_r)
3119
dnl We don't want to link with libdl even if it's present on OS X, since
3120
dnl it's not used and not part of the default installation.
3121
dnl The same goes for BeOS.
3122
dnl We don't want to link against libm or libpthread on Darwin since
3123
dnl they both are just symlinks to libSystem and explicitly linking
3124
dnl against libSystem causes issues when debugging (see bug 299601).
3131
AC_CHECK_LIB(m, atan)
3132
AC_CHECK_LIB(dl, dlopen,
3133
AC_CHECK_HEADER(dlfcn.h,
3135
AC_DEFINE(HAVE_LIBDL)))
3139
_SAVE_CFLAGS="$CFLAGS"
3140
CFLAGS="$CFLAGS -D_GNU_SOURCE"
3141
AC_CHECK_FUNCS(dladdr)
3142
CFLAGS="$_SAVE_CFLAGS"
3144
if test ! "$GNU_CXX"; then
3148
AC_CHECK_LIB(C_r, demangle)
3151
AC_CHECK_LIB(C, demangle)
3155
AC_CHECK_LIB(socket, socket)
3157
dnl ========================================================
3158
dnl Check whether we can compile code for Core Text
3159
dnl (Mac OS X 10.5 or later)
3160
dnl ========================================================
3163
AC_MSG_CHECKING([for Core Text])
3164
AC_TRY_COMPILE([#include <ApplicationServices/ApplicationServices.h>],
3165
[CTLineRef lineRef;],
3166
ac_cv_have_core_text="yes",
3167
ac_cv_have_core_text="no")
3168
AC_MSG_RESULT([$ac_cv_have_core_text])
3170
case "${target_cpu}" in
3176
MOZ_ARG_ENABLE_BOOL(coretext,
3177
[ --enable-coretext Use CoreText instead of ATSUI for text rendering],
3181
if test -n "$MOZ_CORETEXT"; then
3182
if test "$ac_cv_have_core_text" = "no"; then
3183
AC_MSG_ERROR([--enable-coretext requires MacOS SDK 10.5 or newer])
3185
AC_DEFINE(MOZ_CORETEXT)
3190
AC_SUBST(MOZ_CORETEXT)
3193
XLIBS="$X_EXTRA_LIBS"
3195
dnl ========================================================
3196
dnl Checks for X libraries.
3197
dnl Ordering is important.
3198
dnl Xt is dependent upon SM as of X11R6
3199
dnl ========================================================
3200
if test "$no_x" = "yes"; then
3203
AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3204
XLIBS="-lX11 $XLIBS"
3205
_SAVE_LDFLAGS="$LDFLAGS"
3206
LDFLAGS="$XLDFLAGS $LDFLAGS"
3207
AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3208
[MISSING_X="$MISSING_X -lX11"], $XLIBS)
3209
AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3210
[MISSING_X="$MISSING_X -lXext"], $XLIBS)
3212
AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3213
unset ac_cv_lib_Xt_XtFree
3214
AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3215
AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3216
AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3217
[MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3220
# AIX needs the motif library linked before libXt to prevent
3221
# crashes in plugins linked against Motif - Bug #98892
3222
case "${target_os}" in
3224
XT_LIBS="-lXm $XT_LIBS"
3228
dnl ========================================================
3229
dnl = Check for XShm
3230
dnl ========================================================
3231
AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3233
AC_CHECK_HEADER(X11/extensions/XShm.h)
3234
if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3235
test -n "$_HAVE_XSHM_XEXT"; then
3236
AC_DEFINE(HAVE_XSHM)
3239
dnl ========================================================
3241
dnl ========================================================
3242
AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3244
AC_CHECK_HEADER(X11/extensions/XIElib.h)
3246
if test "$MOZ_XIE_LIBS"; then
3247
dnl ====================================================
3248
dnl = If XIE is present and is desired, turn it on
3249
dnl ====================================================
3259
LDFLAGS="$_SAVE_LDFLAGS"
3261
dnl ========================================================
3262
dnl = Check for freetype2 and its functionality
3263
dnl ========================================================
3264
AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3266
if test "$_HAVE_FREETYPE2"; then
3268
_SAVE_CFLAGS="$CFLAGS"
3269
LIBS="$LIBS $FT2_LIBS"
3270
CFLAGS="$CFLAGS $FT2_CFLAGS"
3272
AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3273
ac_cv_member_FT_Bitmap_Size_y_ppem,
3274
[AC_TRY_COMPILE([#include <ft2build.h>
3275
#include FT_FREETYPE_H],
3277
if (sizeof s.y_ppem) return 0;
3279
ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3280
ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3281
if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3282
HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3284
HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3286
AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3287
$HAVE_FT_BITMAP_SIZE_Y_PPEM,
3288
[FT_Bitmap_Size structure includes y_ppem field])
3290
AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3293
CFLAGS="$_SAVE_CFLAGS"
3304
AC_MSG_CHECKING(for ARM SIMD support in compiler)
3306
[asm("uqadd8 r1, r1, r2");],
3307
result="yes", result="no")
3308
AC_MSG_RESULT("$result")
3309
if test "$result" = "yes"; then
3310
AC_DEFINE(HAVE_ARM_SIMD)
3313
AC_SUBST(HAVE_ARM_SIMD)
3315
AC_MSG_CHECKING(for ARM NEON support in compiler)
3316
_SAVE_CFLAGS="$CFLAGS"
3317
if test "$GNU_CC"; then
3318
# gcc needs -mfpu=neon to recognize NEON instructions
3319
CFLAGS="$CFLAGS -mfpu=neon"
3322
[asm("vadd.i8 d0, d0, d0");],
3323
result="yes", result="no")
3324
AC_MSG_RESULT("$result")
3325
if test "$result" = "yes"; then
3326
AC_DEFINE(HAVE_ARM_NEON)
3329
CFLAGS="$_SAVE_CFLAGS"
3330
AC_SUBST(HAVE_ARM_NEON)
3332
dnl ========================================================
3333
dnl = pthread support
3334
dnl = Start by checking whether the system support pthreads
3335
dnl ========================================================
3336
case "$target_os" in
3341
MOZ_CHECK_PTHREADS(pthreads,
3342
USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3343
MOZ_CHECK_PTHREADS(pthread,
3344
USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3345
MOZ_CHECK_PTHREADS(c_r,
3346
USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3347
MOZ_CHECK_PTHREADS(c,
3356
dnl ========================================================
3357
dnl Check the command line for --with-pthreads
3358
dnl ========================================================
3359
MOZ_ARG_WITH_BOOL(pthreads,
3360
[ --with-pthreads Force use of system pthread library with NSPR ],
3361
[ if test "$USE_PTHREADS"x = x; then
3362
AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3368
dnl ========================================================
3369
dnl Do the platform specific pthread hackery
3370
dnl ========================================================
3371
if test "$USE_PTHREADS"x != x
3374
dnl See if -pthread is supported.
3377
ac_cv_have_dash_pthread=no
3378
AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3379
echo 'int main() { return 0; }' | cat > conftest.c
3380
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3381
if test $? -eq 0; then
3382
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3383
ac_cv_have_dash_pthread=yes
3384
case "$target_os" in
3386
# Freebsd doesn't use -pthread for compiles, it uses them for linking
3389
CFLAGS="$CFLAGS -pthread"
3390
CXXFLAGS="$CXXFLAGS -pthread"
3396
AC_MSG_RESULT($ac_cv_have_dash_pthread)
3399
dnl See if -pthreads is supported.
3401
ac_cv_have_dash_pthreads=no
3402
if test "$ac_cv_have_dash_pthread" = "no"; then
3403
AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3404
echo 'int main() { return 0; }' | cat > conftest.c
3405
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3406
if test $? -eq 0; then
3407
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3408
ac_cv_have_dash_pthreads=yes
3409
CFLAGS="$CFLAGS -pthreads"
3410
CXXFLAGS="$CXXFLAGS -pthreads"
3414
AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3419
AC_DEFINE(_REENTRANT)
3420
AC_DEFINE(_THREAD_SAFE)
3421
dnl -pthread links in -lc_r, so don't specify it explicitly.
3422
if test "$ac_cv_have_dash_pthread" = "yes"; then
3423
_PTHREAD_LDFLAGS="-pthread"
3425
_PTHREAD_LDFLAGS="-lc_r"
3429
*-*-openbsd*|*-*-bsdi*)
3430
AC_DEFINE(_REENTRANT)
3431
AC_DEFINE(_THREAD_SAFE)
3432
dnl -pthread links in -lc_r, so don't specify it explicitly.
3433
if test "$ac_cv_have_dash_pthread" = "yes"; then
3434
_PTHREAD_LDFLAGS="-pthread"
3438
*-*-linux*|*-*-kfreebsd*-gnu)
3439
AC_DEFINE(_REENTRANT)
3443
AC_DEFINE(_REENTRANT)
3447
AC_DEFINE(_REENTRANT)
3451
AC_DEFINE(_REENTRANT)
3455
AC_DEFINE(_REENTRANT)
3459
AC_DEFINE(_REENTRANT)
3460
if test "$SOLARIS_SUNPRO_CC"; then
3461
CFLAGS="$CFLAGS -mt"
3462
CXXFLAGS="$CXXFLAGS -mt"
3466
LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3469
dnl ========================================================
3470
dnl See if mmap sees writes
3471
dnl For cross compiling, just define it as no, which is a safe default
3472
dnl ========================================================
3473
AC_MSG_CHECKING(whether mmap() sees write()s)
3479
#include <sys/mman.h>
3480
#include <sys/types.h>
3481
#include <sys/stat.h>
3484
char fname[] = "conftest.file";
3485
char zbuff[1024]; /* Fractional page is probably worst case */
3492
fd = open(fname, O_RDWR | O_CREAT, 0660);
3495
write(fd, zbuff, sizeof(zbuff));
3496
lseek(fd, 0, SEEK_SET);
3497
map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3498
if(map==(char*)-1) return 2;
3499
for(i=0; fname[i]; i++) {
3500
int rc = write(fd, &fname[i], 1);
3501
if(map[i]!=fname[i]) return 4;
3508
AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3510
AC_MSG_RESULT("$result")
3512
if test "$result" = "no"; then
3513
AC_DEFINE(MMAP_MISSES_WRITES)
3517
dnl Checks for library functions.
3518
dnl ========================================================
3519
AC_PROG_GCC_TRADITIONAL
3521
AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3522
AC_CHECK_FUNCS(flockfile getpagesize)
3523
AC_CHECK_FUNCS(localtime_r strtok_r)
3525
dnl check for wcrtomb/mbrtowc
3526
dnl =======================================================================
3527
if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3530
AC_CACHE_CHECK(for wcrtomb,
3532
[AC_TRY_LINK([#include <wchar.h>],
3533
[mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3534
ac_cv_have_wcrtomb="yes",
3535
ac_cv_have_wcrtomb="no")])
3536
if test "$ac_cv_have_wcrtomb" = "yes"; then
3537
AC_DEFINE(HAVE_WCRTOMB)
3539
AC_CACHE_CHECK(for mbrtowc,
3541
[AC_TRY_LINK([#include <wchar.h>],
3542
[mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3543
ac_cv_have_mbrtowc="yes",
3544
ac_cv_have_mbrtowc="no")])
3545
if test "$ac_cv_have_mbrtowc" = "yes"; then
3546
AC_DEFINE(HAVE_MBRTOWC)
3553
ac_cv_func_res_ninit,
3556
#define _BSD_SOURCE 1
3560
[int foo = res_ninit(&_res);],
3561
[ac_cv_func_res_ninit=yes],
3562
[ac_cv_func_res_ninit=no])
3565
if test "$ac_cv_func_res_ninit" = "yes"; then
3566
AC_DEFINE(HAVE_RES_NINIT)
3567
dnl must add the link line we do something as foolish as this... dougt
3569
dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3570
dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3575
[for gnu_get_libc_version()],
3576
ac_cv_func_gnu_get_libc_version,
3578
#ifdef HAVE_GNU_LIBC_VERSION_H
3579
#include <gnu/libc-version.h>
3582
[const char *glibc_version = gnu_get_libc_version();],
3583
[ac_cv_func_gnu_get_libc_version=yes],
3584
[ac_cv_func_gnu_get_libc_version=no]
3588
if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3589
AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3593
os2*|msvc*|mks*|cygwin*|mingw*|darwin*|wince*|beos*)
3597
AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3598
AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3599
AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3601
LIBS="$LIBS $_ICONV_LIBS"
3610
iconv_t h = iconv_open("", "");
3611
iconv(h, NULL, NULL, NULL, NULL);
3614
[ac_cv_func_iconv=yes],
3615
[ac_cv_func_iconv=no]
3618
if test "$ac_cv_func_iconv" = "yes"; then
3619
AC_DEFINE(HAVE_ICONV)
3620
DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3621
LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3622
LIBICONV="$_ICONV_LIBS"
3624
[for iconv() with const input],
3625
ac_cv_func_const_iconv,
3631
const char *input = "testing";
3632
iconv_t h = iconv_open("", "");
3633
iconv(h, &input, NULL, NULL, NULL);
3636
[ac_cv_func_const_iconv=yes],
3637
[ac_cv_func_const_iconv=no]
3640
if test "$ac_cv_func_const_iconv" = "yes"; then
3641
AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3653
dnl **********************
3654
dnl *** va_copy checks ***
3655
dnl **********************
3656
dnl we currently check for all three va_copy possibilities, so we get
3657
dnl all results in config.log for bug reports.
3658
AC_MSG_CHECKING(for an implementation of va_copy())
3659
AC_CACHE_VAL(ac_cv_va_copy,[
3662
void f (int i, ...) {
3663
va_list args1, args2;
3664
va_start (args1, i);
3665
va_copy (args2, args1);
3666
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3668
va_end (args1); va_end (args2);
3670
int main() { f (0, 42); return 0; }],
3676
AC_MSG_RESULT($ac_cv_va_copy)
3677
AC_MSG_CHECKING(for an implementation of __va_copy())
3678
AC_CACHE_VAL(ac_cv___va_copy,[
3681
void f (int i, ...) {
3682
va_list args1, args2;
3683
va_start (args1, i);
3684
__va_copy (args2, args1);
3685
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3687
va_end (args1); va_end (args2);
3689
int main() { f (0, 42); return 0; }],
3690
ac_cv___va_copy=yes,
3695
AC_MSG_RESULT($ac_cv___va_copy)
3696
AC_MSG_CHECKING(whether va_lists can be copied by value)
3697
AC_CACHE_VAL(ac_cv_va_val_copy,[
3700
void f (int i, ...) {
3701
va_list args1, args2;
3702
va_start (args1, i);
3704
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3706
va_end (args1); va_end (args2);
3708
int main() { f (0, 42); return 0; }],
3709
ac_cv_va_val_copy=yes,
3710
ac_cv_va_val_copy=no,
3711
ac_cv_va_val_copy=yes
3714
if test "x$ac_cv_va_copy" = "xyes"; then
3715
AC_DEFINE(VA_COPY, va_copy)
3716
AC_DEFINE(HAVE_VA_COPY)
3717
elif test "x$ac_cv___va_copy" = "xyes"; then
3718
AC_DEFINE(VA_COPY, __va_copy)
3719
AC_DEFINE(HAVE_VA_COPY)
3722
if test "x$ac_cv_va_val_copy" = "xno"; then
3723
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3725
AC_MSG_RESULT($ac_cv_va_val_copy)
3727
dnl Check for dll-challenged libc's.
3728
dnl This check is apparently only needed for Linux.
3731
dnl ===================================================================
3734
rm -rf conftest* _conftest
3736
cat >> conftest.C <<\EOF
3741
void __dump_link_map(void) {
3742
struct link_map *map = _dl_loaded;
3743
while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
3746
dlopen("./conftest1.so",RTLD_LAZY);
3747
dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
3748
dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
3749
dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
3753
/* _dl_loaded isn't defined, so this should be either a libc5 (glibc1) system, or a glibc2 system that doesn't have the multiple load bug (i.e., RH6.0).*/
3754
int main() { printf("./conftest1.so\n"); }
3758
$PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
3760
cat >> conftest1.C <<\EOF
3762
void foo(void) {printf("foo in dll called\n");}
3764
${CXX-g++} -fPIC -c -g conftest1.C
3765
${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
3766
${CXX-g++} -g conftest.C -o conftest -ldl
3767
cp -f conftest1.so conftest _conftest
3769
if test `./conftest | grep conftest1.so | wc -l` -gt 1
3772
echo "*** Your libc has a bug that can result in loading the same dynamic"
3773
echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
3774
echo "*** or later. However, if you choose not to upgrade, the only effect"
3775
echo "*** will be excessive memory usage at runtime."
3779
rm -rf conftest* _conftest
3780
dnl ===================================================================
3784
dnl ===================================================================
3785
dnl ========================================================
3786
dnl By default, turn rtti and exceptions off on g++/egcs
3787
dnl ========================================================
3788
if test "$GNU_CXX"; then
3790
AC_MSG_CHECKING(for C++ exceptions flag)
3792
dnl They changed -f[no-]handle-exceptions to -f[no-]exceptions in g++ 2.8
3793
AC_CACHE_VAL(ac_cv_cxx_exceptions_flags,
3794
[echo "int main() { return 0; }" | cat > conftest.C
3796
${CXX-g++} ${CXXFLAGS} -c -fno-handle-exceptions conftest.C > conftest.out 2>&1
3798
if egrep "warning.*renamed" conftest.out >/dev/null; then
3799
ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-exceptions
3801
ac_cv_cxx_exceptions_flags=${_COMPILER_PREFIX}-fno-handle-exceptions
3806
AC_MSG_RESULT($ac_cv_cxx_exceptions_flags)
3807
_MOZ_EXCEPTIONS_FLAGS_OFF=$ac_cv_cxx_exceptions_flags
3808
_MOZ_EXCEPTIONS_FLAGS_ON=`echo $ac_cv_cxx_exceptions_flags | sed 's|no-||'`
3811
dnl ========================================================
3812
dnl Put your C++ language/feature checks below
3813
dnl ========================================================
3817
if test "$GNU_CC"; then
3818
AC_CACHE_CHECK(for gcc 3.0 ABI,
3819
ac_cv_gcc_three_abi,
3822
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
3828
ac_cv_gcc_three_abi="yes",
3829
ac_cv_gcc_three_abi="no")])
3830
if test "$ac_cv_gcc_three_abi" = "yes"; then
3831
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc3}"
3834
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-gcc2}"
3837
AC_SUBST(HAVE_GCC3_ABI)
3840
AC_CACHE_CHECK(for C++ \"explicit\" keyword,
3842
[AC_TRY_COMPILE(class X {
3843
public: explicit X(int i) : i_(i) {}
3847
ac_cv_cpp_explicit=yes,
3848
ac_cv_cpp_explicit=no)])
3849
if test "$ac_cv_cpp_explicit" = yes ; then
3850
AC_DEFINE(HAVE_CPP_EXPLICIT)
3853
AC_CACHE_CHECK(for C++ \"typename\" keyword,
3855
[AC_TRY_COMPILE(class param {
3857
typedef unsigned long num_type;
3860
template <class T> class tplt {
3862
typedef typename T::num_type t_num_type;
3863
t_num_type foo(typename T::num_type num) {
3869
ac_cv_cpp_typename=yes,
3870
ac_cv_cpp_typename=no)])
3871
if test "$ac_cv_cpp_typename" = yes ; then
3872
AC_DEFINE(HAVE_CPP_TYPENAME)
3875
dnl Check for support of modern template specialization syntax
3876
dnl Test code and requirement from scc@netscape.com.
3877
dnl Autoconf cut-and-paste job by waterson@netscape.com
3878
AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3879
ac_cv_cpp_modern_specialize_template_syntax,
3880
[AC_TRY_COMPILE(template <class T> struct X { int a; };
3882
template <> struct X<Y> { double a; };,
3885
ac_cv_cpp_modern_specialize_template_syntax=yes,
3886
ac_cv_cpp_modern_specialize_template_syntax=no)])
3887
if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
3888
AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
3892
dnl Some compilers support only full specialization, and some don't.
3893
AC_CACHE_CHECK(whether partial template specialization works,
3894
ac_cv_cpp_partial_specialization,
3895
[AC_TRY_COMPILE(template <class T> class Foo {};
3896
template <class T> class Foo<T*> {};,
3898
ac_cv_cpp_partial_specialization=yes,
3899
ac_cv_cpp_partial_specialization=no)])
3900
if test "$ac_cv_cpp_partial_specialization" = yes ; then
3901
AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3904
dnl Some compilers have limited support for operators with templates;
3905
dnl specifically, it is necessary to define derived operators when a base
3906
dnl class's operator declaration should suffice.
3907
AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
3908
ac_cv_need_derived_template_operators,
3909
[AC_TRY_COMPILE([template <class T> class Base { };
3911
Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
3912
template <class T> class Derived : public Base<T> { };],
3913
[Derived<char> a, b;
3914
Base<char> c = a + b;
3916
ac_cv_need_derived_template_operators=no,
3917
ac_cv_need_derived_template_operators=yes)])
3918
if test "$ac_cv_need_derived_template_operators" = yes ; then
3919
AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
3923
dnl Some compilers have trouble detecting that a template class
3924
dnl that derives from another template is actually an instance
3925
dnl of the base class. This test checks for that.
3926
AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
3927
ac_cv_need_cpp_template_cast_to_base,
3928
[AC_TRY_COMPILE([template <class T> class Base { };
3929
template <class T> class Derived : public Base<T> { };
3930
template <class T> int foo(const Base<T>&) { return 0; }],
3931
[Derived<char> bar; return foo(bar);],
3932
ac_cv_need_cpp_template_cast_to_base=no,
3933
ac_cv_need_cpp_template_cast_to_base=yes)])
3934
if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
3935
AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
3938
dnl Some compilers have trouble resolving the ambiguity between two
3939
dnl functions whose arguments differ only by cv-qualifications.
3940
AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
3941
ac_cv_can_resolve_const_ambiguity,
3943
template <class T> class ptrClass {
3947
template <class T> T* a(ptrClass<T> *arg) {
3952
const T* a(const ptrClass<T> *arg) {
3958
ac_cv_can_resolve_const_ambiguity=yes,
3959
ac_cv_can_resolve_const_ambiguity=no)])
3960
if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
3961
AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
3965
dnl We don't do exceptions on unix. The only reason this used to be here
3966
dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
3967
dnl exceptions. But, we turn exceptions off by default and this test breaks.
3968
dnl So im commenting this out until someone writes some artificial
3969
dnl intelligence to detect not only if the compiler has exceptions, but if
3970
dnl they are enabled as well.
3972
dnl AC_CACHE_CHECK(for C++ \"exceptions\",
3973
dnl ac_cv_cpp_exceptions,
3974
dnl [AC_TRY_COMPILE(class X { public: X() {} };
3975
dnl static void F() { throw X(); },
3976
dnl try { F(); } catch(X & e) { },
3977
dnl ac_cv_cpp_exceptions=yes,
3978
dnl ac_cv_cpp_exceptions=no)])
3979
dnl if test $ac_cv_cpp_exceptions = yes ; then
3980
dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
3983
dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
3984
dnl supports it well enough to allow us to use it to change access, but not
3985
dnl to resolve ambiguity. The next two tests determine how well the |using|
3986
dnl keyword is supported.
3988
dnl Check to see if we can change access with |using|. Test both a
3989
dnl legal and an illegal example.
3990
AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
3991
ac_cv_cpp_access_changing_using2,
3993
class A { protected: int foo() { return 0; } };
3994
class B : public A { public: using A::foo; };,
3995
B b; return b.foo();,
3997
class A { public: int foo() { return 1; } };
3998
class B : public A { private: using A::foo; };,
3999
B b; return b.foo();,
4000
ac_cv_cpp_access_changing_using2=no,
4001
ac_cv_cpp_access_changing_using2=yes)],
4002
ac_cv_cpp_access_changing_using2=no)])
4003
if test "$ac_cv_cpp_access_changing_using2" = yes ; then
4004
AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
4007
dnl Check to see if we can resolve ambiguity with |using|.
4008
AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
4009
ac_cv_cpp_ambiguity_resolving_using,
4010
[AC_TRY_COMPILE(class X {
4011
public: int go(const X&) {return 3;}
4012
int jo(const X&) {return 3;}
4014
class Y : public X {
4015
public: int go(int) {return 2;}
4016
int jo(int) {return 2;}
4018
private: using X::go;
4021
ac_cv_cpp_ambiguity_resolving_using=yes,
4022
ac_cv_cpp_ambiguity_resolving_using=no)])
4023
if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
4024
AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
4027
dnl Check to see if the |std| namespace is supported. If so, we'll want
4028
dnl to qualify any standard library calls with "std::" to ensure that
4029
dnl those functions can be resolved.
4030
AC_CACHE_CHECK(for \"std::\" namespace,
4031
ac_cv_cpp_namespace_std,
4032
[AC_TRY_COMPILE([#include <algorithm>],
4033
[return std::min(0, 1);],
4034
ac_cv_cpp_namespace_std=yes,
4035
ac_cv_cpp_namespace_std=no)])
4036
if test "$ac_cv_cpp_namespace_std" = yes ; then
4037
AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
4040
dnl Older compilers are overly ambitious with respect to using the standard
4041
dnl template library's |operator!=()| when |operator==()| is defined. In
4042
dnl which case, defining |operator!=()| in addition to |operator==()| causes
4043
dnl ambiguity at compile-time. This test checks for that case.
4044
AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
4045
ac_cv_cpp_unambiguous_std_notequal,
4046
[AC_TRY_COMPILE([#include <algorithm>
4048
int operator==(const T1&, const T1&) { return 0; }
4049
int operator!=(const T1&, const T1&) { return 0; }],
4050
[T1 a,b; return a != b;],
4051
ac_cv_cpp_unambiguous_std_notequal=unambiguous,
4052
ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
4053
if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
4054
AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
4058
AC_CACHE_CHECK(for C++ reinterpret_cast,
4059
ac_cv_cpp_reinterpret_cast,
4060
[AC_TRY_COMPILE(struct X { int i; };
4061
struct Y { int i; };,
4062
X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
4063
ac_cv_cpp_reinterpret_cast=yes,
4064
ac_cv_cpp_reinterpret_cast=no)])
4065
if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
4066
AC_DEFINE(HAVE_CPP_NEW_CASTS)
4069
dnl See if a dynamic_cast to void* gives the most derived object.
4070
AC_CACHE_CHECK(for C++ dynamic_cast to void*,
4071
ac_cv_cpp_dynamic_cast_void_ptr,
4072
[AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
4073
class Y { int j; public: virtual ~Y() { } };
4074
class Z : public X, public Y { int k; };
4080
return !((((void*)&mdo != (void*)subx) &&
4081
((void*)&mdo == dynamic_cast<void*>(subx))) ||
4082
(((void*)&mdo != (void*)suby) &&
4083
((void*)&mdo == dynamic_cast<void*>(suby))));
4085
ac_cv_cpp_dynamic_cast_void_ptr=yes,
4086
ac_cv_cpp_dynamic_cast_void_ptr=no,
4087
ac_cv_cpp_dynamic_cast_void_ptr=no)])
4088
if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
4089
AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
4093
dnl note that this one is reversed - if the test fails, then
4094
dnl we require implementations of unused virtual methods. Which
4095
dnl really blows because it means we'll have useless vtable
4097
AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
4098
ac_cv_cpp_unused_required,
4099
[AC_TRY_LINK(class X {private: virtual void never_called();};,
4101
ac_cv_cpp_unused_required=no,
4102
ac_cv_cpp_unused_required=yes)])
4103
if test "$ac_cv_cpp_unused_required" = yes ; then
4104
AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
4108
dnl Some compilers have trouble comparing a constant reference to a templatized
4109
dnl class to zero, and require an explicit operator==() to be defined that takes
4110
dnl an int. This test separates the strong from the weak.
4112
AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
4113
ac_cv_trouble_comparing_to_zero,
4114
[AC_TRY_COMPILE([#include <algorithm>
4115
template <class T> class Foo {};
4117
template <class T> int operator==(const T2*, const T&) { return 0; }
4118
template <class T> int operator!=(const T2*, const T&) { return 0; }],
4119
[Foo<int> f; return (0 != f);],
4120
ac_cv_trouble_comparing_to_zero=no,
4121
ac_cv_trouble_comparing_to_zero=yes)])
4122
if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
4123
AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
4126
AC_CACHE_CHECK(for __thread keyword for TLS variables,
4127
ac_cv_thread_keyword,
4128
[AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
4129
[return tlsIsMainThread;],
4130
ac_cv_thread_keyword=yes,
4131
ac_cv_thread_keyword=no)])
4132
if test "$ac_cv_thread_keyword" = yes; then
4133
AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
4136
dnl End of C++ language/feature checks
4139
dnl ========================================================
4140
dnl = Internationalization checks
4141
dnl ========================================================
4143
dnl Internationalization and Locale support is different
4144
dnl on various UNIX platforms. Checks for specific i18n
4145
dnl features go here.
4147
dnl check for LC_MESSAGES
4148
AC_CACHE_CHECK(for LC_MESSAGES,
4149
ac_cv_i18n_lc_messages,
4150
[AC_TRY_COMPILE([#include <locale.h>],
4151
[int category = LC_MESSAGES;],
4152
ac_cv_i18n_lc_messages=yes,
4153
ac_cv_i18n_lc_messages=no)])
4154
if test "$ac_cv_i18n_lc_messages" = yes; then
4155
AC_DEFINE(HAVE_I18N_LC_MESSAGES)
4158
fi # SKIP_COMPILER_CHECKS
4161
if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
4162
TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
4165
dnl Mozilla specific options
4166
dnl ========================================================
4167
dnl The macros used for command line options
4168
dnl are defined in build/autoconf/altoptions.m4.
4171
dnl ========================================================
4173
dnl = Check for external package dependencies
4175
dnl ========================================================
4176
MOZ_ARG_HEADER(External Packages)
4180
MOZ_ARG_WITH_STRING(libxul-sdk,
4181
[ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
4182
LIBXUL_SDK_DIR=$withval)
4184
if test "$LIBXUL_SDK_DIR" = "yes"; then
4185
AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4186
elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4187
LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4189
if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
4190
AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
4195
AC_SUBST(LIBXUL_SDK)
4197
if test -n "$LIBXUL_SDK"; then
4198
LIBXUL_DIST="$LIBXUL_SDK"
4200
LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
4202
AC_SUBST(LIBXUL_DIST)
4206
MOZ_ARG_WITH_BOOL(system-libxul,
4207
[ --with-system-libxul Use system installed libxul SDK],
4210
if test -n "$SYSTEM_LIBXUL" && test -z "$MOZ_ENABLE_LIBXUL"; then
4211
AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
4214
dnl ========================================================
4215
dnl = If NSPR was not detected in the system,
4216
dnl = use the one in the source tree (mozilla/nsprpub)
4217
dnl ========================================================
4218
MOZ_ARG_WITH_BOOL(system-nspr,
4219
[ --with-system-nspr Use system installed NSPR],
4220
_USE_SYSTEM_NSPR=1 )
4222
if test -n "$_USE_SYSTEM_NSPR"; then
4223
AM_PATH_NSPR(4.8.0, [MOZ_NATIVE_NSPR=1], [MOZ_NATIVE_NSPR=])
4226
if test -n "$MOZ_NATIVE_NSPR"; then
4227
_SAVE_CFLAGS=$CFLAGS
4228
CFLAGS="$CFLAGS $NSPR_CFLAGS"
4229
AC_TRY_COMPILE([#include "prlog.h"],
4230
[#ifndef PR_STATIC_ASSERT
4231
#error PR_STATIC_ASSERT not defined
4233
[MOZ_NATIVE_NSPR=1],
4234
AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
4235
CFLAGS=$_SAVE_CFLAGS
4237
if test "$OS_ARCH" = "WINCE"; then
4238
NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4239
NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4240
elif test "$OS_ARCH" = "WINNT"; then
4241
NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4242
if test -n "$GNU_CC"; then
4243
NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
4245
NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4248
NSPR_CFLAGS='`$(LIBXUL_DIST)/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
4249
NSPR_LIBS='`$(LIBXUL_DIST)/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
4253
dnl ========================================================
4254
dnl = If NSS was not detected in the system,
4255
dnl = use the one in the source tree (mozilla/security/nss)
4256
dnl ========================================================
4258
MOZ_ARG_WITH_BOOL(system-nss,
4259
[ --with-system-nss Use system installed NSS],
4262
if test -n "$_USE_SYSTEM_NSS"; then
4263
AM_PATH_NSS(3.12.0, [MOZ_NATIVE_NSS=1], [MOZ_NATIVE_NSS=])
4266
if test -n "$MOZ_NATIVE_NSS"; then
4267
NSS_LIBS="$NSS_LIBS -lcrmf"
4269
NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4271
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4272
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4273
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4274
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4275
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX)"
4277
if test -z "$GNU_CC" && test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4279
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4280
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4281
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4282
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(IMPORT_LIB_SUFFIX) \
4283
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(IMPORT_LIB_SUFFIX)"
4285
NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION"
4289
if test -z "$SKIP_LIBRARY_CHECKS"; then
4290
dnl system JPEG support
4291
dnl ========================================================
4292
MOZ_ARG_WITH_STRING(system-jpeg,
4293
[ --with-system-jpeg[=PFX]
4294
Use system libjpeg [installed at prefix PFX]],
4297
_SAVE_CFLAGS=$CFLAGS
4298
_SAVE_LDFLAGS=$LDFLAGS
4300
if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4301
CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4302
LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4304
if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4307
AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4310
if test "$SYSTEM_JPEG" = 1; then
4311
LIBS="$JPEG_LIBS $LIBS"
4312
AC_TRY_COMPILE([ #include <stdio.h>
4313
#include <sys/types.h>
4314
#include <jpeglib.h> ],
4315
[ #if JPEG_LIB_VERSION < $MOZJPEG
4316
#error "Insufficient JPEG library version ($MOZJPEG required)."
4319
[SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
4321
CFLAGS=$_SAVE_CFLAGS
4322
LDFLAGS=$_SAVE_LDFLAGS
4325
if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4326
JPEG_CFLAGS="-I${JPEG_DIR}/include"
4327
JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4330
dnl system ZLIB support
4331
dnl ========================================================
4332
MOZ_ARG_WITH_STRING(system-zlib,
4333
[ --with-system-zlib[=PFX]
4334
Use system libz [installed at prefix PFX]],
4337
_SAVE_CFLAGS=$CFLAGS
4338
_SAVE_LDFLAGS=$LDFLAGS
4340
if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4341
CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4342
LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4344
if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4347
AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4348
[SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4350
if test "$SYSTEM_ZLIB" = 1; then
4351
LIBS="$ZLIB_LIBS $LIBS"
4352
AC_TRY_COMPILE([ #include <stdio.h>
4354
#include <zlib.h> ],
4355
[ #if ZLIB_VERNUM < $MOZZLIB
4356
#error "Insufficient zlib version ($MOZZLIB required)."
4359
[SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4361
CFLAGS=$_SAVE_CFLAGS
4362
LDFLAGS=$_SAVE_LDFLAGS
4365
if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4366
ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4367
ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4370
dnl system BZIP2 Support
4371
dnl ========================================================
4372
MOZ_ARG_WITH_STRING(system-bz2,
4373
[ --with-system-bz2[=PFX]
4374
Use system libbz2 [installed at prefix PFX]],
4377
_SAVE_CFLAGS=$CFLAGS
4378
_SAVE_LDFLAGS=$LDFLAGS
4380
if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4381
CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4382
LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4384
if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4387
AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4388
[SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=], $BZ2_LIBS)
4390
CFLAGS=$_SAVE_CFLAGS
4391
LDFLAGS=$_SAVE_LDFLAGS
4394
if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4395
BZ2_CFLAGS="-I${BZ2_DIR}/include"
4396
BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4399
dnl system PNG Support
4400
dnl ========================================================
4401
MOZ_ARG_WITH_STRING(system-png,
4402
[ --with-system-png[=PFX]
4403
Use system libpng [installed at prefix PFX]],
4406
_SAVE_CFLAGS=$CFLAGS
4407
_SAVE_LDFLAGS=$LDFLAGS
4409
CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4410
LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4411
if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4412
CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4413
LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4415
if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4418
_SAVE_PNG_LIBS=$PNG_LIBS
4419
AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4420
AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4422
AC_CHECK_LIB(png, png_get_acTL, ,
4423
AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4426
if test "$SYSTEM_PNG" = 1; then
4427
LIBS="$PNG_LIBS $LIBS"
4428
AC_TRY_COMPILE([ #include <stdio.h>
4429
#include <sys/types.h>
4431
[ #if PNG_LIBPNG_VER < $MOZPNG
4432
#error "Insufficient libpng version ($MOZPNG required)."
4434
#ifndef PNG_UINT_31_MAX
4435
#error "Insufficient libpng version."
4438
AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4440
CFLAGS=$_SAVE_CFLAGS
4441
LDFLAGS=$_SAVE_LDFLAGS
4444
if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4445
PNG_CFLAGS="-I${PNG_DIR}/include"
4446
PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4449
fi # SKIP_LIBRARY_CHECKS
4451
dnl system HunSpell Support
4452
dnl ========================================================
4453
MOZ_ARG_ENABLE_BOOL(system-hunspell,
4454
[ --enable-system-hunspell Use system hunspell (located with pkgconfig)],
4457
if test -n "$SYSTEM_HUNSPELL"; then
4458
PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4461
AC_SUBST(SYSTEM_HUNSPELL)
4463
dnl ========================================================
4464
dnl Java SDK support
4465
dnl ========================================================
4467
MOZ_ARG_WITH_STRING(java-include-path,
4468
[ --with-java-include-path=dir Location of Java SDK headers],
4469
JAVA_INCLUDE_PATH=$withval)
4472
MOZ_ARG_WITH_STRING(java-bin-path,
4473
[ --with-java-bin-path=dir Location of Java binaries (java, javac, jar)],
4474
JAVA_BIN_PATH=$withval)
4476
dnl ========================================================
4477
dnl Use ARM userspace kernel helpers; tell NSPR to enable
4478
dnl their usage and use them in spidermonkey.
4479
dnl ========================================================
4480
MOZ_ARG_WITH_BOOL(arm-kuser,
4481
[ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4484
if test -n "$USE_ARM_KUSER"; then
4485
AC_DEFINE(USE_ARM_KUSER)
4488
dnl ========================================================
4492
dnl ========================================================
4494
MOZ_ARG_HEADER(Application)
4498
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4499
MOZ_BRANDING_DIRECTORY=
4500
MOZ_OFFICIAL_BRANDING=
4501
MOZ_DBGRINFO_MODULES=
4503
MOZ_ENABLE_CANVAS3D=
4505
MOZ_IMG_DECODERS_DEFAULT="png gif jpeg bmp icon"
4506
MOZ_IMG_ENCODERS_DEFAULT="png jpeg"
4513
MOZ_AUTH_EXTENSION=1
4514
MOZ_NO_ACTIVEX_SUPPORT=1
4515
MOZ_NO_INSPECTOR_APIS=
4516
MOZ_NO_XPCOM_OBSOLETE=
4524
MOZ_PLAINTEXT_EDITOR_ONLY=
4526
MOZ_PREF_EXTENSIONS=1
4527
MOZ_PROFILELOCKING=1
4536
MOZ_STATIC_MAIL_BUILD=
4541
MOZ_UNIVERSALCHARDET=1
4543
MOZ_USE_NATIVE_UCONV=
4545
MOZ_XPFE_COMPONENTS=1
4547
MOZ_XSLT_STANDALONE=
4555
NECKO_PROTOCOLS_DEFAULT="about data file ftp gopher http res viewsource"
4556
NECKO_SMALL_BUFFERS=
4557
XPC_IDISPATCH_SUPPORT=
4560
case "$target_os" in
4569
case "$target_os" in
4570
msvc*|mks*|cygwin*|mingw*)
4571
if test -z "$GNU_CC"; then
4572
XPC_IDISPATCH_SUPPORT=1
4573
MOZ_NO_ACTIVEX_SUPPORT=
4578
MOZ_ARG_ENABLE_STRING(application,
4579
[ --enable-application=APP
4583
content/xslt (Standalone Transformiix XSLT)
4584
netwerk (Standalone Necko)
4585
tools/update-packaging (AUS-related packaging tools)
4586
standalone (use this for standalone
4587
xpcom/xpconnect or to manually drive a build)],
4588
[ MOZ_BUILD_APP=$enableval ] )
4590
MOZ_EMBEDDING_PROFILE=default
4591
MOZ_ARG_WITH_STRING(embedding-profile,
4592
[ --with-embedding-profile=default|basic|minimal
4593
see http://wiki.mozilla.org/Gecko:Small_Device_Support],
4594
[ MOZ_EMBEDDING_PROFILE=$withval ])
4596
case "$MOZ_EMBEDDING_PROFILE" in
4598
MOZ_EMBEDDING_LEVEL_DEFAULT=1
4599
MOZ_EMBEDDING_LEVEL_BASIC=1
4600
MOZ_EMBEDDING_LEVEL_MINIMAL=1
4601
AC_DEFINE(MOZ_EMBEDDING_LEVEL_DEFAULT)
4602
AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4603
AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4607
MOZ_EMBEDDING_LEVEL_DEFAULT=
4608
MOZ_EMBEDDING_LEVEL_BASIC=1
4609
MOZ_EMBEDDING_LEVEL_MINIMAL=1
4610
AC_DEFINE(MOZ_EMBEDDING_LEVEL_BASIC)
4611
AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4613
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4615
MOZ_ENABLE_POSTSCRIPT=
4616
MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4617
MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4618
MOZ_IMG_ENCODERS_DEFAULT=
4624
MOZ_NO_ACTIVEX_SUPPORT=1
4625
MOZ_NO_INSPECTOR_APIS=1
4626
MOZ_NO_XPCOM_OBSOLETE=1
4628
MOZ_PLAINTEXT_EDITOR_ONLY=1
4630
MOZ_PREF_EXTENSIONS=
4634
MOZ_UNIVERSALCHARDET=
4636
MOZ_USE_NATIVE_UCONV=
4638
MOZ_XPFE_COMPONENTS=
4643
NECKO_PROTOCOLS_DEFAULT="about data http file res"
4644
NECKO_SMALL_BUFFERS=1
4645
NS_DISABLE_LOGGING=1
4650
MOZ_EMBEDDING_LEVEL_DEFAULT=
4651
MOZ_EMBEDDING_LEVEL_BASIC=
4652
MOZ_EMBEDDING_LEVEL_MINIMAL=1
4653
AC_DEFINE(MOZ_EMBEDDING_LEVEL_MINIMAL)
4655
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4657
MOZ_ENABLE_POSTSCRIPT=
4658
MOZ_EXTENSIONS_DEFAULT=" spatialnavigation"
4659
MOZ_IMG_DECODERS_DEFAULT="png gif jpeg"
4660
MOZ_IMG_ENCODERS_DEFAULT=
4666
MOZ_NO_ACTIVEX_SUPPORT=1
4667
MOZ_NO_INSPECTOR_APIS=1
4668
MOZ_NO_XPCOM_OBSOLETE=1
4670
MOZ_PLAINTEXT_EDITOR_ONLY=1
4672
MOZ_PREF_EXTENSIONS=
4678
MOZ_UNIVERSALCHARDET=
4680
MOZ_USE_NATIVE_UCONV=1
4682
MOZ_XPFE_COMPONENTS=
4689
NECKO_PROTOCOLS_DEFAULT="about data http file res"
4690
NECKO_SMALL_BUFFERS=1
4691
NS_DISABLE_LOGGING=1
4696
AC_MSG_ERROR([Unrecognized value: --with-embedding-profile=$MOZ_EMBEDDING_PROFILE])
4700
AC_SUBST(MOZ_EMBEDDING_LEVEL_DEFAULT)
4701
AC_SUBST(MOZ_EMBEDDING_LEVEL_BASIC)
4702
AC_SUBST(MOZ_EMBEDDING_LEVEL_MINIMAL)
4704
MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4705
[ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4706
XULRUNNER_STUB_NAME=$withval)
4708
if test -z "$XULRUNNER_STUB_NAME"; then
4709
case "$target_os" in
4711
XULRUNNER_STUB_NAME=xulrunner
4714
XULRUNNER_STUB_NAME=xulrunner-stub
4717
AC_SUBST(XULRUNNER_STUB_NAME)
4719
if test -z "$MOZ_BUILD_APP"; then
4720
AC_MSG_ERROR([--enable-application=APP was not specified and is required.])
4722
# We have a valid application only if it has a build.mk file in its top
4724
if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4725
AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4729
# Allow the application to influence configure with a confvars.sh script.
4731
AC_MSG_CHECKING([if app-specific confvars.sh exists])
4732
if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4733
AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4734
. "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4739
# Now is a good time to test for logic errors, define mismatches, etc.
4740
case "$MOZ_BUILD_APP" in
4742
if test "$LIBXUL_SDK"; then
4743
AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4748
# Special cases where we need to AC_DEFINE something. Also a holdover for apps
4749
# that haven't made a confvars.sh yet. Don't add new stuff here, use
4751
case "$MOZ_BUILD_APP" in
4753
AC_DEFINE(MOZ_PHOENIX)
4757
AC_DEFINE(MOZ_XULRUNNER)
4765
MOZ_APP_NAME=mozilla
4766
MOZ_APP_DISPLAYNAME=Mozilla
4767
MOZ_APP_VERSION=$MOZILLA_VERSION
4772
AC_SUBST(MOZ_BUILD_APP)
4773
AC_SUBST(MOZ_PHOENIX)
4774
AC_SUBST(MOZ_XULRUNNER)
4776
AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4778
dnl ========================================================
4780
dnl = Toolkit Options
4782
dnl ========================================================
4783
MOZ_ARG_HEADER(Toolkit Options)
4785
dnl ========================================================
4786
dnl = Select the default toolkit
4787
dnl ========================================================
4788
MOZ_ARG_ENABLE_STRING(default-toolkit,
4789
[ --enable-default-toolkit=TK
4790
Select default toolkit
4791
Platform specific defaults:
4793
Mac OS X - cairo-cocoa
4794
Neutrino/QNX - photon
4796
Win32/WinCE - cairo-windows
4797
Gtk2 with DirectFB - cairo-gtk2-dfb
4800
[ _DEFAULT_TOOLKIT=$enableval ],
4801
[ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4803
if test "$_DEFAULT_TOOLKIT" = "photon" \
4804
-o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4805
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4806
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
4807
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4808
-o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4809
-o "$_DEFAULT_TOOLKIT" = "cairo-beos" \
4810
-o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4811
-o "$_DEFAULT_TOOLKIT" = "cairo-cocoa"
4813
dnl nglayout only supports building with one toolkit,
4814
dnl so ignore everything after the first comma (",").
4815
MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4817
AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4820
AC_DEFINE_UNQUOTED(MOZ_DEFAULT_TOOLKIT,"$MOZ_WIDGET_TOOLKIT")
4822
dnl ========================================================
4823
dnl = Enable the toolkit as needed =
4824
dnl ========================================================
4826
case "$MOZ_WIDGET_TOOLKIT" in
4829
AC_DEFINE(MOZ_WIDGET_PHOTON)
4833
MOZ_WIDGET_TOOLKIT=windows
4834
MOZ_GFX_TOOLKIT=cairo
4837
cairo-gtk2|cairo-gtk2-x11)
4838
MOZ_WIDGET_TOOLKIT=gtk2
4839
MOZ_GFX_TOOLKIT=cairo
4841
MOZ_ENABLE_XREMOTE=1
4847
TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4848
TK_LIBS='$(MOZ_GTK2_LIBS)'
4849
AC_DEFINE(MOZ_WIDGET_GTK2)
4853
MOZ_WIDGET_TOOLKIT=gtk2
4854
MOZ_GFX_TOOLKIT=cairo
4860
TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4861
TK_LIBS='$(MOZ_GTK2_LIBS)'
4862
AC_DEFINE(MOZ_WIDGET_GTK2)
4863
if test "$no_x" != "yes"; then
4864
AC_MSG_WARN([Disabling X when DirectFB is specified.])
4870
MOZ_WIDGET_TOOLKIT=qt
4871
MOZ_GFX_TOOLKIT=cairo
4873
MOZ_ENABLE_XREMOTE=1
4881
TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4882
TK_LIBS='$(MOZ_QT_LIBS)'
4883
AC_DEFINE(MOZ_WIDGET_QT)
4887
MOZ_WIDGET_TOOLKIT=beos
4888
MOZ_GFX_TOOLKIT=cairo
4890
TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4891
TK_LIBS='$(MOZ_CAIRO_LIBS)'
4895
MOZ_WIDGET_TOOLKIT=os2
4896
MOZ_GFX_TOOLKIT=cairo
4898
TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
4899
TK_LIBS='$(MOZ_CAIRO_LIBS)'
4903
MOZ_WIDGET_TOOLKIT=cocoa
4904
AC_DEFINE(MOZ_WIDGET_COCOA)
4906
MOZ_GFX_TOOLKIT=cairo
4907
MOZ_USER_DIR="Mozilla"
4908
AC_DEFINE(XP_MACOSX)
4909
AC_DEFINE(TARGET_CARBON)
4910
AC_DEFINE(TARGET_API_MAC_CARBON)
4911
TK_LIBS='-framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook'
4912
TK_CFLAGS="-DNO_X11"
4913
LDFLAGS="$LDFLAGS -framework Cocoa"
4914
CFLAGS="$CFLAGS $TK_CFLAGS"
4915
CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4916
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL -lobjc'
4917
MOZ_FS_LAYOUT=bundle
4921
if test "$MOZ_ENABLE_XREMOTE"; then
4922
AC_DEFINE(MOZ_ENABLE_XREMOTE)
4925
if test "$COMPILE_ENVIRONMENT"; then
4926
if test "$MOZ_ENABLE_GTK2"; then
4927
if test "$MOZ_X11"; then
4928
GDK_PACKAGES=gdk-x11-2.0
4929
elif test "$MOZ_DFB"; then
4930
PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
4931
GDK_PACKAGES=directfb
4934
PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4937
fi # COMPILE_ENVIRONMENT
4939
AC_SUBST(MOZ_DEFAULT_TOOLKIT)
4940
AC_SUBST(MOZ_FS_LAYOUT)
4942
dnl ========================================================
4943
dnl = startup-notification support module
4944
dnl ========================================================
4946
if test "$MOZ_ENABLE_GTK2"
4948
MOZ_ENABLE_STARTUP_NOTIFICATION=
4950
MOZ_ARG_ENABLE_BOOL(startup-notification,
4951
[ --enable-startup-notification Enable startup-notification support (default: disabled) ],
4952
MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4953
MOZ_ENABLE_STARTUP_NOTIFICATION=)
4954
if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4956
PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4957
libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4958
[MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4959
if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4961
AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4963
MOZ_ENABLE_STARTUP_NOTIFICATION=
4967
if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4968
AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4971
TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4973
AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4974
AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4975
AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4977
dnl ========================================================
4979
dnl ========================================================
4980
if test "$MOZ_ENABLE_QT"
4982
PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtUiTools QtCore)
4983
AC_SUBST(MOZ_QT_CFLAGS)
4984
AC_SUBST(MOZ_QT_LIBS)
4986
MOZ_ARG_WITH_STRING(qtdir,
4987
[ --with-qtdir=\$dir Specify Qt directory ],
4990
if test -z "$QTDIR"; then
4993
QTINCDIR="/include/qt"
4994
if test ! -d "$QTDIR$QTINCDIR"; then
4995
QTINCDIR="/include/X11/qt"
4997
if test ! -d "$QTDIR$QTINCDIR"; then
5001
if test -x "$QTDIR/bin/moc-qt4"; then
5002
HOST_MOC="$QTDIR/bin/moc-qt4"
5004
if test -x "$QTDIR/bin/moc"; then
5005
HOST_MOC="$QTDIR/bin/moc"
5007
AC_CHECK_PROGS(HOST_MOC, moc, "")
5010
if test -z "$HOST_MOC"; then
5011
AC_MSG_ERROR([no acceptable moc preprocessor found])
5016
AC_SUBST(GTK_CONFIG)
5020
AC_SUBST(MOZ_ENABLE_GTK2)
5021
AC_SUBST(MOZ_ENABLE_PHOTON)
5022
AC_SUBST(MOZ_ENABLE_COCOA)
5023
AC_SUBST(MOZ_ENABLE_QT)
5024
AC_SUBST(MOZ_ENABLE_XREMOTE)
5025
AC_SUBST(MOZ_GTK2_CFLAGS)
5026
AC_SUBST(MOZ_GTK2_LIBS)
5027
AC_SUBST(MOZ_QT_CFLAGS)
5028
AC_SUBST(MOZ_QT_LIBS)
5035
dnl ========================================================
5037
dnl = Components & Features
5039
dnl ========================================================
5040
MOZ_ARG_HEADER(Components and Features)
5042
dnl ========================================================
5043
dnl = Enable obsolete Open JVM Interface (OJI) support on OS X
5044
dnl ========================================================
5057
dnl ========================================================
5059
dnl ========================================================
5060
MOZ_ARG_ENABLE_STRING(ui-locale,
5061
[ --enable-ui-locale=ab-CD
5062
Select the user interface locale (default: en-US)],
5063
MOZ_UI_LOCALE=$enableval )
5064
AC_SUBST(MOZ_UI_LOCALE)
5066
dnl ========================================================
5067
dnl = Trademarked Branding
5068
dnl ========================================================
5069
MOZ_ARG_ENABLE_BOOL(official-branding,
5070
[ --enable-official-branding Enable Official mozilla.org Branding
5071
Do not distribute builds with
5072
--enable-official-branding unless you have
5073
permission to use trademarks per
5074
http://www.mozilla.org/foundation/trademarks/ .],
5076
if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
5077
AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
5079
MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
5080
MOZ_OFFICIAL_BRANDING=1
5082
], MOZ_OFFICIAL_BRANDING=)
5084
AC_SUBST(MOZ_OFFICIAL_BRANDING)
5085
if test -n "$MOZ_OFFICIAL_BRANDING"; then
5086
AC_DEFINE(MOZ_OFFICIAL_BRANDING)
5089
MOZ_ARG_WITH_STRING(branding,
5090
[ --with-branding=dir Use branding from the specified directory.],
5091
MOZ_BRANDING_DIRECTORY=$withval)
5093
REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
5094
if test -z "$REAL_BRANDING_DIRECTORY"; then
5095
REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5098
if test -f "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"; then
5099
. "$topsrcdir/$REAL_BRANDING_DIRECTORY/configure.sh"
5102
AC_SUBST(MOZ_BRANDING_DIRECTORY)
5104
dnl ========================================================
5105
dnl = Distribution ID
5106
dnl ========================================================
5107
MOZ_ARG_WITH_STRING(distribution-id,
5108
[ --with-distribution-id=ID Set distribution-specific id (default=org.mozilla)],
5109
[ val=`echo $withval`
5110
MOZ_DISTRIBUTION_ID="$val"])
5112
if test -z "$MOZ_DISTRIBUTION_ID"; then
5113
MOZ_DISTRIBUTION_ID="org.mozilla"
5116
AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
5117
AC_SUBST(MOZ_DISTRIBUTION_ID)
5120
dnl ========================================================
5121
dnl complex text support off by default
5122
dnl ========================================================
5124
MOZ_ARG_DISABLE_BOOL(pango,
5125
[ --disable-pango Disable usage of Pango ],
5130
dnl ========================================================
5132
dnl ========================================================
5133
if test "$MOZ_ENABLE_GTK2"
5137
PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
5139
if test "$MOZ_PANGO"
5141
PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5142
AC_SUBST(MOZ_PANGO_CFLAGS)
5143
AC_SUBST(MOZ_PANGO_LIBS)
5144
AC_DEFINE(MOZ_PANGO)
5146
PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION)
5147
AC_SUBST(MOZ_PANGO_CFLAGS)
5148
AC_SUBST(MOZ_PANGO_LIBS)
5150
PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
5151
AC_SUBST(FT2_CFLAGS)
5156
dnl ========================================================
5157
dnl = PostScript print module
5158
dnl ========================================================
5159
MOZ_ARG_DISABLE_BOOL(postscript,
5160
[ --disable-postscript Disable PostScript printing support ],
5161
MOZ_ENABLE_POSTSCRIPT=,
5162
MOZ_ENABLE_POSTSCRIPT=1 )
5164
dnl ========================================================
5165
dnl = GnomeVFS support module
5166
dnl ========================================================
5170
dnl build the gnomevfs extension by default only when the
5171
dnl GTK2 toolkit is in use.
5172
if test "$MOZ_ENABLE_GTK2"
5174
MOZ_ENABLE_GNOMEVFS=1
5178
MOZ_ARG_DISABLE_BOOL(gnomevfs,
5179
[ --disable-gnomevfs Disable GnomeVFS support ],
5180
MOZ_ENABLE_GNOMEVFS=,
5181
MOZ_ENABLE_GNOMEVFS=force)
5183
if test "$MOZ_ENABLE_GNOMEVFS"
5185
PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5186
MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5187
MOZ_ENABLE_GNOMEVFS=1
5188
AC_DEFINE(MOZ_ENABLE_GNOMEVFS)
5190
if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5192
AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5194
MOZ_ENABLE_GNOMEVFS=
5198
AC_SUBST(MOZ_ENABLE_GNOMEVFS)
5199
AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5200
AC_SUBST(MOZ_GNOMEVFS_LIBS)
5202
if test "$MOZ_ENABLE_GCONF"
5204
PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION,[
5205
MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5212
if test "$MOZ_ENABLE_GCONF"; then
5213
AC_DEFINE(MOZ_ENABLE_GCONF)
5216
AC_SUBST(MOZ_ENABLE_GCONF)
5217
AC_SUBST(MOZ_GCONF_CFLAGS)
5218
AC_SUBST(MOZ_GCONF_LIBS)
5220
# The GNOME component is built if gtk2, gconf and gnome-vfs
5221
# are all available.
5223
if test "$MOZ_ENABLE_GTK2" -a "$MOZ_ENABLE_GCONF" -a \
5224
"$MOZ_ENABLE_GNOMEVFS"; then
5225
MOZ_ENABLE_GNOME_COMPONENT=1
5227
MOZ_ENABLE_GNOME_COMPONENT=
5230
AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5233
dnl ========================================================
5234
dnl = libgnomeui support module
5235
dnl ========================================================
5237
if test "$MOZ_ENABLE_GTK2"
5239
MOZ_ENABLE_GNOMEUI=1
5241
MOZ_ARG_DISABLE_BOOL(gnomeui,
5242
[ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
5243
MOZ_ENABLE_GNOMEUI=,
5244
MOZ_ENABLE_GNOMEUI=force)
5246
if test "$MOZ_ENABLE_GNOMEUI"
5248
PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5250
MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5251
MOZ_ENABLE_GNOMEUI=1
5253
if test "$MOZ_ENABLE_GNOMEUI" = "force"
5255
AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5261
if test "$MOZ_ENABLE_GNOMEUI"; then
5262
AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5265
AC_SUBST(MOZ_ENABLE_GNOMEUI)
5266
AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5267
AC_SUBST(MOZ_GNOMEUI_LIBS)
5269
dnl ========================================================
5271
dnl ========================================================
5273
if test "$MOZ_ENABLE_GTK2" || test "$MOZ_ENABLE_QT"
5277
MOZ_ARG_DISABLE_BOOL(dbus,
5278
[ --disable-dbus Disable dbus support ],
5282
if test "$MOZ_ENABLE_DBUS"
5284
PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5285
AC_DEFINE(MOZ_ENABLE_DBUS)
5288
AC_SUBST(MOZ_ENABLE_DBUS)
5289
AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5290
AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5292
dnl ========================================================
5293
dnl = libnotify support
5294
dnl ========================================================
5296
if test "$MOZ_ENABLE_GTK2"
5298
MOZ_ENABLE_LIBNOTIFY=1
5300
MOZ_ARG_DISABLE_BOOL(libnotify,
5301
[ --disable-libnotify Disable libnotify support ],
5302
MOZ_ENABLE_LIBNOTIFY=,
5303
MOZ_ENABLE_LIBNOTIFY=1)
5305
if test "$MOZ_ENABLE_LIBNOTIFY"
5307
AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
5311
if test -z "$SKIP_LIBRARY_CHECKS"
5313
if test "$MOZ_ENABLE_GTK2"
5315
if test "$MOZ_ENABLE_LIBNOTIFY"
5317
PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
5321
AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
5322
AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
5323
AC_SUBST(MOZ_LIBNOTIFY_LIBS)
5325
dnl ========================================================
5326
dnl = Build Personal Security Manager
5327
dnl ========================================================
5328
MOZ_ARG_DISABLE_BOOL(crypto,
5329
[ --disable-crypto Disable crypto support (Personal Security Manager)],
5333
dnl ========================================================
5334
dnl = JS Debugger XPCOM component (js/jsd)
5335
dnl ========================================================
5336
MOZ_ARG_DISABLE_BOOL(jsd,
5337
[ --disable-jsd Disable JavaScript debug library],
5342
dnl ========================================================
5343
dnl = Disable plugin support
5344
dnl ========================================================
5345
MOZ_ARG_DISABLE_BOOL(plugins,
5346
[ --disable-plugins Disable plugins support],
5350
dnl ========================================================
5351
dnl = Disable building dbm
5352
dnl ========================================================
5353
MOZ_ARG_DISABLE_BOOL(dbm,
5354
[ --disable-dbm Disable building dbm],
5358
dnl bi-directional support always on
5362
dnl ========================================================
5363
dnl view source support on by default
5364
dnl ========================================================
5365
MOZ_ARG_DISABLE_BOOL(view-source,
5366
[ --disable-view-source Disable view source support],
5369
if test "$MOZ_VIEW_SOURCE"; then
5370
AC_DEFINE(MOZ_VIEW_SOURCE)
5374
dnl ========================================================
5375
dnl accessibility support on by default on all platforms
5377
dnl ========================================================
5378
MOZ_ARG_DISABLE_BOOL(accessibility,
5379
[ --disable-accessibility Disable accessibility support (off by default on OS X)],
5382
if test "$ACCESSIBILITY"; then
5383
AC_DEFINE(ACCESSIBILITY)
5386
if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
5388
*-mingw*|*-cygwin*|*-msvc*|*-mks*)
5389
if test "$ac_cv_header_atlbase_h" = "no"; then
5390
AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
5392
if test "$ac_cv_header_oleacc_idl" = "no"; then
5393
AC_MSG_ERROR([System header oleacc.idl is not available. See http://developer.mozilla.org/en/docs/oleacc.idl for details on fixing this problem.])
5399
dnl ========================================================
5400
dnl xpfe/components on by default
5401
dnl ========================================================
5402
MOZ_ARG_DISABLE_BOOL(xpfe-components,
5403
[ --disable-xpfe-components
5404
Disable xpfe components],
5405
MOZ_XPFE_COMPONENTS=,
5406
MOZ_XPFE_COMPONENTS=1 )
5408
dnl ========================================================
5409
dnl xpinstall support on by default
5410
dnl ========================================================
5411
MOZ_ARG_DISABLE_BOOL(xpinstall,
5412
[ --disable-xpinstall Disable xpinstall support],
5415
if test "$MOZ_XPINSTALL"; then
5416
AC_DEFINE(MOZ_XPINSTALL)
5419
dnl ========================================================
5420
dnl xpcom js loader support on by default
5421
dnl ========================================================
5422
MOZ_ARG_DISABLE_BOOL(jsloader,
5423
[ --disable-jsloader Disable xpcom js loader support],
5426
if test "$MOZ_JSLOADER"; then
5427
AC_DEFINE(MOZ_JSLOADER)
5430
dnl ========================================================
5431
dnl Disable printing
5432
dnl ========================================================
5433
MOZ_ARG_DISABLE_BOOL(printing,
5434
[ --disable-printing Disable printing support],
5438
if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
5439
AC_MSG_WARN([Printing does not work with Qt at this time. Omitting printing support.])
5443
if test "$NS_PRINTING"; then
5444
AC_DEFINE(NS_PRINTING)
5445
AC_DEFINE(NS_PRINT_PREVIEW)
5448
dnl ========================================================
5449
dnl use native unicode converters
5450
dnl ========================================================
5451
MOZ_ARG_ENABLE_BOOL(native-uconv,
5452
[ --enable-native-uconv Enable iconv support],
5453
MOZ_USE_NATIVE_UCONV=1,
5454
MOZ_USE_NATIVE_UCONV= )
5455
if test "$MOZ_USE_NATIVE_UCONV"; then
5456
AC_DEFINE(MOZ_USE_NATIVE_UCONV)
5458
if test "$OS_ARCH" != "WINCE" -a "$OS_ARCH" != "WINNT" -a "$MOZ_USE_NATIVE_UCONV" -a "$ac_cv_func_iconv" != "yes"; then
5459
AC_MSG_ERROR([iconv() not found. Cannot enable native uconv support.])
5463
dnl ========================================================
5464
dnl Libeditor can be build as plaintext-only,
5465
dnl or as a full html and text editing component.
5466
dnl We build both by default.
5467
dnl ========================================================
5468
MOZ_ARG_ENABLE_BOOL(plaintext-editor-only,
5469
[ --enable-plaintext-editor-only
5470
Allow only plaintext editing],
5471
MOZ_PLAINTEXT_EDITOR_ONLY=1,
5472
MOZ_PLAINTEXT_EDITOR_ONLY= )
5473
dnl Note the #define is MOZILLA, not MOZ, for compat with the Mac build.
5474
AC_SUBST(MOZ_PLAINTEXT_EDITOR_ONLY)
5476
dnl ========================================================
5477
dnl = Drop XPCOM Obsolete library
5478
dnl ========================================================
5479
MOZ_ARG_DISABLE_BOOL(xpcom-obsolete,
5480
[ --disable-xpcom-obsolete Disable XPCOM Obsolete Library],
5481
MOZ_NO_XPCOM_OBSOLETE=1,
5482
MOZ_NO_XPCOM_OBSOLETE=)
5484
if test -n "$MOZ_NO_XPCOM_OBSOLETE"; then
5485
AC_DEFINE(MOZ_NO_XPCOM_OBSOLETE)
5488
dnl ========================================================
5489
dnl = Disable Fast Load
5490
dnl ========================================================
5491
MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5492
[ --disable-xpcom-fastload Disable XPCOM fastload support],
5496
AC_SUBST(MOZ_NO_FAST_LOAD)
5498
if test -n "$MOZ_NO_FAST_LOAD"; then
5499
AC_DEFINE(MOZ_NO_FAST_LOAD)
5502
dnl ========================================================
5503
dnl = Disable Ogg Codecs
5504
dnl ========================================================
5505
MOZ_ARG_DISABLE_BOOL(ogg,
5506
[ --disable-ogg Disable Ogg Codec support],
5512
if test -n "$MOZ_OGG"; then
5517
dnl Checks for __attribute__(aligned()) directive
5518
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5519
[ac_cv_c_attribute_aligned],
5520
[ac_cv_c_attribute_aligned=0
5521
CFLAGS_save="${CFLAGS}"
5522
CFLAGS="${CFLAGS} -Werror"
5523
for ac_cv_c_attr_align_try in 64 32 16 8; do
5524
echo "trying $ac_cv_c_attr_align_try"
5526
[static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5527
[ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5528
if test "$ac_cv_c_attribute_aligned" != 0; then
5532
CFLAGS="${CFLAGS_save}"])
5533
if test "${ac_cv_c_attribute_aligned}" != "0"; then
5534
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5535
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5539
dnl ========================================================
5540
dnl = Disable Wave decoder support
5541
dnl ========================================================
5542
MOZ_ARG_DISABLE_BOOL(wave,
5543
[ --disable-wave Disable Wave decoder support],
5549
if test -n "$MOZ_WAVE"; then
5555
dnl ========================================================
5556
dnl = Handle dependent SYDNEYAUDIO and MEDIA defines
5557
dnl ========================================================
5559
AC_SUBST(MOZ_SYDNEYAUDIO)
5561
if test -n "$MOZ_SYDNEYAUDIO"; then
5562
AC_DEFINE(MOZ_SYDNEYAUDIO)
5567
if test -n "$MOZ_MEDIA"; then
5568
AC_DEFINE(MOZ_MEDIA)
5571
dnl ========================================================
5572
dnl = Check alsa availability on Linux if using sydneyaudio
5573
dnl ========================================================
5575
dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5576
if test "$COMPILE_ENVIRONMENT"; then
5577
if test -n "$MOZ_SYDNEYAUDIO"; then
5578
case "$target_os" in
5580
AC_CHECK_LIB(asound, snd_pcm_open,,AC_MSG_ERROR([Ogg support on Linux requires the alsa library]))
5586
dnl ========================================================
5588
dnl ========================================================
5589
AC_ARG_ENABLE(splashscreen,
5590
[ --enable-splashscreen display splashscreen while loading (default=no)],
5591
[enable_splash="yes"],[enable_splash=""])
5592
if test "x$enable_splash" = "xyes"; then
5594
AC_DEFINE(MOZ_SPLASHSCREEN)
5596
AC_SUBST(MOZ_SPLASHSCREEN)
5598
dnl ========================================================
5599
dnl Permissions System
5600
dnl ========================================================
5601
MOZ_ARG_DISABLE_BOOL(permissions,
5602
[ --disable-permissions Disable permissions (popup and cookie blocking)],
5607
dnl ========================================================
5609
dnl ========================================================
5610
MOZ_ARG_DISABLE_BOOL(negotiateauth,
5611
[ --disable-negotiateauth Disable GSS-API negotiation ],
5612
MOZ_AUTH_EXTENSION=,
5613
MOZ_AUTH_EXTENSION=1 )
5615
dnl ========================================================
5617
dnl ========================================================
5618
MOZ_ARG_DISABLE_BOOL(xtf,
5619
[ --disable-xtf Disable XTF (pluggable xml tags) support],
5622
if test "$MOZ_XTF"; then
5626
dnl ========================================================
5628
dnl ========================================================
5629
MOZ_ARG_DISABLE_BOOL(inspector-apis,
5630
[ --disable-inspector-apis Disable the DOM inspection APIs ],
5631
MOZ_NO_INSPECTOR_APIS=1,
5632
MOZ_NO_INSPECTOR_APIS= )
5634
dnl ========================================================
5635
dnl Pref extensions (autoconfig and system-pref)
5636
dnl ========================================================
5637
MOZ_ARG_DISABLE_BOOL(pref-extensions,
5638
[ --disable-pref-extensions
5639
Disable pref extensions such as autoconfig and
5641
MOZ_PREF_EXTENSIONS=,
5642
MOZ_PREF_EXTENSIONS=1 )
5644
dnl ========================================================
5645
dnl = Universalchardet
5646
dnl ========================================================
5647
MOZ_ARG_DISABLE_BOOL(universalchardet,
5648
[ --disable-universalchardet
5649
Disable universal encoding detection],
5650
MOZ_UNIVERSALCHARDET=,
5651
MOZ_UNIVERSALCHARDET=1 )
5653
dnl ========================================================
5655
dnl ========================================================
5656
MOZ_ARG_ENABLE_BOOL(javaxpcom,
5657
[ --enable-javaxpcom
5658
Enable Java-XPCOM bridge],
5662
if test -n "${MOZ_JAVAXPCOM}"; then
5665
if test -n "$JAVA_HOME"; then
5666
JAVA_HOME=`cygpath -u \`cygpath -m -s "$JAVA_HOME"\``
5670
if test -n "$JAVA_HOME"; then
5671
JAVA_HOME=`cd "$JAVA_HOME" && pwd`
5676
if test -n "${JAVA_INCLUDE_PATH}"; then
5677
dnl Make sure jni.h exists in the given include path.
5678
if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5679
AC_MSG_ERROR([jni.h was not found in given include path $JAVA_INCLUDE_PATH.])
5682
case "$target_os" in
5684
dnl Default to java system location
5685
JAVA_INCLUDE_PATH=/System/Library/Frameworks/JavaVM.framework/Headers
5689
JAVA_INCLUDE_PATH="$JAVA_HOME/include"
5692
if test ! -f "$JAVA_INCLUDE_PATH/jni.h"; then
5693
AC_MSG_ERROR([The header jni.h was not found. Set \$JAVA_HOME to your java sdk directory, use --with-java-bin-path={java-bin-dir}, or reconfigure with --disable-javaxpcom.])
5697
if test -n "${JAVA_BIN_PATH}"; then
5698
dnl Look for javac and jar in the specified path.
5699
JAVA_PATH="$JAVA_BIN_PATH"
5701
dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5702
JAVA_PATH="$JAVA_HOME/bin:$PATH"
5705
MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5706
MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5707
MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5708
if test -z "$JAVA" || test "$JAVA" = ":" || test -z "$JAVAC" || test "$JAVAC" = ":" || test -z "$JAR" || test "$JAR" = ":"; then
5709
AC_MSG_ERROR([The programs java, javac and jar were not found. Set \$JAVA_HOME to your java sdk directory, use --with-java-bin-path={java-bin-dir}, or reconfigure with --disable-javaxpcom.])
5713
dnl ========================================================
5714
dnl = Breakpad crash reporting (on by default on supported platforms)
5715
dnl ========================================================
5717
if (test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC" \
5718
|| test "$OS_ARCH" = "Darwin" \
5719
|| test "$OS_ARCH" = "Linux" -a "$CPU_ARCH" = "x86" \
5720
|| test "$OS_ARCH" = "SunOS") \
5721
&& test -z "$HAVE_64BIT_OS"; then
5725
MOZ_ARG_DISABLE_BOOL(crashreporter,
5726
[ --disable-crashreporter Disable breakpad crash reporting],
5728
MOZ_CRASHREPORTER=1)
5730
if test -n "$MOZ_CRASHREPORTER"; then
5731
AC_DEFINE(MOZ_CRASHREPORTER)
5733
if (test "$OS_ARCH" = "Linux" || test "$OS_ARCH" = "SunOS") && \
5734
test -z "$SKIP_LIBRARY_CHECKS"; then
5735
PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5736
AC_SUBST(MOZ_GTHREAD_CFLAGS)
5737
AC_SUBST(MOZ_GTHREAD_LIBS)
5739
AC_CHECK_HEADERS([curl/curl.h], [], [AC_MSG_ERROR([Couldn't find curl/curl.h which is required for the crash reporter. Use --disable-crashreporter to disable the crash reporter.])])
5743
MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5744
[ --with-crashreporter-enable-percent=NN Enable sending crash reports by default on NN% of users. (default=100)],
5745
[ val=`echo $withval | sed 's/[^0-9]//g'`
5746
MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5748
if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5749
MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5751
AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5753
dnl ========================================================
5754
dnl = Enable compilation of specific extension modules
5755
dnl ========================================================
5757
MOZ_ARG_ENABLE_STRING(extensions,
5758
[ --enable-extensions Enable extensions],
5759
[ for option in `echo $enableval | sed 's/,/ /g'`; do
5760
if test "$option" = "yes" || test "$option" = "all"; then
5761
AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5762
elif test "$option" = "no" || test "$option" = "none"; then
5764
elif test "$option" = "default"; then
5765
MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5766
elif test `echo "$option" | grep -c \^-` != 0; then
5767
option=`echo $option | sed 's/^-//'`
5768
MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5770
MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5773
MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5775
if test -z "$MOZ_ENABLE_GNOMEVFS" && test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5776
# Suppress warning on non-X11 platforms
5777
if test -n "$MOZ_X11"; then
5778
AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5780
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5783
if test -z "$MOZ_JSDEBUGGER" && test `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5784
AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5785
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5788
dnl This might be temporary: build tridentprofile only on Windows
5789
if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0 && test "$OS_ARCH" != "WINNT"; then
5790
AC_MSG_WARN([tridentprofile extension works only on Windows at this time. Removing tridentprofile from MOZ_EXTENSIONS.])
5791
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5794
dnl cookie must be built before tridentprofile. put it at list's end.
5795
if test `echo "$MOZ_EXTENSIONS" | grep -c tridentprofile` -ne 0; then
5796
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|tridentprofile||'`
5797
MOZ_EXTENSIONS="$MOZ_EXTENSIONS tridentprofile"
5800
dnl xforms requires xtf and schema-validation
5801
if test -z "$MOZ_XTF" && test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5802
AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5803
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5805
if test `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0 && test `echo "$MOZ_EXTENSIONS" | grep -c schema-validation` -eq 0; then
5806
AC_MSG_WARN([Cannot build XForms without schema validation. Removing XForms from MOZ_EXTENSIONS.])
5807
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
5810
if test `echo "$MOZ_EXTENSIONS" | grep -c auth` -ne 0; then
5811
AC_MSG_WARN([auth is no longer an extension, use --disable-negotiateauth to disable.])
5812
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|auth||g'`
5815
if test `echo "$MOZ_EXTENSIONS" | grep -c 'cookie\|permissions'` -ne 0; then
5816
AC_MSG_WARN([cookie and permissions are no longer extensions, use --disable-permissions to disable.])
5817
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|cookie||g; s|permissions||g'`
5820
if test `echo "$MOZ_EXTENSIONS" | grep -c pref` -ne 0; then
5821
AC_MSG_WARN([pref is no longer an extension, use --disable-pref-extensions to disable.])
5822
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|pref||g'`
5825
if test `echo "$MOZ_EXTENSIONS" | grep -c universalchardet` -ne 0; then
5826
AC_MSG_WARN([universalchardet is no longer an extension, use --disable-universalchardet to disable.])
5827
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|universalchardet||g'`
5830
if test `echo "$MOZ_EXTENSIONS" | grep -c java` -ne 0; then
5831
AC_MSG_WARN([java is no longer an extension, use --enable-javaxpcom to enable.])
5832
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|java||g'`
5835
if test `echo "$MOZ_EXTENSIONS" | grep -c spellcheck` -ne 0; then
5836
AC_MSG_WARN([spellcheck is no longer an extension.])
5837
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|spellcheck||g'`
5840
if test -n "$MOZ_NO_XPCOM_OBSOLETE" && test `echo "$MOZ_EXTENSIONS" | grep -c sroaming` -ne 0; then
5841
AC_MSG_WARN([Cannot currently build sroaming without xpcom obsolete -- bug 249343. Removing sroaming from MOZ_EXTENSIONS.])
5842
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|sroaming||'`
5846
MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
5848
dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
5849
dnl when trying to build a non-existent extension.
5850
for extension in $MOZ_EXTENSIONS; do
5851
if test ! -d "${srcdir}/extensions/${extension}"; then
5852
AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
5857
dnl ========================================================
5859
dnl ========================================================
5860
case "$MOZ_WIDGET_TOOLKIT" in
5861
beos|windows|os2|mac|cocoa)
5864
if test -z "$MOZ_ENABLE_GTK2" && test -z "$MOZ_ENABLE_QT"; then
5865
MOZ_IMG_DECODERS_DEFAULT=`echo $MOZ_IMG_DECODERS_DEFAULT | sed -e 's|icon||'`
5870
MOZ_ARG_ENABLE_STRING(image-decoders,
5871
[ --enable-image-decoders[={mod1,mod2,default,all,none}]
5872
Enable specific image decoders],
5873
[ for option in `echo $enableval | sed 's/,/ /g'`; do
5874
if test "$option" = "yes" || test "$option" = "all"; then
5875
MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5876
elif test "$option" = "no" || test "$option" = "none"; then
5878
elif test "$option" = "default"; then
5879
MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $MOZ_IMG_DECODERS_DEFAULT"
5880
elif test `echo "$option" | grep -c \^-` != 0; then
5881
option=`echo $option | sed 's/^-//'`
5882
MOZ_IMG_DECODERS=`echo "$MOZ_IMG_DECODERS" | sed "s/ ${option}//"`
5884
MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS $option"
5887
MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS_DEFAULT")
5889
dnl Dupes are removed in the encoder section because it will also add decoders
5891
dnl ========================================================
5893
dnl ========================================================
5894
MOZ_ARG_ENABLE_STRING(image-encoders,
5895
[ --enable-image-encoders[={mod1,mod2,default,all,none}]
5896
Enable specific image encoders],
5897
[ for option in `echo $enableval | sed 's/,/ /g'`; do
5898
if test "$option" = "yes" || test "$option" = "all"; then
5899
addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5900
elif test "$option" = "no" || test "$option" = "none"; then
5903
elif test "$option" = "default"; then
5904
addencoder="$MOZ_IMG_ENCODERS_DEFAULT"
5905
elif test `echo "$option" | grep -c \^-` != 0; then
5906
option=`echo $option | sed 's/^-//'`
5907
addencoder=`echo "$MOZ_IMG_ENCODERS" | sed "s/ ${option}//"`
5909
addencoder="$option"
5911
MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS $addencoder"
5913
MOZ_IMG_ENCODERS="$MOZ_IMG_ENCODERS_DEFAULT")
5916
MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
5917
MOZ_IMG_ENCODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_ENCODERS}`
5919
dnl ========================================================
5920
dnl MathML on by default
5921
dnl ========================================================
5922
MOZ_ARG_DISABLE_BOOL(mathml,
5923
[ --disable-mathml Disable MathML support],
5926
if test "$MOZ_MATHML"; then
5927
AC_DEFINE(MOZ_MATHML)
5930
dnl ========================================================
5932
dnl ========================================================
5933
MOZ_ARG_DISABLE_BOOL(canvas,
5934
[ --disable-canvas Disable html:canvas feature],
5936
MOZ_ENABLE_CANVAS=1 )
5937
if test -n "$MOZ_ENABLE_CANVAS"; then
5938
AC_DEFINE(MOZ_ENABLE_CANVAS)
5940
AC_SUBST(MOZ_ENABLE_CANVAS)
5942
MOZ_ARG_ENABLE_BOOL(canvas3d,
5943
[ --enable-canvas3d Enable canvas 3D context],
5944
MOZ_ENABLE_CANVAS3D=1,
5945
MOZ_ENABLE_CANVAS3D= )
5946
if test -n "$MOZ_ENABLE_CANVAS3D"; then
5947
AC_DEFINE(MOZ_ENABLE_CANVAS3D)
5949
AC_SUBST(MOZ_ENABLE_CANVAS3D)
5951
dnl ========================================================
5953
dnl ========================================================
5954
MOZ_ARG_DISABLE_BOOL(svg,
5955
[ --disable-svg Disable SVG support],
5958
if test -n "$MOZ_SVG"; then
5962
dnl ========================================================
5964
dnl ========================================================
5965
MOZ_ARG_ENABLE_BOOL(smil,
5966
[ --enable-smil Enable SMIL animation support],
5969
# Automatically disable SMIL if SVG is disabled
5970
if test -z "$MOZ_SVG"; then
5973
if test -n "$MOZ_SMIL"; then
5977
dnl ========================================================
5978
dnl Build Freetype in the tree
5979
dnl ========================================================
5980
MOZ_ARG_ENABLE_BOOL(tree-freetype,
5981
[ --enable-tree-freetype Enable Tree FreeType],
5982
MOZ_TREE_FREETYPE=1,
5983
MOZ_TREE_FREETYPE= )
5984
if test -n "$MOZ_TREE_FREETYPE"; then
5985
AC_DEFINE(MOZ_TREE_FREETYPE)
5986
AC_SUBST(MOZ_TREE_FREETYPE)
5987
MOZ_ENABLE_CAIRO_FT=1
5988
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
5989
FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
5990
CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
5991
FT2_LIBS='$(LIBXUL_DIST)/lib/freetype2.lib'
5992
CAIRO_FT_LIBS='$(LIBXUL_DIST)/lib/freetype2.lib'
5993
AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
5994
AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
5995
AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
5996
AC_SUBST(CAIRO_FT_CFLAGS)
6000
dnl ========================================================
6002
dnl ========================================================
6003
case "$target_os" in
6004
aix*|solaris*|linux*|msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6009
MOZ_ARG_DISABLE_BOOL(installer,
6010
[ --disable-installer Disable building of installer],
6013
if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
6014
# Disable installer for Windows builds that use the new toolkit if NSIS
6015
# isn't in the path.
6016
MOZ_PATH_PROGS(MAKENSIS, makensis)
6017
if test -z "$MAKENSIS" || test "$MAKENSIS" = ":"; then
6018
AC_MSG_ERROR([To build the installer makensis is required in your path. To build without the installer reconfigure using --disable-installer.])
6020
# The Windows build for NSIS requires the iconv command line utility to
6021
# convert the charset of the locale files.
6022
MOZ_PATH_PROGS(HOST_ICONV, $HOST_ICONV "iconv", "")
6023
if test -z "$HOST_ICONV"; then
6024
AC_MSG_ERROR([To build the installer iconv is required in your path. To build without the installer reconfigure using --disable-installer.])
6028
# Automatically disable installer if xpinstall isn't built
6029
if test -z "$MOZ_XPINSTALL"; then
6032
AC_SUBST(MOZ_INSTALLER)
6034
AC_MSG_CHECKING([for tar archiver])
6035
AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6036
if test -z "$TAR"; then
6037
AC_MSG_ERROR([no tar archiver found in \$PATH])
6039
AC_MSG_RESULT([$TAR])
6042
AC_MSG_CHECKING([for wget])
6043
AC_CHECK_PROGS(WGET, wget, "")
6044
AC_MSG_RESULT([$WGET])
6047
dnl ========================================================
6049
dnl ========================================================
6051
MOZ_ARG_DISABLE_BOOL(updater,
6052
[ --disable-updater Disable building of updater],
6055
AC_SUBST(MOZ_UPDATER)
6057
# app update channel is 'default' when not supplied.
6058
MOZ_ARG_ENABLE_STRING([update-channel],
6059
[ --enable-update-channel=CHANNEL
6060
Select application update channel (default=default)],
6061
MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6063
if test -z "$MOZ_UPDATE_CHANNEL"; then
6064
MOZ_UPDATE_CHANNEL=default
6066
AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6068
# tools/update-packaging is not checked out by default.
6069
MOZ_ARG_ENABLE_BOOL(update-packaging,
6070
[ --enable-update-packaging
6071
Enable tools/update-packaging],
6072
MOZ_UPDATE_PACKAGING=1,
6073
MOZ_UPDATE_PACKAGING= )
6074
AC_SUBST(MOZ_UPDATE_PACKAGING)
6076
dnl ========================================================
6078
dnl ========================================================
6080
MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
6081
[ --disable-xpconnect-idispatch
6082
Disable building of xpconnect support for IDispatch
6084
XPC_IDISPATCH_SUPPORT=,
6085
XPC_IDISPATCH_SUPPORT=1)
6086
AC_SUBST(XPC_IDISPATCH_SUPPORT)
6088
MOZ_ARG_DISABLE_BOOL(activex,
6089
[ --disable-activex Disable building of ActiveX control (win32 only)],
6090
MOZ_NO_ACTIVEX_SUPPORT=1,
6091
MOZ_NO_ACTIVEX_SUPPORT= )
6092
AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
6094
MOZ_ARG_ENABLE_BOOL(activex-scripting,
6095
[ --enable-activex-scripting
6096
Enable building of ActiveX scripting support (win32)],
6097
MOZ_ACTIVEX_SCRIPTING_SUPPORT=1,
6098
MOZ_ACTIVEX_SCRIPTING_SUPPORT=)
6099
AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
6101
if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
6103
AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
6106
if test "$COMPILE_ENVIRONMENT" = "1"; then
6107
if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
6109
*-mingw*|*-cygwin*|*-msvc*|*-mks*)
6110
if test "$ac_cv_header_atlbase_h" = "no"; then
6111
AC_MSG_ERROR([System header atlbase.h is not available. See http://developer.mozilla.org/en/docs/atlbase.h for details on fixing this problem.])
6118
dnl ========================================================
6120
dnl ========================================================
6121
MOZ_ARG_ENABLE_BOOL(leaky,
6122
[ --enable-leaky Build leaky memory tool],
6127
dnl ========================================================
6129
dnl ========================================================
6130
MOZ_ARG_ENABLE_BOOL(xpctools,
6131
[ --enable-xpctools Build JS profiling tool],
6136
dnl ========================================================
6137
dnl build the tests by default
6138
dnl ========================================================
6139
MOZ_ARG_DISABLE_BOOL(tests,
6140
[ --disable-tests Do not build test libraries & programs],
6144
dnl ========================================================
6145
dnl parental controls (for Windows Vista)
6146
dnl ========================================================
6147
MOZ_ARG_DISABLE_BOOL(parental-controls,
6148
[ --disable-parental-controls
6149
Do not build parental controls],
6150
MOZ_DISABLE_PARENTAL_CONTROLS=1,
6151
MOZ_DISABLE_PARENTAL_CONTROLS=)
6152
if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6153
AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6156
AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6158
dnl ========================================================
6160
dnl = Module specific options
6162
dnl ========================================================
6163
MOZ_ARG_HEADER(Individual module options)
6165
dnl ========================================================
6166
dnl = Enable Lea malloc in xpcom. OFF by default.
6167
dnl ========================================================
6168
MOZ_ARG_ENABLE_BOOL(xpcom-lea,
6169
[ --enable-xpcom-lea Use Lea malloc in xpcom ],
6172
if test -n "$XPCOM_USE_LEA"; then
6173
AC_DEFINE(XPCOM_USE_LEA)
6176
dnl ========================================================
6177
dnl = Enable places (new history/bookmarks)
6178
dnl ========================================================
6179
MOZ_ARG_ENABLE_BOOL(places,
6180
[ --enable-places Enable 'places' bookmark/history implementation],
6183
if test -n "$MOZ_PLACES"; then
6184
AC_DEFINE(MOZ_PLACES)
6185
if test -z "$MOZ_MAIL_NEWS"; then
6190
if test "$MOZ_BUILD_APP" = "browser"; then
6191
AC_MSG_ERROR([Cannot build Firefox with --disable-places.])
6195
dnl ========================================================
6196
dnl = Disable feed handling components
6197
dnl ========================================================
6198
MOZ_ARG_DISABLE_BOOL(feeds,
6199
[ --disable-feeds Disable feed handling and processing components],
6202
if test -n "$MOZ_FEEDS"; then
6203
AC_DEFINE(MOZ_FEEDS)
6205
if test "$MOZ_BUILD_APP" = "browser"; then
6206
AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6210
dnl ========================================================
6211
dnl = Enable mozStorage
6212
dnl ========================================================
6213
dnl Implicitly enabled by default if building calendar or places
6214
MOZ_ARG_ENABLE_BOOL(storage,
6215
[ --enable-storage Enable mozStorage module and related components],
6218
if test -n "$MOZ_STORAGE"; then
6219
AC_DEFINE(MOZ_STORAGE)
6222
dnl ========================================================
6223
dnl Check for sqlite
6224
dnl ========================================================
6227
MOZ_ARG_ENABLE_BOOL(system-sqlite,
6228
[ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6229
MOZ_NATIVE_SQLITE=1,
6230
MOZ_NATIVE_SQLITE= )
6232
if test -z "$MOZ_NATIVE_SQLITE"
6235
SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,sqlite3,$(DIST)/lib)'
6237
PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6240
AC_SUBST(MOZ_NATIVE_SQLITE)
6242
dnl ========================================================
6243
dnl = Enable help viewer (off by default)
6244
dnl ========================================================
6245
MOZ_ARG_ENABLE_BOOL(help-viewer,
6246
[ --enable-help-viewer Enable help viewer],
6249
if test -n "$MOZ_HELP_VIEWER"; then
6250
AC_DEFINE(MOZ_HELP_VIEWER)
6252
AC_SUBST(MOZ_HELP_VIEWER)
6253
if test "$MOZ_BUILD_APP" = "browser" -a -n "$MOZ_HELP_VIEWER"; then
6254
AC_MSG_ERROR([Cannot build Firefox with --enable-help-viewer.])
6257
dnl ========================================================
6258
dnl = Enable safe browsing (anti-phishing)
6259
dnl ========================================================
6260
MOZ_ARG_ENABLE_BOOL(safe-browsing,
6261
[ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6262
MOZ_SAFE_BROWSING=1,
6263
MOZ_SAFE_BROWSING= )
6264
if test -n "$MOZ_SAFE_BROWSING"; then
6265
AC_DEFINE(MOZ_SAFE_BROWSING)
6267
AC_SUBST(MOZ_SAFE_BROWSING)
6269
dnl ========================================================
6270
dnl = Enable faststart component
6271
dnl ========================================================
6272
MOZ_ARG_ENABLE_BOOL(faststart,
6273
[ --enable-faststart Enable the faststart component],
6276
if test -n "$MOZ_FASTSTART"; then
6277
AC_DEFINE(MOZ_FASTSTART)
6279
AC_SUBST(MOZ_FASTSTART)
6281
dnl ========================================================
6282
dnl = Enable url-classifier
6283
dnl ========================================================
6284
dnl Implicitly enabled by default if building with safe-browsing
6285
if test -n "$MOZ_SAFE_BROWSING"; then
6286
MOZ_URL_CLASSIFIER=1
6288
MOZ_ARG_ENABLE_BOOL(url-classifier,
6289
[ --enable-url-classifier Enable url classifier module],
6290
MOZ_URL_CLASSIFIER=1,
6291
MOZ_URL_CLASSIFIER= )
6292
if test -n "$MOZ_URL_CLASSIFIER"; then
6293
AC_DEFINE(MOZ_URL_CLASSIFIER)
6295
AC_SUBST(MOZ_URL_CLASSIFIER)
6297
dnl ========================================================
6298
dnl = Disable zipwriter
6299
dnl ========================================================
6300
MOZ_ARG_DISABLE_BOOL(zipwriter,
6301
[ --disable-zipwriter Disable zipwriter component],
6304
AC_SUBST(MOZ_ZIPWRITER)
6306
dnl ========================================================
6307
dnl = Disable libconic
6308
dnl ========================================================
6309
MOZ_ENABLE_LIBCONIC=1
6310
MOZ_ARG_DISABLE_BOOL(libconic,
6311
[ --disable-libconic Disable libconic],
6312
MOZ_ENABLE_LIBCONIC=,
6313
MOZ_ENABLE_LIBCONIC=1 )
6315
if test -n "$MOZ_ENABLE_LIBCONIC"; then
6316
PKG_CHECK_MODULES(LIBCONIC, conic,
6317
MOZ_ENABLE_LIBCONIC=1,
6318
MOZ_ENABLE_LIBCONIC=)
6320
if test "$MOZ_ENABLE_LIBCONIC"; then
6321
AC_DEFINE(MOZ_ENABLE_LIBCONIC)
6324
AC_SUBST(MOZ_ENABLE_LIBCONIC)
6325
AC_SUBST(LIBCONIC_CFLAGS)
6326
AC_SUBST(LIBCONIC_LIBS)
6328
dnl ========================================================
6330
dnl ========================================================
6332
MAEMO_SDK_TARGET_VER=-1
6334
MOZ_ARG_WITH_STRING(maemo-version,
6335
[ --with-maemo-version=MAEMO_SDK_TARGET_VER
6337
MAEMO_SDK_TARGET_VER=$withval)
6339
case "$MAEMO_SDK_TARGET_VER" in
6341
MOZ_PLATFORM_MAEMO=5
6345
MOZ_PLATFORM_MAEMO=6
6349
dnl We aren't compiling for Maemo, move on.
6352
AC_MSG_ERROR([Unknown Maemo Version. Try setting --with-maemo-version to 5 or 6.])
6356
if test $MOZ_PLATFORM_MAEMO; then
6357
AC_DEFINE_UNQUOTED([MOZ_PLATFORM_MAEMO], $MOZ_PLATFORM_MAEMO)
6359
if test -z "$MOZ_ENABLE_DBUS"; then
6360
AC_MSG_ERROR([DBus is required when building for Maemo])
6363
MOZ_GFX_OPTIMIZE_MOBILE=1
6366
if test $MOZ_PLATFORM_MAEMO = 5; then
6367
dnl if we have Xcomposite we should also have Xdamage and Xfixes
6368
AC_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
6369
[AC_MSG_ERROR([Couldn't find X11/extensions/Xdamage.h which is required for composited plugins.])])
6370
AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
6371
[MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
6373
AC_SUBST(XCOMPOSITE_LIBS)
6375
PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime, _LIB_FOUND=1, _LIB_FOUND=)
6376
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
6377
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
6378
if test -z "$_LIB_FOUND"; then
6379
AC_MSG_ERROR([Hildon Mime is required when building for Maemo])
6383
PKG_CHECK_MODULES(LIBOSSO,libosso, _LIB_FOUND=1, _LIB_FOUND=)
6384
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
6385
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
6386
if test -z "$_LIB_FOUND"; then
6387
AC_MSG_ERROR([LibOSSO is required when building for Maemo])
6390
PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2, _LIB_FOUND=1, _LIB_FOUND=)
6391
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
6392
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
6393
if test -z "$_LIB_FOUND"; then
6394
AC_MSG_ERROR([Hildon FM-2 is required when building for Maemo])
6398
AC_SUBST(MOZ_PLATFORM_MAEMO_LIBS)
6399
AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
6402
dnl ========================================================
6403
dnl = faststripe theme
6404
dnl ========================================================
6405
MOZ_ARG_ENABLE_BOOL(faststripe,
6406
[ --enable-faststripe Use faststripe theme],
6407
MOZ_THEME_FASTSTRIPE=1,
6408
MOZ_THEME_FASTSTRIPE= )
6409
AC_SUBST(MOZ_THEME_FASTSTRIPE)
6411
dnl ========================================================
6413
dnl = Feature options that require extra sources to be pulled
6415
dnl ========================================================
6416
dnl MOZ_ARG_HEADER(Features that require extra sources)
6418
dnl ========================================================
6420
dnl = Debugging Options
6422
dnl ========================================================
6423
MOZ_ARG_HEADER(Debugging and Optimizations)
6425
dnl ========================================================
6426
dnl = Disable building with debug info.
6427
dnl = Debugging is OFF by default
6428
dnl ========================================================
6429
if test -z "$MOZ_DEBUG_FLAGS"
6433
if test "$GNU_CC"; then
6434
GCC_VERSION=`$CC -v 2>&1 | awk '/version/ { print $3 }'`
6435
case "$GCC_VERSION" in
6440
MOZ_DEBUG_FLAGS="-g"
6444
MOZ_DEBUG_FLAGS="-g"
6448
MOZ_DEBUG_FLAGS="-g"
6453
MOZ_ARG_ENABLE_STRING(debug,
6454
[ --enable-debug[=DBG] Enable building with developer debug info
6455
(Using compiler flags DBG)],
6456
[ if test "$enableval" != "no"; then
6458
if test -n "$enableval" && test "$enableval" != "yes"; then
6459
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6466
MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG"
6467
case "${target_os}" in
6469
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${USER}"
6471
msvc*|mks*|cygwin*|mingw*|os2*|wince*)
6472
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
6475
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
6478
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DTRACING"
6480
MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6482
if test -n "$MOZ_DEBUG"; then
6483
AC_MSG_CHECKING([for valid debug flags])
6484
_SAVE_CFLAGS=$CFLAGS
6485
CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6486
AC_TRY_COMPILE([#include <stdio.h>],
6487
[printf("Hello World\n");],
6490
AC_MSG_RESULT([$_results])
6491
if test "$_results" = "no"; then
6492
AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6494
CFLAGS=$_SAVE_CFLAGS
6497
dnl ========================================================
6498
dnl enable mobile optimizations
6499
dnl ========================================================
6500
MOZ_ARG_ENABLE_BOOL(mobile-optimize,
6501
[ --enable-mobile-optimize Enable mobile optimizations],
6502
MOZ_GFX_OPTIMIZE_MOBILE=1)
6504
AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
6506
if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
6507
AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6510
dnl ========================================================
6511
dnl = Enable code optimization. ON by default.
6512
dnl ========================================================
6513
if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6514
MOZ_OPTIMIZE_FLAGS="-O"
6517
MOZ_ARG_ENABLE_STRING(optimize,
6518
[ --disable-optimize Disable compiler optimization
6519
--enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6520
[ if test "$enableval" != "no"; then
6522
if test -n "$enableval" && test "$enableval" != "yes"; then
6523
MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6528
fi ], MOZ_OPTIMIZE=1)
6530
if test "$COMPILE_ENVIRONMENT"; then
6531
if test -n "$MOZ_OPTIMIZE"; then
6532
AC_MSG_CHECKING([for valid optimization flags])
6533
_SAVE_CFLAGS=$CFLAGS
6534
CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6535
AC_TRY_COMPILE([#include <stdio.h>],
6536
[printf("Hello World\n");],
6539
AC_MSG_RESULT([$_results])
6540
if test "$_results" = "no"; then
6541
AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6543
CFLAGS=$_SAVE_CFLAGS
6545
fi # COMPILE_ENVIRONMENT
6547
AC_SUBST(MOZ_OPTIMIZE)
6548
AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6549
AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6550
AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6552
dnl ========================================================
6553
dnl = Enable/disable debug for specific modules only
6554
dnl = module names beginning with ^ will be disabled
6555
dnl ========================================================
6556
MOZ_ARG_ENABLE_STRING(debug-modules,
6557
[ --enable-debug-modules Enable/disable debug info for specific modules],
6558
[ MOZ_DEBUG_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
6560
dnl ========================================================
6561
dnl = Enable/disable generation of debugger info for specific modules only
6562
dnl = the special module name ALL_MODULES can be used to denote all modules
6563
dnl = module names beginning with ^ will be disabled
6564
dnl ========================================================
6565
MOZ_ARG_ENABLE_STRING(debugger-info-modules,
6566
[ --enable-debugger-info-modules
6567
Enable/disable debugger info for specific modules],
6568
[ for i in `echo $enableval | sed 's/,/ /g'`; do
6569
dnl note that the list of module names is reversed as it is copied
6570
dnl this is important, as it will allow config.mk to interpret stuff like
6571
dnl "^ALL_MODULES xpcom" properly
6572
if test "$i" = "no"; then
6575
if test "$i" = "yes"; then
6578
MOZ_DBGRINFO_MODULES="$i $MOZ_DBGRINFO_MODULES";
6581
dnl ========================================================
6582
dnl Enable garbage collector
6583
dnl ========================================================
6584
MOZ_ARG_ENABLE_BOOL(boehm,
6585
[ --enable-boehm Enable the Boehm Garbage Collector],
6588
if test -n "$GC_LEAK_DETECTOR"; then
6589
AC_DEFINE(GC_LEAK_DETECTOR)
6592
dnl ========================================================
6593
dnl Disable runtime logging checks
6594
dnl ========================================================
6595
MOZ_ARG_DISABLE_BOOL(logging,
6596
[ --disable-logging Disable logging facilities],
6597
NS_DISABLE_LOGGING=1,
6598
NS_DISABLE_LOGGING= )
6599
if test "$NS_DISABLE_LOGGING"; then
6600
AC_DEFINE(NS_DISABLE_LOGGING)
6602
AC_DEFINE(MOZ_LOGGING)
6605
dnl ========================================================
6606
dnl = dnl This will enable logging of addref, release, ctor, dtor.
6607
dnl ========================================================
6608
_ENABLE_LOGREFCNT=42
6609
MOZ_ARG_ENABLE_BOOL(logrefcnt,
6610
[ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6611
_ENABLE_LOGREFCNT=1,
6612
_ENABLE_LOGREFCNT= )
6613
if test "$_ENABLE_LOGREFCNT" = "1"; then
6614
AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6615
elif test -z "$_ENABLE_LOGREFCNT"; then
6616
AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6619
dnl ========================================================
6620
dnl = Enable trace malloc
6621
dnl ========================================================
6622
NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6623
MOZ_ARG_ENABLE_BOOL(trace-malloc,
6624
[ --enable-trace-malloc Enable malloc tracing],
6627
if test "$NS_TRACE_MALLOC"; then
6628
# Please, Mr. Linker Man, don't take away our symbol names
6629
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6631
AC_DEFINE(NS_TRACE_MALLOC)
6633
AC_SUBST(NS_TRACE_MALLOC)
6635
dnl ========================================================
6636
dnl = Enable jemalloc
6637
dnl ========================================================
6638
MOZ_ARG_ENABLE_BOOL(jemalloc,
6639
[ --enable-jemalloc Replace memory allocator with jemalloc],
6643
if test "$NS_TRACE_MALLOC"; then
6647
if test "$MOZ_MEMORY"; then
6649
dnl Don't try to run compiler tests on Windows
6650
if test "$OS_ARCH" = "WINNT"; then
6651
if test -z "$HAVE_64BIT_OS"; then
6652
AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6654
AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6657
AC_CHECK_SIZEOF([int *], [4])
6658
case "${ac_cv_sizeof_int_p}" in
6660
AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6663
AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6666
AC_MSG_ERROR([Unexpected pointer size])
6671
AC_DEFINE(MOZ_MEMORY)
6672
if test "x$MOZ_DEBUG" = "x1"; then
6673
AC_DEFINE(MOZ_MEMORY_DEBUG)
6675
dnl The generic feature tests that determine how to compute ncpus are long and
6676
dnl complicated. Therefore, simply define special cpp variables for the
6677
dnl platforms we have special knowledge of.
6678
case "${target_os}" in
6680
AC_DEFINE(MOZ_MEMORY_DARWIN)
6683
AC_DEFINE(MOZ_MEMORY_BSD)
6686
AC_DEFINE(MOZ_MEMORY_LINUX)
6689
AC_DEFINE(MOZ_MEMORY_BSD)
6692
AC_DEFINE(MOZ_MEMORY_SOLARIS)
6694
msvc*|mks*|cygwin*|mingw*)
6695
AC_DEFINE(MOZ_MEMORY_WINDOWS)
6696
dnl This is sort of awful. Will revisit if we add support for more versions
6697
if test "$CC_VERSION" != "14.00.50727.762" -a "$CC_VERSION" != "15.00.30729.01"; then
6698
AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 or 2008 SP1 currently.])
6700
if test -z "$WIN32_CRT_SRC_DIR"; then
6701
if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
6702
AC_MSG_ERROR([When building jemalloc, set WIN32_CRT_SRC_DIR to the path to the Visual C++ CRT source (usually VCINSTALLDIR\crt\src, but VCINSTALLDIR is not set, so I can't autodetect it for you).])
6704
WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
6708
if test ! -d "$WIN32_CRT_SRC_DIR"; then
6709
AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
6711
WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
6712
_objdir_win=`pwd -W`
6713
WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/intel"
6714
dnl Statically link the C++ stdlib. We only use this for Breakpad anyway.
6715
AC_DEFINE(_STATIC_CPPLIB)
6716
MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -DEFAULTLIB:mozcrt19"
6717
dnl Also pass this to NSPR/NSS
6718
DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
6722
AC_DEFINE(MOZ_MEMORY_WINCE)
6723
AC_DEFINE(MOZ_MEMORY_WINDOWS)
6724
if test -z "$WINCE_WINDOWS_MOBILE"; then
6725
AC_DEFINE(MOZ_MEMORY_WINCE6)
6729
AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
6733
AC_SUBST(MOZ_MEMORY)
6734
AC_SUBST(MOZ_MEMORY_LDFLAGS)
6735
AC_SUBST(WIN32_CRT_SRC_DIR)
6736
dnl Need to set this for make because NSS doesn't have configure
6739
dnl ========================================================
6740
dnl = Use malloc wrapper lib
6741
dnl ========================================================
6742
MOZ_ARG_ENABLE_BOOL(wrap-malloc,
6743
[ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
6747
if test -n "$_WRAP_MALLOC"; then
6748
if test "$GNU_CC"; then
6749
WRAP_MALLOC_CFLAGS="${LDFLAGS} -Wl,--wrap -Wl,malloc -Wl,--wrap -Wl,free -Wl,--wrap -Wl,realloc -Wl,--wrap -Wl,__builtin_new -Wl,--wrap -Wl,__builtin_vec_new -Wl,--wrap -Wl,__builtin_delete -Wl,--wrap -Wl,__builtin_vec_delete -Wl,--wrap -Wl,PR_Free -Wl,--wrap -Wl,PR_Malloc -Wl,--wrap -Wl,PR_Calloc -Wl,--wrap -Wl,PR_Realloc"
6750
MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) -o $@'
6754
dnl ========================================================
6755
dnl = Location of malloc wrapper lib
6756
dnl ========================================================
6757
MOZ_ARG_WITH_STRING(wrap-malloc,
6758
[ --with-wrap-malloc=DIR Location of malloc wrapper library],
6759
WRAP_MALLOC_LIB=$withval)
6761
dnl ========================================================
6763
dnl ========================================================
6764
MOZ_ARG_ENABLE_BOOL(tracevis,
6765
[ --enable-tracevis Enable TraceVis tracing tool (default=no)],
6768
if test -n "$MOZ_TRACEVIS"; then
6769
AC_DEFINE(MOZ_TRACEVIS)
6772
dnl ========================================================
6774
dnl ========================================================
6775
MOZ_ARG_ENABLE_BOOL(valgrind,
6776
[ --enable-valgrind Enable Valgrind integration hooks (default=no)],
6779
if test -n "$MOZ_VALGRIND"; then
6780
AC_CHECK_HEADER([valgrind/valgrind.h], [],
6782
[--enable-valgrind specified but Valgrind is not installed]))
6783
AC_DEFINE(MOZ_VALGRIND)
6786
dnl ========================================================
6787
dnl = Use Electric Fence
6788
dnl ========================================================
6789
MOZ_ARG_ENABLE_BOOL(efence,
6790
[ --enable-efence Link with Electric Fence],
6793
if test -n "$_ENABLE_EFENCE"; then
6794
AC_CHECK_LIB(efence,malloc)
6797
dnl ========================================================
6799
dnl ========================================================
6800
MOZ_ARG_ENABLE_BOOL(jprof,
6801
[ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof)],
6804
if test -n "$MOZ_JPROF"; then
6805
AC_DEFINE(MOZ_JPROF)
6808
dnl ========================================================
6810
dnl ========================================================
6811
MOZ_ARG_ENABLE_BOOL(shark,
6812
[ --enable-shark Enable shark remote profiling (needs CHUD framework)],
6815
if test -n "$MOZ_SHARK"; then
6816
AC_DEFINE(MOZ_SHARK)
6819
dnl ========================================================
6821
dnl ========================================================
6822
MOZ_ARG_ENABLE_BOOL(callgrind,
6823
[ --enable-callgrind Enable callgrind profiling],
6826
if test -n "$MOZ_CALLGRIND"; then
6827
AC_DEFINE(MOZ_CALLGRIND)
6830
dnl ========================================================
6832
dnl ========================================================
6833
MOZ_ARG_ENABLE_BOOL(vtune,
6834
[ --enable-vtune Enable vtune profiling],
6837
if test -n "$MOZ_VTUNE"; then
6838
AC_DEFINE(MOZ_VTUNE)
6841
dnl ========================================================
6842
dnl Zealous JavaScript GC
6843
dnl ========================================================
6844
MOZ_ARG_ENABLE_BOOL(gczeal,
6845
[ --enable-gczeal Enable zealous JavaScript GCing],
6848
if test -n "$JS_GC_ZEAL"; then
6849
AC_DEFINE(JS_GC_ZEAL)
6852
dnl ========================================================
6853
dnl = Enable static checking using gcc-dehydra
6854
dnl ========================================================
6856
MOZ_ARG_WITH_STRING(static-checking,
6857
[ --with-static-checking=path/to/gcc_dehydra.so
6858
Enable static checking of code using GCC-dehydra],
6859
DEHYDRA_PATH=$withval,
6862
if test -n "$DEHYDRA_PATH"; then
6863
if test ! -f "$DEHYDRA_PATH"; then
6864
AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
6866
AC_DEFINE(NS_STATIC_CHECKING)
6868
AC_SUBST(DEHYDRA_PATH)
6870
dnl ========================================================
6871
dnl = Enable stripping of libs & executables
6872
dnl ========================================================
6873
MOZ_ARG_ENABLE_BOOL(strip,
6874
[ --enable-strip Enable stripping of libs & executables ],
6878
dnl ========================================================
6879
dnl = Enable stripping of libs & executables when packaging
6880
dnl ========================================================
6881
MOZ_ARG_ENABLE_BOOL(install-strip,
6882
[ --enable-install-strip Enable stripping of libs & executables when packaging ],
6886
dnl ========================================================
6887
dnl = --enable-elf-dynstr-gc
6888
dnl ========================================================
6889
MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
6890
[ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
6891
USE_ELF_DYNSTR_GC=1,
6892
USE_ELF_DYNSTR_GC= )
6894
dnl ========================================================
6895
dnl = --enable-old-abi-compat-wrappers
6896
dnl ========================================================
6897
dnl on x86 linux, the current builds of some popular plugins (notably
6898
dnl flashplayer and real) expect a few builtin symbols from libgcc
6899
dnl which were available in some older versions of gcc. However,
6900
dnl they're _NOT_ available in newer versions of gcc (eg 3.1), so if
6901
dnl we want those plugin to work with a gcc-3.1 built binary, we need
6902
dnl to provide these symbols. MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS defaults
6903
dnl to true on x86 linux, and false everywhere else.
6906
MOZ_ARG_ENABLE_BOOL(old-abi-compat-wrappers,
6907
[ --enable-old-abi-compat-wrappers
6908
Support old GCC ABI symbols to ease the pain
6909
of the linux compiler change],
6910
MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS=1,
6911
MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS= )
6912
if test "$COMPILE_ENVIRONMENT"; then
6913
if test "$MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS"; then
6916
AC_CHECK_FUNCS(__builtin_vec_new __builtin_vec_delete __builtin_new __builtin_delete __pure_virtual)
6918
AC_DEFINE(MOZ_ENABLE_OLD_ABI_COMPAT_WRAPPERS)
6920
fi # COMPILE_ENVIRONMENT
6922
dnl ========================================================
6924
dnl = Profiling and Instrumenting
6926
dnl ========================================================
6927
MOZ_ARG_HEADER(Profiling and Instrumenting)
6929
dnl ========================================================
6930
dnl = Enable timeline service, which provides lightweight
6931
dnl = instrumentation of mozilla for performance measurement.
6932
dnl = Timeline is off by default.
6933
dnl ========================================================
6934
MOZ_ARG_ENABLE_BOOL(timeline,
6935
[ --enable-timeline Enable timeline services ],
6938
if test -n "$MOZ_TIMELINE"; then
6939
AC_DEFINE(MOZ_TIMELINE)
6942
dnl ========================================================
6943
dnl Turn on reflow counting
6944
dnl ========================================================
6945
MOZ_ARG_ENABLE_BOOL(reflow-perf,
6946
[ --enable-reflow-perf Enable reflow performance tracing],
6949
if test -n "$MOZ_REFLOW_PERF"; then
6950
AC_DEFINE(MOZ_REFLOW_PERF)
6953
dnl ========================================================
6954
dnl Enable performance metrics.
6955
dnl ========================================================
6956
MOZ_ARG_ENABLE_BOOL(perf-metrics,
6957
[ --enable-perf-metrics Enable performance metrics],
6960
if test -n "$MOZ_PERF_METRICS"; then
6961
AC_DEFINE(MOZ_PERF_METRICS)
6964
dnl ========================================================
6965
dnl Enable code size metrics.
6966
dnl ========================================================
6967
MOZ_ARG_ENABLE_BOOL(codesighs,
6968
[ --enable-codesighs Enable code size analysis tools],
6969
_ENABLE_CODESIGHS=1,
6970
_ENABLE_CODESIGHS= )
6971
if test -n "$_ENABLE_CODESIGHS"; then
6972
if test -d $srcdir/tools/codesighs; then
6975
AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
6979
dnl ========================================================
6980
dnl = Add support for Eazel profiler
6981
dnl ========================================================
6982
MOZ_ARG_ENABLE_BOOL(eazel-profiler-support,
6983
[ --enable-eazel-profiler-support
6984
Enable Corel/Eazel profiler support],
6985
ENABLE_EAZEL_PROFILER=1,
6986
ENABLE_EAZEL_PROFILER= )
6987
if test -n "$ENABLE_EAZEL_PROFILER"; then
6988
AC_DEFINE(ENABLE_EAZEL_PROFILER)
6990
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6991
EAZEL_PROFILER_CFLAGS="-g -O -gdwarf-2 -finstrument-functions -D__NO_STRING_INLINES -D__NO_MATH_INLINES"
6992
EAZEL_PROFILER_LIBS="-lprofiler -lpthread"
6995
MOZ_ARG_ENABLE_STRING(profile-modules,
6996
[ --enable-profile-modules
6997
Enable/disable profiling for specific modules],
6998
[ MOZ_PROFILE_MODULES=`echo $enableval| sed 's/,/ /g'` ] )
7000
MOZ_ARG_ENABLE_BOOL(insure,
7001
[ --enable-insure Enable insure++ instrumentation (linux only)],
7004
if test -n "$_ENABLE_INSURE"; then
7008
MOZ_INSURE_EXCLUDE_DIRS="config"
7011
MOZ_ARG_WITH_STRING(insure-dirs,
7012
[ --with-insure-dirs=DIRS
7013
Dirs to instrument with insure ],
7014
MOZ_INSURE_DIRS=$withval )
7016
MOZ_ARG_WITH_STRING(insure-exclude-dirs,
7017
[ --with-insure-exclude-dirs=DIRS
7018
Dirs to not instrument with insure ],
7019
MOZ_INSURE_EXCLUDE_DIRS="config $withval" )
7021
dnl ========================================================
7022
dnl = Support for Quantify (Windows)
7023
dnl ========================================================
7024
MOZ_ARG_ENABLE_BOOL(quantify,
7025
[ --enable-quantify Enable Quantify support (Windows only) ],
7029
dnl ========================================================
7030
dnl = Support for demangling undefined symbols
7031
dnl ========================================================
7032
if test -z "$SKIP_LIBRARY_CHECKS"; then
7035
AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
7039
# Demangle only for debug or trace-malloc builds
7040
MOZ_DEMANGLE_SYMBOLS=
7041
if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
7042
MOZ_DEMANGLE_SYMBOLS=1
7043
AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
7045
AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
7047
dnl ========================================================
7048
dnl = Support for gcc stack unwinding (from gcc 3.3)
7049
dnl ========================================================
7050
if test "$HAVE_GCC3_ABI" && test -z "$SKIP_LIBRARY_CHECKS"; then
7051
AC_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
7054
dnl ========================================================
7058
dnl ========================================================
7059
MOZ_ARG_HEADER(Misc. Options)
7061
dnl ========================================================
7062
dnl update xterm title
7063
dnl ========================================================
7064
MOZ_ARG_ENABLE_BOOL(xterm-updates,
7065
[ --enable-xterm-updates Update XTERM titles with current command.],
7069
dnl =========================================================
7071
dnl =========================================================
7072
MOZ_ARG_ENABLE_STRING([chrome-format],
7073
[ --enable-chrome-format=jar|flat|both|symlink
7074
Select FORMAT of chrome files (default=jar)],
7075
MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
7077
if test -z "$MOZ_CHROME_FILE_FORMAT"; then
7078
MOZ_CHROME_FILE_FORMAT=jar
7081
if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
7082
test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
7083
test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
7084
test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
7085
AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
7088
dnl ========================================================
7089
dnl = Define default location for MOZILLA_FIVE_HOME
7090
dnl ========================================================
7091
MOZ_ARG_WITH_STRING(default-mozilla-five-home,
7092
[ --with-default-mozilla-five-home
7093
Set the default value for MOZILLA_FIVE_HOME],
7094
[ val=`echo $withval`
7095
AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7097
dnl ========================================================
7098
dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7099
dnl ========================================================
7100
MOZ_ARG_WITH_STRING(user-appdir,
7101
[ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
7102
[ val=`echo $withval`
7103
if echo "$val" | grep "\/" >/dev/null; then
7104
AC_MSG_ERROR("Homedir must be single relative path.")
7109
AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7111
dnl ========================================================
7112
dnl = Doxygen configuration
7113
dnl ========================================================
7114
dnl Use commas to specify multiple dirs to this arg
7115
MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7116
MOZ_ARG_WITH_STRING(doc-input-dirs,
7117
[ --with-doc-input-dirs=DIRS
7118
Header/idl dirs to create docs from],
7119
[ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7120
AC_SUBST(MOZ_DOC_INPUT_DIRS)
7122
dnl Use commas to specify multiple dirs to this arg
7123
MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7124
MOZ_ARG_WITH_STRING(doc-include-dirs,
7125
[ --with-doc-include-dirs=DIRS
7126
Include dirs to preprocess doc headers],
7127
[ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7128
AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7130
MOZ_DOC_OUTPUT_DIR='./dist/docs'
7131
MOZ_ARG_WITH_STRING(doc-output-dir,
7132
[ --with-doc-output-dir=DIR
7133
Dir to generate docs into],
7134
[ MOZ_DOC_OUTPUT_DIR=$withval ] )
7135
AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7137
if test -z "$SKIP_COMPILER_CHECKS"; then
7138
dnl ========================================================
7140
dnl = Compiler Options
7142
dnl ========================================================
7143
MOZ_ARG_HEADER(Compiler Options)
7145
dnl ========================================================
7146
dnl Check for gcc -pipe support
7147
dnl ========================================================
7148
AC_MSG_CHECKING([for gcc -pipe support])
7149
if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
7150
echo '#include <stdio.h>' > dummy-hello.c
7151
echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
7152
${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
7153
cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
7154
if test $? = 0; then
7159
if test "$_res_as_stdin" = "yes"; then
7160
_SAVE_CFLAGS=$CFLAGS
7161
CFLAGS="$CFLAGS -pipe"
7162
AC_TRY_COMPILE( [ #include <stdio.h> ],
7163
[printf("Hello World\n");],
7164
[_res_gcc_pipe="yes"],
7165
[_res_gcc_pipe="no"] )
7166
CFLAGS=$_SAVE_CFLAGS
7168
if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
7170
CFLAGS="$CFLAGS -pipe"
7171
CXXFLAGS="$CXXFLAGS -pipe"
7175
rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
7176
AC_MSG_RESULT([$_res])
7181
dnl pass -Wno-long-long to the compiler
7182
MOZ_ARG_ENABLE_BOOL(long-long-warning,
7183
[ --enable-long-long-warning
7184
Warn about use of non-ANSI long long type],
7185
_IGNORE_LONG_LONG_WARNINGS=,
7186
_IGNORE_LONG_LONG_WARNINGS=1)
7188
if test "$_IGNORE_LONG_LONG_WARNINGS"; then
7189
_SAVE_CFLAGS="$CFLAGS"
7190
CFLAGS="$CFLAGS ${_COMPILER_PREFIX}-Wno-long-long"
7191
AC_MSG_CHECKING([whether compiler supports -Wno-long-long])
7192
AC_TRY_COMPILE([], [return(0);],
7193
[ _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7194
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-long-long"
7195
result="yes" ], result="no")
7196
AC_MSG_RESULT([$result])
7197
CFLAGS="$_SAVE_CFLAGS"
7200
dnl ========================================================
7201
dnl Profile guided optimization
7202
dnl ========================================================
7203
dnl Test for profiling options
7204
dnl Under gcc 3.3, use -fprofile-arcs/-fbranch-probabilities
7205
dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7207
dnl Provide a switch to disable PGO even when called via profiledbuild.
7208
MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
7209
[ --disable-profile-guided-optimization
7210
Don't build with PGO even if called via make profiledbuild],
7211
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
7212
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
7214
AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
7216
_SAVE_CFLAGS="$CFLAGS"
7217
CFLAGS="$CFLAGS -fprofile-generate"
7219
AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7220
AC_TRY_COMPILE([], [return 0;],
7221
[ PROFILE_GEN_CFLAGS="-fprofile-generate"
7222
result="yes" ], result="no")
7223
AC_MSG_RESULT([$result])
7225
if test $result = "yes"; then
7226
PROFILE_GEN_LDFLAGS="-fprofile-generate"
7227
PROFILE_USE_CFLAGS="-fprofile-use"
7228
PROFILE_USE_LDFLAGS="-fprofile-use"
7230
CFLAGS="$_SAVE_CFLAGS -fprofile-arcs"
7231
AC_MSG_CHECKING([whether C compiler supports -fprofile-arcs])
7232
AC_TRY_COMPILE([], [return 0;],
7233
[ PROFILE_GEN_CFLAGS="-fprofile-arcs"
7234
result="yes" ], result="no")
7235
AC_MSG_RESULT([$result])
7236
if test $result = "yes"; then
7237
PROFILE_USE_CFLAGS="-fbranch-probabilities"
7239
# don't really care, this is an old GCC
7240
PROFILE_GEN_LDFLAGS=
7241
PROFILE_USE_LDFLAGS=
7244
CFLAGS="$_SAVE_CFLAGS"
7246
if test -n "$INTEL_CC"; then
7247
PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7248
PROFILE_GEN_LDFLAGS=
7249
PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7250
PROFILE_USE_LDFLAGS=
7253
dnl Sun Studio on Solaris
7254
if test "$SOLARIS_SUNPRO_CC"; then
7255
PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7256
PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7257
if test "$CPU_ARCH" != "sparc"; then
7258
PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7259
PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7261
PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7262
PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
7266
AC_SUBST(PROFILE_GEN_CFLAGS)
7267
AC_SUBST(PROFILE_GEN_LDFLAGS)
7268
AC_SUBST(PROFILE_USE_CFLAGS)
7269
AC_SUBST(PROFILE_USE_LDFLAGS)
7273
dnl ========================================================
7274
dnl Test for -pedantic bustage
7275
dnl ========================================================
7276
MOZ_ARG_DISABLE_BOOL(pedantic,
7277
[ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7279
if test "$_PEDANTIC"; then
7280
_SAVE_CXXFLAGS=$CXXFLAGS
7281
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7282
AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7283
AC_TRY_COMPILE([$configure_static_assert_macros],
7284
[CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7285
result="no", result="yes" )
7286
AC_MSG_RESULT([$result])
7287
CXXFLAGS="$_SAVE_CXXFLAGS"
7291
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic"
7292
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic"
7295
AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7300
dnl ========================================================
7301
dnl Test for correct temporary object destruction order
7302
dnl ========================================================
7303
dnl We want to make sure the compiler follows the C++ spec here as
7304
dnl xpcom and the string classes depend on it (bug 235381).
7305
AC_MSG_CHECKING([for correct temporary object destruction order])
7306
AC_TRY_RUN([ class A {
7307
public: A(int& x) : mValue(x) {}
7309
operator char**() { return 0; }
7310
private: int& mValue;
7312
void func(char **arg) {}
7323
result="yes", result="no", result="maybe")
7324
AC_MSG_RESULT([$result])
7326
if test "$result" = "no"; then
7327
AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
7330
dnl ========================================================
7331
dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7332
dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7333
dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7334
dnl ========================================================
7335
_SAVE_CXXFLAGS=$CXXFLAGS
7336
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7337
AC_CACHE_CHECK(for correct overload resolution with const and templates,
7338
ac_nscap_nonconst_opeq_bug,
7347
template <class T, class U>
7348
int operator==(const Pointer<T>& rhs, U* lhs)
7350
return rhs.myPtr == lhs;
7353
template <class T, class U>
7354
int operator==(const Pointer<T>& rhs, const U* lhs)
7356
return rhs.myPtr == lhs;
7364
ac_nscap_nonconst_opeq_bug="no",
7365
ac_nscap_nonconst_opeq_bug="yes")])
7366
CXXFLAGS="$_SAVE_CXXFLAGS"
7368
if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7369
AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7371
fi # SKIP_COMPILER_CHECKS
7373
dnl ========================================================
7375
dnl Should be smarter and check that the compiler does indeed have rtti
7376
dnl ========================================================
7377
MOZ_ARG_ENABLE_BOOL(cpp-rtti,
7378
[ --enable-cpp-rtti Enable C++ RTTI ],
7379
[ _MOZ_USE_RTTI=1 ],
7382
if test "$_MOZ_USE_RTTI"; then
7383
_MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
7385
_MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
7388
AC_SUBST(_MOZ_RTTI_FLAGS_ON)
7390
dnl ========================================================
7391
dnl C++ exceptions (g++/egcs only - for now)
7392
dnl Should be smarter and check that the compiler does indeed have exceptions
7393
dnl ========================================================
7394
MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
7395
[ --enable-cpp-exceptions Enable C++ exceptions ],
7396
[ _MOZ_CPP_EXCEPTIONS=1 ],
7397
[ _MOZ_CPP_EXCEPTIONS= ])
7399
if test "$_MOZ_CPP_EXCEPTIONS"; then
7400
_MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
7402
_MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
7405
AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON)
7407
# Irix & OSF native compilers do not like exception declarations
7408
# when exceptions are disabled
7409
if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
7410
AC_DEFINE(CPP_THROW_NEW, [])
7412
AC_DEFINE(CPP_THROW_NEW, [throw()])
7416
dnl ========================================================
7418
dnl = Build depencency options
7420
dnl ========================================================
7421
MOZ_ARG_HEADER(Build dependencies)
7423
dnl ========================================================
7424
dnl = Do not auto generate dependency info
7425
dnl ========================================================
7427
MOZ_ARG_DISABLE_BOOL(auto-deps,
7428
[ --disable-auto-deps Do not automatically generate dependency info],
7432
if test -n "$MOZ_AUTO_DEPS"; then
7433
dnl ========================================================
7434
dnl = Use mkdepend instead of $CC -MD for dependency generation
7435
dnl ========================================================
7437
MOZ_ARG_DISABLE_BOOL(md,
7438
[ --disable-md Do not use compiler-based dependencies ],
7441
[dnl Default is to turn on -MD if using GNU-compatible compilers
7442
if test "$GNU_CC" -a "$GNU_CXX" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
7445
dnl Default is to use -xM if using Sun Studio on Solaris
7446
if test "$SOLARIS_SUNPRO_CC"; then
7449
if test "$_cpp_md_flag"; then
7451
if test "$OS_ARCH" = "OpenVMS"; then
7452
_DEPEND_CFLAGS='$(subst =, ,$(filter-out %/.pp,-MM=-MD=-MF=$(MDDEPDIR)/$(basename $(@F)).pp))'
7454
_DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
7456
dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7457
if test "$SOLARIS_SUNPRO_CC"; then
7462
_USE_CPP_INCLUDE_FLAG=
7463
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7464
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7468
AC_SUBST(MOZ_AUTO_DEPS)
7469
AC_SUBST(COMPILER_DEPEND)
7473
dnl ========================================================
7475
dnl = Static Build Options
7477
dnl ========================================================
7478
MOZ_ARG_HEADER(Static build options)
7480
MOZ_ARG_ENABLE_BOOL(static,
7481
[ --enable-static Enable building of internal static libs],
7482
BUILD_STATIC_LIBS=1,
7485
dnl Disable libxul in debug builds, but not for xulrunner.
7486
if test -n "$MOZ_DEBUG" -a "$MOZ_BUILD_APP" != "xulrunner"; then
7490
MOZ_ARG_ENABLE_BOOL(libxul,
7491
[ --enable-libxul Enable building of libxul],
7492
MOZ_ENABLE_LIBXUL=1,
7495
if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
7496
AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME. You probably want --enable-libxul.])
7499
if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
7500
AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
7503
AC_SUBST(LIBXUL_LIBS)
7505
if test -n "$MOZ_ENABLE_LIBXUL"; then
7506
XPCOM_LIBS="$LIBXUL_LIBS"
7507
AC_DEFINE(MOZ_ENABLE_LIBXUL)
7509
if test -n "$BUILD_STATIC_LIBS"; then
7510
AC_DEFINE(MOZ_STATIC_BUILD)
7512
XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS"
7515
dnl ========================================================
7517
dnl = Standalone module options
7519
dnl ========================================================
7520
MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7522
dnl Check for GLib and libIDL.
7523
dnl ========================================================
7524
case "$target_os" in
7525
msvc*|mks*|cygwin*|mingw*|wince*)
7526
SKIP_IDL_CHECK="yes"
7533
if test -z "$COMPILE_ENVIRONMENT"; then
7534
SKIP_IDL_CHECK="yes"
7537
dnl = Allow users to disable libIDL checking for standalone modules
7538
MOZ_ARG_WITHOUT_BOOL(libIDL,
7539
[ --without-libIDL Skip check for libIDL (standalone modules only)],
7540
SKIP_IDL_CHECK="yes")
7542
if test "$SKIP_IDL_CHECK" = "no"
7545
if test "$MACOS_SDK_DIR"; then
7546
dnl xpidl, and therefore libIDL, is only needed on the build host.
7547
dnl Don't build it against the SDK, as that causes problems.
7548
_MACSAVE_CFLAGS="$CFLAGS"
7549
_MACSAVE_LIBS="$LIBS"
7550
_MACSAVE_LDFLAGS="$LDFLAGS"
7551
_MACSAVE_NEXT_ROOT="$NEXT_ROOT"
7553
CFLAGS=`echo $CFLAGS|sed -E -e "s%((-I|-isystem )${MACOS_SDK_DIR}/usr/(include|lib/gcc)[^ ]*)|-F${MACOS_SDK_DIR}(/System)?/Library/Frameworks[^ ]*|-nostdinc[^ ]*|-isysroot ${MACOS_SDK_DIR}%%g"`
7554
LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
7555
LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
7560
if test "$MOZ_ENABLE_GTK2"; then
7561
PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
7563
dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
7564
dnl to either libIDL1 or libIDL2.
7565
if test -z "$_LIBIDL_FOUND"; then
7566
AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
7567
if test -z "$_LIBIDL_FOUND"; then
7568
PKG_CHECK_MODULES(LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
7572
dnl If we don't have a libIDL config program & not cross-compiling,
7573
dnl look for orbit-config instead.
7575
if test -z "$_LIBIDL_FOUND" && test -z "$CROSS_COMPILE"; then
7576
MOZ_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
7577
if test -n "$ORBIT_CONFIG"; then
7578
AC_MSG_CHECKING([for ORBit libIDL usability])
7579
_ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
7580
_ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
7581
_ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
7582
_ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
7583
LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
7584
LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
7586
_SAVE_CFLAGS="$CFLAGS"
7588
CFLAGS="$LIBIDL_CFLAGS $CFLAGS"
7589
LIBS="$LIBIDL_LIBS $LIBS"
7592
#include <libIDL/IDL.h>
7595
s=strdup(IDL_get_libver_string());
7608
AC_MSG_RESULT($result)
7609
CFLAGS="$_SAVE_CFLAGS"
7613
if test -z "$_LIBIDL_FOUND"; then
7614
AC_MSG_ERROR([libIDL not found.
7615
libIDL $LIBIDL_VERSION or higher is required.])
7617
if test "$MACOS_SDK_DIR"; then
7618
CFLAGS="$_MACSAVE_CFLAGS"
7619
LIBS="$_MACSAVE_LIBS"
7620
LDFLAGS="$_MACSAVE_LDFLAGS"
7621
if test -n "$_MACSAVE_NEXT_ROOT" ; then
7622
export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
7627
if test -n "$CROSS_COMPILE"; then
7628
if test -z "$HOST_LIBIDL_CONFIG"; then
7629
HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
7631
if test -n "$HOST_LIBIDL_CONFIG" && test "$HOST_LIBIDL_CONFIG" != "no"; then
7632
HOST_LIBIDL_CFLAGS=`${HOST_LIBIDL_CONFIG} --cflags`
7633
HOST_LIBIDL_LIBS=`${HOST_LIBIDL_CONFIG} --libs`
7635
HOST_LIBIDL_CFLAGS="$LIBIDL_CFLAGS"
7636
HOST_LIBIDL_LIBS="$LIBIDL_LIBS"
7640
if test -z "$SKIP_PATH_CHECKS"; then
7641
if test -z "${GLIB_CFLAGS}" || test -z "${GLIB_LIBS}" ; then
7642
if test "$MOZ_ENABLE_GTK2" || test "$USE_ELF_DYNSTR_GC" ; then
7643
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7645
AM_PATH_GLIB(${GLIB_VERSION})
7650
if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
7651
GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7654
AC_SUBST(LIBIDL_CFLAGS)
7655
AC_SUBST(LIBIDL_LIBS)
7656
AC_SUBST(STATIC_LIBIDL)
7657
AC_SUBST(GLIB_CFLAGS)
7659
AC_SUBST(GLIB_GMODULE_LIBS)
7660
AC_SUBST(HOST_LIBIDL_CONFIG)
7661
AC_SUBST(HOST_LIBIDL_CFLAGS)
7662
AC_SUBST(HOST_LIBIDL_LIBS)
7664
dnl ========================================================
7666
dnl ========================================================
7667
MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7670
MOZ_ARG_ENABLE_BOOL(system-cairo,
7671
[ --enable-system-cairo Use system cairo (located with pkgconfig)],
7675
# Check for headers defining standard int types.
7676
AC_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7678
if test "$MOZ_TREE_CAIRO"; then
7679
AC_DEFINE(MOZ_TREE_CAIRO)
7681
# For now we assume that we will have a uint64_t available through
7682
# one of the above headers or mozstdint.h.
7683
AC_DEFINE(HAVE_UINT64_T)
7685
# Define macros for cairo-features.h
7686
if test "$MOZ_X11"; then
7687
XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7688
XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7689
PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7690
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7691
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7692
MOZ_ENABLE_CAIRO_FT=1
7693
CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7695
if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
7696
QPAINTER_SURFACE_FEATURE="#define CAIRO_HAS_QPAINTER_SURFACE 1"
7698
if test "$MOZ_WIDGET_TOOLKIT" = "mac" -o "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
7699
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7700
QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7701
QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7703
if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
7704
WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7705
if test -z "$WINCE"; then
7706
WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7711
AC_TRY_COMPILE([#include <ddraw.h>], [int foo = DDLOCK_WAITNOTBUSY;], HAS_DDRAW=1, HAS_DDRAW=)
7712
if test -z "$HAS_DDRAW"; then
7713
AC_MSG_WARN([DirectDraw ddraw.h header not found or it's missing DDLOCK_WAITNOTBUSY, disabling DirectDraw surface. If you have an older SDK (such as the CE5 SDK), try copying in ddraw.lib and ddraw.h from the WM6 SDK.])
7714
DDRAW_SURFACE_FEATURE=
7716
DDRAW_SURFACE_FEATURE="#define CAIRO_HAS_DDRAW_SURFACE 1"
7719
if test -z "$OGLES_SDK_DIR"; then
7720
OGLES_SURFACE_FEATURE=
7723
#include <EGL/egl.h>
7724
#include <EGL/eglext.h>
7725
#include <GLES2/gl2.h>
7726
#include <GLES2/gl2ext.h>
7727
], [ EGLDisplay _cairo_ddraw_egl_dpy = EGL_NO_DISPLAY;], HAS_OGLES=1, HAS_OGLES=)
7728
if test -z "$HAS_OGLES"; then
7729
AC_MSG_WARN([OpenGL ES2 headers not found, disabling OpenGL acceleration surfaces.])
7730
OGLES_SURFACE_FEATURE=
7732
OGLES_SURFACE_FEATURE="#define CAIRO_DDRAW_USE_GL 1"
7736
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7738
if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
7739
OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7740
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7741
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
7742
MOZ_ENABLE_CAIRO_FT=1
7743
CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7744
CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7746
if test "$MOZ_WIDGET_TOOLKIT" = "beos"; then
7747
PKG_CHECK_MODULES(CAIRO_FT, fontconfig freetype2)
7748
BEOS_SURFACE_FEATURE="#define CAIRO_HAS_BEOS_SURFACE 1"
7749
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7750
MOZ_ENABLE_CAIRO_FT=1
7752
if test "$USE_FC_FREETYPE"; then
7753
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7755
AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7756
AC_SUBST(CAIRO_FT_CFLAGS)
7759
if test "$MOZ_DEBUG"; then
7760
SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
7762
SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
7765
PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
7767
AC_SUBST(PS_SURFACE_FEATURE)
7768
AC_SUBST(PDF_SURFACE_FEATURE)
7769
AC_SUBST(SVG_SURFACE_FEATURE)
7770
AC_SUBST(XLIB_SURFACE_FEATURE)
7771
AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7772
AC_SUBST(QUARTZ_SURFACE_FEATURE)
7773
AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7774
AC_SUBST(XCB_SURFACE_FEATURE)
7775
AC_SUBST(WIN32_SURFACE_FEATURE)
7776
AC_SUBST(DDRAW_SURFACE_FEATURE)
7777
AC_SUBST(OGLES_SURFACE_FEATURE)
7778
AC_SUBST(OS2_SURFACE_FEATURE)
7779
AC_SUBST(BEOS_SURFACE_FEATURE)
7780
AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7781
AC_SUBST(FT_FONT_FEATURE)
7782
AC_SUBST(FC_FONT_FEATURE)
7783
AC_SUBST(WIN32_FONT_FEATURE)
7784
AC_SUBST(QUARTZ_FONT_FEATURE)
7785
AC_SUBST(PNG_FUNCTIONS_FEATURE)
7786
AC_SUBST(QPAINTER_SURFACE_FEATURE)
7788
if test "$_WIN32_MSVC"; then
7789
MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/mozcairo.lib $(DEPTH)/gfx/cairo/libpixman/src/mozlibpixman.lib'
7791
MOZ_CAIRO_LIBS='$(DEPTH)/gfx/cairo/cairo/src/$(LIB_PREFIX)mozcairo.$(LIB_SUFFIX) $(DEPTH)/gfx/cairo/libpixman/src/$(LIB_PREFIX)mozlibpixman.$(LIB_SUFFIX)'" $CAIRO_FT_LIBS"
7793
if test "$MOZ_X11"; then
7794
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
7798
CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7799
mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
7802
PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION freetype2 fontconfig)
7803
MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
7804
MOZ_CAIRO_LIBS=$CAIRO_LIBS
7805
if test "$MOZ_X11"; then
7806
PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7807
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7808
MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7812
AC_SUBST(MOZ_TREE_CAIRO)
7813
AC_SUBST(MOZ_CAIRO_CFLAGS)
7814
AC_SUBST(MOZ_CAIRO_LIBS)
7817
dnl ========================================================
7819
QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'
7822
dnl ========================================================
7824
dnl ========================================================
7825
MOZ_ARG_DISABLE_BOOL(xul,
7826
[ --disable-xul Disable XUL],
7828
if test "$MOZ_XUL"; then
7831
dnl remove extensions that require XUL
7832
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
7837
dnl ========================================================
7838
dnl disable profile locking
7839
dnl do no use this in applications that can have more than
7840
dnl one process accessing the profile directory.
7841
dnl ========================================================
7842
MOZ_ARG_DISABLE_BOOL(profilelocking,
7843
[ --disable-profilelocking Disable profile locking],
7844
MOZ_PROFILELOCKING=,
7845
MOZ_PROFILELOCKING=1 )
7846
if test "$MOZ_PROFILELOCKING"; then
7847
AC_DEFINE(MOZ_PROFILELOCKING)
7850
dnl ========================================================
7851
dnl disable rdf services
7852
dnl ========================================================
7853
MOZ_ARG_DISABLE_BOOL(rdf,
7854
[ --disable-rdf Disable RDF],
7856
if test "$MOZ_RDF"; then
7862
dnl ========================================================
7863
dnl necko configuration options
7864
dnl ========================================================
7867
dnl option to disable various necko protocols
7869
MOZ_ARG_ENABLE_STRING(necko-protocols,
7870
[ --enable-necko-protocols[={http,ftp,default,all,none}]
7871
Enable/disable specific protocol handlers],
7872
[ for option in `echo $enableval | sed 's/,/ /g'`; do
7873
if test "$option" = "yes" || test "$option" = "all"; then
7874
NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7875
elif test "$option" = "no" || test "$option" = "none"; then
7877
elif test "$option" = "default"; then
7878
NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
7879
elif test `echo "$option" | grep -c \^-` != 0; then
7880
option=`echo $option | sed 's/^-//'`
7881
NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
7883
NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
7886
NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
7888
NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
7889
AC_SUBST(NECKO_PROTOCOLS)
7890
for p in $NECKO_PROTOCOLS; do
7891
AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
7895
dnl option to disable necko's disk cache
7897
MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
7898
[ --disable-necko-disk-cache
7899
Disable necko disk cache],
7902
AC_SUBST(NECKO_DISK_CACHE)
7903
if test "$NECKO_DISK_CACHE"; then
7904
AC_DEFINE(NECKO_DISK_CACHE)
7908
dnl option to disable necko's wifi scanner
7910
MOZ_ARG_DISABLE_BOOL(necko-wifi,
7911
[ --disable-necko-wifi Disable necko wifi scanner],
7916
if test "$OS_ARCH" = "OS2"; then
7917
dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
7920
if test "$NECKO_WIFI" -a \
7921
"$OS_ARCH" != "Linux" -a \
7922
"$OS_ARCH" != "Darwin" -a \
7923
"$OS_ARCH" != "WINNT" -a \
7924
"$OS_ARCH" != "WINCE"; then
7925
AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
7928
if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
7930
AC_CHECK_HEADER([iwlib.h])
7931
if test "$ac_cv_header_iwlib_h" != "yes"; then
7932
AC_MSG_ERROR([Can't find header iwlib.h for Necko WiFi scanning (might be in package libiw-dev (Ubuntu) or wireless-tools-devel (Fedora)); use --disable-necko-wifi to disable])
7936
if test "$NECKO_WIFI"; then
7937
AC_DEFINE(NECKO_WIFI)
7939
AC_SUBST(NECKO_WIFI)
7942
dnl option to minimize size of necko's i/o buffers
7944
MOZ_ARG_ENABLE_BOOL(necko-small-buffers,
7945
[ --enable-necko-small-buffers
7946
Minimize size of necko's i/o buffers],
7947
NECKO_SMALL_BUFFERS=1,
7948
NECKO_SMALL_BUFFERS=)
7949
AC_SUBST(NECKO_SMALL_BUFFERS)
7950
if test "$NECKO_SMALL_BUFFERS"; then
7951
AC_DEFINE(NECKO_SMALL_BUFFERS)
7955
dnl option to disable cookies
7957
MOZ_ARG_DISABLE_BOOL(cookies,
7958
[ --disable-cookies Disable cookie support],
7961
AC_SUBST(NECKO_COOKIES)
7962
if test "$NECKO_COOKIES"; then
7963
AC_DEFINE(NECKO_COOKIES)
7967
dnl Build jsctypes on the platforms we can.
7969
AC_SUBST(BUILD_CTYPES)
7970
if test "$OS_TARGET" != "WINCE" -o `echo $OS_TEST | grep -ic arm` != 1; then
7972
AC_DEFINE(BUILD_CTYPES)
7975
dnl NECKO_ configuration options are not global
7976
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
7978
dnl Only build Mork if it's required
7980
if test "$MOZ_MORK"; then
7984
dnl Build the lightweight Mork reader if required
7985
AC_SUBST(MOZ_MORKREADER)
7986
if test "$MOZ_MORKREADER"; then
7987
AC_DEFINE(MOZ_MORKREADER)
7990
dnl ========================================================
7991
if test "$MOZ_DEBUG" || test "$NS_TRACE_MALLOC"; then
7992
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7995
dnl ========================================================
7997
dnl = Maintainer debug option (no --enable equivalent)
7999
dnl ========================================================
8004
AC_SUBST(AR_EXTRACT)
8008
AC_SUBST(AS_DASH_C_FLAG)
8013
AC_SUBST(USE_SHORT_LIBNAME)
8017
AC_SUBST(NS_USE_NATIVE)
8018
AC_SUBST(MOZ_WIDGET_TOOLKIT)
8019
AC_SUBST(MOZ_GFX_TOOLKIT)
8020
AC_SUBST(MOZ_UPDATE_XTERM)
8022
AC_SUBST(MOZ_PLATFORM_MAEMO)
8023
AC_SUBST(MOZ_AUTH_EXTENSION)
8024
AC_SUBST(MOZ_MATHML)
8025
AC_SUBST(MOZ_PERMISSIONS)
8027
AC_SUBST(MOZ_NO_INSPECTOR_APIS)
8028
AC_SUBST(MOZ_PREF_EXTENSIONS)
8031
AC_SUBST(MOZ_XSLT_STANDALONE)
8032
AC_SUBST(MOZ_JS_LIBS)
8035
AC_SUBST(MOZ_DEBUG_MODULES)
8036
AC_SUBST(MOZ_PROFILE_MODULES)
8037
AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
8038
AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
8039
AC_SUBST(MOZ_DEBUG_FLAGS)
8040
AC_SUBST(MOZ_DEBUG_LDFLAGS)
8041
AC_SUBST(WARNINGS_AS_ERRORS)
8042
AC_SUBST(MOZ_DBGRINFO_MODULES)
8043
AC_SUBST(MOZ_EXTENSIONS)
8044
AC_SUBST(MOZ_IMG_DECODERS)
8045
AC_SUBST(MOZ_IMG_ENCODERS)
8046
AC_SUBST(MOZ_JSDEBUGGER)
8047
AC_SUBST(MOZ_NO_XPCOM_OBSOLETE)
8048
AC_SUBST(MOZ_PLUGINS)
8049
AC_SUBST(ENABLE_EAZEL_PROFILER)
8050
AC_SUBST(EAZEL_PROFILER_CFLAGS)
8051
AC_SUBST(EAZEL_PROFILER_LIBS)
8052
AC_SUBST(MOZ_PERF_METRICS)
8053
AC_SUBST(GC_LEAK_DETECTOR)
8054
AC_SUBST(MOZ_LOG_REFCNT)
8058
AC_SUBST(MOZ_CALLGRIND)
8060
AC_SUBST(MOZ_XPCTOOLS)
8061
AC_SUBST(MOZ_JSLOADER)
8062
AC_SUBST(MOZ_USE_NATIVE_UCONV)
8063
AC_SUBST(MOZ_INSURE)
8064
AC_SUBST(MOZ_INSURE_DIRS)
8065
AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
8066
AC_SUBST(MOZ_QUANTIFY)
8067
AC_SUBST(MOZ_INSURIFYING)
8069
AC_SUBST(MOZ_PLACES)
8070
AC_SUBST(MOZ_PLACES_BOOKMARKS)
8071
AC_SUBST(MOZ_STORAGE)
8073
AC_SUBST(NS_PRINTING)
8075
AC_SUBST(MOZ_JAVAXPCOM)
8076
AC_SUBST(JAVA_INCLUDE_PATH)
8081
AC_SUBST(MOZ_PROFILELOCKING)
8084
AC_SUBST(MOZ_XIE_LIBS)
8085
AC_SUBST(MOZ_ENABLE_POSTSCRIPT)
8087
AC_SUBST(XPCOM_USE_LEA)
8088
AC_SUBST(BUILD_STATIC_LIBS)
8089
AC_SUBST(MOZ_ENABLE_LIBXUL)
8090
AC_SUBST(ENABLE_TESTS)
8092
AC_SUBST(MOZ_UNIVERSALCHARDET)
8093
AC_SUBST(ACCESSIBILITY)
8094
AC_SUBST(MOZ_XPINSTALL)
8095
AC_SUBST(MOZ_VIEW_SOURCE)
8096
AC_SUBST(MOZ_SPELLCHECK)
8097
AC_SUBST(MOZ_XPFE_COMPONENTS)
8098
AC_SUBST(MOZ_USER_DIR)
8099
AC_SUBST(MOZ_CRASHREPORTER)
8101
AC_SUBST(ENABLE_STRIP)
8102
AC_SUBST(PKG_SKIP_STRIP)
8103
AC_SUBST(USE_ELF_DYNSTR_GC)
8104
AC_SUBST(INCREMENTAL_LINKER)
8105
AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
8106
AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
8107
AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
8109
AC_SUBST(MOZ_FIX_LINK_PATHS)
8110
AC_SUBST(XPCOM_LIBS)
8111
AC_SUBST(XPCOM_FROZEN_LDOPTS)
8112
AC_SUBST(XPCOM_GLUE_LDOPTS)
8113
AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
8115
AC_SUBST(USE_DEPENDENT_LIBS)
8117
AC_SUBST(MOZ_BUILD_ROOT)
8118
AC_SUBST(MOZ_OS2_TOOLS)
8119
AC_SUBST(MOZ_OS2_USE_DECLSPEC)
8121
AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8122
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8123
AC_SUBST(MOZ_TIMELINE)
8124
AC_SUBST(OGLES_SDK_DIR)
8126
AC_SUBST(MOZ_APP_NAME)
8127
AC_SUBST(MOZ_APP_DISPLAYNAME)
8128
AC_SUBST(MOZ_APP_VERSION)
8129
AC_SUBST(MOZ_APP_UA_EXTRA)
8130
AC_SUBST(FIREFOX_VERSION)
8132
AC_SUBST(MOZ_PKG_SPECIAL)
8134
AC_SUBST(MOZILLA_OFFICIAL)
8137
AC_SUBST(MOZ_DEBUG_SYMBOLS)
8138
AC_SUBST(MOZ_MAPINFO)
8139
AC_SUBST(MOZ_BROWSE_INFO)
8140
AC_SUBST(MOZ_TOOLS_DIR)
8141
AC_SUBST(CYGWIN_WRAPPER)
8143
AC_SUBST(WIN32_REDIST_DIR)
8147
AC_SUBST(WINCE_SDK_DIR)
8148
AC_SUBST(WINCE_WINDOWS_MOBILE)
8150
dnl Echo the CFLAGS to remove extra whitespace.
8157
$_MOZ_EXCEPTIONS_FLAGS \
8158
$_WARNINGS_CXXFLAGS \
8161
COMPILE_CFLAGS=`echo \
8166
COMPILE_CXXFLAGS=`echo \
8167
$_DEFINES_CXXFLAGS \
8171
AC_SUBST(SYSTEM_MAKEDEPEND)
8172
AC_SUBST(SYSTEM_LIBXUL)
8173
AC_SUBST(SYSTEM_JPEG)
8174
AC_SUBST(SYSTEM_PNG)
8175
AC_SUBST(SYSTEM_ZLIB)
8176
AC_SUBST(SYSTEM_BZ2)
8178
AC_SUBST(JPEG_CFLAGS)
8180
AC_SUBST(ZLIB_CFLAGS)
8182
AC_SUBST(BZ2_CFLAGS)
8184
AC_SUBST(PNG_CFLAGS)
8187
AC_SUBST(MOZ_JPEG_CFLAGS)
8188
AC_SUBST(MOZ_JPEG_LIBS)
8189
AC_SUBST(MOZ_ZLIB_CFLAGS)
8190
AC_SUBST(MOZ_ZLIB_LIBS)
8191
AC_SUBST(MOZ_BZ2_CFLAGS)
8192
AC_SUBST(MOZ_BZ2_LIBS)
8193
AC_SUBST(MOZ_PNG_CFLAGS)
8194
AC_SUBST(MOZ_PNG_LIBS)
8196
AC_SUBST(NSPR_CFLAGS)
8198
AC_SUBST(MOZ_NATIVE_NSPR)
8200
AC_SUBST(NSS_CFLAGS)
8202
AC_SUBST(NSS_DEP_LIBS)
8203
AC_SUBST(MOZ_NATIVE_NSS)
8204
AC_SUBST(NSS_DISABLE_DBM)
8209
AC_SUBST(COMPILE_CFLAGS)
8210
AC_SUBST(COMPILE_CXXFLAGS)
8213
AC_SUBST(CROSS_COMPILE)
8214
AC_SUBST(WCHAR_CFLAGS)
8218
AC_SUBST(HOST_CFLAGS)
8219
AC_SUBST(HOST_CXXFLAGS)
8220
AC_SUBST(HOST_OPTIMIZE_FLAGS)
8222
AC_SUBST(HOST_AR_FLAGS)
8224
AC_SUBST(HOST_RANLIB)
8225
AC_SUBST(HOST_NSPR_MDCPUCFG)
8226
AC_SUBST(HOST_BIN_SUFFIX)
8227
AC_SUBST(HOST_OS_ARCH)
8229
AC_SUBST(TARGET_CPU)
8230
AC_SUBST(TARGET_VENDOR)
8232
AC_SUBST(TARGET_NSPR_MDCPUCFG)
8233
AC_SUBST(TARGET_MD_ARCH)
8234
AC_SUBST(TARGET_XPCOM_ABI)
8237
AC_SUBST(OS_RELEASE)
8240
AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
8241
AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8243
AC_SUBST(WRAP_MALLOC_CFLAGS)
8244
AC_SUBST(WRAP_MALLOC_LIB)
8247
AC_SUBST(MKSHLIB_FORCE_ALL)
8248
AC_SUBST(MKSHLIB_UNFORCE_ALL)
8249
AC_SUBST(DSO_CFLAGS)
8250
AC_SUBST(DSO_PIC_CFLAGS)
8251
AC_SUBST(DSO_LDOPTS)
8252
AC_SUBST(LIB_PREFIX)
8253
AC_SUBST(DLL_PREFIX)
8254
AC_SUBST(DLL_SUFFIX)
8255
AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8256
AC_SUBST(LIB_SUFFIX)
8257
AC_SUBST(OBJ_SUFFIX)
8258
AC_SUBST(BIN_SUFFIX)
8259
AC_SUBST(ASM_SUFFIX)
8260
AC_SUBST(IMPORT_LIB_SUFFIX)
8262
AC_SUBST(CC_VERSION)
8263
AC_SUBST(CXX_VERSION)
8264
AC_SUBST(MSMANIFEST_TOOL)
8266
if test "$USING_HCC"; then
8267
CC='${topsrcdir}/build/hcc'
8269
CXX='${topsrcdir}/build/hcpp'
8270
CXX="$CXX '$_OLDCXX'"
8275
dnl Check for missing components
8276
if test "$COMPILE_ENVIRONMENT"; then
8277
if test "$MOZ_X11"; then
8278
dnl ====================================================
8279
dnl = Check if X headers exist
8280
dnl ====================================================
8281
_SAVE_CFLAGS=$CFLAGS
8282
CFLAGS="$CFLAGS $XCFLAGS"
8286
#include <X11/Xlib.h>
8287
#include <X11/Intrinsic.h>
8291
if ((dpy = XOpenDisplay(NULL)) == NULL) {
8292
fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8296
[ AC_MSG_ERROR([Could not compile basic X program.]) ])
8297
CFLAGS="$_SAVE_CFLAGS"
8299
if test ! -z "$MISSING_X"; then
8300
AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8304
fi # COMPILE_ENVIRONMENT
8306
if test "$USE_FC_FREETYPE"; then
8307
if test "$COMPILE_ENVIRONMENT"; then
8308
_SAVE_CPPFLAGS="$CPPFLAGS"
8309
CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
8310
AC_CHECK_HEADERS(fontconfig/fcfreetype.h, ,
8311
[AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)])
8312
CPPFLAGS="$_SAVE_CPPFLAGS"
8314
AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
8318
dnl Set various defines and substitutions
8319
dnl ========================================================
8321
if test "$OS_ARCH" = "BeOS"; then
8324
elif test "$OS_ARCH" = "Darwin"; then
8326
AC_DEFINE(UNIX_ASYNC_DNS)
8328
elif test "$OS_ARCH" = "OpenVMS"; then
8330
elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
8332
AC_DEFINE(UNIX_ASYNC_DNS)
8335
AC_SUBST(MOZ_MOVEMAIL)
8337
if test "$MOZ_DEBUG"; then
8338
AC_DEFINE(MOZ_REFLOW_PERF)
8339
AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8342
if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8343
AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8344
ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8345
ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8346
ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8347
ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8348
AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8349
AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8350
AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8353
dnl ========================================================
8354
dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
8355
dnl ========================================================
8358
WIN_TOP_SRC=`cd $srcdir; pwd -W`
8361
HOST_CC="\$(CYGWIN_WRAPPER) $HOST_CC"
8362
HOST_CXX="\$(CYGWIN_WRAPPER) $HOST_CXX"
8363
CC="\$(CYGWIN_WRAPPER) $CC"
8364
CXX="\$(CYGWIN_WRAPPER) $CXX"
8365
CPP="\$(CYGWIN_WRAPPER) $CPP"
8366
LD="\$(CYGWIN_WRAPPER) $LD"
8367
AS="\$(CYGWIN_WRAPPER) $AS"
8368
RC="\$(CYGWIN_WRAPPER) $RC"
8369
MIDL="\$(CYGWIN_WRAPPER) $MIDL"
8370
CYGDRIVE_MOUNT=`mount -p | awk '{ if (/^\//) { print $1; exit } }'`
8371
WIN_TOP_SRC=`cygpath -a -w $srcdir | sed -e 's|\\\\|/|g'`
8375
AC_SUBST(CYGDRIVE_MOUNT)
8376
AC_SUBST(WIN_TOP_SRC)
8378
AC_SUBST(MOZILLA_VERSION)
8380
AC_SUBST(ac_configure_args)
8382
dnl Spit out some output
8383
dnl ========================================================
8385
dnl The following defines are used by xpcom
8386
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8388
HAVE_CPP_2BYTE_WCHAR_T
8389
HAVE_CPP_ACCESS_CHANGING_USING
8390
HAVE_CPP_AMBIGUITY_RESOLVING_USING
8393
HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8395
HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
8396
HAVE_CPP_NAMESPACE_STD
8398
HAVE_CPP_PARTIAL_SPECIALIZATION
8399
HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8401
HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
8403
NEED_CPP_UNUSED_IMPLEMENTATIONS
8407
HAVE_ICONV_WITH_CONST_INPUT
8415
netwerk/necko-config.h
8416
xpcom/xpcom-config.h
8417
xpcom/xpcom-private.h
8420
# Save the defines header file before autoconf removes it.
8421
# (Do not add AC_DEFINE calls after this line.)
8422
_CONFIG_TMP=confdefs-tmp.h
8423
_CONFIG_DEFS_H=mozilla-config.h
8425
cat > $_CONFIG_TMP <<\EOF
8426
/* List of defines generated by configure. Included with preprocessor flag,
8427
* -include, to avoid long list of -D defines on the compile command-line.
8431
#ifndef _MOZILLA_CONFIG_H_
8432
#define _MOZILLA_CONFIG_H_
8435
_EGREP_PATTERN='^#define ('
8436
if test -n "$_NON_GLOBAL_ACDEFINES"; then
8437
for f in $_NON_GLOBAL_ACDEFINES; do
8438
_EGREP_PATTERN="${_EGREP_PATTERN}$f|"
8441
_EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
8443
sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
8445
cat >> $_CONFIG_TMP <<\EOF
8447
#endif /* _MOZILLA_CONFIG_H_ */
8451
# Only write mozilla-config.h when something changes (or it doesn't exist)
8452
if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
8455
AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
8456
mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
8458
echo ==== $_CONFIG_DEFS_H =================================
8462
dnl Probably shouldn't call this manually but we always want the output of DEFS
8463
rm -f confdefs.h.save
8464
mv confdefs.h confdefs.h.save
8465
egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
8466
AC_OUTPUT_MAKE_DEFS()
8468
AC_SUBST(MOZ_DEFINES)
8470
mv confdefs.h.save confdefs.h
8472
dnl Load the list of Makefiles to generate.
8473
dnl To add new Makefiles, edit allmakefiles.sh.
8474
dnl allmakefiles.sh sets the variable, MAKEFILES.
8475
. ${srcdir}/allmakefiles.sh
8477
dnl Run a perl script to quickly create the makefiles.
8478
dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
8479
dnl for the files it cannot handle correctly. This way, config.status
8480
dnl will handle these files.
8481
dnl If it fails, nothing is set and config.status will run as usual.
8483
dnl This does not change the $MAKEFILES variable.
8485
dnl OpenVMS gets a line overflow on the long eval command, so use a temp file.
8487
if test -z "${AS_PERL}"; then
8488
echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
8490
echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl -nowrap --cygwin-srcdir=$srcdir > conftest.sh
8495
echo $MAKEFILES > unallmakefiles
8497
mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
8499
AC_OUTPUT($MAKEFILES)
8501
dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
8502
if test "$CAIRO_FEATURES_H"; then
8503
if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
8504
echo "$CAIRO_FEATURES_H is unchanged"
8505
mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
8507
rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
8511
dnl ========================================================
8512
dnl = Setup a nice relatively clean build environment for
8513
dnl = sub-configures.
8514
dnl ========================================================
8517
CFLAGS="$_SUBDIR_CFLAGS"
8518
CPPFLAGS="$_SUBDIR_CPPFLAGS"
8519
CXXFLAGS="$_SUBDIR_CXXFLAGS"
8520
LDFLAGS="$_SUBDIR_LDFLAGS"
8521
HOST_CC="$_SUBDIR_HOST_CC"
8522
HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8523
HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8529
# No need to run subconfigures when building with LIBXUL_SDK_DIR
8530
if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8532
if test -z "$MOZ_NATIVE_NSPR"; then
8533
ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8534
if test -z "$MOZ_DEBUG"; then
8535
ac_configure_args="$ac_configure_args --disable-debug"
8537
if test "$MOZ_OPTIMIZE" = "1"; then
8538
ac_configure_args="$ac_configure_args --enable-optimize"
8540
if test "$OS_ARCH" = "WINNT" && test "$NS_TRACE_MALLOC"; then
8541
ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
8543
if test -n "$HAVE_64BIT_OS"; then
8544
ac_configure_args="$ac_configure_args --enable-64bit"
8546
if test -n "$USE_ARM_KUSER"; then
8547
ac_configure_args="$ac_configure_args --with-arm-kuser"
8549
AC_OUTPUT_SUBDIRS(nsprpub)
8550
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8553
if test -z "$MOZ_NATIVE_NSPR"; then
8554
# Hack to deal with the fact that we use NSPR_CFLAGS everywhere
8555
AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
8556
if test "$OS_ARCH" != "WINNT" && test "$OS_ARCH" != "WINCE"; then
8557
NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
8558
$PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
8559
NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
8560
$PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
8562
rm -f config/autoconf.mk.bak
8565
# Run the SpiderMonkey 'configure' script.
8566
dist=$MOZ_BUILD_ROOT/dist
8567
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8568
ac_configure_args="$ac_configure_args --enable-threadsafe"
8569
if test -z "$MOZ_NATIVE_NSPR"; then
8570
ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
8571
ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
8573
ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
8574
ac_configure_args="$ac_configure_args --includedir=$dist/include"
8575
ac_configure_args="$ac_configure_args --bindir=$dist/bin"
8576
ac_configure_args="$ac_configure_args --libdir=$dist/lib"
8577
ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
8578
if test "$MOZ_MEMORY"; then
8579
ac_configure_args="$ac_configure_args --enable-jemalloc"
8580
if test -n "$MOZ_MEMORY_LDFLAGS"; then
8581
export MOZ_MEMORY_LDFLAGS
8584
AC_OUTPUT_SUBDIRS(js/src)
8585
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8587
# Build jsctypes on the platforms we can.
8588
if test "$BUILD_CTYPES"; then
8589
# Run the libffi 'configure' script on platforms that it supports.
8590
if test -z "$_MSC_VER"; then
8591
ac_configure_args="--disable-shared --enable-static --disable-raw-api"
8592
if test "$MOZ_DEBUG"; then
8593
ac_configure_args="$ac_configure_args --enable-debug"
8595
if test -n "$DSO_PIC_CFLAGS"; then
8596
ac_configure_args="$ac_configure_args --with-pic"
8598
if test -n "$CROSS_COMPILE"; then
8599
ac_configure_args="$ac_configure_args --build=$build --host=$target"
8601
if test "$SOLARIS_SUNPRO_CC"; then
8602
# Always use gcc for libffi on Solaris
8603
old_cache_file=$cache_file
8604
cache_file=js/ctypes/libffi/config.cache
8605
ac_configure_args="$ac_configure_args CC=gcc"
8606
AC_OUTPUT_SUBDIRS(js/ctypes/libffi)
8607
cache_file=$old_cache_file
8609
AC_OUTPUT_SUBDIRS(js/ctypes/libffi)
8611
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8615
fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
8617
dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
8618
dnl Needs to be at the end to respect possible changes from NSPR configure
8619
if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
8620
echo "config/autoconf.mk is unchanged"
8621
mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
8623
rm -f config/autoconf.mk.orig 2> /dev/null