1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2 dnl vi: set tabstop=4 shiftwidth=4 expandtab syntax=m4:
3 dnl This Source Code Form is subject to the terms of the Mozilla Public
4 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
5 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 dnl Process this file with autoconf to produce a configure script.
8 dnl ========================================================
11 AC_INIT(config/config.mk)
12 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
14 TARGET_CPU="${target_cpu}"
15 TARGET_VENDOR="${target_vendor}"
16 TARGET_OS="${target_os}"
18 MOZ_DEB_TIMESTAMP=`date +"%a, %d %b %Y %T %z" 2>&1`
19 AC_SUBST(MOZ_DEB_TIMESTAMP)
21 dnl ========================================================
23 dnl = Don't change the following two lines. Doing so breaks:
25 dnl = CFLAGS="-foo" ./configure
27 dnl ========================================================
29 CPPFLAGS="${CPPFLAGS=}"
30 CXXFLAGS="${CXXFLAGS=}"
32 HOST_CFLAGS="${HOST_CFLAGS=}"
33 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
34 HOST_LDFLAGS="${HOST_LDFLAGS=}"
36 dnl ========================================================
37 dnl = Preserve certain environment flags passed to configure
38 dnl = We want sub projects to receive the same flags
39 dnl = untainted by this configure script
40 dnl ========================================================
43 _SUBDIR_CFLAGS="$CFLAGS"
44 _SUBDIR_CPPFLAGS="$CPPFLAGS"
45 _SUBDIR_CXXFLAGS="$CXXFLAGS"
46 _SUBDIR_LDFLAGS="$LDFLAGS"
47 _SUBDIR_HOST_CC="$HOST_CC"
48 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
49 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
50 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
51 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
53 dnl Set the version number of the libs included with mozilla
54 dnl ========================================================
60 dnl Set the minimum version of toolkit libs used by mozilla
61 dnl ========================================================
64 PYTHON_VERSION_MAJOR=2
65 PYTHON_VERSION_MINOR=5
69 WINDRES_VERSION=2.14.90
75 STARTUP_NOTIFICATION_VERSION=0.8
81 dnl Set various checks
82 dnl ========================================================
86 dnl Initialize the Pthread test variables early so they can be
87 dnl overridden by each platform.
88 dnl ========================================================
92 dnl Do not allow a separate objdir build if a srcdir build exists.
93 dnl ==============================================================
94 _topsrcdir=`cd \`dirname $0\`; pwd`
97 if test "$_topsrcdir" != "$_objdir"
99 # Check for a couple representative files in the source tree
101 for file in $_topsrcdir/Makefile $_topsrcdir/config/autoconf.mk; do
102 if test -f $file; then
103 _conflict_files="$_conflict_files $file"
106 if test "$_conflict_files"; then
108 echo "* Your source tree contains these files:"
109 for file in $_conflict_files; do
113 * This indicates that you previously built in the source tree.
114 * A source tree build can confuse the separate objdir build.
116 * To clean up the source tree:
129 COMPILE_ENVIRONMENT=1
130 MOZ_ARG_DISABLE_BOOL(compile-environment,
131 [ --disable-compile-environment
132 Disable compiler/library checks.],
133 COMPILE_ENVIRONMENT= )
134 AC_SUBST(COMPILE_ENVIRONMENT)
136 MOZ_ARG_WITH_STRING(l10n-base,
137 [ --with-l10n-base=DIR path to l10n repositories],
138 L10NBASEDIR=$withval)
139 if test -n "$L10NBASEDIR"; then
140 if test "$L10NBASEDIR" = "yes" -o "$L10NBASEDIR" = "no"; then
141 AC_MSG_ERROR([--with-l10n-base must specify a path])
142 elif test -d "$L10NBASEDIR"; then
143 L10NBASEDIR=`cd "$L10NBASEDIR" && pwd`
145 AC_MSG_ERROR([Invalid value --with-l10n-base, $L10NBASEDIR doesn't exist])
148 AC_SUBST(L10NBASEDIR)
150 dnl Check for Perl first -- needed for win32 SDK checks
151 MOZ_PATH_PROGS(PERL, $PERL perl5 perl )
152 if test -z "$PERL" -o "$PERL" = ":"; then
153 AC_MSG_ERROR([perl not found in \$PATH])
157 if test -n "$GAIADIR" ; then
158 AC_DEFINE(PACKAGE_GAIA)
161 MOZ_ARG_WITH_STRING(gonk,
163 location of gonk dir],
166 MOZ_ARG_WITH_STRING(gonk-toolchain-prefix,
167 [ --with-gonk-toolchain-prefix=DIR
168 prefix to gonk toolchain commands],
169 gonk_toolchain_prefix=$withval)
171 if test -n "$gonkdir" ; then
172 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
173 android_source="$gonkdir"
174 ANDROID_SOURCE="$android_source"
175 ANDROID_NDK="${ANDROID_SOURCE}/ndk"
178 TOOLCHAIN_PREFIX="$gonk_toolchain_prefix"
179 AS="$gonk_toolchain_prefix"as
180 CC="$gonk_toolchain_prefix"gcc
181 CXX="$gonk_toolchain_prefix"g++
182 CPP="$gonk_toolchain_prefix"cpp
183 LD="$gonk_toolchain_prefix"ld
184 AR="$gonk_toolchain_prefix"ar
185 RANLIB="$gonk_toolchain_prefix"ranlib
186 STRIP="$gonk_toolchain_prefix"strip
188 STLPORT_CPPFLAGS="-I$gonkdir/ndk/sources/cxx-stl/stlport/stlport/"
189 STLPORT_LIBS="-lstlport"
191 case "$target_cpu" in
200 CPPFLAGS="-DANDROID -isystem $gonkdir/bionic/libc/$ARCH_DIR/include -isystem $gonkdir/bionic/libc/include/ -isystem $gonkdir/bionic/libc/kernel/common -isystem $gonkdir/bionic/libc/kernel/$ARCH_DIR -isystem $gonkdir/bionic/libm/include -I$gonkdir/frameworks/base/opengl/include -I$gonkdir/frameworks/base/native/include -I$gonkdir/hardware/libhardware/include -I$gonkdir/hardware/libhardware_legacy/include -I$gonkdir/system -I$gonkdir/system/core/include -isystem $gonkdir/bionic -I$gonkdir/frameworks/base/include -I$gonkdir/external/dbus -I$gonkdir/external/bluetooth/bluez/lib $CPPFLAGS -I$gonkdir/frameworks/base/services/sensorservice -I$gonkdir/frameworks/base/services/camera -I$gonkdir/system/media/wilhelm/include"
201 CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
202 CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS $STLPORT_CPPFLAGS"
203 dnl Add -llog by default, since we use it all over the place.
204 LIBS="$LIBS -llog $STLPORT_LIBS"
206 LDFLAGS="-mandroid -L$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib -Wl,-rpath-link=$gonkdir/out/target/product/$GONK_PRODUCT/obj/lib --sysroot=$gonkdir/out/target/product/$GONK_PRODUCT/obj/ $LDFLAGS"
208 dnl prevent cross compile section from using these flags as host flags
209 if test -z "$HOST_CPPFLAGS" ; then
212 if test -z "$HOST_CFLAGS" ; then
215 if test -z "$HOST_CXXFLAGS" ; then
218 if test -z "$HOST_LDFLAGS" ; then
223 AC_DEFINE(HAVE_SYS_UIO_H)
224 AC_DEFINE(HAVE_PTHREADS)
226 MOZ_CHROME_FILE_FORMAT=omni
232 *-android*|*-linuxandroid*)
233 if test -z "$ANDROID_PACKAGE_NAME" ; then
234 ANDROID_PACKAGE_NAME='org.mozilla.$(MOZ_APP_NAME)'
236 MOZ_CHROME_FILE_FORMAT=omni
240 AC_PATH_PROG(OBJCOPY,objcopy)
245 AC_SUBST(ANDROID_SOURCE)
246 AC_SUBST(ANDROID_PACKAGE_NAME)
249 dnl ========================================================
250 dnl Checks for compilers.
251 dnl ========================================================
252 dnl Set CROSS_COMPILE in the environment when running configure
253 dnl to use the cross-compile setup for now
254 dnl ========================================================
256 dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
259 if test "$COMPILE_ENVIRONMENT"; then
261 if test -n "$CROSS_COMPILE" -a "$target" != "$host"; then
262 echo "cross compiling from $host to $target"
266 _SAVE_CFLAGS="$CFLAGS"
267 _SAVE_LDFLAGS="$LDFLAGS"
269 AC_MSG_CHECKING([for host c compiler])
270 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
271 if test -z "$HOST_CC"; then
272 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
274 AC_MSG_RESULT([$HOST_CC])
275 AC_MSG_CHECKING([for host c++ compiler])
276 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
277 if test -z "$HOST_CXX"; then
278 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
280 AC_MSG_RESULT([$HOST_CXX])
282 if test -z "$HOST_CFLAGS"; then
283 HOST_CFLAGS="$CFLAGS"
285 if test -z "$HOST_CXXFLAGS"; then
286 HOST_CXXFLAGS="$CXXFLAGS"
288 if test -z "$HOST_LDFLAGS"; then
289 HOST_LDFLAGS="$LDFLAGS"
291 if test -z "$HOST_AR_FLAGS"; then
292 HOST_AR_FLAGS="$AR_FLAGS"
294 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
295 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
297 CFLAGS="$HOST_CFLAGS"
298 LDFLAGS="$HOST_LDFLAGS"
300 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
301 AC_TRY_COMPILE([], [return(0);],
302 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
303 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
306 CFLAGS="$HOST_CXXFLAGS"
308 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
309 AC_TRY_COMPILE([], [return(0);],
310 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
311 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
315 LDFLAGS=$_SAVE_LDFLAGS
317 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
320 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
324 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
325 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
326 MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
327 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
328 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
329 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
330 AC_DEFINE(CROSS_COMPILE)
335 # Work around the conftest.exe access problem on Windows
340 MOZ_PATH_PROGS(AS, $AS as, $CC)
341 AC_CHECK_PROGS(AR, ar, :)
342 AC_CHECK_PROGS(LD, ld, :)
343 AC_CHECK_PROGS(STRIP, strip, :)
344 AC_CHECK_PROGS(WINDRES, windres, :)
345 if test -z "$HOST_CC"; then
348 if test -z "$HOST_CFLAGS"; then
349 HOST_CFLAGS="$CFLAGS"
351 if test -z "$HOST_CXX"; then
354 if test -z "$HOST_CXXFLAGS"; then
355 HOST_CXXFLAGS="$CXXFLAGS"
357 if test -z "$HOST_LDFLAGS"; then
358 HOST_LDFLAGS="$LDFLAGS"
360 if test -z "$HOST_RANLIB"; then
361 HOST_RANLIB="$RANLIB"
363 if test -z "$HOST_AR"; then
366 if test -z "$HOST_AR_FLAGS"; then
367 HOST_AR_FLAGS="$AR_FLAGS"
371 if test -n "$MOZ_WINCONSOLE"; then
372 AC_DEFINE(MOZ_WINCONSOLE)
377 dnl ========================================================
378 dnl Special win32 checks
379 dnl ========================================================
381 # With win8, sdk target=602, WINVER=602
382 MOZ_ARG_ENABLE_BOOL(metro,
383 [ --enable-metro Enable Windows Metro build targets],
386 if test -n "$MOZ_METRO"; then
388 # Target the Windows 8 Kit
390 # Allow a higher api set
392 # toolkit/library/makefile.in needs these, see nsDllMain.
394 CRTEXPDLLVERSION=1-1-0
396 # Target the Windows 7 SDK by default
401 AC_SUBST(CRTDLLVERSION)
402 AC_SUBST(CRTEXPDLLVERSION)
404 if test -n "$MOZ_METRO"; then
409 AC_MSG_ERROR([Metro builds only valid on the windows platform.]);
414 MOZ_ARG_WITH_STRING(windows-version,
415 [ --with-windows-version=WINSDK_TARGETVER
416 Windows SDK version to target. Lowest version
417 currently allowed is 601 (Win7), highest is 602 (Win8)],
418 WINSDK_TARGETVER=$withval)
420 # Currently only two sdk versions allowed, 601 and 602
421 case "$WINSDK_TARGETVER" in
423 MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
427 AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER)]);
433 if test "$GCC" != "yes"; then
434 # Check to see if we are really running in a msvc environemnt
436 AC_CHECK_PROGS(MIDL, midl)
438 # Make sure compilers are valid
439 CFLAGS="$CFLAGS -TC -nologo"
440 CXXFLAGS="$CXXFLAGS -TP -nologo"
443 AC_TRY_COMPILE([#include <stdio.h>],
444 [ printf("Hello World\n"); ],,
445 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
448 AC_TRY_COMPILE([#include <new.h>],
449 [ unsigned *test = new unsigned(42); ],,
450 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
454 _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
457 # Determine compiler version
458 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
459 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
460 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
461 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
462 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
463 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
465 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
466 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
468 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
469 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
472 if test "$_CC_MAJOR_VERSION" = "14"; then
473 dnl Require VC8SP1 or newer.
474 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762.
475 if test "$_CC_RELEASE" -lt 50727 -o \
476 \( "$_CC_RELEASE" -eq 50727 -a "$_CC_BUILD" -lt 762 \); then
477 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.])
482 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
483 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
484 elif test "$_CC_MAJOR_VERSION" = "15"; then
487 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
488 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
489 elif test "$_CC_MAJOR_VERSION" = "16"; then
492 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
493 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
494 elif test "$_CC_MAJOR_VERSION" = "17"; then
497 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
498 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
500 AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
503 AC_DEFINE(HAVE_SEH_EXCEPTIONS)
505 if test -n "$WIN32_REDIST_DIR"; then
506 if test ! -d "$WIN32_REDIST_DIR"; then
507 AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
509 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
512 dnl Confirm we have the pri tools on win8 builds
513 if test -n "$MOZ_METRO"; then
514 AC_MSG_CHECKING([for makepri])
515 AC_CHECK_PROGS(MAKEPRI, makepri, "")
516 if test -z "MAKEPRI" ; then
517 AC_MSG_ERROR([makepri.exe is required for generating metro browser install components. It should be in the Win8 SDK.])
522 dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
523 dnl not something else like "magnetic tape manipulation utility".
524 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
525 if test -z "$MSMT_TOOL"; then
526 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
530 _MSMT_VER_FILTER='s|.*[^!-~]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
532 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
533 if test -z "$MSMANIFEST_TOOL_VERSION"; then
534 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
540 # Check linker version
541 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
542 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
543 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
544 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
550 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
551 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
552 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
553 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
554 # Add flags if necessary
555 AC_MSG_CHECKING([for midl flags])
558 if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
559 # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
560 # MIDL version 7.00.0500 or later has no problem.
561 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
562 AC_MSG_RESULT([need -env win32])
564 AC_MSG_RESULT([none needed])
568 MIDL_FLAGS="${MIDL_FLAGS} -env x64"
571 AC_MSG_RESULT([none needed])
575 # Identify which version of the SDK we're building with
576 # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
578 MOZ_CHECK_HEADERS([winsdkver.h])
579 if test "$ac_cv_header_winsdkver_h" = "yes"; then
580 # Get the highest _WIN32_WINNT and NTDDI versions supported
581 # Take the higher of the two
582 # This is done because the Windows 7 beta SDK reports its
583 # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
584 AC_CACHE_CHECK(for highest Windows version supported by this SDK,
586 [cat > conftest.h <<EOF
587 #include <winsdkver.h>
588 #include <sdkddkver.h>
590 #if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
591 #define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
593 #define WINSDK_MAXVER NTDDI_MAXVER
598 ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
601 MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
603 # Any SDK which doesn't have WinSDKVer.h is too old.
604 AC_MSG_ERROR([Your SDK does not have WinSDKVer.h. It is probably too old. Please upgrade to a newer SDK or 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.])
607 unset _MSVC_VER_FILTER
609 AC_CACHE_CHECK(for std::_Throw, ac_cv_have_std__Throw,
613 _SAVE_CXXFLAGS="$CXXFLAGS"
614 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
615 AC_TRY_COMPILE([#include <exception>],
616 [std::_Throw(std::exception()); return 0;],
617 ac_cv_have_std__Throw="yes",
618 ac_cv_have_std__Throw="no")
619 CXXFLAGS="$_SAVE_CXXFLAGS"
623 if test "$ac_cv_have_std__Throw" = "yes"; then
624 AC_CACHE_CHECK(for |class __declspec(dllimport) exception| bug,
625 ac_cv_have_dllimport_exception_bug,
629 _SAVE_CXXFLAGS="$CXXFLAGS"
630 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
631 AC_TRY_LINK([#include <vector>],
632 [std::vector<int> v; return v.at(1);],
633 ac_cv_have_dllimport_exception_bug="no",
634 ac_cv_have_dllimport_exception_bug="yes")
635 CXXFLAGS="$_SAVE_CXXFLAGS"
638 if test "$ac_cv_have_dllimport_exception_bug" = "no"; then
640 MOZ_MSVC_STL_WRAP__Throw=1
641 AC_DEFINE(MOZ_MSVC_STL_WRAP__Throw)
644 AC_CACHE_CHECK(for overridable _RAISE,
649 _SAVE_CXXFLAGS="$CXXFLAGS"
650 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
651 AC_TRY_COMPILE([#include <xstddef>
653 #define _RAISE(x) externallyDefinedFunction((x).what())
656 [std::vector<int> v; return v.at(1);],
657 ac_cv_have__RAISE="no",
658 ac_cv_have__RAISE="yes")
659 CXXFLAGS="$_SAVE_CXXFLAGS"
662 if test "$ac_cv_have__RAISE" = "yes"; then
664 MOZ_MSVC_STL_WRAP__RAISE=1
665 AC_DEFINE(MOZ_MSVC_STL_WRAP__RAISE)
667 AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.])
671 if test "$WRAP_STL_INCLUDES" = "1"; then
672 STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers'
675 # Check w32api version
676 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
677 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
678 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
679 AC_TRY_COMPILE([#include <w32api.h>],
680 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
681 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
682 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
683 #error "test failed."
685 , [ res=yes ], [ res=no ])
686 AC_MSG_RESULT([$res])
687 if test "$res" != "yes"; then
688 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
690 # Check windres version
691 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
692 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
693 AC_MSG_RESULT([$_WINDRES_VERSION])
694 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
695 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
696 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
697 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
698 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
699 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
700 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
701 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
702 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
703 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
704 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
705 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
707 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
710 MOZ_WINSDK_MAXVER=0x06020000
713 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
714 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
715 # Require OS features provided by IE 6.0 SP2 (XP SP2)
716 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0603)
718 # If the maximum version supported by this SDK is lower than the target
720 AC_MSG_CHECKING([for Windows SDK being recent enough])
721 if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
725 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.])
728 # Make sure the sdk / code we're targeting has the right toolset
729 AC_MSG_CHECKING([SDK and tools are in sync])
730 if test -n "$MOZ_METRO"; then
731 if test "$MOZ_MSVCVERSION" -gt "10"; then
735 AC_MSG_ERROR([Your MOZ_MSVCVERSION equals $MOZ_MSVCVERSION and you've enabled metro build support. You can't target metro without msvc 11 or higher. Disable metro support or switch to a newer set of tools.])
739 AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
740 # Definitions matching sdkddkver.h
741 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
748 if test -n "$_WIN32_MSVC"; then
750 SKIP_COMPILER_CHECKS=1
751 SKIP_LIBRARY_CHECKS=1
753 # Since we're skipping compiler and library checks, hard-code
756 AC_DEFINE(HAVE_SETBUF)
757 AC_DEFINE(HAVE_ISATTY)
760 fi # COMPILE_ENVIRONMENT
773 AC_SUBST(WRAP_STL_INCLUDES)
774 AC_SUBST(MOZ_MSVC_STL_WRAP__Throw)
775 AC_SUBST(MOZ_MSVC_STL_WRAP__RAISE)
777 dnl ========================================================
778 dnl Checks for programs.
779 dnl ========================================================
783 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
784 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
785 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
787 AC_MSG_RESULT([$_perl_version])
789 if test "$_perl_res" != 0; then
790 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
794 AC_MSG_CHECKING([for full perl installation])
795 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
797 if test "$_perl_res" != 0; then
799 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
804 MOZ_PATH_PROGS(PYTHON, $PYTHON python2.7 python2.6 python2.5 python)
805 if test -z "$PYTHON"; then
806 AC_MSG_ERROR([python was not found in \$PATH])
809 MOZ_ARG_WITH_BOOL(system-ply,
810 [ --with-system-ply Use system installed python ply library],
811 [if $PYTHON -c 'import ply' 2>&5; then
814 AC_MSG_ERROR([python ply library is not found but --with-system-ply was requested])
817 AC_SUBST(MOZ_SYSTEM_PLY)
819 if test -z "$COMPILE_ENVIRONMENT"; then
820 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
822 AC_SUBST(NSINSTALL_BIN)
824 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
825 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
826 MOZ_PATH_PROGS(UNZIP, unzip)
827 if test -z "$UNZIP" -o "$UNZIP" = ":"; then
828 AC_MSG_ERROR([unzip not found in \$PATH])
830 MOZ_PATH_PROGS(ZIP, zip)
831 if test -z "$ZIP" -o "$ZIP" = ":"; then
832 AC_MSG_ERROR([zip not found in \$PATH])
834 MOZ_PATH_PROG(XARGS, xargs)
835 if test -z "$XARGS" -o "$XARGS" = ":"; then
836 AC_MSG_ERROR([xargs not found in \$PATH .])
839 MOZ_PATH_PROG(RPMBUILD, rpmbuild, :)
842 if test "$COMPILE_ENVIRONMENT"; then
844 dnl ========================================================
845 dnl = Mac OS X toolchain support
846 dnl ========================================================
850 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
851 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
852 dnl the environment and includedir purposes (when using an SDK, below),
853 dnl but remember the full version number for the libdir (SDK).
855 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
856 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
858 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
859 dnl Bug 280479, but this keeps popping up in bug 292530 too because
860 dnl 4.0.0/4061 is the default compiler in Tiger.
862 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
864 if test "$GCC_BUILD" = "4061" ; then
865 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
866 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
867 from building Mozilla. Upgrade to Xcode 2.1 or later.])
871 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
872 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
873 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
874 MOZ_PATH_PROGS(PBBUILD_BIN, pbbuild xcodebuild pbxbuild)
876 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
877 dnl it has moved into /usr/bin.
878 MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
882 AC_SUBST(GCC_VERSION)
884 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
885 dnl that a universal binary is being produced and MOZ_CAN_RUN_PROGRAMS
886 dnl when we can run target binaries.
887 AC_SUBST(UNIVERSAL_BINARY)
888 AC_SUBST(MOZ_CAN_RUN_PROGRAMS)
890 dnl ========================================================
891 dnl Check for MacOS deployment target version
892 dnl ========================================================
894 MOZ_ARG_ENABLE_STRING(macos-target,
895 [ --enable-macos-target=VER (default=10.6)
896 Set the minimum MacOS version needed at runtime],
897 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
901 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
902 dnl Use the specified value
903 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
905 dnl No value specified on the command line or in the environment,
906 dnl use architecture minimum.
907 export MACOSX_DEPLOYMENT_TARGET=10.6
912 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
914 dnl ========================================================
915 dnl = Mac OS X SDK support
916 dnl ========================================================
919 MOZ_ARG_WITH_STRING(macos-sdk,
920 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
921 MACOS_SDK_DIR=$withval)
923 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
924 dnl NEXT_ROOT will be set and exported only if it's needed.
925 AC_SUBST(MACOS_SDK_DIR)
928 if test "$MACOS_SDK_DIR"; then
929 dnl Sync this section with the ones in NSPR and NSS.
930 dnl Changes to the cross environment here need to be accounted for in
931 dnl the libIDL checks (below) and xpidl build.
933 if test ! -d "$MACOS_SDK_DIR"; then
934 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
935 specify a valid SDK. SDKs are installed when the optional cross-development
936 tools are selected during the Xcode/Developer Tools installation.])
939 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
940 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
941 AC_MSG_ERROR([You need to upgrade the compiler version to 4.x])
943 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
944 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
946 dnl CPP/CXXCPP needs to be set for MOZ_CHECK_HEADER.
947 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
948 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
950 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
951 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
952 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
953 dnl be ignored and cause warnings when -syslibroot is specified.
954 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
955 dnl the -isysroot it receives, so this is only needed with 4.0.0.
956 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
961 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
963 AC_TRY_COMPILE([#include <new>],[],
967 AC_MSG_RESULT($result)
969 if test "$result" = "no" ; then
970 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
974 fi # COMPILE_ENVIRONMENT
976 AC_MSG_CHECKING([compiler version])
977 # Just print it so it shows up in the logs.
978 cc_version=$($CC --version)
979 AC_MSG_RESULT([$cc_version])
981 if test -n "$MAKE"; then
982 if test `echo $MAKE | grep -c make.py` != 1; then
989 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
992 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
995 if test "$GMAKE" = ":"; then
996 AC_MSG_ERROR([GNU make not found])
1000 if test -z "$MAKE"; then
1004 if test "$COMPILE_ENVIRONMENT"; then
1010 fi # COMPILE_ENVIRONMENT
1012 dnl ========================================================
1013 dnl set the defaults first
1014 dnl ========================================================
1017 AR_EXTRACT='$(AR) x'
1030 MOZ_USER_DIR=".mozilla"
1033 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/media/libjpeg)'
1035 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1037 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)'
1039 MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
1040 MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
1041 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core -lmozalloc'
1042 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1043 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom -lmozalloc'
1044 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1045 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1046 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1048 # These are specially defined on Windows only
1051 XPCOM_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1052 XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime.$(LIB_SUFFIX)'
1055 XPCOM_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_GLUE_LDOPTS
1056 XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_STANDALONE_GLUE_LDOPTS
1062 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1064 USE_DEPENDENT_LIBS=1
1066 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1068 if test -n "$CROSS_COMPILE"; then
1069 OS_TARGET="${target_os}"
1070 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1072 case "${target_os}" in
1073 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1074 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1075 gnu*) OS_ARCH=GNU ;;
1076 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1077 mingw*) OS_ARCH=WINNT OS_TARGET=WINNT ;;
1078 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1081 *-android*|*-linuxandroid*) OS_ARCH=Linux OS_TARGET=Android ;;
1084 OS_TARGET=`uname -s`
1085 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1086 OS_RELEASE=`uname -r`
1089 # Before this used `uname -m` when not cross compiling
1090 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
1091 OS_TEST="${target_cpu}"
1093 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1095 #######################################################################
1096 # Master "Core Components" macros for getting the OS target #
1097 #######################################################################
1100 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1101 # cross-compilation.
1105 # Define and override various archtecture-specific variables, including
1114 case "$HOST_OS_ARCH" in
1128 if test -z "$GNU_CC"; then
1129 if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1134 if test -z "$GNU_CXX"; then
1135 if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1136 SOLARIS_SUNPRO_CXX=1
1139 AC_SUBST(SOLARIS_SUNPRO_CC)
1140 AC_SUBST(SOLARIS_SUNPRO_CXX)
1152 if test -z "$CROSS_COMPILE" ; then
1158 # If uname -s returns "Windows_NT", we assume that we are using
1159 # the uname.exe in MKS toolkit.
1161 # The -r option of MKS uname only returns the major version number.
1162 # So we need to use its -v option to get the minor version number.
1163 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1167 OS_MINOR_RELEASE=`uname -v`
1168 if test "$OS_MINOR_RELEASE" = "00"; then
1171 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1175 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1176 # the uname.exe in the MSYS tools.
1178 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1183 OS_RELEASE=`uname -v`.`uname -r`
1184 OS_TEST=${target_cpu}
1192 OS_RELEASE=`uname -v`
1195 case "${target_cpu}" in
1206 if test -z "$CROSS_COMPILE" ; then
1214 # Only set CPU_ARCH if we recognize the value of OS_TEST
1225 powerpc | ppc | rs6000)
1229 Alpha | alpha | ALPHA)
1262 if test -z "$OS_TARGET"; then
1265 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1267 dnl Set INTEL_ARCHITECTURE if we're compiling for x86-32 or x86-64.
1268 dnl ===============================================================
1272 INTEL_ARCHITECTURE=1
1275 dnl Configure platform-specific CPU architecture compiler options.
1276 dnl ==============================================================
1279 dnl =================================================================
1280 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1281 dnl which is bad when cross compiling.
1282 dnl =================================================================
1283 if test "$COMPILE_ENVIRONMENT"; then
1284 configure_static_assert_macros='
1285 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1286 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1287 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1290 dnl test that the macros actually work:
1291 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1292 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1295 ac_cv_static_assertion_macros_work="yes"
1296 AC_TRY_COMPILE([$configure_static_assert_macros],
1297 [CONFIGURE_STATIC_ASSERT(1)],
1299 ac_cv_static_assertion_macros_work="no")
1300 AC_TRY_COMPILE([$configure_static_assert_macros],
1301 [CONFIGURE_STATIC_ASSERT(0)],
1302 ac_cv_static_assertion_macros_work="no",
1305 AC_TRY_COMPILE([$configure_static_assert_macros],
1306 [CONFIGURE_STATIC_ASSERT(1)],
1308 ac_cv_static_assertion_macros_work="no")
1309 AC_TRY_COMPILE([$configure_static_assert_macros],
1310 [CONFIGURE_STATIC_ASSERT(0)],
1311 ac_cv_static_assertion_macros_work="no",
1315 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1316 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1317 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1319 fi # COMPILE_ENVIRONMENT
1321 dnl ========================================================
1322 dnl Android libstdc++, placed here so it can use MOZ_ARCH
1324 dnl ========================================================
1328 dnl ========================================================
1329 dnl Suppress Clang Argument Warnings
1330 dnl ========================================================
1331 if test -n "$CLANG_CC"; then
1332 _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
1333 CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
1335 if test -n "$CLANG_CXX"; then
1336 _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
1339 dnl ========================================================
1340 dnl = Use Address Sanitizer
1341 dnl ========================================================
1342 MOZ_ARG_ENABLE_BOOL(address-sanitizer,
1343 [ --enable-address-sanitizer Enable Address Sanitizer (default=no)],
1346 if test -n "$MOZ_ASAN"; then
1352 dnl ========================================================
1353 dnl = Enable hacks required for LLVM instrumentations
1354 dnl ========================================================
1355 MOZ_ARG_ENABLE_BOOL(llvm-hacks,
1356 [ --enable-llvm-hacks Enable workarounds required for several LLVM instrumentations (default=no)],
1359 if test -n "$MOZ_LLVM_HACKS"; then
1363 AC_SUBST(MOZ_NO_WLZDEFS)
1364 AC_SUBST(MOZ_CFLAGS_NSS)
1366 dnl ========================================================
1367 dnl GNU specific defaults
1368 dnl ========================================================
1369 if test "$GNU_CC"; then
1370 # FIXME: Let us build with strict aliasing. bug 414641.
1371 CFLAGS="$CFLAGS -fno-strict-aliasing"
1372 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1373 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1374 DSO_LDOPTS='-shared'
1375 if test "$GCC_USE_GNU_LD"; then
1376 # Some tools like ASan use a runtime library that is only
1377 # linked against executables, so we must allow undefined
1378 # symbols for shared objects in some cases.
1379 if test -z "$MOZ_NO_WLZDEFS"; then
1380 # Don't allow undefined symbols in libraries
1381 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1384 WARNINGS_AS_ERRORS='-Werror -Wno-error=uninitialized'
1386 DSO_PIC_CFLAGS='-fPIC'
1387 ASFLAGS="$ASFLAGS -fPIC"
1388 AC_MSG_CHECKING([for --noexecstack option to as])
1389 _SAVE_CFLAGS=$CFLAGS
1390 CFLAGS="$CFLAGS -Wa,--noexecstack"
1391 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
1392 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
1393 AC_MSG_RESULT([no]))
1394 CFLAGS=$_SAVE_CFLAGS
1395 AC_MSG_CHECKING([for -z noexecstack option to ld])
1396 _SAVE_LDFLAGS=$LDFLAGS
1397 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
1398 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
1400 LDFLAGS=$_SAVE_LDFLAGS)
1402 # Check for -mssse3 on $CC
1403 AC_MSG_CHECKING([if toolchain supports -mssse3 option])
1404 HAVE_TOOLCHAIN_SUPPORT_MSSSE3=
1405 _SAVE_CFLAGS=$CFLAGS
1406 CFLAGS="$CFLAGS -mssse3"
1407 AC_TRY_COMPILE([asm ("pmaddubsw %xmm2,%xmm3");],,AC_MSG_RESULT([yes])
1408 [HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1],
1409 AC_MSG_RESULT([no]))
1410 CFLAGS=$_SAVE_CFLAGS
1411 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
1413 # Turn on GNU-specific warnings:
1414 # -Wall - turn on a lot of warnings
1415 # -pedantic - this is turned on below
1416 # -Wpointer-arith - enabled with -pedantic, but good to have even if not
1417 # -Wdeclaration-after-statement - MSVC doesn't like these
1418 # -Werror=return-type - catches missing returns, zero false positives
1419 # -Wtype-limits - catches overflow bugs, few false positives
1420 # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
1422 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
1423 MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type)
1424 MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits)
1425 MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body)
1427 # Turn off the following warnings that -Wall/-pedantic turn on:
1428 # -Wno-unused - lots of violations in third-party code
1429 # -Wno-overlength-strings - we exceed the minimum maximum length frequently
1431 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused"
1432 MOZ_C_SUPPORTS_WARNING(-Wno-, overlength-strings, ac_c_has_wno_overlength_strings)
1434 if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then
1435 # Don't use -Wcast-align with ICC or clang
1437 # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
1438 hppa | ia64 | sparc | arm)
1441 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1446 dnl Turn pedantic on but disable the warnings for long long
1449 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1450 _USE_CPP_INCLUDE_FLAG=1
1452 elif test "$SOLARIS_SUNPRO_CC"; then
1454 if test "$CPU_ARCH" = "sparc"; then
1455 # for Sun Studio on Solaris/SPARC
1456 DSO_PIC_CFLAGS='-xcode=pic32'
1458 DSO_PIC_CFLAGS='-KPIC'
1460 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1462 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1463 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1465 DSO_LDOPTS='-shared'
1466 if test "$GNU_LD"; then
1467 # Don't allow undefined symbols in libraries
1468 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1472 DSO_PIC_CFLAGS='-KPIC'
1473 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1476 if test "$GNU_CXX"; then
1477 # FIXME: Let us build with strict aliasing. bug 414641.
1478 CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"
1480 # Turn on GNU-specific warnings:
1481 # -Wall - turn on a lot of warnings
1482 # -pedantic - this is turned on below
1483 # -Wpointer-arith - enabled with -pedantic, but good to have even if not
1484 # -Woverloaded-virtual - ???
1485 # -Werror=return-type - catches missing returns, zero false positives
1486 # -Wtype-limits - catches overflow bugs, few false positives
1487 # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
1489 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
1490 MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type)
1491 MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits)
1492 MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body)
1494 # Turn off the following warnings that -Wall/-pedantic turn on:
1495 # -Wno-ctor-dtor-privacy - ???
1496 # -Wno-overlength-strings - we exceed the minimum maximum length frequently
1497 # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently
1498 # -Wno-variadic-macros - ???
1500 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-ctor-dtor-privacy"
1501 MOZ_CXX_SUPPORTS_WARNING(-Wno-, overlength-strings, ac_cxx_has_wno_overlength_strings)
1502 MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof)
1503 MOZ_CXX_SUPPORTS_WARNING(-Wno-, variadic-macros, ac_cxx_has_wno_variadic_macros)
1505 if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then
1506 # Don't use -Wcast-align with ICC or clang
1508 # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
1509 hppa | ia64 | sparc | arm)
1512 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1517 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1518 _USE_CPP_INCLUDE_FLAG=1
1520 # Recent clang and gcc support C++11 deleted functions without warnings if
1521 # compiling with -std=c++0x or -std=gnu++0x (or c++11 or gnu++11 in very new
1522 # versions). We can't use -std=c++0x yet, so gcc's support must remain
1523 # unused. But clang's warning can be disabled, so when compiling with clang
1524 # we use it to opt out of the warning, enabling (macro-encapsulated) use of
1525 # deleted function syntax.
1526 if test "$CLANG_CXX"; then
1527 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions"
1528 MOZ_CXX_SUPPORTS_WARNING(-Wno-, extended-offsetof, ac_cxx_has_wno_extended_offsetof)
1532 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1535 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1536 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1537 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1538 dnl normal behavior.
1539 dnl ========================================================
1541 MKSHLIB_UNFORCE_ALL=
1543 if test "$COMPILE_ENVIRONMENT"; then
1544 if test "$GNU_CC"; then
1545 AC_MSG_CHECKING(whether ld has archive extraction flags)
1546 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1547 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1548 ac_cv_mkshlib_force_and_unforce="no"
1549 exec 3<&0 <<LOOP_INPUT
1550 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1551 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1552 force="-Wl,-all"; unforce="-Wl,-none"
1559 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1562 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1564 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1568 eval $ac_cv_mkshlib_force_and_unforce
1569 MKSHLIB_FORCE_ALL=$force
1570 MKSHLIB_UNFORCE_ALL=$unforce
1573 fi # COMPILE_ENVIRONMENT
1575 dnl ========================================================
1576 dnl Checking for 64-bit OS
1577 dnl ========================================================
1578 if test "$COMPILE_ENVIRONMENT"; then
1581 AC_MSG_CHECKING(for 64-bit OS)
1582 AC_TRY_COMPILE([$configure_static_assert_macros],
1583 [CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)],
1584 result="yes", result="no")
1585 AC_MSG_RESULT("$result")
1586 if test "$result" = "yes"; then
1587 AC_DEFINE(HAVE_64BIT_OS)
1590 AC_SUBST(HAVE_64BIT_OS)
1592 fi # COMPILE_ENVIRONMENT
1594 dnl ========================================================
1595 dnl Enable high-memory support on OS/2 by default.
1596 dnl ========================================================
1597 MOZ_OS2_HIGH_MEMORY=1
1598 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1599 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1600 MOZ_OS2_HIGH_MEMORY=,
1601 MOZ_OS2_HIGH_MEMORY=1 )
1602 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1604 dnl ========================================================
1605 dnl = Use profiling compile flags
1606 dnl ========================================================
1607 MOZ_ARG_ENABLE_BOOL(profiling,
1608 [ --enable-profiling Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
1612 # For profiling builds keep the symbol information
1613 if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
1614 STRIP_FLAGS="--strip-debug"
1617 dnl ========================================================
1618 dnl = Use incremental GC
1619 dnl ========================================================
1621 MOZ_ARG_DISABLE_BOOL(gcincremental,
1622 [ --disable-gcincremental Disable incremental GC],
1624 if test -n "$JSGC_INCREMENTAL"; then
1625 AC_DEFINE(JSGC_INCREMENTAL)
1628 dnl ========================================================
1629 dnl = Use generational GC
1630 dnl ========================================================
1631 MOZ_ARG_ENABLE_BOOL(gcgenerational,
1632 [ --enable-gcgenerational Enable generational GC],
1633 JSGC_GENERATIONAL=1,
1634 JSGC_GENERATIONAL= )
1635 if test -n "$JSGC_GENERATIONAL"; then
1636 AC_DEFINE(JSGC_GENERATIONAL)
1639 dnl ========================================================
1640 dnl = Perform moving GC stack rooting analysis
1641 dnl ========================================================
1642 MOZ_ARG_ENABLE_BOOL(root-analysis,
1643 [ --enable-root-analysis Enable moving GC stack root analysis],
1644 JSGC_ROOT_ANALYSIS=1,
1645 JSGC_ROOT_ANALYSIS= )
1646 if test -n "$JSGC_ROOT_ANALYSIS"; then
1647 AC_DEFINE(JSGC_ROOT_ANALYSIS)
1650 dnl ========================================================
1651 dnl = Use exact stack rooting for GC
1652 dnl ========================================================
1653 MOZ_ARG_ENABLE_BOOL(exact-rooting,
1654 [ --enable-exact-rooting Enable use of exact stack roots for GC],
1655 JSGC_USE_EXACT_ROOTING=1,
1656 JSGC_USE_EXACT_ROOTING= )
1657 if test -n "$JSGC_USE_EXACT_ROOTING"; then
1658 AC_DEFINE(JSGC_USE_EXACT_ROOTING)
1661 dnl ========================================================
1663 dnl ========================================================
1664 MOZ_ARG_ENABLE_BOOL(valgrind,
1665 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
1668 if test -n "$MOZ_VALGRIND"; then
1669 MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
1671 [--enable-valgrind specified but Valgrind is not installed]))
1672 AC_DEFINE(MOZ_VALGRIND)
1674 AC_SUBST(MOZ_VALGRIND)
1676 dnl ========================================================
1678 dnl ========================================================
1679 MOZ_ARG_ENABLE_BOOL(dmd,
1680 [ --enable-dmd Enable DMD; also disables jemalloc (default=no)],
1683 if test -n "$MOZ_DMD"; then
1684 MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
1686 [--enable-dmd specified but Valgrind is not installed]))
1690 dnl ========================================================
1692 dnl ========================================================
1693 MOZ_ARG_ENABLE_BOOL(jprof,
1694 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.],
1697 if test -n "$MOZ_JPROF"; then
1699 AC_DEFINE(MOZ_JPROF)
1702 dnl ========================================================
1704 dnl ========================================================
1705 MOZ_ENABLE_PROFILER_SPS=1
1707 case "${OS_TARGET}" in
1709 case "${CPU_ARCH}" in
1712 MOZ_ENABLE_PROFILER_SPS=
1716 case "${CPU_ARCH}" in
1719 MOZ_ENABLE_PROFILER_SPS=
1724 MOZ_ENABLE_PROFILER_SPS=
1728 if test -n "$MOZ_ENABLE_PROFILER_SPS"; then
1729 AC_DEFINE(MOZ_ENABLE_PROFILER_SPS)
1732 dnl ========================================================
1734 dnl ========================================================
1735 MOZ_ARG_ENABLE_BOOL(shark,
1736 [ --enable-shark Enable shark remote profiling. Implies --enable-profiling.],
1739 if test -n "$MOZ_SHARK"; then
1741 AC_DEFINE(MOZ_SHARK)
1744 dnl ========================================================
1746 dnl ========================================================
1747 MOZ_ARG_ENABLE_BOOL(callgrind,
1748 [ --enable-callgrind Enable callgrind profiling. Implies --enable-profiling.],
1751 if test -n "$MOZ_CALLGRIND"; then
1753 AC_DEFINE(MOZ_CALLGRIND)
1756 dnl ========================================================
1758 dnl ========================================================
1759 MOZ_ARG_ENABLE_BOOL(vtune,
1760 [ --enable-vtune Enable vtune profiling. Implies --enable-profiling.],
1763 if test -n "$MOZ_VTUNE"; then
1765 AC_DEFINE(MOZ_VTUNE)
1768 dnl ========================================================
1770 dnl ========================================================
1771 if test -n "$MOZ_PROFILING"; then
1772 AC_DEFINE(MOZ_PROFILING)
1775 dnl ========================================================
1776 dnl System overrides of the defaults for host
1777 dnl ========================================================
1780 if test -n "$_WIN32_MSVC"; then
1782 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1783 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1784 HOST_RANLIB='echo ranlib'
1786 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
1788 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
1789 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1790 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1791 HOST_BIN_SUFFIX=.exe
1794 PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper"
1798 case "${host_cpu}" in
1800 if test -n "$_WIN32_MSVC"; then
1801 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
1805 if test -n "$_WIN32_MSVC"; then
1806 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
1808 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
1814 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1815 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1816 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1819 *-linux*|*-kfreebsd*-gnu|*-gnu*)
1820 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1821 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1822 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1826 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1827 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1828 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1829 HOST_BIN_SUFFIX=.exe
1834 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1835 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1839 dnl We require version 2.5 or newer of Python to build.
1840 AC_MSG_CHECKING([for Python version >= $PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR but not 3.x])
1843 read python_version_major python_version_minor python_version_micro <<EOF
1844 `$PYTHON -c 'import sys; print sys.version_info[0], sys.version_info[1], sys.version_info[2]'`
1848 if test $python_version_major -ne $PYTHON_VERSION_MAJOR; then
1849 AC_MSG_ERROR([Cannot build on Python $python_version_major.])
1851 if test $python_version_minor -lt $PYTHON_VERSION_MINOR; then
1852 AC_MSG_ERROR([Cannot build on Python $python_version_major.$python_version_minor. You need at least $PYTHON_VERSION_MAJOR.$PYTHON_VERSION_MINOR.])
1855 AC_MSG_RESULT([yes])
1857 dnl Check for using a custom <stdint.h> implementation
1858 dnl ========================================================
1859 AC_MSG_CHECKING(for custom <stdint.h> implementation)
1860 if test "$MOZ_CUSTOM_STDINT_H"; then
1861 AC_DEFINE_UNQUOTED(MOZ_CUSTOM_STDINT_H, "$MOZ_CUSTOM_STDINT_H")
1862 AC_MSG_RESULT(using $MOZ_CUSTOM_STDINT_H)
1864 AC_MSG_RESULT(none specified)
1867 dnl Get mozilla version from central milestone file
1868 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1869 MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`
1871 dnl Get version of various core apps from the version files.
1872 FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
1874 if test -z "$FIREFOX_VERSION"; then
1875 AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.])
1878 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1879 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1880 AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION")
1882 MOZ_DOING_LTO(lto_is_enabled)
1884 dnl ========================================================
1885 dnl System overrides of the defaults for target
1886 dnl ========================================================
1891 if test ! "$GNU_CC"; then
1892 if test ! "$HAVE_64BIT_OS"; then
1893 # Compiling with Visual Age C++ object model compat is the
1894 # default. To compile with object model ibm, add
1895 # AIX_OBJMODEL=ibm to .mozconfig.
1896 if test "$AIX_OBJMODEL" = "ibm"; then
1897 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1904 AC_SUBST(AIX_OBJMODEL)
1905 DSO_LDOPTS='-qmkshrobj=1'
1906 DSO_CFLAGS='-qflag=w:w'
1908 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1910 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1911 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1912 if test "$COMPILE_ENVIRONMENT"; then
1915 AC_MSG_CHECKING([for IBM XLC/C++ compiler version >= 9.0.0.7])
1917 [#if (__IBMCPP__ < 900)
1918 #error "Bad compiler"
1920 _BAD_COMPILER=,_BAD_COMPILER=1)
1921 if test -n "$_BAD_COMPILER"; then
1923 AC_MSG_ERROR([IBM XLC/C++ 9.0.0.7 or higher is required to build.])
1925 AC_MSG_RESULT([yes])
1928 TARGET_COMPILER_ABI="ibmc"
1929 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1930 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1933 case "${target_os}" in
1938 if test "$COMPILE_ENVIRONMENT"; then
1939 MOZ_CHECK_HEADERS(sys/inttypes.h)
1941 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1945 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1954 _WARNINGS_CFLAGS="-Wall"
1955 _WARNINGS_CXXFLAGS="-Wall"
1956 # The test above doesn't work properly, at least on 3.1.
1957 MKSHLIB_FORCE_ALL=''
1958 MKSHLIB_UNFORCE_ALL=''
1964 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1965 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1966 MOZ_OPTIMIZE_FLAGS="-O3"
1968 # Statically disable jemalloc on 10.5 and 32-bit 10.6. See bug 702250.
1969 if test "$HAVE_64BIT_OS"; then
1974 STRIP="$STRIP -x -S"
1975 # Check whether we're targeting OS X or iOS
1976 AC_CACHE_CHECK(for iOS target,
1978 [AC_TRY_COMPILE([#include <TargetConditionals.h>
1979 #if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
1983 ac_cv_ios_target="yes",
1984 ac_cv_ios_target="no")])
1985 if test "$ac_cv_ios_target" = "yes"; then
1987 AC_DEFINE(XP_DARWIN)
1988 _PLATFORM_DEFAULT_TOOLKIT='cairo-uikit'
1990 AC_DEFINE(XP_MACOSX)
1991 AC_DEFINE(XP_DARWIN)
1992 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1993 # The ExceptionHandling framework is needed for Objective-C exception
1994 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1996 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
1998 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
2001 if test "x$lto_is_enabled" = "xyes"; then
2002 echo "Skipping -dead_strip because lto is enabled."
2003 dnl DTrace and -dead_strip don't interact well. See bug 403132.
2004 dnl ===================================================================
2005 elif test "x$enable_dtrace" = "xyes"; then
2006 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
2008 dnl check for the presence of the -dead_strip linker flag
2009 AC_MSG_CHECKING([for -dead_strip option to ld])
2010 _SAVE_LDFLAGS=$LDFLAGS
2011 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
2012 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
2013 if test -n "$_HAVE_DEAD_STRIP" ; then
2014 AC_MSG_RESULT([yes])
2015 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
2020 LDFLAGS=$_SAVE_LDFLAGS
2023 dnl With newer linkers we need to pass -allow_heap_execute because of
2024 dnl Microsoft Silverlight (5.1.10411.0 at least).
2025 AC_MSG_CHECKING([for -allow_heap_execute option to ld])
2026 _SAVE_LDFLAGS=$LDFLAGS
2027 LDFLAGS="$LDFLAGS -Wl,-allow_heap_execute"
2028 AC_TRY_LINK(,[return 0;],_HAVE_ALLOW_HEAP_EXECUTE=1,
2029 _HAVE_ALLOW_HEAP_EXECUTE=)
2030 if test -n "$_HAVE_ALLOW_HEAP_EXECUTE" ; then
2031 AC_MSG_RESULT([yes])
2032 MOZ_ALLOW_HEAP_EXECUTE_FLAGS="-Wl,-allow_heap_execute"
2036 LDFLAGS=$_SAVE_LDFLAGS
2038 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
2043 if test ! "$GNU_CC"; then
2047 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
2048 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@'
2049 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
2052 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2053 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2056 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2057 AC_DEFINE(_LARGEFILE64_SOURCE)
2062 if test ! "$GNU_CC"; then
2063 DSO_LDOPTS='-b -Wl,+s'
2066 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
2067 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
2068 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
2070 DSO_LDOPTS='-b -E +s'
2071 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
2072 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
2074 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
2075 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2078 *-android*|*-linuxandroid*)
2079 AC_DEFINE(NO_PW_GECOS)
2081 if test -n "$gonkdir"; then
2082 _PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
2086 _PLATFORM_DEFAULT_TOOLKIT=cairo-android
2089 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2091 MOZ_GFX_OPTIMIZE_MOBILE=1
2092 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions"
2096 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
2097 # Similarly for GNU_CXX and INTEL_CXX.
2098 if test "$INTEL_CC" -o "$INTEL_CXX"; then
2099 # -Os has been broken on Intel's C/C++ compilers for quite a
2100 # while; Intel recommends against using it.
2101 MOZ_OPTIMIZE_FLAGS="-O2"
2102 MOZ_DEBUG_FLAGS="-g"
2103 elif test "$GNU_CC" -o "$GNU_CXX"; then
2104 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2105 case $GCC_VERSION in
2107 # -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results.
2108 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
2110 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
2111 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK"
2112 MOZ_DEBUG_FLAGS="-g"
2115 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2119 case "${target_cpu}" in
2121 CFLAGS="$CFLAGS -mieee"
2122 CXXFLAGS="$CXXFLAGS -mieee"
2128 MOZ_DEBUG_FLAGS="-g" # We want inlining
2132 if test -z "$MC"; then
2142 # certain versions of cygwin's makedepend barf on the
2143 # #include <string> vs -I./dist/include/string issue so don't use it
2144 if test -n "$GNU_CC"; then
2146 CXX="$CXX -mwindows"
2147 CPP="$CPP -mwindows"
2148 CFLAGS="$CFLAGS -mms-bitfields"
2149 CXXFLAGS="$CXXFLAGS -mms-bitfields"
2150 DSO_LDOPTS='-shared'
2151 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2152 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2154 # Use temp file for windres (bug 213281)
2155 RCFLAGS='-O coff --use-temp-file'
2156 # mingw doesn't require kernel32, user32, and advapi32 explicitly
2157 LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32 -luserenv"
2159 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core -lmozalloc'
2160 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc'
2162 IMPORT_LIB_SUFFIX=dll.a
2163 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2165 TARGET_COMPILER_ABI=msvc
2169 if test "$AS_BIN"; then
2170 AS="$(basename "$AS_BIN")"
2173 AR_FLAGS='-NOLOGO -OUT:"$@"'
2175 RANLIB='echo not_ranlib'
2176 STRIP='echo not_strip'
2187 IMPORT_LIB_SUFFIX=lib
2188 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2189 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2191 MKSHLIB_UNFORCE_ALL=
2192 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2193 _USE_CPP_INCLUDE_FLAG=1
2194 _DEFINES_CFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
2195 _DEFINES_CXXFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
2196 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2197 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2198 CXXFLAGS="$CXXFLAGS -wd4800" # disable warning "forcing value to bool"
2199 # make 'foo == bar;' error out
2200 CFLAGS="$CFLAGS -we4553"
2201 CXXFLAGS="$CXXFLAGS -we4553"
2202 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2203 MOZ_DEBUG_FLAGS='-Zi'
2204 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2205 WARNINGS_AS_ERRORS='-WX'
2206 MOZ_OPTIMIZE_FLAGS='-O1'
2208 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2209 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2210 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2211 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2212 if test $_MSC_VER -ge 1400; then
2213 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
2214 dnl For profile-guided optimization
2215 PROFILE_GEN_CFLAGS="-GL"
2216 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2217 dnl XXX: PGO builds can fail with warnings treated as errors,
2218 dnl specifically "no profile data available" appears to be
2219 dnl treated as an error sometimes. This might be a consequence
2220 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2221 dnl with the linker doing most of the work in the whole-program
2222 dnl optimization/PGO case. I think it's probably a compiler bug,
2223 dnl but we work around it here.
2224 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2225 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2226 dnl Probably also a compiler bug, but what can you do?
2227 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2228 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2231 AC_DEFINE(HAVE_SNPRINTF)
2236 AC_DEFINE(HW_THREADS)
2237 AC_DEFINE(STDC_HEADERS)
2238 AC_DEFINE(NEW_H, <new>)
2239 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2240 TARGET_MD_ARCH=win32
2241 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2243 MOZ_USER_DIR="Mozilla"
2245 dnl Hardcode to win95 for now - cls
2246 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2248 dnl set NO_X11 defines here as the general check is skipped on win32
2254 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2255 L10NBASEDIR=`cd $L10NBASEDIR && pwd -W`
2261 if test -z "$MOZ_TOOLS"; then
2262 AC_MSG_ERROR([MOZ_TOOLS is not set])
2264 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2265 if test "$?" != "0" -o -z "$MOZ_TOOLS_DIR"; then
2266 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2268 MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2269 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2270 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2277 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.])
2283 if test "$HAVE_64BIT_OS"; then
2284 AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.])
2287 if test $_MSC_VER -ge 1400; then
2288 LDFLAGS="$LDFLAGS -SAFESEH"
2291 if test -n "$GNU_CC"; then
2292 CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
2293 CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
2294 LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup"
2296 AC_DEFINE(HAVE_STDCALL)
2297 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
2300 MOZ_CHECK_HEADERS(mmintrin.h)
2304 if test -n "$_WIN32_MSVC"; then
2305 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
2310 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2314 if test "$HAVE_64BIT_OS"; then
2321 CFLAGS="$CFLAGS -Dunix"
2322 CXXFLAGS="$CXXFLAGS -Dunix"
2323 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2325 DSO_PIC_CFLAGS='-fPIC -DPIC'
2326 DSO_LDOPTS='-shared'
2327 BIN_FLAGS='-Wl,--export-dynamic'
2329 DSO_PIC_CFLAGS='-fPIC -DPIC'
2330 DLL_SUFFIX=".so.1.0"
2331 DSO_LDOPTS='-shared'
2333 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2334 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2335 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2336 if test "$LIBRUNPATH"; then
2337 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2339 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2340 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2344 if test "$SO_VERSION"; then
2345 DLL_SUFFIX=".so.$SO_VERSION"
2347 DLL_SUFFIX=".so.1.0"
2349 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib'
2351 DSO_PIC_CFLAGS='-fPIC'
2352 DSO_LDOPTS='-shared -fPIC'
2353 if test "$LIBRUNPATH"; then
2354 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2359 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2360 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2363 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2364 AC_DEFINE(TCPV40HDRS)
2370 IMPORT_LIB_SUFFIX=lib
2374 CFLAGS="$CFLAGS -Zomf"
2375 CXXFLAGS="$CXXFLAGS -Zomf"
2377 BIN_FLAGS='-Zlinker /ST:0x100000'
2381 WARNINGS_AS_ERRORS='-Werror'
2382 MOZ_DEBUG_FLAGS="-g -fno-inline"
2383 MOZ_OPTIMIZE_FLAGS="-O2"
2384 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2385 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2386 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2388 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2392 MOZ_USER_DIR="Mozilla"
2395 if test "$MOZTOOLS"; then
2396 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2398 AC_MSG_ERROR([MOZTOOLS is not set])
2400 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2401 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2402 LDFLAGS="$LDFLAGS -Zhigh-mem"
2403 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2404 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2407 # GCC for OS/2 currently predefines these, but we don't want them
2408 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2409 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2411 AC_CACHE_CHECK(for __declspec(dllexport),
2413 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2415 ac_os2_declspec="yes",
2416 ac_os2_declspec="no")])
2417 if test "$ac_os2_declspec" != "yes"; then
2418 AC_MSG_ERROR([Compiler does not support __declspec(dllexport), install GCC-4.3.2 or newer])
2424 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2426 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2427 # libraries one level up (e.g. libnspr4.so)
2428 if test "$SOLARIS_SUNPRO_CC"; then
2429 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..' -z lazyload -z combreloc -z muldefs"
2430 LIBS="-lCrun -lCstd -lc $LIBS"
2431 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2432 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
2433 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
2434 LDFLAGS="-xildoff $LDFLAGS"
2435 if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
2436 _SAVE_LDFLAGS=$LDFLAGS
2437 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2438 AC_TRY_LINK([#include <stdio.h>],
2439 [printf("Hello World\n");],
2441 [LDFLAGS=$_SAVE_LDFLAGS])
2443 MOZ_OPTIMIZE_FLAGS="-xO4"
2444 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2445 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2446 MKSHLIB_FORCE_ALL='-z allextract'
2447 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2454 AS='/usr/ccs/bin/as'
2455 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2457 TARGET_COMPILER_ABI="sunc"
2458 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2459 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2460 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2464 [#if (__SUNPRO_CC < 0x590)
2467 _BAD_COMPILER=,_BAD_COMPILER=1)
2468 if test -n "$_BAD_COMPILER"; then
2470 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2475 [#if (__SUNPRO_CC >= 0x5100)
2476 #error "Sun C++ 5.10 or above"
2478 _ABOVE_SS12U1=,_ABOVE_SS12U1=1)
2479 if test "$_ABOVE_SS12U1"; then
2481 CXXFLAGS="$CXXFLAGS -xannotate=no"
2483 AC_MSG_RESULT([$_res])
2486 LDFLAGS="$LDFLAGS -Wl,-z,ignore -Wl,-R,'\$\$ORIGIN:\$\$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs"
2488 MKSHLIB_FORCE_ALL='-Wl,-z -Wl,allextract'
2489 MKSHLIB_UNFORCE_ALL='-Wl,-z -Wl,defaultextract'
2490 ASFLAGS="$ASFLAGS -fPIC"
2491 DSO_LDOPTS='-shared'
2492 WARNINGS_AS_ERRORS='-Werror'
2494 _WARNINGS_CXXFLAGS=''
2495 if test "$OS_RELEASE" = "5.3"; then
2496 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2499 if test "$OS_RELEASE" = "5.5.1"; then
2500 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2505 DSO_LDOPTS='-Bdynamic'
2506 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2507 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2509 AC_DEFINE(SPRINTF_RETURNS_STRING)
2510 case "$(target_os)" in
2512 DLL_SUFFIX='.so.1.0'
2518 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2523 AC_SUBST(MOZ_LINKER)
2524 if test -n "$MOZ_LINKER"; then
2525 AC_DEFINE(MOZ_LINKER)
2527 AC_SUBST(MOZ_ENABLE_SZIP)
2529 dnl Only one oddball right now (QNX), but this gives us flexibility
2530 dnl if any other platforms need to override this in the future.
2531 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2533 dnl ========================================================
2534 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2535 dnl by now will not have any way to link most binaries (tests
2536 dnl as well as viewer, apprunner, etc.), because some symbols
2537 dnl will be left out of the "composite" .so's by ld as unneeded.
2538 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2539 dnl they can link in the static libs that provide the missing
2541 dnl ========================================================
2542 NO_LD_ARCHIVE_FLAGS=
2543 if test -z "$MKSHLIB_FORCE_ALL" -o -z "$MKSHLIB_UNFORCE_ALL"; then
2544 NO_LD_ARCHIVE_FLAGS=1
2548 NO_LD_ARCHIVE_FLAGS=
2551 NO_LD_ARCHIVE_FLAGS=
2554 if test -z "$GNU_CC"; then
2555 NO_LD_ARCHIVE_FLAGS=
2559 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2561 dnl ========================================================
2562 dnl = Flags to strip unused symbols from .so components and
2563 dnl = to export jemalloc symbols when linking a program
2564 dnl ========================================================
2566 *-linux*|*-kfreebsd*-gnu|*-gnu*)
2567 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2570 if test -z "$GNU_CC"; then
2571 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2573 if test -z "$GCC_USE_GNU_LD"; then
2574 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2576 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2581 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2584 if test -n "$GNU_CC"; then
2585 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2590 if test -z "$COMPILE_ENVIRONMENT"; then
2591 SKIP_COMPILER_CHECKS=1
2592 SKIP_LIBRARY_CHECKS=1
2596 if test -z "$SKIP_COMPILER_CHECKS"; then
2597 dnl Checks for typedefs, structures, and compiler characteristics.
2598 dnl ========================================================
2606 AC_MSG_CHECKING(for __stdcall)
2607 AC_CACHE_VAL(ac_cv___stdcall,
2608 [AC_TRY_COMPILE([template <typename Method> struct foo;
2609 template <> struct foo<void (*)()> {};
2610 template <> struct foo<void (__stdcall*)()> {};],
2612 [ac_cv___stdcall=true],
2613 [ac_cv___stdcall=false])])
2614 if test "$ac_cv___stdcall" = true ; then
2615 AC_DEFINE(HAVE_STDCALL)
2621 AC_MSG_CHECKING(for ssize_t)
2622 AC_CACHE_VAL(ac_cv_type_ssize_t,
2623 [AC_TRY_COMPILE([#include <stdio.h>
2624 #include <sys/types.h>],
2626 [ac_cv_type_ssize_t=true],
2627 [ac_cv_type_ssize_t=false])])
2628 if test "$ac_cv_type_ssize_t" = true ; then
2629 AC_DEFINE(HAVE_SSIZE_T)
2634 AC_STRUCT_ST_BLKSIZE
2635 AC_MSG_CHECKING(for siginfo_t)
2636 AC_CACHE_VAL(ac_cv_siginfo_t,
2637 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2638 #include <signal.h>],
2640 [ac_cv_siginfo_t=true],
2641 [ac_cv_siginfo_t=false])])
2642 if test "$ac_cv_siginfo_t" = true ; then
2643 AC_DEFINE(HAVE_SIGINFO_T)
2649 dnl Check for int64, uint, and uint_t.
2650 dnl ========================================================
2651 AC_MSG_CHECKING(for int64)
2652 AC_CACHE_VAL(ac_cv_int64,
2653 [AC_TRY_COMPILE([#include <stdio.h>
2654 #include <sys/types.h>],
2657 [ac_cv_int64=false])])
2658 if test "$ac_cv_int64" = true ; then
2659 AC_DEFINE(HAVE_INT64)
2664 AC_MSG_CHECKING(for uint)
2665 AC_CACHE_VAL(ac_cv_uint,
2666 [AC_TRY_COMPILE([#include <stdio.h>
2667 #include <sys/types.h>],
2670 [ac_cv_uint=false])])
2671 if test "$ac_cv_uint" = true ; then
2672 AC_DEFINE(HAVE_UINT)
2677 AC_MSG_CHECKING(for uint_t)
2678 AC_CACHE_VAL(ac_cv_uint_t,
2679 [AC_TRY_COMPILE([#include <stdio.h>
2680 #include <sys/types.h>],
2682 [ac_cv_uint_t=true],
2683 [ac_cv_uint_t=false])])
2684 if test "$ac_cv_uint_t" = true ; then
2685 AC_DEFINE(HAVE_UINT_T)
2691 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2692 dnl are defined when compiling C++ but not C. Since the result of this
2693 dnl test is used only in C++, do it in C++.
2696 AC_MSG_CHECKING(for uname.domainname)
2697 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2698 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2699 [ struct utsname *res; char *domain;
2700 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2701 [ac_cv_have_uname_domainname_field=true],
2702 [ac_cv_have_uname_domainname_field=false])])
2704 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2705 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2711 AC_MSG_CHECKING(for uname.__domainname)
2712 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2713 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2714 [ struct utsname *res; char *domain;
2715 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2716 [ac_cv_have_uname_us_domainname_field=true],
2717 [ac_cv_have_uname_us_domainname_field=false])])
2719 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2720 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2726 dnl Check whether we can use gcc's c++0x mode
2729 if test "$GNU_CXX"; then
2730 _SAVE_CXXFLAGS=$CXXFLAGS
2731 CXXFLAGS="$CXXFLAGS -std=gnu++0x"
2733 AC_CACHE_CHECK(for gcc c++0x headers bug without rtti,
2734 ac_cv_cxx0x_headers_bug,
2735 [AC_TRY_COMPILE([#include <memory>], [],
2736 ac_cv_cxx0x_headers_bug="no",
2737 ac_cv_cxx0x_headers_bug="yes")])
2738 CXXFLAGS="$_SAVE_CXXFLAGS"
2739 if test "$ac_cv_cxx0x_headers_bug" = "no"; then
2740 CXXFLAGS="$CXXFLAGS -std=gnu++0x"
2744 dnl Check for usable char16_t (2 bytes, unsigned)
2745 dnl (we might not need the unsignedness check anymore)
2746 AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
2747 ac_cv_have_usable_char16_t,
2748 [AC_TRY_COMPILE([$configure_static_assert_macros],
2749 [CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
2750 CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
2751 CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
2752 CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
2753 CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
2754 ac_cv_have_usable_char16_t="yes",
2755 ac_cv_have_usable_char16_t="no")])
2756 if test "$ac_cv_have_usable_char16_t" = "yes"; then
2757 AC_DEFINE(HAVE_CPP_CHAR16_T)
2759 elif test "$GNU_CXX"; then
2760 CXXFLAGS="$_SAVE_CXXFLAGS"
2763 dnl Check for usable wchar_t (2 bytes, unsigned)
2764 dnl (we really don't need the unsignedness check anymore)
2765 dnl ========================================================
2767 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2768 ac_cv_have_usable_wchar_v2,
2769 [AC_TRY_COMPILE([#include <stddef.h>
2770 $configure_static_assert_macros],
2771 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2772 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2773 ac_cv_have_usable_wchar_v2="yes",
2774 ac_cv_have_usable_wchar_v2="no")])
2775 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2776 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2777 HAVE_CPP_2BYTE_WCHAR_T=1
2778 elif test "$ac_cv_have_usable_char16_t" != "yes"; then
2779 dnl This is really gcc-only
2780 dnl Do this test using CXX only since some versions of gcc
2781 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2782 dnl only have short-wchar support for c++.
2783 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2785 _SAVE_CXXFLAGS=$CXXFLAGS
2786 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2788 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2789 ac_cv_have_usable_wchar_option_v2,
2790 [AC_TRY_LINK([#include <stddef.h>
2791 $configure_static_assert_macros],
2792 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2793 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2794 ac_cv_have_usable_wchar_option_v2="yes",
2795 ac_cv_have_usable_wchar_option_v2="no")])
2797 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2798 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2799 HAVE_CPP_2BYTE_WCHAR_T=1
2800 if test "$OS_TARGET" = Android; then
2801 WCHAR_CFLAGS="-fshort-wchar -Wl,--no-wchar-size-warning"
2802 CXXFLAGS="$CXXFLAGS -Wl,--no-wchar-size-warning"
2803 CFLAGS="$CFLAGS -Wl,--no-wchar-size-warning"
2804 DSO_LDOPTS="$DSO_LDOPTS -Wl,--no-wchar-size-warning"
2806 WCHAR_CFLAGS="-fshort-wchar"
2809 CXXFLAGS=$_SAVE_CXXFLAGS
2815 dnl Check for .hidden assembler directive and visibility attribute.
2816 dnl Borrowed from glibc configure.in
2817 dnl ===============================================================
2818 if test "$GNU_CC"; then
2819 AC_CACHE_CHECK(for visibility(hidden) attribute,
2820 ac_cv_visibility_hidden,
2821 [cat > conftest.c <<EOF
2822 int foo __attribute__ ((visibility ("hidden"))) = 1;
2824 ac_cv_visibility_hidden=no
2825 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2826 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2827 ac_cv_visibility_hidden=yes
2832 if test "$ac_cv_visibility_hidden" = "yes"; then
2833 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2835 AC_CACHE_CHECK(for visibility(default) attribute,
2836 ac_cv_visibility_default,
2837 [cat > conftest.c <<EOF
2838 int foo __attribute__ ((visibility ("default"))) = 1;
2840 ac_cv_visibility_default=no
2841 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2842 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2843 ac_cv_visibility_default=yes
2848 if test "$ac_cv_visibility_default" = "yes"; then
2849 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2851 AC_CACHE_CHECK(for visibility pragma support,
2852 ac_cv_visibility_pragma,
2853 [cat > conftest.c <<EOF
2854 #pragma GCC visibility push(hidden)
2856 #pragma GCC visibility push(default)
2857 int foo_default = 1;
2859 ac_cv_visibility_pragma=no
2860 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2861 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2862 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2863 ac_cv_visibility_pragma=yes
2869 if test "$ac_cv_visibility_pragma" = "yes"; then
2870 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2871 ac_cv_have_visibility_class_bug,
2872 [cat > conftest.c <<EOF
2873 #pragma GCC visibility push(hidden)
2874 struct __attribute__ ((visibility ("default"))) TestStruct {
2877 __attribute__ ((visibility ("default"))) void TestFunc() {
2881 ac_cv_have_visibility_class_bug=no
2882 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2883 ac_cv_have_visibility_class_bug=yes
2885 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2886 ac_cv_have_visibility_class_bug=yes
2889 rm -rf conftest.{c,S}
2892 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2893 ac_cv_have_visibility_builtin_bug,
2894 [cat > conftest.c <<EOF
2895 #pragma GCC visibility push(hidden)
2896 #pragma GCC visibility push(default)
2898 #pragma GCC visibility pop
2900 __attribute__ ((visibility ("default"))) void Func() {
2902 memset(c, 0, sizeof(c));
2905 ac_cv_have_visibility_builtin_bug=no
2906 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2907 ac_cv_have_visibility_builtin_bug=yes
2909 if test `grep -c "@PLT" conftest.S` = 0; then
2910 ac_cv_visibility_builtin_bug=yes
2913 rm -f conftest.{c,S}
2915 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2916 "$ac_cv_have_visibility_class_bug" = "no"; then
2917 VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
2918 WRAP_SYSTEM_INCLUDES=1
2919 STL_FLAGS='-I$(DIST)/stl_wrappers'
2922 VISIBILITY_FLAGS='-fvisibility=hidden'
2923 fi # have visibility pragma bug
2924 fi # have visibility pragma
2925 fi # have visibility(default) attribute
2926 fi # have visibility(hidden) attribute
2929 # visibility hidden flag for Sun Studio on Solaris
2930 if test "$SOLARIS_SUNPRO_CC"; then
2931 VISIBILITY_FLAGS='-xldscope=hidden'
2932 fi # Sun Studio on Solaris
2934 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2935 AC_SUBST(VISIBILITY_FLAGS)
2941 dnl Check for __force_align_arg_pointer__ for SSE2 on gcc
2942 dnl ========================================================
2943 if test "$GNU_CC"; then
2944 CFLAGS_save="${CFLAGS}"
2945 CFLAGS="${CFLAGS} -Werror"
2946 AC_CACHE_CHECK(for __force_align_arg_pointer__ attribute,
2947 ac_cv_force_align_arg_pointer,
2948 [AC_TRY_COMPILE([__attribute__ ((__force_align_arg_pointer__)) void test() {}],
2950 ac_cv_force_align_arg_pointer="yes",
2951 ac_cv_force_align_arg_pointer="no")])
2952 CFLAGS="${CFLAGS_save}"
2953 if test "$ac_cv_force_align_arg_pointer" = "yes"; then
2954 HAVE_GCC_ALIGN_ARG_POINTER=1
2956 HAVE_GCC_ALIGN_ARG_POINTER=
2959 AC_SUBST(HAVE_GCC_ALIGN_ARG_POINTER)
2961 dnl Checks for header files.
2962 dnl ========================================================
2964 case "$target_os" in
2966 # for stuff like -lXshm
2967 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2970 MOZ_CHECK_COMMON_HEADERS
2972 dnl These are all the places some variant of statfs can be hiding.
2973 MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2976 MOZ_CHECK_HEADERS(sys/quota.h sys/sysmacros.h)
2977 MOZ_CHECK_HEADERS(linux/quota.h)
2979 dnl Try for MMX support
2980 dnl NB - later gcc versions require -mmmx for this header to be successfully
2981 dnl included (or another option which implies it, such as -march=pentium-mmx)
2982 MOZ_CHECK_HEADERS(mmintrin.h)
2984 dnl Check whether the compiler supports the new-style C++ standard
2985 dnl library headers (i.e. <new>) or needs the old "new.h"
2988 MOZ_CHECK_HEADER(new, [NEW_H=new])
2989 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2992 AC_ARG_ENABLE(dtrace,
2993 [ --enable-dtrace build with dtrace support if available (default=no)],
2994 [enable_dtrace="yes"],)
2995 if test "x$enable_dtrace" = "xyes"; then
2996 MOZ_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
2997 if test -n "$HAVE_DTRACE"; then
2998 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
3000 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
3003 AC_SUBST(HAVE_DTRACE)
3009 MOZ_CHECK_HEADERS(sys/cdefs.h)
3013 MOZ_LINUX_PERF_EVENT
3015 dnl Checks for libraries.
3016 dnl ========================================================
3021 AC_CHECK_LIB(c_r, gethostbyname_r)
3025 dnl We don't want to link with libdl even if it's present on OS X, since
3026 dnl it's not used and not part of the default installation. OS/2 has dlfcn
3028 dnl We don't want to link against libm or libpthread on Darwin since
3029 dnl they both are just symlinks to libSystem and explicitly linking
3030 dnl against libSystem causes issues when debugging (see bug 299601).
3037 AC_SEARCH_LIBS(dlopen, dl,
3038 MOZ_CHECK_HEADER(dlfcn.h,
3039 AC_DEFINE(HAVE_DLOPEN)))
3043 _SAVE_CFLAGS="$CFLAGS"
3044 CFLAGS="$CFLAGS -D_GNU_SOURCE"
3045 AC_CHECK_FUNCS(dladdr memmem)
3046 CFLAGS="$_SAVE_CFLAGS"
3048 if test ! "$GNU_CXX"; then
3052 AC_CHECK_LIB(C_r, demangle)
3055 AC_CHECK_LIB(C, demangle)
3060 dnl OS/2 has socket in libc.
3065 AC_CHECK_LIB(socket, socket)
3069 XLIBS="$X_EXTRA_LIBS"
3071 dnl ========================================================
3072 dnl Checks for X libraries.
3073 dnl Ordering is important.
3074 dnl Xt is dependent upon SM as of X11R6
3075 dnl ========================================================
3076 if test "$no_x" = "yes"; then
3079 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3080 XLIBS="-lX11 $XLIBS"
3081 _SAVE_LDFLAGS="$LDFLAGS"
3082 LDFLAGS="$XLDFLAGS $LDFLAGS"
3083 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3084 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3085 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3086 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3088 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3089 unset ac_cv_lib_Xt_XtFree
3090 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3091 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3092 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3093 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3096 # AIX needs the motif library linked before libXt to prevent
3097 # crashes in plugins linked against Motif - Bug #98892
3098 case "${target_os}" in
3100 XT_LIBS="-lXm $XT_LIBS"
3104 dnl ========================================================
3105 dnl = Check for XShm
3106 dnl ========================================================
3107 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3110 dnl ========================================================
3112 dnl ========================================================
3113 MOZ_CHECK_HEADER(X11/extensions/scrnsaver.h,
3114 AC_CHECK_LIB(Xss, XScreenSaverQueryInfo,
3115 [XSS_LIBS="-lXss $XEXT_LIBS $XLIBS"
3116 AC_DEFINE(HAVE_LIBXSS)],, $XEXT_LIBS $XLIBS))
3118 LDFLAGS="$_SAVE_LDFLAGS"
3128 dnl ========================================================
3129 dnl = pthread support
3130 dnl = Start by checking whether the system support pthreads
3131 dnl ========================================================
3132 case "$target_os" in
3137 MOZ_CHECK_PTHREADS(pthreads,
3138 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3139 MOZ_CHECK_PTHREADS(pthread,
3140 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3141 MOZ_CHECK_PTHREADS(c_r,
3142 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3143 MOZ_CHECK_PTHREADS(c,
3152 dnl ========================================================
3153 dnl Check the command line for --with-pthreads
3154 dnl ========================================================
3155 MOZ_ARG_WITH_BOOL(pthreads,
3156 [ --with-pthreads Force use of system pthread library with NSPR ],
3157 [ if test "$USE_PTHREADS"x = x; then
3158 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3164 dnl ========================================================
3165 dnl Do the platform specific pthread hackery
3166 dnl ========================================================
3167 if test "$USE_PTHREADS"x != x
3170 dnl See if -pthread is supported.
3173 ac_cv_have_dash_pthread=no
3174 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3175 echo 'int main() { return 0; }' | cat > conftest.c
3176 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3177 if test $? -eq 0; then
3178 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3179 ac_cv_have_dash_pthread=yes
3180 case "$target_os" in
3182 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3185 CFLAGS="$CFLAGS -pthread"
3186 CXXFLAGS="$CXXFLAGS -pthread"
3192 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3195 dnl See if -pthreads is supported.
3197 ac_cv_have_dash_pthreads=no
3198 if test "$ac_cv_have_dash_pthread" = "no"; then
3199 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3200 echo 'int main() { return 0; }' | cat > conftest.c
3201 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3202 if test $? -eq 0; then
3203 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3204 ac_cv_have_dash_pthreads=yes
3205 CFLAGS="$CFLAGS -pthreads"
3206 CXXFLAGS="$CXXFLAGS -pthreads"
3210 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3215 AC_DEFINE(_REENTRANT)
3216 AC_DEFINE(_THREAD_SAFE)
3217 dnl -pthread links in -lpthread, so don't specify it explicitly.
3218 if test "$ac_cv_have_dash_pthread" = "yes"; then
3219 _PTHREAD_LDFLAGS="-pthread"
3223 *-*-openbsd*|*-*-bsdi*)
3224 AC_DEFINE(_REENTRANT)
3225 AC_DEFINE(_THREAD_SAFE)
3226 dnl -pthread links in -lc_r, so don't specify it explicitly.
3227 if test "$ac_cv_have_dash_pthread" = "yes"; then
3228 _PTHREAD_LDFLAGS="-pthread"
3232 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
3233 AC_DEFINE(_REENTRANT)
3237 AC_DEFINE(_REENTRANT)
3241 AC_DEFINE(_REENTRANT)
3245 AC_DEFINE(_REENTRANT)
3246 if test "$SOLARIS_SUNPRO_CC"; then
3247 CFLAGS="$CFLAGS -mt"
3248 CXXFLAGS="$CXXFLAGS -mt"
3252 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3256 dnl Checks for library functions.
3257 dnl ========================================================
3258 AC_PROG_GCC_TRADITIONAL
3260 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf memmove rint stat64 lstat64 truncate64 setbuf isatty)
3261 AC_CHECK_FUNCS(statvfs64 statvfs statfs64 statfs)
3262 AC_CHECK_FUNCS(flockfile getpagesize)
3263 AC_CHECK_FUNCS(localtime_r strtok_r)
3265 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
3266 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
3267 ac_cv_clock_monotonic,
3268 [for libs in "" -lrt; do
3271 AC_TRY_LINK([#include <time.h>],
3272 [ struct timespec ts;
3273 clock_gettime(CLOCK_MONOTONIC, &ts); ],
3274 ac_cv_clock_monotonic=$libs
3277 ac_cv_clock_monotonic=no)
3280 if test "$ac_cv_clock_monotonic" != "no"; then
3281 HAVE_CLOCK_MONOTONIC=1
3282 REALTIME_LIBS=$ac_cv_clock_monotonic
3283 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
3284 AC_SUBST(HAVE_CLOCK_MONOTONIC)
3285 AC_SUBST(REALTIME_LIBS)
3288 dnl check for wcrtomb/mbrtowc
3289 dnl =======================================================================
3290 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3293 AC_CACHE_CHECK(for wcrtomb,
3295 [AC_TRY_LINK([#include <wchar.h>],
3296 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3297 ac_cv_have_wcrtomb="yes",
3298 ac_cv_have_wcrtomb="no")])
3299 if test "$ac_cv_have_wcrtomb" = "yes"; then
3300 AC_DEFINE(HAVE_WCRTOMB)
3302 AC_CACHE_CHECK(for mbrtowc,
3304 [AC_TRY_LINK([#include <wchar.h>],
3305 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3306 ac_cv_have_mbrtowc="yes",
3307 ac_cv_have_mbrtowc="no")])
3308 if test "$ac_cv_have_mbrtowc" = "yes"; then
3309 AC_DEFINE(HAVE_MBRTOWC)
3316 ac_cv_func_res_ninit,
3319 #define _BSD_SOURCE 1
3323 [int foo = res_ninit(&_res);],
3324 [ac_cv_func_res_ninit=yes],
3325 [ac_cv_func_res_ninit=no])
3328 if test "$ac_cv_func_res_ninit" = "yes"; then
3329 AC_DEFINE(HAVE_RES_NINIT)
3330 dnl must add the link line we do something as foolish as this... dougt
3332 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3333 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3338 [for gnu_get_libc_version()],
3339 ac_cv_func_gnu_get_libc_version,
3341 #ifdef HAVE_GNU_LIBC_VERSION_H
3342 #include <gnu/libc-version.h>
3345 [const char *glibc_version = gnu_get_libc_version();],
3346 [ac_cv_func_gnu_get_libc_version=yes],
3347 [ac_cv_func_gnu_get_libc_version=no]
3351 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3352 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3356 darwin*|mingw*|os2*)
3360 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3361 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3362 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3364 LIBS="$LIBS $_ICONV_LIBS"
3373 iconv_t h = iconv_open("", "");
3374 iconv(h, NULL, NULL, NULL, NULL);
3377 [ac_cv_func_iconv=yes],
3378 [ac_cv_func_iconv=no]
3381 if test "$ac_cv_func_iconv" = "yes"; then
3382 AC_DEFINE(HAVE_ICONV)
3383 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3384 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3385 LIBICONV="$_ICONV_LIBS"
3387 [for iconv() with const input],
3388 ac_cv_func_const_iconv,
3394 const char *input = "testing";
3395 iconv_t h = iconv_open("", "");
3396 iconv(h, &input, NULL, NULL, NULL);
3399 [ac_cv_func_const_iconv=yes],
3400 [ac_cv_func_const_iconv=no]
3403 if test "$ac_cv_func_const_iconv" = "yes"; then
3404 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3416 dnl **********************
3417 dnl *** va_copy checks ***
3418 dnl **********************
3419 dnl we currently check for all three va_copy possibilities, so we get
3420 dnl all results in config.log for bug reports.
3421 AC_MSG_CHECKING(for an implementation of va_copy())
3422 AC_CACHE_VAL(ac_cv_va_copy,[
3425 void f (int i, ...) {
3426 va_list args1, args2;
3427 va_start (args1, i);
3428 va_copy (args2, args1);
3429 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3431 va_end (args1); va_end (args2);
3433 int main() { f (0, 42); return 0; }],
3439 AC_MSG_RESULT($ac_cv_va_copy)
3440 AC_MSG_CHECKING(for an implementation of __va_copy())
3441 AC_CACHE_VAL(ac_cv___va_copy,[
3444 void f (int i, ...) {
3445 va_list args1, args2;
3446 va_start (args1, i);
3447 __va_copy (args2, args1);
3448 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3450 va_end (args1); va_end (args2);
3452 int main() { f (0, 42); return 0; }],
3453 ac_cv___va_copy=yes,
3458 AC_MSG_RESULT($ac_cv___va_copy)
3459 AC_MSG_CHECKING(whether va_lists can be copied by value)
3460 AC_CACHE_VAL(ac_cv_va_val_copy,[
3463 void f (int i, ...) {
3464 va_list args1, args2;
3465 va_start (args1, i);
3467 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3469 va_end (args1); va_end (args2);
3471 int main() { f (0, 42); return 0; }],
3472 ac_cv_va_val_copy=yes,
3473 ac_cv_va_val_copy=no,
3474 ac_cv_va_val_copy=yes
3477 if test "x$ac_cv_va_copy" = "xyes"; then
3478 AC_DEFINE(VA_COPY, va_copy)
3479 AC_DEFINE(HAVE_VA_COPY)
3480 elif test "x$ac_cv___va_copy" = "xyes"; then
3481 AC_DEFINE(VA_COPY, __va_copy)
3482 AC_DEFINE(HAVE_VA_COPY)
3485 if test "x$ac_cv_va_val_copy" = "xno"; then
3486 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3488 AC_MSG_RESULT($ac_cv_va_val_copy)
3490 dnl ===================================================================
3491 dnl ========================================================
3492 dnl Put your C++ language/feature checks below
3493 dnl ========================================================
3497 if test "$GNU_CC"; then
3498 if test "$CPU_ARCH" = "arm" ; then
3499 AC_CACHE_CHECK(for ARM EABI,
3503 #if defined(__ARM_EABI__)
3506 #error Not ARM EABI.
3509 ac_cv_gcc_arm_eabi="yes",
3510 ac_cv_gcc_arm_eabi="no")])
3511 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
3513 ARM_ABI_PREFIX=eabi-
3515 ARM_ABI_PREFIX=oabi-
3519 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
3522 dnl Check for support of modern template specialization syntax
3523 dnl Test code and requirement from scc@netscape.com.
3524 dnl Autoconf cut-and-paste job by waterson@netscape.com
3525 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3526 ac_cv_cpp_modern_specialize_template_syntax,
3527 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3529 template <> struct X<Y> { double a; };,
3532 ac_cv_cpp_modern_specialize_template_syntax=yes,
3533 ac_cv_cpp_modern_specialize_template_syntax=no)])
3534 if test "$ac_cv_cpp_modern_specialize_template_syntax" = no ; then
3535 AC_MSG_ERROR([The C++ compiler does not support template specialization])
3538 dnl Some compilers support only full specialization, and some don't.
3539 AC_CACHE_CHECK(whether partial template specialization works,
3540 ac_cv_cpp_partial_specialization,
3541 [AC_TRY_COMPILE(template <class T> class Foo {};
3542 template <class T> class Foo<T*> {};,
3544 ac_cv_cpp_partial_specialization=yes,
3545 ac_cv_cpp_partial_specialization=no)])
3546 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3547 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3550 dnl Check to see if we can resolve ambiguity with |using|.
3551 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3552 ac_cv_cpp_ambiguity_resolving_using,
3553 [AC_TRY_COMPILE(class X {
3554 public: int go(const X&) {return 3;}
3555 int jo(const X&) {return 3;}
3557 class Y : public X {
3558 public: int go(int) {return 2;}
3559 int jo(int) {return 2;}
3561 private: using X::go;
3564 ac_cv_cpp_ambiguity_resolving_using=yes,
3565 ac_cv_cpp_ambiguity_resolving_using=no)])
3566 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3567 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3570 dnl See if a dynamic_cast to void* gives the most derived object.
3571 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3572 ac_cv_cpp_dynamic_cast_void_ptr,
3573 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3574 class Y { int j; public: virtual ~Y() { } };
3575 class Z : public X, public Y { int k; };
3581 return !((((void*)&mdo != (void*)subx) &&
3582 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3583 (((void*)&mdo != (void*)suby) &&
3584 ((void*)&mdo == dynamic_cast<void*>(suby))));
3586 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3587 ac_cv_cpp_dynamic_cast_void_ptr=no,
3588 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3589 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3590 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3594 dnl note that this one is reversed - if the test fails, then
3595 dnl we require implementations of unused virtual methods. Which
3596 dnl really blows because it means we'll have useless vtable
3598 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3599 ac_cv_cpp_unused_required,
3600 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3602 ac_cv_cpp_unused_required=no,
3603 ac_cv_cpp_unused_required=yes)])
3604 if test "$ac_cv_cpp_unused_required" = yes ; then
3605 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3609 dnl Some compilers have trouble comparing a constant reference to a templatized
3610 dnl class to zero, and require an explicit operator==() to be defined that takes
3611 dnl an int. This test separates the strong from the weak.
3613 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3614 ac_cv_trouble_comparing_to_zero,
3615 [AC_TRY_COMPILE([#include <algorithm>
3616 template <class T> class Foo {};
3618 template <class T> int operator==(const T2*, const T&) { return 0; }
3619 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3620 [Foo<int> f; return (0 != f);],
3621 ac_cv_trouble_comparing_to_zero=no,
3622 ac_cv_trouble_comparing_to_zero=yes)])
3623 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3624 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3627 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
3628 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
3629 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
3631 _SAVE_LDFLAGS=$LDFLAGS
3632 LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
3633 AC_CACHE_CHECK(for __thread keyword for TLS variables,
3634 ac_cv_thread_keyword,
3635 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
3636 [return tlsIsMainThread;],
3637 ac_cv_thread_keyword=yes,
3638 ac_cv_thread_keyword=no)])
3639 LDFLAGS=$_SAVE_LDFLAGS
3640 # The custom dynamic linker doesn't support TLS variables
3642 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
3643 # mips builds fail with TLS variables because of a binutils bug.
3645 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
3650 *-android*|*-linuxandroid*)
3657 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
3663 dnl Using the custom linker on ARMv6 requires 16k alignment of ELF segments.
3664 if test -n "$MOZ_LINKER"; then
3665 if test "$CPU_ARCH" = arm; then
3666 dnl Determine the target ARM architecture (5 for ARMv5, v5T, v5E, etc.; 6 for ARMv6, v6K, etc.)
3667 ARM_ARCH=`${CC-cc} ${CFLAGS} -dM -E - < /dev/null | sed -n 's/.*__ARM_ARCH_\([[0-9]]*\).*/\1/p'`
3668 dnl When building for < ARMv7, we need to ensure 16k alignment of ELF segments
3669 if test -n "$ARM_ARCH" && test "$ARM_ARCH" -lt 7; then
3670 LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=0x4000"
3671 _SUBDIR_LDFLAGS="$_SUBDIR_LDFLAGS -Wl,-z,max-page-size=0x4000"
3676 dnl The custom linker doesn't support text relocations, but NDK >= r6b
3677 dnl creates some (http://code.google.com/p/android/issues/detail?id=23203)
3678 dnl We however want to avoid these text relocations, and this can be done
3679 dnl by making gcc not link crtbegin and crtend. In the broken NDKs, crtend
3680 dnl doesn't contain anything at all, beside placeholders for some sections,
3681 dnl and crtbegin only contains a finalizer function that calls
3682 dnl __cxa_finalize. The custom linker actually takes care of calling
3683 dnl __cxa_finalize when the library doesn't call it itself, which makes it
3684 dnl safe not to link crtbegin. Besides, previous versions of the NDK didn't
3685 dnl link crtbegin and crtend at all.
3686 if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$OS_TARGET" = "Android"; then
3687 AC_CACHE_CHECK([whether the CRT objects have text relocations],
3688 ac_cv_crt_has_text_relocations,
3689 [echo 'int foo() { return 0; }' > conftest.cpp
3690 if AC_TRY_COMMAND(${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5) &&
3691 test -s conftest${DLL_SUFFIX}; then
3692 if ${TOOLCHAIN_PREFIX}readelf -d conftest${DLL_SUFFIX} | grep TEXTREL > /dev/null; then
3693 ac_cv_crt_has_text_relocations=yes
3695 ac_cv_crt_has_text_relocations=no
3698 AC_ERROR([couldn't compile a simple C file])
3701 if test "$ac_cv_crt_has_text_relocations" = yes; then
3702 dnl While we want libraries to skip the CRT files, we don't want
3703 dnl executables to be treated the same way. We thus set the flag
3704 dnl in DSO_LDOPTS and not LDFLAGS. However, to pass it to nspr,
3705 dnl we need to use LDFLAGS because nspr doesn't inherit DSO_LDOPTS.
3706 dnl Using LDFLAGS in nspr is safe, since we only really build
3707 dnl libraries there.
3708 DSO_LDOPTS="$DSO_LDOPTS -nostartfiles"
3709 NSPR_LDFLAGS=-nostartfiles
3713 dnl Check for the existence of various allocation headers/functions
3716 MOZ_CHECK_HEADER(malloc.h, [MALLOC_H=malloc.h])
3717 if test "$MALLOC_H" = ""; then
3718 MOZ_CHECK_HEADER(malloc/malloc.h, [MALLOC_H=malloc/malloc.h])
3719 if test "$MALLOC_H" = ""; then
3720 MOZ_CHECK_HEADER(sys/malloc.h, [MALLOC_H=sys/malloc.h])
3723 if test "$MALLOC_H" != ""; then
3724 AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
3727 MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc"
3728 AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)
3730 dnl See if compiler supports some gcc-style attributes
3732 AC_CACHE_CHECK(for __attribute__((always_inline)),
3733 ac_cv_attribute_always_inline,
3734 [AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));],
3736 ac_cv_attribute_always_inline=yes,
3737 ac_cv_attribute_always_inline=no)])
3739 AC_CACHE_CHECK(for __attribute__((malloc)),
3740 ac_cv_attribute_malloc,
3741 [AC_TRY_COMPILE([void* f(int) __attribute__((malloc));],
3743 ac_cv_attribute_malloc=yes,
3744 ac_cv_attribute_malloc=no)])
3746 AC_CACHE_CHECK(for __attribute__((warn_unused_result)),
3747 ac_cv_attribute_warn_unused,
3748 [AC_TRY_COMPILE([int f(void) __attribute__((warn_unused_result));],
3750 ac_cv_attribute_warn_unused=yes,
3751 ac_cv_attribute_warn_unused=no)])
3753 dnl End of C++ language/feature checks
3756 dnl ========================================================
3757 dnl = Internationalization checks
3758 dnl ========================================================
3760 dnl Internationalization and Locale support is different
3761 dnl on various UNIX platforms. Checks for specific i18n
3762 dnl features go here.
3764 dnl check for LC_MESSAGES
3765 AC_CACHE_CHECK(for LC_MESSAGES,
3766 ac_cv_i18n_lc_messages,
3767 [AC_TRY_COMPILE([#include <locale.h>],
3768 [int category = LC_MESSAGES;],
3769 ac_cv_i18n_lc_messages=yes,
3770 ac_cv_i18n_lc_messages=no)])
3771 if test "$ac_cv_i18n_lc_messages" = yes; then
3772 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3775 AC_HAVE_FUNCS(localeconv)
3776 fi # ! SKIP_COMPILER_CHECKS
3779 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3780 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
3783 dnl Mozilla specific options
3784 dnl ========================================================
3785 dnl The macros used for command line options
3786 dnl are defined in build/autoconf/altoptions.m4.
3788 dnl If the compiler supports these attributes, define them as
3789 dnl convenience macros.
3790 if test "$ac_cv_attribute_always_inline" = yes ; then
3791 AC_DEFINE(NS_ALWAYS_INLINE, [__attribute__((always_inline))])
3793 AC_DEFINE(NS_ALWAYS_INLINE,)
3796 if test "$ac_cv_attribute_malloc" = yes ; then
3797 AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))])
3799 AC_DEFINE(NS_ATTR_MALLOC,)
3802 if test "$ac_cv_attribute_warn_unused" = yes ; then
3803 AC_DEFINE(NS_WARN_UNUSED_RESULT, [__attribute__((warn_unused_result))])
3805 AC_DEFINE(NS_WARN_UNUSED_RESULT,)
3808 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
3809 dnl features that Windows actually does support.
3811 if test -n "$SKIP_COMPILER_CHECKS"; then
3812 dnl Windows has malloc.h
3813 AC_DEFINE(MALLOC_H, [<malloc.h>])
3814 AC_DEFINE(HAVE_FORCEINLINE)
3815 AC_DEFINE(HAVE_LOCALECONV)
3816 fi # SKIP_COMPILER_CHECKS
3818 dnl ========================================================
3820 dnl = Check for external package dependencies
3822 dnl ========================================================
3823 MOZ_ARG_HEADER(External Packages)
3825 MOZ_ARG_WITH_STRING(libxul-sdk,
3826 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
3827 LIBXUL_SDK_DIR=$withval)
3829 if test "$LIBXUL_SDK_DIR" = "yes"; then
3830 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
3831 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
3832 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
3834 if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
3835 AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
3839 AC_SUBST(LIBXUL_SDK)
3841 if test -n "$LIBXUL_SDK"; then
3842 LIBXUL_DIST="$LIBXUL_SDK"
3844 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
3846 AC_SUBST(LIBXUL_DIST)
3850 MOZ_ARG_WITH_BOOL(system-libxul,
3851 [ --with-system-libxul Use system installed libxul SDK],
3854 dnl ========================================================
3855 dnl = If NSPR was not detected in the system,
3856 dnl = use the one in the source tree (mozilla/nsprpub)
3857 dnl ========================================================
3858 MOZ_ARG_WITH_BOOL(system-nspr,
3859 [ --with-system-nspr Use system installed NSPR],
3860 _USE_SYSTEM_NSPR=1 )
3862 if test -n "$_USE_SYSTEM_NSPR"; then
3863 AM_PATH_NSPR(4.9.2, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
3866 if test -n "$MOZ_NATIVE_NSPR"; then
3867 _SAVE_CFLAGS=$CFLAGS
3868 CFLAGS="$CFLAGS $NSPR_CFLAGS"
3869 AC_TRY_COMPILE([#include "prtypes.h"],
3870 [#ifndef PR_STATIC_ASSERT
3871 #error PR_STATIC_ASSERT not defined or requires including prtypes.h
3873 [MOZ_NATIVE_NSPR=1],
3874 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it]))
3875 AC_TRY_COMPILE([#include "prtypes.h"],
3877 #error PR_UINT64 not defined or requires including prtypes.h
3879 [MOZ_NATIVE_NSPR=1],
3880 AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
3881 CFLAGS=$_SAVE_CFLAGS
3883 if test -z "$LIBXUL_SDK"; then
3884 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
3885 if test -n "$GNU_CC"; then
3886 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
3888 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
3891 NSPR_CFLAGS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --includedir="${LIBXUL_DIST}/include/nspr" --cflags`
3892 NSPR_LIBS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --libdir="${LIBXUL_DIST}"/lib --libs`
3896 dnl system libevent Support
3897 dnl ========================================================
3898 MOZ_ARG_WITH_STRING(system-libevent,
3899 [ --with-system-libevent[=PFX]
3900 Use system libevent [installed at prefix PFX]],
3901 LIBEVENT_DIR=$withval)
3903 _SAVE_CFLAGS=$CFLAGS
3904 _SAVE_LDFLAGS=$LDFLAGS
3906 if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
3907 MOZ_NATIVE_LIBEVENT=
3908 elif test "$LIBEVENT_DIR" = yes; then
3909 PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
3910 MOZ_NATIVE_LIBEVENT=1,
3911 AC_MSG_ERROR([--with-system-libevent requested but libevent package not found]))
3913 CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
3914 LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
3915 MOZ_CHECK_HEADER(event.h,
3916 [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
3917 AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
3919 AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
3920 AC_CHECK_LIB(event, event_init,
3921 [MOZ_NATIVE_LIBEVENT=1
3922 MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
3923 MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
3924 [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
3926 CFLAGS=$_SAVE_CFLAGS
3927 LDFLAGS=$_SAVE_LDFLAGS
3930 AC_SUBST(MOZ_NATIVE_LIBEVENT)
3931 AC_SUBST(MOZ_LIBEVENT_CFLAGS)
3932 AC_SUBST(MOZ_LIBEVENT_LIBS)
3934 dnl ========================================================
3935 dnl = If NSS was not detected in the system,
3936 dnl = use the one in the source tree (mozilla/security/nss)
3937 dnl ========================================================
3939 MOZ_ARG_WITH_BOOL(system-nss,
3940 [ --with-system-nss Use system installed NSS],
3943 if test -n "$_USE_SYSTEM_NSS"; then
3944 AM_PATH_NSS(3.13.2, [MOZ_NATIVE_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
3947 if test -n "$MOZ_NATIVE_NSS"; then
3948 NSS_LIBS="$NSS_LIBS -lcrmf"
3950 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
3952 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
3953 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
3954 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
3955 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
3956 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX)"
3958 if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2"; then
3960 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
3961 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(LIB_SUFFIX) \
3962 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(LIB_SUFFIX) \
3963 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(LIB_SUFFIX) \
3964 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(LIB_SUFFIX)"
3966 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION"
3970 dnl ======================
3972 dnl ======================
3974 AC_MSG_CHECKING([for YASM assembler])
3975 AC_CHECK_PROGS(YASM, yasm, "")
3977 if test -n "$YASM"; then
3978 dnl Pull out yasm's version string
3979 YASM_VERSION=`yasm --version | $AWK '/^yasm/ { print $2 }'`
3980 _YASM_MAJOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $1 }'`
3981 _YASM_MINOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $2 }'`
3982 _YASM_RELEASE=` echo ${YASM_VERSION} | $AWK -F\. '{ print $3 }'`
3983 _YASM_BUILD=` echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
3986 if test -z "$SKIP_LIBRARY_CHECKS"; then
3987 dnl system JPEG support
3988 dnl ========================================================
3989 MOZ_ARG_WITH_STRING(system-jpeg,
3990 [ --with-system-jpeg[=PFX]
3991 Use system libjpeg [installed at prefix PFX]],
3994 _SAVE_CFLAGS=$CFLAGS
3995 _SAVE_LDFLAGS=$LDFLAGS
3997 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
3998 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
3999 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
4001 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
4004 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [MOZ_NATIVE_JPEG=1 MOZ_JPEG_LIBS="-ljpeg"], MOZ_NATIVE_JPEG=)
4007 if test "$MOZ_NATIVE_JPEG" = 1; then
4008 AC_TRY_COMPILE([ #include <stdio.h>
4009 #include <sys/types.h>
4010 #include <jpeglib.h> ],
4011 [ #if JPEG_LIB_VERSION < $MOZJPEG
4012 #error "Insufficient JPEG library version ($MOZJPEG required)."
4014 #ifndef JCS_EXTENSIONS
4015 #error "libjpeg-turbo JCS_EXTENSIONS required"
4019 AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
4021 CFLAGS=$_SAVE_CFLAGS
4022 LDFLAGS=$_SAVE_LDFLAGS
4025 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$MOZ_NATIVE_JPEG" = 1; then
4026 MOZ_JPEG_CFLAGS="-I${JPEG_DIR}/include"
4027 MOZ_JPEG_LIBS="-L${JPEG_DIR}/lib ${MOZ_JPEG_LIBS}"
4029 fi # SKIP_LIBRARY_CHECKS
4031 dnl system ZLIB support
4032 dnl ========================================================
4033 MOZ_ZLIB_CHECK([1.2.3])
4035 if test "$MOZ_NATIVE_ZLIB" != 1; then
4037 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,'"$MOZ_BUILD_ROOT"'/modules/zlib/src)'
4040 if test "$MOZ_LINKER" = 1 -a "$MOZ_NATIVE_ZLIB" != 1; then
4041 AC_MSG_ERROR([Custom dynamic linker requires --with-system-zlib])
4044 if test -z "$SKIP_LIBRARY_CHECKS"; then
4045 dnl system BZIP2 Support
4046 dnl ========================================================
4047 MOZ_ARG_WITH_STRING(system-bz2,
4048 [ --with-system-bz2[=PFX]
4049 Use system libbz2 [installed at prefix PFX]],
4052 _SAVE_CFLAGS=$CFLAGS
4053 _SAVE_LDFLAGS=$LDFLAGS
4055 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4056 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4057 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4059 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4062 AC_CHECK_LIB(bz2, BZ2_bzread, [MOZ_NATIVE_BZ2=1 MOZ_BZ2_LIBS="-lbz2"],
4063 [MOZ_NATIVE_BZ2= MOZ_BZ2_CFLAGS= MOZ_BZ2_LIBS=])
4065 CFLAGS=$_SAVE_CFLAGS
4066 LDFLAGS=$_SAVE_LDFLAGS
4069 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$MOZ_NATIVE_BZ2" = 1; then
4070 MOZ_BZ2_CFLAGS="-I${BZ2_DIR}/include"
4071 MOZ_BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4074 dnl system PNG Support
4075 dnl ========================================================
4076 MOZ_ARG_WITH_STRING(system-png,
4077 [ --with-system-png[=PFX]
4078 Use system libpng [installed at prefix PFX]],
4081 _SAVE_CFLAGS=$CFLAGS
4082 _SAVE_LDFLAGS=$LDFLAGS
4084 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4085 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4086 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4088 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4091 AC_CHECK_LIB(png, png_get_valid, [MOZ_NATIVE_PNG=1 MOZ_PNG_LIBS="-lpng"],
4092 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4093 AC_CHECK_LIB(png, png_get_acTL, ,
4094 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]))
4096 if test "$MOZ_NATIVE_PNG" = 1; then
4097 AC_TRY_COMPILE([ #include <stdio.h>
4098 #include <sys/types.h>
4100 [ #if PNG_LIBPNG_VER < $MOZPNG
4101 #error "Insufficient libpng version ($MOZPNG required)."
4103 #ifndef PNG_UINT_31_MAX
4104 #error "Insufficient libpng version."
4107 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4109 CFLAGS=$_SAVE_CFLAGS
4110 LDFLAGS=$_SAVE_LDFLAGS
4113 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_NATIVE_PNG" = 1; then
4114 MOZ_PNG_CFLAGS="-I${PNG_DIR}/include"
4115 MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}"
4118 fi # SKIP_LIBRARY_CHECKS
4120 dnl system HunSpell Support
4121 dnl ========================================================
4122 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4123 [ --enable-system-hunspell
4124 Use system hunspell (located with pkgconfig)],
4125 MOZ_NATIVE_HUNSPELL=1 )
4127 if test -n "$MOZ_NATIVE_HUNSPELL"; then
4128 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4131 AC_SUBST(MOZ_NATIVE_HUNSPELL)
4133 dnl ========================================================
4134 dnl system libffi Support
4135 dnl ========================================================
4136 MOZ_ARG_ENABLE_BOOL(system-ffi,
4137 [ --enable-system-ffi Use system libffi (located with pkgconfig)],
4140 if test -n "$MOZ_NATIVE_FFI"; then
4141 # Vanilla libffi 3.0.9 needs a few patches from upcoming version 3.0.10
4142 # for non-GCC compilers.
4143 if test -z "$GNU_CC"; then
4144 PKG_CHECK_MODULES(MOZ_FFI, libffi > 3.0.9)
4146 PKG_CHECK_MODULES(MOZ_FFI, libffi >= 3.0.9)
4148 MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS"
4151 dnl ========================================================
4152 dnl Java SDK support
4153 dnl ========================================================
4156 MOZ_ARG_WITH_STRING(java-bin-path,
4157 [ --with-java-bin-path=dir
4158 Location of Java binaries (java, javac, jar)],
4159 JAVA_BIN_PATH=$withval)
4161 dnl ========================================================
4165 dnl ========================================================
4167 MOZ_ARG_HEADER(Application)
4170 ENABLE_SYSTEM_EXTENSION_DIRS=1
4171 MOZ_BRANDING_DIRECTORY=
4172 MOZ_OFFICIAL_BRANDING=
4177 MOZ_AUTH_EXTENSION=1
4181 MOZ_SPEEX_RESAMPLER=1
4186 MOZ_SAMPLE_TYPE_FLOAT32=
4187 MOZ_SAMPLE_TYPE_S16=
4192 MOZ_WEBRTC_SIGNALING=
4194 MOZ_MEDIA_NAVIGATOR=
4197 MOZ_VP8_ERROR_CONCEALMENT=
4207 LIBJPEG_TURBO_ASFLAGS=
4208 LIBJPEG_TURBO_X86_ASM=
4209 LIBJPEG_TURBO_X64_ASM=
4210 LIBJPEG_TURBO_ARM_ASM=
4214 MOZ_PREF_EXTENSIONS=1
4215 MOZ_PROFILELOCKING=1
4221 MOZ_JAVA_COMPOSITOR=
4222 MOZ_ONLY_TOUCH_EVENTS=
4223 MOZ_TOOLKIT_SEARCH=1
4225 MOZ_UNIVERSALCHARDET=1
4232 MOZ_DISABLE_DOMCRYPTO=
4236 NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
4239 MOZ_USE_NATIVE_POPUP_WINDOWS=
4240 MOZ_ANDROID_HISTORY=
4247 case "$target_os" in
4250 AC_DEFINE(NS_ENABLE_TSF)
4255 *-android*|*-linuxandroid*)
4256 if test "$CPU_ARCH" = "arm" ; then
4262 MOZ_THEME_FASTSTRIPE=1
4270 MOZ_ARG_ENABLE_STRING(application,
4271 [ --enable-application=APP
4275 tools/update-packaging (AUS-related packaging tools)],
4276 [ MOZ_BUILD_APP=$enableval ] )
4278 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4279 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4280 XULRUNNER_STUB_NAME=$withval)
4282 if test -z "$XULRUNNER_STUB_NAME"; then
4283 case "$target_os" in
4285 XULRUNNER_STUB_NAME=xulrunner
4288 XULRUNNER_STUB_NAME=xulrunner-stub
4291 AC_SUBST(XULRUNNER_STUB_NAME)
4293 AC_MSG_CHECKING([for application to build])
4294 if test -z "$MOZ_BUILD_APP"; then
4295 AC_MSG_RESULT([browser])
4296 MOZ_BUILD_APP=browser
4298 # default mobile to be mobile/xul
4299 if test "$MOZ_BUILD_APP" = "mobile" ; then
4300 MOZ_BUILD_APP=mobile/xul
4302 # We have a valid application only if it has a build.mk file in its top
4304 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4305 AC_MSG_RESULT([none])
4306 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4308 AC_MSG_RESULT([$MOZ_BUILD_APP])
4312 # Allow the application to influence configure with a confvars.sh script.
4314 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4315 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4316 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4317 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4322 # Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
4323 MOZ_ARG_WITH_STRING(app-name,
4324 [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
4325 WITH_APP_NAME=$withval,
4328 if test -n "$WITH_APP_NAME" ; then
4329 MOZ_APP_NAME="$WITH_APP_NAME"
4332 MOZ_ARG_WITH_STRING(app-basename,
4333 [--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
4334 WITH_APP_BASENAME=$withval,
4337 if test -n "$WITH_APP_BASENAME" ; then
4338 MOZ_APP_BASENAME="$WITH_APP_BASENAME"
4341 # Now is a good time to test for logic errors, define mismatches, etc.
4342 case "$MOZ_BUILD_APP" in
4344 if test "$LIBXUL_SDK"; then
4345 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4350 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4351 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4353 case "$MOZ_BUILD_APP" in
4355 AC_DEFINE(MOZ_PHOENIX)
4359 AC_DEFINE(MOZ_XULRUNNER)
4363 AC_SUBST(MOZ_BUILD_APP)
4364 AC_SUBST(MOZ_PHOENIX)
4365 AC_SUBST(MOZ_XULRUNNER)
4367 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4369 dnl ========================================================
4370 dnl Check android sdk version depending on mobile target
4371 dnl ========================================================
4373 if test -z "$gonkdir" ; then
4374 # Minimum Android SDK API Level we require.
4375 case "$MOZ_BUILD_APP" in
4377 android_min_api_level=13
4380 android_min_api_level=16
4384 MOZ_ANDROID_SDK($android_min_api_level)
4387 dnl ========================================================
4389 dnl = Toolkit Options
4391 dnl ========================================================
4392 MOZ_ARG_HEADER(Toolkit Options)
4394 dnl ========================================================
4395 dnl = Select the default toolkit
4396 dnl ========================================================
4397 MOZ_ARG_ENABLE_STRING(default-toolkit,
4398 [ --enable-default-toolkit=TK
4399 Select default toolkit
4400 Platform specific defaults:
4401 Mac OS X - cairo-cocoa
4403 Win32 - cairo-windows
4406 [ _DEFAULT_TOOLKIT=$enableval ],
4407 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4409 if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4410 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4411 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4412 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4413 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4414 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
4415 -o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \
4416 -o "$_DEFAULT_TOOLKIT" = "cairo-android" \
4417 -o "$_DEFAULT_TOOLKIT" = "cairo-gonk"
4419 dnl nglayout only supports building with one toolkit,
4420 dnl so ignore everything after the first comma (",").
4421 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4423 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4426 MOZ_ARG_WITHOUT_BOOL(x,
4427 [ --without-x Build without X11],
4430 dnl ========================================================
4431 dnl = Enable the toolkit as needed =
4432 dnl ========================================================
4434 case "$MOZ_WIDGET_TOOLKIT" in
4437 MOZ_WIDGET_TOOLKIT=windows
4440 MOZ_INSTRUMENT_EVENT_LOOP=1
4443 cairo-gtk2|cairo-gtk2-x11)
4444 MOZ_WIDGET_TOOLKIT=gtk2
4446 MOZ_ENABLE_XREMOTE=1
4448 MOZ_GL_DEFAULT_PROVIDER=GLX
4454 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4455 TK_LIBS='$(MOZ_GTK2_LIBS)'
4456 AC_DEFINE(MOZ_WIDGET_GTK2)
4457 AC_DEFINE(MOZ_WIDGET_GTK,2)
4459 MOZ_INSTRUMENT_EVENT_LOOP=1
4463 MOZ_WIDGET_TOOLKIT=qt
4465 if test -z "$WITHOUT_X11"; then
4466 MOZ_ENABLE_XREMOTE=1
4467 MOZ_GL_DEFAULT_PROVIDER=GLX
4476 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4477 TK_LIBS='$(MOZ_QT_LIBS)'
4478 AC_DEFINE(MOZ_WIDGET_QT)
4483 MOZ_WIDGET_TOOLKIT=os2
4485 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4486 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4491 MOZ_WIDGET_TOOLKIT=cocoa
4492 AC_DEFINE(MOZ_WIDGET_COCOA)
4493 LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
4494 TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
4495 TK_CFLAGS="-DNO_X11"
4496 CFLAGS="$CFLAGS $TK_CFLAGS"
4497 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4498 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
4499 MOZ_USER_DIR="Mozilla"
4500 MOZ_FS_LAYOUT=bundle
4502 MOZ_INSTRUMENT_EVENT_LOOP=1
4506 MOZ_WIDGET_TOOLKIT=uikit
4507 AC_DEFINE(MOZ_WIDGET_UIKIT)
4508 LDFLAGS="$LDFLAGS -framework UIKit -lobjc"
4509 TK_CFLAGS="-DNO_X11"
4510 TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
4511 CFLAGS="$CFLAGS $TK_CFLAGS"
4512 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4513 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
4514 MOZ_USER_DIR="Mozilla"
4515 MOZ_FS_LAYOUT=bundle
4519 AC_DEFINE(MOZ_WIDGET_ANDROID)
4520 MOZ_WIDGET_TOOLKIT=android
4521 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4522 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4525 MOZ_INSTRUMENT_EVENT_LOOP=1
4526 if test "$MOZ_BUILD_APP" = "mobile/xul"; then
4532 AC_DEFINE(MOZ_WIDGET_GONK)
4533 AC_DEFINE(MOZ_TOUCH)
4534 MOZ_WIDGET_TOOLKIT=gonk
4535 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4536 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4544 AC_SUBST(MOZ_OLD_LINKER)
4545 AC_SUBST(MOZ_PDF_PRINTING)
4546 if test "$MOZ_PDF_PRINTING"; then
4547 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
4548 AC_DEFINE(MOZ_PDF_PRINTING)
4551 if test "$MOZ_ENABLE_XREMOTE"; then
4552 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4555 if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then
4556 AC_DEFINE(MOZ_INSTRUMENT_EVENT_LOOP)
4559 if test "$COMPILE_ENVIRONMENT"; then
4560 if test "$MOZ_ENABLE_GTK2"; then
4561 if test "$MOZ_X11"; then
4562 GDK_PACKAGES=gdk-x11-2.0
4565 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4568 fi # COMPILE_ENVIRONMENT
4570 AC_SUBST(MOZ_FS_LAYOUT)
4572 dnl ========================================================
4573 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4574 dnl their usage and use them in spidermonkey.
4575 dnl ========================================================
4576 MOZ_ARG_WITH_BOOL(arm-kuser,
4577 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4579 if test -n "$USE_ARM_KUSER"; then
4580 AC_DEFINE(USE_ARM_KUSER)
4583 dnl ========================================================
4584 dnl = startup-notification support module
4585 dnl ========================================================
4587 if test "$MOZ_ENABLE_GTK2"
4589 MOZ_ENABLE_STARTUP_NOTIFICATION=
4591 MOZ_ARG_ENABLE_BOOL(startup-notification,
4592 [ --enable-startup-notification
4593 Enable startup-notification support (default: disabled) ],
4594 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4595 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4596 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4598 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4599 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4600 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4601 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4603 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4605 MOZ_ENABLE_STARTUP_NOTIFICATION=
4609 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4610 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4613 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4615 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4616 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4617 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4619 dnl ========================================================
4621 dnl ========================================================
4622 if test "$MOZ_ENABLE_QT"
4624 MOZ_ARG_WITH_STRING(qtdir,
4625 [ --with-qtdir=\$dir Specify Qt directory ],
4628 if test -z "$QTDIR"; then
4629 PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore QtOpenGL)
4630 PKG_CHECK_MODULES(MOZ_QT5, QtWidgets QtMultimedia QtPrintSupport,
4633 if test "$MOZ_ENABLE_QT5"; then
4635 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $MOZ_QT5_CFLAGS"
4636 MOZ_QT_LIBS="$MOZ_QT_LIBS $MOZ_QT5_LIBS"
4639 AC_CHECK_PROGS(HOST_MOC, $MOC moc, "")
4640 AC_CHECK_PROGS(HOST_RCC, $RCC rcc, "")
4642 MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtXml -lQtOpenGL"
4644 MOZ_QT_CFLAGS="-DQT_SHARED"
4645 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
4646 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt"
4647 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
4648 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
4649 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
4650 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
4651 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDeclarative"
4652 HOST_MOC="$QTDIR/bin/moc"
4653 HOST_RCC="$QTDIR/bin/rcc"
4655 # QtWidgets was introduced only in Qt5
4656 if test -d $QTDIR/include/QtWidgets; then
4657 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtWidgets"
4658 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtPrintSupport"
4659 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtWidgets -lQtPrintSupport"
4662 if test -z "$HOST_MOC"; then
4663 AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is
4666 if test -z "$HOST_RCC"; then
4667 AC_MSG_ERROR([No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is
4674 MOZ_ENABLE_QMSYSTEM2=
4675 PKG_CHECK_MODULES(_QMSYSTEM2, qmsystem2,
4676 MOZ_ENABLE_QMSYSTEM2=1,
4677 MOZ_ENABLE_QMSYSTEM2=)
4679 if test "$MOZ_ENABLE_QMSYSTEM2"; then
4680 MOZ_ENABLE_QMSYSTEM2=1
4681 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QMSYSTEM2_CFLAGS"
4682 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QMSYSTEM2_LIBS"
4683 AC_DEFINE(MOZ_ENABLE_QMSYSTEM2)
4686 MOZ_ENABLE_QTNETWORK=
4687 PKG_CHECK_MODULES(_QTNETWORK, QtNetwork >= 4.7,
4688 MOZ_ENABLE_QTNETWORK=1,
4689 MOZ_ENABLE_QTNETWORK=)
4691 if test "$MOZ_ENABLE_QTNETWORK"; then
4692 MOZ_ENABLE_QTNETWORK=1
4693 AC_DEFINE(MOZ_ENABLE_QTNETWORK)
4696 MOZ_ENABLE_QTMOBILITY=
4697 PKG_CHECK_MODULES(_QTMOBILITY, QtSensors QtFeedback QtLocation,
4698 MOZ_ENABLE_QTMOBILITY=1,
4699 MOZ_ENABLE_QTMOBILITY=)
4700 if test "$MOZ_ENABLE_QTMOBILITY"; then
4701 MOZ_ENABLE_QTMOBILITY=1
4702 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
4703 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
4705 AC_CHECK_LIB(QtSensors, main, [
4706 MOZ_ENABLE_QTMOBILITY=1
4707 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtMobility"
4708 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtSensors"
4709 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtFeedback"
4710 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtLocation"
4711 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback -lQtLocation"
4714 if test "$MOZ_ENABLE_QTMOBILITY"; then
4715 AC_DEFINE(MOZ_ENABLE_QTMOBILITY)
4719 AC_SUBST(GTK_CONFIG)
4723 AC_SUBST(MOZ_ENABLE_GTK2)
4724 AC_SUBST(MOZ_ENABLE_QT)
4725 AC_SUBST(MOZ_ENABLE_QTNETWORK)
4726 AC_SUBST(MOZ_ENABLE_QMSYSTEM2)
4727 AC_SUBST(MOZ_ENABLE_QTMOBILITY)
4728 AC_SUBST(MOZ_ENABLE_XREMOTE)
4729 AC_SUBST(MOZ_GTK2_CFLAGS)
4730 AC_SUBST(MOZ_GTK2_LIBS)
4731 AC_SUBST(MOZ_QT_CFLAGS)
4732 AC_SUBST(MOZ_QT_LIBS)
4739 dnl ========================================================
4741 dnl = Components & Features
4743 dnl ========================================================
4744 MOZ_ARG_HEADER(Components and Features)
4746 dnl ========================================================
4748 dnl ========================================================
4749 MOZ_ARG_ENABLE_STRING(ui-locale,
4750 [ --enable-ui-locale=ab-CD
4751 Select the user interface locale (default: en-US)],
4752 MOZ_UI_LOCALE=$enableval )
4753 AC_SUBST(MOZ_UI_LOCALE)
4755 dnl ========================================================
4756 dnl = Trademarked Branding
4757 dnl ========================================================
4758 MOZ_ARG_ENABLE_BOOL(official-branding,
4759 [ --enable-official-branding
4760 Enable Official mozilla.org Branding
4761 Do not distribute builds with
4762 --enable-official-branding unless you have
4763 permission to use trademarks per
4764 http://www.mozilla.org/foundation/trademarks/ .],
4766 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
4767 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
4769 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
4770 MOZ_OFFICIAL_BRANDING=1
4772 ], MOZ_OFFICIAL_BRANDING=)
4774 AC_SUBST(MOZ_OFFICIAL_BRANDING)
4775 if test -n "$MOZ_OFFICIAL_BRANDING"; then
4776 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
4779 MOZ_ARG_WITH_STRING(branding,
4780 [ --with-branding=dir Use branding from the specified directory.],
4781 MOZ_BRANDING_DIRECTORY=$withval)
4783 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4784 if test -z "$REAL_BRANDING_DIRECTORY"; then
4785 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4788 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4789 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
4792 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4794 dnl ========================================================
4795 dnl = Distribution ID
4796 dnl ========================================================
4797 MOZ_ARG_WITH_STRING(distribution-id,
4798 [ --with-distribution-id=ID
4799 Set distribution-specific id (default=org.mozilla)],
4800 [ val=`echo $withval`
4801 MOZ_DISTRIBUTION_ID="$val"])
4803 if test -z "$MOZ_DISTRIBUTION_ID"; then
4804 MOZ_DISTRIBUTION_ID="org.mozilla"
4807 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4808 AC_SUBST(MOZ_DISTRIBUTION_ID)
4811 dnl ========================================================
4812 dnl complex text support off by default
4813 dnl ========================================================
4814 MOZ_ARG_DISABLE_BOOL(pango,
4815 [ --disable-pango Disable usage of Pango ],
4819 dnl ========================================================
4821 dnl ========================================================
4822 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
4826 if test "$MOZ_PANGO"
4828 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
4830 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION)
4831 AC_SUBST(MOZ_PANGO_CFLAGS)
4832 AC_SUBST(MOZ_PANGO_LIBS)
4833 AC_DEFINE(MOZ_PANGO)
4835 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0)
4836 AC_SUBST(FT2_CFLAGS)
4841 dnl ========================================================
4842 dnl = GnomeVFS, GIO and GConf support module
4843 dnl ========================================================
4847 dnl build the gnomevfs extension by default only when the
4848 dnl GTK2 toolkit is in use.
4849 if test "$MOZ_ENABLE_GTK2"
4851 MOZ_ENABLE_GNOMEVFS=1
4855 dnl ========================================================
4856 dnl = GnomeVFS support module
4857 dnl ========================================================
4858 MOZ_ARG_DISABLE_BOOL(gnomevfs,
4859 [ --disable-gnomevfs Disable GnomeVFS support ],
4860 MOZ_ENABLE_GNOMEVFS=,
4861 MOZ_ENABLE_GNOMEVFS=force)
4863 if test "$MOZ_ENABLE_GNOMEVFS"
4865 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4866 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4867 MOZ_ENABLE_GNOMEVFS=1
4868 AC_DEFINE(MOZ_ENABLE_GNOMEVFS)
4870 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
4872 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
4874 MOZ_ENABLE_GNOMEVFS=
4877 if test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
4878 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4879 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4884 AC_SUBST(MOZ_ENABLE_GNOMEVFS)
4885 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
4886 AC_SUBST(MOZ_GNOMEVFS_LIBS)
4888 dnl ========================================================
4889 dnl = GIO support module
4890 dnl ========================================================
4891 MOZ_ARG_ENABLE_BOOL(gio,
4892 [ --enable-gio Enable GIO support (default: disabled)],
4893 MOZ_ENABLE_GIO=force,
4896 if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK2"
4898 PKG_CHECK_MODULES(_GTKCHECK, gtk+-2.0 >= 2.14, ,
4899 [AC_MSG_ERROR([* * * Could not find gtk+-2.0 > 2.14. Required for build with gio.])])
4900 PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[
4901 MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
4903 AC_DEFINE(MOZ_ENABLE_GIO)
4905 if test "$MOZ_ENABLE_GIO" = "force"
4907 AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION])
4913 AC_SUBST(MOZ_ENABLE_GIO)
4914 AC_SUBST(MOZ_GIO_CFLAGS)
4915 AC_SUBST(MOZ_GIO_LIBS)
4917 dnl ========================================================
4918 dnl = GConf support module
4919 dnl ========================================================
4920 MOZ_ARG_DISABLE_BOOL(gconf,
4921 [ --disable-gconf Disable Gconf support ],
4923 MOZ_ENABLE_GCONF=force)
4925 if test "$MOZ_ENABLE_GCONF"
4927 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
4928 MOZ_GCONF_LIBS=`$PKG_CONFIG --libs gobject-2.0`
4931 if test "$MOZ_ENABLE_GCONF" = "force"
4933 AC_MSG_ERROR([* * * Could not find gconf-2.0 ])
4939 if test "$MOZ_ENABLE_GCONF"; then
4940 AC_DEFINE(MOZ_ENABLE_GCONF)
4943 AC_SUBST(MOZ_ENABLE_GCONF)
4944 AC_SUBST(MOZ_GCONF_CFLAGS)
4945 AC_SUBST(MOZ_GCONF_LIBS)
4948 dnl ========================================================
4949 dnl = libproxy support
4950 dnl ========================================================
4952 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
4954 MOZ_ENABLE_LIBPROXY=
4956 MOZ_ARG_ENABLE_BOOL(libproxy,
4957 [ --enable-libproxy Enable libproxy support ],
4958 MOZ_ENABLE_LIBPROXY=1,
4959 MOZ_ENABLE_LIBPROXY=)
4961 if test "$MOZ_ENABLE_LIBPROXY"
4963 PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
4964 AC_DEFINE(MOZ_ENABLE_LIBPROXY)
4967 AC_SUBST(MOZ_ENABLE_LIBPROXY)
4968 AC_SUBST(MOZ_LIBPROXY_CFLAGS)
4969 AC_SUBST(MOZ_LIBPROXY_LIBS)
4971 dnl ========================================================
4972 dnl = GNOME component (mozgnome)
4973 dnl ========================================================
4975 if test "$MOZ_ENABLE_GTK2"
4977 MOZ_ENABLE_GNOME_COMPONENT=1
4979 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
4981 dnl ========================================================
4982 dnl = libgnomeui support module
4983 dnl ========================================================
4985 if test "$MOZ_ENABLE_GTK2"
4987 MOZ_ENABLE_GNOMEUI=1
4989 MOZ_ARG_DISABLE_BOOL(gnomeui,
4990 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
4991 MOZ_ENABLE_GNOMEUI=,
4992 MOZ_ENABLE_GNOMEUI=force)
4994 if test "$MOZ_ENABLE_GNOMEUI"
4996 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
4998 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
4999 MOZ_ENABLE_GNOMEUI=1
5001 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5003 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5009 if test "$MOZ_ENABLE_GNOMEUI"; then
5010 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5014 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5015 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5016 AC_SUBST(MOZ_GNOMEUI_LIBS)
5018 dnl ========================================================
5020 dnl ========================================================
5022 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
5026 MOZ_ARG_DISABLE_BOOL(dbus,
5027 [ --disable-dbus Disable dbus support ],
5031 if test "$MOZ_ENABLE_DBUS"
5033 PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION)
5034 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5035 AC_DEFINE(MOZ_ENABLE_DBUS)
5038 AC_SUBST(MOZ_ENABLE_DBUS)
5039 AC_SUBST(MOZ_DBUS_CFLAGS)
5040 AC_SUBST(MOZ_DBUS_LIBS)
5041 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5042 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5044 dnl ========================================================
5045 dnl = Enable Android History instead of Places
5046 dnl ========================================================
5047 if test -n "$MOZ_ANDROID_HISTORY"; then
5048 dnl Do this if defined in confvars.sh
5049 AC_DEFINE(MOZ_ANDROID_HISTORY)
5053 dnl ========================================================
5054 dnl = Build with the Android Java compositor
5055 dnl ========================================================
5056 if test -n "$MOZ_JAVA_COMPOSITOR"; then
5057 dnl Do this if defined in confvars.sh
5058 AC_DEFINE(MOZ_JAVA_COMPOSITOR)
5061 dnl ========================================================
5062 dnl = Disable WebSMS backend
5063 dnl ========================================================
5064 MOZ_ARG_DISABLE_BOOL(websms-backend,
5065 [ --disable-websms-backend
5066 Disable WebSMS backend],
5067 MOZ_WEBSMS_BACKEND=,
5068 MOZ_WEBSMS_BACKEND=1)
5070 if test -n "$MOZ_WEBSMS_BACKEND"; then
5071 AC_DEFINE(MOZ_WEBSMS_BACKEND)
5074 dnl ========================================================
5075 dnl = Build Personal Security Manager
5076 dnl ========================================================
5077 MOZ_ARG_DISABLE_BOOL(crypto,
5078 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5082 dnl ========================================================
5083 dnl = JS Debugger XPCOM component (js/jsd)
5084 dnl ========================================================
5085 MOZ_ARG_DISABLE_BOOL(jsd,
5086 [ --disable-jsd Disable JavaScript debug library],
5091 dnl ========================================================
5092 dnl = Enable IPDL's "expensive" unit tests
5093 dnl ========================================================
5096 MOZ_ARG_ENABLE_BOOL(ipdl-tests,
5097 [ --enable-ipdl-tests Enable expensive IPDL tests],
5101 if test -n "$MOZ_IPDL_TESTS"; then
5102 AC_DEFINE(MOZ_IPDL_TESTS)
5105 AC_SUBST(MOZ_IPDL_TESTS)
5107 dnl ========================================================
5108 dnl = Turns off code necessary for e10s compatibility
5109 dnl ========================================================
5110 dnl This is a temporary flag to be removed in bug 662601 when
5111 dnl it's no longer needed
5115 MOZ_ARG_ENABLE_BOOL(e10s-compat,
5116 [ --enable-e10s-compat Turns off code for e10s compat],
5120 if test -n "$MOZ_E10S_COMPAT"; then
5121 AC_DEFINE(MOZ_E10S_COMPAT)
5124 dnl ========================================================
5125 dnl = Disable building dbm
5126 dnl ========================================================
5127 MOZ_ARG_DISABLE_BOOL(dbm,
5128 [ --disable-dbm Disable building dbm],
5132 dnl bi-directional support always on
5136 dnl ========================================================
5137 dnl accessibility support on by default on all platforms
5138 dnl ========================================================
5139 MOZ_ARG_DISABLE_BOOL(accessibility,
5140 [ --disable-accessibility Disable accessibility support],
5143 if test "$ACCESSIBILITY"; then
5144 AC_DEFINE(ACCESSIBILITY)
5147 dnl ========================================================
5148 dnl Disable printing
5149 dnl ========================================================
5150 MOZ_ARG_DISABLE_BOOL(printing,
5151 [ --disable-printing Disable printing support],
5155 if test "$NS_PRINTING"; then
5156 AC_DEFINE(NS_PRINTING)
5157 AC_DEFINE(NS_PRINT_PREVIEW)
5160 dnl Turn off webrtc for OS's we don't handle yet, but allow
5161 dnl --enable-webrtc to override. Can disable for everything in
5162 dnl the master list above.
5163 if test -n "$MOZ_WEBRTC"; then
5165 *-android*|*-linuxandroid*)
5166 dnl Make sure doesn't get matched by *-linux*
5169 *-linux*|*-mingw*|*-darwin*)
5173 dnl default to disabled for all others
5179 dnl ========================================================
5180 dnl = Disable WebRTC code
5181 dnl ========================================================
5182 MOZ_ARG_DISABLE_BOOL(webrtc,
5183 [ --disable-webrtc Disable support for WebRTC],
5187 if test -n "$MOZ_WEBRTC"; then
5188 AC_DEFINE(MOZ_WEBRTC)
5193 MOZ_VP8_ERROR_CONCEALMENT=1
5196 AC_SUBST(MOZ_WEBRTC)
5198 case "$target_cpu" in
5200 MOZ_SAMPLE_TYPE_S16=1
5201 AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
5202 AC_SUBST(MOZ_SAMPLE_TYPE_S16)
5205 MOZ_SAMPLE_TYPE_FLOAT32=1
5206 AC_DEFINE(MOZ_SAMPLE_TYPE_FLOAT32)
5207 AC_SUBST(MOZ_SAMPLE_TYPE_FLOAT32)
5211 dnl ========================================================
5212 dnl = Enable Raw Codecs
5213 dnl ========================================================
5214 MOZ_ARG_ENABLE_BOOL(raw,
5215 [ --enable-raw Enable support for RAW media],
5219 if test -n "$MOZ_RAW"; then
5226 dnl ========================================================
5227 dnl = Disable Ogg Codecs
5228 dnl ========================================================
5229 MOZ_ARG_DISABLE_BOOL(ogg,
5230 [ --disable-ogg Disable support for OGG media (Theora video and Vorbis audio)],
5234 if test -n "$MOZ_OGG"; then
5240 dnl Checks for __attribute__(aligned()) directive
5241 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5242 [ac_cv_c_attribute_aligned],
5243 [ac_cv_c_attribute_aligned=0
5244 CFLAGS_save="${CFLAGS}"
5245 CFLAGS="${CFLAGS} -Werror"
5246 for ac_cv_c_attr_align_try in 64 32 16 8; do
5247 echo "trying $ac_cv_c_attr_align_try"
5249 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5250 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5251 if test "$ac_cv_c_attribute_aligned" != 0; then
5255 CFLAGS="${CFLAGS_save}"])
5256 if test "${ac_cv_c_attribute_aligned}" != "0"; then
5257 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5258 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5262 dnl ========================================================
5263 dnl = Disable Opus audio codec support
5264 dnl ========================================================
5265 MOZ_ARG_DISABLE_BOOL(opus,
5266 [ --disable-opus Disable support for Opus audio],
5270 dnl ========================================================
5271 dnl = Disable VP8 decoder support
5272 dnl ========================================================
5273 MOZ_ARG_DISABLE_BOOL(webm,
5274 [ --disable-webm Disable support for WebM media (VP8 video and Vorbis audio)],
5278 if test -n "$MOZ_WEBM"; then
5283 dnl ========================================================
5284 dnl = Enable media plugin support
5285 dnl ========================================================
5286 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
5287 dnl Enable support on android by default
5291 MOZ_ARG_ENABLE_BOOL(media-plugins,
5292 [ --enable-media-plugins Enable support for media plugins],
5293 MOZ_MEDIA_PLUGINS=1,
5296 if test -n "$MOZ_MEDIA_PLUGINS"; then
5297 AC_DEFINE(MOZ_MEDIA_PLUGINS)
5300 dnl ========================================================
5301 dnl = Enable getUserMedia support
5302 dnl ========================================================
5303 MOZ_ARG_ENABLE_BOOL(media-navigator,
5304 [ --enable-media-navigator Enable support for getUserMedia],
5305 MOZ_MEDIA_NAVIGATOR=1,
5306 MOZ_MEDIA_NAVIGATOR=)
5308 if test -n "$MOZ_MEDIA_NAVIGATOR"; then
5309 AC_DEFINE(MOZ_MEDIA_NAVIGATOR)
5312 dnl ========================================================
5313 dnl = Enable building OMX media plugin (B2G or Android)
5314 dnl ========================================================
5315 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
5316 dnl Enable support on android by default
5320 MOZ_ARG_ENABLE_BOOL(omx-plugin,
5321 [ --enable-omx-plugin Enable building OMX plugin (B2G)],
5325 if test -n "$MOZ_OMX_PLUGIN"; then
5326 if test "$OS_TARGET" = "Android"; then
5327 dnl Only allow building OMX plugin on Gonk (B2G) or Android
5328 AC_DEFINE(MOZ_OMX_PLUGIN)
5330 dnl fail if we're not building on Gonk or Android
5331 AC_MSG_ERROR([OMX media plugin can only be built on B2G or Android])
5335 dnl system libvpx Support
5336 dnl ========================================================
5337 MOZ_ARG_WITH_BOOL(system-libvpx,
5338 [ --with-system-libvpx Use system libvpx (located with pkgconfig)],
5339 MOZ_NATIVE_LIBVPX=1)
5344 if test -n "$MOZ_VP8"; then
5346 if test -n "$MOZ_VP8_ERROR_CONCEALMENT" ; then
5347 AC_DEFINE(MOZ_VP8_ERROR_CONCEALMENT)
5349 if test -n "$MOZ_VP8_ENCODER" ; then
5350 AC_DEFINE(MOZ_VP8_ENCODER)
5353 if test -n "$MOZ_NATIVE_LIBVPX"; then
5354 dnl ============================
5355 dnl === libvpx Version check ===
5356 dnl ============================
5357 dnl Check to see if we have a system libvpx package.
5358 PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.0.0)
5360 MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
5361 [AC_MSG_ERROR([Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx.])])
5364 AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
5365 [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
5370 AC_SUBST(MOZ_NATIVE_LIBVPX)
5371 AC_SUBST(MOZ_LIBVPX_CFLAGS)
5372 AC_SUBST(MOZ_LIBVPX_LIBS)
5374 if test "$MOZ_WEBM"; then
5378 if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then
5385 if test -n "$MOZ_VP8" -a -z "$MOZ_NATIVE_LIBVPX"; then
5387 dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
5388 dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
5389 dnl We currently require gcc on all arm platforms.
5392 VPX_NEED_OBJ_INT_EXTRACT=
5394 dnl See if we have assembly on this platform.
5395 case "$OS_ARCH:$CPU_ARCH" in
5397 VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
5401 VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC"
5405 VPX_ASFLAGS="-f x64 -rnasm -pnasm"
5409 dnl Check for yasm 1.1 or greater.
5410 if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then
5411 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.])
5412 elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
5413 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.])
5415 VPX_ASFLAGS="-f win32 -rnasm -pnasm -DPIC"
5417 dnl The encoder needs obj_int_extract to get asm offsets.
5421 if test -n "$GNU_AS" ; then
5423 dnl These flags are a lie; they're just used to enable the requisite
5424 dnl opcodes; actual arch detection is done at runtime.
5425 VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
5426 VPX_DASH_C_FLAG="-c"
5427 VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
5428 VPX_ASM_SUFFIX="$ASM_SUFFIX"
5433 if $CC -E -dM -</dev/null | grep -q __ELF__; then
5434 VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
5439 if $CC -E -dM -</dev/null | grep -q __ELF__; then
5440 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
5446 if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then
5447 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.])
5450 if test -n "$MOZ_VP8_ENCODER" -a \
5451 -z "$GNU_CC" -a -z "$INTEL_CC" -a -z "$CLANG_CC" ; then
5452 dnl We prefer to get asm offsets using inline assembler, which the above
5453 dnl compilers can do. When we're not using one of those, we have to fall
5454 dnl back to obj_int_extract, which reads them from a compiled object
5455 dnl file. Unfortunately, that only works if we're compiling on a system
5456 dnl with the header files for the appropriate object file format.
5457 VPX_NEED_OBJ_INT_EXTRACT=1
5460 if test -n "$VPX_X86_ASM"; then
5461 AC_DEFINE(VPX_X86_ASM)
5462 elif test -n "$VPX_ARM_ASM"; then
5463 AC_DEFINE(VPX_ARM_ASM)
5465 AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.])
5469 dnl ========================================================
5470 dnl = Disable Wave decoder support
5471 dnl ========================================================
5472 MOZ_ARG_DISABLE_BOOL(wave,
5473 [ --disable-wave Disable Wave decoder support],
5477 if test -n "$MOZ_WAVE"; then
5484 dnl ========================================================
5485 dnl = Handle dependent SYDNEYAUDIO, CUBEB, and MEDIA defines
5486 dnl ========================================================
5488 if test -n "$MOZ_SYDNEYAUDIO"; then
5489 AC_DEFINE(MOZ_SYDNEYAUDIO)
5492 if test -n "$MOZ_SPEEX_RESAMPLER"; then
5493 AC_DEFINE(MOZ_SPEEX_RESAMPLER)
5496 if test -n "$MOZ_CUBEB"; then
5498 *-android*|*-linuxandroid*)
5499 if test -n "$gonkdir"; then
5500 AC_DEFINE(MOZ_CUBEB)
5502 dnl No Android implementation of libcubeb yet.
5505 AC_DEFINE(MOZ_CUBEB)
5508 AC_DEFINE(MOZ_CUBEB)
5511 AC_DEFINE(MOZ_CUBEB)
5514 AC_DEFINE(MOZ_CUBEB)
5517 dnl Other targets will be enabled soon.
5522 if test -n "$MOZ_MEDIA"; then
5523 AC_DEFINE(MOZ_MEDIA)
5526 if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
5527 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/])
5530 if test -n "$MOZ_VORBIS"; then
5531 AC_DEFINE(MOZ_VORBIS)
5534 if test -n "$MOZ_TREMOR"; then
5535 AC_DEFINE(MOZ_TREMOR)
5538 if test -n "$MOZ_OPUS"; then
5542 dnl ========================================================
5543 dnl = Check alsa availability on Linux if using sydneyaudio
5544 dnl ========================================================
5546 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5547 if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux"; then
5548 PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
5549 [echo "$MOZ_ALSA_PKG_ERRORS"
5550 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.)])])
5553 dnl ========================================================
5554 dnl = Enable PulseAudio
5555 dnl ========================================================
5557 MOZ_ARG_ENABLE_BOOL(pulseaudio,
5558 [ --enable-pulseaudio Enable PulseAudio support (experimental)],
5562 if test -n "$MOZ_PULSEAUDIO"; then
5563 AC_DEFINE(MOZ_CUBEB)
5564 PKG_CHECK_MODULES(MOZ_PULSEAUDIO, libpulse, ,
5565 [echo "$MOZ_PULSEAUDIO_PKG_ERRORS"
5566 AC_MSG_ERROR([pulseaudio audio backend requires libpulse package])])
5569 AC_SUBST(MOZ_PULSEAUDIO)
5570 AC_SUBST(MOZ_PULSEAUDIO_CFLAGS)
5571 AC_SUBST(MOZ_PULSEAUDIO_LIBS)
5573 dnl ========================================================
5574 dnl = Enable GStreamer
5575 dnl ========================================================
5576 MOZ_ARG_ENABLE_BOOL(gstreamer,
5577 [ --enable-gstreamer Enable GStreamer support],
5581 if test "$MOZ_GSTREAMER"; then
5582 # API version, eg 0.10, 1.0 etc
5583 GST_API_VERSION=0.10
5584 # core/base release number
5585 # depend on >= 0.10.33 as that's when the playbin2 source-setup signal was
5588 PKG_CHECK_MODULES(GSTREAMER,
5589 gstreamer-$GST_API_VERSION >= $GST_VERSION
5590 gstreamer-app-$GST_API_VERSION
5591 gstreamer-plugins-base-$GST_API_VERSION)
5592 if test -n "$GSTREAMER_LIBS"; then
5593 _SAVE_LDFLAGS=$LDFLAGS
5594 LDFLAGS="$LDFLAGS $GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
5595 AC_TRY_LINK(,[return 0;],_HAVE_LIBGSTVIDEO=1,_HAVE_LIBGSTVIDEO=)
5596 if test -n "$_HAVE_LIBGSTVIDEO" ; then
5597 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
5599 AC_MSG_ERROR([gstreamer video backend requires libgstvideo])
5601 LDFLAGS=$_SAVE_LDFLAGS
5603 AC_MSG_ERROR([gstreamer backend requires the gstreamer packages])
5606 AC_SUBST(GSTREAMER_CFLAGS)
5607 AC_SUBST(GSTREAMER_LIBS)
5608 AC_SUBST(MOZ_GSTREAMER)
5610 if test -n "$MOZ_GSTREAMER"; then
5611 AC_DEFINE(MOZ_GSTREAMER)
5616 dnl ========================================================
5617 dnl Permissions System
5618 dnl ========================================================
5619 MOZ_ARG_DISABLE_BOOL(permissions,
5620 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5625 dnl ========================================================
5627 dnl ========================================================
5628 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5629 [ --disable-negotiateauth Disable GSS-API negotiation ],
5630 MOZ_AUTH_EXTENSION=,
5631 MOZ_AUTH_EXTENSION=1 )
5633 dnl ========================================================
5635 dnl ========================================================
5636 MOZ_ARG_DISABLE_BOOL(xtf,
5637 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5640 if test "$MOZ_XTF"; then
5644 dnl ========================================================
5645 dnl Pref extensions (autoconfig)
5646 dnl ========================================================
5647 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5648 [ --disable-pref-extensions
5649 Disable pref extensions such as autoconfig],
5650 MOZ_PREF_EXTENSIONS=,
5651 MOZ_PREF_EXTENSIONS=1 )
5653 dnl ========================================================
5654 dnl Searching of system directories for extensions.
5655 dnl Note: this switch is meant to be used for test builds
5656 dnl whose behavior should not depend on what happens to be
5657 dnl installed on the local machine.
5658 dnl ========================================================
5659 MOZ_ARG_DISABLE_BOOL(system-extension-dirs,
5660 [ --disable-system-extension-dirs
5661 Disable searching system- and account-global
5662 directories for extensions of any kind; use
5663 only profile-specific extension directories],
5664 ENABLE_SYSTEM_EXTENSION_DIRS=,
5665 ENABLE_SYSTEM_EXTENSION_DIRS=1 )
5666 if test "$ENABLE_SYSTEM_EXTENSION_DIRS"; then
5667 AC_DEFINE(ENABLE_SYSTEM_EXTENSION_DIRS)
5670 dnl ========================================================
5671 dnl = Universalchardet
5672 dnl ========================================================
5673 MOZ_ARG_DISABLE_BOOL(universalchardet,
5674 [ --disable-universalchardet
5675 Disable universal encoding detection],
5676 MOZ_UNIVERSALCHARDET=,
5677 MOZ_UNIVERSALCHARDET=1 )
5679 if test -n "${JAVA_BIN_PATH}"; then
5680 dnl Look for javac and jar in the specified path.
5681 JAVA_PATH="$JAVA_BIN_PATH"
5683 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5684 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5687 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5688 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5689 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5691 if test -n "${JAVA_BIN_PATH}" -o \
5692 \( "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" \); then
5693 if test -z "$JAVA" -o "$JAVA" = ":" -o -z "$JAVAC" -o "$JAVAC" = ":" -o -z "$JAR" -o "$JAR" = ":"; then
5694 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}])
5698 dnl ========================================================
5699 dnl = ANGLE OpenGL->D3D translator for WebGL
5700 dnl = * only applies to win32
5701 dnl = * enabled by default (shipping build); requires explicit --disable to disable
5702 dnl ========================================================
5704 MOZ_DIRECTX_SDK_PATH=
5705 MOZ_DIRECTX_SDK_CPU_SUFFIX=
5708 MOZ_D3DCOMPILER_CAB=
5710 MOZ_D3DCOMPILER_DLL=
5711 case "$target_os" in
5713 MOZ_ANGLE_RENDERER=1
5717 # The DirectX SDK libraries are split into x86 and x64 sub-directories
5718 case "${target_cpu}" in
5720 MOZ_DIRECTX_SDK_CPU_SUFFIX=x86
5723 MOZ_DIRECTX_SDK_CPU_SUFFIX=x64
5727 MOZ_ARG_DISABLE_BOOL(webgl,
5728 [ --disable-webgl Disable building of the WebGL implementation],
5729 MOZ_WEBGL_DISABLED=1,
5730 MOZ_WEBGL_DISABLED=)
5732 if test -n "$MOZ_WEBGL_DISABLED"; then
5737 if test -n "$MOZ_ANGLE_RENDERER" -a -z "$CROSS_COMPILE"; then
5738 # Get the SDK path from the registry.
5739 # First try to get the June 2010 SDK
5740 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1`
5741 if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then
5742 # Otherwise just take whatever comes first
5743 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
5746 if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then
5747 AC_MSG_ERROR([Found the February 2010 DirectX SDK. Need the June 2010 DirectX SDK, or newer. Upgrade your SDK or reconfigure with --disable-webgl.])
5749 MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/'`
5752 if test -n "$MOZ_DIRECTX_SDK_PATH" &&
5753 test -f "$MOZ_DIRECTX_SDK_PATH"/include/d3dx9.h &&
5754 test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
5755 AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH])
5757 AC_MSG_ERROR([Couldn't find the DirectX SDK, needed for WebGL. Either install it (June 2010 version or newer), or reconfigure with --disable-webgl.])
5760 # Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib
5761 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'`
5763 if test -z "$MOZ_D3DX9_VERSION" ; then
5764 AC_MSG_ERROR([Couldn't determine the D3DX9 version, needed for WebGL. Either reinstall the DirectX SDK (June 2010 version or newer), or reconfigure with --disable-webgl.])
5767 MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
5768 MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
5770 if test -z "$MOZ_D3DX9_CAB" -o -z "$MOZ_D3DCOMPILER_CAB"; then
5771 AC_MSG_ERROR([Couldn't find the DirectX redistributable files. Either reinstall the DirectX SDK (making sure the "DirectX Redistributable Files" option is selected), or reconfigure with --disable-webgl.])
5774 MOZ_D3DX9_DLL=d3dx9_$MOZ_D3DX9_VERSION.dll
5775 MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll
5778 dnl ========================================================
5779 dnl = Breakpad crash reporting (on by default on supported platforms)
5780 dnl ========================================================
5783 i?86-*-mingw*|x86_64-*-mingw*)
5786 i?86-apple-darwin*|x86_64-apple-darwin*)
5789 i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
5790 if test "$MOZ_ENABLE_GTK2"; then
5794 *-android*|*-linuxandroid*)
5802 MOZ_ARG_DISABLE_BOOL(crashreporter,
5803 [ --disable-crashreporter Disable breakpad crash reporting],
5805 MOZ_CRASHREPORTER=1)
5807 if test -n "$MOZ_CRASHREPORTER"; then
5808 AC_DEFINE(MOZ_CRASHREPORTER)
5810 if test "$OS_TARGET" = "Linux" -o "$OS_ARCH" = "SunOS" && \
5811 test -z "$SKIP_LIBRARY_CHECKS"; then
5812 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5813 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5814 AC_SUBST(MOZ_GTHREAD_LIBS)
5816 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.])])
5819 if test "$OS_ARCH" != "$HOST_OS_ARCH"; then
5820 AC_MSG_ERROR([Breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH. Use --disable-crashreporter.])
5823 if test "$OS_ARCH" = "WINNT" -a -z "$HAVE_64BIT_OS"; then
5824 MOZ_CRASHREPORTER_INJECTOR=1
5825 AC_DEFINE(MOZ_CRASHREPORTER_INJECTOR)
5829 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5830 [ --with-crashreporter-enable-percent=NN
5831 Enable sending crash reports by default on NN% of users. (default=100)],
5832 [ val=`echo $withval | sed 's/[^0-9]//g'`
5833 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5835 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5836 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5838 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5840 dnl ========================================================
5841 dnl = libjpeg-turbo configuration
5842 dnl ========================================================
5844 if test -z "$MOZ_NATIVE_JPEG"; then
5848 MOZ_ARG_DISABLE_BOOL(libjpeg_turbo,
5849 [ --disable-libjpeg-turbo Disable optimized jpeg decoding routines],
5851 MOZ_LIBJPEG_TURBO=1)
5853 if test "$MOZ_NATIVE_JPEG" = 1 -a "$MOZ_LIBJPEG_TURBO" = 1; then
5854 AC_MSG_ERROR([cannot use --with-system-jpeg with --enable-libjpeg-turbo.])
5857 dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
5860 if test -n "$MOZ_LIBJPEG_TURBO"; then
5862 dnl Do we support libjpeg-turbo on this platform?
5863 case "$OS_ARCH:$OS_TEST" in
5865 LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
5866 LIBJPEG_TURBO_X86_ASM=1
5869 LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
5870 LIBJPEG_TURBO_X64_ASM=1
5872 WINNT:x86|WINNT:i?86)
5873 LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
5874 LIBJPEG_TURBO_X86_ASM=1
5877 LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
5878 LIBJPEG_TURBO_X64_ASM=1
5881 LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon"
5882 LIBJPEG_TURBO_ARM_ASM=1
5885 if $CC -E -dM -</dev/null | grep -q __ELF__; then
5886 LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
5887 LIBJPEG_TURBO_X86_ASM=1
5891 if $CC -E -dM -</dev/null | grep -q __ELF__; then
5892 LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
5893 LIBJPEG_TURBO_X64_ASM=1
5900 dnl If we're on an x86 or x64 system which supports libjpeg-turbo's asm routines
5901 dnl and --disable-libjpeg-turbo wasn't passed, check for Yasm, and error out if
5902 dnl it doesn't exist or we have too old of a version.
5903 if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
5904 AC_MSG_CHECKING([for Yasm assembler])
5905 AC_CHECK_PROGS(LIBJPEG_TURBO_AS, yasm, "")
5907 if test -z "$LIBJPEG_TURBO_AS" ; then
5908 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.])
5911 dnl Check that we have the right yasm version. We require 1.0.1 or newer
5912 dnl on Linux and 1.1 or newer everywhere else.
5913 if test "$OS_ARCH" = "Linux" ; then
5914 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
5915 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_RELEASE. 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.])
5918 if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
5919 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.])
5924 dnl If we're on an ARM system which supports libjpeg-turbo's asm routines and
5925 dnl --disable-libjpeg-turbo wasn't passed, use the C compiler as the assembler.
5926 if test -n "$LIBJPEG_TURBO_ARM_ASM" ; then
5927 echo "Using $AS as the assembler for ARM code."
5928 LIBJPEG_TURBO_AS=$AS
5931 if test -n "$LIBJPEG_TURBO_X86_ASM"; then
5932 AC_DEFINE(LIBJPEG_TURBO_X86_ASM)
5933 elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
5934 AC_DEFINE(LIBJPEG_TURBO_X64_ASM)
5935 elif test -n "$LIBJPEG_TURBO_ARM_ASM"; then
5936 AC_DEFINE(LIBJPEG_TURBO_ARM_ASM)
5937 elif test -n "$MOZ_LIBJPEG_TURBO"; then
5938 dnl Warn if we're not building the optimized routines, even though the user
5939 dnl didn't specify --disable-libjpeg-turbo.
5940 AC_MSG_WARN([No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.])
5943 dnl ========================================================
5944 dnl = Enable compilation of specific extension modules
5945 dnl ========================================================
5947 MOZ_ARG_ENABLE_STRING(extensions,
5948 [ --enable-extensions Enable extensions],
5949 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5950 if test "$option" = "yes" -o "$option" = "all"; then
5951 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5952 elif test "$option" = "no" -o "$option" = "none"; then
5954 elif test "$option" = "default"; then
5955 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5956 elif test `echo "$option" | grep -c \^-` != 0; then
5957 option=`echo $option | sed 's/^-//'`
5958 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5960 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5963 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5965 if test -z "$MOZ_ENABLE_GNOMEVFS" -a -z "$MOZ_GNOMEVFS_LIBS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5966 # Suppress warning on non-X11 platforms
5967 if test -n "$MOZ_X11"; then
5968 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5970 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5973 dnl Do not build gnomevfs with libxul based apps
5974 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5975 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5978 if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
5979 # Suppress warning on non-X11 platforms
5980 if test -n "$MOZ_X11"; then
5981 AC_MSG_WARN([Cannot build gio without required libraries. Removing gio from MOZ_EXTENSIONS.])
5983 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
5986 dnl Do not build gio with libxul based apps
5987 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
5988 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
5991 if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5992 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5993 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5996 dnl xforms requires xtf
5997 if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
5998 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
5999 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
6003 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
6005 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
6006 dnl when trying to build a nonexistent extension.
6007 for extension in $MOZ_EXTENSIONS; do
6008 if test ! -d "${srcdir}/extensions/${extension}"; then
6009 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
6013 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
6014 AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS)
6017 dnl ========================================================
6018 dnl CSS3 Flexbox Support
6019 dnl ========================================================
6020 if test -n "$MOZ_FLEXBOX"; then
6021 AC_DEFINE(MOZ_FLEXBOX)
6024 dnl ========================================================
6025 dnl Build Freetype in the tree
6026 dnl ========================================================
6027 MOZ_ARG_ENABLE_BOOL(tree-freetype,
6028 [ --enable-tree-freetype Enable Tree FreeType],
6029 MOZ_TREE_FREETYPE=1,
6030 MOZ_TREE_FREETYPE= )
6031 if test -n "$MOZ_TREE_FREETYPE"; then
6032 if test -n "$_WIN32_MSVC"; then
6033 AC_ERROR("building with in-tree freetype is not supported on MSVC")
6035 AC_DEFINE(MOZ_TREE_FREETYPE)
6036 AC_SUBST(MOZ_TREE_FREETYPE)
6037 MOZ_ENABLE_CAIRO_FT=1
6038 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6039 FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6040 CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6041 FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6043 CAIRO_FT_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6044 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
6045 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
6046 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
6047 AC_SUBST(CAIRO_FT_CFLAGS)
6050 dnl ========================================================
6052 dnl ========================================================
6053 dnl Abort Windows build if the required major version and
6054 dnl minimum minor version of Unicode NSIS isn't in the path
6055 dnl (unless in case of cross compiling, for which Unicode
6056 dnl is not yet sufficient).
6057 if test "$OS_ARCH" = "WINNT"; then
6058 REQ_NSIS_MAJOR_VER=2
6059 MIN_NSIS_MINOR_VER=33
6060 MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensisu-2.46 makensisu makensis)
6061 if test -n "$MAKENSISU" -a "$MAKENSISU" != ":"; then
6062 AC_MSG_RESULT([yes])
6064 MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\)\-Unicode$/\1/g'`
6066 if test ! "$MAKENSISU_VER" = ""; then
6067 MAKENSISU_MAJOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $1 }'`
6068 MAKENSISU_MINOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $2 }'`
6070 AC_MSG_CHECKING([for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER])
6071 if test "$MAKENSISU_VER" = "" || \
6072 test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \
6073 ! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then
6075 if test -z "$CROSS_COMPILE"; then
6076 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.])
6081 elif test -z "$CROSS_COMPILE"; then
6082 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.])
6088 dnl ========================================================
6090 dnl ========================================================
6091 MOZ_ARG_DISABLE_BOOL(webapp-runtime,
6092 [ --disable-webapp-runtime Disable Web App Runtime],
6093 MOZ_WEBAPP_RUNTIME=,
6094 MOZ_WEBAPP_RUNTIME=1)
6095 if test "$MOZ_WIDGET_TOOLKIT" != "windows" -a "$MOZ_WIDGET_TOOLKIT" != "cocoa" -a "$MOZ_WIDGET_TOOLKIT" != "gtk2"; then
6098 if test "$OS_ARCH" = "WINNT" -a -z "$MAKENSISU" -a -n "$CROSS_COMPILE"; then
6101 AC_SUBST(MOZ_WEBAPP_RUNTIME)
6102 if test "$MOZ_WEBAPP_RUNTIME"; then
6103 AC_DEFINE(MOZ_WEBAPP_RUNTIME)
6106 AC_MSG_CHECKING([for tar archiver])
6107 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6108 if test -z "$TAR"; then
6109 AC_MSG_ERROR([no tar archiver found in \$PATH])
6111 AC_MSG_RESULT([$TAR])
6114 AC_MSG_CHECKING([for wget])
6115 AC_CHECK_PROGS(WGET, wget, "")
6116 AC_MSG_RESULT([$WGET])
6119 dnl ========================================================
6121 dnl ========================================================
6123 if test -n "$MOZ_SIGN_CMD"; then
6124 AC_DEFINE(MOZ_SIGNING)
6127 dnl ========================================================
6128 dnl Maintenance Service
6129 dnl ========================================================
6131 MOZ_ARG_ENABLE_BOOL(maintenance-service,
6132 [ --enable-maintenance-service Enable building of maintenanceservice],
6133 MOZ_MAINTENANCE_SERVICE=1,
6134 MOZ_MAINTENANCE_SERVICE= )
6136 if test -n "$MOZ_MAINTENANCE_SERVICE"; then
6137 if test "$OS_ARCH" = "WINNT"; then
6138 AC_DEFINE(MOZ_MAINTENANCE_SERVICE)
6140 AC_MSG_ERROR([Can only build with --enable-maintenance-service with a Windows target])
6144 dnl ========================================================
6145 dnl Verify MAR signatures
6146 dnl ========================================================
6148 MOZ_ARG_ENABLE_BOOL(verify-mar,
6149 [ --enable-verify-mar Enable verifying MAR signatures],
6150 MOZ_VERIFY_MAR_SIGNATURE=1,
6151 MOZ_VERIFY_MAR_SIGNATURE= )
6153 if test -n "$MOZ_VERIFY_MAR_SIGNATURE"; then
6154 if test "$OS_ARCH" = "WINNT"; then
6155 AC_DEFINE(MOZ_VERIFY_MAR_SIGNATURE)
6157 AC_MSG_ERROR([Can only build with --enable-verify-mar with a Windows target])
6161 dnl ========================================================
6162 dnl Enable building the signmar program.
6163 dnl This option is much different than the --enable-verify-mar option.
6164 dnl --enable-verify-mar is for enabling the verification check on MAR
6165 dnl files in the updater. The --enable-signmar option is for building
6166 dnl the signmar program.
6167 dnl ========================================================
6169 MOZ_ARG_ENABLE_BOOL(signmar,
6170 [ --enable-signmar Enable building the signmar program],
6171 MOZ_ENABLE_SIGNMAR=1,
6172 MOZ_ENABLE_SIGNMAR= )
6174 if test -n "$MOZ_ENABLE_SIGNMAR"; then
6175 AC_DEFINE(MOZ_ENABLE_SIGNMAR)
6178 dnl ========================================================
6180 dnl ========================================================
6182 MOZ_ARG_DISABLE_BOOL(updater,
6183 [ --disable-updater Disable building of updater],
6187 if test -n "$MOZ_UPDATER"; then
6188 AC_DEFINE(MOZ_UPDATER)
6191 # app update channel is 'default' when not supplied.
6192 MOZ_ARG_ENABLE_STRING([update-channel],
6193 [ --enable-update-channel=CHANNEL
6194 Select application update channel (default=default)],
6195 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6197 if test -z "$MOZ_UPDATE_CHANNEL"; then
6198 MOZ_UPDATE_CHANNEL=default
6200 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6201 AC_SUBST(MOZ_UPDATE_CHANNEL)
6203 # tools/update-packaging is not checked out by default.
6204 MOZ_ARG_ENABLE_BOOL(update-packaging,
6205 [ --enable-update-packaging
6206 Enable tools/update-packaging],
6207 MOZ_UPDATE_PACKAGING=1,
6208 MOZ_UPDATE_PACKAGING= )
6209 AC_SUBST(MOZ_UPDATE_PACKAGING)
6211 dnl ========================================================
6212 dnl build the tests by default
6213 dnl ========================================================
6214 MOZ_ARG_DISABLE_BOOL(tests,
6215 [ --disable-tests Do not build test libraries & programs],
6219 dnl ========================================================
6220 dnl parental controls (for Windows Vista)
6221 dnl ========================================================
6222 MOZ_ARG_DISABLE_BOOL(parental-controls,
6223 [ --disable-parental-controls
6224 Do not build parental controls],
6225 MOZ_DISABLE_PARENTAL_CONTROLS=1,
6226 MOZ_DISABLE_PARENTAL_CONTROLS=)
6227 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6228 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6231 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6233 dnl ========================================================
6234 dnl = Disable DOMCrypto
6235 dnl ========================================================
6236 if test -n "$MOZ_DISABLE_DOMCRYPTO"; then
6237 AC_DEFINE(MOZ_DISABLE_DOMCRYPTO)
6240 dnl ========================================================
6242 dnl = Module specific options
6244 dnl ========================================================
6245 MOZ_ARG_HEADER(Individual module options)
6247 dnl ========================================================
6248 dnl = Disable feed handling components
6249 dnl ========================================================
6250 MOZ_ARG_DISABLE_BOOL(feeds,
6251 [ --disable-feeds Disable feed handling and processing components],
6254 if test -n "$MOZ_FEEDS"; then
6255 AC_DEFINE(MOZ_FEEDS)
6257 if test "$MOZ_BUILD_APP" = "browser"; then
6258 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6262 dnl ========================================================
6263 dnl Check for sqlite
6264 dnl ========================================================
6267 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6268 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6269 MOZ_NATIVE_SQLITE=1,
6270 MOZ_NATIVE_SQLITE= )
6272 if test -z "$MOZ_NATIVE_SQLITE"
6275 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)'
6277 dnl ============================
6278 dnl === SQLite Version check ===
6279 dnl ============================
6280 dnl Check to see if the system SQLite package is new enough.
6281 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6283 dnl ==================================
6284 dnl === SQLITE_SECURE_DELETE check ===
6285 dnl ==================================
6286 dnl Check to see if the system SQLite package is compiled with
6287 dnl SQLITE_SECURE_DELETE enabled.
6288 AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
6289 _SAVE_CFLAGS="$CFLAGS"
6290 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6292 LIBS="$LIBS $SQLITE_LIBS"
6293 AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
6295 #include "sqlite3.h"
6297 int main(int argc, char **argv){
6298 return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
6300 ac_cv_sqlite_secure_delete=yes,
6301 ac_cv_sqlite_secure_delete=no,
6302 ac_cv_sqlite_secure_delete=no
6305 AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
6306 CFLAGS="$_SAVE_CFLAGS"
6308 if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
6309 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
6312 dnl ===============================
6313 dnl === SQLITE_THREADSAFE check ===
6314 dnl ===============================
6315 dnl Check to see if the system SQLite package is compiled with
6316 dnl SQLITE_THREADSAFE enabled.
6317 AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
6318 _SAVE_CFLAGS="$CFLAGS"
6319 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6321 LIBS="$LIBS $SQLITE_LIBS"
6322 AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
6324 #include "sqlite3.h"
6326 int main(int argc, char **argv){
6327 return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
6329 ac_cv_sqlite_threadsafe=yes,
6330 ac_cv_sqlite_threadsafe=no,
6331 ac_cv_sqlite_threadsafe=no
6334 AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
6335 CFLAGS="$_SAVE_CFLAGS"
6337 if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
6338 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
6341 dnl ================================
6342 dnl === SQLITE_ENABLE_FTS3 check ===
6343 dnl ================================
6344 dnl check to see if the system SQLite package is compiled with
6345 dnl SQLITE_ENABLE_FTS3 enabled.
6346 AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
6347 _SAVE_CFLAGS="$CFLAGS"
6348 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6350 LIBS="$LIBS $SQLITE_LIBS"
6351 AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
6353 #include "sqlite3.h"
6355 int main(int argc, char **argv){
6356 return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
6358 ac_cv_sqlite_enable_fts3=yes,
6359 ac_cv_sqlite_enable_fts3=no,
6360 ac_cv_sqlite_enable_fts3=no
6363 AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
6364 CFLAGS="$_SAVE_CFLAGS"
6366 if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
6367 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
6370 dnl =========================================
6371 dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
6372 dnl =========================================
6373 dnl check to see if the system SQLite package is compiled with
6374 dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
6375 AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
6376 _SAVE_CFLAGS="$CFLAGS"
6377 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6379 LIBS="$LIBS $SQLITE_LIBS"
6380 AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
6382 #include "sqlite3.h"
6384 int main(int argc, char **argv){
6385 return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
6387 ac_cv_sqlite_enable_unlock_notify=yes,
6388 ac_cv_sqlite_enable_unlock_notify=no,
6389 ac_cv_sqlite_enable_unlock_notify=no
6392 AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
6393 CFLAGS="$_SAVE_CFLAGS"
6395 if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
6396 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
6400 if test -n "$MOZ_NATIVE_SQLITE"; then
6401 AC_DEFINE(MOZ_NATIVE_SQLITE)
6403 AC_SUBST(MOZ_NATIVE_SQLITE)
6405 dnl ========================================================
6406 dnl = Enable help viewer (off by default)
6407 dnl ========================================================
6408 if test -n "$MOZ_HELP_VIEWER"; then
6409 dnl Do this if defined in confvars.sh
6410 AC_DEFINE(MOZ_HELP_VIEWER)
6413 dnl ========================================================
6414 dnl = Enable safe browsing (anti-phishing)
6415 dnl ========================================================
6416 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6417 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6418 MOZ_SAFE_BROWSING=1,
6419 MOZ_SAFE_BROWSING= )
6420 if test -n "$MOZ_SAFE_BROWSING"; then
6421 AC_DEFINE(MOZ_SAFE_BROWSING)
6423 AC_SUBST(MOZ_SAFE_BROWSING)
6425 dnl ========================================================
6426 dnl = Enable url-classifier
6427 dnl ========================================================
6428 dnl Implicitly enabled by default if building with safe-browsing
6429 if test -n "$MOZ_SAFE_BROWSING"; then
6430 MOZ_URL_CLASSIFIER=1
6432 MOZ_ARG_ENABLE_BOOL(url-classifier,
6433 [ --enable-url-classifier Enable url classifier module],
6434 MOZ_URL_CLASSIFIER=1,
6435 MOZ_URL_CLASSIFIER= )
6436 if test -n "$MOZ_URL_CLASSIFIER"; then
6437 AC_DEFINE(MOZ_URL_CLASSIFIER)
6439 AC_SUBST(MOZ_URL_CLASSIFIER)
6441 dnl ========================================================
6442 dnl = Disable zipwriter
6443 dnl ========================================================
6444 MOZ_ARG_DISABLE_BOOL(zipwriter,
6445 [ --disable-zipwriter Disable zipwriter component],
6448 AC_SUBST(MOZ_ZIPWRITER)
6450 dnl ========================================================
6452 dnl ========================================================
6453 dnl superseded by QtNetwork starting from 4.7
6454 MOZ_ENABLE_LIBCONIC=1
6456 if test -n "$MOZ_ENABLE_QT"; then
6457 if test "$MOZ_ENABLE_QTNETWORK"; then
6458 MOZ_ENABLE_LIBCONIC=
6462 MOZ_ARG_DISABLE_BOOL(libconic,
6463 [ --disable-libconic Disable libconic],
6464 MOZ_ENABLE_LIBCONIC=,
6465 MOZ_ENABLE_LIBCONIC=1 )
6467 if test -n "$MOZ_ENABLE_LIBCONIC"; then
6468 PKG_CHECK_MODULES(LIBCONIC, conic,
6469 MOZ_ENABLE_LIBCONIC=1,
6470 MOZ_ENABLE_LIBCONIC=)
6472 if test "$MOZ_ENABLE_LIBCONIC"; then
6473 AC_DEFINE(MOZ_ENABLE_LIBCONIC)
6476 AC_SUBST(MOZ_ENABLE_LIBCONIC)
6477 AC_SUBST(LIBCONIC_CFLAGS)
6478 AC_SUBST(LIBCONIC_LIBS)
6480 dnl ========================================================
6482 dnl ========================================================
6484 MAEMO_SDK_TARGET_VER=-1
6486 MOZ_ARG_WITH_STRING(maemo-version,
6487 [ --with-maemo-version=MAEMO_SDK_TARGET_VER
6489 MAEMO_SDK_TARGET_VER=$withval)
6491 case "$MAEMO_SDK_TARGET_VER" in
6493 MOZ_PLATFORM_MAEMO=5
6497 MOZ_PLATFORM_MAEMO=6
6501 dnl We aren't compiling for Maemo, move on.
6504 AC_MSG_ERROR([Unknown Maemo Version. Try setting --with-maemo-version to 5 or 6.])
6508 if test $MOZ_PLATFORM_MAEMO; then
6509 AC_DEFINE_UNQUOTED([MOZ_PLATFORM_MAEMO], $MOZ_PLATFORM_MAEMO)
6511 if test -z "$MOZ_ENABLE_DBUS"; then
6512 AC_MSG_ERROR([DBus is required when building for Maemo])
6515 MOZ_GFX_OPTIMIZE_MOBILE=1
6516 MOZ_GL_DEFAULT_PROVIDER=EGL
6517 MOZ_MAEMO_LIBLOCATION=
6519 if test $MOZ_PLATFORM_MAEMO = 5; then
6520 dnl if we have Xcomposite we should also have Xdamage and Xfixes
6521 MOZ_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
6522 [AC_MSG_ERROR([Couldn't find X11/extensions/Xdamage.h which is required for composited plugins.])])
6523 AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
6524 [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
6526 AC_SUBST(XCOMPOSITE_LIBS)
6528 PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime, _LIB_FOUND=1, _LIB_FOUND=)
6529 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
6530 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
6531 if test -z "$_LIB_FOUND"; then
6532 AC_MSG_ERROR([Hildon Mime is required when building for Maemo])
6536 PKG_CHECK_MODULES(LIBOSSO,libosso, _LIB_FOUND=1, _LIB_FOUND=)
6537 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
6538 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
6539 if test -z "$_LIB_FOUND"; then
6540 AC_MSG_ERROR([LibOSSO is required when building for Maemo])
6543 PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2, _LIB_FOUND=1, _LIB_FOUND=)
6544 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
6545 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
6546 if test -z "$_LIB_FOUND"; then
6547 AC_MSG_ERROR([Hildon FM-2 is required when building for Maemo])
6551 if test $MOZ_PLATFORM_MAEMO = 6; then
6553 PKG_CHECK_MODULES(LIBCONTENTMANAGER, ContentManager QtSparql,
6556 if test "$_LIB_FOUND"; then
6557 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTMANAGER_LIBS"
6558 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTMANAGER_CFLAGS"
6559 MOZ_ENABLE_CONTENTMANAGER=1
6560 AC_DEFINE(MOZ_ENABLE_CONTENTMANAGER)
6562 AC_MSG_WARN([Cannot find libcontentmanager and or QtSparql building for Maemo 6])
6564 AC_SUBST(MOZ_ENABLE_CONTENTMANAGER)
6566 dnl ========================================================
6567 dnl = Enable meego libcontentaction
6568 dnl ========================================================
6569 MOZ_ARG_ENABLE_BOOL(meegocontentaction,
6570 [ --enable-meegocontentaction Enable meegocontentaction support],
6571 MOZ_MEEGOCONTENTACTION=1,
6572 MOZ_MEEGOCONTENTACTION=)
6574 if test -n "$MOZ_MEEGOCONTENTACTION"; then
6576 PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
6577 if test "$_LIB_FOUND"; then
6578 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTACTION_LIBS"
6579 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTACTION_CFLAGS"
6580 MOZ_ENABLE_CONTENTACTION=1
6581 AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
6582 AC_SUBST(MOZ_ENABLE_CONTENTACTION)
6586 MOZ_ARG_ENABLE_BOOL(meegotouch,
6587 [ --enable-meegotouch Enable meegotouch support],
6588 MOZ_MEEGOTOUCHENABLED=1,
6589 MOZ_MEEGOTOUCHENABLED=)
6591 if test -n "$MOZ_MEEGOTOUCHENABLED"; then
6592 PKG_CHECK_MODULES(MOZ_MEEGOTOUCH, meegotouchcore, _LIB_FOUND=1, _LIB_FOUND=)
6593 if test "$_LIB_FOUND"; then
6594 MOZ_QT_CFLAGS="$MOZ_MEEGOTOUCH_CFLAGS $MOZ_QT_CFLAGS"
6595 MOZ_QT_LIBS="$MOZ_MEEGOTOUCH_LIBS $MOZ_QT_LIBS"
6596 AC_DEFINE(MOZ_ENABLE_MEEGOTOUCH)
6598 AC_MSG_WARN([Cannot meegotouchcore-dev. Disabling Meegotouch support.])
6603 PKG_CHECK_MODULES(LIBLOCATION,liblocation, _LIB_FOUND=1, _LIB_FOUND=)
6604 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBLOCATION_LIBS"
6605 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBLOCATION_CFLAGS"
6606 if test "$_LIB_FOUND"; then
6607 MOZ_MAEMO_LIBLOCATION=1
6608 AC_DEFINE(MOZ_MAEMO_LIBLOCATION)
6610 AC_MSG_WARN([Cannot liblocation-dev. Disabling Maemo geolocation.])
6612 AC_SUBST(MOZ_MAEMO_LIBLOCATION)
6614 PKG_CHECK_MODULES(LIBMEEGOTOUCHSHARE, ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri, _LIB_FOUND=1, _LIB_FOUND=)
6615 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBMEEGOTOUCHSHARE_LIBS"
6616 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBMEEGOTOUCHSHARE_CFLAGS"
6617 if test "$_LIB_FOUND"; then
6618 MOZ_ENABLE_MEEGOTOUCHSHARE=1
6619 AC_DEFINE(MOZ_ENABLE_MEEGOTOUCHSHARE)
6621 AC_MSG_WARN([Cannot find maemo-meegotouch-interfaces-dev or libmdatauri-dev. Disabling meegotouch share ui.])
6623 AC_SUBST(MOZ_ENABLE_MEEGOTOUCHSHARE)
6625 AC_SUBST(MOZ_PLATFORM_MAEMO_LIBS)
6626 AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
6629 dnl ========================================================
6630 dnl = XRender Composite
6631 dnl ========================================================
6632 MOZ_ARG_ENABLE_BOOL(egl-xrender-composite,
6633 [ --enable-egl-xrender-composite
6634 Enable EGL xrender composite optimizations],
6635 MOZ_EGL_XRENDER_COMPOSITE=1)
6637 if test -n "$MOZ_EGL_XRENDER_COMPOSITE"; then
6638 AC_DEFINE(MOZ_EGL_XRENDER_COMPOSITE)
6641 AC_SUBST(MOZ_EGL_XRENDER_COMPOSITE)
6643 dnl ========================================================
6645 dnl ========================================================
6647 MOZ_ARG_WITH_STRING(gl-provider,
6648 [ --with-gl-provider=ID
6649 Set GL provider backend type],
6650 [ val=`echo $withval`
6651 MOZ_GL_PROVIDER="$val"])
6653 if test -n "$MOZ_GL_PROVIDER"; then
6654 MOZ_GL_DEFAULT_PROVIDER=$MOZ_GL_PROVIDER
6655 AC_SUBST(MOZ_GL_PROVIDER)
6656 AC_DEFINE_UNQUOTED(MOZ_GL_PROVIDER, GLContextProvider$MOZ_GL_PROVIDER)
6658 AC_SUBST(MOZ_GL_DEFAULT_PROVIDER)
6660 dnl ========================================================
6661 dnl = faststripe theme
6662 dnl ========================================================
6663 MOZ_ARG_ENABLE_BOOL(faststripe,
6664 [ --enable-faststripe Use faststripe theme],
6665 MOZ_THEME_FASTSTRIPE=1,
6666 MOZ_THEME_FASTSTRIPE= )
6667 AC_SUBST(MOZ_THEME_FASTSTRIPE)
6669 dnl ========================================================
6671 dnl = Feature options that require extra sources to be pulled
6673 dnl ========================================================
6674 dnl MOZ_ARG_HEADER(Features that require extra sources)
6676 dnl ========================================================
6678 dnl = Debugging Options
6680 dnl ========================================================
6681 MOZ_ARG_HEADER(Debugging and Optimizations)
6683 dnl ========================================================
6684 dnl = Disable building with debug info.
6685 dnl = Debugging is OFF by default
6686 dnl ========================================================
6687 if test -z "$MOZ_DEBUG_FLAGS"; then
6688 MOZ_DEBUG_FLAGS="-g"
6691 MOZ_ARG_ENABLE_STRING(debug,
6692 [ --enable-debug[=DBG] Enable building with developer debug info
6693 (using compiler flags DBG)],
6694 [ if test "$enableval" != "no"; then
6696 if test -n "$enableval" -a "$enableval" != "yes"; then
6697 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6698 _MOZ_DEBUG_FLAGS_SET=1
6705 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
6706 MOZ_ARG_WITH_STRING(debug-label,
6707 [ --with-debug-label=LABELS
6708 Define DEBUG_<value> for each comma-separated
6710 [ for option in `echo $withval | sed 's/,/ /g'`; do
6711 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
6714 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6716 if test -n "$MOZ_DEBUG"; then
6717 AC_MSG_CHECKING([for valid debug flags])
6718 _SAVE_CFLAGS=$CFLAGS
6719 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6720 AC_TRY_COMPILE([#include <stdio.h>],
6721 [printf("Hello World\n");],
6724 AC_MSG_RESULT([$_results])
6725 if test "$_results" = "no"; then
6726 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6728 CFLAGS=$_SAVE_CFLAGS
6731 dnl ========================================================
6732 dnl enable mobile optimizations
6733 dnl ========================================================
6734 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
6735 [ --enable-mobile-optimize
6736 Enable mobile optimizations],
6737 MOZ_GFX_OPTIMIZE_MOBILE=1)
6739 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
6741 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
6742 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6745 dnl ========================================================
6746 dnl = Enable code optimization. ON by default.
6747 dnl ========================================================
6748 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6749 MOZ_OPTIMIZE_FLAGS="-O"
6752 MOZ_ARG_ENABLE_STRING(optimize,
6753 [ --disable-optimize Disable compiler optimization
6754 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6755 [ if test "$enableval" != "no"; then
6757 if test -n "$enableval" -a "$enableval" != "yes"; then
6758 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6763 fi ], MOZ_OPTIMIZE=1)
6765 MOZ_SET_FRAMEPTR_FLAGS
6767 if test "$COMPILE_ENVIRONMENT"; then
6768 if test -n "$MOZ_OPTIMIZE"; then
6769 AC_MSG_CHECKING([for valid optimization flags])
6770 _SAVE_CFLAGS=$CFLAGS
6771 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6772 AC_TRY_COMPILE([#include <stdio.h>],
6773 [printf("Hello World\n");],
6776 AC_MSG_RESULT([$_results])
6777 if test "$_results" = "no"; then
6778 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6780 CFLAGS=$_SAVE_CFLAGS
6782 fi # COMPILE_ENVIRONMENT
6784 AC_SUBST(MOZ_OPTIMIZE)
6785 AC_SUBST(MOZ_FRAMEPTR_FLAGS)
6786 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6787 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6788 AC_SUBST(MOZ_ALLOW_HEAP_EXECUTE_FLAGS)
6789 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6790 AC_SUBST(MOZ_PGO_OPTIMIZE_FLAGS)
6792 dnl ========================================================
6793 dnl = Enable generation of debug symbols
6794 dnl ========================================================
6795 MOZ_ARG_ENABLE_STRING(debug-symbols,
6796 [ --enable-debug-symbols[=DBG]
6797 Enable debugging symbols (using compiler flags DBG)],
6798 [ if test "$enableval" != "no"; then
6800 if test -n "$enableval" -a "$enableval" != "yes"; then
6801 if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
6802 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6804 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
6810 MOZ_DEBUG_SYMBOLS=1)
6812 if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
6813 AC_DEFINE(MOZ_DEBUG_SYMBOLS)
6814 export MOZ_DEBUG_SYMBOLS
6817 dnl ========================================================
6818 dnl = Enable any treating of compile warnings as errors
6819 dnl ========================================================
6820 MOZ_ARG_ENABLE_BOOL(warnings-as-errors,
6821 [ --enable-warnings-as-errors
6822 Enable treating of warnings as errors],
6823 MOZ_ENABLE_WARNINGS_AS_ERRORS=1,
6824 MOZ_ENABLE_WARNINGS_AS_ERRORS=)
6825 if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
6826 WARNINGS_AS_ERRORS=''
6829 dnl ========================================================
6830 dnl = Disable runtime logging checks
6831 dnl ========================================================
6832 MOZ_ARG_DISABLE_BOOL(logging,
6833 [ --disable-logging Disable logging facilities],
6834 NS_DISABLE_LOGGING=1,
6835 NS_DISABLE_LOGGING= )
6836 if test "$NS_DISABLE_LOGGING"; then
6837 AC_DEFINE(NS_DISABLE_LOGGING)
6839 AC_DEFINE(MOZ_LOGGING)
6842 dnl ========================================================
6843 dnl = This will enable logging of addref, release, ctor, dtor.
6844 dnl ========================================================
6845 _ENABLE_LOGREFCNT=42
6846 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6847 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6848 _ENABLE_LOGREFCNT=1,
6849 _ENABLE_LOGREFCNT= )
6850 if test "$_ENABLE_LOGREFCNT" = "1"; then
6851 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6852 elif test -z "$_ENABLE_LOGREFCNT"; then
6853 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6856 dnl ========================================================
6857 dnl moz_dump_painting
6858 dnl ========================================================
6859 MOZ_ARG_ENABLE_BOOL(dump-painting,
6860 [ --enable-dump-painting Enable paint debugging.],
6861 MOZ_DUMP_PAINTING=1,
6862 MOZ_DUMP_PAINTING= )
6863 if test -n "$MOZ_DUMP_PAINTING"; then
6864 AC_DEFINE(MOZ_DUMP_PAINTING)
6865 AC_DEFINE(MOZ_LAYERS_HAVE_LOG)
6867 if test -n "$MOZ_DEBUG"; then
6868 AC_DEFINE(MOZ_DUMP_PAINTING)
6871 dnl ========================================================
6872 dnl = Enable trace malloc
6873 dnl ========================================================
6874 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6875 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6876 [ --enable-trace-malloc Enable malloc tracing; also disables jemalloc],
6879 if test "$NS_TRACE_MALLOC"; then
6880 # Please, Mr. Linker Man, don't take away our symbol names
6881 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6883 AC_DEFINE(NS_TRACE_MALLOC)
6885 AC_SUBST(NS_TRACE_MALLOC)
6887 dnl ========================================================
6888 dnl = Enable jemalloc
6889 dnl ========================================================
6890 MOZ_ARG_ENABLE_BOOL(jemalloc,
6891 [ --enable-jemalloc Replace memory allocator with jemalloc],
6895 if test "$NS_TRACE_MALLOC"; then
6898 if test "$MOZ_DMD"; then
6902 if test "${OS_TARGET}" = "Android"; then
6903 dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue
6905 elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "OS2"; then
6906 dnl On Windows, OSX and OS2, we want to link all our binaries against mozglue
6907 if test -z "$GNU_CC"; then
6908 MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
6910 MOZ_GLUE_LDFLAGS='-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)'
6913 dnl On other Unix systems, we only want to link executables against mozglue
6914 MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
6915 dnl On other Unix systems, where mozglue is a static library, jemalloc is
6916 dnl separated for the SDK, so we need to add it here.
6917 if test "$MOZ_MEMORY" = 1 -o \( "$LIBXUL_SDK" -a -f "$LIBXUL_SDK/lib/${LIB_PREFIX}memory.${LIB_SUFFIX}" \); then
6918 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)'
6920 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(MKSHLIB_UNFORCE_ALL)'
6921 if test -n "$GNU_CC"; then
6922 dnl And we need mozglue symbols to be exported.
6923 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
6925 if test "$MOZ_LINKER" = 1; then
6926 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $ZLIB_LIBS"
6930 if test -z "$MOZ_MEMORY"; then
6933 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
6934 AC_MSG_WARN([When not building jemalloc, you need to set WIN32_REDIST_DIR to the path to the Visual C++ Redist (usually VCINSTALLDIR\redist\x86\Microsoft.VC80.CRT, for VC++ v8) if you intend to distribute your build.])
6939 dnl Don't try to run compiler tests on Windows
6940 if test "$OS_ARCH" = "WINNT"; then
6941 if test -z "$HAVE_64BIT_OS"; then
6942 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6944 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6947 AC_CHECK_SIZEOF([int *], [4])
6948 case "${ac_cv_sizeof_int_p}" in
6950 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6953 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6956 AC_MSG_ERROR([Unexpected pointer size])
6961 AC_DEFINE(MOZ_MEMORY)
6962 if test -n "$MOZ_JEMALLOC"; then
6963 AC_DEFINE(MOZ_JEMALLOC)
6965 if test "x$MOZ_DEBUG" = "x1"; then
6966 AC_DEFINE(MOZ_MEMORY_DEBUG)
6968 dnl The generic feature tests that determine how to compute ncpus are long and
6969 dnl complicated. Therefore, simply define special cpp variables for the
6970 dnl platforms we have special knowledge of.
6973 AC_DEFINE(MOZ_MEMORY_DARWIN)
6976 AC_DEFINE(MOZ_MEMORY_BSD)
6978 *-android*|*-linuxandroid*)
6979 AC_DEFINE(MOZ_MEMORY_LINUX)
6980 AC_DEFINE(MOZ_MEMORY_ANDROID)
6981 if test -z "$gonkdir"; then
6984 AC_DEFINE(MOZ_MEMORY_GONK)
6989 AC_DEFINE(MOZ_MEMORY_LINUX)
6992 AC_DEFINE(MOZ_MEMORY_BSD)
6995 AC_DEFINE(MOZ_MEMORY_SOLARIS)
6998 AC_DEFINE(MOZ_MEMORY_WINDOWS)
6999 if test -z "$MOZ_DEBUG"; then
7000 WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
7002 WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
7004 dnl Look for a broken crtdll.obj
7005 WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
7006 lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
7007 if grep -q '__imp__\{0,1\}free' crtdll.obj; then
7008 MOZ_GLUE_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
7009 dnl Also pass this to NSPR/NSS
7010 DLLFLAGS="$DLLFLAGS $MOZ_GLUE_LDFLAGS"
7012 DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozglue"
7019 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
7023 AC_SUBST(MOZ_MEMORY)
7024 AC_SUBST(MOZ_JEMALLOC)
7025 AC_SUBST(MOZ_GLUE_LDFLAGS)
7026 AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS)
7027 AC_SUBST(WIN32_CRT_LIBS)
7028 dnl Need to set this for make because NSS doesn't have configure
7031 dnl We need to wrap dlopen and related functions on Android because we use
7033 if test "$OS_TARGET" = Android; then
7034 WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue"
7035 if test -n "$MOZ_OLD_LINKER"; then
7036 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
7038 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
7039 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise,--wrap=PR_GetEnv,--wrap=PR_SetEnv"
7042 dnl ========================================================
7043 dnl = Use malloc wrapper lib
7044 dnl ========================================================
7045 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
7046 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
7050 if test -n "$_WRAP_MALLOC"; then
7051 if test -n "$GNU_CC"; then
7052 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
7053 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
7054 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
7055 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
7056 dnl Wrap operator new and operator delete on Android.
7057 if test "$OS_TARGET" = "Android"; then
7058 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv"
7061 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
7065 dnl ========================================================
7066 dnl = Location of malloc wrapper lib
7067 dnl ========================================================
7068 MOZ_ARG_WITH_STRING(wrap-malloc,
7069 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
7070 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
7072 dnl ========================================================
7073 dnl = Use JS Call tracing
7074 dnl ========================================================
7075 MOZ_ARG_ENABLE_BOOL(trace-jscalls,
7076 [ --enable-trace-jscalls Enable JS call enter/exit callback (default=no)],
7077 MOZ_TRACE_JSCALLS=1,
7078 MOZ_TRACE_JSCALLS= )
7079 if test -n "$MOZ_TRACE_JSCALLS"; then
7080 AC_DEFINE(MOZ_TRACE_JSCALLS)
7083 dnl ========================================================
7084 dnl = Use incremental GC
7085 dnl ========================================================
7087 MOZ_ARG_DISABLE_BOOL(gcincremental,
7088 [ --disable-gcincremental Disable incremental GC],
7090 if test -n "$JSGC_INCREMENTAL"; then
7091 AC_DEFINE(JSGC_INCREMENTAL)
7094 dnl ========================================================
7095 dnl ETW - Event Tracing for Windows
7096 dnl ========================================================
7097 MOZ_ARG_ENABLE_BOOL(ETW,
7098 [ --enable-ETW Enable ETW (Event Tracing for Windows) event reporting],
7101 if test -n "$MOZ_ETW"; then
7105 if test -n "$MOZ_ETW"; then
7106 if test -z "$MOZ_WINSDK_TARGETVER"; then
7107 AC_MSG_ERROR([--enable-ETW is only valid on Windows])
7111 dnl ========================================================
7112 dnl Zealous JavaScript GC
7113 dnl ========================================================
7114 MOZ_ARG_ENABLE_BOOL(gczeal,
7115 [ --enable-gczeal Enable zealous JavaScript GCing],
7118 if test -n "$JS_GC_ZEAL"; then
7119 AC_DEFINE(JS_GC_ZEAL)
7122 dnl ========================================================
7123 dnl JS opt-mode assertions and minidump instrumentation
7124 dnl ========================================================
7125 MOZ_ARG_ENABLE_BOOL(js-diagnostics,
7126 [ --enable-js-diagnostics
7127 Enable JS diagnostic assertions and breakpad data],
7128 JS_CRASH_DIAGNOSTICS=1,
7129 JS_CRASH_DIAGNOSTICS= )
7130 if test -n "$JS_CRASH_DIAGNOSTICS"; then
7131 AC_DEFINE(JS_CRASH_DIAGNOSTICS)
7136 dnl ========================================================
7137 dnl = Enable static checking using gcc-dehydra
7138 dnl ========================================================
7140 MOZ_ARG_WITH_STRING(static-checking,
7141 [ --with-static-checking=path/to/gcc_dehydra.so
7142 Enable static checking of code using GCC-dehydra],
7143 DEHYDRA_PATH=$withval,
7146 if test -n "$DEHYDRA_PATH"; then
7147 if test ! -f "$DEHYDRA_PATH"; then
7148 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
7150 AC_DEFINE(NS_STATIC_CHECKING)
7152 AC_SUBST(DEHYDRA_PATH)
7154 dnl ========================================================
7155 dnl = Enable stripping of libs & executables
7156 dnl ========================================================
7157 MOZ_ARG_ENABLE_BOOL(strip,
7158 [ --enable-strip Enable stripping of libs & executables ],
7162 dnl ========================================================
7163 dnl = Enable stripping of libs & executables when packaging
7164 dnl ========================================================
7165 MOZ_ARG_ENABLE_BOOL(install-strip,
7166 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
7170 dnl ========================================================
7171 dnl = --enable-elf-dynstr-gc
7172 dnl ========================================================
7173 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
7174 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
7175 USE_ELF_DYNSTR_GC=1,
7176 USE_ELF_DYNSTR_GC= )
7178 dnl ========================================================
7179 dnl = --disable-elf-hack
7180 dnl ========================================================
7183 MOZ_ARG_DISABLE_BOOL(elf-hack,
7184 [ --disable-elf-hack Disable elf hacks],
7188 # Disable elf hack for profiling because the built in profiler
7189 # doesn't read the segments properly with elf hack. This is
7190 # temporary and should be fixed soon in the profiler.
7191 if test "$MOZ_PROFILING" = 1; then
7195 # Only enable elfhack where supported
7196 if test "$USE_ELF_HACK" = 1; then
7197 case "${HOST_OS_ARCH},${OS_ARCH}" in
7199 case "${CPU_ARCH}" in
7214 if test "$USE_ELF_HACK" = 1; then
7215 dnl PT_GNU_RELRO segment makes the dynamic linker set a read-only flag on
7216 dnl memory addresses it maps to. The result is that by the time elfhack
7217 dnl kicks in, it is not possible to apply relocations because of that,
7218 dnl thus elfhack effectively skips relocations inside the PT_GNU_RELRO
7219 dnl segment. It makes elfhack mostly useless, so considering the problems
7220 dnl we have we PT_GNU_RELRO (e.g. bug 664366), and until elfhack can deal
7221 dnl with PT_GNU_RELRO segments, it's just simpler to disable elfhack when
7222 dnl the linker creates PT_GNU_RELRO segments.
7223 AC_CACHE_CHECK([whether linker creates PT_GNU_RELRO segments],
7224 LINK_WITH_PT_GNU_RELRO,
7225 [echo "int main() {return 0;}" > conftest.${ac_ext}
7226 if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.${ac_ext} $LIBS 1>&2) &&
7227 test -s conftest${ac_exeext}; then
7228 if ${TOOLCHAIN_PREFIX}readelf -l conftest${ac_exeext} | grep GNU_RELRO > /dev/null; then
7229 LINK_WITH_PT_GNU_RELRO=yes
7231 LINK_WITH_PT_GNU_RELRO=no
7234 dnl We really don't expect to get here, but just in case
7235 AC_ERROR([couldn't compile a simple C file])
7238 if test "$LINK_WITH_PT_GNU_RELRO" = yes; then
7239 AC_MSG_WARN([Disabling elfhack])
7244 dnl ========================================================
7245 dnl = libstdc++ compatibility hacks
7246 dnl ========================================================
7249 MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
7250 [ --enable-stdcxx-compat Enable compatibility with older libstdc++],
7253 AC_SUBST(STDCXX_COMPAT)
7255 if test -n "$STDCXX_COMPAT"; then
7256 eval $(CXX="$CXX" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
7257 AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION)
7258 AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION)
7261 dnl ========================================================
7263 dnl = Profiling and Instrumenting
7265 dnl ========================================================
7266 MOZ_ARG_HEADER(Profiling and Instrumenting)
7268 dnl ========================================================
7269 dnl = Enable runtime visual profiling logger
7270 dnl ========================================================
7271 MOZ_ARG_ENABLE_BOOL(visual-event-tracer,
7272 [ --enable-visual-event-tracer Enable visual event tracer instrumentation],
7273 MOZ_VISUAL_EVENT_TRACER=1,
7274 MOZ_VISUAL_EVENT_TRACER=)
7275 if test -n "$MOZ_VISUAL_EVENT_TRACER"; then
7276 AC_DEFINE(MOZ_VISUAL_EVENT_TRACER)
7279 dnl ========================================================
7280 dnl Turn on reflow counting
7281 dnl ========================================================
7282 MOZ_ARG_ENABLE_BOOL(reflow-perf,
7283 [ --enable-reflow-perf Enable reflow performance tracing],
7286 if test -n "$MOZ_REFLOW_PERF"; then
7287 AC_DEFINE(MOZ_REFLOW_PERF)
7290 dnl ========================================================
7291 dnl Enable code size metrics.
7292 dnl ========================================================
7293 MOZ_ARG_ENABLE_BOOL(codesighs,
7294 [ --enable-codesighs Enable code size analysis tools],
7295 _ENABLE_CODESIGHS=1,
7296 _ENABLE_CODESIGHS= )
7297 if test -n "$_ENABLE_CODESIGHS"; then
7298 if test -d $srcdir/tools/codesighs; then
7301 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
7305 dnl ========================================================
7306 dnl = Enable Radio Interface for B2G (Gonk usually)
7307 dnl ========================================================
7308 MOZ_ARG_ENABLE_BOOL(b2g-ril,
7309 [ --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ],
7312 if test -n "$MOZ_B2G_RIL"; then
7313 AC_DEFINE(MOZ_B2G_RIL)
7315 AC_SUBST(MOZ_B2G_RIL)
7317 dnl ========================================================
7318 dnl = Enable Bluetooth Interface for B2G (Gonk usually)
7319 dnl ========================================================
7320 MOZ_ARG_ENABLE_BOOL(b2g-bt,
7321 [ --enable-b2g-bt Set compile flags necessary for compiling Bluetooth API for B2G ],
7324 if test -n "$MOZ_B2G_BT"; then
7325 AC_DEFINE(MOZ_B2G_BT)
7327 AC_SUBST(MOZ_B2G_BT)
7329 dnl ========================================================
7330 dnl = Enable Support for System Messages API
7331 dnl ========================================================
7332 if test -n "$MOZ_SYS_MSG"; then
7333 AC_DEFINE(MOZ_SYS_MSG)
7335 AC_SUBST(MOZ_SYS_MSG)
7337 dnl ========================================================
7338 dnl = Enable Camera Interface for B2G (Gonk usually)
7339 dnl ========================================================
7340 MOZ_ARG_ENABLE_BOOL(b2g-camera,
7341 [ --enable-b2g-camera Set compile flags necessary for compiling camera API for B2G ],
7344 if test -n "$MOZ_B2G_CAMERA"; then
7345 AC_DEFINE(MOZ_B2G_CAMERA)
7347 AC_SUBST(MOZ_B2G_CAMERA)
7349 dnl ========================================================
7350 dnl = Enable Support for Payment API
7351 dnl ========================================================
7352 if test -n "$MOZ_PAY"; then
7357 dnl ========================================================
7358 dnl = Support for demangling undefined symbols
7359 dnl ========================================================
7360 if test -z "$SKIP_LIBRARY_CHECKS"; then
7363 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
7367 # Demangle only for debug or trace-malloc builds
7368 MOZ_DEMANGLE_SYMBOLS=
7369 if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
7370 MOZ_DEMANGLE_SYMBOLS=1
7371 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
7373 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
7375 dnl ========================================================
7376 dnl = Support for gcc stack unwinding (from gcc 3.3)
7377 dnl ========================================================
7378 if test -z "$SKIP_LIBRARY_CHECKS"; then
7379 MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
7382 dnl ========================================================
7384 dnl ========================================================
7386 MOZ_ARG_WITH_STRING(jitreport-granularity,
7387 [ --jitreport-granularity=N
7388 Default granularity at which to report JIT code
7391 1 - code ranges for whole functions only
7392 2 - per-line information
7393 3 - per-op information],
7394 JITREPORT_GRANULARITY=$withval,
7395 JITREPORT_GRANULARITY=3)
7397 AC_DEFINE_UNQUOTED(JS_DEFAULT_JITREPORT_GRANULARITY, $JITREPORT_GRANULARITY)
7399 dnl ========================================================
7403 dnl ========================================================
7404 MOZ_ARG_HEADER(Misc. Options)
7406 dnl ========================================================
7407 dnl update xterm title
7408 dnl ========================================================
7409 MOZ_ARG_ENABLE_BOOL(xterm-updates,
7410 [ --enable-xterm-updates Update XTERM titles with current command.],
7414 dnl =========================================================
7416 dnl =========================================================
7417 MOZ_ARG_ENABLE_STRING([chrome-format],
7418 [ --enable-chrome-format=jar|flat|both|symlink|omni
7419 Select FORMAT of chrome files (default=jar)],
7420 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
7422 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
7423 MOZ_CHROME_FILE_FORMAT=jar
7426 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
7427 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
7428 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
7429 test "$MOZ_CHROME_FILE_FORMAT" != "both" &&
7430 test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then
7431 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, symlink, or omni])
7434 dnl =========================================================
7435 dnl Omnijar packaging (bug 552121)
7436 dnl =========================================================
7437 dnl Omnijar packaging is compatible with flat packaging.
7438 dnl In unpackaged builds, omnijar looks for files as if
7439 dnl things were flat packaged. After packaging, all files
7440 dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT
7441 dnl is set to flat since putting files into jars is only
7442 dnl done during packaging with omnijar.
7443 if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
7445 AC_DEFINE(MOZ_OMNIJAR)
7446 if test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2" -o "$OS_TARGET" = "Android"; then
7447 MOZ_CHROME_FILE_FORMAT=flat
7449 MOZ_CHROME_FILE_FORMAT=symlink
7451 elif test "$MOZ_CHROME_FILE_FORMAT" = "jar"; then
7452 AC_DEFINE(MOZ_CHROME_FILE_FORMAT_JAR)
7455 OMNIJAR_NAME=omni.ja
7456 AC_SUBST(OMNIJAR_NAME)
7457 AC_SUBST(MOZ_OMNIJAR)
7459 dnl ========================================================
7460 dnl = Define default location for MOZILLA_FIVE_HOME
7461 dnl ========================================================
7462 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
7463 [ --with-default-mozilla-five-home
7464 Set the default value for MOZILLA_FIVE_HOME],
7465 [ val=`echo $withval`
7466 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7468 dnl ========================================================
7469 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7470 dnl ========================================================
7471 MOZ_ARG_WITH_STRING(user-appdir,
7472 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
7473 [ val=`echo $withval`
7474 if echo "$val" | grep "\/" >/dev/null; then
7475 AC_MSG_ERROR("Homedir must be single relative path.")
7480 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7482 dnl ========================================================
7483 dnl = Doxygen configuration
7484 dnl ========================================================
7485 dnl Use commas to specify multiple dirs to this arg
7486 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7487 MOZ_ARG_WITH_STRING(doc-input-dirs,
7488 [ --with-doc-input-dirs=DIRS
7489 Header/idl dirs to create docs from],
7490 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7491 AC_SUBST(MOZ_DOC_INPUT_DIRS)
7493 dnl Use commas to specify multiple dirs to this arg
7494 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7495 MOZ_ARG_WITH_STRING(doc-include-dirs,
7496 [ --with-doc-include-dirs=DIRS
7497 Include dirs to preprocess doc headers],
7498 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7499 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7501 MOZ_DOC_OUTPUT_DIR='./dist/docs'
7502 MOZ_ARG_WITH_STRING(doc-output-dir,
7503 [ --with-doc-output-dir=DIR
7504 Dir to generate docs into],
7505 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
7506 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7508 if test -z "$SKIP_COMPILER_CHECKS"; then
7509 dnl ========================================================
7511 dnl = Compiler Options
7513 dnl ========================================================
7514 MOZ_ARG_HEADER(Compiler Options)
7516 dnl ========================================================
7517 dnl Check for gcc -pipe support
7518 dnl ========================================================
7519 AC_MSG_CHECKING([for -pipe support])
7520 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
7521 dnl Any gcc that supports firefox supports -pipe.
7522 CFLAGS="$CFLAGS -pipe"
7523 CXXFLAGS="$CXXFLAGS -pipe"
7524 AC_MSG_RESULT([yes])
7529 dnl ========================================================
7530 dnl Profile guided optimization (gcc checks)
7531 dnl ========================================================
7532 dnl Test for profiling options
7533 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7535 _SAVE_CFLAGS="$CFLAGS"
7536 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
7538 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7539 AC_TRY_COMPILE([], [return 0;],
7540 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
7541 result="yes" ], result="no")
7542 AC_MSG_RESULT([$result])
7544 if test $result = "yes"; then
7545 PROFILE_GEN_LDFLAGS="-fprofile-generate"
7546 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
7547 PROFILE_USE_LDFLAGS="-fprofile-use"
7550 CFLAGS="$_SAVE_CFLAGS"
7552 if test -n "$INTEL_CC"; then
7553 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7554 PROFILE_GEN_LDFLAGS=
7555 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7556 PROFILE_USE_LDFLAGS=
7559 dnl Sun Studio on Solaris
7560 if test "$SOLARIS_SUNPRO_CC"; then
7561 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7562 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7563 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7564 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7567 AC_SUBST(PROFILE_GEN_CFLAGS)
7568 AC_SUBST(PROFILE_GEN_LDFLAGS)
7569 AC_SUBST(PROFILE_USE_CFLAGS)
7570 AC_SUBST(PROFILE_USE_LDFLAGS)
7574 dnl ========================================================
7575 dnl Test for -pedantic bustage
7576 dnl ========================================================
7577 MOZ_ARG_DISABLE_BOOL(pedantic,
7578 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7580 if test "$_PEDANTIC"; then
7581 _SAVE_CXXFLAGS=$CXXFLAGS
7582 CXXFLAGS="$CXXFLAGS -pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
7583 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7584 AC_TRY_COMPILE([$configure_static_assert_macros],
7585 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7586 result="no", result="yes" )
7587 AC_MSG_RESULT([$result])
7588 CXXFLAGS="$_SAVE_CXXFLAGS"
7592 _WARNINGS_CFLAGS="-pedantic ${_WARNINGS_CFLAGS} -Wno-long-long"
7593 _WARNINGS_CXXFLAGS="-pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
7596 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7601 dnl ========================================================
7602 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7603 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7604 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7605 dnl ========================================================
7606 _SAVE_CXXFLAGS=$CXXFLAGS
7607 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7608 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7609 ac_nscap_nonconst_opeq_bug,
7618 template <class T, class U>
7619 int operator==(const Pointer<T>& rhs, U* lhs)
7621 return rhs.myPtr == lhs;
7624 template <class T, class U>
7625 int operator==(const Pointer<T>& rhs, const U* lhs)
7627 return rhs.myPtr == lhs;
7635 ac_nscap_nonconst_opeq_bug="no",
7636 ac_nscap_nonconst_opeq_bug="yes")])
7637 CXXFLAGS="$_SAVE_CXXFLAGS"
7639 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7640 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7642 fi # ! SKIP_COMPILER_CHECKS
7644 AC_DEFINE(CPP_THROW_NEW, [throw()])
7647 if test "$COMPILE_ENVIRONMENT"; then
7649 fi # COMPILE_ENVIRONMENT
7651 dnl ========================================================
7653 dnl = Build depencency options
7655 dnl ========================================================
7656 MOZ_ARG_HEADER(Build dependencies)
7658 if test "$GNU_CC" -a "$GNU_CXX"; then
7659 _DEPEND_CFLAGS='$(filter-out %/.pp,-MD -MF $(MDDEPDIR)/$(@F).pp)'
7660 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7661 elif test "$SOLARIS_SUNPRO_CC"; then
7664 dnl Don't override this for MSVC
7665 if test -z "$_WIN32_MSVC"; then
7666 _USE_CPP_INCLUDE_FLAG=
7667 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7668 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7670 echo '#include <stdio.h>' > dummy-hello.c
7672 CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'`
7674 if test -z "$CL_INCLUDES_PREFIX"; then
7675 AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
7677 AC_SUBST(CL_INCLUDES_PREFIX)
7682 dnl ========================================================
7684 dnl = Static Build Options
7686 dnl ========================================================
7687 MOZ_ARG_HEADER(Static build options)
7689 # split JS out by default to avoid VS2005 PGO crash (bug 591836).
7690 if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" != "x86_64" ; then
7694 MOZ_ARG_ENABLE_BOOL(shared-js,
7695 [ --enable-shared-js
7696 Create a shared JavaScript library.],
7700 if test -n "$ENABLE_SHARED_JS"; then
7702 MOZ_JS_LIBS="$MOZ_JS_SHARED_LIBS"
7704 MOZ_JS_LIBS="$MOZ_JS_STATIC_LIBS"
7705 AC_DEFINE(MOZ_STATIC_JS)
7707 AC_SUBST(JS_SHARED_LIBRARY)
7709 AC_SUBST(LIBXUL_LIBS)
7710 XPCOM_LIBS="$LIBXUL_LIBS"
7712 dnl ========================================================
7714 dnl = Standalone module options
7716 dnl ========================================================
7717 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7720 dnl ========================================================
7722 if test -z "$SKIP_PATH_CHECKS"; then
7723 if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
7724 if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then
7725 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7730 if test -z "${GLIB_GMODULE_LIBS}" \
7731 -a -n "${GLIB_CONFIG}"\
7732 -a "${GLIB_CONFIG}" != no\
7734 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7737 AC_SUBST(GLIB_CFLAGS)
7739 AC_SUBST(GLIB_GMODULE_LIBS)
7741 dnl ========================================================
7742 dnl Graphics checks.
7743 dnl ========================================================
7745 if test "${OS_TARGET}" = "WINNT" -o "${OS_ARCH}" = "Darwin" -o "${MOZ_WIDGET_TOOLKIT}" = "android" -o "${MOZ_WIDGET_TOOLKIT}" = "gtk2"; then
7751 MOZ_ARG_ENABLE_BOOL(skia,
7752 [ --enable-skia Enable use of Skia],
7756 if test "$USE_FC_FREETYPE"; then
7757 if test "$COMPILE_ENVIRONMENT"; then
7758 dnl ========================================================
7759 dnl = Check for freetype2 and its functionality
7760 dnl ========================================================
7761 PKG_CHECK_MODULES(FT2, freetype2 >= 6.1.0, _HAVE_FREETYPE2=1, _HAVE_FREETYPE2=)
7763 if test "$_HAVE_FREETYPE2"; then
7765 _SAVE_CFLAGS="$CFLAGS"
7766 LIBS="$LIBS $FT2_LIBS"
7767 CFLAGS="$CFLAGS $FT2_CFLAGS"
7769 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
7770 ac_cv_member_FT_Bitmap_Size_y_ppem,
7771 [AC_TRY_COMPILE([#include <ft2build.h>
7772 #include FT_FREETYPE_H],
7774 if (sizeof s.y_ppem) return 0;
7776 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
7777 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
7778 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
7779 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
7781 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
7783 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
7784 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
7785 [FT_Bitmap_Size structure includes y_ppem field])
7787 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
7790 CFLAGS="$_SAVE_CFLAGS"
7793 _SAVE_CPPFLAGS="$CPPFLAGS"
7794 CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
7795 MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
7796 [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
7797 CPPFLAGS="$_SAVE_CPPFLAGS"
7799 AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
7802 PKG_CHECK_MODULES(_FONTCONFIG, fontconfig,
7804 if test "$MOZ_PANGO"; then
7805 MOZ_PANGO_CFLAGS="$MOZ_PANGO_CFLAGS $_FONTCONFIG_CFLAGS"
7806 MOZ_PANGO_LIBS="$MOZ_PANGO_LIBS $_FONTCONFIG_LIBS"
7808 FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
7809 FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
7814 dnl ========================================================
7815 dnl Check for pixman and cairo
7816 dnl ========================================================
7819 MOZ_ARG_ENABLE_BOOL(system-cairo,
7820 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7825 MOZ_ARG_ENABLE_BOOL(system-pixman,
7826 [ --enable-system-pixman Use system pixman (located with pkgconfig)],
7828 MOZ_TREE_PIXMAN=force,
7831 # System cairo depends on system pixman
7832 if test "$MOZ_TREE_PIXMAN" = "force"; then
7833 if test -z "$MOZ_TREE_CAIRO"; then
7834 AC_MSG_ERROR([--disable-system-pixman is incompatible with --enable-system-cairo.])
7838 elif test -z "$MOZ_TREE_CAIRO"; then
7842 if test "$MOZ_TREE_PIXMAN"; then
7843 AC_DEFINE(MOZ_TREE_PIXMAN)
7844 MOZ_PIXMAN_CFLAGS=""
7845 MOZ_PIXMAN_LIBS='$(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
7847 PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.19.2)
7848 MOZ_PIXMAN_CFLAGS="$PIXMAN_CFLAGS"
7849 MOZ_PIXMAN_LIBS="$PIXMAN_LIBS"
7851 AC_SUBST(MOZ_PIXMAN_CFLAGS)
7852 AC_SUBST(MOZ_PIXMAN_LIBS)
7854 # Check for headers defining standard int types.
7855 MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7857 if test "$MOZ_TREE_CAIRO"; then
7858 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7859 AC_DEFINE(MOZ_TREE_CAIRO)
7861 # For now we assume that we will have a uint64_t available through
7862 # one of the above headers or mozstdint.h.
7863 AC_DEFINE(HAVE_UINT64_T)
7865 # Define macros for cairo-features.h
7866 TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1"
7867 if test "$MOZ_X11"; then
7868 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7869 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7870 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7871 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7872 MOZ_ENABLE_CAIRO_FT=1
7873 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7875 case "$MOZ_WIDGET_TOOLKIT" in
7877 QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
7880 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7881 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7882 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7885 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7886 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7887 if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
7888 WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
7889 WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
7890 MOZ_ENABLE_D2D_SURFACE=1
7891 MOZ_ENABLE_DWRITE_FONT=1
7893 WIN32_DWRITE_FONT_FEATURE=
7894 WIN32_D2D_SURFACE_FEATURE=
7897 MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1)
7899 dnl D3D10 Layers depend on D2D Surfaces.
7900 if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
7901 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
7905 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7906 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7907 MOZ_ENABLE_CAIRO_FT=1
7908 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7909 CAIRO_FT_OSLIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7913 if test "$USE_FC_FREETYPE"; then
7914 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7916 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7917 AC_SUBST(MOZ_ENABLE_DWRITE_FONT)
7918 AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
7919 AC_SUBST(MOZ_ENABLE_D3D9_LAYER)
7920 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
7921 AC_SUBST(CAIRO_FT_CFLAGS)
7923 AC_SUBST(PS_SURFACE_FEATURE)
7924 AC_SUBST(PDF_SURFACE_FEATURE)
7925 AC_SUBST(SVG_SURFACE_FEATURE)
7926 AC_SUBST(XLIB_SURFACE_FEATURE)
7927 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7928 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7929 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7930 AC_SUBST(WIN32_SURFACE_FEATURE)
7931 AC_SUBST(OS2_SURFACE_FEATURE)
7932 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7933 AC_SUBST(FT_FONT_FEATURE)
7934 AC_SUBST(FC_FONT_FEATURE)
7935 AC_SUBST(WIN32_FONT_FEATURE)
7936 AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
7937 AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
7938 AC_SUBST(QUARTZ_FONT_FEATURE)
7939 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7940 AC_SUBST(QT_SURFACE_FEATURE)
7941 AC_SUBST(TEE_SURFACE_FEATURE)
7943 MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src)'" $CAIRO_FT_LIBS"
7944 MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'
7946 if test "$MOZ_X11"; then
7947 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
7950 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7952 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
7953 MOZ_CAIRO_CFLAGS="$CAIRO_CFLAGS"
7954 MOZ_CAIRO_LIBS="$CAIRO_LIBS"
7955 PKG_CHECK_MODULES(CAIRO_TEE, cairo-tee >= $CAIRO_VERSION)
7956 if test "$MOZ_X11"; then
7957 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
7958 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
7959 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_LIBS"
7960 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
7964 AC_SUBST(MOZ_TREE_CAIRO)
7965 AC_SUBST(MOZ_CAIRO_CFLAGS)
7966 AC_SUBST(MOZ_CAIRO_LIBS)
7967 AC_SUBST(MOZ_CAIRO_OSLIBS)
7968 AC_SUBST(MOZ_TREE_PIXMAN)
7970 dnl ========================================================
7972 dnl ========================================================
7974 QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'
7977 dnl ========================================================
7979 dnl ========================================================
7980 MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
7981 AC_SUBST(MOZ_HARFBUZZ_LIBS)
7983 dnl ========================================================
7985 dnl ========================================================
7986 if test "$MOZ_GRAPHITE"; then
7987 MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
7988 AC_DEFINE(MOZ_GRAPHITE)
7992 AC_SUBST(MOZ_GRAPHITE)
7993 AC_SUBST(MOZ_GRAPHITE_LIBS)
7995 dnl ========================================================
7997 dnl ========================================================
7998 MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
7999 AC_SUBST(MOZ_OTS_LIBS)
8001 dnl ========================================================
8003 dnl ========================================================
8004 if test "$MOZ_ENABLE_SKIA"; then
8005 MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
8006 AC_DEFINE(MOZ_ENABLE_SKIA)
8010 AC_SUBST(MOZ_ENABLE_SKIA)
8011 AC_SUBST(MOZ_SKIA_LIBS)
8013 dnl ========================================================
8015 dnl ========================================================
8016 MOZ_ARG_DISABLE_BOOL(xul,
8017 [ --disable-xul Disable XUL],
8019 if test "$MOZ_XUL"; then
8022 dnl remove extensions that require XUL
8023 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
8028 dnl ========================================================
8029 dnl disable profile locking
8030 dnl do no use this in applications that can have more than
8031 dnl one process accessing the profile directory.
8032 dnl ========================================================
8033 MOZ_ARG_DISABLE_BOOL(profilelocking,
8034 [ --disable-profilelocking
8035 Disable profile locking],
8036 MOZ_PROFILELOCKING=,
8037 MOZ_PROFILELOCKING=1 )
8038 if test "$MOZ_PROFILELOCKING"; then
8039 AC_DEFINE(MOZ_PROFILELOCKING)
8042 dnl ========================================================
8043 dnl necko configuration options
8044 dnl ========================================================
8047 dnl option to disable various necko protocols
8049 MOZ_ARG_ENABLE_STRING(necko-protocols,
8050 [ --enable-necko-protocols[={http,ftp,default,all,none}]
8051 Enable/disable specific protocol handlers],
8052 [ for option in `echo $enableval | sed 's/,/ /g'`; do
8053 if test "$option" = "yes" -o "$option" = "all"; then
8054 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8055 elif test "$option" = "no" -o "$option" = "none"; then
8057 elif test "$option" = "default"; then
8058 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8059 elif test `echo "$option" | grep -c \^-` != 0; then
8060 option=`echo $option | sed 's/^-//'`
8061 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
8063 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
8066 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
8068 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
8069 AC_SUBST(NECKO_PROTOCOLS)
8070 for p in $NECKO_PROTOCOLS; do
8071 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
8072 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_PROTOCOL_$p"
8076 dnl option to disable necko's wifi scanner
8078 MOZ_ARG_DISABLE_BOOL(necko-wifi,
8079 [ --disable-necko-wifi Disable necko wifi scanner],
8083 if test "$OS_ARCH" = "OS2"; then
8084 dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
8087 if test "$NECKO_WIFI" -a \
8088 "$OS_ARCH" != "Linux" -a \
8089 "$OS_ARCH" != "Darwin" -a \
8090 "$OS_ARCH" != "SunOS" -a \
8091 "$OS_ARCH" != "WINNT"; then
8092 AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
8095 if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
8097 MOZ_CHECK_HEADER([iwlib.h])
8098 if test "$ac_cv_header_iwlib_h" != "yes"; then
8099 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])
8103 if test "$NECKO_WIFI"; then
8104 AC_DEFINE(NECKO_WIFI)
8105 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
8107 AC_SUBST(NECKO_WIFI)
8110 dnl option to disable cookies
8112 MOZ_ARG_DISABLE_BOOL(cookies,
8113 [ --disable-cookies Disable cookie support],
8116 AC_SUBST(NECKO_COOKIES)
8117 if test "$NECKO_COOKIES"; then
8118 AC_DEFINE(NECKO_COOKIES)
8119 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES"
8123 dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
8125 MOZ_ARG_DISABLE_BOOL(ctypes,
8126 [ --disable-ctypes Disable js-ctypes],
8129 AC_SUBST(BUILD_CTYPES)
8130 if test "$BUILD_CTYPES"; then
8131 AC_DEFINE(BUILD_CTYPES)
8134 dnl Build Places if required
8135 if test "$MOZ_PLACES"; then
8136 AC_DEFINE(MOZ_PLACES)
8139 dnl Build Apps in the Cloud (AITC) if required
8140 AC_SUBST(MOZ_SERVICES_AITC)
8141 if test -n "$MOZ_SERVICES_AITC"; then
8142 AC_DEFINE(MOZ_SERVICES_AITC)
8145 dnl Build Notifications if required
8146 AC_SUBST(MOZ_SERVICES_NOTIFICATIONS)
8147 if test -n "$MOZ_SERVICES_NOTIFICATIONS"; then
8148 AC_DEFINE(MOZ_SERVICES_NOTIFICATIONS)
8151 dnl Build Sync Services if required
8152 AC_SUBST(MOZ_SERVICES_SYNC)
8153 if test -n "$MOZ_SERVICES_SYNC"; then
8154 AC_DEFINE(MOZ_SERVICES_SYNC)
8157 dnl ========================================================
8158 if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
8159 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
8162 if test "$MOZ_APP_COMPONENT_INCLUDE"; then
8163 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_INCLUDE, "$MOZ_APP_COMPONENT_INCLUDE")
8166 if test "$MOZ_APP_COMPONENT_MODULES"; then
8167 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_MODULES, $MOZ_APP_COMPONENT_MODULES)
8170 dnl ========================================================
8172 dnl = Maintainer debug option (no --enable equivalent)
8174 dnl ========================================================
8179 AC_SUBST(AR_EXTRACT)
8183 AC_SUBST(AS_DASH_C_FLAG)
8192 AC_SUBST(MOZ_WIDGET_TOOLKIT)
8193 AC_SUBST(MOZ_UPDATE_XTERM)
8194 AC_SUBST(MOZ_PLATFORM_MAEMO)
8195 AC_SUBST(MOZ_AUTH_EXTENSION)
8196 AC_SUBST(MOZ_PERMISSIONS)
8198 AC_SUBST(MOZ_PREF_EXTENSIONS)
8199 AC_SUBST(MOZ_JS_LIBS)
8202 AC_SUBST(MOZ_DEBUG_SYMBOLS)
8203 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
8204 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
8205 AC_SUBST(MOZ_DEBUG_FLAGS)
8206 AC_SUBST(MOZ_DEBUG_LDFLAGS)
8207 AC_SUBST(WARNINGS_AS_ERRORS)
8208 AC_SUBST(MOZ_EXTENSIONS)
8209 AC_SUBST(MOZ_JSDEBUGGER)
8210 AC_SUBST(MOZ_ENABLE_PROFILER_SPS)
8213 AC_SUBST(MOZ_CALLGRIND)
8216 AC_SUBST(MOZ_PROFILING)
8218 AC_SUBST(MOZ_PLACES)
8219 AC_SUBST(MOZ_TOOLKIT_SEARCH)
8221 AC_SUBST(NS_PRINTING)
8223 AC_SUBST(MOZ_HELP_VIEWER)
8224 AC_SUBST(TOOLCHAIN_PREFIX)
8230 AC_SUBST(MOZ_PROFILELOCKING)
8232 AC_SUBST(ENABLE_TESTS)
8233 AC_SUBST(ENABLE_MARIONETTE)
8235 AC_SUBST(MOZ_UNIVERSALCHARDET)
8236 AC_SUBST(ACCESSIBILITY)
8237 AC_SUBST(MOZ_SPELLCHECK)
8238 AC_SUBST(MOZ_JAVA_COMPOSITOR)
8239 AC_SUBST(MOZ_ONLY_TOUCH_EVENTS)
8240 AC_SUBST(MOZ_CRASHREPORTER)
8241 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
8242 AC_SUBST(MOZ_MAINTENANCE_SERVICE)
8243 AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
8244 AC_SUBST(MOZ_ENABLE_SIGNMAR)
8245 AC_SUBST(MOZ_UPDATER)
8246 AC_SUBST(MOZ_ANGLE_RENDERER)
8247 AC_SUBST(MOZ_DIRECTX_SDK_PATH)
8248 AC_SUBST(MOZ_DIRECTX_SDK_CPU_SUFFIX)
8249 AC_SUBST(MOZ_D3DX9_VERSION)
8250 AC_SUBST(MOZ_D3DX9_CAB)
8251 AC_SUBST(MOZ_D3DCOMPILER_CAB)
8252 AC_SUBST(MOZ_D3DX9_DLL)
8253 AC_SUBST(MOZ_D3DCOMPILER_DLL)
8256 AC_SUBST(MOZ_ANDROID_HISTORY)
8257 AC_SUBST(MOZ_WEBSMS_BACKEND)
8258 AC_SUBST(ENABLE_STRIP)
8259 AC_SUBST(PKG_SKIP_STRIP)
8260 AC_SUBST(STRIP_FLAGS)
8261 AC_SUBST(USE_ELF_DYNSTR_GC)
8262 AC_SUBST(USE_ELF_HACK)
8263 AC_SUBST(INCREMENTAL_LINKER)
8264 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
8265 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
8267 AC_SUBST(MOZ_FIX_LINK_PATHS)
8268 AC_SUBST(XPCOM_LIBS)
8269 AC_SUBST(XPCOM_FROZEN_LDOPTS)
8270 AC_SUBST(XPCOM_GLUE_LDOPTS)
8271 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
8272 AC_SUBST(XPCOM_STATICRUNTIME_GLUE_LDOPTS)
8273 AC_SUBST(XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS)
8275 AC_SUBST(USE_DEPENDENT_LIBS)
8277 AC_SUBST(MOZ_BUILD_ROOT)
8278 AC_SUBST(MOZ_OS2_TOOLS)
8280 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8281 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8282 AC_SUBST(MOZ_LINKER_EXTRACT)
8283 AC_SUBST(MOZ_PER_WINDOW_PRIVATE_BROWSING)
8285 dnl ========================================================
8286 dnl = Mac bundle name prefix
8287 dnl ========================================================
8288 MOZ_ARG_WITH_STRING(macbundlename-prefix,
8289 [ --with-macbundlename-prefix=prefix
8290 Prefix for MOZ_MACBUNDLE_NAME],
8291 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
8293 MOZ_MACBUNDLE_NAME=`echo $MOZ_APP_DISPLAYNAME | tr -d ' '`
8294 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
8295 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
8298 if test "$MOZ_DEBUG"; then
8299 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}Debug.app
8301 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
8303 AC_SUBST(MOZ_MACBUNDLE_NAME)
8305 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
8306 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr '[A-Z]' '[a-z]'`
8307 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
8308 if test "$MOZ_DEBUG"; then
8309 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
8312 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
8313 AC_SUBST(MOZ_MACBUNDLE_ID)
8315 # The following variables are available to branding and application
8316 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
8317 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
8318 # impacts profile location and user-visible fields.
8319 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
8320 # versions of a given application (e.g. Aurora and Firefox both use
8321 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
8322 # for application.ini's "Name" field, which controls profile location in
8323 # the absence of a "Profile" field (see below), and various system
8324 # integration hooks (Unix remoting, Windows MessageWindow name, etc.)
8325 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
8326 # Mac Bundle name, Updater, Installer), it is typically used for nightly
8327 # builds (e.g. Aurora for Firefox).
8328 # - MOZ_APP_VERSION: Defines the application version number.
8329 # - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
8330 # defaults to a lowercase form of MOZ_APP_BASENAME.
8331 # - MOZ_APP_PROFILE: When set, used for application.ini's
8332 # "Profile" field, which controls profile location.
8333 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
8334 # crash reporter server url.
8335 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
8336 # - MOZ_EXTENSION_MANAGER: When set, enabled extension manager.
8338 if test -z "$MOZ_APP_NAME"; then
8339 MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
8342 # For extensions and langpacks, we require a max version that is compatible
8343 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
8344 # 10.0a1 and 10.0a2 aren't affected
8345 # 10.0 becomes 10.0.*
8346 # 10.0.1 becomes 10.0.*
8347 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
8348 if test -z "$IS_ALPHA"; then
8350 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*.[0-9]*\).*|\1|"`.*
8353 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
8356 AC_SUBST(MOZ_APP_NAME)
8357 AC_SUBST(MOZ_APP_DISPLAYNAME)
8358 AC_SUBST(MOZ_APP_BASENAME)
8359 AC_SUBST(MOZ_APP_VENDOR)
8360 AC_SUBST(MOZ_APP_PROFILE)
8361 AC_SUBST(MOZ_APP_ID)
8362 AC_SUBST(MAR_CHANNEL_ID)
8363 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
8364 AC_SUBST(MOZ_PROFILE_MIGRATOR)
8365 AC_SUBST(MOZ_EXTENSION_MANAGER)
8366 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
8367 AC_SUBST(MOZ_APP_UA_NAME)
8368 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
8369 AC_SUBST(MOZ_APP_VERSION)
8370 AC_SUBST(MOZ_APP_MAXVERSION)
8371 AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIREFOX_VERSION)
8372 AC_SUBST(FIREFOX_VERSION)
8373 AC_SUBST(MOZ_UA_OS_AGNOSTIC)
8374 if test -n "$MOZ_UA_OS_AGNOSTIC"; then
8375 AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
8378 # We can't use the static application.ini data when building against
8380 if test -n "$LIBXUL_SDK"; then
8383 AC_SUBST(MOZ_APP_STATIC_INI)
8385 AC_SUBST(MOZ_PKG_SPECIAL)
8387 AC_SUBST(MOZILLA_OFFICIAL)
8389 if test "$MOZ_TELEMETRY_REPORTING"; then
8390 AC_DEFINE(MOZ_TELEMETRY_REPORTING)
8394 AC_SUBST(MOZ_MAPINFO)
8395 AC_SUBST(MOZ_BROWSE_INFO)
8396 AC_SUBST(MOZ_TOOLS_DIR)
8397 AC_SUBST(WIN32_REDIST_DIR)
8400 dnl Echo the CFLAGS to remove extra whitespace.
8406 $_WARNINGS_CXXFLAGS \
8409 COMPILE_CFLAGS=`echo \
8414 COMPILE_CXXFLAGS=`echo \
8415 $_DEFINES_CXXFLAGS \
8419 AC_SUBST(SYSTEM_LIBXUL)
8420 AC_SUBST(MOZ_NATIVE_JPEG)
8421 AC_SUBST(MOZ_NATIVE_PNG)
8422 AC_SUBST(MOZ_NATIVE_BZ2)
8424 AC_SUBST(MOZ_FLEXBOX)
8425 AC_SUBST(MOZ_JPEG_CFLAGS)
8426 AC_SUBST(MOZ_JPEG_LIBS)
8427 AC_SUBST(MOZ_BZ2_CFLAGS)
8428 AC_SUBST(MOZ_BZ2_LIBS)
8429 AC_SUBST(MOZ_PNG_CFLAGS)
8430 AC_SUBST(MOZ_PNG_LIBS)
8432 AC_SUBST(NSPR_CFLAGS)
8434 AC_SUBST(MOZ_NATIVE_NSPR)
8436 AC_SUBST(NSS_CFLAGS)
8438 AC_SUBST(NSS_DEP_LIBS)
8439 AC_SUBST(MOZ_NATIVE_NSS)
8440 AC_SUBST(NSS_DISABLE_DBM)
8443 OS_CXXFLAGS="$CXXFLAGS"
8444 OS_CPPFLAGS="$CPPFLAGS"
8445 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
8446 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
8447 OS_LDFLAGS="$LDFLAGS"
8450 AC_SUBST(OS_CXXFLAGS)
8451 AC_SUBST(OS_CPPFLAGS)
8452 AC_SUBST(OS_COMPILE_CFLAGS)
8453 AC_SUBST(OS_COMPILE_CXXFLAGS)
8454 AC_SUBST(OS_LDFLAGS)
8456 AC_SUBST(CROSS_COMPILE)
8457 AC_SUBST(WCHAR_CFLAGS)
8461 AC_SUBST(HOST_CFLAGS)
8462 AC_SUBST(HOST_CXXFLAGS)
8463 AC_SUBST(HOST_LDFLAGS)
8464 AC_SUBST(HOST_OPTIMIZE_FLAGS)
8466 AC_SUBST(HOST_AR_FLAGS)
8468 AC_SUBST(HOST_RANLIB)
8469 AC_SUBST(HOST_NSPR_MDCPUCFG)
8470 AC_SUBST(HOST_BIN_SUFFIX)
8471 AC_SUBST(HOST_OS_ARCH)
8473 AC_SUBST(TARGET_CPU)
8474 AC_SUBST(TARGET_VENDOR)
8476 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8477 AC_SUBST(TARGET_MD_ARCH)
8478 AC_SUBST(TARGET_XPCOM_ABI)
8481 AC_SUBST(OS_RELEASE)
8484 AC_SUBST(INTEL_ARCHITECTURE)
8486 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8488 AC_SUBST(WRAP_LDFLAGS)
8491 AC_SUBST(MKSHLIB_FORCE_ALL)
8492 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8493 AC_SUBST(DSO_CFLAGS)
8494 AC_SUBST(DSO_PIC_CFLAGS)
8495 AC_SUBST(DSO_LDOPTS)
8496 AC_SUBST(LIB_PREFIX)
8497 AC_SUBST(DLL_PREFIX)
8498 AC_SUBST(DLL_SUFFIX)
8499 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8500 AC_SUBST(LIB_SUFFIX)
8501 AC_SUBST(OBJ_SUFFIX)
8502 AC_SUBST(BIN_SUFFIX)
8503 AC_SUBST(ASM_SUFFIX)
8504 AC_SUBST(IMPORT_LIB_SUFFIX)
8506 AC_SUBST(CC_VERSION)
8507 AC_SUBST(CXX_VERSION)
8508 AC_SUBST(MSMANIFEST_TOOL)
8509 AC_SUBST(NS_ENABLE_TSF)
8510 AC_SUBST(MOZ_NSS_PATCH)
8511 AC_SUBST(MOZ_APP_COMPONENT_LIBS)
8512 AC_SUBST(MOZ_APP_EXTRA_LIBS)
8515 AC_SUBST(MOZ_SYDNEYAUDIO)
8516 AC_SUBST(MOZ_SPEEX_RESAMPLER)
8519 AC_SUBST(MOZ_VORBIS)
8520 AC_SUBST(MOZ_TREMOR)
8523 AC_SUBST(MOZ_MEDIA_PLUGINS)
8524 AC_SUBST(MOZ_OMX_PLUGIN)
8525 AC_SUBST(MOZ_VP8_ERROR_CONCEALMENT)
8526 AC_SUBST(MOZ_VP8_ENCODER)
8529 AC_SUBST(MOZ_ALSA_LIBS)
8530 AC_SUBST(MOZ_ALSA_CFLAGS)
8532 AC_SUBST(VPX_ASFLAGS)
8533 AC_SUBST(VPX_DASH_C_FLAG)
8534 AC_SUBST(VPX_AS_CONVERSION)
8535 AC_SUBST(VPX_ASM_SUFFIX)
8536 AC_SUBST(VPX_X86_ASM)
8537 AC_SUBST(VPX_ARM_ASM)
8538 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT)
8539 AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP)
8540 AC_SUBST(LIBJPEG_TURBO_AS)
8541 AC_SUBST(LIBJPEG_TURBO_ASFLAGS)
8542 AC_SUBST(LIBJPEG_TURBO_X86_ASM)
8543 AC_SUBST(LIBJPEG_TURBO_X64_ASM)
8544 AC_SUBST(LIBJPEG_TURBO_ARM_ASM)
8546 AC_SUBST(MOZ_PACKAGE_JSSHELL)
8548 AC_MSG_CHECKING([for posix_fallocate])
8549 AC_TRY_LINK([#define _XOPEN_SOURCE 600
8550 #include <fcntl.h>],
8551 [posix_fallocate(0, 0, 0);],
8552 [ac_cv___posix_fallocate=true],
8553 [ac_cv___posix_fallocate=false])
8555 if test "$ac_cv___posix_fallocate" = true ; then
8556 AC_DEFINE(HAVE_POSIX_FALLOCATE)
8562 dnl Check for missing components
8563 if test "$COMPILE_ENVIRONMENT"; then
8564 if test "$MOZ_X11"; then
8565 if test "$WITHOUT_X11"; then
8566 AC_MSG_ERROR([--without-x specified and MOZ_X11 still defined])
8568 dnl ====================================================
8569 dnl = Check if X headers exist
8570 dnl ====================================================
8571 _SAVE_CFLAGS=$CFLAGS
8572 CFLAGS="$CFLAGS $XCFLAGS"
8576 #include <X11/Xlib.h>
8577 #include <X11/Intrinsic.h>
8578 #include <X11/extensions/XShm.h>
8582 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8583 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8587 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8588 CFLAGS="$_SAVE_CFLAGS"
8590 if test -n "$MISSING_X"; then
8591 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8596 dnl Check for headers, etc. needed by WebGL.
8597 if test "$MOZ_GL_DEFAULT_PROVIDER" = "GLX"; then
8598 MOZ_CHECK_HEADER(GL/glx.h)
8599 if test "$ac_cv_header_GL_glx_h" != "yes"; then
8600 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))])
8602 fi # MOZ_GL_DEFAULT_PROVIDER=GLX
8603 fi # COMPILE_ENVIRONMENT
8605 dnl Set various defines and substitutions
8606 dnl ========================================================
8608 if test "$OS_ARCH" = "Darwin"; then
8610 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
8614 if test "$MOZ_DEBUG"; then
8615 AC_DEFINE(MOZ_REFLOW_PERF)
8616 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8619 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8620 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8621 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8622 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8623 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8624 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8625 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8626 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8627 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8630 AC_SUBST(MOZILLA_VERSION)
8632 AC_SUBST(ac_configure_args)
8634 dnl Spit out some output
8635 dnl ========================================================
8637 dnl The following defines are used by xpcom
8638 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8640 HAVE_CPP_2BYTE_WCHAR_T
8641 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8643 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8644 HAVE_CPP_PARTIAL_SPECIALIZATION
8645 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8646 NEED_CPP_UNUSED_IMPLEMENTATIONS
8650 HAVE_ICONV_WITH_CONST_INPUT
8664 netwerk/necko-config.h
8665 xpcom/xpcom-config.h
8666 xpcom/xpcom-private.h
8669 # Hack around an Apple bug that affects the egrep that comes with OS X 10.7.
8670 # "env ARCHPREFERENCE=i386,x86_64 arch egrep" first tries to use the 32-bit
8671 # Intel part of the egrep fat binary, even on 64-bit systems, and falls back on
8672 # the 64-bit part if it's not a fat binary, as can happen with MacPorts. We
8673 # (apparently) only need this hack when egrep's "pattern" is particularly long
8674 # (as in the following code) and the first egrep on our $PATH is Apple's. See
8678 FIXED_EGREP="env ARCHPREFERENCE=i386,x86_64 arch egrep"
8685 dnl Create a virtualenv where we can install local Python packages
8686 AC_MSG_RESULT([Creating Python virtualenv])
8688 mkdir -p _virtualenv
8689 MACOSX_DEPLOYMENT_TARGET= PYTHONDONTWRITEBYTECODE= $PYTHON $_topsrcdir/python/virtualenv/virtualenv.py --system-site-packages ./_virtualenv
8692 PYTHON=$MOZ_BUILD_ROOT/_virtualenv/Scripts/python.exe
8695 PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python
8701 dnl Populate the virtualenv
8703 dnl We always use the version Python was compiled with to ensure that compiled
8704 dnl extensions work properly. This works around a bug in Python. See also
8705 dnl http://bugs.python.org/issue9516 and bug 659881.
8707 dnl Please note that this assumes nothing built during virtualenv population is
8708 dnl shipped as part of a release package. If it does ship, binaries built here
8709 dnl may not be compatible with the minimum supported OS X version.
8710 osx_deployment_target_system=
8712 if test $python_version_major -ne 2; then
8713 AC_MSG_ERROR([Assertion failed: building with Python 2.])
8716 dnl sysconfig is only present on Python 2.7 and above.
8717 if test $python_version_minor -ge 7; then
8718 osx_deployment_target_system=`$PYTHON -c 'import sysconfig; print sysconfig.get_config_var("MACOSX_DEPLOYMENT_TARGET")'`
8721 AC_MSG_RESULT([Populating Python virtualenv])
8722 MACOSX_DEPLOYMENT_TARGET=$osx_deployment_target_system \
8723 LDFLAGS="${HOST_LDFLAGS}" \
8724 CC="${HOST_CC}" CXX="${HOST_CXX}" \
8725 CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" \
8726 $PYTHON $_topsrcdir/build/virtualenv/populate_virtualenv.py \
8727 $_topsrcdir $_topsrcdir/build/virtualenv/packages.txt \
8730 dnl Load the list of Makefiles to generate.
8731 dnl To add new Makefiles, edit allmakefiles.sh.
8732 dnl allmakefiles.sh sets the variable, MAKEFILES.
8733 . ${srcdir}/allmakefiles.sh
8735 echo $MAKEFILES > unallmakefiles
8737 AC_OUTPUT($MAKEFILES)
8739 # Generate Makefiles for WebRTC directly from .gyp files
8740 if test "${OS_TARGET}" = "WINNT"; then
8741 if test "$HAVE_64BIT_OS"; then
8746 EXTRA_GYP_DEFINES="-D MSVS_VERSION=${_MSVS_VERSION} -D MSVS_OS_BITS=${OS_BITS}"
8749 if test -n "$MOZ_WEBRTC"; then
8750 AC_MSG_RESULT("generating WebRTC Makefiles...")
8752 GYP_WEBRTC_OPTIONS="--format=mozmake -D build_with_mozilla=1 -D enable_protobuf=0 -D include_internal_video_render=0 ${EXTRA_GYP_DEFINES} --depth=${srcdir}/media/webrtc/trunk --toplevel-dir=${srcdir} -G OBJDIR=${_objdir}"
8754 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8755 $GYP_WEBRTC_OPTIONS \
8756 --generator-output=${_objdir}/media/webrtc/trunk \
8757 ${srcdir}/media/webrtc/trunk/peerconnection.gyp
8758 if test "$?" != 0; then
8759 AC_MSG_ERROR([failed to generate WebRTC Makefiles])
8762 # XXX disable until we land the tranche with signaling
8763 if test -n "$MOZ_WEBRTC_SIGNALING"; then
8764 AC_MSG_RESULT("generating WebRTC/Signaling Makefiles...")
8765 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8766 $GYP_WEBRTC_OPTIONS \
8767 --generator-output=${_objdir}/media/webrtc/signaling \
8768 ${srcdir}/media/webrtc/signaling/signaling.gyp
8769 if test "$?" != 0; then
8770 AC_MSG_ERROR([failed to generate WebRTC/Signaling Makefiles])
8774 AC_MSG_RESULT("generating gtest Makefiles...")
8775 # Ok to pass some extra -D's that are ignored here
8776 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8777 $GYP_WEBRTC_OPTIONS \
8778 --generator-output=${_objdir}/media/webrtc/trunk/testing/ \
8779 ${srcdir}/media/webrtc/trunk/testing/gtest.gyp
8780 if test "$?" != 0; then
8781 AC_MSG_ERROR([failed to generate gtest Makefiles])
8785 # Generate a JSON config file for unittest harnesses etc to read
8786 # build configuration details from in a standardized way.
8787 OS_TARGET=${OS_TARGET} TARGET_CPU=${TARGET_CPU} MOZ_DEBUG=${MOZ_DEBUG} \
8788 MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
8789 $PYTHON ${_topsrcdir}/config/writemozinfo.py ./mozinfo.json.tmp
8790 if cmp -s ./mozinfo.json.tmp ./mozinfo.json; then
8791 rm ./mozinfo.json.tmp
8793 mv -f ./mozinfo.json.tmp ./mozinfo.json
8796 # Run jemalloc configure script
8798 if test "$MOZ_JEMALLOC" -a "$MOZ_MEMORY"; then
8799 ac_configure_args="$_SUBDIR_CONFIG_ARGS --build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_"
8800 if test "$OS_ARCH" = "Linux"; then
8801 MANGLE="malloc calloc valloc free realloc memalign posix_memalign malloc_usable_size"
8804 if test -n "$_WRAP_MALLOC"; then
8805 JEMALLOC_WRAPPER=__wrap_
8807 for mangle in ${MANGLE}; do
8808 if test -n "$MANGLED"; then
8809 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle,$MANGLED"
8811 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle"
8814 ac_configure_args="$ac_configure_args --with-mangling=$MANGLED"
8817 if test -z "$MOZ_TLS"; then
8818 ac_configure_args="$ac_configure_args --disable-tls"
8820 EXTRA_CFLAGS="$CFLAGS"
8821 for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do
8822 ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
8824 if test "$CROSS_COMPILE"; then
8825 ac_configure_args="$ac_configure_args je_cv_static_page_shift=12"
8827 _save_cache_file="$cache_file"
8828 cache_file=$_objdir/memory/jemalloc/src/config.cache
8829 AC_OUTPUT_SUBDIRS(memory/jemalloc/src)
8830 cache_file="$_save_cache_file"
8831 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8834 dnl Build libunwind for Android profiling builds
8835 if test "$OS_TARGET" = "Android" -a "$MOZ_PROFILING"; then
8836 old_ac_configure_arg="$ac_configure_args"
8837 ac_configure_args="--build=${build} --host=${target_alias} --disable-shared --enable-block-signals=no"
8838 if test "$MOZ_DEBUG"; then
8839 ac_configure_args="$ac_configure_args --enable-debug"
8841 if test "$DSO_PIC_CFLAGS"; then
8842 ac_configure_args="$ac_configure_args --with-pic"
8844 ac_configure_args="$ac_configure_args \
8848 CFLAGS=\"$CFLAGS\" \
8849 CXXFLAGS=\"$CXXFLAGS\" \
8850 CPPFLAGS=\"$CPPFLAGS\" \
8852 LDFLAGS=\"$LDFLAGS\" \
8854 RANLIB=\"$RANLIB\" \
8858 # Use a separate cache file for libunwind, since it does not use caching.
8859 mkdir -p $_objdir/tools/profiler/libunwind/src
8860 old_cache_file=$cache_file
8861 cache_file=$_objdir/tools/profiler/libunwind/src/config.cache
8862 old_config_files=$CONFIG_FILES
8864 AC_OUTPUT_SUBDIRS(tools/profiler/libunwind/src)
8865 cache_file=$old_cache_file
8866 ac_configure_args="$old_ac_configure_args"
8867 CONFIG_FILES=$old_config_files
8870 # Run freetype configure script
8872 if test "$MOZ_TREE_FREETYPE"; then
8873 export CFLAGS="$CFLAGS -std=c99"
8874 export CPPFLAGS="$CPPFLAGS"
8875 export CXXFLAGS="$CXXFLAGS"
8876 export LDFLAGS="$LDFLAGS"
8877 export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
8878 ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes"
8879 AC_OUTPUT_SUBDIRS(modules/freetype2)
8882 if test -z "$direct_nspr_config"; then
8883 dnl ========================================================
8884 dnl = Setup a nice relatively clean build environment for
8885 dnl = sub-configures.
8886 dnl ========================================================
8889 CFLAGS="$_SUBDIR_CFLAGS"
8890 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8891 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8892 LDFLAGS="$_SUBDIR_LDFLAGS"
8893 HOST_CC="$_SUBDIR_HOST_CC"
8894 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8895 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8902 # No need to run subconfigures when building with LIBXUL_SDK_DIR
8903 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8907 if test -n "$_WRAP_MALLOC"; then
8908 # Avoid doubling wrap malloc arguments
8909 _SUBDIR_CONFIG_ARGS="`echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'`"
8912 if test -z "$MOZ_NATIVE_NSPR"; then
8913 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8914 if test -z "$MOZ_DEBUG"; then
8915 ac_configure_args="$ac_configure_args --disable-debug"
8917 ac_configure_args="$ac_configure_args --enable-debug"
8919 if test "$MOZ_OPTIMIZE" = "1"; then
8920 ac_configure_args="$ac_configure_args --enable-optimize"
8921 elif test -z "$MOZ_OPTIMIZE"; then
8922 ac_configure_args="$ac_configure_args --disable-optimize"
8924 if test -n "$HAVE_64BIT_OS"; then
8925 ac_configure_args="$ac_configure_args --enable-64bit"
8927 if test -n "$USE_ARM_KUSER"; then
8928 ac_configure_args="$ac_configure_args --with-arm-kuser"
8930 ac_configure_args="$ac_configure_args $NSPR_CONFIGURE_ARGS"
8931 if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no ; then
8932 # dladdr is supported by the new linker, even when the system linker doesn't
8933 # support it. Trick nspr into using dladdr when it's not supported.
8934 _SAVE_CPPFLAGS="$CPPFLAGS"
8935 export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS"
8937 _SAVE_LDFLAGS="$LDFLAGS"
8938 export LDFLAGS="$LDFLAGS $NSPR_LDFLAGS"
8939 AC_OUTPUT_SUBDIRS(nsprpub)
8940 LDFLAGS="$_SAVE_LDFLAGS"
8941 if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no; then
8943 CPPFLAGS="$_SAVE_CFLAGS"
8945 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8948 dnl ========================================================
8949 dnl = Setup a nice relatively clean build environment for
8950 dnl = sub-configures.
8951 dnl ========================================================
8954 CFLAGS="$_SUBDIR_CFLAGS"
8955 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8956 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8957 LDFLAGS="$_SUBDIR_LDFLAGS"
8958 HOST_CC="$_SUBDIR_HOST_CC"
8959 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8960 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8963 # Run the SpiderMonkey 'configure' script.
8964 dist=$MOZ_BUILD_ROOT/dist
8965 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8966 ac_configure_args="$ac_configure_args --enable-threadsafe"
8967 if test "$BUILD_CTYPES"; then
8968 # Build js-ctypes on the platforms we can.
8969 ac_configure_args="$ac_configure_args --enable-ctypes"
8971 if test -z "$JS_SHARED_LIBRARY" ; then
8972 ac_configure_args="$ac_configure_args --disable-shared-js"
8974 if test -z "$MOZ_NATIVE_NSPR"; then
8975 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
8976 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
8978 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
8979 ac_configure_args="$ac_configure_args --prefix=$dist"
8980 if test "$MOZ_MEMORY"; then
8981 ac_configure_args="$ac_configure_args --enable-jemalloc"
8983 if test -n "$MOZ_GLUE_LDFLAGS"; then
8984 export MOZ_GLUE_LDFLAGS
8986 if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then
8987 export MOZ_GLUE_PROGRAM_LDFLAGS
8989 if test "$MOZ_NATIVE_ZLIB" != 1 -a "$OS_ARCH" = "WINNT"; then
8992 export MOZ_NATIVE_ZLIB
8993 export MOZ_ZLIB_CFLAGS
8994 export MOZ_ZLIB_LIBS
8996 export STLPORT_CPPFLAGS
8997 export STLPORT_LDFLAGS
8999 AC_OUTPUT_SUBDIRS(js/src)
9000 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9002 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR