1
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2
dnl vi: set tabstop=4 shiftwidth=4 expandtab syntax=m4:
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>
45
dnl Windows x64 support
46
dnl Makoto Kato <m_kato@ga2.so-net.ne.jp>
48
dnl Alternatively, the contents of this file may be used under the terms of
49
dnl either the GNU General Public License Version 2 or later (the "GPL"), or
50
dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
51
dnl in which case the provisions of the GPL or the LGPL are applicable instead
52
dnl of those above. If you wish to allow use of your version of this file only
53
dnl under the terms of either the GPL or the LGPL, and not to allow others to
54
dnl use your version of this file under the terms of the MPL, indicate your
55
dnl decision by deleting the provisions above and replace them with the notice
56
dnl and other provisions required by the GPL or the LGPL. If you do not delete
57
dnl the provisions above, a recipient may use your version of this file under
58
dnl the terms of any one of the MPL, the GPL or the LGPL.
60
dnl ***** END LICENSE BLOCK *****
62
dnl Process this file with autoconf to produce a configure script.
63
dnl ========================================================
66
AC_INIT(config/config.mk)
67
AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
69
TARGET_CPU="${target_cpu}"
70
TARGET_VENDOR="${target_vendor}"
71
TARGET_OS="${target_os}"
73
MOZ_DEB_TIMESTAMP=`date +"%a, %d %b %Y %T %z" 2>&1`
74
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
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 and gcc-4.2 for darwin
185
dnl ==============================================================
186
if test -z "$CROSS_COMPILE"; then
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
195
case "${target_cpu}" in
204
if test -z "$MIDL"; then MIDL=midl; fi
207
if test -z "$CC"; then CC=gcc-4.2; fi
208
if test -z "$CXX"; then CXX=g++-4.2; fi
213
COMPILE_ENVIRONMENT=1
214
MOZ_ARG_DISABLE_BOOL(compile-environment,
215
[ --disable-compile-environment
216
Disable compiler/library checks.],
217
COMPILE_ENVIRONMENT= )
218
AC_SUBST(COMPILE_ENVIRONMENT)
220
MOZ_ARG_WITH_STRING(l10n-base,
221
[ --with-l10n-base=DIR path to l10n repositories],
222
L10NBASEDIR=$withval)
223
if test ! -z "$L10NBASEDIR"; then
224
if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
225
AC_MSG_ERROR([--with-l10n-base must specify a path])
226
elif test -d "$L10NBASEDIR"; then
227
L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
229
AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
232
AC_SUBST(L10NBASEDIR)
234
dnl Check for Perl first -- needed for win32 SDK checks
235
MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
236
if test -z "$PERL" -o "$PERL" = ":"; then
237
AC_MSG_ERROR([perl not found in \$PATH])
240
dnl ========================================================
241
dnl = Android uses a very custom (hacky) toolchain; we need to do this
242
dnl = here, so that the compiler checks can succeed
243
dnl ========================================================
245
MOZ_ARG_WITH_STRING(android-ndk,
246
[ --with-android-ndk=DIR
247
location where the Android NDK can be found],
248
android_ndk=$withval)
250
MOZ_ARG_WITH_STRING(android-toolchain,
251
[ --with-android-toolchain=DIR
252
location of the android toolchain, default NDK/build/prebuilt/HOST/arm-eabi-4.4.0],
253
android_toolchain=$withval)
256
MOZ_ARG_WITH_STRING(android-version,
257
[ --with-android-version=VER
258
android platform version, default 5],
259
android_version=$withval,
262
MOZ_ARG_WITH_STRING(android-sdk,
263
[ --with-android-sdk=DIR
264
location where the Android SDK can be found (base directory, e.g. .../android/platforms/android-6)],
265
android_sdk=$withval)
267
if test "$target" = "arm-android-eabi" ; then
268
if test -z "$android_ndk" ; then
269
AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
272
if test -z "$android_sdk" ; then
273
AC_MSG_ERROR([You must specify --with-android-sdk=/path/to/sdk when targeting Android.])
276
android_platform_tools="$android_sdk"/../../platform-tools
277
if test ! -d "$android_platform_tools" ; then
278
android_platform_tools="$android_sdk"/tools # SDK Tools < r8
281
if test -z "$android_toolchain" ; then
282
android_toolchain="$android_ndk"/build/prebuilt/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/arm-eabi-4.4.0
285
if test -z "$android_platform" ; then
286
android_platform="$android_ndk"/build/platforms/android-"$android_version"/arch-"$target_cpu"
290
AS="$android_toolchain"/bin/arm-eabi-as
291
CC="$android_toolchain"/bin/arm-eabi-gcc
292
CXX="$android_toolchain"/bin/arm-eabi-g++
293
CPP="$android_toolchain"/bin/arm-eabi-cpp
294
LD="$android_toolchain"/bin/arm-eabi-ld
295
AR="$android_toolchain"/bin/arm-eabi-ar
296
RANLIB="$android_toolchain"/bin/arm-eabi-ranlib
297
STRIP="$android_toolchain"/bin/arm-eabi-strip
299
CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
300
CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
301
CXXFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CXXFLAGS"
303
dnl Add -llog by default, since we use it all over the place.
304
dnl Add --allow-shlib-undefined, because libGLESv2 links to an
305
dnl undefined symbol (present on the hardware, just not in the
307
LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform -llog -Wl,--allow-shlib-undefined $LDFLAGS"
309
dnl prevent cross compile section from using these flags as host flags
310
if test -z "$HOST_CPPFLAGS" ; then
313
if test -z "$HOST_CFLAGS" ; then
316
if test -z "$HOST_CXXFLAGS" ; then
319
if test -z "$HOST_LDFLAGS" ; then
323
ANDROID_NDK="${android_ndk}"
324
ANDROID_TOOLCHAIN="{android_toolchain}"
325
ANDROID_PLATFORM="{android_platform}"
326
ANDROID_SDK="${android_sdk}"
327
ANDROID_PLATFORM_TOOLS="${android_platform_tools}"
328
ANDROID_VERSION="${android_version}"
329
if test -z "$ANDROID_PACKAGE_NAME" ; then
330
ANDROID_PACKAGE_NAME='org.mozilla.$(MOZ_APP_NAME)'
334
AC_DEFINE_UNQUOTED(ANDROID_VERSION, $android_version)
335
AC_SUBST(ANDROID_VERSION)
337
MOZ_CHROME_FILE_FORMAT=omni
341
AC_SUBST(ANDROID_NDK)
342
AC_SUBST(ANDROID_TOOLCHAIN)
343
AC_SUBST(ANDROID_PLATFORM)
344
AC_SUBST(ANDROID_SDK)
345
AC_SUBST(ANDROID_PLATFORM_TOOLS)
346
AC_SUBST(ANDROID_PACKAGE_NAME)
348
dnl ========================================================
349
dnl Checks for compilers.
350
dnl ========================================================
351
dnl Set CROSS_COMPILE in the environment when running configure
352
dnl to use the cross-compile setup for now
353
dnl ========================================================
355
dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
358
if test "$COMPILE_ENVIRONMENT"; then
360
dnl Do some special WinCE toolchain stuff
364
MOZ_ARG_WITH_STRING(wince-sdk,
365
[ --with-wince-sdk=WINCE_SDK_DIR
366
The path to the Windows CE SDK],
367
WINCE_SDK_DIR=$withval)
369
MOZ_ARG_WITH_STRING(ogles-sdk,
370
[ --with-ogles-sdk=OGLES_SDK_DIR
371
The path to the OGLES SDK],
372
OGLES_SDK_DIR=$withval)
378
echo -----------------------------------------------------------------------------
379
echo Building Windows CE Shunt Library and Tool Chain
386
_topsrcdirwin=`cd \`dirname $0\`; pwd -W`
387
make OGLES_SDK_DIR="$OGLES_SDK_DIR" WINCE_SDK_DIR="$WINCE_SDK_DIR" \
388
TOPSRCDIR="$_topsrcdirwin" OBJDIR="$_pwd" target="$target" \
389
-C $srcdir/build/wince/tools
391
CC="$_pwd/dist/sdk/bin/$target-gcc.exe"
392
CXX="$_pwd/dist/sdk/bin/$target-gcc.exe"
393
CPP="$_pwd/dist/sdk/bin/$target-gcc.exe -E -nologo"
394
CXXCPP="$_pwd/dist/sdk/bin/$target-gcc.exe -TP -E -nologo"
395
LD="$_pwd/dist/sdk/bin/$target-link.exe"
396
AR="$_pwd/dist/sdk/bin/$target-lib.exe"
397
AS="$_pwd/dist/sdk/bin/$target-as.exe"
398
RC="$_pwd/dist/sdk/bin/$target-res.exe"
401
echo -----------------------------------------------------------------------------
406
if test -n "$CROSS_COMPILE" -a "$target" != "$host"; then
407
echo "cross compiling from $host to $target"
411
_SAVE_CFLAGS="$CFLAGS"
412
_SAVE_LDFLAGS="$LDFLAGS"
414
AC_MSG_CHECKING([for host c compiler])
415
AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
416
if test -z "$HOST_CC"; then
417
AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
419
AC_MSG_RESULT([$HOST_CC])
420
AC_MSG_CHECKING([for host c++ compiler])
421
AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
422
if test -z "$HOST_CXX"; then
423
AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
425
AC_MSG_RESULT([$HOST_CXX])
427
if test -z "$HOST_CFLAGS"; then
428
HOST_CFLAGS="$CFLAGS"
430
if test -z "$HOST_CXXFLAGS"; then
431
HOST_CXXFLAGS="$CXXFLAGS"
433
if test -z "$HOST_LDFLAGS"; then
434
HOST_LDFLAGS="$LDFLAGS"
436
if test -z "$HOST_AR_FLAGS"; then
437
HOST_AR_FLAGS="$AR_FLAGS"
439
AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
440
AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
442
CFLAGS="$HOST_CFLAGS"
443
LDFLAGS="$HOST_LDFLAGS"
445
AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
446
AC_TRY_COMPILE([], [return(0);],
447
[ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
448
AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
451
CFLAGS="$HOST_CXXFLAGS"
453
AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
454
AC_TRY_COMPILE([], [return(0);],
455
[ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
456
AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
460
LDFLAGS=$_SAVE_LDFLAGS
462
case "$build:$target" in
463
powerpc-apple-darwin8*:i?86-apple-darwin*)
464
dnl The Darwin cross compiler doesn't necessarily point itself at a
465
dnl root that has libraries for the proper architecture, it defaults
466
dnl to the system root. The libraries in the system root on current
467
dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
468
dnl checks will fail. Fake a working SDK in that case.
470
_SAVE_CXXFLAGS=$CXXLAGS
471
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk $CFLAGS"
472
CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk $CXXFLAGS"
476
AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
479
AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
483
case "$build:$target" in
484
powerpc-apple-darwin8*:i?86-apple-darwin*)
485
dnl Revert the changes made above. From this point on, the target
486
dnl compiler will never be used without applying the SDK to CFLAGS
487
dnl (see --with-macos-sdk below).
489
CXXFLAGS=$_SAVE_CXXFLAGS
493
AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
494
AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
495
MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
496
AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
497
AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
498
AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
499
AC_DEFINE(CROSS_COMPILE)
504
MOZ_PATH_PROGS(AS, $AS as, $CC)
505
AC_CHECK_PROGS(AR, ar, :)
506
AC_CHECK_PROGS(LD, ld, :)
507
AC_CHECK_PROGS(STRIP, strip, :)
508
AC_CHECK_PROGS(WINDRES, windres, :)
509
if test -z "$HOST_CC"; then
512
if test -z "$HOST_CFLAGS"; then
513
HOST_CFLAGS='$(CFLAGS)'
515
if test -z "$HOST_CXX"; then
518
if test -z "$HOST_CXXFLAGS"; then
519
HOST_CXXFLAGS='$(CXXFLAGS)'
521
if test -z "$HOST_LDFLAGS"; then
522
HOST_LDFLAGS='$(LDFLAGS)'
524
if test -z "$HOST_RANLIB"; then
525
HOST_RANLIB='$(RANLIB)'
527
if test -z "$HOST_AR"; then
530
if test -z "$HOST_AR_FLAGS"; then
531
HOST_AR_FLAGS='$(AR_FLAGS)'
541
if test "$GCC" = "yes"; then
543
CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
545
if test "$GXX" = "yes"; then
547
CXX_VERSION=`$CXX -v 2>&1 | grep 'gcc version'`
549
if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
552
if test "`echo | $LD -v 2>&1 | grep -c GNU`" != "0"; then
555
if test "$GNU_CC"; then
556
if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
563
if test "$GCC" = yes; then
564
if test "`$CC -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
569
if test "$GXX" = yes; then
570
if test "`$CXX -help 2>&1 | grep -c 'Intel(R) C++ Compiler'`" != "0"; then
575
dnl Special win32 checks
576
dnl ========================================================
584
dnl Target the Windows 7 SDK by default
589
MOZ_ARG_WITH_STRING(windows-version,
590
[ --with-windows-version=WINSDK_TARGETVER
591
Highest Windows version to target using this SDK
592
502: Windows Server 2003
595
WINSDK_TARGETVER=$withval)
597
case "$WINSDK_TARGETVER" in
599
MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
603
AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER), must be 502, 600 or 601]);
608
if test -n "$COMPILE_ENVIRONMENT"; then
609
if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
610
# We can't build parental controls either
611
MOZ_DISABLE_PARENTAL_CONTROLS=1
616
*-mingw*|*-wince|*-winmo)
617
if test "$GCC" != "yes"; then
618
# Check to see if we are really running in a msvc environemnt
620
AC_CHECK_PROGS(MIDL, midl)
622
# Make sure compilers are valid
623
CFLAGS="$CFLAGS -TC -nologo"
624
CXXFLAGS="$CXXFLAGS -TP -nologo"
627
AC_TRY_COMPILE([#include <stdio.h>],
628
[ printf("Hello World\n"); ],,
629
AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
632
AC_TRY_COMPILE([#include <new.h>],
633
[ unsigned *test = new unsigned(42); ],,
634
AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
638
_MSVC_VER_FILTER='s|.* ([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
641
# Determine compiler version
642
CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
643
_CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
644
_CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
645
_CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
646
_CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
647
_MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
649
CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
650
_CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
652
if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
653
AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
656
if test "$_CC_MAJOR_VERSION" = "14"; then
657
dnl Require VC8SP1 or newer.
658
dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762.
659
if test "$_CC_RELEASE" -lt 50727 -o \
660
\( "$_CC_RELEASE" -eq 50727 -a "$_CC_BUILD" -lt 762 \); then
661
AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. You probably need to install Service Pack 1 of Visual Studio 2005. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
665
CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
666
AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
667
AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
668
elif test "$_CC_MAJOR_VERSION" = "15"; then
670
CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
671
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
672
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
673
elif test "$_CC_MAJOR_VERSION" = "16"; then
675
CXXFLAGS="$CXXFLAGS -Zc:wchar_t-"
676
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
677
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
679
AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
682
_MOZ_RTTI_FLAGS_ON='-GR'
683
_MOZ_RTTI_FLAGS_OFF='-GR-'
684
_MOZ_EXCEPTIONS_FLAGS_ON='-EHsc'
685
_MOZ_EXCEPTIONS_FLAGS_OFF=''
686
AC_DEFINE(HAVE_SEH_EXCEPTIONS)
688
if test -n "$WIN32_REDIST_DIR"; then
689
WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
692
dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
693
dnl not something else like "magnetic tape manipulation utility".
694
MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
695
if test -z "$MSMT_TOOL"; then
696
AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
700
_MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
702
MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
703
if test -z "$MSMANIFEST_TOOL_VERSION"; then
704
AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
710
# Check linker version
711
_LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
712
_LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
713
if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
714
AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
720
_MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
721
_MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
722
_MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
723
_MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
724
# Add flags if necessary
725
AC_MSG_CHECKING([for midl flags])
728
if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
729
# MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
730
# MIDL version 7.00.0500 or later has no problem.
731
MIDL_FLAGS="${MIDL_FLAGS} -env win32"
732
AC_MSG_RESULT([need -env win32])
734
AC_MSG_RESULT([none needed])
738
MIDL_FLAGS="${MIDL_FLAGS} -env x64"
741
AC_MSG_RESULT([none needed])
745
# Identify which version of the SDK we're building with
746
# Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
748
MOZ_CHECK_HEADERS([winsdkver.h])
749
if test "$ac_cv_header_winsdkver_h" = "yes"; then
750
# Get the highest _WIN32_WINNT and NTDDI versions supported
751
# Take the higher of the two
752
# This is done because the Windows 7 beta SDK reports its
753
# NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
754
AC_CACHE_CHECK(for highest Windows version supported by this SDK,
756
[cat > conftest.h <<EOF
757
#include <winsdkver.h>
758
#include <sdkddkver.h>
760
#if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
761
#define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
763
#define WINSDK_MAXVER NTDDI_MAXVER
768
ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
771
MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
773
# The Vista SDK is the only one to have sdkddkver.h but not
775
MOZ_CHECK_HEADERS([sdkddkver.h])
776
if test "$ac_cv_header_sdkddkver_h" = "yes"; then
777
MOZ_WINSDK_MAXVER=0x06000000
779
# Assume the Server 2003 Platform SDK
780
MOZ_WINSDK_MAXVER=0x05020000
784
unset _MSVC_VER_FILTER
786
AC_CACHE_CHECK(for std::_Throw, ac_cv_have_std__Throw,
790
_SAVE_CXXFLAGS="$CXXFLAGS"
791
CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
792
AC_TRY_COMPILE([#include <exception>],
793
[std::_Throw(std::exception()); return 0;],
794
ac_cv_have_std__Throw="yes",
795
ac_cv_have_std__Throw="no")
796
CXXFLAGS="$_SAVE_CXXFLAGS"
800
if test "$ac_cv_have_std__Throw" = "yes"; then
801
AC_CACHE_CHECK(for |class __declspec(dllimport) exception| bug,
802
ac_cv_have_dllimport_exception_bug,
806
_SAVE_CXXFLAGS="$CXXFLAGS"
807
CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
808
AC_TRY_LINK([#include <vector>],
809
[std::vector<int> v; return v.at(1);],
810
ac_cv_have_dllimport_exception_bug="no",
811
ac_cv_have_dllimport_exception_bug="yes")
812
CXXFLAGS="$_SAVE_CXXFLAGS"
815
if test "$ac_cv_have_dllimport_exception_bug" = "no"; then
817
MOZ_MSVC_STL_WRAP__Throw=1
818
AC_DEFINE(MOZ_MSVC_STL_WRAP__Throw)
821
AC_CACHE_CHECK(for overridable _RAISE,
826
_SAVE_CXXFLAGS="$CXXFLAGS"
827
CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
828
AC_TRY_COMPILE([#include <xstddef>
830
#define _RAISE(x) externallyDefinedFunction((x).what())
833
[std::vector<int> v; return v.at(1);],
834
ac_cv_have__RAISE="no",
835
ac_cv_have__RAISE="yes")
836
CXXFLAGS="$_SAVE_CXXFLAGS"
839
if test "$ac_cv_have__RAISE" = "yes"; then
841
MOZ_MSVC_STL_WRAP__RAISE=1
842
AC_DEFINE(MOZ_MSVC_STL_WRAP__RAISE)
844
AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.])
848
if test "$WRAP_STL_INCLUDES" = "1"; then
849
STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers'
852
# Check w32api version
853
_W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
854
_W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
855
AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
856
AC_TRY_COMPILE([#include <w32api.h>],
857
#if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
858
(__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
859
__W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
860
#error "test failed."
862
, [ res=yes ], [ res=no ])
863
AC_MSG_RESULT([$res])
864
if test "$res" != "yes"; then
865
AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
867
# Check windres version
868
AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
869
_WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
870
AC_MSG_RESULT([$_WINDRES_VERSION])
871
_WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
872
_WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
873
_WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
874
WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
875
WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
876
WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
877
if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
878
"$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
879
"$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
880
"$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
881
"$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
882
"$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
884
AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
887
# Server 2003 is the highest version supported
888
MOZ_WINSDK_MAXVER=0x05020000
891
AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
892
AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
893
# Require OS features provided by IE 5.0
894
AC_DEFINE_UNQUOTED(_WIN32_IE,0x0500)
896
# If the maximum version supported by this SDK is lower than the target
898
AC_MSG_CHECKING([for Windows SDK being recent enough])
899
if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
903
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. Alternatively, try running the Windows SDK Configuration Tool and selecting a newer SDK. See https://developer.mozilla.org/En/Windows_SDK_versions for more details on fixing this.])
906
AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
907
# Definitions matching sdkddkver.h
908
AC_DEFINE_UNQUOTED(MOZ_NTDDI_WS03, 0x05020000)
909
AC_DEFINE_UNQUOTED(MOZ_NTDDI_LONGHORN, 0x06000000)
910
AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
914
dnl Test breaks icc on OS/2 && MSVC
915
if test "$CC" != "icc" -a -z "$_WIN32_MSVC"; then
917
if grep "NO_MINUS_C_MINUS_O 1" ./confdefs.h >/dev/null; then
921
CC="${srcdir}/build/hcc '$CC'"
922
CXX="${srcdir}/build/hcpp '$CXX'"
929
if test -n "$_WIN32_MSVC"; then
931
SKIP_COMPILER_CHECKS=1
932
SKIP_LIBRARY_CHECKS=1
934
# Since we're skipping compiler and library checks, hard-code
941
AC_DEFINE(HAVE_SETBUF)
942
AC_DEFINE(HAVE_ISATTY)
947
fi # COMPILE_ENVIRONMENT
960
AC_SUBST(WRAP_STL_INCLUDES)
961
AC_SUBST(MOZ_MSVC_STL_WRAP__Throw)
962
AC_SUBST(MOZ_MSVC_STL_WRAP__RAISE)
964
dnl ========================================================
965
dnl Checks for programs.
966
dnl ========================================================
970
if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
971
AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
972
_perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
974
AC_MSG_RESULT([$_perl_version])
976
if test "$_perl_res" != 0; then
977
AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
981
AC_MSG_CHECKING([for full perl installation])
982
_perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
984
if test "$_perl_res" != 0; then
986
AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
991
MOZ_PATH_PROGS(PYTHON, $PYTHON python2.7 python2.6 python2.5 python)
992
if test -z "$PYTHON"; then
993
AC_MSG_ERROR([python was not found in \$PATH])
996
if test -z "$COMPILE_ENVIRONMENT"; then
997
NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
999
AC_SUBST(NSINSTALL_BIN)
1001
MOZ_PATH_PROG(DOXYGEN, doxygen, :)
1002
MOZ_PATH_PROG(AUTOCONF, autoconf, :)
1003
MOZ_PATH_PROG(UNZIP, unzip, :)
1004
MOZ_PATH_PROGS(ZIP, zip)
1005
if test -z "$ZIP" -o "$ZIP" = ":"; then
1006
AC_MSG_ERROR([zip not found in \$PATH])
1008
MOZ_PATH_PROG(SYSTEM_MAKEDEPEND, makedepend)
1009
MOZ_PATH_PROG(XARGS, xargs)
1010
if test -z "$XARGS" -o "$XARGS" = ":"; then
1011
AC_MSG_ERROR([xargs not found in \$PATH .])
1014
MOZ_PATH_PROG(RPMBUILD, rpmbuild, :)
1017
if test "$COMPILE_ENVIRONMENT"; then
1019
dnl ========================================================
1020
dnl = Mac OS X toolchain support
1021
dnl ========================================================
1023
case "$target_os" in
1025
dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
1026
dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
1027
dnl the environment and includedir purposes (when using an SDK, below),
1028
dnl but remember the full version number for the libdir (SDK).
1030
GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1031
GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1033
if test "$GCC_VERSION_FULL" = "4.0.0" ; then
1034
dnl Bug 280479, but this keeps popping up in bug 292530 too because
1035
dnl 4.0.0/4061 is the default compiler in Tiger.
1037
GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
1039
if test "$GCC_BUILD" = "4061" ; then
1040
AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
1041
This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
1042
from building Mozilla. Upgrade to Xcode 2.1 or later.])
1046
dnl xcodebuild needs GCC_VERSION defined in the environment, since it
1047
dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
1048
dnl /usr/bin/g(cc|++)-$GCC_VERSION.
1049
MOZ_PATH_PROGS(PBBUILD, pbbuild xcodebuild pbxbuild)
1054
XCODEBUILD_VERSION=`$PBBUILD -version 2>/dev/null | xargs | sed -e 's/.*DevToolsCore-\([0-9]*\).*/\1/'`
1056
if test -n "$XCODEBUILD_VERSION" && test "$XCODEBUILD_VERSION" -ge 620 ; then
1062
dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
1063
dnl it has moved into /usr/bin.
1064
MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
1068
AC_SUBST(GCC_VERSION)
1069
AC_SUBST(XCODEBUILD_VERSION)
1070
AC_SUBST(HAS_XCODE_2_1)
1072
dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
1073
dnl that a universal binary is being produced.
1074
AC_SUBST(UNIVERSAL_BINARY)
1076
dnl ========================================================
1077
dnl Check for MacOS deployment target version
1078
dnl ========================================================
1080
MOZ_ARG_ENABLE_STRING(macos-target,
1081
[ --enable-macos-target=VER (default=10.5)
1082
Set the minimum MacOS version needed at runtime],
1083
[_MACOSX_DEPLOYMENT_TARGET=$enableval])
1087
if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1088
dnl Use the specified value
1089
export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1090
AC_DEFINE_UNQUOTED(__ENVIRONMENT_MAC_OS_X_VERION_MIN_REQUIRED__,$_MACOSX_DEPLOYMENT_TARGET)
1092
dnl No value specified on the command line or in the environment,
1093
dnl use architecture minimum.
1094
case "${target_cpu}" in
1096
export MACOSX_DEPLOYMENT_TARGET=10.5
1099
export MACOSX_DEPLOYMENT_TARGET=10.5
1102
export MACOSX_DEPLOYMENT_TARGET=10.6
1109
AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
1111
dnl ========================================================
1112
dnl = Mac OS X SDK support
1113
dnl ========================================================
1116
MOZ_ARG_WITH_STRING(macos-sdk,
1117
[ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
1118
MACOS_SDK_DIR=$withval)
1120
dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
1121
dnl NEXT_ROOT will be set and exported only if it's needed.
1122
AC_SUBST(MACOS_SDK_DIR)
1125
if test "$MACOS_SDK_DIR"; then
1126
dnl Sync this section with the ones in NSPR and NSS.
1127
dnl Changes to the cross environment here need to be accounted for in
1128
dnl the libIDL checks (below) and xpidl build.
1130
if test ! -d "$MACOS_SDK_DIR"; then
1131
AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1132
specify a valid SDK. SDKs are installed when the optional cross-development
1133
tools are selected during the Xcode/Developer Tools installation.])
1136
GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1137
if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1138
AC_MSG_ERROR([You need to upgrade the compiler version to 4.x])
1140
CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1141
CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
1143
dnl CPP/CXXCPP needs to be set for MOZ_CHECK_HEADER.
1144
CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1145
CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
1147
if test "$GCC_VERSION_FULL" = "4.0.0" ; then
1148
dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
1149
dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
1150
dnl be ignored and cause warnings when -syslibroot is specified.
1151
dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
1152
dnl the -isysroot it receives, so this is only needed with 4.0.0.
1153
LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1158
AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
1160
AC_TRY_COMPILE([#include <new>],[],
1164
AC_MSG_RESULT($result)
1166
if test "$result" = "no" ; then
1167
AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
1171
fi # COMPILE_ENVIRONMENT
1173
dnl clang prior to 2.9 (including Xcode 4) does not support all the
1174
dnl constructs required by the libtheora inline asm. This is used to
1175
dnl detect and disable it
1179
#if defined(__clang__)
1180
# if __clang_major__<2 || (__clang_major__==2 && __clang_minor__<9)
1181
# error "clang older than 2.9 detected"
1188
if test "$result" = "no"; then
1189
AC_DEFINE(HAVE_OLD_CLANG)
1193
AC_SUBST(HAVE_OLD_CLANG)
1195
if test -n "$MAKE"; then
1196
if test `echo $MAKE | grep -c make.py` != 1; then
1203
MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
1206
MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
1209
if test "$GMAKE" = ":"; then
1210
AC_MSG_ERROR([GNU make not found])
1214
if test "$COMPILE_ENVIRONMENT"; then
1220
fi # COMPILE_ENVIRONMENT
1222
dnl ========================================================
1223
dnl set the defaults first
1224
dnl ========================================================
1227
AR_EXTRACT='$(AR) x'
1241
MOZ_USER_DIR=".mozilla"
1244
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/jpeg)'
1246
MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,$(DEPTH)/modules/zlib/src)'
1248
MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1250
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/modules/libimg/png)'
1252
MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
1253
MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
1254
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core -lmozalloc'
1255
MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1256
XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom -lmozalloc'
1257
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1258
XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1259
XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1263
MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1265
USE_DEPENDENT_LIBS=1
1267
_PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1269
if test -n "$CROSS_COMPILE"; then
1270
OS_TARGET="${target_os}"
1271
OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1273
case "${target_os}" in
1274
linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1275
kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1276
gnu*) OS_ARCH=GNU ;;
1277
solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1278
mingw*) OS_ARCH=WINNT ;;
1279
wince*) OS_ARCH=WINCE ;;
1280
winmo*) OS_ARCH=WINCE ;;
1281
darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1284
arm-android-eabi) OS_ARCH=Linux OS_TARGET=Android ;;
1287
OS_TARGET=`uname -s`
1288
OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1289
OS_RELEASE=`uname -r`
1292
# Before this used `uname -m` when not cross compiling
1293
# but that breaks when you have a 64 bit kernel with a 32 bit userland.
1294
OS_TEST="${target_cpu}"
1298
HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1300
#######################################################################
1301
# Master "Core Components" macros for getting the OS target #
1302
#######################################################################
1305
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1306
# cross-compilation.
1310
# Define and override various archtecture-specific variables, including
1319
case "$HOST_OS_ARCH" in
1333
if test -z "$GNU_CC"; then
1334
if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1339
if test -z "$GNU_CXX"; then
1340
if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1341
SOLARIS_SUNPRO_CXX=1
1344
AC_SUBST(SOLARIS_SUNPRO_CC)
1345
AC_SUBST(SOLARIS_SUNPRO_CXX)
1357
if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1360
HOST_OS_ARCH=UNIXWARE
1379
SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1383
HOST_OS_ARCH=UNIXWARE
1389
if test -z "$CROSS_COMPILE" ; then
1395
# If uname -s returns "Windows_NT", we assume that we are using
1396
# the uname.exe in MKS toolkit.
1398
# The -r option of MKS uname only returns the major version number.
1399
# So we need to use its -v option to get the minor version number.
1400
# Moreover, it doesn't have the -p option, so we need to use uname -m.
1404
OS_MINOR_RELEASE=`uname -v`
1405
if test "$OS_MINOR_RELEASE" = "00"; then
1408
OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1412
# If uname -s returns MINGW32_NT-5.1, we assume that we are using
1413
# the uname.exe in the MSYS tools.
1415
OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1420
OS_RELEASE=`uname -v`.`uname -r`
1421
OS_TEST=${target_cpu}
1433
if "`cat /etc/bcheckrc | grep -c NCR 2>/dev/null`" != "0"; then
1437
OS_RELEASE=`uname -v`
1462
OS_RELEASE=`uname -v`
1465
if test "$OS_TARGET" != "NTO"; then
1467
OS_RELEASE=`uname -v | sed 's/^\([0-9]\)\([0-9]*\)$/\1.\2/'`
1476
SINIX-N | SINIX-Y | SINIX-Z |ReliantUNIX-M)
1482
OS_RELEASE=`uname -v`
1486
case "${target_os}" in
1489
WINCE_WINDOWS_MOBILE=1
1490
AC_DEFINE(WINCE_WINDOWS_MOBILE)
1498
case "${target_cpu}" in
1509
if test -z "$CROSS_COMPILE" ; then
1517
if test "$OS_ARCH" = "NCR"; then
1519
OS_RELEASE=`awk '{print $3}' /etc/.relid | sed 's/^\([0-9]\)\(.\)\(..\)\(.*\)$/\2.\3/'`
1523
# Only set CPU_ARCH if we recognize the value of OS_TEST
1534
powerpc | ppc | rs6000)
1538
Alpha | alpha | ALPHA)
1571
if test -z "$OS_TARGET"; then
1574
OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1576
dnl Set INTEL_ARCHITECTURE if we're compiling for x86-32 or x86-64.
1577
dnl ===============================================================
1581
INTEL_ARCHITECTURE=1
1584
dnl ========================================================
1585
dnl GNU specific defaults
1586
dnl ========================================================
1587
if test "$GNU_CC"; then
1588
# FIXME: Let us build with strict aliasing. bug 414641.
1589
CFLAGS="$CFLAGS -fno-strict-aliasing"
1590
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1591
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1592
DSO_LDOPTS='-shared'
1593
if test "$GCC_USE_GNU_LD"; then
1594
# Don't allow undefined symbols in libraries
1595
DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1597
WARNINGS_AS_ERRORS='-Werror'
1599
DSO_PIC_CFLAGS='-fPIC'
1600
ASFLAGS="$ASFLAGS -fPIC"
1601
_MOZ_RTTI_FLAGS_ON=${_COMPILER_PREFIX}-frtti
1602
_MOZ_RTTI_FLAGS_OFF=${_COMPILER_PREFIX}-fno-rtti
1603
_MOZ_EXCEPTIONS_FLAGS_ON='-fexceptions'
1604
_MOZ_EXCEPTIONS_FLAGS_OFF='-fno-exceptions'
1606
# Turn on GNU specific features
1607
# -Wall - turn on all warnings
1608
# -pedantic - make compiler warn about non-ANSI stuff, and
1609
# be a little bit stricter
1610
# Warnings slamm took out for now (these were giving more noise than help):
1611
# -Wbad-function-cast - warns when casting a function to a new return type
1612
# -Wshadow - removed because it generates more noise than help --pete
1613
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -W -Wno-unused -Wpointer-arith"
1614
if test -z "$INTEL_CC"; then
1615
# Don't use -Wcast-align with ICC
1617
# And don't use it on hppa, ia64, sparc, arm, since it's noisy there
1618
hppa | ia64 | sparc | arm)
1621
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1626
dnl Turn pedantic on but disable the warnings for long long
1629
if test -z "$INTEL_CC"; then
1630
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -W"
1633
_DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1634
_USE_CPP_INCLUDE_FLAG=1
1635
elif test "$SOLARIS_SUNPRO_CC"; then
1637
if test "$CPU_ARCH" = "sparc"; then
1638
# for Sun Studio on Solaris/SPARC
1639
DSO_PIC_CFLAGS='-xcode=pic32'
1641
DSO_PIC_CFLAGS='-KPIC'
1643
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1645
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1646
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1648
DSO_LDOPTS='-shared'
1649
if test "$GNU_LD"; then
1650
# Don't allow undefined symbols in libraries
1651
DSO_LDOPTS="$DSO_LDOPTS -z defs"
1655
DSO_PIC_CFLAGS='-KPIC'
1656
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1659
if test "$GNU_CXX"; then
1660
# FIXME: Let us build with strict aliasing. bug 414641.
1661
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
1662
# Turn on GNU specific features
1663
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor"
1664
if test -z "$INTEL_CC"; then
1665
# Don't use -Wcast-align with ICC
1667
# And don't use it on hppa, ia64, sparc, arm, since it's noisy there
1668
hppa | ia64 | sparc | arm)
1671
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1676
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1677
_USE_CPP_INCLUDE_FLAG=1
1679
AC_CACHE_CHECK(whether the compiler supports -Wno-invalid-offsetof,
1680
ac_has_wno_invalid_offsetof,
1684
_SAVE_CXXFLAGS="$CXXFLAGS"
1685
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1688
ac_has_wno_invalid_offsetof="yes",
1689
ac_has_wno_invalid_offsetof="no")
1690
CXXFLAGS="$_SAVE_CXXFLAGS"
1693
if test "$ac_has_wno_invalid_offsetof" = "yes"; then
1694
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-invalid-offsetof"
1697
AC_CACHE_CHECK(whether the compiler supports -Wno-variadic-macros,
1698
ac_has_wno_variadic_macros,
1702
_SAVE_CXXFLAGS="$CXXFLAGS"
1703
CXXFLAGS="$CXXFLAGS ${_COMPILER_PREFIX}-Wno-variadic-macros"
1706
ac_has_wno_variadic_macros="yes",
1707
ac_has_wno_variadic_macros="no")
1708
CXXFLAGS="$_SAVE_CXXFLAGS"
1711
if test "$ac_has_wno_variadic_macros" = "yes"; then
1712
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-Wno-variadic-macros"
1715
AC_CACHE_CHECK(whether the compiler supports -Werror=return-type,
1716
ac_has_werror_return_type,
1720
_SAVE_CXXFLAGS="$CXXFLAGS"
1721
CXXFLAGS="$CXXFLAGS -Werror=return-type"
1724
ac_has_werror_return_type="yes",
1725
ac_has_werror_return_type="no")
1726
CXXFLAGS="$_SAVE_CXXFLAGS"
1729
if test "$ac_has_werror_return_type" = "yes"; then
1730
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Werror=return-type"
1734
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1737
dnl gcc can come with its own linker so it is better to use the pass-thru calls
1738
dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1739
dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1740
dnl normal behavior.
1741
dnl ========================================================
1743
MKSHLIB_UNFORCE_ALL=
1745
if test "$COMPILE_ENVIRONMENT"; then
1746
if test "$GNU_CC"; then
1747
AC_MSG_CHECKING(whether ld has archive extraction flags)
1748
AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1749
[_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1750
ac_cv_mkshlib_force_and_unforce="no"
1751
exec 3<&0 <<LOOP_INPUT
1752
force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1753
force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1754
force="-Wl,-all"; unforce="-Wl,-none"
1761
AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1764
LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1766
if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1770
eval $ac_cv_mkshlib_force_and_unforce
1771
MKSHLIB_FORCE_ALL=$force
1772
MKSHLIB_UNFORCE_ALL=$unforce
1775
fi # COMPILE_ENVIRONMENT
1777
dnl =================================================================
1778
dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1779
dnl which is bad when cross compiling.
1780
dnl =================================================================
1781
if test "$COMPILE_ENVIRONMENT"; then
1782
configure_static_assert_macros='
1783
#define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1784
#define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1785
#define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1788
dnl test that the macros actually work:
1789
AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1790
AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1793
ac_cv_static_assertion_macros_work="yes"
1794
AC_TRY_COMPILE([$configure_static_assert_macros],
1795
[CONFIGURE_STATIC_ASSERT(1)],
1797
ac_cv_static_assertion_macros_work="no")
1798
AC_TRY_COMPILE([$configure_static_assert_macros],
1799
[CONFIGURE_STATIC_ASSERT(0)],
1800
ac_cv_static_assertion_macros_work="no",
1803
AC_TRY_COMPILE([$configure_static_assert_macros],
1804
[CONFIGURE_STATIC_ASSERT(1)],
1806
ac_cv_static_assertion_macros_work="no")
1807
AC_TRY_COMPILE([$configure_static_assert_macros],
1808
[CONFIGURE_STATIC_ASSERT(0)],
1809
ac_cv_static_assertion_macros_work="no",
1813
AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1814
if test "$ac_cv_static_assertion_macros_work" = "no"; then
1815
AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1817
fi # COMPILE_ENVIRONMENT
1819
dnl ========================================================
1820
dnl Checking for 64-bit OS
1821
dnl ========================================================
1822
if test "$COMPILE_ENVIRONMENT"; then
1825
AC_MSG_CHECKING(for 64-bit OS)
1826
AC_TRY_COMPILE([$configure_static_assert_macros],
1827
[CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)],
1828
result="yes", result="no")
1829
AC_MSG_RESULT("$result")
1830
if test "$result" = "yes"; then
1831
AC_DEFINE(HAVE_64BIT_OS)
1834
AC_SUBST(HAVE_64BIT_OS)
1836
fi # COMPILE_ENVIRONMENT
1838
dnl ========================================================
1839
dnl Enable high-memory support on OS/2 by default.
1840
dnl ========================================================
1841
MOZ_OS2_HIGH_MEMORY=1
1842
MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1843
[ --disable-os2-high-mem Disable high-memory support on OS/2],
1844
MOZ_OS2_HIGH_MEMORY=,
1845
MOZ_OS2_HIGH_MEMORY=1 )
1846
AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1848
dnl ========================================================
1849
dnl = Use profiling compile flags
1850
dnl ========================================================
1851
MOZ_ARG_ENABLE_BOOL(profiling,
1852
[ --enable-profiling Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
1856
dnl ========================================================
1858
dnl ========================================================
1859
MOZ_ARG_ENABLE_BOOL(valgrind,
1860
[ --enable-valgrind Enable Valgrind integration hooks (default=no)],
1863
if test -n "$MOZ_VALGRIND"; then
1864
MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
1866
[--enable-valgrind specified but Valgrind is not installed]))
1867
AC_DEFINE(MOZ_VALGRIND)
1870
dnl ========================================================
1872
dnl ========================================================
1873
MOZ_ARG_ENABLE_BOOL(jprof,
1874
[ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.],
1877
if test -n "$MOZ_JPROF"; then
1879
AC_DEFINE(MOZ_JPROF)
1882
dnl ========================================================
1884
dnl ========================================================
1885
MOZ_ARG_ENABLE_BOOL(shark,
1886
[ --enable-shark Enable shark remote profiling. Implies --enable-profiling.],
1889
if test -n "$MOZ_SHARK"; then
1891
AC_DEFINE(MOZ_SHARK)
1894
dnl ========================================================
1896
dnl ========================================================
1897
MOZ_ARG_ENABLE_BOOL(callgrind,
1898
[ --enable-callgrind Enable callgrind profiling],
1901
if test -n "$MOZ_CALLGRIND"; then
1902
AC_DEFINE(MOZ_CALLGRIND)
1905
dnl ========================================================
1907
dnl ========================================================
1908
MOZ_ARG_ENABLE_BOOL(vtune,
1909
[ --enable-vtune Enable vtune profiling. Implies --enable-profiling.],
1912
if test -n "$MOZ_VTUNE"; then
1914
AC_DEFINE(MOZ_VTUNE)
1917
dnl ========================================================
1919
dnl ========================================================
1920
if test -n "$MOZ_PROFILING"; then
1921
AC_DEFINE(MOZ_PROFILING)
1924
dnl ========================================================
1925
dnl System overrides of the defaults for host
1926
dnl ========================================================
1928
*mingw*|*wince|*winmo)
1929
if test -n "$_WIN32_MSVC"; then
1931
HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1932
HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1933
HOST_RANLIB='echo ranlib'
1935
HOST_CFLAGS="$HOST_CFLAGS -mno-cygwin"
1937
HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
1938
HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1939
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1940
HOST_BIN_SUFFIX=.exe
1943
PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper"
1947
case "${host_cpu}" in
1949
HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
1955
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1956
HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1957
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1960
*-linux*|*-kfreebsd*-gnu|*-gnu*)
1961
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1962
HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1963
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1967
HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1968
HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1969
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1970
HOST_BIN_SUFFIX=.exe
1975
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1976
HOST_NSPR_MDCPUCFG='\"md/_osf1.cfg\"'
1977
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1981
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1982
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1986
dnl We require version 2.5 or newer of Python to build.
1987
AC_MSG_CHECKING([for Python version >= $PYTHON_VERSION but not 3.x])
1989
$PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1] or sys.version[:2] != '2.')" $PYTHON_VERSION
1992
if test "$_python_res" != 0; then
1993
AC_MSG_ERROR([Python $PYTHON_VERSION or higher (but not Python 3.x) is required.])
1995
AC_MSG_RESULT([yes])
1997
dnl Get mozilla version from central milestone file
1998
MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
2000
dnl Get version of various core apps from the version files.
2001
FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
2003
if test -z "$FIREFOX_VERSION"; then
2004
AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.])
2007
AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
2008
AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
2010
MOZ_DOING_LTO(lto_is_enabled)
2012
dnl ========================================================
2013
dnl System overrides of the defaults for target
2014
dnl ========================================================
2019
if test ! "$GNU_CC"; then
2020
if test ! "$HAVE_64BIT_OS"; then
2021
# Compiling with Visual Age C++ object model compat is the
2022
# default. To compile with object model ibm, add
2023
# AIX_OBJMODEL=ibm to .mozconfig.
2024
if test "$AIX_OBJMODEL" = "ibm"; then
2025
CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
2032
AC_SUBST(AIX_OBJMODEL)
2033
DSO_LDOPTS='-qmkshrobj=1'
2034
DSO_CFLAGS='-qflag=w:w'
2036
LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
2038
MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2039
MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2040
if test "$COMPILE_ENVIRONMENT"; then
2043
AC_MSG_CHECKING([for IBM XLC/C++ compiler version >= 9.0.0.7])
2045
[#if (__IBMCPP__ < 900)
2046
#error "Bad compiler"
2048
_BAD_COMPILER=,_BAD_COMPILER=1)
2049
if test -n "$_BAD_COMPILER"; then
2051
AC_MSG_ERROR([IBM XLC/C++ 9.0.0.7 or higher is required to build.])
2053
AC_MSG_RESULT([yes])
2056
TARGET_COMPILER_ABI="ibmc"
2057
CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
2058
CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
2061
case "${target_os}" in
2066
if test "$COMPILE_ENVIRONMENT"; then
2067
MOZ_CHECK_HEADERS(sys/inttypes.h)
2069
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2073
dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
2082
_WARNINGS_CFLAGS="-Wall"
2083
_WARNINGS_CXXFLAGS="-Wall"
2084
# The test above doesn't work properly, at least on 3.1.
2085
MKSHLIB_FORCE_ALL=''
2086
MKSHLIB_UNFORCE_ALL=''
2092
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2093
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2094
# If we're building with --enable-profiling, we need a frame pointer.
2095
if test -z "$MOZ_PROFILING"; then
2096
MOZ_OPTIMIZE_FLAGS="-O3 -fomit-frame-pointer"
2098
MOZ_OPTIMIZE_FLAGS="-O3 -fno-omit-frame-pointer"
2101
CFLAGS="$CFLAGS -fpascal-strings -fno-common"
2102
CXXFLAGS="$CXXFLAGS -fpascal-strings -fno-common"
2105
STRIP="$STRIP -x -S"
2106
_PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
2107
TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
2108
# The ExceptionHandling framework is needed for Objective-C exception
2109
# logging code in nsObjCExceptions.h. Currently we only use that in debug
2111
MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling"
2113
if test "x$lto_is_enabled" = "xyes"; then
2114
echo "Skipping -dead_strip because lto is enabled."
2115
dnl DTrace and -dead_strip don't interact well. See bug 403132.
2116
dnl ===================================================================
2117
elif test "x$enable_dtrace" = "xyes"; then
2118
echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
2120
dnl check for the presence of the -dead_strip linker flag
2121
AC_MSG_CHECKING([for -dead_strip option to ld])
2122
_SAVE_LDFLAGS=$LDFLAGS
2123
LDFLAGS="$LDFLAGS -Wl,-dead_strip"
2124
AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
2125
if test -n "$_HAVE_DEAD_STRIP" ; then
2126
AC_MSG_RESULT([yes])
2127
MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
2132
LDFLAGS=$_SAVE_LDFLAGS
2134
MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
2138
if test `test -x /usr/bin/objformat && /usr/bin/objformat || echo elf` != "elf"; then
2139
DLL_SUFFIX=".so.1.0"
2140
DSO_LDOPTS="-shared"
2142
if test ! "$GNU_CC"; then
2143
DSO_LDOPTS="-Bshareable $DSO_LDOPTS"
2149
if test ! "$GNU_CC"; then
2153
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
2154
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@'
2155
CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
2158
MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2159
MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2163
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2164
AC_DEFINE(_LARGEFILE64_SOURCE)
2169
if test ! "$GNU_CC"; then
2170
DSO_LDOPTS='-b -Wl,+s'
2173
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
2174
MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
2175
CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
2177
DSO_LDOPTS='-b -E +s'
2178
MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
2179
MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
2181
MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
2182
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2187
DSO_LDOPTS='-elf -shared'
2189
if test "$GNU_CC"; then
2190
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2191
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2192
MKSHLIB_FORCE_ALL='-Wl,-all'
2193
MKSHLIB_UNFORCE_ALL='-Wl,-none'
2194
CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
2196
MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2197
MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2198
MKSHLIB_FORCE_ALL='-all'
2199
MKSHLIB_UNFORCE_ALL='-none'
2205
dnl the irix specific xptcinvoke code is written against the n32 ABI so we *must*
2206
dnl compile and link using -n32
2208
TARGET_COMPILER_ABI=n32
2209
DSO_LDOPTS='-elf -shared'
2210
MKSHLIB='$(CCC) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2211
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2212
_MOZ_EXCEPTIONS_FLAGS_OFF="-LANG:exceptions=OFF"
2213
_MOZ_EXCEPTIONS_FLAGS_ON="-LANG:exceptions=ON"
2214
if test "$GNU_CC"; then
2215
MKSHLIB_FORCE_ALL='-Wl,-all'
2216
MKSHLIB_UNFORCE_ALL='-Wl,-none'
2217
_WARNINGS_CFLAGS="-Wall"
2218
_WARNINGS_CXXFLAGS="-Wall"
2219
CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS"
2221
MKSHLIB_FORCE_ALL='-all'
2222
MKSHLIB_UNFORCE_ALL='-none'
2228
CFLAGS="$CFLAGS -woff 3262 -G 4"
2229
CXXFLAGS="$CXXFLAGS -woff 3262 -G 4"
2230
if test -n "$USE_N32"; then
2231
ASFLAGS="$ASFLAGS -n32"
2232
CFLAGS="$CFLAGS -n32"
2233
CXXFLAGS="$CXXFLAGS -n32"
2234
LDFLAGS="$LDFLAGS -n32"
2236
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2237
AC_MSG_WARN([Clearing MOZ_FIX_LINK_PATHS for OSF/1 as fix for bug 333545 (till the reference bug 332075 is fixed.])
2240
if test -z "$GNU_CXX"; then
2246
# Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
2247
# Similarly for GNU_CXX and INTEL_CXX.
2248
if test "$INTEL_CC" -o "$INTEL_CXX"; then
2249
# -Os has been broken on Intel's C/C++ compilers for quite a
2250
# while; Intel recommends against using it.
2251
MOZ_OPTIMIZE_FLAGS="-O2"
2252
MOZ_DEBUG_FLAGS="-g"
2253
elif test "$GNU_CC" -o "$GNU_CXX"; then
2254
GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2255
case $GCC_VERSION in
2257
# -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results.
2258
MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
2260
# If we're building with --enable-profiling, we need a frame pointer.
2261
if test -z "$MOZ_PROFILING"; then
2262
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fomit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"
2264
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-omit-frame-pointer $MOZ_OPTIMIZE_SIZE_TWEAK"
2266
MOZ_DEBUG_FLAGS="-g"
2269
TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2273
case "${target_cpu}" in
2275
CFLAGS="$CFLAGS -mieee"
2276
CXXFLAGS="$CXXFLAGS -mieee"
2282
MOZ_DEBUG_FLAGS="-g" # We want inlining
2288
TARGET_COMPILER_ABI=msvc
2289
_PLATFORM_DEFAULT_TOOLKIT=cairo-windows
2290
MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2291
MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2295
AR_FLAGS='-OUT:"$@"'
2299
ac_configure_args="$ac_configure_args --enable-win32-target=WINCE"
2301
if test "$AS_BIN"; then
2308
if test -z "$RC"; then
2311
# certain versions of cygwin's makedepend barf on the
2312
# #include <string> vs -I./dist/include/string issue so don't use it
2319
HOST_AR_FLAGS='-OUT:$@'
2320
HOST_RANLIB='echo ranlib'
2321
HOST_CFLAGS="$HOST_CFLAGS -D_X86_"
2324
WARNINGS_AS_ERRORS='-WX'
2325
MOZ_OPTIMIZE_FLAGS='-Ox'
2326
AR_FLAGS='-NOLOGO -OUT:"$@"'
2328
CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2329
CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2332
DSO_LDOPTS=-SUBSYSTEM:WINDOWSCE
2333
DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2335
IMPORT_LIB_SUFFIX=lib
2336
dnl Need to force-link against mozalloc because it's used in the shunt
2337
LIBS="$LIBS \$(LIBXUL_DIST)/lib/mozalloc.lib"
2338
LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2341
MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2342
MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ $(DSO_LDOPTS)'
2344
MKSHLIB_UNFORCE_ALL=
2345
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2346
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2347
MOZ_DEBUG_FLAGS='-Zi'
2348
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2351
RANLIB='echo not_ranlib'
2352
STRIP='echo not_strip'
2353
TARGET_NSPR_MDCPUCFG='\"md/_wince.cfg\"'
2356
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2360
AC_DEFINE(HAVE_SNPRINTF)
2365
AC_DEFINE(HW_THREADS)
2366
AC_DEFINE(STDC_HEADERS)
2367
AC_DEFINE(NEW_H, <new>)
2368
AC_DEFINE(WIN32_LEAN_AND_MEAN)
2369
AC_DEFINE(HAVE_LOCALTIME_R)
2371
TARGET_MD_ARCH=win32
2372
_PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2374
MOZ_USER_DIR="Mozilla"
2376
MOZ_GFX_OPTIMIZE_MOBILE=1
2378
# Sanity check for WINCE_WINDOWS_MOBILE
2379
# XXX disabled until we can fix the mobile tinderbox
2380
##if test "$WINCE_WINDOWS_MOBILE"; then
2381
## MOZ_CHECK_HEADER(tpcshell.h, [],
2382
## AC_MSG_ERROR([Can't find tpcshell.h in your SDK; are you sure you don't need --disable-windows-mobile-components?]))
2391
# certain versions of cygwin's makedepend barf on the
2392
# #include <string> vs -I./dist/include/string issue so don't use it
2394
if test -n "$GNU_CC"; then
2395
CC="$CC -mno-cygwin"
2396
CXX="$CXX -mno-cygwin"
2397
CPP="$CPP -mno-cygwin"
2398
CFLAGS="$CFLAGS -mms-bitfields"
2399
CXXFLAGS="$CXXFLAGS -mms-bitfields"
2400
DSO_LDOPTS='-shared'
2401
MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2402
MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2404
# Use temp file for windres (bug 213281)
2405
RCFLAGS='-O coff --use-temp-file'
2406
# mingw doesn't require kernel32, user32, and advapi32 explicitly
2407
LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32"
2409
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core -lmozalloc'
2410
XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc'
2412
IMPORT_LIB_SUFFIX=dll.a
2413
GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2415
TARGET_COMPILER_ABI=msvc
2419
if test "$AS_BIN"; then
2420
AS="$(basename "$AS_BIN")"
2423
AR_FLAGS='-NOLOGO -OUT:"$@"'
2425
RANLIB='echo not_ranlib'
2426
STRIP='echo not_strip'
2432
GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
2438
IMPORT_LIB_SUFFIX=lib
2439
MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2440
MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2442
MKSHLIB_UNFORCE_ALL=
2443
DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2444
_USE_CPP_INCLUDE_FLAG=1
2445
_DEFINES_CFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
2446
_DEFINES_CXXFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
2447
CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2448
CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2449
CXXFLAGS="$CXXFLAGS -wd4800" # disable warning "forcing value to bool"
2450
LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2451
MOZ_DEBUG_FLAGS='-Zi'
2452
MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2453
WARNINGS_AS_ERRORS='-WX'
2454
# If we're building with --enable-profiling, we need -Oy-, which forces a frame pointer.
2455
if test -z "$MOZ_PROFILING"; then
2456
MOZ_OPTIMIZE_FLAGS='-O1'
2458
MOZ_OPTIMIZE_FLAGS='-O1 -Oy-'
2461
DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2462
XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2463
LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2464
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2465
if test $_MSC_VER -ge 1400; then
2466
LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
2467
dnl For profile-guided optimization
2468
PROFILE_GEN_CFLAGS="-GL"
2469
PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2470
dnl XXX: PGO builds can fail with warnings treated as errors,
2471
dnl specifically "no profile data available" appears to be
2472
dnl treated as an error sometimes. This might be a consequence
2473
dnl of using WARNINGS_AS_ERRORS in some modules, combined
2474
dnl with the linker doing most of the work in the whole-program
2475
dnl optimization/PGO case. I think it's probably a compiler bug,
2476
dnl but we work around it here.
2477
PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2478
dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2479
dnl Probably also a compiler bug, but what can you do?
2480
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2481
LDFLAGS="$LDFLAGS -DYNAMICBASE"
2484
MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,jpeg32$(VERSION_NUMBER),$(DEPTH)/jpeg)'
2485
MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,png,$(DEPTH)/modules/libimg/png)'
2486
AC_DEFINE(HAVE_SNPRINTF)
2491
AC_DEFINE(HW_THREADS)
2492
AC_DEFINE(STDC_HEADERS)
2493
AC_DEFINE(NEW_H, <new>)
2494
AC_DEFINE(WIN32_LEAN_AND_MEAN)
2495
TARGET_MD_ARCH=win32
2496
_PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2498
MOZ_USER_DIR="Mozilla"
2500
dnl Hardcode to win95 for now - cls
2501
TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2503
dnl set NO_X11 defines here as the general check is skipped on win32
2509
MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2515
if test -z "$MOZ_TOOLS"; then
2516
AC_MSG_ERROR([MOZ_TOOLS is not set])
2518
MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2519
if test "$?" != "0" -o -z "$MOZ_TOOLS_DIR"; then
2520
AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2522
MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2523
if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2524
AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2531
AC_MSG_ERROR([Using a Cygwin build environment is unsupported. Configure cannot check for presence of necessary headers. Please upgrade to MozillaBuild; see https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
2534
AC_CHECK_HEADERS(oleacc.idl)
2537
MOZ_CHECK_HEADERS(atlbase.h)
2544
if test "$HAVE_64BIT_OS"; then
2545
AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.])
2548
if test $_MSC_VER -ge 1400; then
2549
LDFLAGS="$LDFLAGS -SAFESEH"
2552
if test -n "$GNU_CC"; then
2553
CFLAGS="$CFLAGS -mstackrealign"
2554
CXXFLAGS="$CXXFLAGS -mstackrealign"
2557
MOZ_CHECK_HEADERS(mmintrin.h)
2564
AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2568
if test "$HAVE_64BIT_OS"; then
2575
CFLAGS="$CFLAGS -Dunix"
2576
CXXFLAGS="$CXXFLAGS -Dunix"
2577
if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2579
DSO_PIC_CFLAGS='-fPIC -DPIC'
2580
DSO_LDOPTS='-shared'
2581
BIN_FLAGS='-Wl,--export-dynamic'
2583
DSO_PIC_CFLAGS='-fPIC -DPIC'
2584
DLL_SUFFIX=".so.1.0"
2585
DSO_LDOPTS='-shared'
2587
# This will fail on a.out systems prior to 1.5.1_ALPHA.
2588
MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2589
MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2590
if test "$LIBRUNPATH"; then
2591
DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2593
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2594
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2599
AC_DEFINE(_QNX_SOURCE)
2602
WARNINGS_AS_ERRORS=''
2603
MOZ_OPTIMIZE_FLAGS="-O"
2604
MOZ_DEBUG_FLAGS="-gstabs"
2607
LIBS="$LIBS -lsocket -lstdc++"
2608
_DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT -D_POSIX_C_SOURCE=199506'
2609
_DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h -D_POSIX_C_SOURCE=199506'
2610
if test "$with_x" != "yes"
2612
_PLATFORM_DEFAULT_TOOLKIT="photon"
2613
TK_CFLAGS='-I/usr/include/photon'
2616
case "${target_cpu}" in
2618
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
2621
case "${host_cpu}" in
2629
DLL_SUFFIX=".so.1.0"
2631
DSO_PIC_CFLAGS='-fPIC'
2632
DSO_LDOPTS='-shared -fPIC'
2633
if test "$LIBRUNPATH"; then
2634
DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2639
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2640
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2643
AC_DEFINE(OS2EMX_PLAIN_CHAR)
2644
AC_DEFINE(TCPV40HDRS)
2650
IMPORT_LIB_SUFFIX=lib
2654
CFLAGS="$CFLAGS -Zomf"
2655
CXXFLAGS="$CXXFLAGS -Zomf"
2657
BIN_FLAGS='-Zlinker /ST:0x100000'
2661
WARNINGS_AS_ERRORS='-Werror'
2662
MOZ_DEBUG_FLAGS="-g -fno-inline"
2663
MOZ_OPTIMIZE_FLAGS="-O2"
2664
MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2665
DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2666
LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2668
_PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2671
MOZ_USER_DIR="Mozilla"
2674
if test "$MOZTOOLS"; then
2675
MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2677
AC_MSG_ERROR([MOZTOOLS is not set])
2679
if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2680
DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2681
LDFLAGS="$LDFLAGS -Zhigh-mem"
2682
MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2683
AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2686
# GCC for OS/2 currently predefines these, but we don't want them
2687
_DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2688
_DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2690
AC_CACHE_CHECK(for __declspec(dllexport),
2692
[AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2694
ac_os2_declspec="yes",
2695
ac_os2_declspec="no")])
2696
if test "$ac_os2_declspec" != "yes"; then
2697
AC_MSG_ERROR([Compiler does not support __declspec(dllexport), install GCC-4.3.2 or newer])
2702
if test "$GNU_CC"; then
2703
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2704
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$@ -o $@'
2707
MOZ_DEBUG_FLAGS='-g'
2708
ASFLAGS='-I$(topsrcdir)/xpcom/reflect/xptcall/public -g'
2709
CFLAGS="$CFLAGS -ieee"
2710
CXXFLAGS="$CXXFLAGS "'-noexceptions -ieee -ptr $(DIST)/cxx_repository'
2711
DSO_LDOPTS='-shared -msym -expect_unresolved \* -update_registry $(DIST)/so_locations'
2714
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2715
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -soname $@ -o $@'
2716
MKSHLIB_FORCE_ALL='-all'
2717
MKSHLIB_UNFORCE_ALL='-none'
2718
dnl Might fix the libxpcom.so breakage on this platform as well....
2719
AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2720
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2722
if test -z "$GNU_CXX"; then
2725
AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2729
DIRENT_INO=d_stat.st_ino
2730
dnl Solves the problems the QNX compiler has with nsCOMPtr.h.
2731
AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2732
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2733
dnl Explicit set STDC_HEADERS to workaround QNX 6.0's failing of std test
2734
AC_DEFINE(STDC_HEADERS)
2735
if test "$no_x" = "yes"; then
2736
_PLATFORM_DEFAULT_TOOLKIT='photon'
2737
TK_CFLAGS='-I/usr/nto/include/photon'
2738
TK_LIBS='-lphoton -lphrender'
2743
AC_DEFINE(NSCAP_DISABLE_TEST_DONTQUERY_CASES)
2744
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2745
CXXFLAGS="$CXXFLAGS -I/usr/include/CC"
2746
if test ! "$GNU_CC"; then
2753
TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2756
# $ORIGIN/.. is for shared libraries under components/ to locate shared
2757
# libraries one level up (e.g. libnspr4.so)
2758
if test "$SOLARIS_SUNPRO_CC"; then
2759
LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..' -z lazyload -z combreloc -z muldefs"
2760
LIBS="-lCrun -lCstd -lc $LIBS"
2762
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2763
CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
2764
CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
2765
_MOZ_EXCEPTIONS_FLAGS_ON='-features=except'
2766
_MOZ_EXCEPTIONS_FLAGS_OFF='-features=no%except'
2767
LDFLAGS="-xildoff $LDFLAGS"
2768
if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
2769
_SAVE_LDFLAGS=$LDFLAGS
2770
LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2771
AC_TRY_LINK([#include <stdio.h>],
2772
[printf("Hello World\n");],
2774
[LDFLAGS=$_SAVE_LDFLAGS])
2776
MOZ_OPTIMIZE_FLAGS="-xO4"
2777
MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2778
MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2779
MKSHLIB_FORCE_ALL='-z allextract'
2780
MKSHLIB_UNFORCE_ALL='-z defaultextract'
2787
AS='/usr/ccs/bin/as'
2788
ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2790
TARGET_COMPILER_ABI="sunc"
2791
CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2792
CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2793
AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2797
[#if (__SUNPRO_CC < 0x590)
2800
_BAD_COMPILER=,_BAD_COMPILER=1)
2801
if test -n "$_BAD_COMPILER"; then
2803
AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2808
[#if (__SUNPRO_CC >= 0x5100)
2809
#error "Sun C++ 5.10 or above"
2811
_ABOVE_SS12U1=,_ABOVE_SS12U1=1)
2812
if test "$_ABOVE_SS12U1"; then
2814
CXXFLAGS="$CXXFLAGS -xannotate=no"
2816
AC_MSG_RESULT([$_res])
2819
LDFLAGS="$LDFLAGS -Wl,-z,ignore -Wl,-R,'\$\$ORIGIN:\$\$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs"
2821
MKSHLIB_FORCE_ALL='-Wl,-z -Wl,allextract'
2822
MKSHLIB_UNFORCE_ALL='-Wl,-z -Wl,defaultextract'
2823
ASFLAGS="$ASFLAGS -fPIC"
2824
DSO_LDOPTS='-shared'
2825
WARNINGS_AS_ERRORS='-Werror'
2827
_WARNINGS_CXXFLAGS=''
2828
if test "$OS_RELEASE" = "5.3"; then
2829
AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2832
if test "$OS_RELEASE" = "5.5.1"; then
2833
AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2838
DSO_LDOPTS='-Bdynamic'
2839
MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2840
MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2842
AC_DEFINE(SPRINTF_RETURNS_STRING)
2843
case "$(target_os)" in
2845
DLL_SUFFIX='.so.1.0'
2851
NSPR_LIBS="-lnspr$NSPR_VERSION -lplc$NSPR_VERSION -lplds$NSPR_VERSION -L/usr/ccs/lib -lcrt"
2855
HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2859
AC_DEFINE(NO_PW_GECOS)
2861
_PLATFORM_DEFAULT_TOOLKIT=cairo-android
2862
TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2864
MOZ_GFX_OPTIMIZE_MOBILE=1
2865
# If we're building with --enable-profiling, we need a frame pointer.
2866
if test -z "$MOZ_PROFILING"; then
2867
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fomit-frame-pointer"
2869
MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions -fno-omit-frame-pointer"
2871
# The Maemo builders don't know about this flag
2872
MOZ_ARM_VFP_FLAGS="-mfpu=vfp"
2877
dnl Only one oddball right now (QNX), but this gives us flexibility
2878
dnl if any other platforms need to override this in the future.
2879
AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2881
dnl ========================================================
2882
dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2883
dnl by now will not have any way to link most binaries (tests
2884
dnl as well as viewer, apprunner, etc.), because some symbols
2885
dnl will be left out of the "composite" .so's by ld as unneeded.
2886
dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2887
dnl they can link in the static libs that provide the missing
2889
dnl ========================================================
2890
NO_LD_ARCHIVE_FLAGS=
2891
if test -z "$MKSHLIB_FORCE_ALL" -o -z "$MKSHLIB_UNFORCE_ALL"; then
2892
NO_LD_ARCHIVE_FLAGS=1
2896
NO_LD_ARCHIVE_FLAGS=
2899
NO_LD_ARCHIVE_FLAGS=
2901
*-mingw*|*-wince|*-winmo)
2902
if test -z "$GNU_CC"; then
2903
NO_LD_ARCHIVE_FLAGS=
2907
AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2909
dnl ========================================================
2910
dnl = Flags to strip unused symbols from .so components and
2911
dnl = to export jemalloc symbols when linking a program
2912
dnl ========================================================
2914
*-linux*|*-kfreebsd*-gnu|*-gnu*)
2915
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2916
MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS='-rdynamic -Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/jemalloc-standalone-linkage-version-script'
2919
if test -z "$GNU_CC"; then
2920
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2922
if test -z "$GCC_USE_GNU_LD"; then
2923
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2925
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2930
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2933
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2935
*-mingw*|*-wince|*-winmo)
2936
if test -n "$GNU_CC"; then
2937
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2942
if test -z "$COMPILE_ENVIRONMENT"; then
2943
SKIP_COMPILER_CHECKS=1
2944
SKIP_LIBRARY_CHECKS=1
2947
if test -z "$SKIP_COMPILER_CHECKS"; then
2948
dnl Checks for typedefs, structures, and compiler characteristics.
2949
dnl ========================================================
2957
AC_MSG_CHECKING(for __stdcall)
2958
AC_CACHE_VAL(ac_cv___stdcall,
2959
[AC_TRY_COMPILE([template <typename Method> struct foo;
2960
template <> struct foo<void (*)()> {};
2961
template <> struct foo<void (__stdcall*)()> {};],
2963
[ac_cv___stdcall=true],
2964
[ac_cv___stdcall=false])])
2965
if test "$ac_cv___stdcall" = true ; then
2966
AC_DEFINE(HAVE_STDCALL)
2972
AC_MSG_CHECKING(for ssize_t)
2973
AC_CACHE_VAL(ac_cv_type_ssize_t,
2974
[AC_TRY_COMPILE([#include <stdio.h>
2975
#include <sys/types.h>],
2977
[ac_cv_type_ssize_t=true],
2978
[ac_cv_type_ssize_t=false])])
2979
if test "$ac_cv_type_ssize_t" = true ; then
2980
AC_DEFINE(HAVE_SSIZE_T)
2985
AC_STRUCT_ST_BLKSIZE
2986
AC_MSG_CHECKING(for siginfo_t)
2987
AC_CACHE_VAL(ac_cv_siginfo_t,
2988
[AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2989
#include <signal.h>],
2991
[ac_cv_siginfo_t=true],
2992
[ac_cv_siginfo_t=false])])
2993
if test "$ac_cv_siginfo_t" = true ; then
2994
AC_DEFINE(HAVE_SIGINFO_T)
3000
dnl Check for int16_t, int32_t, int64_t, int64, uint, uint_t, and uint16_t.
3001
dnl ========================================================
3002
AC_MSG_CHECKING(for int16_t)
3003
AC_CACHE_VAL(ac_cv_int16_t,
3004
[AC_TRY_COMPILE([#include <stdio.h>
3005
#include <sys/types.h>],
3007
[ac_cv_int16_t=true],
3008
[ac_cv_int16_t=false])])
3009
if test "$ac_cv_int16_t" = true ; then
3010
AC_DEFINE(HAVE_INT16_T)
3015
AC_MSG_CHECKING(for int32_t)
3016
AC_CACHE_VAL(ac_cv_int32_t,
3017
[AC_TRY_COMPILE([#include <stdio.h>
3018
#include <sys/types.h>],
3020
[ac_cv_int32_t=true],
3021
[ac_cv_int32_t=false])])
3022
if test "$ac_cv_int32_t" = true ; then
3023
AC_DEFINE(HAVE_INT32_T)
3028
AC_MSG_CHECKING(for int64_t)
3029
AC_CACHE_VAL(ac_cv_int64_t,
3030
[AC_TRY_COMPILE([#include <stdio.h>
3031
#include <sys/types.h>],
3033
[ac_cv_int64_t=true],
3034
[ac_cv_int64_t=false])])
3035
if test "$ac_cv_int64_t" = true ; then
3036
AC_DEFINE(HAVE_INT64_T)
3041
AC_MSG_CHECKING(for int64)
3042
AC_CACHE_VAL(ac_cv_int64,
3043
[AC_TRY_COMPILE([#include <stdio.h>
3044
#include <sys/types.h>],
3047
[ac_cv_int64=false])])
3048
if test "$ac_cv_int64" = true ; then
3049
AC_DEFINE(HAVE_INT64)
3054
AC_MSG_CHECKING(for uint)
3055
AC_CACHE_VAL(ac_cv_uint,
3056
[AC_TRY_COMPILE([#include <stdio.h>
3057
#include <sys/types.h>],
3060
[ac_cv_uint=false])])
3061
if test "$ac_cv_uint" = true ; then
3062
AC_DEFINE(HAVE_UINT)
3067
AC_MSG_CHECKING(for uint_t)
3068
AC_CACHE_VAL(ac_cv_uint_t,
3069
[AC_TRY_COMPILE([#include <stdio.h>
3070
#include <sys/types.h>],
3072
[ac_cv_uint_t=true],
3073
[ac_cv_uint_t=false])])
3074
if test "$ac_cv_uint_t" = true ; then
3075
AC_DEFINE(HAVE_UINT_T)
3080
AC_MSG_CHECKING(for uint16_t)
3081
AC_CACHE_VAL(ac_cv_uint16_t,
3082
[AC_TRY_COMPILE([#include <stdio.h>
3083
#include <sys/types.h>],
3084
[uint16_t foo = 0;],
3085
[ac_cv_uint16_t=true],
3086
[ac_cv_uint16_t=false])])
3087
if test "$ac_cv_uint16_t" = true ; then
3088
AC_DEFINE(HAVE_UINT16_T)
3094
dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
3095
dnl are defined when compiling C++ but not C. Since the result of this
3096
dnl test is used only in C++, do it in C++.
3099
AC_MSG_CHECKING(for uname.domainname)
3100
AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
3101
[AC_TRY_COMPILE([#include <sys/utsname.h>],
3102
[ struct utsname *res; char *domain;
3103
(void)uname(res); if (res != 0) { domain = res->domainname; } ],
3104
[ac_cv_have_uname_domainname_field=true],
3105
[ac_cv_have_uname_domainname_field=false])])
3107
if test "$ac_cv_have_uname_domainname_field" = "true"; then
3108
AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
3114
AC_MSG_CHECKING(for uname.__domainname)
3115
AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
3116
[AC_TRY_COMPILE([#include <sys/utsname.h>],
3117
[ struct utsname *res; char *domain;
3118
(void)uname(res); if (res != 0) { domain = res->__domainname; } ],
3119
[ac_cv_have_uname_us_domainname_field=true],
3120
[ac_cv_have_uname_us_domainname_field=false])])
3122
if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
3123
AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
3131
dnl Check for usable char16_t (2 bytes, unsigned)
3132
dnl (we might not need the unsignedness check anymore)
3133
AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
3134
ac_cv_have_usable_char16_t,
3135
[AC_TRY_COMPILE([$configure_static_assert_macros],
3136
[CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
3137
CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
3138
CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
3139
CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
3140
CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
3141
ac_cv_have_usable_char16_t="yes",
3142
ac_cv_have_usable_char16_t="no")])
3143
if test "$ac_cv_have_usable_char16_t" = "yes"; then
3144
AC_DEFINE(HAVE_CPP_CHAR16_T)
3148
dnl Check for usable wchar_t (2 bytes, unsigned)
3149
dnl (we really don't need the unsignedness check anymore)
3150
dnl ========================================================
3152
AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
3153
ac_cv_have_usable_wchar_v2,
3154
[AC_TRY_COMPILE([#include <stddef.h>
3155
$configure_static_assert_macros],
3156
[CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
3157
CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
3158
ac_cv_have_usable_wchar_v2="yes",
3159
ac_cv_have_usable_wchar_v2="no")])
3160
if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
3161
AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
3162
HAVE_CPP_2BYTE_WCHAR_T=1
3163
elif test "$ac_cv_have_usable_char16_t" != "yes"; then
3164
dnl This is really gcc-only
3165
dnl Do this test using CXX only since some versions of gcc
3166
dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
3167
dnl only have short-wchar support for c++.
3168
dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
3170
_SAVE_CXXFLAGS=$CXXFLAGS
3171
CXXFLAGS="$CXXFLAGS -fshort-wchar"
3173
AC_CACHE_CHECK(for compiler -fshort-wchar option,
3174
ac_cv_have_usable_wchar_option_v2,
3175
[AC_TRY_LINK([#include <stddef.h>
3176
$configure_static_assert_macros],
3177
[CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
3178
CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
3179
ac_cv_have_usable_wchar_option_v2="yes",
3180
ac_cv_have_usable_wchar_option_v2="no")])
3182
if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
3183
AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
3184
HAVE_CPP_2BYTE_WCHAR_T=1
3185
if test "$OS_TARGET" = Android; then
3186
WCHAR_CFLAGS="-fshort-wchar -Wl,--no-wchar-size-warning"
3187
CXXFLAGS="$CXXFLAGS -Wl,--no-wchar-size-warning"
3188
CFLAGS="$CFLAGS -Wl,--no-wchar-size-warning"
3189
DSO_LDOPTS="$DSO_LDOPTS -Wl,--no-wchar-size-warning"
3191
WCHAR_CFLAGS="-fshort-wchar"
3194
CXXFLAGS=$_SAVE_CXXFLAGS
3200
dnl Check for .hidden assembler directive and visibility attribute.
3201
dnl Borrowed from glibc configure.in
3202
dnl ===============================================================
3203
if test "$GNU_CC"; then
3204
AC_CACHE_CHECK(for visibility(hidden) attribute,
3205
ac_cv_visibility_hidden,
3206
[cat > conftest.c <<EOF
3207
int foo __attribute__ ((visibility ("hidden"))) = 1;
3209
ac_cv_visibility_hidden=no
3210
if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
3211
if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
3212
ac_cv_visibility_hidden=yes
3217
if test "$ac_cv_visibility_hidden" = "yes"; then
3218
AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
3220
AC_CACHE_CHECK(for visibility(default) attribute,
3221
ac_cv_visibility_default,
3222
[cat > conftest.c <<EOF
3223
int foo __attribute__ ((visibility ("default"))) = 1;
3225
ac_cv_visibility_default=no
3226
if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
3227
if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
3228
ac_cv_visibility_default=yes
3233
if test "$ac_cv_visibility_default" = "yes"; then
3234
AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
3236
AC_CACHE_CHECK(for visibility pragma support,
3237
ac_cv_visibility_pragma,
3238
[cat > conftest.c <<EOF
3239
#pragma GCC visibility push(hidden)
3241
#pragma GCC visibility push(default)
3242
int foo_default = 1;
3244
ac_cv_visibility_pragma=no
3245
if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
3246
if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
3247
if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
3248
ac_cv_visibility_pragma=yes
3254
if test "$ac_cv_visibility_pragma" = "yes"; then
3255
AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
3256
ac_cv_have_visibility_class_bug,
3257
[cat > conftest.c <<EOF
3258
#pragma GCC visibility push(hidden)
3259
struct __attribute__ ((visibility ("default"))) TestStruct {
3262
__attribute__ ((visibility ("default"))) void TestFunc() {
3266
ac_cv_have_visibility_class_bug=no
3267
if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3268
ac_cv_have_visibility_class_bug=yes
3270
if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
3271
ac_cv_have_visibility_class_bug=yes
3274
rm -rf conftest.{c,S}
3277
AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
3278
ac_cv_have_visibility_builtin_bug,
3279
[cat > conftest.c <<EOF
3280
#pragma GCC visibility push(hidden)
3281
#pragma GCC visibility push(default)
3283
#pragma GCC visibility pop
3285
__attribute__ ((visibility ("default"))) void Func() {
3287
memset(c, 0, sizeof(c));
3290
ac_cv_have_visibility_builtin_bug=no
3291
if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
3292
ac_cv_have_visibility_builtin_bug=yes
3294
if test `grep -c "@PLT" conftest.S` = 0; then
3295
ac_cv_visibility_builtin_bug=yes
3298
rm -f conftest.{c,S}
3300
if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
3301
"$ac_cv_have_visibility_class_bug" = "no"; then
3302
VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
3303
WRAP_SYSTEM_INCLUDES=1
3304
STL_FLAGS='-I$(DIST)/stl_wrappers'
3307
VISIBILITY_FLAGS='-fvisibility=hidden'
3308
fi # have visibility pragma bug
3309
fi # have visibility pragma
3310
fi # have visibility(default) attribute
3311
fi # have visibility(hidden) attribute
3314
# visibility hidden flag for Sun Studio on Solaris
3315
if test "$SOLARIS_SUNPRO_CC"; then
3316
VISIBILITY_FLAGS='-xldscope=hidden'
3317
fi # Sun Studio on Solaris
3319
AC_SUBST(WRAP_SYSTEM_INCLUDES)
3320
AC_SUBST(VISIBILITY_FLAGS)
3322
dnl Check for __force_align_arg_pointer__ for SSE2 on gcc
3323
dnl ========================================================
3324
if test "$GNU_CC"; then
3325
CFLAGS_save="${CFLAGS}"
3326
CFLAGS="${CFLAGS} -Werror"
3327
AC_CACHE_CHECK(for __force_align_arg_pointer__ attribute,
3328
ac_cv_force_align_arg_pointer,
3329
[AC_TRY_COMPILE([__attribute__ ((__force_align_arg_pointer__)) void test() {}],
3331
ac_cv_force_align_arg_pointer="yes",
3332
ac_cv_force_align_arg_pointer="no")])
3333
CFLAGS="${CFLAGS_save}"
3334
if test "$ac_cv_force_align_arg_pointer" = "yes"; then
3335
HAVE_GCC_ALIGN_ARG_POINTER=1
3337
HAVE_GCC_ALIGN_ARG_POINTER=
3340
AC_SUBST(HAVE_GCC_ALIGN_ARG_POINTER)
3342
dnl Checks for header files.
3343
dnl ========================================================
3345
case "$target_os" in
3347
# for stuff like -lXshm
3348
CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
3351
MOZ_CHECK_HEADERS(sys/byteorder.h compat.h getopt.h)
3352
MOZ_CHECK_HEADERS(sys/bitypes.h memory.h unistd.h)
3353
MOZ_CHECK_HEADERS(gnu/libc-version.h nl_types.h)
3354
MOZ_CHECK_HEADERS(malloc.h)
3355
MOZ_CHECK_HEADERS(X11/XKBlib.h)
3356
MOZ_CHECK_HEADERS(io.h)
3358
dnl These are all the places some variant of statfs can be hiding.
3359
MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
3362
MOZ_CHECK_HEADERS(sys/quota.h)
3363
MOZ_CHECK_HEADERS(linux/quota.h)
3365
dnl Try for MMX support
3366
dnl NB - later gcc versions require -mmmx for this header to be successfully
3367
dnl included (or another option which implies it, such as -march=pentium-mmx)
3368
MOZ_CHECK_HEADERS(mmintrin.h)
3370
dnl Check whether the compiler supports the new-style C++ standard
3371
dnl library headers (i.e. <new>) or needs the old "new.h"
3374
MOZ_CHECK_HEADER(new, [NEW_H=new])
3375
AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
3378
AC_ARG_ENABLE(dtrace,
3379
[ --enable-dtrace build with dtrace support if available (default=no)],
3380
[enable_dtrace="yes"],)
3381
if test "x$enable_dtrace" = "xyes"; then
3382
MOZ_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
3383
if test -n "$HAVE_DTRACE"; then
3384
AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
3386
AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
3389
AC_SUBST(HAVE_DTRACE)
3395
MOZ_CHECK_HEADERS(sys/cdefs.h)
3399
dnl Checks for libraries.
3400
dnl ========================================================
3405
AC_CHECK_LIB(c_r, gethostbyname_r)
3409
dnl We don't want to link with libdl even if it's present on OS X, since
3410
dnl it's not used and not part of the default installation. OS/2 has dlfcn
3412
dnl We don't want to link against libm or libpthread on Darwin since
3413
dnl they both are just symlinks to libSystem and explicitly linking
3414
dnl against libSystem causes issues when debugging (see bug 299601).
3421
AC_SEARCH_LIBS(dlopen, dl,
3422
MOZ_CHECK_HEADER(dlfcn.h,
3423
AC_DEFINE(HAVE_DLOPEN)))
3427
_SAVE_CFLAGS="$CFLAGS"
3428
CFLAGS="$CFLAGS -D_GNU_SOURCE"
3429
AC_CHECK_FUNCS(dladdr)
3430
CFLAGS="$_SAVE_CFLAGS"
3432
if test ! "$GNU_CXX"; then
3436
AC_CHECK_LIB(C_r, demangle)
3439
AC_CHECK_LIB(C, demangle)
3444
dnl OS/2 has socket in libc.
3449
AC_CHECK_LIB(socket, socket)
3452
dnl ========================================================
3453
dnl Check whether we can compile code for Core Text
3454
dnl (available on Mac OS X 10.5 or later)
3455
dnl ========================================================
3458
AC_MSG_CHECKING([for Core Text])
3459
AC_TRY_COMPILE([#include <ApplicationServices/ApplicationServices.h>],
3460
[CTLineRef lineRef;],
3461
ac_cv_have_core_text="yes",
3462
ac_cv_have_core_text="no")
3463
AC_MSG_RESULT([$ac_cv_have_core_text])
3465
if test "$ac_cv_have_core_text" = "no"; then
3466
AC_MSG_ERROR([Core Text is required (available on Mac OS X 10.5 or later).])
3472
XLIBS="$X_EXTRA_LIBS"
3474
dnl ========================================================
3475
dnl Checks for X libraries.
3476
dnl Ordering is important.
3477
dnl Xt is dependent upon SM as of X11R6
3478
dnl ========================================================
3479
if test "$no_x" = "yes"; then
3482
AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3483
XLIBS="-lX11 $XLIBS"
3484
_SAVE_LDFLAGS="$LDFLAGS"
3485
LDFLAGS="$XLDFLAGS $LDFLAGS"
3486
AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3487
[MISSING_X="$MISSING_X -lX11"], $XLIBS)
3488
AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3489
[MISSING_X="$MISSING_X -lXext"], $XLIBS)
3491
AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3492
unset ac_cv_lib_Xt_XtFree
3493
AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3494
AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3495
AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3496
[MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3499
# AIX needs the motif library linked before libXt to prevent
3500
# crashes in plugins linked against Motif - Bug #98892
3501
case "${target_os}" in
3503
XT_LIBS="-lXm $XT_LIBS"
3507
dnl ========================================================
3508
dnl = Check for XShm
3509
dnl ========================================================
3510
AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3512
MOZ_CHECK_HEADER(X11/extensions/XShm.h)
3513
if test "$ac_cv_header_X11_extensions_XShm_h" = "yes" &&
3514
test -n "$_HAVE_XSHM_XEXT"; then
3515
AC_DEFINE(HAVE_XSHM)
3518
dnl ========================================================
3520
dnl ========================================================
3521
MOZ_CHECK_HEADER(X11/extensions/scrnsaver.h,
3522
AC_CHECK_LIB(Xss, XScreenSaverQueryInfo,
3523
[XSS_LIBS="-lXss $XEXT_LIBS $XLIBS"
3524
AC_DEFINE(HAVE_LIBXSS)],, $XEXT_LIBS $XLIBS))
3526
dnl ========================================================
3528
dnl ========================================================
3529
AC_CHECK_LIB(XIE, XieFloGeometry, [MOZ_XIE_LIBS="-lXIE"],,
3531
MOZ_CHECK_HEADER(X11/extensions/XIElib.h)
3533
if test "$MOZ_XIE_LIBS"; then
3534
dnl ====================================================
3535
dnl = If XIE is present and is desired, turn it on
3536
dnl ====================================================
3546
LDFLAGS="$_SAVE_LDFLAGS"
3548
dnl ========================================================
3549
dnl = Check for freetype2 and its functionality
3550
dnl ========================================================
3551
AC_CHECK_FT2(6.1.0, [_HAVE_FREETYPE2=1], [_HAVE_FREETYPE2=])
3553
if test "$_HAVE_FREETYPE2"; then
3555
_SAVE_CFLAGS="$CFLAGS"
3556
LIBS="$LIBS $FT2_LIBS"
3557
CFLAGS="$CFLAGS $FT2_CFLAGS"
3559
AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3560
ac_cv_member_FT_Bitmap_Size_y_ppem,
3561
[AC_TRY_COMPILE([#include <ft2build.h>
3562
#include FT_FREETYPE_H],
3564
if (sizeof s.y_ppem) return 0;
3566
ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3567
ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3568
if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3569
HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3571
HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3573
AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3574
$HAVE_FT_BITMAP_SIZE_Y_PPEM,
3575
[FT_Bitmap_Size structure includes y_ppem field])
3577
AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
3580
CFLAGS="$_SAVE_CFLAGS"
3592
AC_MSG_CHECKING(for ARM SIMD support in compiler)
3593
# We try to link so that this also fails when
3594
# building with LTO.
3596
[asm("uqadd8 r1, r1, r2");],
3597
result="yes", result="no")
3598
AC_MSG_RESULT("$result")
3599
if test "$result" = "yes"; then
3600
AC_DEFINE(HAVE_ARM_SIMD)
3603
AC_SUBST(HAVE_ARM_SIMD)
3605
AC_MSG_CHECKING(for ARM NEON support in compiler)
3606
_SAVE_CFLAGS="$CFLAGS"
3607
if test "$GNU_CC"; then
3608
# gcc needs -mfpu=neon to recognize NEON instructions
3609
CFLAGS="$CFLAGS -mfpu=neon -mfloat-abi=softfp"
3611
# We try to link so that this also fails when
3612
# building with LTO.
3614
[asm("vadd.i8 d0, d0, d0");],
3615
result="yes", result="no")
3616
AC_MSG_RESULT("$result")
3617
if test "$result" = "yes"; then
3618
AC_DEFINE(HAVE_ARM_NEON)
3621
CFLAGS="$_SAVE_CFLAGS"
3622
AC_SUBST(HAVE_ARM_NEON)
3624
dnl ========================================================
3625
dnl = pthread support
3626
dnl = Start by checking whether the system support pthreads
3627
dnl ========================================================
3628
case "$target_os" in
3633
MOZ_CHECK_PTHREADS(pthreads,
3634
USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3635
MOZ_CHECK_PTHREADS(pthread,
3636
USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3637
MOZ_CHECK_PTHREADS(c_r,
3638
USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3639
MOZ_CHECK_PTHREADS(c,
3648
dnl ========================================================
3649
dnl Check the command line for --with-pthreads
3650
dnl ========================================================
3651
MOZ_ARG_WITH_BOOL(pthreads,
3652
[ --with-pthreads Force use of system pthread library with NSPR ],
3653
[ if test "$USE_PTHREADS"x = x; then
3654
AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3660
dnl ========================================================
3661
dnl Do the platform specific pthread hackery
3662
dnl ========================================================
3663
if test "$USE_PTHREADS"x != x
3666
dnl See if -pthread is supported.
3669
ac_cv_have_dash_pthread=no
3670
AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3671
echo 'int main() { return 0; }' | cat > conftest.c
3672
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3673
if test $? -eq 0; then
3674
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3675
ac_cv_have_dash_pthread=yes
3676
case "$target_os" in
3678
# Freebsd doesn't use -pthread for compiles, it uses them for linking
3681
CFLAGS="$CFLAGS -pthread"
3682
CXXFLAGS="$CXXFLAGS -pthread"
3688
AC_MSG_RESULT($ac_cv_have_dash_pthread)
3691
dnl See if -pthreads is supported.
3693
ac_cv_have_dash_pthreads=no
3694
if test "$ac_cv_have_dash_pthread" = "no"; then
3695
AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3696
echo 'int main() { return 0; }' | cat > conftest.c
3697
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3698
if test $? -eq 0; then
3699
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3700
ac_cv_have_dash_pthreads=yes
3701
CFLAGS="$CFLAGS -pthreads"
3702
CXXFLAGS="$CXXFLAGS -pthreads"
3706
AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3711
AC_DEFINE(_REENTRANT)
3712
AC_DEFINE(_THREAD_SAFE)
3713
dnl -pthread links in -lc_r, so don't specify it explicitly.
3714
if test "$ac_cv_have_dash_pthread" = "yes"; then
3715
_PTHREAD_LDFLAGS="-pthread"
3717
_PTHREAD_LDFLAGS="-lc_r"
3721
*-*-openbsd*|*-*-bsdi*)
3722
AC_DEFINE(_REENTRANT)
3723
AC_DEFINE(_THREAD_SAFE)
3724
dnl -pthread links in -lc_r, so don't specify it explicitly.
3725
if test "$ac_cv_have_dash_pthread" = "yes"; then
3726
_PTHREAD_LDFLAGS="-pthread"
3730
*-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
3731
AC_DEFINE(_REENTRANT)
3735
AC_DEFINE(_REENTRANT)
3739
AC_DEFINE(_REENTRANT)
3743
AC_DEFINE(_REENTRANT)
3747
AC_DEFINE(_REENTRANT)
3751
AC_DEFINE(_REENTRANT)
3752
if test "$SOLARIS_SUNPRO_CC"; then
3753
CFLAGS="$CFLAGS -mt"
3754
CXXFLAGS="$CXXFLAGS -mt"
3758
LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3761
dnl ========================================================
3762
dnl See if mmap sees writes
3763
dnl For cross compiling, just define it as no, which is a safe default
3764
dnl ========================================================
3765
AC_MSG_CHECKING(whether mmap() sees write()s)
3771
#include <sys/mman.h>
3772
#include <sys/types.h>
3773
#include <sys/stat.h>
3776
char fname[] = "conftest.file";
3777
char zbuff[1024]; /* Fractional page is probably worst case */
3784
fd = open(fname, O_RDWR | O_CREAT, 0660);
3787
write(fd, zbuff, sizeof(zbuff));
3788
lseek(fd, 0, SEEK_SET);
3789
map = (char*)mmap(0, sizeof(zbuff), PROT_READ, MAP_SHARED, fd, 0);
3790
if(map==(char*)-1) return 2;
3791
for(i=0; fname[i]; i++) {
3792
int rc = write(fd, &fname[i], 1);
3793
if(map[i]!=fname[i]) return 4;
3800
AC_TRY_RUN($mmap_test_prog , result="yes", result="no", result="yes")
3802
AC_MSG_RESULT("$result")
3804
if test "$result" = "no"; then
3805
AC_DEFINE(MMAP_MISSES_WRITES)
3809
dnl Checks for library functions.
3810
dnl ========================================================
3811
AC_PROG_GCC_TRADITIONAL
3813
AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3814
AC_CHECK_FUNCS(flockfile getpagesize)
3815
AC_CHECK_FUNCS(localtime_r strtok_r)
3817
dnl check for clock_gettime(), the CLOCK_MONOTONIC clock, and -lrt
3818
_SAVE_LDFLAGS=$LDFLAGS
3819
LDFLAGS="$LDFLAGS -lrt"
3820
AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC) and -lrt,
3821
ac_cv_have_clock_monotonic,
3822
[AC_TRY_LINK([#include <time.h>],
3823
[ struct timespec ts;
3824
clock_gettime(CLOCK_MONOTONIC, &ts); ],
3825
ac_cv_have_clock_monotonic=yes,
3826
ac_cv_have_clock_monotonic=no)])
3827
LDFLAGS=$_SAVE_LDFLAGS
3828
if test "$ac_cv_have_clock_monotonic" = "yes"; then
3829
HAVE_CLOCK_MONOTONIC=1
3831
AC_DEFINE(HAVE_CLOCK_MONOTONIC)
3832
AC_SUBST(HAVE_CLOCK_MONOTONIC)
3833
AC_SUBST(REALTIME_LIBS)
3836
dnl check for wcrtomb/mbrtowc
3837
dnl =======================================================================
3838
if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3841
AC_CACHE_CHECK(for wcrtomb,
3843
[AC_TRY_LINK([#include <wchar.h>],
3844
[mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3845
ac_cv_have_wcrtomb="yes",
3846
ac_cv_have_wcrtomb="no")])
3847
if test "$ac_cv_have_wcrtomb" = "yes"; then
3848
AC_DEFINE(HAVE_WCRTOMB)
3850
AC_CACHE_CHECK(for mbrtowc,
3852
[AC_TRY_LINK([#include <wchar.h>],
3853
[mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3854
ac_cv_have_mbrtowc="yes",
3855
ac_cv_have_mbrtowc="no")])
3856
if test "$ac_cv_have_mbrtowc" = "yes"; then
3857
AC_DEFINE(HAVE_MBRTOWC)
3864
ac_cv_func_res_ninit,
3867
#define _BSD_SOURCE 1
3871
[int foo = res_ninit(&_res);],
3872
[ac_cv_func_res_ninit=yes],
3873
[ac_cv_func_res_ninit=no])
3876
if test "$ac_cv_func_res_ninit" = "yes"; then
3877
AC_DEFINE(HAVE_RES_NINIT)
3878
dnl must add the link line we do something as foolish as this... dougt
3880
dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3881
dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3886
[for gnu_get_libc_version()],
3887
ac_cv_func_gnu_get_libc_version,
3889
#ifdef HAVE_GNU_LIBC_VERSION_H
3890
#include <gnu/libc-version.h>
3893
[const char *glibc_version = gnu_get_libc_version();],
3894
[ac_cv_func_gnu_get_libc_version=yes],
3895
[ac_cv_func_gnu_get_libc_version=no]
3899
if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3900
AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3904
darwin*|mingw*|os2*|wince*|winmo*)
3908
AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3909
AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3910
AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3912
LIBS="$LIBS $_ICONV_LIBS"
3921
iconv_t h = iconv_open("", "");
3922
iconv(h, NULL, NULL, NULL, NULL);
3925
[ac_cv_func_iconv=yes],
3926
[ac_cv_func_iconv=no]
3929
if test "$ac_cv_func_iconv" = "yes"; then
3930
AC_DEFINE(HAVE_ICONV)
3931
DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3932
LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3933
LIBICONV="$_ICONV_LIBS"
3935
[for iconv() with const input],
3936
ac_cv_func_const_iconv,
3942
const char *input = "testing";
3943
iconv_t h = iconv_open("", "");
3944
iconv(h, &input, NULL, NULL, NULL);
3947
[ac_cv_func_const_iconv=yes],
3948
[ac_cv_func_const_iconv=no]
3951
if test "$ac_cv_func_const_iconv" = "yes"; then
3952
AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3964
dnl **********************
3965
dnl *** va_copy checks ***
3966
dnl **********************
3967
dnl we currently check for all three va_copy possibilities, so we get
3968
dnl all results in config.log for bug reports.
3969
AC_MSG_CHECKING(for an implementation of va_copy())
3970
AC_CACHE_VAL(ac_cv_va_copy,[
3973
void f (int i, ...) {
3974
va_list args1, args2;
3975
va_start (args1, i);
3976
va_copy (args2, args1);
3977
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3979
va_end (args1); va_end (args2);
3981
int main() { f (0, 42); return 0; }],
3987
AC_MSG_RESULT($ac_cv_va_copy)
3988
AC_MSG_CHECKING(for an implementation of __va_copy())
3989
AC_CACHE_VAL(ac_cv___va_copy,[
3992
void f (int i, ...) {
3993
va_list args1, args2;
3994
va_start (args1, i);
3995
__va_copy (args2, args1);
3996
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3998
va_end (args1); va_end (args2);
4000
int main() { f (0, 42); return 0; }],
4001
ac_cv___va_copy=yes,
4006
AC_MSG_RESULT($ac_cv___va_copy)
4007
AC_MSG_CHECKING(whether va_lists can be copied by value)
4008
AC_CACHE_VAL(ac_cv_va_val_copy,[
4011
void f (int i, ...) {
4012
va_list args1, args2;
4013
va_start (args1, i);
4015
if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
4017
va_end (args1); va_end (args2);
4019
int main() { f (0, 42); return 0; }],
4020
ac_cv_va_val_copy=yes,
4021
ac_cv_va_val_copy=no,
4022
ac_cv_va_val_copy=yes
4025
if test "x$ac_cv_va_copy" = "xyes"; then
4026
AC_DEFINE(VA_COPY, va_copy)
4027
AC_DEFINE(HAVE_VA_COPY)
4028
elif test "x$ac_cv___va_copy" = "xyes"; then
4029
AC_DEFINE(VA_COPY, __va_copy)
4030
AC_DEFINE(HAVE_VA_COPY)
4033
if test "x$ac_cv_va_val_copy" = "xno"; then
4034
AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
4036
AC_MSG_RESULT($ac_cv_va_val_copy)
4038
dnl Check for dll-challenged libc's.
4039
dnl This check is apparently only needed for Linux.
4042
dnl ===================================================================
4045
rm -rf conftest* _conftest
4047
cat >> conftest.C <<\EOF
4052
void __dump_link_map(void) {
4053
struct link_map *map = _dl_loaded;
4054
while (NULL != map) {printf("0x%08x %s\n", map->l_addr, map->l_name); map = map->l_next;}
4057
dlopen("./conftest1.so",RTLD_LAZY);
4058
dlopen("./../_conftest/conftest1.so",RTLD_LAZY);
4059
dlopen("CURDIR/_conftest/conftest1.so",RTLD_LAZY);
4060
dlopen("CURDIR/_conftest/../_conftest/conftest1.so",RTLD_LAZY);
4064
/* _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).*/
4065
int main() { printf("./conftest1.so\n"); }
4069
$PERL -p -i -e "s/CURDIR/\$ENV{_curdir}/g;" conftest.C
4071
cat >> conftest1.C <<\EOF
4073
void foo(void) {printf("foo in dll called\n");}
4075
${CXX-g++} -fPIC -c -g conftest1.C
4076
${CXX-g++} -shared -Wl,-h -Wl,conftest1.so -o conftest1.so conftest1.o
4077
${CXX-g++} -g conftest.C -o conftest -ldl
4078
cp -f conftest1.so conftest _conftest
4080
if test `./conftest | grep conftest1.so | wc -l` -gt 1
4083
echo "*** Your libc has a bug that can result in loading the same dynamic"
4084
echo "*** library multiple times. This bug is known to be fixed in glibc-2.0.7-32"
4085
echo "*** or later. However, if you choose not to upgrade, the only effect"
4086
echo "*** will be excessive memory usage at runtime."
4090
rm -rf conftest* _conftest
4091
dnl ===================================================================
4095
dnl ===================================================================
4096
dnl ========================================================
4097
dnl Put your C++ language/feature checks below
4098
dnl ========================================================
4103
if test "$GNU_CC"; then
4104
if test "$CPU_ARCH" = "arm" ; then
4105
AC_CACHE_CHECK(for ARM EABI,
4109
#if defined(__ARM_EABI__)
4112
#error Not ARM EABI.
4115
ac_cv_gcc_arm_eabi="yes",
4116
ac_cv_gcc_arm_eabi="no")])
4117
if test "$ac_cv_gcc_arm_eabi" = "yes"; then
4119
ARM_ABI_PREFIX=eabi-
4121
ARM_ABI_PREFIX=oabi-
4125
AC_CACHE_CHECK(for gcc 3.0 ABI,
4126
ac_cv_gcc_three_abi,
4129
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
4135
ac_cv_gcc_three_abi="yes",
4136
ac_cv_gcc_three_abi="no")])
4137
if test "$ac_cv_gcc_three_abi" = "yes"; then
4138
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
4141
TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc2}"
4144
AC_SUBST(HAVE_GCC3_ABI)
4147
AC_CACHE_CHECK(for C++ \"explicit\" keyword,
4149
[AC_TRY_COMPILE(class X {
4150
public: explicit X(int i) : i_(i) {}
4154
ac_cv_cpp_explicit=yes,
4155
ac_cv_cpp_explicit=no)])
4156
if test "$ac_cv_cpp_explicit" = yes ; then
4157
AC_DEFINE(HAVE_CPP_EXPLICIT)
4160
AC_CACHE_CHECK(for C++ \"typename\" keyword,
4162
[AC_TRY_COMPILE(class param {
4164
typedef unsigned long num_type;
4167
template <class T> class tplt {
4169
typedef typename T::num_type t_num_type;
4170
t_num_type foo(typename T::num_type num) {
4176
ac_cv_cpp_typename=yes,
4177
ac_cv_cpp_typename=no)])
4178
if test "$ac_cv_cpp_typename" = yes ; then
4179
AC_DEFINE(HAVE_CPP_TYPENAME)
4182
dnl Check for support of modern template specialization syntax
4183
dnl Test code and requirement from scc@netscape.com.
4184
dnl Autoconf cut-and-paste job by waterson@netscape.com
4185
AC_CACHE_CHECK(for modern C++ template specialization syntax support,
4186
ac_cv_cpp_modern_specialize_template_syntax,
4187
[AC_TRY_COMPILE(template <class T> struct X { int a; };
4189
template <> struct X<Y> { double a; };,
4192
ac_cv_cpp_modern_specialize_template_syntax=yes,
4193
ac_cv_cpp_modern_specialize_template_syntax=no)])
4194
if test "$ac_cv_cpp_modern_specialize_template_syntax" = yes ; then
4195
AC_DEFINE(HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX)
4199
dnl Some compilers support only full specialization, and some don't.
4200
AC_CACHE_CHECK(whether partial template specialization works,
4201
ac_cv_cpp_partial_specialization,
4202
[AC_TRY_COMPILE(template <class T> class Foo {};
4203
template <class T> class Foo<T*> {};,
4205
ac_cv_cpp_partial_specialization=yes,
4206
ac_cv_cpp_partial_specialization=no)])
4207
if test "$ac_cv_cpp_partial_specialization" = yes ; then
4208
AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
4211
dnl Some compilers have limited support for operators with templates;
4212
dnl specifically, it is necessary to define derived operators when a base
4213
dnl class's operator declaration should suffice.
4214
AC_CACHE_CHECK(whether operators must be re-defined for templates derived from templates,
4215
ac_cv_need_derived_template_operators,
4216
[AC_TRY_COMPILE([template <class T> class Base { };
4218
Base<T> operator+(const Base<T>& lhs, const Base<T>& rhs) { return lhs; }
4219
template <class T> class Derived : public Base<T> { };],
4220
[Derived<char> a, b;
4221
Base<char> c = a + b;
4223
ac_cv_need_derived_template_operators=no,
4224
ac_cv_need_derived_template_operators=yes)])
4225
if test "$ac_cv_need_derived_template_operators" = yes ; then
4226
AC_DEFINE(NEED_CPP_DERIVED_TEMPLATE_OPERATORS)
4230
dnl Some compilers have trouble detecting that a template class
4231
dnl that derives from another template is actually an instance
4232
dnl of the base class. This test checks for that.
4233
AC_CACHE_CHECK(whether we need to cast a derived template to pass as its base class,
4234
ac_cv_need_cpp_template_cast_to_base,
4235
[AC_TRY_COMPILE([template <class T> class Base { };
4236
template <class T> class Derived : public Base<T> { };
4237
template <class T> int foo(const Base<T>&) { return 0; }],
4238
[Derived<char> bar; return foo(bar);],
4239
ac_cv_need_cpp_template_cast_to_base=no,
4240
ac_cv_need_cpp_template_cast_to_base=yes)])
4241
if test "$ac_cv_need_cpp_template_cast_to_base" = yes ; then
4242
AC_DEFINE(NEED_CPP_TEMPLATE_CAST_TO_BASE)
4245
dnl Some compilers have trouble resolving the ambiguity between two
4246
dnl functions whose arguments differ only by cv-qualifications.
4247
AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
4248
ac_cv_can_resolve_const_ambiguity,
4250
template <class T> class ptrClass {
4254
template <class T> T* a(ptrClass<T> *arg) {
4259
const T* a(const ptrClass<T> *arg) {
4265
ac_cv_can_resolve_const_ambiguity=yes,
4266
ac_cv_can_resolve_const_ambiguity=no)])
4267
if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
4268
AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
4272
dnl We don't do exceptions on unix. The only reason this used to be here
4273
dnl is that mozilla/xpcom/tests/TestCOMPtr.cpp has a test which uses
4274
dnl exceptions. But, we turn exceptions off by default and this test breaks.
4275
dnl So im commenting this out until someone writes some artificial
4276
dnl intelligence to detect not only if the compiler has exceptions, but if
4277
dnl they are enabled as well.
4279
dnl AC_CACHE_CHECK(for C++ \"exceptions\",
4280
dnl ac_cv_cpp_exceptions,
4281
dnl [AC_TRY_COMPILE(class X { public: X() {} };
4282
dnl static void F() { throw X(); },
4283
dnl try { F(); } catch(X & e) { },
4284
dnl ac_cv_cpp_exceptions=yes,
4285
dnl ac_cv_cpp_exceptions=no)])
4286
dnl if test $ac_cv_cpp_exceptions = yes ; then
4287
dnl AC_DEFINE(HAVE_CPP_EXCEPTIONS)
4290
dnl Some compilers have marginal |using| support; for example, gcc-2.7.2.3
4291
dnl supports it well enough to allow us to use it to change access, but not
4292
dnl to resolve ambiguity. The next two tests determine how well the |using|
4293
dnl keyword is supported.
4295
dnl Check to see if we can change access with |using|. Test both a
4296
dnl legal and an illegal example.
4297
AC_CACHE_CHECK(whether the C++ \"using\" keyword can change access,
4298
ac_cv_cpp_access_changing_using2,
4300
class A { protected: int foo() { return 0; } };
4301
class B : public A { public: using A::foo; };,
4302
B b; return b.foo();,
4304
class A { public: int foo() { return 1; } };
4305
class B : public A { private: using A::foo; };,
4306
B b; return b.foo();,
4307
ac_cv_cpp_access_changing_using2=no,
4308
ac_cv_cpp_access_changing_using2=yes)],
4309
ac_cv_cpp_access_changing_using2=no)])
4310
if test "$ac_cv_cpp_access_changing_using2" = yes ; then
4311
AC_DEFINE(HAVE_CPP_ACCESS_CHANGING_USING)
4314
dnl Check to see if we can resolve ambiguity with |using|.
4315
AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
4316
ac_cv_cpp_ambiguity_resolving_using,
4317
[AC_TRY_COMPILE(class X {
4318
public: int go(const X&) {return 3;}
4319
int jo(const X&) {return 3;}
4321
class Y : public X {
4322
public: int go(int) {return 2;}
4323
int jo(int) {return 2;}
4325
private: using X::go;
4328
ac_cv_cpp_ambiguity_resolving_using=yes,
4329
ac_cv_cpp_ambiguity_resolving_using=no)])
4330
if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
4331
AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
4334
dnl Check to see if the |std| namespace is supported. If so, we'll want
4335
dnl to qualify any standard library calls with "std::" to ensure that
4336
dnl those functions can be resolved.
4337
AC_CACHE_CHECK(for \"std::\" namespace,
4338
ac_cv_cpp_namespace_std,
4339
[AC_TRY_COMPILE([#include <algorithm>],
4340
[return std::min(0, 1);],
4341
ac_cv_cpp_namespace_std=yes,
4342
ac_cv_cpp_namespace_std=no)])
4343
if test "$ac_cv_cpp_namespace_std" = yes ; then
4344
AC_DEFINE(HAVE_CPP_NAMESPACE_STD)
4347
dnl Older compilers are overly ambitious with respect to using the standard
4348
dnl template library's |operator!=()| when |operator==()| is defined. In
4349
dnl which case, defining |operator!=()| in addition to |operator==()| causes
4350
dnl ambiguity at compile-time. This test checks for that case.
4351
AC_CACHE_CHECK(whether standard template operator!=() is ambiguous,
4352
ac_cv_cpp_unambiguous_std_notequal,
4353
[AC_TRY_COMPILE([#include <algorithm>
4355
int operator==(const T1&, const T1&) { return 0; }
4356
int operator!=(const T1&, const T1&) { return 0; }],
4357
[T1 a,b; return a != b;],
4358
ac_cv_cpp_unambiguous_std_notequal=unambiguous,
4359
ac_cv_cpp_unambiguous_std_notequal=ambiguous)])
4360
if test "$ac_cv_cpp_unambiguous_std_notequal" = unambiguous ; then
4361
AC_DEFINE(HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL)
4365
AC_CACHE_CHECK(for C++ reinterpret_cast,
4366
ac_cv_cpp_reinterpret_cast,
4367
[AC_TRY_COMPILE(struct X { int i; };
4368
struct Y { int i; };,
4369
X x; X*const z = &x;Y*y = reinterpret_cast<Y*>(z);,
4370
ac_cv_cpp_reinterpret_cast=yes,
4371
ac_cv_cpp_reinterpret_cast=no)])
4372
if test "$ac_cv_cpp_reinterpret_cast" = yes ; then
4373
AC_DEFINE(HAVE_CPP_NEW_CASTS)
4376
dnl See if a dynamic_cast to void* gives the most derived object.
4377
AC_CACHE_CHECK(for C++ dynamic_cast to void*,
4378
ac_cv_cpp_dynamic_cast_void_ptr,
4379
[AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
4380
class Y { int j; public: virtual ~Y() { } };
4381
class Z : public X, public Y { int k; };
4387
return !((((void*)&mdo != (void*)subx) &&
4388
((void*)&mdo == dynamic_cast<void*>(subx))) ||
4389
(((void*)&mdo != (void*)suby) &&
4390
((void*)&mdo == dynamic_cast<void*>(suby))));
4392
ac_cv_cpp_dynamic_cast_void_ptr=yes,
4393
ac_cv_cpp_dynamic_cast_void_ptr=no,
4394
ac_cv_cpp_dynamic_cast_void_ptr=no)])
4395
if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
4396
AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
4400
dnl note that this one is reversed - if the test fails, then
4401
dnl we require implementations of unused virtual methods. Which
4402
dnl really blows because it means we'll have useless vtable
4404
AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
4405
ac_cv_cpp_unused_required,
4406
[AC_TRY_LINK(class X {private: virtual void never_called();};,
4408
ac_cv_cpp_unused_required=no,
4409
ac_cv_cpp_unused_required=yes)])
4410
if test "$ac_cv_cpp_unused_required" = yes ; then
4411
AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
4415
dnl Some compilers have trouble comparing a constant reference to a templatized
4416
dnl class to zero, and require an explicit operator==() to be defined that takes
4417
dnl an int. This test separates the strong from the weak.
4419
AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
4420
ac_cv_trouble_comparing_to_zero,
4421
[AC_TRY_COMPILE([#include <algorithm>
4422
template <class T> class Foo {};
4424
template <class T> int operator==(const T2*, const T&) { return 0; }
4425
template <class T> int operator!=(const T2*, const T&) { return 0; }],
4426
[Foo<int> f; return (0 != f);],
4427
ac_cv_trouble_comparing_to_zero=no,
4428
ac_cv_trouble_comparing_to_zero=yes)])
4429
if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
4430
AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
4433
# try harder, when checking for __thread support, see bug 521750 comment #33 and below
4434
_SAVE_LDFLAGS=$LDFLAGS
4435
LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS"
4436
AC_CACHE_CHECK(for __thread keyword for TLS variables,
4437
ac_cv_thread_keyword,
4438
[AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
4439
[return tlsIsMainThread;],
4440
ac_cv_thread_keyword=yes,
4441
ac_cv_thread_keyword=no)])
4442
LDFLAGS=$_SAVE_LDFLAGS
4443
if test "$ac_cv_thread_keyword" = yes; then
4444
# mips builds fail with TLS variables because of a binutils bug.
4454
AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
4459
dnl Check for the existence of various allocation headers/functions
4462
MOZ_CHECK_HEADER(malloc.h, [MALLOC_H=malloc.h])
4463
if test "$MALLOC_H" = ""; then
4464
MOZ_CHECK_HEADER(malloc/malloc.h, [MALLOC_H=malloc/malloc.h])
4465
if test "$MALLOC_H" = ""; then
4466
MOZ_CHECK_HEADER(sys/malloc.h, [MALLOC_H=sys/malloc.h])
4469
if test "$MALLOC_H" != ""; then
4470
AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
4473
MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc"
4474
AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)
4476
dnl See if compiler supports some gcc-style attributes
4478
AC_CACHE_CHECK(for __attribute__((always_inline)),
4479
ac_cv_attribute_always_inline,
4481
[inline void f(void) __attribute__((always_inline));],
4482
ac_cv_attribute_always_inline=yes,
4483
ac_cv_attribute_always_inline=no)])
4485
AC_CACHE_CHECK(for __attribute__((malloc)),
4486
ac_cv_attribute_malloc,
4488
[void* f(int) __attribute__((malloc));],
4489
ac_cv_attribute_malloc=yes,
4490
ac_cv_attribute_malloc=no)])
4492
AC_CACHE_CHECK(for __attribute__((warn_unused_result)),
4493
ac_cv_attribute_warn_unused,
4495
[int f(void) __attribute__((warn_unused_result));],
4496
ac_cv_attribute_warn_unused=yes,
4497
ac_cv_attribute_warn_unused=no)])
4499
AC_CACHE_CHECK(for __attribute__((noreturn)),
4500
ac_cv_attribute_noreturn,
4502
[void f(void) __attribute__((noreturn));],
4503
ac_cv_attribute_noreturn=yes,
4504
ac_cv_attribute_noreturn=no)])
4506
dnl End of C++ language/feature checks
4509
dnl ========================================================
4510
dnl = Internationalization checks
4511
dnl ========================================================
4513
dnl Internationalization and Locale support is different
4514
dnl on various UNIX platforms. Checks for specific i18n
4515
dnl features go here.
4517
dnl check for LC_MESSAGES
4518
AC_CACHE_CHECK(for LC_MESSAGES,
4519
ac_cv_i18n_lc_messages,
4520
[AC_TRY_COMPILE([#include <locale.h>],
4521
[int category = LC_MESSAGES;],
4522
ac_cv_i18n_lc_messages=yes,
4523
ac_cv_i18n_lc_messages=no)])
4524
if test "$ac_cv_i18n_lc_messages" = yes; then
4525
AC_DEFINE(HAVE_I18N_LC_MESSAGES)
4528
AC_HAVE_FUNCS(localeconv)
4530
fi # SKIP_COMPILER_CHECKS
4533
if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
4534
TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
4537
dnl Mozilla specific options
4538
dnl ========================================================
4539
dnl The macros used for command line options
4540
dnl are defined in build/autoconf/altoptions.m4.
4542
dnl If the compiler supports these attributes, define them as
4543
dnl convenience macros.
4544
if test "$ac_cv_attribute_always_inline" = yes ; then
4545
AC_DEFINE(NS_ALWAYS_INLINE, [__attribute__((always_inline))])
4547
AC_DEFINE(NS_ALWAYS_INLINE,)
4550
if test "$ac_cv_attribute_malloc" = yes ; then
4551
AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))])
4553
AC_DEFINE(NS_ATTR_MALLOC,)
4556
if test "$ac_cv_attribute_warn_unused" = yes ; then
4557
AC_DEFINE(NS_WARN_UNUSED_RESULT, [__attribute__((warn_unused_result))])
4559
AC_DEFINE(NS_WARN_UNUSED_RESULT,)
4562
if test "$ac_cv_attribute_noreturn" = yes ; then
4563
AC_DEFINE(NS_NORETURN, [__attribute__((noreturn))])
4565
AC_DEFINE(NS_NORETURN,)
4568
dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
4569
dnl features that Windows actually does support.
4571
if test -n "$SKIP_COMPILER_CHECKS"; then
4572
dnl Windows has malloc.h
4573
AC_DEFINE(MALLOC_H, [<malloc.h>])
4574
AC_DEFINE(HAVE_FORCEINLINE)
4575
AC_DEFINE(HAVE_LOCALECONV)
4576
fi # SKIP_COMPILER_CHECKS
4578
dnl ========================================================
4580
dnl = Check for external package dependencies
4582
dnl ========================================================
4583
MOZ_ARG_HEADER(External Packages)
4587
MOZ_ARG_WITH_STRING(libxul-sdk,
4588
[ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
4589
LIBXUL_SDK_DIR=$withval)
4591
if test "$LIBXUL_SDK_DIR" = "yes"; then
4592
AC_MSG_ERROR([--with-libxul-sdk must specify a path])
4593
elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
4594
LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
4596
if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
4597
AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
4602
AC_SUBST(LIBXUL_SDK)
4604
if test -n "$LIBXUL_SDK"; then
4605
LIBXUL_DIST="$LIBXUL_SDK"
4607
LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
4609
AC_SUBST(LIBXUL_DIST)
4613
MOZ_ARG_WITH_BOOL(system-libxul,
4614
[ --with-system-libxul Use system installed libxul SDK],
4617
if test -n "$SYSTEM_LIBXUL" -a -z "$MOZ_ENABLE_LIBXUL"; then
4618
AC_MSG_ERROR([--with-system-libxul needs --with-libxul-sdk])
4621
dnl ========================================================
4622
dnl = If NSPR was not detected in the system,
4623
dnl = use the one in the source tree (mozilla/nsprpub)
4624
dnl ========================================================
4625
MOZ_ARG_WITH_BOOL(system-nspr,
4626
[ --with-system-nspr Use system installed NSPR],
4627
_USE_SYSTEM_NSPR=1 )
4629
if test -n "$_USE_SYSTEM_NSPR"; then
4630
AM_PATH_NSPR(4.8.7, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
4633
if test -n "$MOZ_NATIVE_NSPR"; then
4634
_SAVE_CFLAGS=$CFLAGS
4635
CFLAGS="$CFLAGS $NSPR_CFLAGS"
4636
AC_TRY_COMPILE([#include "prtypes.h"],
4637
[#ifndef PR_STATIC_ASSERT
4638
#error PR_STATIC_ASSERT not defined or requires including prlog.h
4640
[MOZ_NATIVE_NSPR=1],
4641
AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it]))
4642
CFLAGS=$_SAVE_CFLAGS
4644
if test "$OS_ARCH" = "WINCE"; then
4645
NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4646
NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4647
elif test "$OS_ARCH" = "WINNT"; then
4648
NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
4649
if test -n "$GNU_CC"; then
4650
NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
4652
NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
4655
NSPR_CFLAGS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --includedir='${LIBXUL_DIST}'/include/nspr --cflags`'
4656
NSPR_LIBS='`$(LIBXUL_DIST)/sdk/bin/nspr-config --prefix='${LIBXUL_DIST}' --libdir='${LIBXUL_DIST}'/lib --libs`'
4660
dnl system libevent Support
4661
dnl ========================================================
4662
MOZ_ARG_WITH_STRING(system-libevent,
4663
[ --with-system-libevent=[PFX]
4664
Use system libevent [installed at prefix PFX]],
4665
LIBEVENT_DIR=$withval)
4667
_SAVE_CFLAGS=$CFLAGS
4668
_SAVE_LDFLAGS=$LDFLAGS
4670
if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
4671
MOZ_NATIVE_LIBEVENT=
4673
if test "${LIBEVENT_DIR}" = "yes"; then
4676
CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
4677
LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
4678
MOZ_CHECK_HEADER(event.h,
4679
[if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
4680
AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
4682
AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
4683
AC_CHECK_LIB(event, event_init,
4684
[MOZ_NATIVE_LIBEVENT=1
4685
MOZ_LIBEVENT_INCLUDES="${LIBEVENT_DIR}/include"
4686
MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
4687
[MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_INCLUDES= MOZ_LIBEVENT_LIBS=])
4689
CFLAGS=$_SAVE_CFLAGS
4690
LDFLAGS=$_SAVE_LDFLAGS
4693
AC_SUBST(MOZ_NATIVE_LIBEVENT)
4694
AC_SUBST(MOZ_LIBEVENT_INCLUDES)
4695
AC_SUBST(MOZ_LIBEVENT_LIBS)
4697
dnl ========================================================
4698
dnl = If NSS was not detected in the system,
4699
dnl = use the one in the source tree (mozilla/security/nss)
4700
dnl ========================================================
4702
MOZ_ARG_WITH_BOOL(system-nss,
4703
[ --with-system-nss Use system installed NSS],
4706
if test -n "$_USE_SYSTEM_NSS"; then
4707
AM_PATH_NSS(3.12.9, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
4710
if test -n "$MOZ_NATIVE_NSS"; then
4711
NSS_LIBS="$NSS_LIBS -lcrmf"
4713
NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
4715
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4716
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
4717
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
4718
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
4719
\$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX)"
4721
if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "WINCE" -o "$OS_ARCH" = "OS2"; then
4723
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
4724
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(LIB_SUFFIX) \
4725
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(LIB_SUFFIX) \
4726
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(LIB_SUFFIX) \
4727
\$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(LIB_SUFFIX)"
4729
NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION"
4733
dnl ======================
4735
dnl ======================
4737
AC_MSG_CHECKING([for YASM assembler])
4738
AC_CHECK_PROGS(YASM, yasm, "")
4740
if test -n "$YASM"; then
4741
dnl Pull out yasm's version string
4743
_YASM_VER_FILTER='s|.* \([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*|\1|p'
4746
YASM_VERSION=`yasm --version | sed -ne "$_YASM_VER_FILTER"`
4747
_YASM_MAJOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $1 }'`
4748
_YASM_MINOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $2 }'`
4749
_YASM_RELEASE=` echo ${YASM_VERSION} | $AWK -F\. '{ print $3 }'`
4750
_YASM_BUILD=` echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
4753
if test -z "$SKIP_LIBRARY_CHECKS"; then
4754
dnl system JPEG support
4755
dnl ========================================================
4756
MOZ_ARG_WITH_STRING(system-jpeg,
4757
[ --with-system-jpeg[=PFX]
4758
Use system libjpeg [installed at prefix PFX]],
4761
_SAVE_CFLAGS=$CFLAGS
4762
_SAVE_LDFLAGS=$LDFLAGS
4764
if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
4765
CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
4766
LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4768
if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4771
AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [SYSTEM_JPEG=1 JPEG_LIBS="-ljpeg $JPEG_LIBS"], SYSTEM_JPEG=, $JPEG_LIBS)
4774
if test "$SYSTEM_JPEG" = 1; then
4775
LIBS="$JPEG_LIBS $LIBS"
4776
AC_TRY_COMPILE([ #include <stdio.h>
4777
#include <sys/types.h>
4778
#include <jpeglib.h> ],
4779
[ #if JPEG_LIB_VERSION < $MOZJPEG
4780
#error "Insufficient JPEG library version ($MOZJPEG required)."
4783
[SYSTEM_JPEG= JPEG_CFLAGS= JPEG_LIBS=])
4785
CFLAGS=$_SAVE_CFLAGS
4786
LDFLAGS=$_SAVE_LDFLAGS
4789
if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$SYSTEM_JPEG" = 1; then
4790
JPEG_CFLAGS="-I${JPEG_DIR}/include"
4791
JPEG_LIBS="-L${JPEG_DIR}/lib ${JPEG_LIBS}"
4794
dnl system ZLIB support
4795
dnl ========================================================
4796
MOZ_ARG_WITH_STRING(system-zlib,
4797
[ --with-system-zlib[=PFX]
4798
Use system libz [installed at prefix PFX]],
4801
_SAVE_CFLAGS=$CFLAGS
4802
_SAVE_LDFLAGS=$LDFLAGS
4804
if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
4805
CFLAGS="-I${ZLIB_DIR}/include $CFLAGS"
4806
LDFLAGS="-L${ZLIB_DIR}/lib $LDFLAGS"
4808
if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
4811
AC_CHECK_LIB(z, gzread, [SYSTEM_ZLIB=1 ZLIB_LIBS="-lz $ZLIB_LIBS"],
4812
[SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=], $ZLIB_LIBS)
4814
if test "$SYSTEM_ZLIB" = 1; then
4815
LIBS="$ZLIB_LIBS $LIBS"
4816
AC_TRY_COMPILE([ #include <stdio.h>
4818
#include <zlib.h> ],
4819
[ #if ZLIB_VERNUM < $MOZZLIB
4820
#error "Insufficient zlib version ($MOZZLIB required)."
4823
[SYSTEM_ZLIB= ZLIB_CFLAGS= ZLIB_LIBS=])
4825
CFLAGS=$_SAVE_CFLAGS
4826
LDFLAGS=$_SAVE_LDFLAGS
4829
if test "${ZLIB_DIR}" -a -d "${ZLIB_DIR}" -a "$SYSTEM_ZLIB" = 1; then
4830
ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
4831
ZLIB_LIBS="-L${ZLIB_DIR}/lib ${ZLIB_LIBS}"
4834
dnl system BZIP2 Support
4835
dnl ========================================================
4836
MOZ_ARG_WITH_STRING(system-bz2,
4837
[ --with-system-bz2[=PFX]
4838
Use system libbz2 [installed at prefix PFX]],
4841
_SAVE_CFLAGS=$CFLAGS
4842
_SAVE_LDFLAGS=$LDFLAGS
4844
if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4845
CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4846
LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4848
if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4851
AC_CHECK_LIB(bz2, BZ2_bzread, [SYSTEM_BZ2=1 BZ2_LIBS="-lbz2"],
4852
[SYSTEM_BZ2= BZ2_CFLAGS= BZ2_LIBS=])
4854
CFLAGS=$_SAVE_CFLAGS
4855
LDFLAGS=$_SAVE_LDFLAGS
4858
if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$SYSTEM_BZ2" = 1; then
4859
BZ2_CFLAGS="-I${BZ2_DIR}/include"
4860
BZ2_LIBS="-L${BZ2_DIR}/lib ${BZ2_LIBS}"
4863
dnl system PNG Support
4864
dnl ========================================================
4865
MOZ_ARG_WITH_STRING(system-png,
4866
[ --with-system-png[=PFX]
4867
Use system libpng [installed at prefix PFX]],
4870
_SAVE_CFLAGS=$CFLAGS
4871
_SAVE_LDFLAGS=$LDFLAGS
4873
CFLAGS="$ZLIB_CFLAGS $CFLAGS"
4874
LDFLAGS="$ZLIB_LIBS -lz $LDFLAGS"
4875
if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4876
CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4877
LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4879
if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4882
_SAVE_PNG_LIBS=$PNG_LIBS
4883
AC_CHECK_LIB(png, png_get_valid, [SYSTEM_PNG=1 PNG_LIBS="-lpng $PNG_LIBS"],
4884
AC_MSG_ERROR([--with-system-png requested but no working libpng found]),
4886
AC_CHECK_LIB(png, png_get_acTL, ,
4887
AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]),
4890
if test "$SYSTEM_PNG" = 1; then
4891
LIBS="$PNG_LIBS $LIBS"
4892
AC_TRY_COMPILE([ #include <stdio.h>
4893
#include <sys/types.h>
4895
[ #if PNG_LIBPNG_VER < $MOZPNG
4896
#error "Insufficient libpng version ($MOZPNG required)."
4898
#ifndef PNG_UINT_31_MAX
4899
#error "Insufficient libpng version."
4902
AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4904
CFLAGS=$_SAVE_CFLAGS
4905
LDFLAGS=$_SAVE_LDFLAGS
4908
if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$SYSTEM_PNG" = 1; then
4909
PNG_CFLAGS="-I${PNG_DIR}/include"
4910
PNG_LIBS="-L${PNG_DIR}/lib ${PNG_LIBS}"
4913
fi # SKIP_LIBRARY_CHECKS
4915
dnl system HunSpell Support
4916
dnl ========================================================
4917
MOZ_ARG_ENABLE_BOOL(system-hunspell,
4918
[ --enable-system-hunspell
4919
Use system hunspell (located with pkgconfig)],
4922
if test -n "$SYSTEM_HUNSPELL"; then
4923
PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4926
AC_SUBST(SYSTEM_HUNSPELL)
4928
dnl ========================================================
4929
dnl Java SDK support
4930
dnl ========================================================
4933
MOZ_ARG_WITH_STRING(java-bin-path,
4934
[ --with-java-bin-path=dir
4935
Location of Java binaries (java, javac, jar)],
4936
JAVA_BIN_PATH=$withval)
4938
dnl ========================================================
4942
dnl ========================================================
4944
MOZ_ARG_HEADER(Application)
4948
MOZ_ACTIVEX_SCRIPTING_SUPPORT=
4949
MOZ_BRANDING_DIRECTORY=
4950
MOZ_OFFICIAL_BRANDING=
4955
MOZ_CSS_ANIMATIONS=1
4958
MOZ_AUTH_EXTENSION=1
4959
MOZ_NO_ACTIVEX_SUPPORT=1
4978
LIBJPEG_TURBO_ASFLAGS=
4979
LIBJPEG_TURBO_X86_ASM=
4980
LIBJPEG_TURBO_X64_ASM=
4984
MOZ_PREF_EXTENSIONS=1
4985
MOZ_PROFILELOCKING=1
4998
MOZ_TOOLKIT_SEARCH=1
5000
MOZ_UNIVERSALCHARDET=1
5002
MOZ_XSLT_STANDALONE=
5008
MOZ_DISABLE_DOMCRYPTO=
5013
NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource wyciwyg"
5016
XPC_IDISPATCH_SUPPORT=
5020
*android*|*darwin*|*wince*|*winmo*)
5028
case "$target_os" in
5031
if test -z "$GNU_CC"; then
5032
if test "$MOZ_WINSDK_TARGETVER" -lt "06000000"; then
5036
if test -n "$NS_ENABLE_TSF"; then
5037
AC_DEFINE(NS_ENABLE_TSF)
5049
MOZ_THEME_FASTSTRIPE=1
5055
MOZ_ARG_ENABLE_STRING(application,
5056
[ --enable-application=APP
5060
content/xslt (Standalone Transformiix XSLT)
5061
netwerk (Standalone Necko)
5062
tools/update-packaging (AUS-related packaging tools)
5063
standalone (use this for standalone
5064
xpcom/xpconnect or to manually drive a build)],
5065
[ MOZ_BUILD_APP=$enableval ] )
5067
MOZ_ARG_WITH_STRING(xulrunner-stub-name,
5068
[ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
5069
XULRUNNER_STUB_NAME=$withval)
5071
if test -z "$XULRUNNER_STUB_NAME"; then
5072
case "$target_os" in
5074
XULRUNNER_STUB_NAME=xulrunner
5077
XULRUNNER_STUB_NAME=xulrunner-stub
5080
AC_SUBST(XULRUNNER_STUB_NAME)
5082
AC_MSG_CHECKING([for application to build])
5083
if test -z "$MOZ_BUILD_APP"; then
5084
AC_MSG_RESULT([browser])
5085
MOZ_BUILD_APP=browser
5087
# We have a valid application only if it has a build.mk file in its top
5089
if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
5090
AC_MSG_RESULT([none])
5091
AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
5093
AC_MSG_RESULT([$MOZ_BUILD_APP])
5097
# Allow the application to influence configure with a confvars.sh script.
5099
AC_MSG_CHECKING([if app-specific confvars.sh exists])
5100
if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
5101
AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
5102
. "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
5107
# Now is a good time to test for logic errors, define mismatches, etc.
5108
case "$MOZ_BUILD_APP" in
5110
if test "$LIBXUL_SDK"; then
5111
AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
5116
# Special cases where we need to AC_DEFINE something. Also a holdover for apps
5117
# that haven't made a confvars.sh yet. Don't add new stuff here, use
5119
case "$MOZ_BUILD_APP" in
5121
AC_DEFINE(MOZ_PHOENIX)
5125
AC_DEFINE(MOZ_XULRUNNER)
5133
MOZ_APP_NAME=mozilla
5134
MOZ_APP_DISPLAYNAME=Mozilla
5135
MOZ_APP_VERSION=$MOZILLA_VERSION
5140
AC_SUBST(MOZ_BUILD_APP)
5141
AC_SUBST(MOZ_PHOENIX)
5142
AC_SUBST(MOZ_XULRUNNER)
5144
AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
5146
dnl ========================================================
5148
dnl = Toolkit Options
5150
dnl ========================================================
5151
MOZ_ARG_HEADER(Toolkit Options)
5153
dnl ========================================================
5154
dnl = Select the default toolkit
5155
dnl ========================================================
5156
MOZ_ARG_ENABLE_STRING(default-toolkit,
5157
[ --enable-default-toolkit=TK
5158
Select default toolkit
5159
Platform specific defaults:
5160
Mac OS X - cairo-cocoa
5161
Neutrino/QNX - photon
5163
Win32/WinCE - cairo-windows
5164
Gtk2 with DirectFB - cairo-gtk2-dfb
5167
[ _DEFAULT_TOOLKIT=$enableval ],
5168
[ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
5170
if test "$_DEFAULT_TOOLKIT" = "photon" \
5171
-o "$_DEFAULT_TOOLKIT" = "cairo-windows" \
5172
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
5173
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-dfb" \
5174
-o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
5175
-o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
5176
-o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
5177
-o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
5178
-o "$_DEFAULT_TOOLKIT" = "cairo-android"
5180
dnl nglayout only supports building with one toolkit,
5181
dnl so ignore everything after the first comma (",").
5182
MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
5184
AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
5187
dnl ========================================================
5188
dnl = Enable the toolkit as needed =
5189
dnl ========================================================
5191
case "$MOZ_WIDGET_TOOLKIT" in
5194
AC_DEFINE(MOZ_WIDGET_PHOTON)
5198
MOZ_WIDGET_TOOLKIT=windows
5208
cairo-gtk2|cairo-gtk2-x11)
5209
MOZ_WIDGET_TOOLKIT=gtk2
5211
MOZ_ENABLE_XREMOTE=1
5219
TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
5220
TK_LIBS='$(MOZ_GTK2_LIBS)'
5221
AC_DEFINE(MOZ_WIDGET_GTK2)
5226
MOZ_WIDGET_TOOLKIT=gtk2
5233
TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
5234
TK_LIBS='$(MOZ_GTK2_LIBS)'
5235
AC_DEFINE(MOZ_WIDGET_GTK2)
5236
if test "$no_x" != "yes"; then
5237
AC_MSG_WARN([Disabling X when DirectFB is specified.])
5244
MOZ_WIDGET_TOOLKIT=qt
5246
MOZ_ENABLE_XREMOTE=1
5255
TK_CFLAGS='$(MOZ_QT_CFLAGS)'
5256
TK_LIBS='$(MOZ_QT_LIBS)'
5257
AC_DEFINE(MOZ_WIDGET_QT)
5262
MOZ_WIDGET_TOOLKIT=os2
5264
TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
5265
TK_LIBS='$(MOZ_CAIRO_LIBS)'
5270
MOZ_WIDGET_TOOLKIT=cocoa
5271
AC_DEFINE(MOZ_WIDGET_COCOA)
5272
MOZ_USER_DIR="Mozilla"
5273
AC_DEFINE(XP_MACOSX)
5274
TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
5275
TK_CFLAGS="-DNO_X11"
5276
LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
5277
CFLAGS="$CFLAGS $TK_CFLAGS"
5278
CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
5279
LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
5280
MOZ_FS_LAYOUT=bundle
5285
AC_DEFINE(MOZ_WIDGET_ANDROID)
5286
MOZ_WIDGET_TOOLKIT=android
5287
TK_CFLAGS='$(MOZ_CAIRO_CFLAGS)'
5288
TK_LIBS='$(MOZ_CAIRO_LIBS)'
5295
AC_SUBST(MOZ_PDF_PRINTING)
5296
if test "$MOZ_PDF_PRINTING"; then
5297
PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
5298
AC_DEFINE(MOZ_PDF_PRINTING)
5301
if test "$MOZ_ENABLE_XREMOTE"; then
5302
AC_DEFINE(MOZ_ENABLE_XREMOTE)
5305
if test "$COMPILE_ENVIRONMENT"; then
5306
if test "$MOZ_ENABLE_GTK2"; then
5307
if test "$MOZ_X11"; then
5308
GDK_PACKAGES=gdk-x11-2.0
5309
elif test "$MOZ_DFB"; then
5310
PKG_CHECK_MODULES(MOZ_DFB, directfb >= 1.1.0)
5311
GDK_PACKAGES=directfb
5314
PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
5317
fi # COMPILE_ENVIRONMENT
5319
AC_SUBST(MOZ_FS_LAYOUT)
5321
dnl ========================================================
5322
dnl Use ARM userspace kernel helpers; tell NSPR to enable
5323
dnl their usage and use them in spidermonkey.
5324
dnl ========================================================
5325
MOZ_ARG_WITH_BOOL(arm-kuser,
5326
[ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
5328
if test -n "$USE_ARM_KUSER"; then
5329
AC_DEFINE(USE_ARM_KUSER)
5332
dnl ========================================================
5333
dnl = startup-notification support module
5334
dnl ========================================================
5336
if test "$MOZ_ENABLE_GTK2"
5338
MOZ_ENABLE_STARTUP_NOTIFICATION=
5340
MOZ_ARG_ENABLE_BOOL(startup-notification,
5341
[ --enable-startup-notification
5342
Enable startup-notification support (default: disabled) ],
5343
MOZ_ENABLE_STARTUP_NOTIFICATION=force,
5344
MOZ_ENABLE_STARTUP_NOTIFICATION=)
5345
if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
5347
PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
5348
libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
5349
[MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
5350
if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
5352
AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
5354
MOZ_ENABLE_STARTUP_NOTIFICATION=
5358
if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
5359
AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
5362
TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
5364
AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
5365
AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
5366
AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
5368
dnl ========================================================
5370
dnl ========================================================
5371
if test "$MOZ_ENABLE_QT"
5373
MOZ_ARG_WITH_STRING(qtdir,
5374
[ --with-qtdir=\$dir Specify Qt directory ],
5377
if test -z "$QTDIR"; then
5378
PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore QtOpenGL)
5379
AC_CHECK_PROGS(HOST_MOC, $MOC moc, "")
5381
MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtDBus -lQtXml -lQtOpenGL"
5383
MOZ_QT_CFLAGS="-DQT_SHARED"
5384
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
5385
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt"
5386
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
5387
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
5388
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
5389
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDBus"
5390
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
5391
HOST_MOC="$QTDIR/bin/moc"
5393
if test -z "$HOST_MOC"; then
5394
AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is
5399
MOZ_ENABLE_QTNETWORK=
5400
PKG_CHECK_MODULES(_QTNETWORK, QtNetwork >= 4.7,
5401
MOZ_ENABLE_QTNETWORK=1,
5402
MOZ_ENABLE_QTNETWORK=)
5404
if test "$MOZ_ENABLE_QTNETWORK"; then
5405
MOZ_ENABLE_QTNETWORK=1
5406
AC_DEFINE(MOZ_ENABLE_QTNETWORK)
5409
MOZ_ENABLE_QTMOBILITY=
5410
PKG_CHECK_MODULES(_QTMOBILITY, QtSensors,
5411
MOZ_ENABLE_QTMOBILITY=1,
5412
MOZ_ENABLE_QTMOBILITY=)
5413
if test "$MOZ_ENABLE_QTMOBILITY"; then
5414
MOZ_ENABLE_QTMOBILITY=1
5415
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
5416
MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
5418
AC_CHECK_LIB(QtSensors, main, [
5419
MOZ_ENABLE_QTMOBILITY=1
5420
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtMobility"
5421
MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I/usr/include/qt4/QtSensors"
5422
MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors"
5425
if test "$MOZ_ENABLE_QTMOBILITY"; then
5426
AC_DEFINE(MOZ_ENABLE_QTMOBILITY)
5430
AC_SUBST(GTK_CONFIG)
5434
AC_SUBST(MOZ_ENABLE_GTK2)
5435
AC_SUBST(MOZ_ENABLE_PHOTON)
5436
AC_SUBST(MOZ_ENABLE_QT)
5437
AC_SUBST(MOZ_ENABLE_QTNETWORK)
5438
AC_SUBST(MOZ_ENABLE_QTMOBILITY)
5439
AC_SUBST(MOZ_ENABLE_XREMOTE)
5440
AC_SUBST(MOZ_GTK2_CFLAGS)
5441
AC_SUBST(MOZ_GTK2_LIBS)
5442
AC_SUBST(MOZ_QT_CFLAGS)
5443
AC_SUBST(MOZ_QT_LIBS)
5450
dnl ========================================================
5452
dnl = Components & Features
5454
dnl ========================================================
5455
MOZ_ARG_HEADER(Components and Features)
5457
dnl ========================================================
5459
dnl ========================================================
5460
MOZ_ARG_ENABLE_STRING(ui-locale,
5461
[ --enable-ui-locale=ab-CD
5462
Select the user interface locale (default: en-US)],
5463
MOZ_UI_LOCALE=$enableval )
5464
AC_SUBST(MOZ_UI_LOCALE)
5466
dnl ========================================================
5467
dnl = Trademarked Branding
5468
dnl ========================================================
5469
MOZ_ARG_ENABLE_BOOL(official-branding,
5470
[ --enable-official-branding
5471
Enable Official mozilla.org Branding
5472
Do not distribute builds with
5473
--enable-official-branding unless you have
5474
permission to use trademarks per
5475
http://www.mozilla.org/foundation/trademarks/ .],
5477
if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
5478
AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
5480
MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
5481
MOZ_OFFICIAL_BRANDING=1
5483
], MOZ_OFFICIAL_BRANDING=)
5485
AC_SUBST(MOZ_OFFICIAL_BRANDING)
5486
if test -n "$MOZ_OFFICIAL_BRANDING"; then
5487
AC_DEFINE(MOZ_OFFICIAL_BRANDING)
5490
MOZ_ARG_WITH_STRING(branding,
5491
[ --with-branding=dir Use branding from the specified directory.],
5492
MOZ_BRANDING_DIRECTORY=$withval)
5494
REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
5495
if test -z "$REAL_BRANDING_DIRECTORY"; then
5496
REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
5499
if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
5500
. "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
5503
AC_SUBST(MOZ_BRANDING_DIRECTORY)
5505
dnl ========================================================
5506
dnl = Distribution ID
5507
dnl ========================================================
5508
MOZ_ARG_WITH_STRING(distribution-id,
5509
[ --with-distribution-id=ID
5510
Set distribution-specific id (default=org.mozilla)],
5511
[ val=`echo $withval`
5512
MOZ_DISTRIBUTION_ID="$val"])
5514
if test -z "$MOZ_DISTRIBUTION_ID"; then
5515
MOZ_DISTRIBUTION_ID="org.mozilla"
5518
AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
5519
AC_SUBST(MOZ_DISTRIBUTION_ID)
5522
dnl ========================================================
5523
dnl complex text support off by default
5524
dnl ========================================================
5525
MOZ_ARG_DISABLE_BOOL(pango,
5526
[ --disable-pango Disable usage of Pango ],
5530
dnl ========================================================
5532
dnl ========================================================
5533
if test "$MOZ_ENABLE_GTK2"
5537
PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
5539
PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION)
5540
AC_SUBST(MOZ_PANGO_CFLAGS)
5541
AC_SUBST(MOZ_PANGO_LIBS)
5542
if test "$MOZ_PANGO"
5544
AC_DEFINE(MOZ_PANGO)
5546
PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0 fontconfig)
5547
AC_SUBST(FT2_CFLAGS)
5552
if test "$MOZ_ENABLE_QT"
5554
if test "$MOZ_PANGO"
5556
PKG_CHECK_MODULES(MOZ_PANGO, [pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION],
5558
AC_SUBST(MOZ_PANGO_CFLAGS)
5559
AC_SUBST(MOZ_PANGO_LIBS)
5560
AC_DEFINE(MOZ_PANGO)
5563
echo "Pango library not found, will use FT2 font engine"
5570
dnl ========================================================
5571
dnl = GnomeVFS, GIO and GConf support module
5572
dnl ========================================================
5576
dnl build the gnomevfs extension by default only when the
5577
dnl GTK2 toolkit is in use.
5578
if test "$MOZ_ENABLE_GTK2"
5580
MOZ_ENABLE_GNOMEVFS=1
5584
dnl ========================================================
5585
dnl = GnomeVFS support module
5586
dnl ========================================================
5587
MOZ_ARG_DISABLE_BOOL(gnomevfs,
5588
[ --disable-gnomevfs Disable GnomeVFS support ],
5589
MOZ_ENABLE_GNOMEVFS=,
5590
MOZ_ENABLE_GNOMEVFS=force)
5592
if test "$MOZ_ENABLE_GNOMEVFS"
5594
PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5595
MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5596
MOZ_ENABLE_GNOMEVFS=1
5597
AC_DEFINE(MOZ_ENABLE_GNOMEVFS)
5599
if test "$MOZ_ENABLE_GNOMEVFS" = "force"
5601
AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
5603
MOZ_ENABLE_GNOMEVFS=
5606
if test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5607
PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
5608
MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
5613
AC_SUBST(MOZ_ENABLE_GNOMEVFS)
5614
AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
5615
AC_SUBST(MOZ_GNOMEVFS_LIBS)
5617
dnl ========================================================
5618
dnl = GIO support module
5619
dnl ========================================================
5620
MOZ_ARG_ENABLE_BOOL(gio,
5621
[ --enable-gio Enable GIO support (default: disabled)],
5622
MOZ_ENABLE_GIO=force,
5625
if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK2"
5627
PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[
5628
MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
5630
AC_DEFINE(MOZ_ENABLE_GIO)
5632
if test "$MOZ_ENABLE_GIO" = "force"
5634
AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION])
5640
AC_SUBST(MOZ_ENABLE_GIO)
5641
AC_SUBST(MOZ_GIO_CFLAGS)
5642
AC_SUBST(MOZ_GIO_LIBS)
5644
dnl ========================================================
5645
dnl = GConf support module
5646
dnl ========================================================
5647
MOZ_ARG_DISABLE_BOOL(gconf,
5648
[ --disable-gconf Disable Gconf support ],
5650
MOZ_ENABLE_GCONF=force)
5652
if test "$MOZ_ENABLE_GCONF"
5654
PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
5655
MOZ_GCONF_LIBS=`echo $MOZ_GCONF_LIBS | sed 's/-llinc\>//'`
5658
if test "$MOZ_ENABLE_GCONF" = "force"
5660
AC_MSG_ERROR([* * * Could not find gconf-2.0 ])
5666
if test "$MOZ_ENABLE_GCONF"; then
5667
AC_DEFINE(MOZ_ENABLE_GCONF)
5670
AC_SUBST(MOZ_ENABLE_GCONF)
5671
AC_SUBST(MOZ_GCONF_CFLAGS)
5672
AC_SUBST(MOZ_GCONF_LIBS)
5675
dnl ========================================================
5676
dnl = libproxy support
5677
dnl ========================================================
5679
if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
5681
MOZ_ENABLE_LIBPROXY=
5683
MOZ_ARG_ENABLE_BOOL(libproxy,
5684
[ --enable-libproxy Enable libproxy support ],
5685
MOZ_ENABLE_LIBPROXY=1,
5686
MOZ_ENABLE_LIBPROXY=)
5688
if test "$MOZ_ENABLE_LIBPROXY"
5690
PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
5691
AC_DEFINE(MOZ_ENABLE_LIBPROXY)
5694
AC_SUBST(MOZ_ENABLE_LIBPROXY)
5695
AC_SUBST(MOZ_LIBPROXY_CFLAGS)
5696
AC_SUBST(MOZ_LIBPROXY_LIBS)
5698
dnl ========================================================
5699
dnl = libnotify support
5700
dnl ========================================================
5702
if test "$MOZ_ENABLE_GTK2"
5704
MOZ_ENABLE_LIBNOTIFY=1
5706
MOZ_ARG_DISABLE_BOOL(libnotify,
5707
[ --disable-libnotify Disable libnotify support ],
5708
MOZ_ENABLE_LIBNOTIFY=,
5709
MOZ_ENABLE_LIBNOTIFY=1)
5711
if test "$MOZ_ENABLE_LIBNOTIFY"
5713
AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
5717
if test -z "$SKIP_LIBRARY_CHECKS"
5719
if test "$MOZ_ENABLE_GTK2"
5721
if test "$MOZ_ENABLE_LIBNOTIFY"
5723
PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
5727
AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
5728
AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
5729
AC_SUBST(MOZ_LIBNOTIFY_LIBS)
5731
dnl ========================================================
5732
dnl = GNOME component (mozgnome)
5733
dnl ========================================================
5735
# The GNOME component is built if one of
5736
# gnome-vfs, gio, gconf or libnotify is available.
5737
if test "$MOZ_ENABLE_GCONF" -o \
5738
"$MOZ_ENABLE_GNOMEVFS" -o \
5739
"$MOZ_ENABLE_GIO" -o \
5740
"$MOZ_ENABLE_LIBNOTIFY"; then
5741
MOZ_ENABLE_GNOME_COMPONENT=1
5743
MOZ_ENABLE_GNOME_COMPONENT=
5745
AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
5747
dnl ========================================================
5748
dnl = libgnomeui support module
5749
dnl ========================================================
5751
if test "$MOZ_ENABLE_GTK2"
5753
MOZ_ENABLE_GNOMEUI=1
5755
MOZ_ARG_DISABLE_BOOL(gnomeui,
5756
[ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
5757
MOZ_ENABLE_GNOMEUI=,
5758
MOZ_ENABLE_GNOMEUI=force)
5760
if test "$MOZ_ENABLE_GNOMEUI"
5762
PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
5764
MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
5765
MOZ_ENABLE_GNOMEUI=1
5767
if test "$MOZ_ENABLE_GNOMEUI" = "force"
5769
AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5775
if test "$MOZ_ENABLE_GNOMEUI"; then
5776
AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5780
AC_SUBST(MOZ_ENABLE_GNOMEUI)
5781
AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5782
AC_SUBST(MOZ_GNOMEUI_LIBS)
5784
dnl ========================================================
5786
dnl ========================================================
5788
if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
5792
MOZ_ARG_DISABLE_BOOL(dbus,
5793
[ --disable-dbus Disable dbus support ],
5797
if test "$MOZ_ENABLE_DBUS"
5799
PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION)
5800
PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5801
AC_DEFINE(MOZ_ENABLE_DBUS)
5804
AC_SUBST(MOZ_ENABLE_DBUS)
5805
AC_SUBST(MOZ_DBUS_CFLAGS)
5806
AC_SUBST(MOZ_DBUS_LIBS)
5807
AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5808
AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5810
dnl ========================================================
5811
dnl = Build Personal Security Manager
5812
dnl ========================================================
5813
MOZ_ARG_DISABLE_BOOL(crypto,
5814
[ --disable-crypto Disable crypto support (Personal Security Manager)],
5818
dnl ========================================================
5819
dnl = JS Debugger XPCOM component (js/jsd)
5820
dnl ========================================================
5821
MOZ_ARG_DISABLE_BOOL(jsd,
5822
[ --disable-jsd Disable JavaScript debug library],
5827
dnl ========================================================
5828
dnl = Enable IPDL's "expensive" unit tests
5829
dnl ========================================================
5832
MOZ_ARG_ENABLE_BOOL(ipdl-tests,
5833
[ --enable-ipdl-tests Enable expensive IPDL tests],
5837
if test -n "$MOZ_IPDL_TESTS"; then
5838
AC_DEFINE(MOZ_IPDL_TESTS)
5841
AC_SUBST(MOZ_IPDL_TESTS)
5843
dnl ========================================================
5844
dnl = Disable building dbm
5845
dnl ========================================================
5846
MOZ_ARG_DISABLE_BOOL(dbm,
5847
[ --disable-dbm Disable building dbm],
5851
dnl bi-directional support always on
5855
dnl ========================================================
5856
dnl accessibility support on by default on all platforms
5858
dnl ========================================================
5859
MOZ_ARG_DISABLE_BOOL(accessibility,
5860
[ --disable-accessibility Disable accessibility support (off by default on OS X)],
5863
if test "$ACCESSIBILITY"; then
5864
AC_DEFINE(ACCESSIBILITY)
5867
if test -n "$ACCESSIBILITY" -a "$COMPILE_ENVIRONMENT" = "1"; then
5870
if test "$ac_cv_header_atlbase_h" = "no"; then
5871
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.])
5873
if test "$ac_cv_header_oleacc_idl" = "no"; then
5874
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.])
5880
dnl ========================================================
5881
dnl Disable printing
5882
dnl ========================================================
5883
MOZ_ARG_DISABLE_BOOL(printing,
5884
[ --disable-printing Disable printing support],
5888
if test "$NS_PRINTING"; then
5889
AC_DEFINE(NS_PRINTING)
5890
AC_DEFINE(NS_PRINT_PREVIEW)
5893
dnl ========================================================
5894
dnl = Disable Fast Load
5895
dnl ========================================================
5896
MOZ_ARG_DISABLE_BOOL(xpcom-fastload,
5897
[ --disable-xpcom-fastload
5898
Disable XPCOM fastload support],
5902
AC_SUBST(MOZ_NO_FAST_LOAD)
5904
if test -n "$MOZ_NO_FAST_LOAD"; then
5905
AC_DEFINE(MOZ_NO_FAST_LOAD)
5908
dnl ========================================================
5909
dnl = Enable Raw Codecs
5910
dnl ========================================================
5911
MOZ_ARG_ENABLE_BOOL(raw,
5912
[ --enable-raw Enable support for RAW media],
5916
if test -n "$MOZ_RAW"; then
5923
dnl ========================================================
5924
dnl = Disable Ogg Codecs
5925
dnl ========================================================
5926
MOZ_ARG_DISABLE_BOOL(ogg,
5927
[ --disable-ogg Disable support for OGG media (Theora video and Vorbis audio)],
5931
if test -n "$MOZ_OGG"; then
5935
case "$target_cpu" in
5944
dnl Checks for __attribute__(aligned()) directive
5945
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5946
[ac_cv_c_attribute_aligned],
5947
[ac_cv_c_attribute_aligned=0
5948
CFLAGS_save="${CFLAGS}"
5949
CFLAGS="${CFLAGS} -Werror"
5950
for ac_cv_c_attr_align_try in 64 32 16 8; do
5951
echo "trying $ac_cv_c_attr_align_try"
5953
[static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5954
[ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5955
if test "$ac_cv_c_attribute_aligned" != 0; then
5959
CFLAGS="${CFLAGS_save}"])
5960
if test "${ac_cv_c_attribute_aligned}" != "0"; then
5961
AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5962
[${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5966
dnl ========================================================
5967
dnl = Disable VP8 decoder support
5968
dnl ========================================================
5969
MOZ_ARG_DISABLE_BOOL(webm,
5970
[ --disable-webm Disable support for WebM media (VP8 video and Vorbis audio)],
5974
dnl system libvpx Support
5975
dnl ========================================================
5976
MOZ_ARG_WITH_STRING(system-libvpx,
5977
[ --with-system-libvpx=[PFX]
5978
Use system libvpx [installed at prefix PFX]],
5979
LIBVPX_DIR=$withval)
5982
MOZ_LIBVPX_INCLUDES=
5985
if test -n "$MOZ_WEBM"; then
5988
if test -n "$LIBVPX_DIR" -a "$LIBVPX_DIR" != no; then
5989
_SAVE_CFLAGS=$CFLAGS
5990
_SAVE_LDFLAGS=$LDFLAGS
5992
if test "${LIBVPX_DIR}" = "yes"; then
5995
CFLAGS="-I${LIBVPX_DIR}/include $CFLAGS"
5996
LDFLAGS="-L${LIBVPX_DIR}/lib $LDFLAGS"
5997
MOZ_CHECK_HEADER(vpx/vpx_decoder.h,
5998
[if test ! -f "${LIBVPX_DIR}/include/vpx/vpx_decoder.h"; then
5999
AC_MSG_ERROR([vpx/vpx_decoder.h found, but is not in ${LIBVPX_DIR}/include])
6001
AC_MSG_ERROR([--with-system-libvpx requested but vpx/vpx_decoder.h not found]))
6002
AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver,
6003
[MOZ_NATIVE_LIBVPX=1
6004
MOZ_LIBVPX_INCLUDES="-I${LIBVPX_DIR}/include"
6005
MOZ_LIBVPX_LIBS="-L${LIBVPX_DIR}/lib -lvpx"],
6006
([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found]))
6007
CFLAGS=$_SAVE_CFLAGS
6008
LDFLAGS=$_SAVE_LDFLAGS
6013
AC_SUBST(MOZ_NATIVE_LIBVPX)
6014
AC_SUBST(MOZ_LIBVPX_INCLUDES)
6015
AC_SUBST(MOZ_LIBVPX_LIBS)
6017
if test -n "$MOZ_WEBM" -a -z "$MOZ_NATIVE_LIBVPX"; then
6020
case "$target_cpu" in
6030
dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
6031
dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
6032
dnl We currently require gcc on all arm platforms.
6036
dnl See if we have assembly on this platform.
6037
case "$OS_ARCH:$CPU_ARCH" in
6039
VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
6043
VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
6047
VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
6051
VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
6055
VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
6059
VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC"
6063
if test -z "$GNU_CC"; then
6064
VPX_ASFLAGS="-f x64 -rnasm -pnasm"
6069
if test -z "$GNU_CC"; then
6070
dnl Check for yasm 1.1 or greater.
6071
if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then
6072
AC_MSG_ERROR([yasm 1.1 or greater is required to build libvpx on Win32, but it appears not to be installed. Install it (included in MozillaBuild 1.5.1 and newer) or configure with --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
6073
elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
6074
AC_MSG_ERROR([yasm 1.1 or greater is required to build libvpx on Win32, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION. Upgrade to the newest version (included in MozillaBuild 1.5.1 and newer) or configure with --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
6076
VPX_ASFLAGS="-f win32 -rnasm -pnasm -DPIC"
6082
if test -n "$GNU_AS" ; then
6084
dnl These flags are a lie; they're just used to enable the requisite
6085
dnl opcodes; actual arch detection is done at runtime.
6086
VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
6087
VPX_DASH_C_FLAG="-c"
6088
VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
6089
VPX_ASM_SUFFIX="$ASM_SUFFIX"
6094
if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then
6095
AC_MSG_ERROR([yasm is a required build tool for this architecture when webm is enabled. You may either install yasm or --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.])
6098
if test -n "$VPX_X86_ASM"; then
6099
AC_DEFINE(VPX_X86_ASM)
6100
elif test -n "$VPX_ARM_ASM"; then
6101
AC_DEFINE(VPX_ARM_ASM)
6103
AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.])
6107
dnl ========================================================
6108
dnl = Disable Wave decoder support
6109
dnl ========================================================
6110
MOZ_ARG_DISABLE_BOOL(wave,
6111
[ --disable-wave Disable Wave decoder support],
6115
if test -n "$MOZ_WAVE"; then
6121
dnl ========================================================
6122
dnl = Handle dependent SYDNEYAUDIO and MEDIA defines
6123
dnl ========================================================
6125
if test -n "$MOZ_SYDNEYAUDIO"; then
6126
AC_DEFINE(MOZ_SYDNEYAUDIO)
6129
if test -n "$MOZ_MEDIA"; then
6130
AC_DEFINE(MOZ_MEDIA)
6133
if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
6134
AC_MSG_ERROR([MOZ_VORBIS and MOZ_TREMOR are mutually exclusive! The build system should not allow them both to be set, but they are. Please file a bug at https://bugzilla.mozilla.org/])
6137
if test -n "$MOZ_VORBIS"; then
6138
AC_DEFINE(MOZ_VORBIS)
6141
if test -n "$MOZ_TREMOR"; then
6142
AC_DEFINE(MOZ_TREMOR)
6145
dnl ========================================================
6146
dnl = Check alsa availability on Linux if using sydneyaudio
6147
dnl ========================================================
6149
dnl If using sydneyaudio with Linux, ensure that the alsa library is available
6150
if test -n "$MOZ_SYDNEYAUDIO"; then
6151
case "$target_os" in
6153
PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
6154
[echo "$MOZ_ALSA_PKG_ERRORS"
6155
AC_MSG_ERROR([Need alsa for Ogg, Wave or WebM decoding on Linux. Disable with --disable-ogg --disable-wave --disable-webm. (On Ubuntu, you might try installing the package libasound2-dev.)])])
6160
dnl ========================================================
6162
dnl ========================================================
6163
AC_ARG_ENABLE(splashscreen,
6164
[ --enable-splashscreen display splashscreen while loading (default=no)],
6165
[enable_splash="yes"],[enable_splash=""])
6166
if test "x$enable_splash" = "xyes"; then
6168
AC_DEFINE(MOZ_SPLASHSCREEN)
6170
AC_SUBST(MOZ_SPLASHSCREEN)
6172
dnl ========================================================
6173
dnl Permissions System
6174
dnl ========================================================
6175
MOZ_ARG_DISABLE_BOOL(permissions,
6176
[ --disable-permissions Disable permissions (popup and cookie blocking)],
6181
dnl ========================================================
6183
dnl ========================================================
6184
MOZ_ARG_DISABLE_BOOL(negotiateauth,
6185
[ --disable-negotiateauth Disable GSS-API negotiation ],
6186
MOZ_AUTH_EXTENSION=,
6187
MOZ_AUTH_EXTENSION=1 )
6189
dnl ========================================================
6191
dnl ========================================================
6192
MOZ_ARG_DISABLE_BOOL(xtf,
6193
[ --disable-xtf Disable XTF (pluggable xml tags) support],
6196
if test "$MOZ_XTF"; then
6200
dnl ========================================================
6201
dnl Pref extensions (autoconfig and system-pref)
6202
dnl ========================================================
6203
MOZ_ARG_DISABLE_BOOL(pref-extensions,
6204
[ --disable-pref-extensions
6205
Disable pref extensions such as autoconfig and
6207
MOZ_PREF_EXTENSIONS=,
6208
MOZ_PREF_EXTENSIONS=1 )
6210
dnl ========================================================
6211
dnl = Universalchardet
6212
dnl ========================================================
6213
MOZ_ARG_DISABLE_BOOL(universalchardet,
6214
[ --disable-universalchardet
6215
Disable universal encoding detection],
6216
MOZ_UNIVERSALCHARDET=,
6217
MOZ_UNIVERSALCHARDET=1 )
6219
if test -n "${JAVA_BIN_PATH}"; then
6220
dnl Look for javac and jar in the specified path.
6221
JAVA_PATH="$JAVA_BIN_PATH"
6223
dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
6224
JAVA_PATH="$JAVA_HOME/bin:$PATH"
6227
MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
6228
MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
6229
MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
6231
if test -n "${JAVA_BIN_PATH}" -o "$OS_TARGET" = Android; then
6232
if test -z "$JAVA" -o "$JAVA" = ":" -o -z "$JAVAC" -o "$JAVAC" = ":" -o -z "$JAR" -o "$JAR" = ":"; then
6233
AC_MSG_ERROR([The programs java, javac and jar were not found. Set \$JAVA_HOME to your java sdk directory or use --with-java-bin-path={java-bin-dir}])
6237
dnl ========================================================
6238
dnl = ANGLE OpenGL->D3D translator for WebGL
6239
dnl = * only applies to win32
6240
dnl = * enabled by default (shipping build); requires explicit --disable to disable
6241
dnl ========================================================
6243
MOZ_DIRECTX_SDK_PATH=
6244
MOZ_DIRECTX_SDK_CPU_SUFFIX=
6247
MOZ_D3DCOMPILER_CAB=
6249
MOZ_D3DCOMPILER_DLL=
6250
case "$target_os" in
6256
# The DirectX SDK libraries are split into x86 and x64 sub-directories
6257
case "${target_cpu}" in
6259
MOZ_DIRECTX_SDK_CPU_SUFFIX=x86
6262
MOZ_DIRECTX_SDK_CPU_SUFFIX=x64
6263
# currently we disable ANGLE in 64bit builds
6268
if test -n "$MOZ_ANGLE"; then
6269
MOZ_ARG_DISABLE_BOOL(angle,
6270
[ --disable-angle Disable building of ANGLE for WebGL->D3D translation],
6274
if test -n "$MOZ_ANGLE"; then
6275
if test -z "$_WIN32_MSVC"; then
6276
AC_MSG_ERROR([Building ANGLE requires MSVC. To build without ANGLE, reconfigure with --disable-angle.])
6279
# Get the SDK path from the registry.
6280
MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
6281
MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's, *, ,g' | cut -d' ' -f4-`
6285
if test -n "$MOZ_DIRECTX_SDK_PATH" ; then
6286
if test -f "$MOZ_DIRECTX_SDK_PATH"/include/d3dx9.h && test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
6287
AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH])
6292
if test -z "$MOZ_ANGLE" ; then
6293
AC_MSG_WARN([Couldn't find the DirectX SDK, needed for ANGLE. Please install it (February 2010 or newer). To explicitly build without ANGLE, reconfigure with --disable-angle.])
6294
AC_MSG_WARN([This will become an error in the future.])
6297
if test -n "$MOZ_ANGLE" ; then
6298
# Get the SDK numeric version (e.g. 42 or 43) by looking at the dependencies of d3dx9.lib
6299
MOZ_D3DX9_VERSION=`dumpbin //headers "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/d3dx9.lib | egrep d3dx9_[[0-9]][[0-9]]\.dll | head -n1 | sed 's/.*\([[0-9]][[0-9]]\).*/\\1/g'`
6301
if test -z "$MOZ_D3DX9_VERSION" ; then
6303
AC_MSG_WARN([Couldn't determine the D3DX9 version! Disabling ANGLE.])
6304
AC_MSG_WARN([This will become an error in the future.])
6307
if test -n "$MOZ_ANGLE" ; then
6308
MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
6309
MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
6311
MOZ_D3DX9_DLL=d3dx9_$MOZ_D3DX9_VERSION.dll
6312
MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll
6318
dnl ========================================================
6319
dnl = Breakpad crash reporting (on by default on supported platforms)
6320
dnl ========================================================
6323
i?86-*-mingw*|x86_64-*-mingw*)
6326
i?86-apple-darwin*|powerpc-apple-darwin*|x86_64-apple-darwin*)
6329
i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
6330
if test "$MOZ_ENABLE_GTK2"; then
6342
MOZ_ARG_DISABLE_BOOL(crashreporter,
6343
[ --disable-crashreporter Disable breakpad crash reporting],
6345
MOZ_CRASHREPORTER=1)
6347
if test -n "$MOZ_CRASHREPORTER"; then
6348
AC_DEFINE(MOZ_CRASHREPORTER)
6350
if (test "$OS_TARGET" = "Linux" -o "$OS_ARCH" = "SunOS") && \
6351
test -z "$SKIP_LIBRARY_CHECKS"; then
6352
PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
6353
AC_SUBST(MOZ_GTHREAD_CFLAGS)
6354
AC_SUBST(MOZ_GTHREAD_LIBS)
6356
MOZ_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.])])
6360
MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
6361
[ --with-crashreporter-enable-percent=NN
6362
Enable sending crash reports by default on NN% of users. (default=100)],
6363
[ val=`echo $withval | sed 's/[^0-9]//g'`
6364
MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
6366
if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
6367
MOZ_CRASHREPORTER_ENABLE_PERCENT=100
6369
AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
6371
dnl ========================================================
6372
dnl = libjpeg-turbo configuration
6373
dnl ========================================================
6375
MOZ_ARG_DISABLE_BOOL(libjpeg_turbo,
6376
[ --disable-libjpeg-turbo Disable optimized jpeg decoding routines],
6378
MOZ_LIBJPEG_TURBO=1)
6380
dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
6383
if test -n "$MOZ_LIBJPEG_TURBO"; then
6385
dnl Do we support libjpeg-turbo on this platform?
6386
case "$OS_ARCH:$OS_TEST" in
6387
Linux:x86|Linux:i?86)
6388
LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
6389
LIBJPEG_TURBO_X86_ASM=1
6392
LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
6393
LIBJPEG_TURBO_X64_ASM=1
6396
LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
6397
LIBJPEG_TURBO_X86_ASM=1
6400
LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
6401
LIBJPEG_TURBO_X64_ASM=1
6404
LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
6405
LIBJPEG_TURBO_X86_ASM=1
6408
LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
6409
LIBJPEG_TURBO_X64_ASM=1
6411
WINNT:x86|WINNT:i?86)
6412
LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
6413
LIBJPEG_TURBO_X86_ASM=1
6416
LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
6417
LIBJPEG_TURBO_X64_ASM=1
6423
dnl If we're on a system which supports libjpeg-turbo's asm routines and
6424
dnl --disable-libjpeg-turbo wasn't passed, check for yasm, and error out if it
6425
dnl doesn't exist or we have too old of a version.
6426
if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
6427
AC_MSG_CHECKING([for YASM assembler])
6428
AC_CHECK_PROGS(LIBJPEG_TURBO_AS, yasm, "")
6430
if test -z "$LIBJPEG_TURBO_AS" ; then
6431
AC_MSG_ERROR([yasm is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you do not appear to have yasm installed. Either install it or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder. See https://developer.mozilla.org/en/YASM for more details.])
6434
dnl Check that we have the right yasm version. We require 1.0.1 or newer
6435
dnl on Linux and 1.1 or newer everywhere else.
6436
if test "$OS_ARCH" = "Linux" ; then
6437
if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -eq "0" -a "$_YASM_RELEASE" -lt "1" \) ; then
6438
AC_MSG_ERROR([yasm 1.0.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION.$_YASM_MINOR_VERSION. Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder. See https://developer.mozilla.org/en/YASM for more details.])
6441
if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
6442
AC_MSG_ERROR([yasm 1.1 or greater is required to build with libjpeg-turbo's optimized JPEG decoding routines, but you appear to have version $_YASM_MAJOR_VERSION.$_YASM_MINOR_VERSION. Upgrade to the newest version or configure with --disable-libjpeg-turbo to use the pure C JPEG decoder. See https://developer.mozilla.org/en/YASM for more details.])
6447
if test -n "$LIBJPEG_TURBO_X86_ASM"; then
6448
AC_DEFINE(LIBJPEG_TURBO_X86_ASM)
6449
elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
6450
AC_DEFINE(LIBJPEG_TURBO_X64_ASM)
6451
elif test -n "$MOZ_LIBJPEG_TURBO"; then
6452
dnl Warn if we're not building the optimized routines, even though the user
6453
dnl didn't specify --disable-libjpeg-turbo.
6454
AC_MSG_WARN([No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.])
6457
dnl ========================================================
6458
dnl = Enable compilation of specific extension modules
6459
dnl ========================================================
6461
MOZ_ARG_ENABLE_STRING(extensions,
6462
[ --enable-extensions Enable extensions],
6463
[ for option in `echo $enableval | sed 's/,/ /g'`; do
6464
if test "$option" = "yes" -o "$option" = "all"; then
6465
AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
6466
elif test "$option" = "no" -o "$option" = "none"; then
6468
elif test "$option" = "default"; then
6469
MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
6470
elif test `echo "$option" | grep -c \^-` != 0; then
6471
option=`echo $option | sed 's/^-//'`
6472
MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
6474
MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
6477
MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
6479
if test -z "$MOZ_ENABLE_GNOMEVFS" -a -z "$MOZ_GNOMEVFS_LIBS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
6480
# Suppress warning on non-X11 platforms
6481
if test -n "$MOZ_X11"; then
6482
AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
6484
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
6487
dnl Do not build gnomevfs with libxul based apps
6488
if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
6489
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
6492
if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
6493
# Suppress warning on non-X11 platforms
6494
if test -n "$MOZ_X11"; then
6495
AC_MSG_WARN([Cannot build gio without required libraries. Removing gio from MOZ_EXTENSIONS.])
6497
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
6500
dnl Do not build gio with libxul based apps
6501
if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
6502
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
6505
if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
6506
AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
6507
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
6510
dnl xforms requires xtf
6511
if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
6512
AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
6513
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
6517
MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
6519
dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
6520
dnl when trying to build a nonexistent extension.
6521
for extension in $MOZ_EXTENSIONS; do
6522
if test ! -d "${srcdir}/extensions/${extension}"; then
6523
AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
6527
dnl ========================================================
6528
dnl MathML on by default
6529
dnl ========================================================
6530
MOZ_ARG_DISABLE_BOOL(mathml,
6531
[ --disable-mathml Disable MathML support],
6534
if test "$MOZ_MATHML"; then
6535
AC_DEFINE(MOZ_MATHML)
6538
AC_DEFINE(MOZ_CSS_ANIMATIONS)
6540
dnl ========================================================
6541
dnl Keeping AC_DEFINE(MOZ_SVG) for the moment in case of something needs it.
6542
dnl ========================================================
6545
dnl ========================================================
6547
dnl ========================================================
6549
MOZ_ARG_DISABLE_BOOL(smil,
6550
[ --disable-smil Disable SMIL animation support],
6553
if test -n "$MOZ_SMIL"; then
6557
dnl ========================================================
6558
dnl Build Freetype in the tree
6559
dnl ========================================================
6560
MOZ_ARG_ENABLE_BOOL(tree-freetype,
6561
[ --enable-tree-freetype Enable Tree FreeType],
6562
MOZ_TREE_FREETYPE=1,
6563
MOZ_TREE_FREETYPE= )
6564
if test -n "$MOZ_TREE_FREETYPE"; then
6565
if test -n "$_WIN32_MSVC"; then
6566
AC_ERROR("building with in-tree freetype is not supported on MSVC")
6568
AC_DEFINE(MOZ_TREE_FREETYPE)
6569
AC_SUBST(MOZ_TREE_FREETYPE)
6570
MOZ_ENABLE_CAIRO_FT=1
6571
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6572
FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6573
CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6574
FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6575
CAIRO_FT_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6576
AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
6577
AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
6578
AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
6579
AC_SUBST(CAIRO_FT_CFLAGS)
6582
dnl ========================================================
6584
dnl ========================================================
6585
case "$target_os" in
6586
aix*|solaris*|linux*|mingw*|os2*|wince*|winmo*)
6591
MOZ_ARG_DISABLE_BOOL(installer,
6592
[ --disable-installer Disable building of installer],
6595
if test -n "$MOZ_INSTALLER" -a "$OS_ARCH" = "WINNT"; then
6596
# Disable installer for Windows builds that use the new toolkit if the
6597
# required major version and minimum minor version of Unicode NSIS isn't in
6599
REQ_NSIS_MAJOR_VER=2
6600
MIN_NSIS_MINOR_VER=33
6601
MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensisu-2.46 makensisu makensis)
6602
if test -z "$MAKENSISU" -o "$MAKENSISU" = ":"; then
6603
AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path. To build without the installer reconfigure using --disable-installer.])
6606
MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\)\-Unicode$/\1/g'`
6608
if test ! "$MAKENSISU_VER" = ""; then
6609
MAKENSISU_MAJOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $1 }'`
6610
MAKENSISU_MINOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $2 }'`
6612
AC_MSG_CHECKING([for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER])
6613
if test "$MAKENSISU_VER" = "" ||
6614
test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \
6615
! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then
6617
AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path. To build without the installer reconfigure using --disable-installer.])
6619
AC_MSG_RESULT([yes])
6622
AC_SUBST(MOZ_INSTALLER)
6624
AC_MSG_CHECKING([for tar archiver])
6625
AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6626
if test -z "$TAR"; then
6627
AC_MSG_ERROR([no tar archiver found in \$PATH])
6629
AC_MSG_RESULT([$TAR])
6632
AC_MSG_CHECKING([for wget])
6633
AC_CHECK_PROGS(WGET, wget, "")
6634
AC_MSG_RESULT([$WGET])
6637
dnl ========================================================
6639
dnl ========================================================
6641
MOZ_ARG_DISABLE_BOOL(updater,
6642
[ --disable-updater Disable building of updater],
6646
if test -n "$MOZ_UPDATER"; then
6647
AC_DEFINE(MOZ_UPDATER)
6650
# app update channel is 'default' when not supplied.
6651
MOZ_ARG_ENABLE_STRING([update-channel],
6652
[ --enable-update-channel=CHANNEL
6653
Select application update channel (default=default)],
6654
MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6656
if test -z "$MOZ_UPDATE_CHANNEL"; then
6657
MOZ_UPDATE_CHANNEL=default
6659
AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6660
AC_SUBST(MOZ_UPDATE_CHANNEL)
6662
# tools/update-packaging is not checked out by default.
6663
MOZ_ARG_ENABLE_BOOL(update-packaging,
6664
[ --enable-update-packaging
6665
Enable tools/update-packaging],
6666
MOZ_UPDATE_PACKAGING=1,
6667
MOZ_UPDATE_PACKAGING= )
6668
AC_SUBST(MOZ_UPDATE_PACKAGING)
6670
dnl ========================================================
6672
dnl ========================================================
6674
MOZ_ARG_DISABLE_BOOL(xpconnect-idispatch,
6675
[ --disable-xpconnect-idispatch
6676
Disable building of xpconnect support for IDispatch
6678
XPC_IDISPATCH_SUPPORT=,
6679
XPC_IDISPATCH_SUPPORT=1)
6680
AC_SUBST(XPC_IDISPATCH_SUPPORT)
6682
MOZ_ARG_DISABLE_BOOL(activex,
6683
[ --disable-activex Disable building of ActiveX control (win32 only)],
6684
MOZ_NO_ACTIVEX_SUPPORT=1,
6685
MOZ_NO_ACTIVEX_SUPPORT= )
6686
AC_SUBST(MOZ_NO_ACTIVEX_SUPPORT)
6688
MOZ_ARG_ENABLE_BOOL(activex-scripting,
6689
[ --enable-activex-scripting
6690
Enable building of ActiveX scripting support (win32)],
6691
MOZ_ACTIVEX_SCRIPTING_SUPPORT=1,
6692
MOZ_ACTIVEX_SCRIPTING_SUPPORT=)
6693
AC_SUBST(MOZ_ACTIVEX_SCRIPTING_SUPPORT)
6695
if test -n "$MOZ_NO_ACTIVEX_SUPPORT" -a -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT";
6697
AC_MSG_ERROR([Cannot enable ActiveX scripting support when ActiveX support is disabled.])
6700
if test "$COMPILE_ENVIRONMENT" = "1"; then
6701
if test -n "$XPC_IDISPATCH_SUPPORT" -o -n "$MOZ_ACTIVEX_SCRIPTING_SUPPORT" -o -z "$MOZ_NO_ACTIVEX_SUPPORT"; then
6704
if test "$ac_cv_header_atlbase_h" = "no"; then
6705
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.])
6712
dnl ========================================================
6714
dnl ========================================================
6715
MOZ_ARG_ENABLE_BOOL(leaky,
6716
[ --enable-leaky Build leaky memory tool],
6721
dnl ========================================================
6722
dnl build the tests by default
6723
dnl ========================================================
6724
MOZ_ARG_DISABLE_BOOL(tests,
6725
[ --disable-tests Do not build test libraries & programs],
6729
dnl ========================================================
6730
dnl parental controls (for Windows Vista)
6731
dnl ========================================================
6732
MOZ_ARG_DISABLE_BOOL(parental-controls,
6733
[ --disable-parental-controls
6734
Do not build parental controls],
6735
MOZ_DISABLE_PARENTAL_CONTROLS=1,
6736
MOZ_DISABLE_PARENTAL_CONTROLS=)
6737
if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6738
AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6741
AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6743
dnl ========================================================
6744
dnl = Disable DOMCrypto
6745
dnl ========================================================
6746
if test -n "$MOZ_DISABLE_DOMCRYPTO"; then
6747
AC_DEFINE(MOZ_DISABLE_DOMCRYPTO)
6750
dnl ========================================================
6752
dnl = Module specific options
6754
dnl ========================================================
6755
MOZ_ARG_HEADER(Individual module options)
6757
dnl ========================================================
6758
dnl = Disable feed handling components
6759
dnl ========================================================
6760
MOZ_ARG_DISABLE_BOOL(feeds,
6761
[ --disable-feeds Disable feed handling and processing components],
6764
if test -n "$MOZ_FEEDS"; then
6765
AC_DEFINE(MOZ_FEEDS)
6767
if test "$MOZ_BUILD_APP" = "browser"; then
6768
AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6772
dnl ========================================================
6773
dnl = Enable mozStorage
6774
dnl ========================================================
6775
dnl Implicitly enabled by default if building calendar or places
6776
MOZ_ARG_ENABLE_BOOL(storage,
6777
[ --enable-storage Enable mozStorage module and related components],
6780
if test -n "$MOZ_STORAGE"; then
6781
AC_DEFINE(MOZ_STORAGE)
6784
dnl ========================================================
6785
dnl Check for sqlite
6786
dnl ========================================================
6789
MOZ_ARG_ENABLE_BOOL(system-sqlite,
6790
[ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6791
MOZ_NATIVE_SQLITE=1,
6792
MOZ_NATIVE_SQLITE= )
6794
if test -z "$MOZ_NATIVE_SQLITE"
6797
SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)'
6799
dnl ============================
6800
dnl === SQLite Version check ===
6801
dnl ============================
6802
dnl Check to see if the system SQLite package is new enough.
6803
PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6805
dnl ==================================
6806
dnl === SQLITE_SECURE_DELETE check ===
6807
dnl ==================================
6808
dnl Check to see if the system SQLite package is compiled with
6809
dnl SQLITE_SECURE_DELETE enabled.
6810
AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
6811
_SAVE_CFLAGS="$CFLAGS"
6812
CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6814
LIBS="$LIBS $SQLITE_LIBS"
6815
AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
6817
#include "sqlite3.h"
6819
int main(int argc, char **argv){
6820
return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
6822
ac_cv_sqlite_secure_delete=yes,
6823
ac_cv_sqlite_secure_delete=no,
6824
ac_cv_sqlite_secure_delete=no
6827
AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
6828
CFLAGS="$_SAVE_CFLAGS"
6830
if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
6831
AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
6834
dnl ===============================
6835
dnl === SQLITE_THREADSAFE check ===
6836
dnl ===============================
6837
dnl Check to see if the system SQLite package is compiled with
6838
dnl SQLITE_THREADSAFE enabled.
6839
AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
6840
_SAVE_CFLAGS="$CFLAGS"
6841
CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6843
LIBS="$LIBS $SQLITE_LIBS"
6844
AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
6846
#include "sqlite3.h"
6848
int main(int argc, char **argv){
6849
return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
6851
ac_cv_sqlite_threadsafe=yes,
6852
ac_cv_sqlite_threadsafe=no,
6853
ac_cv_sqlite_threadsafe=no
6856
AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
6857
CFLAGS="$_SAVE_CFLAGS"
6859
if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
6860
AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
6863
dnl ================================
6864
dnl === SQLITE_ENABLE_FTS3 check ===
6865
dnl ================================
6866
dnl check to see if the system SQLite package is compiled with
6867
dnl SQLITE_ENABLE_FTS3 enabled.
6868
AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
6869
_SAVE_CFLAGS="$CFLAGS"
6870
CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6872
LIBS="$LIBS $SQLITE_LIBS"
6873
AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
6875
#include "sqlite3.h"
6877
int main(int argc, char **argv){
6878
return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
6880
ac_cv_sqlite_enable_fts3=yes,
6881
ac_cv_sqlite_enable_fts3=no,
6882
ac_cv_sqlite_enable_fts3=no
6885
AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
6886
CFLAGS="$_SAVE_CFLAGS"
6888
if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
6889
AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
6892
dnl =========================================
6893
dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
6894
dnl =========================================
6895
dnl check to see if the system SQLite package is compiled with
6896
dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
6897
AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
6898
_SAVE_CFLAGS="$CFLAGS"
6899
CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6901
LIBS="$LIBS $SQLITE_LIBS"
6902
AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
6904
#include "sqlite3.h"
6906
int main(int argc, char **argv){
6907
return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
6909
ac_cv_sqlite_enable_unlock_notify=yes,
6910
ac_cv_sqlite_enable_unlock_notify=no,
6911
ac_cv_sqlite_enable_unlock_notify=no
6914
AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
6915
CFLAGS="$_SAVE_CFLAGS"
6917
if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
6918
AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
6922
if test -n "$MOZ_NATIVE_SQLITE"; then
6923
AC_DEFINE(MOZ_NATIVE_SQLITE)
6925
AC_SUBST(MOZ_NATIVE_SQLITE)
6927
dnl ========================================================
6928
dnl = Enable help viewer (off by default)
6929
dnl ========================================================
6930
if test -n "$MOZ_HELP_VIEWER"; then
6931
dnl Do this if defined in confvars.sh
6932
AC_DEFINE(MOZ_HELP_VIEWER)
6935
dnl ========================================================
6936
dnl = Enable safe browsing (anti-phishing)
6937
dnl ========================================================
6938
MOZ_ARG_ENABLE_BOOL(safe-browsing,
6939
[ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6940
MOZ_SAFE_BROWSING=1,
6941
MOZ_SAFE_BROWSING= )
6942
if test -n "$MOZ_SAFE_BROWSING"; then
6943
AC_DEFINE(MOZ_SAFE_BROWSING)
6945
AC_SUBST(MOZ_SAFE_BROWSING)
6947
dnl ========================================================
6948
dnl = Enable faststart component
6949
dnl ========================================================
6950
MOZ_ARG_ENABLE_BOOL(faststart,
6951
[ --enable-faststart Enable the faststart component],
6954
if test -n "$MOZ_FASTSTART"; then
6955
AC_DEFINE(MOZ_FASTSTART)
6957
AC_SUBST(MOZ_FASTSTART)
6959
dnl ========================================================
6960
dnl = Enable url-classifier
6961
dnl ========================================================
6962
dnl Implicitly enabled by default if building with safe-browsing
6963
if test -n "$MOZ_SAFE_BROWSING"; then
6964
MOZ_URL_CLASSIFIER=1
6966
MOZ_ARG_ENABLE_BOOL(url-classifier,
6967
[ --enable-url-classifier Enable url classifier module],
6968
MOZ_URL_CLASSIFIER=1,
6969
MOZ_URL_CLASSIFIER= )
6970
if test -n "$MOZ_URL_CLASSIFIER"; then
6971
AC_DEFINE(MOZ_URL_CLASSIFIER)
6973
AC_SUBST(MOZ_URL_CLASSIFIER)
6975
dnl ========================================================
6976
dnl = Disable zipwriter
6977
dnl ========================================================
6978
MOZ_ARG_DISABLE_BOOL(zipwriter,
6979
[ --disable-zipwriter Disable zipwriter component],
6982
AC_SUBST(MOZ_ZIPWRITER)
6984
dnl ========================================================
6986
dnl ========================================================
6987
dnl superseded by QtNetwork starting from 4.7
6988
MOZ_ENABLE_LIBCONIC=1
6990
if test -n "$MOZ_ENABLE_QT"; then
6991
if test "$MOZ_ENABLE_QTNETWORK"; then
6992
MOZ_ENABLE_LIBCONIC=
6996
MOZ_ARG_DISABLE_BOOL(libconic,
6997
[ --disable-libconic Disable libconic],
6998
MOZ_ENABLE_LIBCONIC=,
6999
MOZ_ENABLE_LIBCONIC=1 )
7001
if test -n "$MOZ_ENABLE_LIBCONIC"; then
7002
PKG_CHECK_MODULES(LIBCONIC, conic,
7003
MOZ_ENABLE_LIBCONIC=1,
7004
MOZ_ENABLE_LIBCONIC=)
7006
if test "$MOZ_ENABLE_LIBCONIC"; then
7007
AC_DEFINE(MOZ_ENABLE_LIBCONIC)
7010
AC_SUBST(MOZ_ENABLE_LIBCONIC)
7011
AC_SUBST(LIBCONIC_CFLAGS)
7012
AC_SUBST(LIBCONIC_LIBS)
7014
dnl ========================================================
7016
dnl ========================================================
7018
MAEMO_SDK_TARGET_VER=-1
7020
MOZ_ARG_WITH_STRING(maemo-version,
7021
[ --with-maemo-version=MAEMO_SDK_TARGET_VER
7023
MAEMO_SDK_TARGET_VER=$withval)
7025
case "$MAEMO_SDK_TARGET_VER" in
7027
MOZ_PLATFORM_MAEMO=5
7031
MOZ_PLATFORM_MAEMO=6
7035
dnl We aren't compiling for Maemo, move on.
7038
AC_MSG_ERROR([Unknown Maemo Version. Try setting --with-maemo-version to 5 or 6.])
7042
if test $MOZ_PLATFORM_MAEMO; then
7043
AC_DEFINE_UNQUOTED([MOZ_PLATFORM_MAEMO], $MOZ_PLATFORM_MAEMO)
7045
if test -z "$MOZ_ENABLE_DBUS"; then
7046
AC_MSG_ERROR([DBus is required when building for Maemo])
7049
MOZ_GFX_OPTIMIZE_MOBILE=1
7051
MOZ_MAEMO_LIBLOCATION=
7053
if test $MOZ_PLATFORM_MAEMO = 5; then
7054
dnl if we have Xcomposite we should also have Xdamage and Xfixes
7055
MOZ_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
7056
[AC_MSG_ERROR([Couldn't find X11/extensions/Xdamage.h which is required for composited plugins.])])
7057
AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
7058
[MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
7060
AC_SUBST(XCOMPOSITE_LIBS)
7062
PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime, _LIB_FOUND=1, _LIB_FOUND=)
7063
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
7064
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
7065
if test -z "$_LIB_FOUND"; then
7066
AC_MSG_ERROR([Hildon Mime is required when building for Maemo])
7070
PKG_CHECK_MODULES(LIBOSSO,libosso, _LIB_FOUND=1, _LIB_FOUND=)
7071
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
7072
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
7073
if test -z "$_LIB_FOUND"; then
7074
AC_MSG_ERROR([LibOSSO is required when building for Maemo])
7077
PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2, _LIB_FOUND=1, _LIB_FOUND=)
7078
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
7079
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
7080
if test -z "$_LIB_FOUND"; then
7081
AC_MSG_ERROR([Hildon FM-2 is required when building for Maemo])
7085
if test $MOZ_PLATFORM_MAEMO = 6; then
7086
dnl ========================================================
7087
dnl = Enable meego libcontentaction
7088
dnl ========================================================
7089
MOZ_ARG_ENABLE_BOOL(meegocontentaction,
7090
[ --enable-meegocontentaction Enable meegocontentaction support],
7091
MOZ_MEEGOCONTENTACTION=1,
7092
MOZ_MEEGOCONTENTACTION=)
7094
if test -n "$MOZ_MEEGOCONTENTACTION"; then
7096
PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
7097
if test "$_LIB_FOUND"; then
7098
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTACTION_LIBS"
7099
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTACTION_CFLAGS"
7100
MOZ_ENABLE_CONTENTACTION=1
7101
AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
7102
AC_SUBST(MOZ_ENABLE_CONTENTACTION)
7109
PKG_CHECK_MODULES(LIBLOCATION,liblocation, _LIB_FOUND=1, _LIB_FOUND=)
7110
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBLOCATION_LIBS"
7111
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBLOCATION_CFLAGS"
7112
if test "$_LIB_FOUND"; then
7113
MOZ_MAEMO_LIBLOCATION=1
7114
AC_DEFINE(MOZ_MAEMO_LIBLOCATION)
7116
AC_MSG_WARN([Cannot liblocation-dev. Disabling Maemo geolocation.])
7118
AC_SUBST(MOZ_MAEMO_LIBLOCATION)
7120
PKG_CHECK_MODULES(LIBMEEGOTOUCHSHARE, ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri, _LIB_FOUND=1, _LIB_FOUND=)
7121
MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBMEEGOTOUCHSHARE_LIBS"
7122
MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBMEEGOTOUCHSHARE_CFLAGS"
7123
if test "$_LIB_FOUND"; then
7124
MOZ_ENABLE_MEEGOTOUCHSHARE=1
7125
AC_DEFINE(MOZ_ENABLE_MEEGOTOUCHSHARE)
7127
AC_MSG_WARN([Cannot find maemo-meegotouch-interfaces-dev or libmdatauri-dev. Disabling meegotouch share ui.])
7129
AC_SUBST(MOZ_ENABLE_MEEGOTOUCHSHARE)
7131
AC_SUBST(MOZ_PLATFORM_MAEMO_LIBS)
7132
AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
7135
dnl Setup default CPU arch for arm target
7136
case "$target_cpu" in
7141
dnl ========================================================
7142
dnl = Enable building the Thumb2 instruction set
7143
dnl ========================================================
7144
MOZ_ARG_ENABLE_BOOL(thumb2,
7145
[ --enable-thumb2 Enable Thumb2 instruction set (implies ARMv7)],
7148
if test -n "$MOZ_THUMB2"; then
7152
dnl ========================================================
7153
dnl = Enable building for ARM specific CPU features
7154
dnl ========================================================
7155
MOZ_ARG_WITH_STRING(cpu-arch,
7156
[ --with-cpu-arch=arch Use specific arm architecture CPU features, default armv7],
7157
MOZ_ARM_ARCH=$withval)
7159
if test -n "$MOZ_THUMB2"; then
7160
case "$target_cpu" in
7162
if test "$MOZ_ARM_ARCH" != "armv7"; then
7163
AC_MSG_ERROR([--enable-thumb2 is not compatible with cpu-arch=$MOZ_ARM_ARCH])
7165
if test "$GNU_CC"; then
7166
AC_DEFINE(MOZ_THUMB2)
7167
AC_DEFINE(MOZ_ARM_ARCH)
7168
CFLAGS="$CFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7169
CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7170
ASFLAGS="$ASFLAGS -march=armv7-a -mthumb -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7172
AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains])
7176
AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures])
7179
elif test "$MOZ_ARM_ARCH" = "armv7"; then
7180
case "$target_cpu" in
7182
if test "$GNU_CC"; then
7183
AC_DEFINE(MOZ_ARM_ARCH)
7184
CFLAGS="$CFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7185
CXXFLAGS="$CXXFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7186
ASFLAGS="$ASFLAGS -march=armv7-a -marm -mfloat-abi=softfp $MOZ_ARM_VFP_FLAGS"
7188
AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-GNU toolchains])
7192
AC_MSG_ERROR([--with-cpu-arch=armv7 is not supported for non-ARM CPU architectures])
7196
case "$target_cpu" in
7198
if test "$GNU_CC"; then
7199
CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -msoft-float"
7200
CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -msoft-float"
7201
ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork -msoft-float"
7207
AC_SUBST(MOZ_THUMB2)
7208
AC_SUBST(MOZ_ARM_ARCH)
7210
dnl ========================================================
7211
dnl = faststripe theme
7212
dnl ========================================================
7213
MOZ_ARG_ENABLE_BOOL(faststripe,
7214
[ --enable-faststripe Use faststripe theme],
7215
MOZ_THEME_FASTSTRIPE=1,
7216
MOZ_THEME_FASTSTRIPE= )
7217
AC_SUBST(MOZ_THEME_FASTSTRIPE)
7219
dnl ========================================================
7221
dnl = Feature options that require extra sources to be pulled
7223
dnl ========================================================
7224
dnl MOZ_ARG_HEADER(Features that require extra sources)
7226
dnl ========================================================
7228
dnl = Debugging Options
7230
dnl ========================================================
7231
MOZ_ARG_HEADER(Debugging and Optimizations)
7233
dnl ========================================================
7234
dnl = Disable building with debug info.
7235
dnl = Debugging is OFF by default
7236
dnl ========================================================
7237
if test -z "$MOZ_DEBUG_FLAGS"; then
7238
MOZ_DEBUG_FLAGS="-g"
7241
MOZ_ARG_ENABLE_STRING(debug,
7242
[ --enable-debug[=DBG] Enable building with developer debug info
7243
(using compiler flags DBG)],
7244
[ if test "$enableval" != "no"; then
7246
if test -n "$enableval" -a "$enableval" != "yes"; then
7247
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
7248
_MOZ_DEBUG_FLAGS_SET=1
7255
MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
7256
MOZ_ARG_WITH_STRING(debug-label,
7257
[ --with-debug-label=LABELS
7258
Define DEBUG_<value> for each comma-separated
7260
[ for option in `echo $withval | sed 's/,/ /g'`; do
7261
MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
7264
MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
7266
if test -n "$MOZ_DEBUG"; then
7267
AC_MSG_CHECKING([for valid debug flags])
7268
_SAVE_CFLAGS=$CFLAGS
7269
CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
7270
AC_TRY_COMPILE([#include <stdio.h>],
7271
[printf("Hello World\n");],
7274
AC_MSG_RESULT([$_results])
7275
if test "$_results" = "no"; then
7276
AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
7278
CFLAGS=$_SAVE_CFLAGS
7281
dnl ========================================================
7282
dnl enable mobile optimizations
7283
dnl ========================================================
7284
MOZ_ARG_ENABLE_BOOL(mobile-optimize,
7285
[ --enable-mobile-optimize
7286
Enable mobile optimizations],
7287
MOZ_GFX_OPTIMIZE_MOBILE=1)
7289
AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
7291
if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
7292
AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
7295
dnl ========================================================
7296
dnl = Enable code optimization. ON by default.
7297
dnl ========================================================
7298
if test -z "$MOZ_OPTIMIZE_FLAGS"; then
7299
MOZ_OPTIMIZE_FLAGS="-O"
7302
MOZ_ARG_ENABLE_STRING(optimize,
7303
[ --disable-optimize Disable compiler optimization
7304
--enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
7305
[ if test "$enableval" != "no"; then
7307
if test -n "$enableval" -a "$enableval" != "yes"; then
7308
MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
7313
fi ], MOZ_OPTIMIZE=1)
7315
if test "$COMPILE_ENVIRONMENT"; then
7316
if test -n "$MOZ_OPTIMIZE"; then
7317
AC_MSG_CHECKING([for valid optimization flags])
7318
_SAVE_CFLAGS=$CFLAGS
7319
CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
7320
AC_TRY_COMPILE([#include <stdio.h>],
7321
[printf("Hello World\n");],
7324
AC_MSG_RESULT([$_results])
7325
if test "$_results" = "no"; then
7326
AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
7328
CFLAGS=$_SAVE_CFLAGS
7330
fi # COMPILE_ENVIRONMENT
7332
AC_SUBST(MOZ_OPTIMIZE)
7333
AC_SUBST(MOZ_OPTIMIZE_FLAGS)
7334
AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
7335
AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
7337
dnl ========================================================
7338
dnl = Enable generation of debug symbols
7339
dnl ========================================================
7340
MOZ_ARG_ENABLE_STRING(debug-symbols,
7341
[ --enable-debug-symbols[=DBG]
7342
Enable debugging symbols (using compiler flags DBG)],
7343
[ if test "$enableval" != "no"; then
7345
if test -n "$enableval" -a "$enableval" != "yes"; then
7346
if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
7347
MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
7349
AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
7355
MOZ_DEBUG_SYMBOLS=1)
7357
if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
7358
AC_DEFINE(MOZ_DEBUG_SYMBOLS)
7359
export MOZ_DEBUG_SYMBOLS
7362
dnl ========================================================
7363
dnl = Disable any treating of compile warnings as errors
7364
dnl ========================================================
7365
MOZ_ARG_DISABLE_BOOL(warnings-as-errors,
7366
[ --disable-warnings-as-errors
7367
Disable treating of warnings as errors],
7368
MOZ_DISABLE_WARNINGS_AS_ERRORS=1,
7369
MOZ_DISABLE_WARNINGS_AS_ERRORS= )
7370
if test "$MOZ_DISABLE_WARNINGS_AS_ERRORS"; then
7371
WARNINGS_AS_ERRORS=''
7374
dnl ========================================================
7375
dnl = Disable runtime logging checks
7376
dnl ========================================================
7377
MOZ_ARG_DISABLE_BOOL(logging,
7378
[ --disable-logging Disable logging facilities],
7379
NS_DISABLE_LOGGING=1,
7380
NS_DISABLE_LOGGING= )
7381
if test "$NS_DISABLE_LOGGING"; then
7382
AC_DEFINE(NS_DISABLE_LOGGING)
7384
AC_DEFINE(MOZ_LOGGING)
7387
dnl ========================================================
7388
dnl = This will enable logging of addref, release, ctor, dtor.
7389
dnl ========================================================
7390
_ENABLE_LOGREFCNT=42
7391
MOZ_ARG_ENABLE_BOOL(logrefcnt,
7392
[ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
7393
_ENABLE_LOGREFCNT=1,
7394
_ENABLE_LOGREFCNT= )
7395
if test "$_ENABLE_LOGREFCNT" = "1"; then
7396
AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
7397
elif test -z "$_ENABLE_LOGREFCNT"; then
7398
AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
7401
dnl ========================================================
7402
dnl = Enable trace malloc
7403
dnl ========================================================
7404
NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
7405
MOZ_ARG_ENABLE_BOOL(trace-malloc,
7406
[ --enable-trace-malloc Enable malloc tracing],
7409
if test "$NS_TRACE_MALLOC"; then
7410
# Please, Mr. Linker Man, don't take away our symbol names
7411
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
7413
AC_DEFINE(NS_TRACE_MALLOC)
7415
AC_SUBST(NS_TRACE_MALLOC)
7417
dnl ========================================================
7418
dnl = Enable jemalloc
7419
dnl ========================================================
7420
MOZ_ARG_ENABLE_BOOL(jemalloc,
7421
[ --enable-jemalloc Replace memory allocator with jemalloc],
7425
if test "$NS_TRACE_MALLOC"; then
7429
if test "$MOZ_MEMORY"; then
7431
dnl Don't try to run compiler tests on Windows
7432
if test "$OS_ARCH" = "WINNT"; then
7433
if test -z "$HAVE_64BIT_OS"; then
7434
AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
7436
AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
7439
AC_CHECK_SIZEOF([int *], [4])
7440
case "${ac_cv_sizeof_int_p}" in
7442
AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
7445
AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
7448
AC_MSG_ERROR([Unexpected pointer size])
7453
AC_DEFINE(MOZ_MEMORY)
7454
if test "x$MOZ_DEBUG" = "x1"; then
7455
AC_DEFINE(MOZ_MEMORY_DEBUG)
7457
dnl The generic feature tests that determine how to compute ncpus are long and
7458
dnl complicated. Therefore, simply define special cpp variables for the
7459
dnl platforms we have special knowledge of.
7462
AC_DEFINE(MOZ_MEMORY_DARWIN)
7465
AC_DEFINE(MOZ_MEMORY_BSD)
7468
AC_DEFINE(MOZ_MEMORY_LINUX)
7471
AC_DEFINE(MOZ_MEMORY_BSD)
7474
AC_DEFINE(MOZ_MEMORY_SOLARIS)
7477
AC_DEFINE(MOZ_MEMORY_WINDOWS)
7478
dnl This is sort of awful. Will revisit if we add support for more versions
7479
if test "$CC_VERSION" != "14.00.50727.762" -a "$CC_VERSION" != "15.00.30729.01"; then
7480
AC_MSG_ERROR([Building jemalloc requires exactly Visual C++ 2005 SP1 or 2008 SP1 currently.])
7482
if test -z "$WIN32_CRT_SRC_DIR"; then
7483
if test -z "$VCINSTALLDIR" -o ! -d "$VCINSTALLDIR"; then
7484
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).])
7486
WIN32_CRT_SRC_DIR="$VCINSTALLDIR\crt\src"
7490
case "${target_cpu}" in
7492
MOZ_CRT_CPU_ARCH=intel
7495
MOZ_CRT_CPU_ARCH=amd64
7498
AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
7502
AC_SUBST(MOZ_CRT_CPU_ARCH)
7504
if test ! -d "$WIN32_CRT_SRC_DIR"; then
7505
AC_MSG_ERROR([Invalid Win32 CRT source directory: ${WIN32_CRT_SRC_DIR}])
7507
WIN32_CRT_SRC_DIR=`cd "$WIN32_CRT_SRC_DIR" && pwd -W`
7508
_objdir_win=`pwd -W`
7509
WIN32_CUSTOM_CRT_DIR="$_objdir_win/memory/jemalloc/crtsrc/build/$MOZ_CRT_CPU_ARCH"
7510
MOZ_MEMORY_LDFLAGS="-MANIFEST:NO -LIBPATH:\"$WIN32_CUSTOM_CRT_DIR\" -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt19 -DEFAULTLIB:mozcpp19"
7511
dnl Also pass this to NSPR/NSS
7512
DLLFLAGS="$DLLFLAGS $MOZ_MEMORY_LDFLAGS"
7516
AC_DEFINE(MOZ_MEMORY_WINCE)
7517
AC_DEFINE(MOZ_MEMORY_WINDOWS)
7518
if test -z "$WINCE_WINDOWS_MOBILE"; then
7519
AC_DEFINE(MOZ_MEMORY_WINCE6)
7523
AC_DEFINE(MOZ_MEMORY_WINCE)
7524
AC_DEFINE(MOZ_MEMORY_WINDOWS)
7527
AC_DEFINE(MOZ_MEMORY_LINUX)
7528
AC_DEFINE(MOZ_MEMORY_ANDROID)
7530
export WRAP_MALLOC_LIB="-L$_objdir/dist/lib -lmozalloc -lmozutils"
7531
WRAP_MALLOC_CFLAGS="-Wl,--wrap=dlopen -Wl,--wrap=dlclose -Wl,--wrap=dlerror -Wl,--wrap=dlsym -Wl,--wrap=dladdr"
7534
AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
7538
if test "$OS_ARCH" != "Darwin"; then
7539
dnl NB: this must be kept in sync with jemalloc.h
7540
AC_DEFINE(HAVE_JEMALLOC_VALLOC)
7541
AC_DEFINE(HAVE_JEMALLOC_POSIX_MEMALIGN)
7542
AC_DEFINE(HAVE_JEMALLOC_MEMALIGN)
7545
AC_SUBST(MOZ_MEMORY)
7546
AC_SUBST(MOZ_MEMORY_LDFLAGS)
7547
AC_SUBST(WIN32_CRT_SRC_DIR)
7548
dnl Need to set this for make because NSS doesn't have configure
7551
dnl ========================================================
7552
dnl = Use malloc wrapper lib
7553
dnl ========================================================
7554
MOZ_ARG_ENABLE_BOOL(wrap-malloc,
7555
[ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
7559
if test -n "$_WRAP_MALLOC"; then
7560
if test "$GNU_CC"; then
7561
WRAP_MALLOC_CFLAGS="${LDFLAGS} ${WRAP_MALLOC_CFLAGS} -Wl,--wrap -Wl,malloc -Wl,--wrap -Wl,calloc -Wl,--wrap -Wl,valloc -Wl,--wrap -Wl,free -Wl,--wrap -Wl,realloc -Wl,--wrap -Wl,memalign -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 -Wl,--wrap -Wl,strdup -Wl,--wrap -Wl,strndup -Wl,--wrap -Wl,posix_memalign"
7562
MKSHLIB='$(CXX) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) $(WRAP_MALLOC_LIB) -o $@'
7563
MKCSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_CFLAGS) $(WRAP_MALLOC_LIB) -o $@'
7567
dnl ========================================================
7568
dnl = Location of malloc wrapper lib
7569
dnl ========================================================
7570
MOZ_ARG_WITH_STRING(wrap-malloc,
7571
[ --with-wrap-malloc=DIR Location of malloc wrapper library],
7572
WRAP_MALLOC_LIB=$withval)
7574
dnl ========================================================
7575
dnl = Use JS Call tracing
7576
dnl ========================================================
7577
MOZ_ARG_ENABLE_BOOL(trace-jscalls,
7578
[ --enable-trace-jscalls Enable JS call enter/exit callback (default=no)],
7579
MOZ_TRACE_JSCALLS=1,
7580
MOZ_TRACE_JSCALLS= )
7581
if test -n "$MOZ_TRACE_JSCALLS"; then
7582
AC_DEFINE(MOZ_TRACE_JSCALLS)
7585
dnl ========================================================
7587
dnl ========================================================
7588
MOZ_ARG_ENABLE_BOOL(tracevis,
7589
[ --enable-tracevis Enable TraceVis tracing tool (default=no)],
7592
if test -n "$MOZ_TRACEVIS"; then
7593
AC_DEFINE(MOZ_TRACEVIS)
7596
dnl ========================================================
7598
dnl ========================================================
7599
MOZ_ARG_ENABLE_BOOL(gctimer,
7600
[ --enable-gctimer Enable GC timer (default=no)],
7603
if test -n "$MOZ_GCTIMER"; then
7604
AC_DEFINE(MOZ_GCTIMER)
7607
dnl ========================================================
7608
dnl Zealous JavaScript GC
7609
dnl ========================================================
7610
MOZ_ARG_ENABLE_BOOL(gczeal,
7611
[ --enable-gczeal Enable zealous JavaScript GCing],
7614
if test -n "$JS_GC_ZEAL"; then
7615
AC_DEFINE(JS_GC_ZEAL)
7618
dnl ======================================================
7619
dnl = Enable compiling with ccache
7620
dnl ======================================================
7621
MOZ_ARG_WITH_STRING(ccache,
7622
[ --with-ccache[=path/to/ccache]
7623
Enable compiling with ccache],
7624
CCACHE=$withval, CCACHE="no")
7626
if test "$CCACHE" != "no"; then
7627
if test -z "$CCACHE" -o "$CCACHE" = "yes"; then
7630
if test ! -e "$CCACHE"; then
7631
AC_MSG_ERROR([$CCACHE not found])
7634
MOZ_PATH_PROGS(CCACHE, $CCACHE ccache)
7635
if test -z "$CCACHE" -o "$CCACHE" = ":"; then
7636
AC_MSG_ERROR([ccache not found])
7637
elif test -x "$CCACHE"; then
7641
AC_MSG_ERROR([$CCACHE is not executable])
7645
dnl ========================================================
7646
dnl = Enable static checking using gcc-dehydra
7647
dnl ========================================================
7649
MOZ_ARG_WITH_STRING(static-checking,
7650
[ --with-static-checking=path/to/gcc_dehydra.so
7651
Enable static checking of code using GCC-dehydra],
7652
DEHYDRA_PATH=$withval,
7655
if test -n "$DEHYDRA_PATH"; then
7656
if test ! -f "$DEHYDRA_PATH"; then
7657
AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
7659
AC_DEFINE(NS_STATIC_CHECKING)
7661
AC_SUBST(DEHYDRA_PATH)
7663
dnl ========================================================
7664
dnl = Enable stripping of libs & executables
7665
dnl ========================================================
7666
MOZ_ARG_ENABLE_BOOL(strip,
7667
[ --enable-strip Enable stripping of libs & executables ],
7671
dnl ========================================================
7672
dnl = Enable stripping of libs & executables when packaging
7673
dnl ========================================================
7674
MOZ_ARG_ENABLE_BOOL(install-strip,
7675
[ --enable-install-strip Enable stripping of libs & executables when packaging ],
7679
dnl ========================================================
7680
dnl = --enable-elf-dynstr-gc
7681
dnl ========================================================
7682
MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
7683
[ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
7684
USE_ELF_DYNSTR_GC=1,
7685
USE_ELF_DYNSTR_GC= )
7687
dnl ========================================================
7688
dnl = --disable-elf-hack
7689
dnl ========================================================
7692
MOZ_ARG_DISABLE_BOOL(elf-hack,
7693
[ --disable-elf-hack Disable elf hacks],
7697
# Only enable elfhack where supported
7698
if test "$USE_ELF_HACK" = 1; then
7699
case "${HOST_OS_ARCH},${OS_ARCH}" in
7701
case "${CPU_ARCH}" in
7716
dnl ========================================================
7718
dnl = Profiling and Instrumenting
7720
dnl ========================================================
7721
MOZ_ARG_HEADER(Profiling and Instrumenting)
7723
dnl ========================================================
7724
dnl = Enable timeline service, which provides lightweight
7725
dnl = instrumentation of mozilla for performance measurement.
7726
dnl = Timeline is off by default.
7727
dnl ========================================================
7728
MOZ_ARG_ENABLE_BOOL(timeline,
7729
[ --enable-timeline Enable timeline services ],
7732
if test -n "$MOZ_TIMELINE"; then
7733
AC_DEFINE(MOZ_TIMELINE)
7736
dnl ========================================================
7737
dnl = Enable NS_FUNCTION_TIMER, which provides Function
7738
dnl = timing for identifying code bottlenecks
7739
dnl = NS_FUNCTION_TIMER is off by default.
7740
dnl ========================================================
7741
MOZ_ARG_ENABLE_BOOL(functiontimer,
7742
[ --enable-functiontimer Enable NS_FUNCTION_TIMER ],
7743
NS_FUNCTION_TIMER=1,
7744
NS_FUNCTION_TIMER= )
7745
if test -n "$NS_FUNCTION_TIMER"; then
7746
AC_DEFINE(NS_FUNCTION_TIMER)
7749
dnl ========================================================
7750
dnl Turn on reflow counting
7751
dnl ========================================================
7752
MOZ_ARG_ENABLE_BOOL(reflow-perf,
7753
[ --enable-reflow-perf Enable reflow performance tracing],
7756
if test -n "$MOZ_REFLOW_PERF"; then
7757
AC_DEFINE(MOZ_REFLOW_PERF)
7760
dnl ========================================================
7761
dnl Enable code size metrics.
7762
dnl ========================================================
7763
MOZ_ARG_ENABLE_BOOL(codesighs,
7764
[ --enable-codesighs Enable code size analysis tools],
7765
_ENABLE_CODESIGHS=1,
7766
_ENABLE_CODESIGHS= )
7767
if test -n "$_ENABLE_CODESIGHS"; then
7768
if test -d $srcdir/tools/codesighs; then
7771
AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
7775
dnl ========================================================
7776
dnl = Support for Quantify (Windows)
7777
dnl ========================================================
7778
MOZ_ARG_ENABLE_BOOL(quantify,
7779
[ --enable-quantify Enable Quantify support (Windows only) ],
7783
dnl ========================================================
7784
dnl = Support for demangling undefined symbols
7785
dnl ========================================================
7786
if test -z "$SKIP_LIBRARY_CHECKS"; then
7789
AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
7793
# Demangle only for debug or trace-malloc builds
7794
MOZ_DEMANGLE_SYMBOLS=
7795
if test "$HAVE_DEMANGLE" -a "$HAVE_GCC3_ABI" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
7796
MOZ_DEMANGLE_SYMBOLS=1
7797
AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
7799
AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
7801
dnl ========================================================
7802
dnl = Support for gcc stack unwinding (from gcc 3.3)
7803
dnl ========================================================
7804
if test "$HAVE_GCC3_ABI" -a -z "$SKIP_LIBRARY_CHECKS"; then
7805
MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
7808
dnl ========================================================
7812
dnl ========================================================
7813
MOZ_ARG_HEADER(Misc. Options)
7815
dnl ========================================================
7816
dnl update xterm title
7817
dnl ========================================================
7818
MOZ_ARG_ENABLE_BOOL(xterm-updates,
7819
[ --enable-xterm-updates Update XTERM titles with current command.],
7823
dnl =========================================================
7825
dnl =========================================================
7826
MOZ_ARG_ENABLE_STRING([chrome-format],
7827
[ --enable-chrome-format=jar|flat|both|symlink|omni
7828
Select FORMAT of chrome files (default=jar)],
7829
MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
7831
if test -z "$MOZ_CHROME_FILE_FORMAT"; then
7832
MOZ_CHROME_FILE_FORMAT=jar
7835
if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
7836
test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
7837
test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
7838
test "$MOZ_CHROME_FILE_FORMAT" != "both" &&
7839
test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then
7840
AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, symlink, or omni])
7843
dnl =========================================================
7844
dnl Omnijar packaging (bug 552121)
7845
dnl =========================================================
7846
dnl Omnijar packaging is compatible with flat packaging.
7847
dnl In unpackaged builds, omnijar looks for files as if
7848
dnl things were flat packaged. After packaging, all files
7849
dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT
7850
dnl is set to flat since putting files into jars is only
7851
dnl done during packaging with omnijar.
7852
if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
7854
AC_DEFINE(MOZ_OMNIJAR)
7855
MOZ_CHROME_FILE_FORMAT=flat
7856
elif test "$MOZ_CHROME_FILE_FORMAT" = "jar"; then
7857
AC_DEFINE(MOZ_CHROME_FILE_FORMAT_JAR)
7860
AC_SUBST(MOZ_OMNIJAR)
7862
dnl ========================================================
7863
dnl = Define default location for MOZILLA_FIVE_HOME
7864
dnl ========================================================
7865
MOZ_ARG_WITH_STRING(default-mozilla-five-home,
7866
[ --with-default-mozilla-five-home
7867
Set the default value for MOZILLA_FIVE_HOME],
7868
[ val=`echo $withval`
7869
AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7871
dnl ========================================================
7872
dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7873
dnl ========================================================
7874
MOZ_ARG_WITH_STRING(user-appdir,
7875
[ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
7876
[ val=`echo $withval`
7877
if echo "$val" | grep "\/" >/dev/null; then
7878
AC_MSG_ERROR("Homedir must be single relative path.")
7883
AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7885
dnl ========================================================
7886
dnl = Doxygen configuration
7887
dnl ========================================================
7888
dnl Use commas to specify multiple dirs to this arg
7889
MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7890
MOZ_ARG_WITH_STRING(doc-input-dirs,
7891
[ --with-doc-input-dirs=DIRS
7892
Header/idl dirs to create docs from],
7893
[ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7894
AC_SUBST(MOZ_DOC_INPUT_DIRS)
7896
dnl Use commas to specify multiple dirs to this arg
7897
MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7898
MOZ_ARG_WITH_STRING(doc-include-dirs,
7899
[ --with-doc-include-dirs=DIRS
7900
Include dirs to preprocess doc headers],
7901
[ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7902
AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7904
MOZ_DOC_OUTPUT_DIR='./dist/docs'
7905
MOZ_ARG_WITH_STRING(doc-output-dir,
7906
[ --with-doc-output-dir=DIR
7907
Dir to generate docs into],
7908
[ MOZ_DOC_OUTPUT_DIR=$withval ] )
7909
AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7911
if test -z "$SKIP_COMPILER_CHECKS"; then
7912
dnl ========================================================
7914
dnl = Compiler Options
7916
dnl ========================================================
7917
MOZ_ARG_HEADER(Compiler Options)
7919
dnl ========================================================
7920
dnl Check for gcc -pipe support
7921
dnl ========================================================
7922
AC_MSG_CHECKING([for gcc -pipe support])
7923
if test -n "$GNU_CC" -a -n "$GNU_CXX" -a -n "$GNU_AS"; then
7924
echo '#include <stdio.h>' > dummy-hello.c
7925
echo 'int main() { printf("Hello World\n"); exit(0); }' >> dummy-hello.c
7926
${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
7927
cat dummy-hello.s 2> /dev/null | ${AS_BIN} -o dummy-hello.S - 2>&5
7928
if test $? = 0; then
7933
if test "$_res_as_stdin" = "yes"; then
7934
_SAVE_CFLAGS=$CFLAGS
7935
CFLAGS="$CFLAGS -pipe"
7936
AC_TRY_COMPILE( [ #include <stdio.h> ],
7937
[printf("Hello World\n");],
7938
[_res_gcc_pipe="yes"],
7939
[_res_gcc_pipe="no"] )
7940
CFLAGS=$_SAVE_CFLAGS
7942
if test "$_res_as_stdin" = "yes" -a "$_res_gcc_pipe" = "yes"; then
7944
CFLAGS="$CFLAGS -pipe"
7945
CXXFLAGS="$CXXFLAGS -pipe"
7949
rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
7950
AC_MSG_RESULT([$_res])
7955
dnl ========================================================
7956
dnl Profile guided optimization
7957
dnl ========================================================
7958
dnl Test for profiling options
7959
dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7961
dnl Provide a switch to disable PGO even when called via profiledbuild.
7962
MOZ_ARG_DISABLE_BOOL(profile-guided-optimization,
7963
[ --disable-profile-guided-optimization
7964
Don't build with PGO even if called via make profiledbuild],
7965
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=1,
7966
MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE=)
7968
AC_SUBST(MOZ_PROFILE_GUIDED_OPTIMIZE_DISABLE)
7970
_SAVE_CFLAGS="$CFLAGS"
7971
CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
7973
AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7974
AC_TRY_COMPILE([], [return 0;],
7975
[ PROFILE_GEN_CFLAGS="-fprofile-generate"
7976
result="yes" ], result="no")
7977
AC_MSG_RESULT([$result])
7979
if test $result = "yes"; then
7980
PROFILE_GEN_LDFLAGS="-fprofile-generate"
7981
PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch -freorder-blocks-and-partition"
7982
PROFILE_USE_LDFLAGS="-fprofile-use"
7985
CFLAGS="$_SAVE_CFLAGS"
7987
if test -n "$INTEL_CC"; then
7988
PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7989
PROFILE_GEN_LDFLAGS=
7990
PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7991
PROFILE_USE_LDFLAGS=
7994
dnl Sun Studio on Solaris
7995
if test "$SOLARIS_SUNPRO_CC"; then
7996
PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7997
PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7998
PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7999
PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
8002
AC_SUBST(PROFILE_GEN_CFLAGS)
8003
AC_SUBST(PROFILE_GEN_LDFLAGS)
8004
AC_SUBST(PROFILE_USE_CFLAGS)
8005
AC_SUBST(PROFILE_USE_LDFLAGS)
8009
dnl ========================================================
8010
dnl Test for -pedantic bustage
8011
dnl ========================================================
8012
MOZ_ARG_DISABLE_BOOL(pedantic,
8013
[ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
8015
if test "$_PEDANTIC"; then
8016
_SAVE_CXXFLAGS=$CXXFLAGS
8017
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
8018
AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
8019
AC_TRY_COMPILE([$configure_static_assert_macros],
8020
[CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
8021
result="no", result="yes" )
8022
AC_MSG_RESULT([$result])
8023
CXXFLAGS="$_SAVE_CXXFLAGS"
8027
_WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
8028
_WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} ${_COMPILER_PREFIX}-pedantic ${_COMPILER_PREFIX}-Wno-long-long"
8031
AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
8036
dnl ========================================================
8037
dnl Test for correct temporary object destruction order
8038
dnl ========================================================
8039
dnl We want to make sure the compiler follows the C++ spec here as
8040
dnl xpcom and the string classes depend on it (bug 235381).
8041
AC_MSG_CHECKING([for correct temporary object destruction order])
8042
AC_TRY_RUN([ class A {
8043
public: A(int& x) : mValue(x) {}
8045
operator char**() { return 0; }
8046
private: int& mValue;
8048
void func(char **arg) {}
8059
result="yes", result="no", result="maybe")
8060
AC_MSG_RESULT([$result])
8062
if test "$result" = "no"; then
8063
AC_MSG_ERROR([Your compiler does not follow the C++ specification for temporary object destruction order.])
8066
dnl ========================================================
8067
dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
8068
dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
8069
dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
8070
dnl ========================================================
8071
_SAVE_CXXFLAGS=$CXXFLAGS
8072
CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
8073
AC_CACHE_CHECK(for correct overload resolution with const and templates,
8074
ac_nscap_nonconst_opeq_bug,
8083
template <class T, class U>
8084
int operator==(const Pointer<T>& rhs, U* lhs)
8086
return rhs.myPtr == lhs;
8089
template <class T, class U>
8090
int operator==(const Pointer<T>& rhs, const U* lhs)
8092
return rhs.myPtr == lhs;
8100
ac_nscap_nonconst_opeq_bug="no",
8101
ac_nscap_nonconst_opeq_bug="yes")])
8102
CXXFLAGS="$_SAVE_CXXFLAGS"
8104
if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
8105
AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
8107
fi # SKIP_COMPILER_CHECKS
8109
dnl ========================================================
8111
dnl Should be smarter and check that the compiler does indeed have rtti
8112
dnl ========================================================
8114
MOZ_ARG_ENABLE_BOOL(cpp-rtti,
8115
[ --enable-cpp-rtti Enable C++ RTTI ],
8116
[ _MOZ_USE_RTTI=1 ],
8119
if test "$_MOZ_USE_RTTI"; then
8120
_MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_ON
8122
_MOZ_RTTI_FLAGS=$_MOZ_RTTI_FLAGS_OFF
8125
AC_SUBST(_MOZ_RTTI_FLAGS_ON)
8127
dnl ========================================================
8128
dnl C++ exceptions (g++/VC/irix6/Sun only - for now)
8129
dnl Should be smarter and check that the compiler does indeed have exceptions
8130
dnl ========================================================
8131
MOZ_ARG_ENABLE_BOOL(cpp-exceptions,
8132
[ --enable-cpp-exceptions Enable C++ exceptions ],
8133
[ _MOZ_CPP_EXCEPTIONS=1 ],
8134
[ _MOZ_CPP_EXCEPTIONS= ])
8136
if test "$_MOZ_CPP_EXCEPTIONS"; then
8137
_MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_ON
8138
AC_DEFINE(MOZ_CPP_EXCEPTIONS)
8140
_MOZ_EXCEPTIONS_FLAGS=$_MOZ_EXCEPTIONS_FLAGS_OFF
8143
AC_SUBST(_MOZ_EXCEPTIONS_FLAGS_ON)
8145
# Irix & OSF native compilers do not like exception declarations
8146
# when exceptions are disabled
8147
if test -n "$MIPSPRO_CXX" -o -n "$COMPAQ_CXX" -o -n "$VACPP"; then
8148
AC_DEFINE(CPP_THROW_NEW, [])
8150
AC_DEFINE(CPP_THROW_NEW, [throw()])
8154
dnl ========================================================
8156
dnl = Check what kind of list files are supported by the
8159
dnl ========================================================
8161
AC_CACHE_CHECK(what kind of list files are supported by the linker,
8162
EXPAND_LIBS_LIST_STYLE,
8163
[echo "int main() {return 0;}" > conftest.${ac_ext}
8164
if AC_TRY_COMMAND(${CC-cc} -o conftest.${OBJ_SUFFIX} -c $CFLAGS $CPPFLAGS conftest.${ac_ext} 1>&2) && test -s conftest.${OBJ_SUFFIX}; then
8165
echo "INPUT(conftest.${OBJ_SUFFIX})" > conftest.list
8166
if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
8167
EXPAND_LIBS_LIST_STYLE=linkerscript
8169
echo "conftest.${OBJ_SUFFIX}" > conftest.list
8170
if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS @conftest.list $LIBS 1>&2) && test -s conftest${ac_exeext}; then
8171
EXPAND_LIBS_LIST_STYLE=list
8173
EXPAND_LIBS_LIST_STYLE=none
8177
dnl We really don't expect to get here, but just in case
8178
AC_ERROR([couldn't compile a simple C file])
8182
LIBS_DESC_SUFFIX=desc
8183
AC_SUBST(LIBS_DESC_SUFFIX)
8184
AC_SUBST(EXPAND_LIBS_LIST_STYLE)
8186
dnl ========================================================
8188
dnl = Build depencency options
8190
dnl ========================================================
8191
MOZ_ARG_HEADER(Build dependencies)
8193
dnl ========================================================
8194
dnl = Do not auto generate dependency info
8195
dnl ========================================================
8197
MOZ_ARG_DISABLE_BOOL(auto-deps,
8198
[ --disable-auto-deps Do not automatically generate dependency info],
8202
if test -n "$MOZ_AUTO_DEPS"; then
8203
dnl ========================================================
8204
dnl = Use mkdepend instead of $CC -MD for dependency generation
8205
dnl ========================================================
8207
MOZ_ARG_DISABLE_BOOL(md,
8208
[ --disable-md Do not use compiler-based dependencies ],
8211
[dnl Default is to turn on -MD if using GNU-compatible compilers
8212
if test "$GNU_CC" -a "$GNU_CXX"; then
8215
dnl Default is to use -xM if using Sun Studio on Solaris
8216
if test "$SOLARIS_SUNPRO_CC"; then
8219
if test "$_cpp_md_flag"; then
8221
_DEPEND_CFLAGS='$(filter-out %/.pp,-MD -MF $(MDDEPDIR)/$(basename $(@F)).pp)'
8222
dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
8223
if test "$SOLARIS_SUNPRO_CC"; then
8228
dnl Don't override this for MSVC
8229
if test -z "$_WIN32_MSVC"; then
8230
_USE_CPP_INCLUDE_FLAG=
8231
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
8232
_DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
8234
echo '#include <stdio.h>' > dummy-hello.c
8236
CL_INCLUDES_PREFIX=`"${CC}" -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'`
8238
if test -z "$CL_INCLUDES_PREFIX"; then
8239
AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
8241
AC_SUBST(CL_INCLUDES_PREFIX)
8243
_topsrcdirwin=`cd \`dirname $0\`; pwd -W`
8244
dnl cl.py provides dependency generation for MSVC
8245
CC_WRAPPER="$PYTHON -O $_topsrcdirwin/build/cl.py"
8246
CXX_WRAPPER="$PYTHON -O $_topsrcdirwin/build/cl.py"
8252
AC_SUBST(MOZ_AUTO_DEPS)
8253
AC_SUBST(COMPILER_DEPEND)
8255
AC_SUBST(CC_WRAPPER)
8256
AC_SUBST(CXX_WRAPPER)
8259
dnl ========================================================
8261
dnl = Static Build Options
8263
dnl ========================================================
8264
MOZ_ARG_HEADER(Static build options)
8266
MOZ_ARG_ENABLE_BOOL(static,
8267
[ --enable-static Enable building internal static libs],
8268
BUILD_STATIC_LIBS=1,
8273
MOZ_ARG_DISABLE_BOOL(libxul,
8274
[ --disable-libxul Disable building libxul (not supported)],
8276
MOZ_ENABLE_LIBXUL=1)
8278
if test -z "$MOZ_ENABLE_LIBXUL"; then
8279
AC_MSG_ERROR([--disable-libxul is no longer supported.])
8282
# split JS out by default to avoid VS2005 PGO crash (bug 591836).
8283
if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" != "x86_64" ; then
8287
MOZ_ARG_ENABLE_BOOL(shared-js,
8288
[ --enable-shared-js
8289
Create a shared JavaScript library.],
8293
if test -n "$ENABLE_SHARED_JS"; then
8295
MOZ_JS_LIBS=$MOZ_JS_SHARED_LIBS
8297
MOZ_JS_LIBS=$MOZ_JS_STATIC_LIBS
8298
AC_DEFINE(MOZ_STATIC_JS)
8300
AC_SUBST(JS_SHARED_LIBRARY)
8302
if test -n "$MOZ_STATIC_BUILD_UNSUPPORTED" -a -n "$BUILD_STATIC_LIBS"; then
8303
AC_MSG_ERROR([--enable-static is not supported for building $MOZ_APP_NAME.])
8306
if test -n "$MOZ_ENABLE_LIBXUL" -a -n "$BUILD_STATIC_LIBS"; then
8307
AC_MSG_ERROR([--enable-libxul is not compatible with --enable-static])
8310
AC_SUBST(LIBXUL_LIBS)
8311
XPCOM_LIBS="$LIBXUL_LIBS"
8312
AC_DEFINE(MOZ_ENABLE_LIBXUL)
8314
dnl ========================================================
8316
dnl = Standalone module options
8318
dnl ========================================================
8319
MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
8321
dnl Check for GLib and libIDL.
8322
dnl ========================================================
8325
if test -z "$COMPILE_ENVIRONMENT"; then
8326
SKIP_IDL_CHECK="yes"
8329
dnl = Allow users to disable libIDL checking for standalone modules
8330
MOZ_ARG_WITHOUT_BOOL(libIDL,
8331
[ --without-libIDL Skip check for libIDL (standalone modules only)],
8332
SKIP_IDL_CHECK="yes")
8334
if test -z "$CROSS_COMPILE"; then
8335
if test -z "$HOST_LIBIDL_CONFIG"; then
8336
HOST_LIBIDL_CONFIG="$LIBIDL_CONFIG"
8338
if test -z "$HOST_LIBIDL_PREFIX"; then
8339
HOST_LIBIDL_PREFIX="$LIBIDL_PREFIX"
8343
if test "$SKIP_IDL_CHECK" = "no"
8348
if test -n "$GLIB_PREFIX"; then
8349
_GLIB_PREFIX_DIR=`cd $GLIB_PREFIX && pwd -W`
8350
if test "$?" = "0"; then
8351
if test `echo ${PATH}: | grep -ic "$_GLIB_PREFIX_DIR/bin:"` = 0; then
8352
AC_MSG_ERROR([GLIB_PREFIX must be in your \$PATH.])
8355
AC_MSG_ERROR([GLIB_PREFIX is set but "${GLIB_PREFIX}" is not a directory.])
8358
_GLIB_PREFIX_DIR=$MOZ_TOOLS_DIR
8360
if test ! -f "${_GLIB_PREFIX_DIR}/include/glib.h"; then
8361
AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/include/glib.h .])
8363
GLIB_CFLAGS="-I${_GLIB_PREFIX_DIR}/include"
8364
if test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"; then
8365
GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2_s.lib"
8366
elif test -f "${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"; then
8367
GLIB_LIBS="${_GLIB_PREFIX_DIR}/lib/glib-1.2.lib"
8369
AC_MSG_ERROR([Cannot find $_GLIB_PREFIX_DIR/lib/glib-1.2.lib or $_GLIB_PREFIX_DIR/lib/glib-1.2_s.lib])
8372
if test -n "$HOST_LIBIDL_PREFIX"; then
8373
_LIBIDL_PREFIX_DIR=`cd $HOST_LIBIDL_PREFIX && pwd -W`
8374
if test "$?" = "0"; then
8375
if test `echo ${PATH}: | grep -ic "$_LIBIDL_PREFIX_DIR/bin:"` = 0; then
8376
AC_MSG_ERROR([LIBIDL_PREFIX must be in your \$PATH.])
8379
AC_MSG_ERROR([LIBIDL_PREFIX is set but "${LIBIDL_PREFIX}" is not a directory.])
8382
_LIBIDL_PREFIX_DIR=$MOZ_TOOLS_DIR
8384
if test ! -f "${_LIBIDL_PREFIX_DIR}/include/libIDL/IDL.h"; then
8385
AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/include/libIDL/IDL.h .])
8387
HOST_LIBIDL_CFLAGS="-I${_LIBIDL_PREFIX_DIR}/include ${GLIB_CFLAGS}"
8388
if test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"; then
8389
HOST_LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6_s.lib"
8391
elif test -f "${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"; then
8392
HOST_LIBIDL_LIBS="${_LIBIDL_PREFIX_DIR}/lib/libidl-0.6.lib"
8394
AC_MSG_ERROR([Cannot find $_LIBIDL_PREFIX_DIR/lib/libidl-0.6.lib or $_LIBIDL_PREFIX_DIR/lib/libidl-0.6_s.lib])
8396
HOST_LIBIDL_LIBS="${HOST_LIBIDL_LIBS} ${GLIB_LIBS}"
8401
if test -z "$_LIBIDL_FOUND"; then
8402
if test "$MACOS_SDK_DIR"; then
8403
dnl xpidl, and therefore libIDL, is only needed on the build host.
8404
dnl Don't build it against the SDK, as that causes problems.
8405
_MACSAVE_CFLAGS="$CFLAGS"
8406
_MACSAVE_LIBS="$LIBS"
8407
_MACSAVE_LDFLAGS="$LDFLAGS"
8408
_MACSAVE_NEXT_ROOT="$NEXT_ROOT"
8410
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"`
8411
LIBS=`echo $LIBS|sed -e "s?-L${MACOS_SDK_DIR}/usr/lib[^ ]*??g"`
8412
LDFLAGS=`echo $LDFLAGS|sed -e "s?-Wl,-syslibroot,${MACOS_SDK_DIR}??g"`
8417
PKG_CHECK_MODULES(HOST_LIBIDL, libIDL-2.0 >= 0.8.0 glib-2.0 gobject-2.0, _LIBIDL_FOUND=1,_LIBIDL_FOUND=)
8420
dnl if no gtk/libIDL1 or gtk2/libIDL2 combination was found, fall back
8421
dnl to either libIDL1 or libIDL2.
8422
if test -z "$_LIBIDL_FOUND"; then
8423
AM_PATH_LIBIDL($LIBIDL_VERSION,_LIBIDL_FOUND=1)
8424
if test -z "$_LIBIDL_FOUND"; then
8425
PKG_CHECK_MODULES(HOST_LIBIDL, libIDL-2.0 >= 0.8.0,_LIBIDL_FOUND=1)
8429
dnl If we don't have a libIDL config program & not cross-compiling,
8430
dnl look for orbit-config instead.
8432
if test -z "$_LIBIDL_FOUND" -a -z "$CROSS_COMPILE"; then
8433
MOZ_PATH_PROGS(ORBIT_CONFIG, $ORBIT_CONFIG orbit-config)
8434
if test -n "$ORBIT_CONFIG"; then
8435
AC_MSG_CHECKING([for ORBit libIDL usability])
8436
_ORBIT_CFLAGS=`${ORBIT_CONFIG} client --cflags`
8437
_ORBIT_LIBS=`${ORBIT_CONFIG} client --libs`
8438
_ORBIT_INC_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-I/); } }' -- ${_ORBIT_CFLAGS}`
8439
_ORBIT_LIB_PATH=`${PERL} -e '{ for $f (@ARGV) { print "$f " if ($f =~ m/^-L/); } }' -- ${_ORBIT_LIBS}`
8440
HOST_LIBIDL_CFLAGS="$_ORBIT_INC_PATH"
8441
HOST_LIBIDL_LIBS="$_ORBIT_LIB_PATH -lIDL -lglib"
8443
_SAVE_CFLAGS="$CFLAGS"
8445
CFLAGS="$HOST_LIBIDL_CFLAGS $CFLAGS"
8446
LIBS="$HOST_LIBIDL_LIBS $LIBS"
8449
#include <libIDL/IDL.h>
8452
s=strdup(IDL_get_libver_string());
8460
[HOST_LIBIDL_CFLAGS=
8465
AC_MSG_RESULT($result)
8466
CFLAGS="$_SAVE_CFLAGS"
8470
if test -z "$_LIBIDL_FOUND"; then
8471
AC_MSG_ERROR([libIDL not found.
8472
libIDL $LIBIDL_VERSION or higher is required.])
8474
if test "$MACOS_SDK_DIR"; then
8475
CFLAGS="$_MACSAVE_CFLAGS"
8476
LIBS="$_MACSAVE_LIBS"
8477
LDFLAGS="$_MACSAVE_LDFLAGS"
8478
if test -n "$_MACSAVE_NEXT_ROOT" ; then
8479
export NEXT_ROOT="$_MACSAVE_NEXT_ROOT"
8484
if test -n "$CROSS_COMPILE"; then
8487
if test -n "$GLIB_PREFIX"; then
8488
GLIB_CFLAGS="-I${GLIB_PREFIX}/include"
8489
if test -f "${GLIB_PREFIX}/lib/glib-1.2_s.lib"; then
8490
GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2_s.lib"
8491
elif test -f "${GLIB_PREFIX}/lib/glib-1.2.lib"; then
8492
GLIB_LIBS="${GLIB_PREFIX}/lib/glib-1.2.lib"
8494
AC_MSG_ERROR([Cannot find $GLIB_PREFIX/lib/glib-1.2.lib or $GLIB_PREFIX/lib/glib-1.2_s.lib])
8498
if test -n "$LIBIDL_PREFIX"; then
8499
LIBIDL_CFLAGS="-I${LIBIDL_PREFIX}/include ${GLIB_CFLAGS}"
8500
if test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"; then
8501
LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6_s.lib"
8503
elif test -f "${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"; then
8504
LIBIDL_LIBS="${LIBIDL_PREFIX}/lib/libIDL-0.6.lib"
8506
AC_MSG_ERROR([Cannot find $LIBIDL_PREFIX/lib/libIDL-0.6.lib or $LIBIDL_PREFIX/lib/libIDL-0.6_s.lib])
8509
LIBIDL_LIBS="${LIBIDL_LIBS} ${GLIB_LIBS}"
8512
if test -n "LIBIDL_CONFIG" -a "LIBIDL_CONFIG" != "no"; then
8513
LIBIDL_CFLAGS=`${LIBIDL_CONFIG} --cflags`
8514
LIBIDL_LIBS=`${LIBIDL_CONFIG} --libs`
8519
LIBIDL_CFLAGS="$HOST_LIBIDL_CFLAGS"
8520
LIBIDL_LIBS="$HOST_LIBIDL_LIBS"
8523
if test -z "$SKIP_PATH_CHECKS"; then
8524
if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
8525
if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then
8526
PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
8528
AM_PATH_GLIB(${GLIB_VERSION})
8533
if test -z "${GLIB_GMODULE_LIBS}" -a -n "${GLIB_CONFIG}"; then
8534
GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
8537
AC_SUBST(LIBIDL_CFLAGS)
8538
AC_SUBST(LIBIDL_LIBS)
8539
AC_SUBST(STATIC_LIBIDL)
8540
AC_SUBST(GLIB_CFLAGS)
8542
AC_SUBST(GLIB_GMODULE_LIBS)
8543
AC_SUBST(HOST_LIBIDL_CONFIG)
8544
AC_SUBST(HOST_LIBIDL_CFLAGS)
8545
AC_SUBST(HOST_LIBIDL_LIBS)
8547
dnl ========================================================
8549
dnl ========================================================
8550
MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
8553
MOZ_ARG_ENABLE_BOOL(system-cairo,
8554
[ --enable-system-cairo Use system cairo (located with pkgconfig)],
8559
MOZ_ARG_ENABLE_BOOL(system-pixman,
8560
[ --enable-system-pixman Use system pixman (located with pkgconfig)],
8564
# Check for headers defining standard int types.
8565
MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
8567
if test "$MOZ_TREE_CAIRO"; then
8568
AC_DEFINE(MOZ_TREE_CAIRO)
8570
# For now we assume that we will have a uint64_t available through
8571
# one of the above headers or mozstdint.h.
8572
AC_DEFINE(HAVE_UINT64_T)
8574
# Define macros for cairo-features.h
8575
if test "$MOZ_X11"; then
8576
XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
8577
XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
8578
PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
8579
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
8580
MOZ_ENABLE_CAIRO_FT=1
8581
CAIRO_FT_CFLAGS="$FT2_CFLAGS"
8583
if test "$MOZ_WIDGET_TOOLKIT" = "qt"; then
8584
QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
8586
if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
8587
QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
8588
QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
8589
QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
8591
if test "$MOZ_WIDGET_TOOLKIT" = "windows"; then
8592
WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
8593
if test -z "$WINCE"; then
8594
WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
8595
if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
8596
WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
8597
WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
8598
MOZ_ENABLE_D2D_SURFACE=1
8599
MOZ_ENABLE_DWRITE_FONT=1
8601
WIN32_DWRITE_FONT_FEATURE=
8602
WIN32_D2D_SURFACE_FEATURE=
8606
WIN32_DWRITE_FONT_FEATURE=
8607
WIN32_D2D_SURFACE_FEATURE=
8610
MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1)
8612
dnl D3D10 Layers depend on D2D Surfaces.
8613
if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
8614
MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
8618
if test "$MOZ_WIDGET_TOOLKIT" = "os2"; then
8619
OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
8620
FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
8621
MOZ_ENABLE_CAIRO_FT=1
8622
CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
8623
CAIRO_FT_LIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
8625
if test "$USE_FC_FREETYPE"; then
8626
FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
8628
AC_SUBST(MOZ_ENABLE_CAIRO_FT)
8629
AC_SUBST(MOZ_ENABLE_DWRITE_FONT)
8630
AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
8631
AC_SUBST(MOZ_ENABLE_D3D9_LAYER)
8632
AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
8633
AC_SUBST(CAIRO_FT_CFLAGS)
8636
if test "$MOZ_DEBUG"; then
8637
SANITY_CHECKING_FEATURE="#define CAIRO_DO_SANITY_CHECKING 1"
8639
SANITY_CHECKING_FEATURE="#undef CAIRO_DO_SANITY_CHECKING"
8642
PNG_FUNCTIONS_FEATURE="#define CAIRO_HAS_PNG_FUNCTIONS 1"
8644
AC_SUBST(PS_SURFACE_FEATURE)
8645
AC_SUBST(PDF_SURFACE_FEATURE)
8646
AC_SUBST(SVG_SURFACE_FEATURE)
8647
AC_SUBST(XLIB_SURFACE_FEATURE)
8648
AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
8649
AC_SUBST(QUARTZ_SURFACE_FEATURE)
8650
AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
8651
AC_SUBST(XCB_SURFACE_FEATURE)
8652
AC_SUBST(WIN32_SURFACE_FEATURE)
8653
AC_SUBST(OS2_SURFACE_FEATURE)
8654
AC_SUBST(DIRECTFB_SURFACE_FEATURE)
8655
AC_SUBST(FT_FONT_FEATURE)
8656
AC_SUBST(FC_FONT_FEATURE)
8657
AC_SUBST(WIN32_FONT_FEATURE)
8658
AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
8659
AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
8660
AC_SUBST(QUARTZ_FONT_FEATURE)
8661
AC_SUBST(PNG_FUNCTIONS_FEATURE)
8662
AC_SUBST(QT_SURFACE_FEATURE)
8664
MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src)'" $CAIRO_FT_LIBS"
8666
if test "$MOZ_TREE_PIXMAN"; then
8667
AC_DEFINE(MOZ_TREE_PIXMAN)
8668
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS"' $(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
8670
PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.19.2)
8671
MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $PIXMAN_CFLAGS"
8672
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $PIXMAN_LIBS"
8675
if test "$MOZ_X11"; then
8676
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS -lXrender -lfreetype -lfontconfig"
8679
CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
8680
mv -f $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig 2> /dev/null
8683
PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION pixman-1 freetype2 fontconfig)
8684
MOZ_CAIRO_CFLAGS=$CAIRO_CFLAGS
8685
MOZ_CAIRO_LIBS=$CAIRO_LIBS
8686
PKG_CHECK_MODULES(CAIRO_TEE, cairo-tee >= $CAIRO_VERSION)
8687
if test "$MOZ_X11"; then
8688
PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
8689
MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
8690
MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
8694
AC_SUBST(MOZ_TREE_CAIRO)
8695
AC_SUBST(MOZ_CAIRO_CFLAGS)
8696
AC_SUBST(MOZ_CAIRO_LIBS)
8697
AC_SUBST(MOZ_TREE_PIXMAN)
8699
dnl ========================================================
8701
dnl ========================================================
8704
if test `echo "$MOZ_EXTENSIONS" | grep -c globalmenu` -ne 0; then
8705
PKG_CHECK_MODULES(DBUSMENU, dbusmenu-gtk-0.4 gio-2.0)
8707
AC_SUBST(DBUSMENU_CFLAGS)
8708
AC_SUBST(DBUSMENU_LIBS)
8709
AC_DEFINE(UNITY_GLOBALMENU)
8711
AC_SUBST(UNITY_GLOBALMENU)
8713
dnl ========================================================
8715
dnl ========================================================
8717
QCMS_LIBS='$(call EXPAND_LIBNAME_PATH,mozqcms,$(DEPTH)/gfx/qcms)'
8720
dnl ========================================================
8722
dnl ========================================================
8723
MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
8724
AC_SUBST(MOZ_HARFBUZZ_LIBS)
8726
dnl ========================================================
8728
dnl ========================================================
8729
MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
8730
AC_SUBST(MOZ_OTS_LIBS)
8732
dnl ========================================================
8734
dnl ========================================================
8735
MOZ_ARG_DISABLE_BOOL(xul,
8736
[ --disable-xul Disable XUL],
8738
if test "$MOZ_XUL"; then
8741
dnl remove extensions that require XUL
8742
MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
8747
dnl ========================================================
8748
dnl disable profile locking
8749
dnl do no use this in applications that can have more than
8750
dnl one process accessing the profile directory.
8751
dnl ========================================================
8752
MOZ_ARG_DISABLE_BOOL(profilelocking,
8753
[ --disable-profilelocking
8754
Disable profile locking],
8755
MOZ_PROFILELOCKING=,
8756
MOZ_PROFILELOCKING=1 )
8757
if test "$MOZ_PROFILELOCKING"; then
8758
AC_DEFINE(MOZ_PROFILELOCKING)
8761
dnl ========================================================
8762
dnl disable rdf services
8763
dnl ========================================================
8764
MOZ_ARG_DISABLE_BOOL(rdf,
8765
[ --disable-rdf Disable RDF],
8767
if test "$MOZ_RDF"; then
8773
dnl ========================================================
8774
dnl necko configuration options
8775
dnl ========================================================
8778
dnl option to disable various necko protocols
8780
MOZ_ARG_ENABLE_STRING(necko-protocols,
8781
[ --enable-necko-protocols[={http,ftp,default,all,none}]
8782
Enable/disable specific protocol handlers],
8783
[ for option in `echo $enableval | sed 's/,/ /g'`; do
8784
if test "$option" = "yes" -o "$option" = "all"; then
8785
NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8786
elif test "$option" = "no" -o "$option" = "none"; then
8788
elif test "$option" = "default"; then
8789
NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8790
elif test `echo "$option" | grep -c \^-` != 0; then
8791
option=`echo $option | sed 's/^-//'`
8792
NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
8794
NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
8797
NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
8799
NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
8800
AC_SUBST(NECKO_PROTOCOLS)
8801
for p in $NECKO_PROTOCOLS; do
8802
AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
8806
dnl option to disable necko's disk cache
8808
MOZ_ARG_DISABLE_BOOL(necko-disk-cache,
8809
[ --disable-necko-disk-cache
8810
Disable necko disk cache],
8813
AC_SUBST(NECKO_DISK_CACHE)
8814
if test "$NECKO_DISK_CACHE"; then
8815
AC_DEFINE(NECKO_DISK_CACHE)
8819
dnl option to disable necko's wifi scanner
8821
MOZ_ARG_DISABLE_BOOL(necko-wifi,
8822
[ --disable-necko-wifi Disable necko wifi scanner],
8826
if test "$OS_ARCH" = "OS2"; then
8827
dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
8830
if test "$NECKO_WIFI" -a \
8831
"$OS_ARCH" != "Linux" -a \
8832
"$OS_ARCH" != "Darwin" -a \
8833
"$OS_ARCH" != "SunOS" -a \
8834
"$OS_ARCH" != "WINNT" -a \
8835
"$OS_ARCH" != "WINCE"; then
8836
AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
8839
if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
8841
MOZ_CHECK_HEADER([iwlib.h])
8842
if test "$ac_cv_header_iwlib_h" != "yes"; then
8843
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) or libiw-devel (openSUSE)); use --disable-necko-wifi to disable])
8847
if test "$NECKO_WIFI"; then
8848
AC_DEFINE(NECKO_WIFI)
8850
AC_SUBST(NECKO_WIFI)
8853
dnl option to disable cookies
8855
MOZ_ARG_DISABLE_BOOL(cookies,
8856
[ --disable-cookies Disable cookie support],
8859
AC_SUBST(NECKO_COOKIES)
8860
if test "$NECKO_COOKIES"; then
8861
AC_DEFINE(NECKO_COOKIES)
8865
dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
8867
MOZ_ARG_DISABLE_BOOL(ctypes,
8868
[ --disable-ctypes Disable js-ctypes],
8871
AC_SUBST(BUILD_CTYPES)
8872
if test "$BUILD_CTYPES"; then
8873
if test "$OS_ARCH" = "WINCE" -a `echo $OS_TEST | grep -ic arm` = 1; then
8874
# Disable ctypes for arm/wince.
8877
AC_DEFINE(BUILD_CTYPES)
8881
dnl NECKO_ configuration options are not global
8882
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_"
8884
dnl Only build Mork if it's required
8886
if test "$MOZ_MORK"; then
8890
dnl Build the lightweight Mork reader if required
8891
AC_SUBST(MOZ_MORKREADER)
8892
if test "$MOZ_MORKREADER"; then
8893
AC_DEFINE(MOZ_MORKREADER)
8896
dnl Build Places if required
8897
if test "$MOZ_PLACES"; then
8898
AC_DEFINE(MOZ_PLACES)
8901
dnl Build Sync Services if required
8902
AC_SUBST(MOZ_SERVICES_SYNC)
8903
if test -n "$MOZ_SERVICES_SYNC"; then
8904
AC_DEFINE(MOZ_SERVICES_SYNC)
8907
dnl ========================================================
8908
if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
8909
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
8912
if test "$MOZ_APP_COMPONENT_INCLUDE"; then
8913
AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_INCLUDE, "$MOZ_APP_COMPONENT_INCLUDE")
8916
if test "$MOZ_APP_COMPONENT_MODULES"; then
8917
AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_MODULES, $MOZ_APP_COMPONENT_MODULES)
8920
dnl ========================================================
8922
dnl = Maintainer debug option (no --enable equivalent)
8924
dnl ========================================================
8929
AC_SUBST(AR_EXTRACT)
8933
AC_SUBST(AS_DASH_C_FLAG)
8941
AC_SUBST(NS_USE_NATIVE)
8942
AC_SUBST(MOZ_WIDGET_TOOLKIT)
8943
AC_SUBST(MOZ_UPDATE_XTERM)
8945
AC_SUBST(MOZ_PLATFORM_MAEMO)
8946
AC_SUBST(MOZ_AUTH_EXTENSION)
8947
AC_SUBST(MOZ_MATHML)
8948
AC_SUBST(MOZ_CSS_ANIMATIONS)
8949
AC_SUBST(MOZ_PERMISSIONS)
8951
AC_SUBST(MOZ_PREF_EXTENSIONS)
8954
AC_SUBST(MOZ_XSLT_STANDALONE)
8955
AC_SUBST(MOZ_JS_LIBS)
8958
AC_SUBST(MOZ_DEBUG_SYMBOLS)
8959
AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
8960
AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
8961
AC_SUBST(MOZ_DEBUG_FLAGS)
8962
AC_SUBST(MOZ_DEBUG_LDFLAGS)
8963
AC_SUBST(WARNINGS_AS_ERRORS)
8964
AC_SUBST(MOZ_EXTENSIONS)
8965
AC_SUBST(MOZ_JSDEBUGGER)
8966
AC_SUBST(MOZ_LOG_REFCNT)
8970
AC_SUBST(MOZ_CALLGRIND)
8972
AC_SUBST(MOZ_PROFILING)
8973
AC_SUBST(MOZ_QUANTIFY)
8975
AC_SUBST(MOZ_PLACES)
8976
AC_SUBST(MOZ_STORAGE)
8977
AC_SUBST(MOZ_TOOLKIT_SEARCH)
8979
AC_SUBST(NS_PRINTING)
8981
AC_SUBST(MOZ_HELP_VIEWER)
8987
AC_SUBST(MOZ_PROFILELOCKING)
8990
AC_SUBST(MOZ_XIE_LIBS)
8992
AC_SUBST(BUILD_STATIC_LIBS)
8993
AC_SUBST(MOZ_ENABLE_LIBXUL)
8994
AC_SUBST(ENABLE_TESTS)
8996
AC_SUBST(MOZ_UNIVERSALCHARDET)
8997
AC_SUBST(ACCESSIBILITY)
8998
AC_SUBST(MOZ_SPELLCHECK)
8999
AC_SUBST(MOZ_USER_DIR)
9000
AC_SUBST(MOZ_CRASHREPORTER)
9001
AC_SUBST(MOZ_UPDATER)
9003
AC_SUBST(MOZ_DIRECTX_SDK_PATH)
9004
AC_SUBST(MOZ_DIRECTX_SDK_CPU_SUFFIX)
9005
AC_SUBST(MOZ_D3DX9_VERSION)
9006
AC_SUBST(MOZ_D3DX9_CAB)
9007
AC_SUBST(MOZ_D3DCOMPILER_CAB)
9008
AC_SUBST(MOZ_D3DX9_DLL)
9009
AC_SUBST(MOZ_D3DCOMPILER_DLL)
9011
AC_SUBST(ENABLE_STRIP)
9012
AC_SUBST(PKG_SKIP_STRIP)
9013
AC_SUBST(USE_ELF_DYNSTR_GC)
9014
AC_SUBST(USE_ELF_HACK)
9015
AC_SUBST(INCREMENTAL_LINKER)
9016
AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
9017
AC_SUBST(MOZ_JEMALLOC_STANDALONE_GLUE_LDOPTS)
9018
AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
9020
AC_SUBST(MOZ_FIX_LINK_PATHS)
9021
AC_SUBST(XPCOM_LIBS)
9022
AC_SUBST(XPCOM_FROZEN_LDOPTS)
9023
AC_SUBST(XPCOM_GLUE_LDOPTS)
9024
AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
9026
AC_SUBST(USE_DEPENDENT_LIBS)
9028
AC_SUBST(MOZ_BUILD_ROOT)
9029
AC_SUBST(MOZ_OS2_TOOLS)
9031
AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
9032
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
9033
AC_SUBST(MOZ_TIMELINE)
9034
AC_SUBST(OGLES_SDK_DIR)
9036
AC_SUBST(MOZ_APP_NAME)
9037
AC_SUBST(MOZ_APP_DISPLAYNAME)
9038
AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
9039
AC_SUBST(MOZ_APP_UA_NAME)
9040
AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
9041
AC_SUBST(MOZ_APP_VERSION)
9042
AC_DEFINE_UNQUOTED(MOZ_UA_BUILDID, "$MOZ_UA_BUILDID")
9043
AC_SUBST(MOZ_UA_BUILDID)
9045
AC_SUBST(MOZ_PKG_SPECIAL)
9047
AC_SUBST(MOZILLA_OFFICIAL)
9050
AC_SUBST(MOZ_MAPINFO)
9051
AC_SUBST(MOZ_BROWSE_INFO)
9052
AC_SUBST(MOZ_TOOLS_DIR)
9053
AC_SUBST(WIN32_REDIST_DIR)
9058
AC_SUBST(WINCE_SDK_DIR)
9059
AC_SUBST(WINCE_WINDOWS_MOBILE)
9061
dnl Echo the CFLAGS to remove extra whitespace.
9068
$_MOZ_EXCEPTIONS_FLAGS \
9069
$_WARNINGS_CXXFLAGS \
9072
COMPILE_CFLAGS=`echo \
9077
COMPILE_CXXFLAGS=`echo \
9078
$_DEFINES_CXXFLAGS \
9082
AC_SUBST(SYSTEM_MAKEDEPEND)
9083
AC_SUBST(SYSTEM_LIBXUL)
9084
AC_SUBST(SYSTEM_JPEG)
9085
AC_SUBST(SYSTEM_PNG)
9086
AC_SUBST(SYSTEM_ZLIB)
9087
AC_SUBST(SYSTEM_BZ2)
9089
AC_SUBST(JPEG_CFLAGS)
9091
AC_SUBST(ZLIB_CFLAGS)
9093
AC_SUBST(BZ2_CFLAGS)
9095
AC_SUBST(PNG_CFLAGS)
9098
AC_SUBST(MOZ_JPEG_CFLAGS)
9099
AC_SUBST(MOZ_JPEG_LIBS)
9100
AC_SUBST(MOZ_ZLIB_CFLAGS)
9101
AC_SUBST(MOZ_ZLIB_LIBS)
9102
AC_SUBST(MOZ_BZ2_CFLAGS)
9103
AC_SUBST(MOZ_BZ2_LIBS)
9104
AC_SUBST(MOZ_PNG_CFLAGS)
9105
AC_SUBST(MOZ_PNG_LIBS)
9107
AC_SUBST(NSPR_CFLAGS)
9109
AC_SUBST(MOZ_NATIVE_NSPR)
9111
AC_SUBST(NSS_CFLAGS)
9113
AC_SUBST(NSS_DEP_LIBS)
9114
AC_SUBST(MOZ_NATIVE_NSS)
9115
AC_SUBST(NSS_DISABLE_DBM)
9120
AC_SUBST(COMPILE_CFLAGS)
9121
AC_SUBST(COMPILE_CXXFLAGS)
9124
AC_SUBST(CROSS_COMPILE)
9125
AC_SUBST(WCHAR_CFLAGS)
9129
AC_SUBST(HOST_CFLAGS)
9130
AC_SUBST(HOST_CXXFLAGS)
9131
AC_SUBST(HOST_LDFLAGS)
9132
AC_SUBST(HOST_OPTIMIZE_FLAGS)
9134
AC_SUBST(HOST_AR_FLAGS)
9136
AC_SUBST(HOST_RANLIB)
9137
AC_SUBST(HOST_NSPR_MDCPUCFG)
9138
AC_SUBST(HOST_BIN_SUFFIX)
9139
AC_SUBST(HOST_OS_ARCH)
9141
AC_SUBST(TARGET_CPU)
9142
AC_SUBST(TARGET_VENDOR)
9144
AC_SUBST(TARGET_NSPR_MDCPUCFG)
9145
AC_SUBST(TARGET_MD_ARCH)
9146
AC_SUBST(TARGET_XPCOM_ABI)
9149
AC_SUBST(OS_RELEASE)
9152
AC_SUBST(INTEL_ARCHITECTURE)
9154
AC_SUBST(MOZ_DISABLE_JAR_PACKAGING)
9155
AC_SUBST(MOZ_CHROME_FILE_FORMAT)
9157
AC_SUBST(WRAP_MALLOC_CFLAGS)
9158
AC_SUBST(WRAP_MALLOC_LIB)
9161
AC_SUBST(MKSHLIB_FORCE_ALL)
9162
AC_SUBST(MKSHLIB_UNFORCE_ALL)
9163
AC_SUBST(DSO_CFLAGS)
9164
AC_SUBST(DSO_PIC_CFLAGS)
9165
AC_SUBST(DSO_LDOPTS)
9166
AC_SUBST(LIB_PREFIX)
9167
AC_SUBST(DLL_PREFIX)
9168
AC_SUBST(DLL_SUFFIX)
9169
AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
9170
AC_SUBST(LIB_SUFFIX)
9171
AC_SUBST(OBJ_SUFFIX)
9172
AC_SUBST(BIN_SUFFIX)
9173
AC_SUBST(ASM_SUFFIX)
9174
AC_SUBST(IMPORT_LIB_SUFFIX)
9176
AC_SUBST(CC_VERSION)
9177
AC_SUBST(CXX_VERSION)
9178
AC_SUBST(MSMANIFEST_TOOL)
9179
AC_SUBST(NS_ENABLE_TSF)
9180
AC_SUBST(MOZ_NSS_PATCH)
9181
AC_SUBST(MOZ_APP_COMPONENT_LIBS)
9182
AC_SUBST(MOZ_APP_EXTRA_LIBS)
9185
AC_SUBST(MOZ_SYDNEYAUDIO)
9187
AC_SUBST(MOZ_VORBIS)
9188
AC_SUBST(MOZ_TREMOR)
9191
AC_SUBST(MOZ_ALSA_LIBS)
9193
AC_SUBST(VPX_ASFLAGS)
9194
AC_SUBST(VPX_DASH_C_FLAG)
9195
AC_SUBST(VPX_AS_CONVERSION)
9196
AC_SUBST(VPX_ASM_SUFFIX)
9197
AC_SUBST(VPX_X86_ASM)
9198
AC_SUBST(VPX_ARM_ASM)
9199
AC_SUBST(LIBJPEG_TURBO_AS)
9200
AC_SUBST(LIBJPEG_TURBO_ASFLAGS)
9201
AC_SUBST(LIBJPEG_TURBO_X86_ASM)
9202
AC_SUBST(LIBJPEG_TURBO_X64_ASM)
9204
if test "$USING_HCC"; then
9205
CC='${topsrcdir}/build/hcc'
9207
CXX='${topsrcdir}/build/hcpp'
9208
CXX="$CXX '$_OLDCXX'"
9213
AC_MSG_CHECKING([for posix_fallocate])
9214
AC_TRY_LINK([#define _XOPEN_SOURCE 600
9215
#include <fcntl.h>],
9216
[posix_fallocate(0, 0, 0);],
9217
[ac_cv___posix_fallocate=true],
9218
[ac_cv___posix_fallocate=false])
9220
if test "$ac_cv___posix_fallocate" = true ; then
9221
AC_DEFINE(HAVE_POSIX_FALLOCATE)
9227
dnl Check for missing components
9228
if test "$COMPILE_ENVIRONMENT"; then
9229
if test "$MOZ_X11"; then
9230
dnl ====================================================
9231
dnl = Check if X headers exist
9232
dnl ====================================================
9233
_SAVE_CFLAGS=$CFLAGS
9234
CFLAGS="$CFLAGS $XCFLAGS"
9238
#include <X11/Xlib.h>
9239
#include <X11/Intrinsic.h>
9243
if ((dpy = XOpenDisplay(NULL)) == NULL) {
9244
fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
9248
[ AC_MSG_ERROR([Could not compile basic X program.]) ])
9249
CFLAGS="$_SAVE_CFLAGS"
9251
if test ! -z "$MISSING_X"; then
9252
AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
9257
dnl Check for headers, etc. needed by WebGL.
9258
if test -n "$MOZ_WEBGL_GLX"; then
9259
MOZ_CHECK_HEADER(GL/glx.h)
9260
if test "$ac_cv_header_GL_glx_h" != "yes"; then
9261
AC_MSG_ERROR([Can't find header GL/glx.h for WebGL (install mesa-common-dev (Ubuntu), mesa-libGL-devel (Fedora), or Mesa-devel (openSUSE))])
9264
fi # COMPILE_ENVIRONMENT
9266
if test "$USE_FC_FREETYPE"; then
9267
if test "$COMPILE_ENVIRONMENT"; then
9268
_SAVE_CPPFLAGS="$CPPFLAGS"
9269
CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
9270
AC_CHECK_HEADERS(fontconfig/fcfreetype.h, ,
9271
[AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)])
9272
CPPFLAGS="$_SAVE_CPPFLAGS"
9274
AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
9278
dnl Set various defines and substitutions
9279
dnl ========================================================
9281
if test "$OS_ARCH" = "Darwin"; then
9283
AC_DEFINE(UNIX_ASYNC_DNS)
9284
elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2" -a "$OS_ARCH" != "WINCE"; then
9286
AC_DEFINE(UNIX_ASYNC_DNS)
9289
if test "$MOZ_DEBUG"; then
9290
AC_DEFINE(MOZ_REFLOW_PERF)
9291
AC_DEFINE(MOZ_REFLOW_PERF_DSP)
9294
if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
9295
AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
9296
ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
9297
ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
9298
ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
9299
ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
9300
AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
9301
AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
9302
AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
9307
WIN_TOP_SRC=`cd $srcdir; pwd -W`
9311
AC_SUBST(WIN_TOP_SRC)
9313
AC_SUBST(MOZILLA_VERSION)
9315
AC_SUBST(ac_configure_args)
9317
dnl Spit out some output
9318
dnl ========================================================
9320
dnl The following defines are used by xpcom
9321
_NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
9323
HAVE_CPP_2BYTE_WCHAR_T
9324
HAVE_CPP_ACCESS_CHANGING_USING
9325
HAVE_CPP_AMBIGUITY_RESOLVING_USING
9328
HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
9330
HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
9331
HAVE_CPP_NAMESPACE_STD
9333
HAVE_CPP_PARTIAL_SPECIALIZATION
9334
HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
9336
HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
9338
NEED_CPP_UNUSED_IMPLEMENTATIONS
9342
HAVE_ICONV_WITH_CONST_INPUT
9350
netwerk/necko-config.h
9351
xpcom/xpcom-config.h
9352
xpcom/xpcom-private.h
9355
# Save the defines header file before autoconf removes it.
9356
# (Do not add AC_DEFINE calls after this line.)
9357
_CONFIG_TMP=confdefs-tmp.h
9358
_CONFIG_DEFS_H=mozilla-config.h
9360
cat > $_CONFIG_TMP <<\EOF
9361
/* List of defines generated by configure. Included with preprocessor flag,
9362
* -include, to avoid long list of -D defines on the compile command-line.
9366
#ifndef _MOZILLA_CONFIG_H_
9367
#define _MOZILLA_CONFIG_H_
9370
_EGREP_PATTERN='^#define ('
9371
if test -n "$_NON_GLOBAL_ACDEFINES"; then
9372
for f in $_NON_GLOBAL_ACDEFINES; do
9373
_EGREP_PATTERN="${_EGREP_PATTERN}$f|"
9376
_EGREP_PATTERN="${_EGREP_PATTERN}dummy_never_defined)"
9378
sort confdefs.h | egrep -v "$_EGREP_PATTERN" >> $_CONFIG_TMP
9380
cat >> $_CONFIG_TMP <<\EOF
9382
#endif /* _MOZILLA_CONFIG_H_ */
9386
# Only write mozilla-config.h when something changes (or it doesn't exist)
9387
if cmp -s $_CONFIG_TMP $_CONFIG_DEFS_H; then
9390
AC_MSG_RESULT("creating $_CONFIG_DEFS_H")
9391
mv -f $_CONFIG_TMP $_CONFIG_DEFS_H
9393
echo ==== $_CONFIG_DEFS_H =================================
9397
dnl Probably shouldn't call this manually but we always want the output of DEFS
9398
rm -f confdefs.h.save
9399
mv confdefs.h confdefs.h.save
9400
egrep -v "$_EGREP_PATTERN" confdefs.h.save > confdefs.h
9401
AC_OUTPUT_MAKE_DEFS()
9403
AC_SUBST(MOZ_DEFINES)
9405
mv confdefs.h.save confdefs.h
9407
dnl Load the list of Makefiles to generate.
9408
dnl To add new Makefiles, edit allmakefiles.sh.
9409
dnl allmakefiles.sh sets the variable, MAKEFILES.
9410
. ${srcdir}/allmakefiles.sh
9412
dnl Run a perl script to quickly create the makefiles.
9413
dnl If it succeeds, it outputs a shell command to set CONFIG_FILES
9414
dnl for the files it cannot handle correctly. This way, config.status
9415
dnl will handle these files.
9416
dnl If it fails, nothing is set and config.status will run as usual.
9418
dnl This does not change the $MAKEFILES variable.
9420
echo $MAKEFILES | ${PERL} $srcdir/build/autoconf/acoutput-fast.pl > conftest.sh
9424
echo $MAKEFILES > unallmakefiles
9426
mv -f config/autoconf.mk config/autoconf.mk.orig 2> /dev/null
9428
AC_OUTPUT($MAKEFILES)
9430
dnl Prevent the regeneration of cairo-features.h forcing rebuilds of gfx stuff
9431
if test "$CAIRO_FEATURES_H"; then
9432
if cmp -s $CAIRO_FEATURES_H "$CAIRO_FEATURES_H".orig; then
9433
echo "$CAIRO_FEATURES_H is unchanged"
9434
mv -f "$CAIRO_FEATURES_H".orig "$CAIRO_FEATURES_H" 2> /dev/null
9436
rm -f "$CAIRO_FEATURES_H".orig 2> /dev/null
9440
# Run freetype configure script
9442
if test "$MOZ_TREE_FREETYPE"; then
9443
export CFLAGS="$CFLAGS -std=c99"
9444
export CPPFLAGS="$CPPFLAGS"
9445
export CXXFLAGS="$CXXFLAGS"
9446
export LDFLAGS="$LDFLAGS"
9447
export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
9448
ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes"
9449
AC_OUTPUT_SUBDIRS(modules/freetype2)
9452
dnl ========================================================
9453
dnl = Setup a nice relatively clean build environment for
9454
dnl = sub-configures.
9455
dnl ========================================================
9458
CFLAGS="$_SUBDIR_CFLAGS"
9459
CPPFLAGS="$_SUBDIR_CPPFLAGS"
9460
CXXFLAGS="$_SUBDIR_CXXFLAGS"
9461
LDFLAGS="$_SUBDIR_LDFLAGS"
9462
HOST_CC="$_SUBDIR_HOST_CC"
9463
HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
9464
HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
9470
# No need to run subconfigures when building with LIBXUL_SDK_DIR
9471
if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
9473
if test -n "$MOZ_THUMB2"; then
9474
_SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --enable-thumb2"
9476
if test -n "$MOZ_ARM_ARCH"; then
9477
_SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --with-cpu-arch=$MOZ_ARM_ARCH"
9479
if test -n "$_WRAP_MALLOC"; then
9480
_SUBDIR_CONFIG_ARGS="$_SUBDIR_CONFIG_ARGS --enable-wrap-malloc"
9483
if test -z "$MOZ_NATIVE_NSPR"; then
9484
ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
9485
if test -z "$MOZ_DEBUG"; then
9486
ac_configure_args="$ac_configure_args --disable-debug"
9488
if test "$MOZ_OPTIMIZE" = "1"; then
9489
ac_configure_args="$ac_configure_args --enable-optimize"
9491
if test "$OS_ARCH" = "WINNT" -a "$NS_TRACE_MALLOC"; then
9492
ac_configure_args="$ac_configure_args --enable-debug --disable-optimize"
9494
if test -n "$HAVE_64BIT_OS"; then
9495
ac_configure_args="$ac_configure_args --enable-64bit"
9497
if test -n "$USE_ARM_KUSER"; then
9498
ac_configure_args="$ac_configure_args --with-arm-kuser"
9500
AC_OUTPUT_SUBDIRS(nsprpub)
9501
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9504
if test -z "$MOZ_NATIVE_NSPR"; then
9505
# Hack to deal with the fact that we use NSPR_CFLAGS everywhere
9506
AC_MSG_WARN([Recreating autoconf.mk with updated nspr-config output])
9507
if test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "WINCE"; then
9508
NSPR_LIBS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --libdir=$LIBXUL_DIST/lib --libs`
9509
$PERL -pi.bak -e "s '^NSPR_LIBS\\s*=.*'NSPR_LIBS = $NSPR_LIBS'" config/autoconf.mk
9510
NSPR_CFLAGS=`./nsprpub/config/nspr-config --prefix=$LIBXUL_DIST --exec-prefix=$MOZ_BUILD_ROOT/dist --includedir=$LIBXUL_DIST/include/nspr --cflags`
9511
$PERL -pi.bak -e "s '^NSPR_CFLAGS\\s*=.*'NSPR_CFLAGS = $NSPR_CFLAGS'" config/autoconf.mk
9513
rm -f config/autoconf.mk.bak
9516
# Run the SpiderMonkey 'configure' script.
9517
dist=$MOZ_BUILD_ROOT/dist
9518
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9519
ac_configure_args="$ac_configure_args --enable-threadsafe"
9520
if test "$BUILD_CTYPES"; then
9521
# Build js-ctypes on the platforms we can.
9522
ac_configure_args="$ac_configure_args --enable-ctypes"
9524
if test -z "$JS_SHARED_LIBRARY" ; then
9525
ac_configure_args="$ac_configure_args --disable-shared-js"
9527
if test -z "$MOZ_NATIVE_NSPR"; then
9528
ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
9529
ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
9531
ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
9532
ac_configure_args="$ac_configure_args --prefix=$dist"
9533
ac_configure_args="$ac_configure_args --with-sync-build-files=$_topsrcdir"
9534
if test "$MOZ_MEMORY"; then
9535
ac_configure_args="$ac_configure_args --enable-jemalloc"
9536
if test -n "$MOZ_MEMORY_LDFLAGS"; then
9537
export MOZ_MEMORY_LDFLAGS
9541
AC_OUTPUT_SUBDIRS(js/src)
9542
ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9544
fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR
9546
dnl Prevent the regeneration of autoconf.mk forcing rebuilds of the world
9547
dnl Needs to be at the end to respect possible changes from NSPR configure
9548
if cmp -s config/autoconf.mk config/autoconf.mk.orig; then
9549
echo "config/autoconf.mk is unchanged"
9550
mv -f config/autoconf.mk.orig config/autoconf.mk 2> /dev/null
9552
rm -f config/autoconf.mk.orig 2> /dev/null