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 ========================================================
68 WINDRES_VERSION=2.14.90
74 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])
156 MOZ_ARG_WITH_STRING(gonk,
158 location of gonk dir],
161 MOZ_ARG_WITH_STRING(gonk-toolchain-prefix,
162 [ --with-gonk-toolchain-prefix=DIR
163 prefix to gonk toolchain commands],
164 gonk_toolchain_prefix=$withval)
166 if test -n "$gonkdir" ; then
167 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
168 android_source="$gonkdir"
169 ANDROID_SOURCE="$android_source"
170 ANDROID_NDK="${ANDROID_SOURCE}/ndk"
173 TOOLCHAIN_PREFIX="$gonk_toolchain_prefix"
174 AS="$gonk_toolchain_prefix"as
175 CC="$gonk_toolchain_prefix"gcc
176 CXX="$gonk_toolchain_prefix"g++
177 CPP="$gonk_toolchain_prefix"cpp
178 LD="$gonk_toolchain_prefix"ld
179 AR="$gonk_toolchain_prefix"ar
180 RANLIB="$gonk_toolchain_prefix"ranlib
181 STRIP="$gonk_toolchain_prefix"strip
183 STLPORT_CPPFLAGS="-I$gonkdir/ndk/sources/cxx-stl/stlport/stlport/"
184 STLPORT_LIBS="-lstlport"
186 case "$target_cpu" in
195 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 $CPPFLAGS -I$gonkdir/frameworks/base/services/sensorservice -I$gonkdir/frameworks/base/services/camera"
196 CFLAGS="-mandroid -fno-short-enums -fno-exceptions $CFLAGS"
197 CXXFLAGS="-mandroid -fno-short-enums -fno-exceptions -Wno-psabi $CXXFLAGS $STLPORT_CPPFLAGS"
198 dnl Add -llog by default, since we use it all over the place.
199 LIBS="$LIBS -llog $STLPORT_LIBS"
201 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"
203 dnl prevent cross compile section from using these flags as host flags
204 if test -z "$HOST_CPPFLAGS" ; then
207 if test -z "$HOST_CFLAGS" ; then
210 if test -z "$HOST_CXXFLAGS" ; then
213 if test -z "$HOST_LDFLAGS" ; then
218 AC_DEFINE(HAVE_SYS_UIO_H)
219 AC_DEFINE(HAVE_PTHREADS)
221 MOZ_CHROME_FILE_FORMAT=omni
227 *-android*|*-linuxandroid*)
228 if test -z "$ANDROID_PACKAGE_NAME" ; then
229 ANDROID_PACKAGE_NAME='org.mozilla.$(MOZ_APP_NAME)'
231 MOZ_CHROME_FILE_FORMAT=omni
235 AC_PATH_PROG(OBJCOPY,objcopy)
240 AC_SUBST(ANDROID_SOURCE)
241 AC_SUBST(ANDROID_PACKAGE_NAME)
244 dnl ========================================================
245 dnl Checks for compilers.
246 dnl ========================================================
247 dnl Set CROSS_COMPILE in the environment when running configure
248 dnl to use the cross-compile setup for now
249 dnl ========================================================
251 dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
254 if test "$COMPILE_ENVIRONMENT"; then
256 if test -n "$CROSS_COMPILE" -a "$target" != "$host"; then
257 echo "cross compiling from $host to $target"
261 _SAVE_CFLAGS="$CFLAGS"
262 _SAVE_LDFLAGS="$LDFLAGS"
264 AC_MSG_CHECKING([for host c compiler])
265 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc cl icc, "")
266 if test -z "$HOST_CC"; then
267 AC_MSG_ERROR([no acceptable c compiler found in \$PATH])
269 AC_MSG_RESULT([$HOST_CC])
270 AC_MSG_CHECKING([for host c++ compiler])
271 AC_CHECK_PROGS(HOST_CXX, $HOST_CXX $CCC c++ g++ gcc CC cxx cc++ cl icc, "")
272 if test -z "$HOST_CXX"; then
273 AC_MSG_ERROR([no acceptable c++ compiler found in \$PATH])
275 AC_MSG_RESULT([$HOST_CXX])
277 if test -z "$HOST_CFLAGS"; then
278 HOST_CFLAGS="$CFLAGS"
280 if test -z "$HOST_CXXFLAGS"; then
281 HOST_CXXFLAGS="$CXXFLAGS"
283 if test -z "$HOST_LDFLAGS"; then
284 HOST_LDFLAGS="$LDFLAGS"
286 if test -z "$HOST_AR_FLAGS"; then
287 HOST_AR_FLAGS="$AR_FLAGS"
289 AC_CHECK_PROGS(HOST_RANLIB, $HOST_RANLIB ranlib, ranlib, :)
290 AC_CHECK_PROGS(HOST_AR, $HOST_AR ar, ar, :)
292 CFLAGS="$HOST_CFLAGS"
293 LDFLAGS="$HOST_LDFLAGS"
295 AC_MSG_CHECKING([whether the host c compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
296 AC_TRY_COMPILE([], [return(0);],
297 [ac_cv_prog_hostcc_works=1 AC_MSG_RESULT([yes])],
298 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CC cannot create executables.]) )
301 CFLAGS="$HOST_CXXFLAGS"
303 AC_MSG_CHECKING([whether the host c++ compiler ($HOST_CXX $HOST_CXXFLAGS $HOST_LDFLAGS) works])
304 AC_TRY_COMPILE([], [return(0);],
305 [ac_cv_prog_hostcxx_works=1 AC_MSG_RESULT([yes])],
306 AC_MSG_ERROR([installation or configuration problem: host compiler $HOST_CXX cannot create executables.]) )
310 LDFLAGS=$_SAVE_LDFLAGS
312 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", :)
315 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", :)
319 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", :)
320 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", :)
321 MOZ_PATH_PROGS(AS, $AS "${target_alias}-as" "${target}-as", :)
322 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", :)
323 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", :)
324 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", :)
325 AC_DEFINE(CROSS_COMPILE)
330 # Work around the conftest.exe access problem on Windows
335 MOZ_PATH_PROGS(AS, $AS as, $CC)
336 AC_CHECK_PROGS(AR, ar, :)
337 AC_CHECK_PROGS(LD, ld, :)
338 AC_CHECK_PROGS(STRIP, strip, :)
339 AC_CHECK_PROGS(WINDRES, windres, :)
340 if test -z "$HOST_CC"; then
343 if test -z "$HOST_CFLAGS"; then
344 HOST_CFLAGS="$CFLAGS"
346 if test -z "$HOST_CXX"; then
349 if test -z "$HOST_CXXFLAGS"; then
350 HOST_CXXFLAGS="$CXXFLAGS"
352 if test -z "$HOST_LDFLAGS"; then
353 HOST_LDFLAGS="$LDFLAGS"
355 if test -z "$HOST_RANLIB"; then
356 HOST_RANLIB="$RANLIB"
358 if test -z "$HOST_AR"; then
361 if test -z "$HOST_AR_FLAGS"; then
362 HOST_AR_FLAGS="$AR_FLAGS"
366 if test -n "$MOZ_WINCONSOLE"; then
367 AC_DEFINE(MOZ_WINCONSOLE)
372 dnl ========================================================
373 dnl Special win32 checks
374 dnl ========================================================
376 # With win8, sdk target=602, WINVER=602
377 MOZ_ARG_ENABLE_BOOL(metro,
378 [ --enable-metro Enable Windows Metro build targets],
381 if test -n "$MOZ_METRO"; then
383 # Target the Windows 8 Kit
385 # Allow a higher api set
387 # toolkit/library/makefile.in needs these, see nsDllMain.
389 CRTEXPDLLVERSION=1-1-0
391 # Target the Windows 7 SDK by default
396 AC_SUBST(CRTDLLVERSION)
397 AC_SUBST(CRTEXPDLLVERSION)
399 if test -n "$MOZ_METRO"; then
404 AC_MSG_ERROR([Metro builds only valid on the windows platform.]);
409 MOZ_ARG_WITH_STRING(windows-version,
410 [ --with-windows-version=WINSDK_TARGETVER
411 Windows SDK version to target. Lowest version
412 currently allowed is 601 (Win7), highest is 602 (Win8)],
413 WINSDK_TARGETVER=$withval)
415 # Currently only two sdk versions allowed, 601 and 602
416 case "$WINSDK_TARGETVER" in
418 MOZ_WINSDK_TARGETVER=0${WINSDK_TARGETVER}0000
422 AC_MSG_ERROR([Invalid value for --with-windows-version ($WINSDK_TARGETVER)]);
428 if test "$GCC" != "yes"; then
429 # Check to see if we are really running in a msvc environemnt
431 AC_CHECK_PROGS(MIDL, midl)
433 # Make sure compilers are valid
434 CFLAGS="$CFLAGS -TC -nologo"
435 CXXFLAGS="$CXXFLAGS -TP -nologo"
438 AC_TRY_COMPILE([#include <stdio.h>],
439 [ printf("Hello World\n"); ],,
440 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
443 AC_TRY_COMPILE([#include <new.h>],
444 [ unsigned *test = new unsigned(42); ],,
445 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
449 _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
452 # Determine compiler version
453 CC_VERSION=`"${CC}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
454 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $1 }'`
455 _CC_MINOR_VERSION=`echo ${CC_VERSION} | $AWK -F\. '{ print $2 }'`
456 _CC_RELEASE=`echo ${CC_VERSION} | $AWK -F\. '{ print $3 }'`
457 _CC_BUILD=`echo ${CC_VERSION} | $AWK -F\. '{ print $4 }'`
458 _MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
460 CXX_VERSION=`"${CXX}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
461 _CXX_MAJOR_VERSION=`echo ${CXX_VERSION} | $AWK -F\. '{ print $1 }'`
463 if test "$_CC_MAJOR_VERSION" != "$_CXX_MAJOR_VERSION"; then
464 AC_MSG_ERROR([The major versions of \$CC and \$CXX do not match.])
467 if test "$_CC_MAJOR_VERSION" = "14"; then
468 dnl Require VC8SP1 or newer.
469 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762.
470 if test "$_CC_RELEASE" -lt 50727 -o \
471 \( "$_CC_RELEASE" -eq 50727 -a "$_CC_BUILD" -lt 762 \); then
472 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.])
477 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
478 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
479 elif test "$_CC_MAJOR_VERSION" = "15"; then
482 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
483 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
484 elif test "$_CC_MAJOR_VERSION" = "16"; then
487 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
488 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
489 elif test "$_CC_MAJOR_VERSION" = "17"; then
492 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
493 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
495 AC_MSG_ERROR([This version ($CC_VERSION) of the MSVC compiler is unsupported. See https://developer.mozilla.org/en/Windows_Build_Prerequisites.])
498 AC_DEFINE(HAVE_SEH_EXCEPTIONS)
500 if test -n "$WIN32_REDIST_DIR"; then
501 if test ! -d "$WIN32_REDIST_DIR"; then
502 AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
504 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd`
507 dnl Confirm we have the pri tools on win8 builds
508 if test -n "$MOZ_METRO"; then
509 AC_MSG_CHECKING([for makepri])
510 AC_CHECK_PROGS(MAKEPRI, makepri, "")
511 if test -z "MAKEPRI" ; then
512 AC_MSG_ERROR([makepri.exe is required for generating metro browser install components. It should be in the Win8 SDK.])
517 dnl Ensure that mt.exe is 'Microsoft (R) Manifest Tool',
518 dnl not something else like "magnetic tape manipulation utility".
519 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
520 if test -z "$MSMT_TOOL"; then
521 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
525 _MSMT_VER_FILTER='s|.*[^!-~]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
527 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
528 if test -z "$MSMANIFEST_TOOL_VERSION"; then
529 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
535 # Check linker version
536 _LD_FULL_VERSION=`"${LD}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
537 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
538 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
539 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
545 _MIDL_FULL_VERSION=`"${MIDL}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
546 _MIDL_MAJOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
547 _MIDL_MINOR_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
548 _MIDL_REV_VERSION=`echo ${_MIDL_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
549 # Add flags if necessary
550 AC_MSG_CHECKING([for midl flags])
553 if test \( "$_MIDL_MAJOR_VERSION" = "7" -a "$_MIDL_MINOR_VERSION" = "00" -a "$_MIDL_REV_VERSION" = "0499" \); then
554 # MIDL version 7.00.0499 defaults /env win64 on x64 platforms.
555 # MIDL version 7.00.0500 or later has no problem.
556 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
557 AC_MSG_RESULT([need -env win32])
559 AC_MSG_RESULT([none needed])
563 MIDL_FLAGS="${MIDL_FLAGS} -env x64"
566 AC_MSG_RESULT([none needed])
570 # Identify which version of the SDK we're building with
571 # Windows Server 2008 and newer SDKs have WinSDKVer.h, get the version
573 MOZ_CHECK_HEADERS([winsdkver.h])
574 if test "$ac_cv_header_winsdkver_h" = "yes"; then
575 # Get the highest _WIN32_WINNT and NTDDI versions supported
576 # Take the higher of the two
577 # This is done because the Windows 7 beta SDK reports its
578 # NTDDI_MAXVER to be 0x06000100 instead of 0x06010000, as it should
579 AC_CACHE_CHECK(for highest Windows version supported by this SDK,
581 [cat > conftest.h <<EOF
582 #include <winsdkver.h>
583 #include <sdkddkver.h>
585 #if (NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER) > NTDDI_MAXVER)
586 #define WINSDK_MAXVER NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT_MAXVER)
588 #define WINSDK_MAXVER NTDDI_MAXVER
593 ac_cv_winsdk_maxver=`$CPP conftest.h 2>/dev/null | tail -n1`
596 MOZ_WINSDK_MAXVER=${ac_cv_winsdk_maxver}
598 # Any SDK which doesn't have WinSDKVer.h is too old.
599 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.])
602 unset _MSVC_VER_FILTER
604 AC_CACHE_CHECK(for std::_Throw, ac_cv_have_std__Throw,
608 _SAVE_CXXFLAGS="$CXXFLAGS"
609 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
610 AC_TRY_COMPILE([#include <exception>],
611 [std::_Throw(std::exception()); return 0;],
612 ac_cv_have_std__Throw="yes",
613 ac_cv_have_std__Throw="no")
614 CXXFLAGS="$_SAVE_CXXFLAGS"
618 if test "$ac_cv_have_std__Throw" = "yes"; then
619 AC_CACHE_CHECK(for |class __declspec(dllimport) exception| bug,
620 ac_cv_have_dllimport_exception_bug,
624 _SAVE_CXXFLAGS="$CXXFLAGS"
625 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
626 AC_TRY_LINK([#include <vector>],
627 [std::vector<int> v; return v.at(1);],
628 ac_cv_have_dllimport_exception_bug="no",
629 ac_cv_have_dllimport_exception_bug="yes")
630 CXXFLAGS="$_SAVE_CXXFLAGS"
633 if test "$ac_cv_have_dllimport_exception_bug" = "no"; then
635 MOZ_MSVC_STL_WRAP__Throw=1
636 AC_DEFINE(MOZ_MSVC_STL_WRAP__Throw)
639 AC_CACHE_CHECK(for overridable _RAISE,
644 _SAVE_CXXFLAGS="$CXXFLAGS"
645 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
646 AC_TRY_COMPILE([#include <xstddef>
648 #define _RAISE(x) externallyDefinedFunction((x).what())
651 [std::vector<int> v; return v.at(1);],
652 ac_cv_have__RAISE="no",
653 ac_cv_have__RAISE="yes")
654 CXXFLAGS="$_SAVE_CXXFLAGS"
657 if test "$ac_cv_have__RAISE" = "yes"; then
659 MOZ_MSVC_STL_WRAP__RAISE=1
660 AC_DEFINE(MOZ_MSVC_STL_WRAP__RAISE)
662 AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.])
666 if test "$WRAP_STL_INCLUDES" = "1"; then
667 STL_FLAGS='-D_HAS_EXCEPTIONS=0 -I$(DIST)/stl_wrappers'
670 # Check w32api version
671 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
672 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
673 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
674 AC_TRY_COMPILE([#include <w32api.h>],
675 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
676 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
677 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
678 #error "test failed."
680 , [ res=yes ], [ res=no ])
681 AC_MSG_RESULT([$res])
682 if test "$res" != "yes"; then
683 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
685 # Check windres version
686 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
687 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
688 AC_MSG_RESULT([$_WINDRES_VERSION])
689 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
690 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
691 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
692 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
693 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
694 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
695 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
696 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
697 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
698 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
699 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
700 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
702 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
705 MOZ_WINSDK_MAXVER=0x06020000
708 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
709 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
710 # Require OS features provided by IE 6.0 SP2 (XP SP2)
711 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0603)
713 # If the maximum version supported by this SDK is lower than the target
715 AC_MSG_CHECKING([for Windows SDK being recent enough])
716 if $PERL -e "exit(0x$MOZ_WINSDK_TARGETVER > $MOZ_WINSDK_MAXVER)"; then
720 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.])
723 # Make sure the sdk / code we're targeting has the right toolset
724 AC_MSG_CHECKING([SDK and tools are in sync])
725 if test -n "$MOZ_METRO"; then
726 if test "$MOZ_MSVCVERSION" -gt "10"; then
730 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.])
734 AC_DEFINE_UNQUOTED(MOZ_WINSDK_TARGETVER,0x$MOZ_WINSDK_TARGETVER)
735 # Definitions matching sdkddkver.h
736 AC_DEFINE_UNQUOTED(MOZ_NTDDI_WIN7, 0x06010000)
743 if test -n "$_WIN32_MSVC"; then
745 SKIP_COMPILER_CHECKS=1
746 SKIP_LIBRARY_CHECKS=1
748 # Since we're skipping compiler and library checks, hard-code
751 AC_DEFINE(HAVE_SETBUF)
752 AC_DEFINE(HAVE_ISATTY)
753 if test $_MSC_VER -ge 1600; then
754 AC_DEFINE(HAVE_NULLPTR)
758 fi # COMPILE_ENVIRONMENT
771 AC_SUBST(WRAP_STL_INCLUDES)
772 AC_SUBST(MOZ_MSVC_STL_WRAP__Throw)
773 AC_SUBST(MOZ_MSVC_STL_WRAP__RAISE)
775 dnl ========================================================
776 dnl Checks for programs.
777 dnl ========================================================
781 if test -z "$TINDERBOX_SKIP_PERL_VERSION_CHECK"; then
782 AC_MSG_CHECKING([for minimum required perl version >= $PERL_VERSION])
783 _perl_version=`PERL_VERSION=$PERL_VERSION $PERL -e 'print "$]"; if ($] >= $ENV{PERL_VERSION}) { exit(0); } else { exit(1); }' 2>&5`
785 AC_MSG_RESULT([$_perl_version])
787 if test "$_perl_res" != 0; then
788 AC_MSG_ERROR([Perl $PERL_VERSION or higher is required.])
792 AC_MSG_CHECKING([for full perl installation])
793 _perl_archlib=`$PERL -e 'use Config; if ( -d $Config{archlib} ) { exit(0); } else { exit(1); }' 2>&5`
795 if test "$_perl_res" != 0; then
797 AC_MSG_ERROR([Cannot find Config.pm or \$Config{archlib}. A full perl installation is required.])
802 MOZ_PATH_PROGS(PYTHON, $PYTHON python2.7 python2.6 python2.5 python)
803 if test -z "$PYTHON"; then
804 AC_MSG_ERROR([python was not found in \$PATH])
807 MOZ_ARG_WITH_BOOL(system-ply,
808 [ --with-system-ply Use system installed python ply library],
809 [if $PYTHON -c 'import ply' 2>&5; then
812 AC_MSG_ERROR([python ply library is not found but --with-system-ply was requested])
815 AC_SUBST(MOZ_SYSTEM_PLY)
817 if test -z "$COMPILE_ENVIRONMENT"; then
818 NSINSTALL_BIN='$(PYTHON) $(topsrcdir)/config/nsinstall.py'
820 AC_SUBST(NSINSTALL_BIN)
822 MOZ_PATH_PROG(DOXYGEN, doxygen, :)
823 MOZ_PATH_PROG(AUTOCONF, autoconf, :)
824 MOZ_PATH_PROGS(UNZIP, unzip)
825 if test -z "$UNZIP" -o "$UNZIP" = ":"; then
826 AC_MSG_ERROR([unzip not found in \$PATH])
828 MOZ_PATH_PROGS(ZIP, zip)
829 if test -z "$ZIP" -o "$ZIP" = ":"; then
830 AC_MSG_ERROR([zip not found in \$PATH])
832 MOZ_PATH_PROG(MOZ_NATIVE_MAKEDEPEND, makedepend)
833 MOZ_PATH_PROG(XARGS, xargs)
834 if test -z "$XARGS" -o "$XARGS" = ":"; then
835 AC_MSG_ERROR([xargs not found in \$PATH .])
838 MOZ_PATH_PROG(RPMBUILD, rpmbuild, :)
841 if test "$COMPILE_ENVIRONMENT"; then
843 dnl ========================================================
844 dnl = Mac OS X toolchain support
845 dnl ========================================================
849 dnl Current known valid versions for GCC_VERSION are 2.95.2 3.1 3.3 4.0.
850 dnl 4.0 identifies itself as 4.0.x, so strip the decidecimal for
851 dnl the environment and includedir purposes (when using an SDK, below),
852 dnl but remember the full version number for the libdir (SDK).
854 GCC_VERSION_FULL=`echo $CXX_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
855 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
857 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
858 dnl Bug 280479, but this keeps popping up in bug 292530 too because
859 dnl 4.0.0/4061 is the default compiler in Tiger.
861 GCC_BUILD=`echo $CXX_VERSION | $PERL -pe 's/^.*build ([^ )]*).*/$1/'`
863 if test "$GCC_BUILD" = "4061" ; then
864 AC_MSG_ERROR([You are attempting to use Apple gcc 4.0 build 4061.
865 This compiler was supplied with Xcode 2.0, and contains bugs that prevent it
866 from building Mozilla. Upgrade to Xcode 2.1 or later.])
870 dnl xcodebuild needs GCC_VERSION defined in the environment, since it
871 dnl doesn't respect the CC/CXX setting. With GCC_VERSION set, it will use
872 dnl /usr/bin/g(cc|++)-$GCC_VERSION.
873 MOZ_PATH_PROGS(PBBUILD_BIN, pbbuild xcodebuild pbxbuild)
875 dnl sdp was formerly in /Developer/Tools. As of Mac OS X 10.4 (Darwin 8),
876 dnl it has moved into /usr/bin.
877 MOZ_PATH_PROG(SDP, sdp, :, [$PATH:/usr/bin:/Developer/Tools])
881 AC_SUBST(GCC_VERSION)
883 dnl The universal machinery sets UNIVERSAL_BINARY to inform packager.mk
884 dnl that a universal binary is being produced and MOZ_CAN_RUN_PROGRAMS
885 dnl when we can run target binaries.
886 AC_SUBST(UNIVERSAL_BINARY)
887 AC_SUBST(MOZ_CAN_RUN_PROGRAMS)
889 dnl ========================================================
890 dnl Check for MacOS deployment target version
891 dnl ========================================================
893 MOZ_ARG_ENABLE_STRING(macos-target,
894 [ --enable-macos-target=VER (default=10.6)
895 Set the minimum MacOS version needed at runtime],
896 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
900 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
901 dnl Use the specified value
902 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
904 dnl No value specified on the command line or in the environment,
905 dnl use architecture minimum.
906 export MACOSX_DEPLOYMENT_TARGET=10.6
911 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
913 dnl ========================================================
914 dnl = Mac OS X SDK support
915 dnl ========================================================
918 MOZ_ARG_WITH_STRING(macos-sdk,
919 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
920 MACOS_SDK_DIR=$withval)
922 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
923 dnl NEXT_ROOT will be set and exported only if it's needed.
924 AC_SUBST(MACOS_SDK_DIR)
927 if test "$MACOS_SDK_DIR"; then
928 dnl Sync this section with the ones in NSPR and NSS.
929 dnl Changes to the cross environment here need to be accounted for in
930 dnl the libIDL checks (below) and xpidl build.
932 if test ! -d "$MACOS_SDK_DIR"; then
933 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
934 specify a valid SDK. SDKs are installed when the optional cross-development
935 tools are selected during the Xcode/Developer Tools installation.])
938 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
939 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
940 AC_MSG_ERROR([You need to upgrade the compiler version to 4.x])
942 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
943 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
945 dnl CPP/CXXCPP needs to be set for MOZ_CHECK_HEADER.
946 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
947 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
949 if test "$GCC_VERSION_FULL" = "4.0.0" ; then
950 dnl If gcc >= 4.0, we're guaranteed to be on Tiger, which has an ld
951 dnl that supports -syslibroot. Don't set NEXT_ROOT because it will
952 dnl be ignored and cause warnings when -syslibroot is specified.
953 dnl gcc 4.0.1 will pass -syslibroot to ld automatically based on
954 dnl the -isysroot it receives, so this is only needed with 4.0.0.
955 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
960 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
962 AC_TRY_COMPILE([#include <new>],[],
966 AC_MSG_RESULT($result)
968 if test "$result" = "no" ; then
969 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
973 fi # COMPILE_ENVIRONMENT
975 AC_MSG_CHECKING([compiler version])
976 # Just print it so it shows up in the logs.
977 cc_version=$($CC --version)
978 AC_MSG_RESULT([$cc_version])
980 if test -n "$MAKE"; then
981 if test `echo $MAKE | grep -c make.py` != 1; then
988 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE make gmake, :)
991 MOZ_PATH_PROGS(GMAKE, $GMAKE $NOT_PYMAKE gmake make, :)
994 if test "$GMAKE" = ":"; then
995 AC_MSG_ERROR([GNU make not found])
999 if test -z "$MAKE"; then
1003 if test "$COMPILE_ENVIRONMENT"; then
1009 fi # COMPILE_ENVIRONMENT
1011 dnl ========================================================
1012 dnl set the defaults first
1013 dnl ========================================================
1016 AR_EXTRACT='$(AR) x'
1029 MOZ_USER_DIR=".mozilla"
1032 MOZ_JPEG_LIBS='$(call EXPAND_LIBNAME_PATH,mozjpeg,$(DEPTH)/media/libjpeg)'
1034 MOZ_BZ2_LIBS='$(call EXPAND_LIBNAME_PATH,bz2,$(DEPTH)/modules/libbz2/src)'
1036 MOZ_PNG_LIBS='$(call EXPAND_LIBNAME_PATH,mozpng,$(DEPTH)/media/libpng)'
1038 MOZ_JS_STATIC_LIBS='$(call EXPAND_LIBNAME_PATH,js_static,$(LIBXUL_DIST)/lib)'
1039 MOZ_JS_SHARED_LIBS='$(call EXPAND_LIBNAME_PATH,mozjs,$(LIBXUL_DIST)/lib)'
1040 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/bin -lxpcom -lxpcom_core -lmozalloc'
1041 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib'
1042 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/bin -lxpcom -lmozalloc'
1043 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) -lxul'
1044 XPCOM_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1045 XPCOM_STANDALONE_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX)'
1047 # These are specially defined on Windows only
1050 XPCOM_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime_s.$(LIB_SUFFIX) $(XPCOM_FROZEN_LDOPTS)'
1051 XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS='$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_staticruntime.$(LIB_SUFFIX)'
1054 XPCOM_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_GLUE_LDOPTS
1055 XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS=$XPCOM_STANDALONE_GLUE_LDOPTS
1061 MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
1063 USE_DEPENDENT_LIBS=1
1065 _PLATFORM_DEFAULT_TOOLKIT=cairo-gtk2
1067 if test -n "$CROSS_COMPILE"; then
1068 OS_TARGET="${target_os}"
1069 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
1071 case "${target_os}" in
1072 linux*) OS_ARCH=Linux OS_TARGET=Linux ;;
1073 kfreebsd*-gnu) OS_ARCH=GNU_kFreeBSD OS_TARGET=GNU_kFreeBSD ;;
1074 gnu*) OS_ARCH=GNU ;;
1075 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
1076 mingw*) OS_ARCH=WINNT OS_TARGET=WINNT ;;
1077 darwin*) OS_ARCH=Darwin OS_TARGET=Darwin ;;
1080 *-android*|*-linuxandroid*) OS_ARCH=Linux OS_TARGET=Android ;;
1083 OS_TARGET=`uname -s`
1084 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
1085 OS_RELEASE=`uname -r`
1088 # Before this used `uname -m` when not cross compiling
1089 # but that breaks when you have a 64 bit kernel with a 32 bit userland.
1090 OS_TEST="${target_cpu}"
1092 HOST_OS_ARCH=`echo $host_os | sed -e 's|/|_|g'`
1094 #######################################################################
1095 # Master "Core Components" macros for getting the OS target #
1096 #######################################################################
1099 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
1100 # cross-compilation.
1104 # Define and override various archtecture-specific variables, including
1113 case "$HOST_OS_ARCH" in
1127 if test -z "$GNU_CC"; then
1128 if test "`$CC -V 2>&1 | egrep -c 'Sun.*C '`" != "0"; then
1133 if test -z "$GNU_CXX"; then
1134 if test "`$CXX -V 2>&1 | egrep -c 'Sun.*C\+\+ '`" != "0"; then
1135 SOLARIS_SUNPRO_CXX=1
1138 AC_SUBST(SOLARIS_SUNPRO_CC)
1139 AC_SUBST(SOLARIS_SUNPRO_CXX)
1151 if test -z "$CROSS_COMPILE" ; then
1157 # If uname -s returns "Windows_NT", we assume that we are using
1158 # the uname.exe in MKS toolkit.
1160 # The -r option of MKS uname only returns the major version number.
1161 # So we need to use its -v option to get the minor version number.
1162 # Moreover, it doesn't have the -p option, so we need to use uname -m.
1166 OS_MINOR_RELEASE=`uname -v`
1167 if test "$OS_MINOR_RELEASE" = "00"; then
1170 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
1174 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
1175 # the uname.exe in the MSYS tools.
1177 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
1182 OS_RELEASE=`uname -v`.`uname -r`
1183 OS_TEST=${target_cpu}
1191 OS_RELEASE=`uname -v`
1194 case "${target_cpu}" in
1205 if test -z "$CROSS_COMPILE" ; then
1213 # Only set CPU_ARCH if we recognize the value of OS_TEST
1224 powerpc | ppc | rs6000)
1228 Alpha | alpha | ALPHA)
1261 if test -z "$OS_TARGET"; then
1264 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1266 dnl Set INTEL_ARCHITECTURE if we're compiling for x86-32 or x86-64.
1267 dnl ===============================================================
1271 INTEL_ARCHITECTURE=1
1274 dnl Configure platform-specific CPU architecture compiler options.
1275 dnl ==============================================================
1278 dnl =================================================================
1279 dnl Set up and test static assertion macros used to avoid AC_TRY_RUN,
1280 dnl which is bad when cross compiling.
1281 dnl =================================================================
1282 if test "$COMPILE_ENVIRONMENT"; then
1283 configure_static_assert_macros='
1284 #define CONFIGURE_STATIC_ASSERT(condition) CONFIGURE_STATIC_ASSERT_IMPL(condition, __LINE__)
1285 #define CONFIGURE_STATIC_ASSERT_IMPL(condition, line) CONFIGURE_STATIC_ASSERT_IMPL2(condition, line)
1286 #define CONFIGURE_STATIC_ASSERT_IMPL2(condition, line) typedef int static_assert_line_##line[(condition) ? 1 : -1]
1289 dnl test that the macros actually work:
1290 AC_MSG_CHECKING(that static assertion macros used in autoconf tests work)
1291 AC_CACHE_VAL(ac_cv_static_assertion_macros_work,
1294 ac_cv_static_assertion_macros_work="yes"
1295 AC_TRY_COMPILE([$configure_static_assert_macros],
1296 [CONFIGURE_STATIC_ASSERT(1)],
1298 ac_cv_static_assertion_macros_work="no")
1299 AC_TRY_COMPILE([$configure_static_assert_macros],
1300 [CONFIGURE_STATIC_ASSERT(0)],
1301 ac_cv_static_assertion_macros_work="no",
1304 AC_TRY_COMPILE([$configure_static_assert_macros],
1305 [CONFIGURE_STATIC_ASSERT(1)],
1307 ac_cv_static_assertion_macros_work="no")
1308 AC_TRY_COMPILE([$configure_static_assert_macros],
1309 [CONFIGURE_STATIC_ASSERT(0)],
1310 ac_cv_static_assertion_macros_work="no",
1314 AC_MSG_RESULT("$ac_cv_static_assertion_macros_work")
1315 if test "$ac_cv_static_assertion_macros_work" = "no"; then
1316 AC_MSG_ERROR([Compiler cannot compile macros used in autoconf tests.])
1318 fi # COMPILE_ENVIRONMENT
1320 dnl ========================================================
1321 dnl Android libstdc++, placed here so it can use MOZ_ARCH
1323 dnl ========================================================
1327 dnl ========================================================
1328 dnl Suppress Clang Argument Warnings
1329 dnl ========================================================
1330 if test -n "$CLANG_CC"; then
1331 _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
1332 CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
1334 if test -n "$CLANG_CXX"; then
1335 _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
1338 dnl ========================================================
1339 dnl = Use Address Sanitizer
1340 dnl ========================================================
1341 MOZ_ARG_ENABLE_BOOL(address-sanitizer,
1342 [ --enable-address-sanitizer Enable Address Sanitizer (default=no)],
1345 if test -n "$MOZ_ASAN"; then
1351 dnl ========================================================
1352 dnl = Enable hacks required for LLVM instrumentations
1353 dnl ========================================================
1354 MOZ_ARG_ENABLE_BOOL(llvm-hacks,
1355 [ --enable-llvm-hacks Enable workarounds required for several LLVM instrumentations (default=no)],
1358 if test -n "$MOZ_LLVM_HACKS"; then
1362 AC_SUBST(MOZ_NO_WLZDEFS)
1363 AC_SUBST(MOZ_CFLAGS_NSS)
1365 dnl ========================================================
1366 dnl GNU specific defaults
1367 dnl ========================================================
1368 if test "$GNU_CC"; then
1369 # FIXME: Let us build with strict aliasing. bug 414641.
1370 CFLAGS="$CFLAGS -fno-strict-aliasing"
1371 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1372 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$@ -o $@'
1373 DSO_LDOPTS='-shared'
1374 if test "$GCC_USE_GNU_LD"; then
1375 # Some tools like ASan use a runtime library that is only
1376 # linked against executables, so we must allow undefined
1377 # symbols for shared objects in some cases.
1378 if test -z "$MOZ_NO_WLZDEFS"; then
1379 # Don't allow undefined symbols in libraries
1380 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
1383 WARNINGS_AS_ERRORS='-Werror -Wno-error=uninitialized'
1385 DSO_PIC_CFLAGS='-fPIC'
1386 ASFLAGS="$ASFLAGS -fPIC"
1387 AC_MSG_CHECKING([for --noexecstack option to as])
1388 _SAVE_CFLAGS=$CFLAGS
1389 CFLAGS="$CFLAGS -Wa,--noexecstack"
1390 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
1391 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
1392 AC_MSG_RESULT([no]))
1393 CFLAGS=$_SAVE_CFLAGS
1394 AC_MSG_CHECKING([for -z noexecstack option to ld])
1395 _SAVE_LDFLAGS=$LDFLAGS
1396 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
1397 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
1399 LDFLAGS=$_SAVE_LDFLAGS)
1401 # Check for -mssse3 on $CC
1402 AC_MSG_CHECKING([for -mssse3 option to $CC])
1403 HAVE_COMPILER_FLAG_MSSSE3=
1404 _SAVE_CFLAGS=$CFLAGS
1405 CFLAGS="$CFLAGS -mssse3"
1406 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
1407 [HAVE_COMPILER_FLAG_MSSSE3=1],
1408 AC_MSG_RESULT([no]))
1409 CFLAGS=$_SAVE_CFLAGS
1410 AC_SUBST(HAVE_COMPILER_FLAG_MSSSE3)
1412 # Turn on GNU-specific warnings:
1413 # -Wall - turn on a lot of warnings
1414 # -pedantic - this is turned on below
1415 # -Wpointer-arith - enabled with -pedantic, but good to have even if not
1416 # -Wdeclaration-after-statement - MSVC doesn't like these
1417 # -Werror=return-type - catches missing returns, zero false positives
1418 # -Wtype-limits - catches overflow bugs, few false positives
1419 # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
1421 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wall -Wpointer-arith -Wdeclaration-after-statement"
1422 MOZ_C_SUPPORTS_WARNING(-W, error=return-type, ac_c_has_werror_return_type)
1423 MOZ_C_SUPPORTS_WARNING(-W, type-limits, ac_c_has_wtype_limits)
1424 MOZ_C_SUPPORTS_WARNING(-W, empty-body, ac_c_has_wempty_body)
1426 # Turn off the following warnings that -Wall/-pedantic turn on:
1427 # -Wno-unused - lots of violations in third-party code
1428 # -Wno-overlength-strings - we exceed the minimum maximum length frequently
1430 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wno-unused"
1431 MOZ_C_SUPPORTS_WARNING(-Wno-, overlength-strings, ac_c_has_wno_overlength_strings)
1433 if test -z "$INTEL_CC" -a -z "$CLANG_CC"; then
1434 # Don't use -Wcast-align with ICC or clang
1436 # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
1437 hppa | ia64 | sparc | arm)
1440 _WARNINGS_CFLAGS="${_WARNINGS_CFLAGS} -Wcast-align"
1445 dnl Turn pedantic on but disable the warnings for long long
1448 _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
1449 _USE_CPP_INCLUDE_FLAG=1
1451 elif test "$SOLARIS_SUNPRO_CC"; then
1453 if test "$CPU_ARCH" = "sparc"; then
1454 # for Sun Studio on Solaris/SPARC
1455 DSO_PIC_CFLAGS='-xcode=pic32'
1457 DSO_PIC_CFLAGS='-KPIC'
1459 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1461 MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1462 MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
1464 DSO_LDOPTS='-shared'
1465 if test "$GNU_LD"; then
1466 # Don't allow undefined symbols in libraries
1467 DSO_LDOPTS="$DSO_LDOPTS -z defs"
1471 DSO_PIC_CFLAGS='-KPIC'
1472 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
1475 if test "$GNU_CXX"; then
1476 # FIXME: Let us build with strict aliasing. bug 414641.
1477 CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"
1479 # Turn on GNU-specific warnings:
1480 # -Wall - turn on a lot of warnings
1481 # -pedantic - this is turned on below
1482 # -Wpointer-arith - enabled with -pedantic, but good to have even if not
1483 # -Woverloaded-virtual - ???
1484 # -Werror=return-type - catches missing returns, zero false positives
1485 # -Wtype-limits - catches overflow bugs, few false positives
1486 # -Wempty-body - catches bugs, e.g. "if (c); foo();", few false positives
1488 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wall -Wpointer-arith -Woverloaded-virtual"
1489 MOZ_CXX_SUPPORTS_WARNING(-W, error=return-type, ac_cxx_has_werror_return_type)
1490 MOZ_CXX_SUPPORTS_WARNING(-W, type-limits, ac_cxx_has_wtype_limits)
1491 MOZ_CXX_SUPPORTS_WARNING(-W, empty-body, ac_cxx_has_wempty_body)
1493 # Turn off the following warnings that -Wall/-pedantic turn on:
1494 # -Wno-ctor-dtor-privacy - ???
1495 # -Wno-overlength-strings - we exceed the minimum maximum length frequently
1496 # -Wno-invalid-offsetof - we use offsetof on non-POD types frequently
1497 # -Wno-variadic-macros - ???
1499 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-ctor-dtor-privacy"
1500 MOZ_CXX_SUPPORTS_WARNING(-Wno-, overlength-strings, ac_cxx_has_wno_overlength_strings)
1501 MOZ_CXX_SUPPORTS_WARNING(-Wno-, invalid-offsetof, ac_cxx_has_wno_invalid_offsetof)
1502 MOZ_CXX_SUPPORTS_WARNING(-Wno-, variadic-macros, ac_cxx_has_wno_variadic_macros)
1504 if test -z "$INTEL_CXX" -a -z "$CLANG_CXX"; then
1505 # Don't use -Wcast-align with ICC or clang
1507 # And don't use it on hppa, ia64, sparc, arm, since it's noisy there
1508 hppa | ia64 | sparc | arm)
1511 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wcast-align"
1516 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -include $(DEPTH)/mozilla-config.h'
1517 _USE_CPP_INCLUDE_FLAG=1
1519 # Recent clang and gcc support C++11 deleted functions without warnings if
1520 # compiling with -std=c++0x or -std=gnu++0x (or c++11 or gnu++11 in very new
1521 # versions). We can't use -std=c++0x yet, so gcc's support must remain
1522 # unused. But clang's warning can be disabled, so when compiling with clang
1523 # we use it to opt out of the warning, enabling (macro-encapsulated) use of
1524 # deleted function syntax.
1525 if test "$CLANG_CXX"; then
1526 _WARNINGS_CXXFLAGS="${_WARNINGS_CXXFLAGS} -Wno-c++0x-extensions"
1527 MOZ_CXX_SUPPORTS_WARNING(-Wno-, extended-offsetof, ac_cxx_has_wno_extended_offsetof)
1531 _DEFINES_CXXFLAGS='-DMOZILLA_CLIENT -D_MOZILLA_CONFIG_H_ $(ACDEFINES)'
1534 dnl gcc can come with its own linker so it is better to use the pass-thru calls
1535 dnl MKSHLIB_FORCE_ALL is used to force the linker to include all object
1536 dnl files present in an archive. MKSHLIB_UNFORCE_ALL reverts the linker to
1537 dnl normal behavior.
1538 dnl ========================================================
1540 MKSHLIB_UNFORCE_ALL=
1542 if test "$COMPILE_ENVIRONMENT"; then
1543 if test "$GNU_CC"; then
1544 AC_MSG_CHECKING(whether ld has archive extraction flags)
1545 AC_CACHE_VAL(ac_cv_mkshlib_force_and_unforce,
1546 [_SAVE_LDFLAGS=$LDFLAGS; _SAVE_LIBS=$LIBS
1547 ac_cv_mkshlib_force_and_unforce="no"
1548 exec 3<&0 <<LOOP_INPUT
1549 force="-Wl,--whole-archive"; unforce="-Wl,--no-whole-archive"
1550 force="-Wl,-z -Wl,allextract"; unforce="-Wl,-z -Wl,defaultextract"
1551 force="-Wl,-all"; unforce="-Wl,-none"
1558 AC_TRY_LINK(,, ac_cv_mkshlib_force_and_unforce=$line; break)
1561 LDFLAGS=$_SAVE_LDFLAGS; LIBS=$_SAVE_LIBS
1563 if test "$ac_cv_mkshlib_force_and_unforce" = "no"; then
1567 eval $ac_cv_mkshlib_force_and_unforce
1568 MKSHLIB_FORCE_ALL=$force
1569 MKSHLIB_UNFORCE_ALL=$unforce
1572 fi # COMPILE_ENVIRONMENT
1574 dnl ========================================================
1575 dnl Checking for 64-bit OS
1576 dnl ========================================================
1577 if test "$COMPILE_ENVIRONMENT"; then
1580 AC_MSG_CHECKING(for 64-bit OS)
1581 AC_TRY_COMPILE([$configure_static_assert_macros],
1582 [CONFIGURE_STATIC_ASSERT(sizeof(void*) == 8)],
1583 result="yes", result="no")
1584 AC_MSG_RESULT("$result")
1585 if test "$result" = "yes"; then
1586 AC_DEFINE(HAVE_64BIT_OS)
1589 AC_SUBST(HAVE_64BIT_OS)
1591 fi # COMPILE_ENVIRONMENT
1593 dnl ========================================================
1594 dnl Enable high-memory support on OS/2 by default.
1595 dnl ========================================================
1596 MOZ_OS2_HIGH_MEMORY=1
1597 MOZ_ARG_DISABLE_BOOL(os2-high-mem,
1598 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1599 MOZ_OS2_HIGH_MEMORY=,
1600 MOZ_OS2_HIGH_MEMORY=1 )
1601 AC_SUBST(MOZ_OS2_HIGH_MEMORY)
1603 dnl ========================================================
1604 dnl = Use profiling compile flags
1605 dnl ========================================================
1606 MOZ_ARG_ENABLE_BOOL(profiling,
1607 [ --enable-profiling Set compile flags necessary for using sampling profilers (e.g. shark, perf)],
1611 # For profiling builds keep the symbol information
1612 if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
1613 STRIP_FLAGS="--strip-debug"
1616 dnl ========================================================
1618 dnl ========================================================
1619 MOZ_ARG_ENABLE_BOOL(valgrind,
1620 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
1623 if test -n "$MOZ_VALGRIND"; then
1624 MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
1626 [--enable-valgrind specified but Valgrind is not installed]))
1627 AC_DEFINE(MOZ_VALGRIND)
1629 AC_SUBST(MOZ_VALGRIND)
1631 dnl ========================================================
1633 dnl ========================================================
1634 MOZ_ARG_ENABLE_BOOL(dmd,
1635 [ --enable-dmd Enable DMD; also disables jemalloc (default=no)],
1638 if test -n "$MOZ_DMD"; then
1639 MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
1641 [--enable-dmd specified but Valgrind is not installed]))
1645 dnl ========================================================
1647 dnl ========================================================
1648 MOZ_ARG_ENABLE_BOOL(jprof,
1649 [ --enable-jprof Enable jprof profiling tool (needs mozilla/tools/jprof). Implies --enable-profiling.],
1652 if test -n "$MOZ_JPROF"; then
1654 AC_DEFINE(MOZ_JPROF)
1657 dnl ========================================================
1659 dnl ========================================================
1660 MOZ_ENABLE_PROFILER_SPS=1
1662 case "${OS_TARGET}" in
1664 case "${CPU_ARCH}" in
1667 MOZ_ENABLE_PROFILER_SPS=
1671 case "${CPU_ARCH}" in
1674 MOZ_ENABLE_PROFILER_SPS=
1679 MOZ_ENABLE_PROFILER_SPS=
1683 if test -n "$MOZ_ENABLE_PROFILER_SPS"; then
1684 AC_DEFINE(MOZ_ENABLE_PROFILER_SPS)
1687 dnl ========================================================
1689 dnl ========================================================
1690 MOZ_ARG_ENABLE_BOOL(shark,
1691 [ --enable-shark Enable shark remote profiling. Implies --enable-profiling.],
1694 if test -n "$MOZ_SHARK"; then
1696 AC_DEFINE(MOZ_SHARK)
1699 dnl ========================================================
1701 dnl ========================================================
1702 MOZ_ARG_ENABLE_BOOL(callgrind,
1703 [ --enable-callgrind Enable callgrind profiling. Implies --enable-profiling.],
1706 if test -n "$MOZ_CALLGRIND"; then
1708 AC_DEFINE(MOZ_CALLGRIND)
1711 dnl ========================================================
1713 dnl ========================================================
1714 MOZ_ARG_ENABLE_BOOL(vtune,
1715 [ --enable-vtune Enable vtune profiling. Implies --enable-profiling.],
1718 if test -n "$MOZ_VTUNE"; then
1720 AC_DEFINE(MOZ_VTUNE)
1723 dnl ========================================================
1725 dnl ========================================================
1726 if test -n "$MOZ_PROFILING"; then
1727 AC_DEFINE(MOZ_PROFILING)
1730 dnl ========================================================
1731 dnl System overrides of the defaults for host
1732 dnl ========================================================
1735 if test -n "$_WIN32_MSVC"; then
1737 HOST_AR_FLAGS='-NOLOGO -OUT:"$@"'
1738 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo -Fd\$(HOST_PDBFILE)"
1739 HOST_RANLIB='echo ranlib'
1741 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
1743 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
1744 HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
1745 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1746 HOST_BIN_SUFFIX=.exe
1749 PERL="/bin/sh ${_topsrcdir}/build/msys-perl-wrapper"
1753 case "${host_cpu}" in
1755 if test -n "$_WIN32_MSVC"; then
1756 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
1760 if test -n "$_WIN32_MSVC"; then
1761 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
1763 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
1769 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
1770 HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1771 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1774 *-linux*|*-kfreebsd*-gnu|*-gnu*)
1775 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1776 HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
1777 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
1781 HOST_CFLAGS="$HOST_CFLAGS -DXP_OS2 -DNO_X11 -Zomf"
1782 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
1783 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1784 HOST_BIN_SUFFIX=.exe
1789 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1790 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
1794 dnl We require version 2.5 or newer of Python to build.
1795 AC_MSG_CHECKING([for Python version >= $PYTHON_VERSION but not 3.x])
1797 $PYTHON -c "import sys; sys.exit(sys.version[:3] < sys.argv[1] or sys.version[:2] != '2.')" $PYTHON_VERSION
1800 if test "$_python_res" != 0; then
1801 AC_MSG_ERROR([Python $PYTHON_VERSION or higher (but not Python 3.x) is required.])
1803 AC_MSG_RESULT([yes])
1805 dnl Check for using a custom <stdint.h> implementation
1806 dnl ========================================================
1807 AC_MSG_CHECKING(for custom <stdint.h> implementation)
1808 if test "$MOZ_CUSTOM_STDINT_H"; then
1809 AC_DEFINE_UNQUOTED(MOZ_CUSTOM_STDINT_H, "$MOZ_CUSTOM_STDINT_H")
1810 AC_MSG_RESULT(using $MOZ_CUSTOM_STDINT_H)
1812 AC_MSG_RESULT(none specified)
1815 dnl Get mozilla version from central milestone file
1816 MOZILLA_VERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir`
1817 MOZILLA_UAVERSION=`$PERL $srcdir/config/milestone.pl -topsrcdir $srcdir -uaversion`
1819 dnl Get version of various core apps from the version files.
1820 FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
1822 if test -z "$FIREFOX_VERSION"; then
1823 AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.])
1826 AC_DEFINE_UNQUOTED(MOZILLA_VERSION,"$MOZILLA_VERSION")
1827 AC_DEFINE_UNQUOTED(MOZILLA_VERSION_U,$MOZILLA_VERSION)
1828 AC_DEFINE_UNQUOTED(MOZILLA_UAVERSION,"$MOZILLA_UAVERSION")
1830 MOZ_DOING_LTO(lto_is_enabled)
1832 dnl ========================================================
1833 dnl System overrides of the defaults for target
1834 dnl ========================================================
1839 if test ! "$GNU_CC"; then
1840 if test ! "$HAVE_64BIT_OS"; then
1841 # Compiling with Visual Age C++ object model compat is the
1842 # default. To compile with object model ibm, add
1843 # AIX_OBJMODEL=ibm to .mozconfig.
1844 if test "$AIX_OBJMODEL" = "ibm"; then
1845 CXXFLAGS="$CXXFLAGS -qobjmodel=ibm"
1852 AC_SUBST(AIX_OBJMODEL)
1853 DSO_LDOPTS='-qmkshrobj=1'
1854 DSO_CFLAGS='-qflag=w:w'
1856 LDFLAGS="$LDFLAGS -Wl,-brtl -blibpath:/usr/lib:/lib"
1858 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
1859 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1860 if test "$COMPILE_ENVIRONMENT"; then
1863 AC_MSG_CHECKING([for IBM XLC/C++ compiler version >= 9.0.0.7])
1865 [#if (__IBMCPP__ < 900)
1866 #error "Bad compiler"
1868 _BAD_COMPILER=,_BAD_COMPILER=1)
1869 if test -n "$_BAD_COMPILER"; then
1871 AC_MSG_ERROR([IBM XLC/C++ 9.0.0.7 or higher is required to build.])
1873 AC_MSG_RESULT([yes])
1876 TARGET_COMPILER_ABI="ibmc"
1877 CC_VERSION=`lslpp -Lcq vac.C 2>/dev/null | awk -F: '{ print $3 }'`
1878 CXX_VERSION=`lslpp -Lcq vacpp.cmp.core 2>/dev/null | awk -F: '{ print $3 }'`
1881 case "${target_os}" in
1886 if test "$COMPILE_ENVIRONMENT"; then
1887 MOZ_CHECK_HEADERS(sys/inttypes.h)
1889 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
1893 dnl -pedantic doesn't play well with BSDI's _very_ modified gcc (shlicc2)
1902 _WARNINGS_CFLAGS="-Wall"
1903 _WARNINGS_CXXFLAGS="-Wall"
1904 # The test above doesn't work properly, at least on 3.1.
1905 MKSHLIB_FORCE_ALL=''
1906 MKSHLIB_UNFORCE_ALL=''
1912 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1913 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
1914 MOZ_OPTIMIZE_FLAGS="-O3"
1916 # Statically disable jemalloc on 10.5 and 32-bit 10.6. See bug 702250.
1917 if test "$HAVE_64BIT_OS"; then
1922 STRIP="$STRIP -x -S"
1923 # Check whether we're targeting OS X or iOS
1924 AC_CACHE_CHECK(for iOS target,
1926 [AC_TRY_COMPILE([#include <TargetConditionals.h>
1927 #if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
1931 ac_cv_ios_target="yes",
1932 ac_cv_ios_target="no")])
1933 if test "$ac_cv_ios_target" = "yes"; then
1935 AC_DEFINE(XP_DARWIN)
1936 _PLATFORM_DEFAULT_TOOLKIT='cairo-uikit'
1938 AC_DEFINE(XP_MACOSX)
1939 AC_DEFINE(XP_DARWIN)
1940 _PLATFORM_DEFAULT_TOOLKIT='cairo-cocoa'
1941 # The ExceptionHandling framework is needed for Objective-C exception
1942 # logging code in nsObjCExceptions.h. Currently we only use that in debug
1944 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
1946 TARGET_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
1949 if test "x$lto_is_enabled" = "xyes"; then
1950 echo "Skipping -dead_strip because lto is enabled."
1951 dnl DTrace and -dead_strip don't interact well. See bug 403132.
1952 dnl ===================================================================
1953 elif test "x$enable_dtrace" = "xyes"; then
1954 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
1956 dnl check for the presence of the -dead_strip linker flag
1957 AC_MSG_CHECKING([for -dead_strip option to ld])
1958 _SAVE_LDFLAGS=$LDFLAGS
1959 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
1960 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
1961 if test -n "$_HAVE_DEAD_STRIP" ; then
1962 AC_MSG_RESULT([yes])
1963 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
1968 LDFLAGS=$_SAVE_LDFLAGS
1971 dnl With newer linkers we need to pass -allow_heap_execute because of
1972 dnl Microsoft Silverlight (5.1.10411.0 at least).
1973 AC_MSG_CHECKING([for -allow_heap_execute option to ld])
1974 _SAVE_LDFLAGS=$LDFLAGS
1975 LDFLAGS="$LDFLAGS -Wl,-allow_heap_execute"
1976 AC_TRY_LINK(,[return 0;],_HAVE_ALLOW_HEAP_EXECUTE=1,
1977 _HAVE_ALLOW_HEAP_EXECUTE=)
1978 if test -n "$_HAVE_ALLOW_HEAP_EXECUTE" ; then
1979 AC_MSG_RESULT([yes])
1980 MOZ_ALLOW_HEAP_EXECUTE_FLAGS="-Wl,-allow_heap_execute"
1984 LDFLAGS=$_SAVE_LDFLAGS
1986 MOZ_FIX_LINK_PATHS='-Wl,-executable_path,$(LIBXUL_DIST)/bin'
1991 if test ! "$GNU_CC"; then
1995 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -o $@'
1996 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_LDOPTS) -o $@'
1997 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
2000 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2001 MKCSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
2004 MOZ_NATIVE_MAKEDEPEND=
2005 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2006 AC_DEFINE(_LARGEFILE64_SOURCE)
2011 if test ! "$GNU_CC"; then
2012 DSO_LDOPTS='-b -Wl,+s'
2015 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -o $@'
2016 MKCSHLIB='$(LD) -b +s -L$(LIBXUL_DIST)/bin -o $@'
2017 CXXFLAGS="$CXXFLAGS -Wc,-ansi_for_scope,on"
2019 DSO_LDOPTS='-b -E +s'
2020 MKSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
2021 MKCSHLIB='$(LD) $(DSO_LDOPTS) -L$(LIBXUL_DIST)/bin -L$(LIBXUL_DIST)/lib -o $@'
2023 MOZ_POST_PROGRAM_COMMAND='chatr +s enable'
2024 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2027 *-android*|*-linuxandroid*)
2028 AC_DEFINE(NO_PW_GECOS)
2030 if test -n "$gonkdir"; then
2031 _PLATFORM_DEFAULT_TOOLKIT=cairo-gonk
2035 _PLATFORM_DEFAULT_TOOLKIT=cairo-android
2038 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2040 MOZ_GFX_OPTIMIZE_MOBILE=1
2041 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks -fno-reorder-functions"
2045 # Note: both GNU_CC and INTEL_CC are set when using Intel's C compiler.
2046 # Similarly for GNU_CXX and INTEL_CXX.
2047 if test "$INTEL_CC" -o "$INTEL_CXX"; then
2048 # -Os has been broken on Intel's C/C++ compilers for quite a
2049 # while; Intel recommends against using it.
2050 MOZ_OPTIMIZE_FLAGS="-O2"
2051 MOZ_DEBUG_FLAGS="-g"
2052 elif test "$GNU_CC" -o "$GNU_CXX"; then
2053 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2054 case $GCC_VERSION in
2056 # -Os is broken on gcc 4.1.x 4.2.x, 4.5.x we need to tweak it to get good results.
2057 MOZ_OPTIMIZE_SIZE_TWEAK="-finline-limit=50"
2059 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
2060 MOZ_OPTIMIZE_FLAGS="-Os -freorder-blocks $MOZ_OPTIMIZE_SIZE_TWEAK"
2061 MOZ_DEBUG_FLAGS="-g"
2064 TARGET_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
2068 case "${target_cpu}" in
2070 CFLAGS="$CFLAGS -mieee"
2071 CXXFLAGS="$CXXFLAGS -mieee"
2077 MOZ_DEBUG_FLAGS="-g" # We want inlining
2081 if test -z "$MC"; then
2091 # certain versions of cygwin's makedepend barf on the
2092 # #include <string> vs -I./dist/include/string issue so don't use it
2093 MOZ_NATIVE_MAKEDEPEND=
2094 if test -n "$GNU_CC"; then
2096 CXX="$CXX -mwindows"
2097 CPP="$CPP -mwindows"
2098 CFLAGS="$CFLAGS -mms-bitfields"
2099 CXXFLAGS="$CXXFLAGS -mms-bitfields"
2100 DSO_LDOPTS='-shared'
2101 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
2102 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2104 # Use temp file for windres (bug 213281)
2105 RCFLAGS='-O coff --use-temp-file'
2106 # mingw doesn't require kernel32, user32, and advapi32 explicitly
2107 LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32 -luserenv"
2109 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom -lxpcom_core -lmozalloc'
2110 XPCOM_FROZEN_LDOPTS='-L$(LIBXUL_DIST)/lib -lxpcom -lmozalloc'
2112 IMPORT_LIB_SUFFIX=dll.a
2113 GCC_VERSION=`$CC -v 2>&1 | awk '/^gcc version/ { print $3 }'`
2115 TARGET_COMPILER_ABI=msvc
2119 if test "$AS_BIN"; then
2120 AS="$(basename "$AS_BIN")"
2123 AR_FLAGS='-NOLOGO -OUT:"$@"'
2125 RANLIB='echo not_ranlib'
2126 STRIP='echo not_strip'
2137 IMPORT_LIB_SUFFIX=lib
2138 MKSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2139 MKCSHLIB='$(LD) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
2141 MKSHLIB_UNFORCE_ALL=
2142 DSO_LDOPTS=-SUBSYSTEM:WINDOWS
2143 _USE_CPP_INCLUDE_FLAG=1
2144 _DEFINES_CFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
2145 _DEFINES_CXXFLAGS='-FI $(DEPTH)/dist/include/mozilla-config.h -DMOZILLA_CLIENT'
2146 CFLAGS="$CFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2147 CXXFLAGS="$CXXFLAGS -W3 -Gy -Fd\$(COMPILE_PDBFILE)"
2148 CXXFLAGS="$CXXFLAGS -wd4800" # disable warning "forcing value to bool"
2149 # make 'foo == bar;' error out
2150 CFLAGS="$CFLAGS -we4553"
2151 CXXFLAGS="$CXXFLAGS -we4553"
2152 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib"
2153 MOZ_DEBUG_FLAGS='-Zi'
2154 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2155 WARNINGS_AS_ERRORS='-WX'
2156 MOZ_OPTIMIZE_FLAGS='-O1'
2158 DYNAMIC_XPCOM_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2159 XPCOM_FROZEN_LDOPTS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2160 LIBXUL_LIBS='$(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2161 MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
2162 if test $_MSC_VER -ge 1400; then
2163 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
2164 dnl For profile-guided optimization
2165 PROFILE_GEN_CFLAGS="-GL"
2166 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
2167 dnl XXX: PGO builds can fail with warnings treated as errors,
2168 dnl specifically "no profile data available" appears to be
2169 dnl treated as an error sometimes. This might be a consequence
2170 dnl of using WARNINGS_AS_ERRORS in some modules, combined
2171 dnl with the linker doing most of the work in the whole-program
2172 dnl optimization/PGO case. I think it's probably a compiler bug,
2173 dnl but we work around it here.
2174 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
2175 dnl XXX: should be -LTCG:PGOPTIMIZE, but that fails on libxul.
2176 dnl Probably also a compiler bug, but what can you do?
2177 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
2178 LDFLAGS="$LDFLAGS -DYNAMICBASE"
2181 AC_DEFINE(HAVE_SNPRINTF)
2186 AC_DEFINE(HW_THREADS)
2187 AC_DEFINE(STDC_HEADERS)
2188 AC_DEFINE(NEW_H, <new>)
2189 AC_DEFINE(WIN32_LEAN_AND_MEAN)
2190 TARGET_MD_ARCH=win32
2191 _PLATFORM_DEFAULT_TOOLKIT='cairo-windows'
2193 MOZ_USER_DIR="Mozilla"
2195 dnl Hardcode to win95 for now - cls
2196 TARGET_NSPR_MDCPUCFG='\"md/_win95.cfg\"'
2198 dnl set NO_X11 defines here as the general check is skipped on win32
2204 MOZ_BUILD_ROOT=`cd $MOZ_BUILD_ROOT && pwd -W`
2205 L10NBASEDIR=`cd $L10NBASEDIR && pwd -W`
2211 if test -z "$MOZ_TOOLS"; then
2212 AC_MSG_ERROR([MOZ_TOOLS is not set])
2214 MOZ_TOOLS_DIR=`cd $MOZ_TOOLS && pwd -W`
2215 if test "$?" != "0" -o -z "$MOZ_TOOLS_DIR"; then
2216 AC_MSG_ERROR([cd \$MOZ_TOOLS failed. MOZ_TOOLS ==? $MOZ_TOOLS])
2218 MOZ_TOOLS_BIN_DIR="$(cd "$MOZ_TOOLS_DIR/bin" && pwd)"
2219 if test `echo ${PATH}: | grep -ic "$MOZ_TOOLS_BINDIR:"` = 0; then
2220 AC_MSG_ERROR([\$MOZ_TOOLS\\bin must be in your path.])
2227 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.])
2233 if test "$HAVE_64BIT_OS"; then
2234 AC_MSG_ERROR([You are targeting i386 but using the 64-bit compiler.])
2237 if test $_MSC_VER -ge 1400; then
2238 LDFLAGS="$LDFLAGS -SAFESEH"
2241 if test -n "$GNU_CC"; then
2242 CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
2243 CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
2245 AC_DEFINE(HAVE_STDCALL)
2246 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
2249 MOZ_CHECK_HEADERS(mmintrin.h)
2253 if test -n "$_WIN32_MSVC"; then
2254 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
2259 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2263 if test "$HAVE_64BIT_OS"; then
2270 CFLAGS="$CFLAGS -Dunix"
2271 CXXFLAGS="$CXXFLAGS -Dunix"
2272 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
2274 DSO_PIC_CFLAGS='-fPIC -DPIC'
2275 DSO_LDOPTS='-shared'
2276 BIN_FLAGS='-Wl,--export-dynamic'
2278 DSO_PIC_CFLAGS='-fPIC -DPIC'
2279 DLL_SUFFIX=".so.1.0"
2280 DSO_LDOPTS='-shared'
2282 # This will fail on a.out systems prior to 1.5.1_ALPHA.
2283 MKSHLIB_FORCE_ALL='-Wl,--whole-archive'
2284 MKSHLIB_UNFORCE_ALL='-Wl,--no-whole-archive'
2285 if test "$LIBRUNPATH"; then
2286 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
2288 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2289 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,lib$(LIBRARY_NAME)$(DLL_SUFFIX) -o $@'
2293 if test "$SO_VERSION"; then
2294 DLL_SUFFIX=".so.$SO_VERSION"
2296 DLL_SUFFIX=".so.1.0"
2298 MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(prefix)/lib -Wl,-rpath-link,$(if $(X11BASE),$(X11BASE),/usr/X11R6)/lib'
2300 DSO_PIC_CFLAGS='-fPIC'
2301 DSO_LDOPTS='-shared -fPIC'
2302 if test "$LIBRUNPATH"; then
2303 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
2308 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2309 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
2312 AC_DEFINE(OS2EMX_PLAIN_CHAR)
2313 AC_DEFINE(TCPV40HDRS)
2319 IMPORT_LIB_SUFFIX=lib
2323 CFLAGS="$CFLAGS -Zomf"
2324 CXXFLAGS="$CXXFLAGS -Zomf"
2326 BIN_FLAGS='-Zlinker /ST:0x100000'
2330 WARNINGS_AS_ERRORS='-Werror'
2331 MOZ_DEBUG_FLAGS="-g -fno-inline"
2332 MOZ_OPTIMIZE_FLAGS="-O2"
2333 MOZ_OPTIMIZE_LDFLAGS="-s -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2334 DYNAMIC_XPCOM_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xpcom_core.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2335 LIBXUL_LIBS='-L$(LIBXUL_DIST)/lib $(LIBXUL_DIST)/lib/xpcom.lib $(LIBXUL_DIST)/lib/xul.lib $(LIBXUL_DIST)/lib/mozalloc.lib'
2337 _PLATFORM_DEFAULT_TOOLKIT="cairo-os2"
2341 MOZ_USER_DIR="Mozilla"
2344 if test "$MOZTOOLS"; then
2345 MOZ_TOOLS_DIR=`echo $MOZTOOLS | sed -e 's|\\\\|/|g'`
2347 AC_MSG_ERROR([MOZTOOLS is not set])
2349 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2350 DSO_LDOPTS="$DSO_LDOPTS -Zhigh-mem"
2351 LDFLAGS="$LDFLAGS -Zhigh-mem"
2352 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -Zhigh-mem"
2353 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2356 # GCC for OS/2 currently predefines these, but we don't want them
2357 _DEFINES_CFLAGS="$_DEFINES_CFLAGS -Uunix -U__unix -U__unix__"
2358 _DEFINES_CXXFLAGS="$_DEFINES_CXXFLAGS -Uunix -U__unix -U__unix__"
2360 AC_CACHE_CHECK(for __declspec(dllexport),
2362 [AC_TRY_COMPILE([__declspec(dllexport) void ac_os2_declspec(void) {}],
2364 ac_os2_declspec="yes",
2365 ac_os2_declspec="no")])
2366 if test "$ac_os2_declspec" != "yes"; then
2367 AC_MSG_ERROR([Compiler does not support __declspec(dllexport), install GCC-4.3.2 or newer])
2373 TARGET_NSPR_MDCPUCFG='\"md/_solaris.cfg\"'
2374 MOZ_NATIVE_MAKEDEPEND=
2376 # $ORIGIN/.. is for shared libraries under components/ to locate shared
2377 # libraries one level up (e.g. libnspr4.so)
2378 if test "$SOLARIS_SUNPRO_CC"; then
2379 LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..' -z lazyload -z combreloc -z muldefs"
2380 LIBS="-lCrun -lCstd -lc $LIBS"
2381 AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
2382 CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all -D__FUNCTION__=__func__"
2383 CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife,tmplrefstatic,extensions,no%except -norunpath -D__FUNCTION__=__func__ -template=no%extdef"
2384 LDFLAGS="-xildoff $LDFLAGS"
2385 if test -z "$CROSS_COMPILE" -a -f /usr/lib/ld/map.noexstk; then
2386 _SAVE_LDFLAGS=$LDFLAGS
2387 LDFLAGS="-M /usr/lib/ld/map.noexstk $LDFLAGS"
2388 AC_TRY_LINK([#include <stdio.h>],
2389 [printf("Hello World\n");],
2391 [LDFLAGS=$_SAVE_LDFLAGS])
2393 MOZ_OPTIMIZE_FLAGS="-xO4"
2394 MKSHLIB='$(CXX) $(CXXFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2395 MKCSHLIB='$(CC) $(CFLAGS) $(DSO_PIC_FLAGS) $(DSO_LDOPTS) -h $@ -o $@'
2396 MKSHLIB_FORCE_ALL='-z allextract'
2397 MKSHLIB_UNFORCE_ALL='-z defaultextract'
2404 AS='/usr/ccs/bin/as'
2405 ASFLAGS="$ASFLAGS -K PIC -L -P -D_ASM -D__STDC__=0"
2407 TARGET_COMPILER_ABI="sunc"
2408 CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2409 CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
2410 AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
2414 [#if (__SUNPRO_CC < 0x590)
2417 _BAD_COMPILER=,_BAD_COMPILER=1)
2418 if test -n "$_BAD_COMPILER"; then
2420 AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
2425 [#if (__SUNPRO_CC >= 0x5100)
2426 #error "Sun C++ 5.10 or above"
2428 _ABOVE_SS12U1=,_ABOVE_SS12U1=1)
2429 if test "$_ABOVE_SS12U1"; then
2431 CXXFLAGS="$CXXFLAGS -xannotate=no"
2433 AC_MSG_RESULT([$_res])
2436 LDFLAGS="$LDFLAGS -Wl,-z,ignore -Wl,-R,'\$\$ORIGIN:\$\$ORIGIN/..' -Wl,-z,lazyload -Wl,-z,combreloc -Wl,-z,muldefs"
2438 MKSHLIB_FORCE_ALL='-Wl,-z -Wl,allextract'
2439 MKSHLIB_UNFORCE_ALL='-Wl,-z -Wl,defaultextract'
2440 ASFLAGS="$ASFLAGS -fPIC"
2441 DSO_LDOPTS='-shared'
2442 WARNINGS_AS_ERRORS='-Werror'
2444 _WARNINGS_CXXFLAGS=''
2445 if test "$OS_RELEASE" = "5.3"; then
2446 AC_DEFINE(MUST_UNDEF_HAVE_BOOLEAN_AFTER_INCLUDES)
2449 if test "$OS_RELEASE" = "5.5.1"; then
2450 AC_DEFINE(NEED_USLEEP_PROTOTYPE)
2455 DSO_LDOPTS='-Bdynamic'
2456 MKSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2457 MKCSHLIB='-$(LD) $(DSO_LDOPTS) -o $@'
2459 AC_DEFINE(SPRINTF_RETURNS_STRING)
2460 case "$(target_os)" in
2462 DLL_SUFFIX='.so.1.0'
2468 HOST_NSPR_MDCPUCFG='\"md/_os2.cfg\"'
2473 AC_SUBST(MOZ_LINKER)
2474 if test -n "$MOZ_LINKER"; then
2475 AC_DEFINE(MOZ_LINKER)
2477 AC_SUBST(MOZ_ENABLE_SZIP)
2479 dnl Only one oddball right now (QNX), but this gives us flexibility
2480 dnl if any other platforms need to override this in the future.
2481 AC_DEFINE_UNQUOTED(D_INO,$DIRENT_INO)
2483 dnl ========================================================
2484 dnl Any platform that doesn't have MKSHLIB_FORCE_ALL defined
2485 dnl by now will not have any way to link most binaries (tests
2486 dnl as well as viewer, apprunner, etc.), because some symbols
2487 dnl will be left out of the "composite" .so's by ld as unneeded.
2488 dnl So, by defining NO_LD_ARCHIVE_FLAGS for these platforms,
2489 dnl they can link in the static libs that provide the missing
2491 dnl ========================================================
2492 NO_LD_ARCHIVE_FLAGS=
2493 if test -z "$MKSHLIB_FORCE_ALL" -o -z "$MKSHLIB_UNFORCE_ALL"; then
2494 NO_LD_ARCHIVE_FLAGS=1
2498 NO_LD_ARCHIVE_FLAGS=
2501 NO_LD_ARCHIVE_FLAGS=
2504 if test -z "$GNU_CC"; then
2505 NO_LD_ARCHIVE_FLAGS=
2509 AC_SUBST(NO_LD_ARCHIVE_FLAGS)
2511 dnl ========================================================
2512 dnl = Flags to strip unused symbols from .so components and
2513 dnl = to export jemalloc symbols when linking a program
2514 dnl ========================================================
2516 *-linux*|*-kfreebsd*-gnu|*-gnu*)
2517 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2520 if test -z "$GNU_CC"; then
2521 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-M $(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2523 if test -z "$GCC_USE_GNU_LD"; then
2524 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-M -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-mapfile'
2526 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2531 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,-exported_symbols_list -Wl,$(BUILD_TOOLS)/gnu-ld-scripts/components-export-list'
2534 if test -n "$GNU_CC"; then
2535 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS='-Wl,--version-script,$(BUILD_TOOLS)/gnu-ld-scripts/components-version-script'
2540 if test -z "$COMPILE_ENVIRONMENT"; then
2541 SKIP_COMPILER_CHECKS=1
2542 SKIP_LIBRARY_CHECKS=1
2546 if test -z "$SKIP_COMPILER_CHECKS"; then
2547 dnl Checks for typedefs, structures, and compiler characteristics.
2548 dnl ========================================================
2556 AC_MSG_CHECKING(for __stdcall)
2557 AC_CACHE_VAL(ac_cv___stdcall,
2558 [AC_TRY_COMPILE([template <typename Method> struct foo;
2559 template <> struct foo<void (*)()> {};
2560 template <> struct foo<void (__stdcall*)()> {};],
2562 [ac_cv___stdcall=true],
2563 [ac_cv___stdcall=false])])
2564 if test "$ac_cv___stdcall" = true ; then
2565 AC_DEFINE(HAVE_STDCALL)
2571 AC_MSG_CHECKING(for ssize_t)
2572 AC_CACHE_VAL(ac_cv_type_ssize_t,
2573 [AC_TRY_COMPILE([#include <stdio.h>
2574 #include <sys/types.h>],
2576 [ac_cv_type_ssize_t=true],
2577 [ac_cv_type_ssize_t=false])])
2578 if test "$ac_cv_type_ssize_t" = true ; then
2579 AC_DEFINE(HAVE_SSIZE_T)
2584 AC_STRUCT_ST_BLKSIZE
2585 AC_MSG_CHECKING(for siginfo_t)
2586 AC_CACHE_VAL(ac_cv_siginfo_t,
2587 [AC_TRY_COMPILE([#define _POSIX_C_SOURCE 199506L
2588 #include <signal.h>],
2590 [ac_cv_siginfo_t=true],
2591 [ac_cv_siginfo_t=false])])
2592 if test "$ac_cv_siginfo_t" = true ; then
2593 AC_DEFINE(HAVE_SIGINFO_T)
2599 dnl Check for int64, uint, and uint_t.
2600 dnl ========================================================
2601 AC_MSG_CHECKING(for int64)
2602 AC_CACHE_VAL(ac_cv_int64,
2603 [AC_TRY_COMPILE([#include <stdio.h>
2604 #include <sys/types.h>],
2607 [ac_cv_int64=false])])
2608 if test "$ac_cv_int64" = true ; then
2609 AC_DEFINE(HAVE_INT64)
2614 AC_MSG_CHECKING(for uint)
2615 AC_CACHE_VAL(ac_cv_uint,
2616 [AC_TRY_COMPILE([#include <stdio.h>
2617 #include <sys/types.h>],
2620 [ac_cv_uint=false])])
2621 if test "$ac_cv_uint" = true ; then
2622 AC_DEFINE(HAVE_UINT)
2627 AC_MSG_CHECKING(for uint_t)
2628 AC_CACHE_VAL(ac_cv_uint_t,
2629 [AC_TRY_COMPILE([#include <stdio.h>
2630 #include <sys/types.h>],
2632 [ac_cv_uint_t=true],
2633 [ac_cv_uint_t=false])])
2634 if test "$ac_cv_uint_t" = true ; then
2635 AC_DEFINE(HAVE_UINT_T)
2641 dnl On the gcc trunk (as of 2001-02-09) _GNU_SOURCE, and thus __USE_GNU,
2642 dnl are defined when compiling C++ but not C. Since the result of this
2643 dnl test is used only in C++, do it in C++.
2646 AC_MSG_CHECKING(for uname.domainname)
2647 AC_CACHE_VAL(ac_cv_have_uname_domainname_field,
2648 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2649 [ struct utsname *res; char *domain;
2650 (void)uname(res); if (res != 0) { domain = res->domainname; } ],
2651 [ac_cv_have_uname_domainname_field=true],
2652 [ac_cv_have_uname_domainname_field=false])])
2654 if test "$ac_cv_have_uname_domainname_field" = "true"; then
2655 AC_DEFINE(HAVE_UNAME_DOMAINNAME_FIELD)
2661 AC_MSG_CHECKING(for uname.__domainname)
2662 AC_CACHE_VAL(ac_cv_have_uname_us_domainname_field,
2663 [AC_TRY_COMPILE([#include <sys/utsname.h>],
2664 [ struct utsname *res; char *domain;
2665 (void)uname(res); if (res != 0) { domain = res->__domainname; } ],
2666 [ac_cv_have_uname_us_domainname_field=true],
2667 [ac_cv_have_uname_us_domainname_field=false])])
2669 if test "$ac_cv_have_uname_us_domainname_field" = "true"; then
2670 AC_DEFINE(HAVE_UNAME_US_DOMAINNAME_FIELD)
2676 dnl Check whether we can use gcc's c++0x mode
2679 if test "$GNU_CXX"; then
2680 _SAVE_CXXFLAGS=$CXXFLAGS
2681 CXXFLAGS="$CXXFLAGS -std=gnu++0x"
2683 AC_CACHE_CHECK(for gcc c++0x headers bug without rtti,
2684 ac_cv_cxx0x_headers_bug,
2685 [AC_TRY_COMPILE([#include <memory>], [],
2686 ac_cv_cxx0x_headers_bug="no",
2687 ac_cv_cxx0x_headers_bug="yes")])
2688 CXXFLAGS="$_SAVE_CXXFLAGS"
2689 if test "$ac_cv_cxx0x_headers_bug" = "no"; then
2690 CXXFLAGS="$CXXFLAGS -std=gnu++0x"
2694 dnl Check for usable char16_t (2 bytes, unsigned)
2695 dnl (we might not need the unsignedness check anymore)
2696 AC_CACHE_CHECK(for usable char16_t (2 bytes, unsigned),
2697 ac_cv_have_usable_char16_t,
2698 [AC_TRY_COMPILE([$configure_static_assert_macros],
2699 [CONFIGURE_STATIC_ASSERT(sizeof(char16_t) == 2);
2700 CONFIGURE_STATIC_ASSERT(char16_t(-1) > char16_t(0));
2701 CONFIGURE_STATIC_ASSERT(sizeof((u"hello")[0]) == 2);
2702 CONFIGURE_STATIC_ASSERT(sizeof(u'a') == 2);
2703 CONFIGURE_STATIC_ASSERT(u'\xFFFF' > u'\x0')],
2704 ac_cv_have_usable_char16_t="yes",
2705 ac_cv_have_usable_char16_t="no")])
2706 if test "$ac_cv_have_usable_char16_t" = "yes"; then
2707 AC_DEFINE(HAVE_CPP_CHAR16_T)
2709 elif test "$GNU_CXX"; then
2710 CXXFLAGS="$_SAVE_CXXFLAGS"
2713 dnl Check for usable wchar_t (2 bytes, unsigned)
2714 dnl (we really don't need the unsignedness check anymore)
2715 dnl ========================================================
2717 AC_CACHE_CHECK(for usable wchar_t (2 bytes, unsigned),
2718 ac_cv_have_usable_wchar_v2,
2719 [AC_TRY_COMPILE([#include <stddef.h>
2720 $configure_static_assert_macros],
2721 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2722 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2723 ac_cv_have_usable_wchar_v2="yes",
2724 ac_cv_have_usable_wchar_v2="no")])
2725 if test "$ac_cv_have_usable_wchar_v2" = "yes"; then
2726 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2727 HAVE_CPP_2BYTE_WCHAR_T=1
2728 elif test "$ac_cv_have_usable_char16_t" != "yes"; then
2729 dnl This is really gcc-only
2730 dnl Do this test using CXX only since some versions of gcc
2731 dnl 2.95-2.97 have a signed wchar_t in c++ only and some versions
2732 dnl only have short-wchar support for c++.
2733 dnl Note that we assume that mac & win32 have short wchar (see nscore.h)
2735 _SAVE_CXXFLAGS=$CXXFLAGS
2736 CXXFLAGS="$CXXFLAGS -fshort-wchar"
2738 AC_CACHE_CHECK(for compiler -fshort-wchar option,
2739 ac_cv_have_usable_wchar_option_v2,
2740 [AC_TRY_LINK([#include <stddef.h>
2741 $configure_static_assert_macros],
2742 [CONFIGURE_STATIC_ASSERT(sizeof(wchar_t) == 2);
2743 CONFIGURE_STATIC_ASSERT((wchar_t)-1 > (wchar_t) 0)],
2744 ac_cv_have_usable_wchar_option_v2="yes",
2745 ac_cv_have_usable_wchar_option_v2="no")])
2747 if test "$ac_cv_have_usable_wchar_option_v2" = "yes"; then
2748 AC_DEFINE(HAVE_CPP_2BYTE_WCHAR_T)
2749 HAVE_CPP_2BYTE_WCHAR_T=1
2750 if test "$OS_TARGET" = Android; then
2751 WCHAR_CFLAGS="-fshort-wchar -Wl,--no-wchar-size-warning"
2752 CXXFLAGS="$CXXFLAGS -Wl,--no-wchar-size-warning"
2753 CFLAGS="$CFLAGS -Wl,--no-wchar-size-warning"
2754 DSO_LDOPTS="$DSO_LDOPTS -Wl,--no-wchar-size-warning"
2756 WCHAR_CFLAGS="-fshort-wchar"
2759 CXXFLAGS=$_SAVE_CXXFLAGS
2763 dnl Check for nullptr (bug 626472)
2765 AC_MSG_CHECKING(for nullptr)
2766 AC_CACHE_VAL(ac_cv_nullptr,
2768 [int* foo = nullptr;],
2769 [ac_cv_nullptr=true],
2770 [ac_cv_nullptr=false])])
2771 if test "$ac_cv_nullptr" = true ; then
2772 AC_DEFINE(HAVE_NULLPTR)
2780 dnl Check for .hidden assembler directive and visibility attribute.
2781 dnl Borrowed from glibc configure.in
2782 dnl ===============================================================
2783 if test "$GNU_CC"; then
2784 AC_CACHE_CHECK(for visibility(hidden) attribute,
2785 ac_cv_visibility_hidden,
2786 [cat > conftest.c <<EOF
2787 int foo __attribute__ ((visibility ("hidden"))) = 1;
2789 ac_cv_visibility_hidden=no
2790 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2791 if egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2792 ac_cv_visibility_hidden=yes
2797 if test "$ac_cv_visibility_hidden" = "yes"; then
2798 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
2800 AC_CACHE_CHECK(for visibility(default) attribute,
2801 ac_cv_visibility_default,
2802 [cat > conftest.c <<EOF
2803 int foo __attribute__ ((visibility ("default"))) = 1;
2805 ac_cv_visibility_default=no
2806 if ${CC-cc} -fvisibility=hidden -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2807 if ! egrep '\.(hidden|private_extern).*foo' conftest.s >/dev/null; then
2808 ac_cv_visibility_default=yes
2813 if test "$ac_cv_visibility_default" = "yes"; then
2814 AC_DEFINE(HAVE_VISIBILITY_ATTRIBUTE)
2816 AC_CACHE_CHECK(for visibility pragma support,
2817 ac_cv_visibility_pragma,
2818 [cat > conftest.c <<EOF
2819 #pragma GCC visibility push(hidden)
2821 #pragma GCC visibility push(default)
2822 int foo_default = 1;
2824 ac_cv_visibility_pragma=no
2825 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
2826 if egrep '\.(hidden|private_extern).*foo_hidden' conftest.s >/dev/null; then
2827 if ! egrep '\.(hidden|private_extern).*foo_default' conftest.s > /dev/null; then
2828 ac_cv_visibility_pragma=yes
2834 if test "$ac_cv_visibility_pragma" = "yes"; then
2835 AC_CACHE_CHECK(For gcc visibility bug with class-level attributes (GCC bug 26905),
2836 ac_cv_have_visibility_class_bug,
2837 [cat > conftest.c <<EOF
2838 #pragma GCC visibility push(hidden)
2839 struct __attribute__ ((visibility ("default"))) TestStruct {
2842 __attribute__ ((visibility ("default"))) void TestFunc() {
2846 ac_cv_have_visibility_class_bug=no
2847 if ! ${CXX-g++} ${CXXFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2848 ac_cv_have_visibility_class_bug=yes
2850 if test `egrep -c '@PLT|\\$stub' conftest.S` = 0; then
2851 ac_cv_have_visibility_class_bug=yes
2854 rm -rf conftest.{c,S}
2857 AC_CACHE_CHECK(For x86_64 gcc visibility bug with builtins (GCC bug 20297),
2858 ac_cv_have_visibility_builtin_bug,
2859 [cat > conftest.c <<EOF
2860 #pragma GCC visibility push(hidden)
2861 #pragma GCC visibility push(default)
2863 #pragma GCC visibility pop
2865 __attribute__ ((visibility ("default"))) void Func() {
2867 memset(c, 0, sizeof(c));
2870 ac_cv_have_visibility_builtin_bug=no
2871 if ! ${CC-cc} ${CFLAGS} ${DSO_PIC_CFLAGS} ${DSO_LDOPTS} -O2 -S -o conftest.S conftest.c > /dev/null 2>&1 ; then
2872 ac_cv_have_visibility_builtin_bug=yes
2874 if test `grep -c "@PLT" conftest.S` = 0; then
2875 ac_cv_visibility_builtin_bug=yes
2878 rm -f conftest.{c,S}
2880 if test "$ac_cv_have_visibility_builtin_bug" = "no" -a \
2881 "$ac_cv_have_visibility_class_bug" = "no"; then
2882 VISIBILITY_FLAGS='-I$(DIST)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
2883 WRAP_SYSTEM_INCLUDES=1
2884 STL_FLAGS='-I$(DIST)/stl_wrappers'
2887 VISIBILITY_FLAGS='-fvisibility=hidden'
2888 fi # have visibility pragma bug
2889 fi # have visibility pragma
2890 fi # have visibility(default) attribute
2891 fi # have visibility(hidden) attribute
2894 # visibility hidden flag for Sun Studio on Solaris
2895 if test "$SOLARIS_SUNPRO_CC"; then
2896 VISIBILITY_FLAGS='-xldscope=hidden'
2897 fi # Sun Studio on Solaris
2899 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2900 AC_SUBST(VISIBILITY_FLAGS)
2904 dnl Check for __force_align_arg_pointer__ for SSE2 on gcc
2905 dnl ========================================================
2906 if test "$GNU_CC"; then
2907 CFLAGS_save="${CFLAGS}"
2908 CFLAGS="${CFLAGS} -Werror"
2909 AC_CACHE_CHECK(for __force_align_arg_pointer__ attribute,
2910 ac_cv_force_align_arg_pointer,
2911 [AC_TRY_COMPILE([__attribute__ ((__force_align_arg_pointer__)) void test() {}],
2913 ac_cv_force_align_arg_pointer="yes",
2914 ac_cv_force_align_arg_pointer="no")])
2915 CFLAGS="${CFLAGS_save}"
2916 if test "$ac_cv_force_align_arg_pointer" = "yes"; then
2917 HAVE_GCC_ALIGN_ARG_POINTER=1
2919 HAVE_GCC_ALIGN_ARG_POINTER=
2922 AC_SUBST(HAVE_GCC_ALIGN_ARG_POINTER)
2924 dnl Checks for header files.
2925 dnl ========================================================
2927 case "$target_os" in
2929 # for stuff like -lXshm
2930 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
2933 MOZ_CHECK_COMMON_HEADERS
2935 dnl These are all the places some variant of statfs can be hiding.
2936 MOZ_CHECK_HEADERS(sys/statvfs.h sys/statfs.h sys/vfs.h sys/mount.h)
2939 MOZ_CHECK_HEADERS(sys/quota.h sys/sysmacros.h)
2940 MOZ_CHECK_HEADERS(linux/quota.h)
2942 dnl Try for MMX support
2943 dnl NB - later gcc versions require -mmmx for this header to be successfully
2944 dnl included (or another option which implies it, such as -march=pentium-mmx)
2945 MOZ_CHECK_HEADERS(mmintrin.h)
2947 dnl Check whether the compiler supports the new-style C++ standard
2948 dnl library headers (i.e. <new>) or needs the old "new.h"
2951 MOZ_CHECK_HEADER(new, [NEW_H=new])
2952 AC_DEFINE_UNQUOTED(NEW_H, <$NEW_H>)
2955 AC_ARG_ENABLE(dtrace,
2956 [ --enable-dtrace build with dtrace support if available (default=no)],
2957 [enable_dtrace="yes"],)
2958 if test "x$enable_dtrace" = "xyes"; then
2959 MOZ_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
2960 if test -n "$HAVE_DTRACE"; then
2961 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
2963 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
2966 AC_SUBST(HAVE_DTRACE)
2972 MOZ_CHECK_HEADERS(sys/cdefs.h)
2976 MOZ_LINUX_PERF_EVENT
2978 dnl Checks for libraries.
2979 dnl ========================================================
2984 AC_CHECK_LIB(c_r, gethostbyname_r)
2988 dnl We don't want to link with libdl even if it's present on OS X, since
2989 dnl it's not used and not part of the default installation. OS/2 has dlfcn
2991 dnl We don't want to link against libm or libpthread on Darwin since
2992 dnl they both are just symlinks to libSystem and explicitly linking
2993 dnl against libSystem causes issues when debugging (see bug 299601).
3000 AC_SEARCH_LIBS(dlopen, dl,
3001 MOZ_CHECK_HEADER(dlfcn.h,
3002 AC_DEFINE(HAVE_DLOPEN)))
3006 _SAVE_CFLAGS="$CFLAGS"
3007 CFLAGS="$CFLAGS -D_GNU_SOURCE"
3008 AC_CHECK_FUNCS(dladdr memmem)
3009 CFLAGS="$_SAVE_CFLAGS"
3011 if test ! "$GNU_CXX"; then
3015 AC_CHECK_LIB(C_r, demangle)
3018 AC_CHECK_LIB(C, demangle)
3023 dnl OS/2 has socket in libc.
3028 AC_CHECK_LIB(socket, socket)
3032 XLIBS="$X_EXTRA_LIBS"
3034 dnl ========================================================
3035 dnl Checks for X libraries.
3036 dnl Ordering is important.
3037 dnl Xt is dependent upon SM as of X11R6
3038 dnl ========================================================
3039 if test "$no_x" = "yes"; then
3042 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
3043 XLIBS="-lX11 $XLIBS"
3044 _SAVE_LDFLAGS="$LDFLAGS"
3045 LDFLAGS="$XLDFLAGS $LDFLAGS"
3046 AC_CHECK_LIB(X11, XDrawLines, [X11_LIBS="-lX11"],
3047 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
3048 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
3049 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
3051 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
3052 unset ac_cv_lib_Xt_XtFree
3053 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
3054 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
3055 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
3056 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
3059 # AIX needs the motif library linked before libXt to prevent
3060 # crashes in plugins linked against Motif - Bug #98892
3061 case "${target_os}" in
3063 XT_LIBS="-lXm $XT_LIBS"
3067 dnl ========================================================
3068 dnl = Check for XShm
3069 dnl ========================================================
3070 AC_CHECK_LIB(Xext, XShmCreateImage, _HAVE_XSHM_XEXT=1,,
3073 dnl ========================================================
3075 dnl ========================================================
3076 MOZ_CHECK_HEADER(X11/extensions/scrnsaver.h,
3077 AC_CHECK_LIB(Xss, XScreenSaverQueryInfo,
3078 [XSS_LIBS="-lXss $XEXT_LIBS $XLIBS"
3079 AC_DEFINE(HAVE_LIBXSS)],, $XEXT_LIBS $XLIBS))
3081 LDFLAGS="$_SAVE_LDFLAGS"
3091 dnl ========================================================
3092 dnl = pthread support
3093 dnl = Start by checking whether the system support pthreads
3094 dnl ========================================================
3095 case "$target_os" in
3100 MOZ_CHECK_PTHREADS(pthreads,
3101 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
3102 MOZ_CHECK_PTHREADS(pthread,
3103 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
3104 MOZ_CHECK_PTHREADS(c_r,
3105 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
3106 MOZ_CHECK_PTHREADS(c,
3115 dnl ========================================================
3116 dnl Check the command line for --with-pthreads
3117 dnl ========================================================
3118 MOZ_ARG_WITH_BOOL(pthreads,
3119 [ --with-pthreads Force use of system pthread library with NSPR ],
3120 [ if test "$USE_PTHREADS"x = x; then
3121 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
3127 dnl ========================================================
3128 dnl Do the platform specific pthread hackery
3129 dnl ========================================================
3130 if test "$USE_PTHREADS"x != x
3133 dnl See if -pthread is supported.
3136 ac_cv_have_dash_pthread=no
3137 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
3138 echo 'int main() { return 0; }' | cat > conftest.c
3139 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
3140 if test $? -eq 0; then
3141 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3142 ac_cv_have_dash_pthread=yes
3143 case "$target_os" in
3145 # Freebsd doesn't use -pthread for compiles, it uses them for linking
3148 CFLAGS="$CFLAGS -pthread"
3149 CXXFLAGS="$CXXFLAGS -pthread"
3155 AC_MSG_RESULT($ac_cv_have_dash_pthread)
3158 dnl See if -pthreads is supported.
3160 ac_cv_have_dash_pthreads=no
3161 if test "$ac_cv_have_dash_pthread" = "no"; then
3162 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
3163 echo 'int main() { return 0; }' | cat > conftest.c
3164 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
3165 if test $? -eq 0; then
3166 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
3167 ac_cv_have_dash_pthreads=yes
3168 CFLAGS="$CFLAGS -pthreads"
3169 CXXFLAGS="$CXXFLAGS -pthreads"
3173 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
3178 AC_DEFINE(_REENTRANT)
3179 AC_DEFINE(_THREAD_SAFE)
3180 dnl -pthread links in -lpthread, so don't specify it explicitly.
3181 if test "$ac_cv_have_dash_pthread" = "yes"; then
3182 _PTHREAD_LDFLAGS="-pthread"
3186 *-*-openbsd*|*-*-bsdi*)
3187 AC_DEFINE(_REENTRANT)
3188 AC_DEFINE(_THREAD_SAFE)
3189 dnl -pthread links in -lc_r, so don't specify it explicitly.
3190 if test "$ac_cv_have_dash_pthread" = "yes"; then
3191 _PTHREAD_LDFLAGS="-pthread"
3195 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
3196 AC_DEFINE(_REENTRANT)
3200 AC_DEFINE(_REENTRANT)
3204 AC_DEFINE(_REENTRANT)
3208 AC_DEFINE(_REENTRANT)
3209 if test "$SOLARIS_SUNPRO_CC"; then
3210 CFLAGS="$CFLAGS -mt"
3211 CXXFLAGS="$CXXFLAGS -mt"
3215 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
3219 dnl Checks for library functions.
3220 dnl ========================================================
3221 AC_PROG_GCC_TRADITIONAL
3223 AC_CHECK_FUNCS(random strerror lchown fchmod snprintf statvfs memmove rint stat64 lstat64 truncate64 statvfs64 setbuf isatty)
3224 AC_CHECK_FUNCS(flockfile getpagesize)
3225 AC_CHECK_FUNCS(localtime_r strtok_r)
3227 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
3228 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
3229 ac_cv_clock_monotonic,
3230 [for libs in "" -lrt; do
3233 AC_TRY_LINK([#include <time.h>],
3234 [ struct timespec ts;
3235 clock_gettime(CLOCK_MONOTONIC, &ts); ],
3236 ac_cv_clock_monotonic=$libs
3239 ac_cv_clock_monotonic=no)
3242 if test "$ac_cv_clock_monotonic" != "no"; then
3243 HAVE_CLOCK_MONOTONIC=1
3244 REALTIME_LIBS=$ac_cv_clock_monotonic
3245 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
3246 AC_SUBST(HAVE_CLOCK_MONOTONIC)
3247 AC_SUBST(REALTIME_LIBS)
3250 dnl check for wcrtomb/mbrtowc
3251 dnl =======================================================================
3252 if test -z "$MACOS_DEPLOYMENT_TARGET" || test "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
3255 AC_CACHE_CHECK(for wcrtomb,
3257 [AC_TRY_LINK([#include <wchar.h>],
3258 [mbstate_t ps={0};wcrtomb(0,'f',&ps);],
3259 ac_cv_have_wcrtomb="yes",
3260 ac_cv_have_wcrtomb="no")])
3261 if test "$ac_cv_have_wcrtomb" = "yes"; then
3262 AC_DEFINE(HAVE_WCRTOMB)
3264 AC_CACHE_CHECK(for mbrtowc,
3266 [AC_TRY_LINK([#include <wchar.h>],
3267 [mbstate_t ps={0};mbrtowc(0,0,0,&ps);],
3268 ac_cv_have_mbrtowc="yes",
3269 ac_cv_have_mbrtowc="no")])
3270 if test "$ac_cv_have_mbrtowc" = "yes"; then
3271 AC_DEFINE(HAVE_MBRTOWC)
3278 ac_cv_func_res_ninit,
3281 #define _BSD_SOURCE 1
3285 [int foo = res_ninit(&_res);],
3286 [ac_cv_func_res_ninit=yes],
3287 [ac_cv_func_res_ninit=no])
3290 if test "$ac_cv_func_res_ninit" = "yes"; then
3291 AC_DEFINE(HAVE_RES_NINIT)
3292 dnl must add the link line we do something as foolish as this... dougt
3294 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
3295 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
3300 [for gnu_get_libc_version()],
3301 ac_cv_func_gnu_get_libc_version,
3303 #ifdef HAVE_GNU_LIBC_VERSION_H
3304 #include <gnu/libc-version.h>
3307 [const char *glibc_version = gnu_get_libc_version();],
3308 [ac_cv_func_gnu_get_libc_version=yes],
3309 [ac_cv_func_gnu_get_libc_version=no]
3313 if test "$ac_cv_func_gnu_get_libc_version" = "yes"; then
3314 AC_DEFINE(HAVE_GNU_GET_LIBC_VERSION)
3318 darwin*|mingw*|os2*)
3322 AC_CHECK_LIB(c, iconv, [_ICONV_LIBS="$_ICONV_LIBS"],
3323 AC_CHECK_LIB(iconv, iconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"],
3324 AC_CHECK_LIB(iconv, libiconv, [_ICONV_LIBS="$_ICONV_LIBS -liconv"])))
3326 LIBS="$LIBS $_ICONV_LIBS"
3335 iconv_t h = iconv_open("", "");
3336 iconv(h, NULL, NULL, NULL, NULL);
3339 [ac_cv_func_iconv=yes],
3340 [ac_cv_func_iconv=no]
3343 if test "$ac_cv_func_iconv" = "yes"; then
3344 AC_DEFINE(HAVE_ICONV)
3345 DYNAMIC_XPCOM_LIBS="$DYNAMIC_XPCOM_LIBS $_ICONV_LIBS"
3346 LIBXUL_LIBS="$LIBXUL_LIBS $_ICONV_LIBS"
3347 LIBICONV="$_ICONV_LIBS"
3349 [for iconv() with const input],
3350 ac_cv_func_const_iconv,
3356 const char *input = "testing";
3357 iconv_t h = iconv_open("", "");
3358 iconv(h, &input, NULL, NULL, NULL);
3361 [ac_cv_func_const_iconv=yes],
3362 [ac_cv_func_const_iconv=no]
3365 if test "$ac_cv_func_const_iconv" = "yes"; then
3366 AC_DEFINE(HAVE_ICONV_WITH_CONST_INPUT)
3378 dnl **********************
3379 dnl *** va_copy checks ***
3380 dnl **********************
3381 dnl we currently check for all three va_copy possibilities, so we get
3382 dnl all results in config.log for bug reports.
3383 AC_MSG_CHECKING(for an implementation of va_copy())
3384 AC_CACHE_VAL(ac_cv_va_copy,[
3387 void f (int i, ...) {
3388 va_list args1, args2;
3389 va_start (args1, i);
3390 va_copy (args2, args1);
3391 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3393 va_end (args1); va_end (args2);
3395 int main() { f (0, 42); return 0; }],
3401 AC_MSG_RESULT($ac_cv_va_copy)
3402 AC_MSG_CHECKING(for an implementation of __va_copy())
3403 AC_CACHE_VAL(ac_cv___va_copy,[
3406 void f (int i, ...) {
3407 va_list args1, args2;
3408 va_start (args1, i);
3409 __va_copy (args2, args1);
3410 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
3412 va_end (args1); va_end (args2);
3414 int main() { f (0, 42); return 0; }],
3415 ac_cv___va_copy=yes,
3420 AC_MSG_RESULT($ac_cv___va_copy)
3421 AC_MSG_CHECKING(whether va_lists can be copied by value)
3422 AC_CACHE_VAL(ac_cv_va_val_copy,[
3425 void f (int i, ...) {
3426 va_list args1, args2;
3427 va_start (args1, i);
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; }],
3434 ac_cv_va_val_copy=yes,
3435 ac_cv_va_val_copy=no,
3436 ac_cv_va_val_copy=yes
3439 if test "x$ac_cv_va_copy" = "xyes"; then
3440 AC_DEFINE(VA_COPY, va_copy)
3441 AC_DEFINE(HAVE_VA_COPY)
3442 elif test "x$ac_cv___va_copy" = "xyes"; then
3443 AC_DEFINE(VA_COPY, __va_copy)
3444 AC_DEFINE(HAVE_VA_COPY)
3447 if test "x$ac_cv_va_val_copy" = "xno"; then
3448 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
3450 AC_MSG_RESULT($ac_cv_va_val_copy)
3452 dnl ===================================================================
3453 dnl ========================================================
3454 dnl Put your C++ language/feature checks below
3455 dnl ========================================================
3459 if test "$GNU_CC"; then
3460 if test "$CPU_ARCH" = "arm" ; then
3461 AC_CACHE_CHECK(for ARM EABI,
3465 #if defined(__ARM_EABI__)
3468 #error Not ARM EABI.
3471 ac_cv_gcc_arm_eabi="yes",
3472 ac_cv_gcc_arm_eabi="no")])
3473 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
3475 ARM_ABI_PREFIX=eabi-
3477 ARM_ABI_PREFIX=oabi-
3481 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
3484 dnl Check for support of modern template specialization syntax
3485 dnl Test code and requirement from scc@netscape.com.
3486 dnl Autoconf cut-and-paste job by waterson@netscape.com
3487 AC_CACHE_CHECK(for modern C++ template specialization syntax support,
3488 ac_cv_cpp_modern_specialize_template_syntax,
3489 [AC_TRY_COMPILE(template <class T> struct X { int a; };
3491 template <> struct X<Y> { double a; };,
3494 ac_cv_cpp_modern_specialize_template_syntax=yes,
3495 ac_cv_cpp_modern_specialize_template_syntax=no)])
3496 if test "$ac_cv_cpp_modern_specialize_template_syntax" = no ; then
3497 AC_MSG_ERROR([The C++ compiler does not support template specialization])
3500 dnl Some compilers support only full specialization, and some don't.
3501 AC_CACHE_CHECK(whether partial template specialization works,
3502 ac_cv_cpp_partial_specialization,
3503 [AC_TRY_COMPILE(template <class T> class Foo {};
3504 template <class T> class Foo<T*> {};,
3506 ac_cv_cpp_partial_specialization=yes,
3507 ac_cv_cpp_partial_specialization=no)])
3508 if test "$ac_cv_cpp_partial_specialization" = yes ; then
3509 AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
3512 dnl Check to see if we can resolve ambiguity with |using|.
3513 AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
3514 ac_cv_cpp_ambiguity_resolving_using,
3515 [AC_TRY_COMPILE(class X {
3516 public: int go(const X&) {return 3;}
3517 int jo(const X&) {return 3;}
3519 class Y : public X {
3520 public: int go(int) {return 2;}
3521 int jo(int) {return 2;}
3523 private: using X::go;
3526 ac_cv_cpp_ambiguity_resolving_using=yes,
3527 ac_cv_cpp_ambiguity_resolving_using=no)])
3528 if test "$ac_cv_cpp_ambiguity_resolving_using" = yes ; then
3529 AC_DEFINE(HAVE_CPP_AMBIGUITY_RESOLVING_USING)
3532 dnl See if a dynamic_cast to void* gives the most derived object.
3533 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
3534 ac_cv_cpp_dynamic_cast_void_ptr,
3535 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
3536 class Y { int j; public: virtual ~Y() { } };
3537 class Z : public X, public Y { int k; };
3543 return !((((void*)&mdo != (void*)subx) &&
3544 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
3545 (((void*)&mdo != (void*)suby) &&
3546 ((void*)&mdo == dynamic_cast<void*>(suby))));
3548 ac_cv_cpp_dynamic_cast_void_ptr=yes,
3549 ac_cv_cpp_dynamic_cast_void_ptr=no,
3550 ac_cv_cpp_dynamic_cast_void_ptr=no)])
3551 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
3552 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
3556 dnl note that this one is reversed - if the test fails, then
3557 dnl we require implementations of unused virtual methods. Which
3558 dnl really blows because it means we'll have useless vtable
3560 AC_CACHE_CHECK(whether C++ requires implementation of unused virtual methods,
3561 ac_cv_cpp_unused_required,
3562 [AC_TRY_LINK(class X {private: virtual void never_called();};,
3564 ac_cv_cpp_unused_required=no,
3565 ac_cv_cpp_unused_required=yes)])
3566 if test "$ac_cv_cpp_unused_required" = yes ; then
3567 AC_DEFINE(NEED_CPP_UNUSED_IMPLEMENTATIONS)
3571 dnl Some compilers have trouble comparing a constant reference to a templatized
3572 dnl class to zero, and require an explicit operator==() to be defined that takes
3573 dnl an int. This test separates the strong from the weak.
3575 AC_CACHE_CHECK(for trouble comparing to zero near std::operator!=(),
3576 ac_cv_trouble_comparing_to_zero,
3577 [AC_TRY_COMPILE([#include <algorithm>
3578 template <class T> class Foo {};
3580 template <class T> int operator==(const T2*, const T&) { return 0; }
3581 template <class T> int operator!=(const T2*, const T&) { return 0; }],
3582 [Foo<int> f; return (0 != f);],
3583 ac_cv_trouble_comparing_to_zero=no,
3584 ac_cv_trouble_comparing_to_zero=yes)])
3585 if test "$ac_cv_trouble_comparing_to_zero" = yes ; then
3586 AC_DEFINE(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
3589 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
3590 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
3591 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
3593 _SAVE_LDFLAGS=$LDFLAGS
3594 LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
3595 AC_CACHE_CHECK(for __thread keyword for TLS variables,
3596 ac_cv_thread_keyword,
3597 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
3598 [return tlsIsMainThread;],
3599 ac_cv_thread_keyword=yes,
3600 ac_cv_thread_keyword=no)])
3601 LDFLAGS=$_SAVE_LDFLAGS
3602 # The custom dynamic linker doesn't support TLS variables
3604 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
3605 # mips builds fail with TLS variables because of a binutils bug.
3607 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
3612 *-android*|*-linuxandroid*)
3619 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
3625 dnl Using the custom linker on ARMv6 requires 16k alignment of ELF segments.
3626 if test -n "$MOZ_LINKER"; then
3627 if test "$CPU_ARCH" = arm; then
3628 dnl Determine the target ARM architecture (5 for ARMv5, v5T, v5E, etc.; 6 for ARMv6, v6K, etc.)
3629 ARM_ARCH=`${CC-cc} ${CFLAGS} -dM -E - < /dev/null | sed -n 's/.*__ARM_ARCH_\([[0-9]]*\).*/\1/p'`
3630 dnl When building for < ARMv7, we need to ensure 16k alignment of ELF segments
3631 if test -n "$ARM_ARCH" && test "$ARM_ARCH" -lt 7; then
3632 LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=0x4000"
3633 _SUBDIR_LDFLAGS="$_SUBDIR_LDFLAGS -Wl,-z,max-page-size=0x4000"
3638 dnl The custom linker doesn't support text relocations, but NDK >= r6b
3639 dnl creates some (http://code.google.com/p/android/issues/detail?id=23203)
3640 dnl We however want to avoid these text relocations, and this can be done
3641 dnl by making gcc not link crtbegin and crtend. In the broken NDKs, crtend
3642 dnl doesn't contain anything at all, beside placeholders for some sections,
3643 dnl and crtbegin only contains a finalizer function that calls
3644 dnl __cxa_finalize. The custom linker actually takes care of calling
3645 dnl __cxa_finalize when the library doesn't call it itself, which makes it
3646 dnl safe not to link crtbegin. Besides, previous versions of the NDK didn't
3647 dnl link crtbegin and crtend at all.
3648 if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$OS_TARGET" = "Android"; then
3649 AC_CACHE_CHECK([whether the CRT objects have text relocations],
3650 ac_cv_crt_has_text_relocations,
3651 [echo 'int foo() { return 0; }' > conftest.cpp
3652 if AC_TRY_COMMAND(${CXX-g++} -o conftest${DLL_SUFFIX} $CXXFLAGS $DSO_LDOPTS $LDFLAGS conftest.cpp $LIBS 1>&5) &&
3653 test -s conftest${DLL_SUFFIX}; then
3654 if ${TOOLCHAIN_PREFIX}readelf -d conftest${DLL_SUFFIX} | grep TEXTREL > /dev/null; then
3655 ac_cv_crt_has_text_relocations=yes
3657 ac_cv_crt_has_text_relocations=no
3660 AC_ERROR([couldn't compile a simple C file])
3663 if test "$ac_cv_crt_has_text_relocations" = yes; then
3664 dnl While we want libraries to skip the CRT files, we don't want
3665 dnl executables to be treated the same way. We thus set the flag
3666 dnl in DSO_LDOPTS and not LDFLAGS. However, to pass it to nspr,
3667 dnl we need to use LDFLAGS because nspr doesn't inherit DSO_LDOPTS.
3668 dnl Using LDFLAGS in nspr is safe, since we only really build
3669 dnl libraries there.
3670 DSO_LDOPTS="$DSO_LDOPTS -nostartfiles"
3671 NSPR_LDFLAGS=-nostartfiles
3675 dnl Check for the existence of various allocation headers/functions
3678 MOZ_CHECK_HEADER(malloc.h, [MALLOC_H=malloc.h])
3679 if test "$MALLOC_H" = ""; then
3680 MOZ_CHECK_HEADER(malloc/malloc.h, [MALLOC_H=malloc/malloc.h])
3681 if test "$MALLOC_H" = ""; then
3682 MOZ_CHECK_HEADER(sys/malloc.h, [MALLOC_H=sys/malloc.h])
3685 if test "$MALLOC_H" != ""; then
3686 AC_DEFINE_UNQUOTED(MALLOC_H, <$MALLOC_H>)
3689 MOZ_ALLOCATING_FUNCS="strndup posix_memalign memalign valloc"
3690 AC_CHECK_FUNCS(strndup posix_memalign memalign valloc)
3692 dnl See if compiler supports some gcc-style attributes
3694 AC_CACHE_CHECK(for __attribute__((always_inline)),
3695 ac_cv_attribute_always_inline,
3696 [AC_TRY_COMPILE([inline void f(void) __attribute__((always_inline));],
3698 ac_cv_attribute_always_inline=yes,
3699 ac_cv_attribute_always_inline=no)])
3701 AC_CACHE_CHECK(for __attribute__((malloc)),
3702 ac_cv_attribute_malloc,
3703 [AC_TRY_COMPILE([void* f(int) __attribute__((malloc));],
3705 ac_cv_attribute_malloc=yes,
3706 ac_cv_attribute_malloc=no)])
3708 AC_CACHE_CHECK(for __attribute__((warn_unused_result)),
3709 ac_cv_attribute_warn_unused,
3710 [AC_TRY_COMPILE([int f(void) __attribute__((warn_unused_result));],
3712 ac_cv_attribute_warn_unused=yes,
3713 ac_cv_attribute_warn_unused=no)])
3715 dnl End of C++ language/feature checks
3718 dnl ========================================================
3719 dnl = Internationalization checks
3720 dnl ========================================================
3722 dnl Internationalization and Locale support is different
3723 dnl on various UNIX platforms. Checks for specific i18n
3724 dnl features go here.
3726 dnl check for LC_MESSAGES
3727 AC_CACHE_CHECK(for LC_MESSAGES,
3728 ac_cv_i18n_lc_messages,
3729 [AC_TRY_COMPILE([#include <locale.h>],
3730 [int category = LC_MESSAGES;],
3731 ac_cv_i18n_lc_messages=yes,
3732 ac_cv_i18n_lc_messages=no)])
3733 if test "$ac_cv_i18n_lc_messages" = yes; then
3734 AC_DEFINE(HAVE_I18N_LC_MESSAGES)
3737 AC_HAVE_FUNCS(localeconv)
3738 fi # ! SKIP_COMPILER_CHECKS
3741 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
3742 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
3745 dnl Mozilla specific options
3746 dnl ========================================================
3747 dnl The macros used for command line options
3748 dnl are defined in build/autoconf/altoptions.m4.
3750 dnl If the compiler supports these attributes, define them as
3751 dnl convenience macros.
3752 if test "$ac_cv_attribute_always_inline" = yes ; then
3753 AC_DEFINE(NS_ALWAYS_INLINE, [__attribute__((always_inline))])
3755 AC_DEFINE(NS_ALWAYS_INLINE,)
3758 if test "$ac_cv_attribute_malloc" = yes ; then
3759 AC_DEFINE(NS_ATTR_MALLOC, [__attribute__((malloc))])
3761 AC_DEFINE(NS_ATTR_MALLOC,)
3764 if test "$ac_cv_attribute_warn_unused" = yes ; then
3765 AC_DEFINE(NS_WARN_UNUSED_RESULT, [__attribute__((warn_unused_result))])
3767 AC_DEFINE(NS_WARN_UNUSED_RESULT,)
3770 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
3771 dnl features that Windows actually does support.
3773 if test -n "$SKIP_COMPILER_CHECKS"; then
3774 dnl Windows has malloc.h
3775 AC_DEFINE(MALLOC_H, [<malloc.h>])
3776 AC_DEFINE(HAVE_FORCEINLINE)
3777 AC_DEFINE(HAVE_LOCALECONV)
3778 fi # SKIP_COMPILER_CHECKS
3780 dnl ========================================================
3782 dnl = Check for external package dependencies
3784 dnl ========================================================
3785 MOZ_ARG_HEADER(External Packages)
3787 MOZ_ARG_WITH_STRING(libxul-sdk,
3788 [ --with-libxul-sdk=PFX Use the libXUL SDK at <PFX>],
3789 LIBXUL_SDK_DIR=$withval)
3791 if test "$LIBXUL_SDK_DIR" = "yes"; then
3792 AC_MSG_ERROR([--with-libxul-sdk must specify a path])
3793 elif test -n "$LIBXUL_SDK_DIR" -a "$LIBXUL_SDK_DIR" != "no"; then
3794 LIBXUL_SDK=`cd "$LIBXUL_SDK_DIR" && pwd`
3796 if test ! -f "$LIBXUL_SDK/include/xpcom-config.h"; then
3797 AC_MSG_ERROR([$LIBXUL_SDK/include/xpcom-config.h doesn't exist])
3801 AC_SUBST(LIBXUL_SDK)
3803 if test -n "$LIBXUL_SDK"; then
3804 LIBXUL_DIST="$LIBXUL_SDK"
3806 LIBXUL_DIST="$MOZ_BUILD_ROOT/dist"
3808 AC_SUBST(LIBXUL_DIST)
3812 MOZ_ARG_WITH_BOOL(system-libxul,
3813 [ --with-system-libxul Use system installed libxul SDK],
3816 dnl ========================================================
3817 dnl = If NSPR was not detected in the system,
3818 dnl = use the one in the source tree (mozilla/nsprpub)
3819 dnl ========================================================
3820 MOZ_ARG_WITH_BOOL(system-nspr,
3821 [ --with-system-nspr Use system installed NSPR],
3822 _USE_SYSTEM_NSPR=1 )
3824 if test -n "$_USE_SYSTEM_NSPR"; then
3825 AM_PATH_NSPR(4.9.0, [MOZ_NATIVE_NSPR=1], [AC_MSG_ERROR([your don't have NSPR installed or your version is too old])])
3828 if test -n "$MOZ_NATIVE_NSPR"; then
3829 _SAVE_CFLAGS=$CFLAGS
3830 CFLAGS="$CFLAGS $NSPR_CFLAGS"
3831 AC_TRY_COMPILE([#include "prtypes.h"],
3832 [#ifndef PR_STATIC_ASSERT
3833 #error PR_STATIC_ASSERT not defined or requires including prtypes.h
3835 [MOZ_NATIVE_NSPR=1],
3836 AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT or including prtypes.h does not provide it]))
3837 AC_TRY_COMPILE([#include "prtypes.h"],
3839 #error PR_UINT64 not defined or requires including prtypes.h
3841 [MOZ_NATIVE_NSPR=1],
3842 AC_MSG_ERROR([system NSPR does not support PR_UINT64 or including prtypes.h does not provide it]))
3843 CFLAGS=$_SAVE_CFLAGS
3845 if test -z "$LIBXUL_SDK"; then
3846 NSPR_CFLAGS="-I${LIBXUL_DIST}/include/nspr"
3847 if test -n "$GNU_CC"; then
3848 NSPR_LIBS="-L${LIBXUL_DIST}/lib -lnspr${NSPR_VERSION} -lplc${NSPR_VERSION} -lplds${NSPR_VERSION}"
3850 NSPR_LIBS="${LIBXUL_DIST}/lib/nspr${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plc${NSPR_VERSION}.lib ${LIBXUL_DIST}/lib/plds${NSPR_VERSION}.lib "
3853 NSPR_CFLAGS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --includedir="${LIBXUL_DIST}/include/nspr" --cflags`
3854 NSPR_LIBS=`"${LIBXUL_DIST}"/sdk/bin/nspr-config --prefix="${LIBXUL_DIST}" --libdir="${LIBXUL_DIST}"/lib --libs`
3858 dnl system libevent Support
3859 dnl ========================================================
3860 MOZ_ARG_WITH_STRING(system-libevent,
3861 [ --with-system-libevent=[PFX]
3862 Use system libevent [installed at prefix PFX]],
3863 LIBEVENT_DIR=$withval)
3865 _SAVE_CFLAGS=$CFLAGS
3866 _SAVE_LDFLAGS=$LDFLAGS
3868 if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
3869 MOZ_NATIVE_LIBEVENT=
3871 if test "${LIBEVENT_DIR}" = "yes"; then
3874 CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
3875 LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
3876 MOZ_CHECK_HEADER(event.h,
3877 [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
3878 AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
3880 AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
3881 AC_CHECK_LIB(event, event_init,
3882 [MOZ_NATIVE_LIBEVENT=1
3883 MOZ_LIBEVENT_INCLUDES="${LIBEVENT_DIR}/include"
3884 MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
3885 [MOZ_NATIVE_LIBEVENT= MOZ_LIBEVENT_INCLUDES= MOZ_LIBEVENT_LIBS=])
3887 CFLAGS=$_SAVE_CFLAGS
3888 LDFLAGS=$_SAVE_LDFLAGS
3891 AC_SUBST(MOZ_NATIVE_LIBEVENT)
3892 AC_SUBST(MOZ_LIBEVENT_INCLUDES)
3893 AC_SUBST(MOZ_LIBEVENT_LIBS)
3895 dnl ========================================================
3896 dnl = If NSS was not detected in the system,
3897 dnl = use the one in the source tree (mozilla/security/nss)
3898 dnl ========================================================
3900 MOZ_ARG_WITH_BOOL(system-nss,
3901 [ --with-system-nss Use system installed NSS],
3904 if test -n "$_USE_SYSTEM_NSS"; then
3905 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])])
3908 if test -n "$MOZ_NATIVE_NSS"; then
3909 NSS_LIBS="$NSS_LIBS -lcrmf"
3911 NSS_CFLAGS='-I$(LIBXUL_DIST)/include/nss'
3913 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
3914 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)smime$NSS_VERSION\$(DLL_SUFFIX) \
3915 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)ssl$NSS_VERSION\$(DLL_SUFFIX) \
3916 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nss$NSS_VERSION\$(DLL_SUFFIX) \
3917 \$(LIBXUL_DIST)/lib/\$(DLL_PREFIX)nssutil$NSS_VERSION\$(DLL_SUFFIX)"
3919 if test -z "$GNU_CC" -a "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2"; then
3921 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)crmf.\$(LIB_SUFFIX) \
3922 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)smime$NSS_VERSION.\$(LIB_SUFFIX) \
3923 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)ssl$NSS_VERSION.\$(LIB_SUFFIX) \
3924 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nss$NSS_VERSION.\$(LIB_SUFFIX) \
3925 \$(LIBXUL_DIST)/lib/\$(LIB_PREFIX)nssutil$NSS_VERSION.\$(LIB_SUFFIX)"
3927 NSS_LIBS='$(LIBS_DIR)'" -lcrmf -lsmime$NSS_VERSION -lssl$NSS_VERSION -lnss$NSS_VERSION -lnssutil$NSS_VERSION"
3931 dnl ======================
3933 dnl ======================
3935 AC_MSG_CHECKING([for YASM assembler])
3936 AC_CHECK_PROGS(YASM, yasm, "")
3938 if test -n "$YASM"; then
3939 dnl Pull out yasm's version string
3941 _YASM_VER_FILTER='s|.* \([0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\).*|\1|p'
3944 YASM_VERSION=`yasm --version | sed -ne "$_YASM_VER_FILTER"`
3945 _YASM_MAJOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $1 }'`
3946 _YASM_MINOR_VERSION=`echo ${YASM_VERSION} | $AWK -F\. '{ print $2 }'`
3947 _YASM_RELEASE=` echo ${YASM_VERSION} | $AWK -F\. '{ print $3 }'`
3948 _YASM_BUILD=` echo ${YASM_VERSION} | $AWK -F\. '{ print $4 }'`
3951 if test -z "$SKIP_LIBRARY_CHECKS"; then
3952 dnl system JPEG support
3953 dnl ========================================================
3954 MOZ_ARG_WITH_STRING(system-jpeg,
3955 [ --with-system-jpeg[=PFX]
3956 Use system libjpeg [installed at prefix PFX]],
3959 _SAVE_CFLAGS=$CFLAGS
3960 _SAVE_LDFLAGS=$LDFLAGS
3962 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
3963 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
3964 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
3966 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
3969 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [MOZ_NATIVE_JPEG=1 MOZ_JPEG_LIBS="-ljpeg"], MOZ_NATIVE_JPEG=)
3972 if test "$MOZ_NATIVE_JPEG" = 1; then
3973 AC_TRY_COMPILE([ #include <stdio.h>
3974 #include <sys/types.h>
3975 #include <jpeglib.h> ],
3976 [ #if JPEG_LIB_VERSION < $MOZJPEG
3977 #error "Insufficient JPEG library version ($MOZJPEG required)."
3980 AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
3982 CFLAGS=$_SAVE_CFLAGS
3983 LDFLAGS=$_SAVE_LDFLAGS
3986 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$MOZ_NATIVE_JPEG" = 1; then
3987 MOZ_JPEG_CFLAGS="-I${JPEG_DIR}/include"
3988 MOZ_JPEG_LIBS="-L${JPEG_DIR}/lib ${MOZ_JPEG_LIBS}"
3990 fi # SKIP_LIBRARY_CHECKS
3992 dnl system ZLIB support
3993 dnl ========================================================
3994 MOZ_ZLIB_CHECK([1.2.3])
3996 if test "$MOZ_NATIVE_ZLIB" != 1; then
3998 MOZ_ZLIB_LIBS='$(call EXPAND_LIBNAME_PATH,mozz,'"$MOZ_BUILD_ROOT"'/modules/zlib/src)'
4001 if test "$MOZ_LINKER" = 1 -a "$MOZ_NATIVE_ZLIB" != 1; then
4002 AC_MSG_ERROR([Custom dynamic linker requires --with-system-zlib])
4005 if test -z "$SKIP_LIBRARY_CHECKS"; then
4006 dnl system BZIP2 Support
4007 dnl ========================================================
4008 MOZ_ARG_WITH_STRING(system-bz2,
4009 [ --with-system-bz2[=PFX]
4010 Use system libbz2 [installed at prefix PFX]],
4013 _SAVE_CFLAGS=$CFLAGS
4014 _SAVE_LDFLAGS=$LDFLAGS
4016 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
4017 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
4018 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
4020 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
4023 AC_CHECK_LIB(bz2, BZ2_bzread, [MOZ_NATIVE_BZ2=1 MOZ_BZ2_LIBS="-lbz2"],
4024 [MOZ_NATIVE_BZ2= MOZ_BZ2_CFLAGS= MOZ_BZ2_LIBS=])
4026 CFLAGS=$_SAVE_CFLAGS
4027 LDFLAGS=$_SAVE_LDFLAGS
4030 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$MOZ_NATIVE_BZ2" = 1; then
4031 MOZ_BZ2_CFLAGS="-I${BZ2_DIR}/include"
4032 MOZ_BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
4035 dnl system PNG Support
4036 dnl ========================================================
4037 MOZ_ARG_WITH_STRING(system-png,
4038 [ --with-system-png[=PFX]
4039 Use system libpng [installed at prefix PFX]],
4042 _SAVE_CFLAGS=$CFLAGS
4043 _SAVE_LDFLAGS=$LDFLAGS
4045 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
4046 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
4047 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
4049 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
4052 AC_CHECK_LIB(png, png_get_valid, [MOZ_NATIVE_PNG=1 MOZ_PNG_LIBS="-lpng"],
4053 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4054 AC_CHECK_LIB(png, png_get_acTL, ,
4055 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]))
4057 if test "$MOZ_NATIVE_PNG" = 1; then
4058 AC_TRY_COMPILE([ #include <stdio.h>
4059 #include <sys/types.h>
4061 [ #if PNG_LIBPNG_VER < $MOZPNG
4062 #error "Insufficient libpng version ($MOZPNG required)."
4064 #ifndef PNG_UINT_31_MAX
4065 #error "Insufficient libpng version."
4068 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
4070 CFLAGS=$_SAVE_CFLAGS
4071 LDFLAGS=$_SAVE_LDFLAGS
4074 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_NATIVE_PNG" = 1; then
4075 MOZ_PNG_CFLAGS="-I${PNG_DIR}/include"
4076 MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}"
4079 fi # SKIP_LIBRARY_CHECKS
4081 dnl system HunSpell Support
4082 dnl ========================================================
4083 MOZ_ARG_ENABLE_BOOL(system-hunspell,
4084 [ --enable-system-hunspell
4085 Use system hunspell (located with pkgconfig)],
4086 MOZ_NATIVE_HUNSPELL=1 )
4088 if test -n "$MOZ_NATIVE_HUNSPELL"; then
4089 PKG_CHECK_MODULES(MOZ_HUNSPELL, hunspell)
4092 AC_SUBST(MOZ_NATIVE_HUNSPELL)
4094 dnl ========================================================
4095 dnl system libffi Support
4096 dnl ========================================================
4097 MOZ_ARG_ENABLE_BOOL(system-ffi,
4098 [ --enable-system-ffi Use system libffi (located with pkgconfig)],
4101 if test -n "$MOZ_NATIVE_FFI"; then
4102 # Vanilla libffi 3.0.9 needs a few patches from upcoming version 3.0.10
4103 # for non-GCC compilers.
4104 if test -z "$GNU_CC"; then
4105 PKG_CHECK_MODULES(MOZ_FFI, libffi > 3.0.9)
4107 PKG_CHECK_MODULES(MOZ_FFI, libffi >= 3.0.9)
4109 MOZ_JS_STATIC_LIBS="$MOZ_JS_STATIC_LIBS $MOZ_FFI_LIBS"
4112 dnl ========================================================
4113 dnl Java SDK support
4114 dnl ========================================================
4117 MOZ_ARG_WITH_STRING(java-bin-path,
4118 [ --with-java-bin-path=dir
4119 Location of Java binaries (java, javac, jar)],
4120 JAVA_BIN_PATH=$withval)
4122 dnl ========================================================
4126 dnl ========================================================
4128 MOZ_ARG_HEADER(Application)
4131 ENABLE_SYSTEM_EXTENSION_DIRS=1
4132 MOZ_BRANDING_DIRECTORY=
4133 MOZ_OFFICIAL_BRANDING=
4138 MOZ_AUTH_EXTENSION=1
4142 MOZ_SPEEX_RESAMPLER=1
4151 MOZ_WEBRTC_SIGNALING=
4153 MOZ_MEDIA_NAVIGATOR=
4156 MOZ_VP8_ERROR_CONCEALMENT=
4166 LIBJPEG_TURBO_ASFLAGS=
4167 LIBJPEG_TURBO_X86_ASM=
4168 LIBJPEG_TURBO_X64_ASM=
4169 LIBJPEG_TURBO_ARM_ASM=
4173 MOZ_PREF_EXTENSIONS=1
4174 MOZ_PROFILELOCKING=1
4180 MOZ_JAVA_COMPOSITOR=
4181 MOZ_ONLY_TOUCH_EVENTS=
4182 MOZ_TOOLKIT_SEARCH=1
4184 MOZ_UNIVERSALCHARDET=1
4191 MOZ_DISABLE_DOMCRYPTO=
4195 NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
4198 MOZ_USE_NATIVE_POPUP_WINDOWS=
4199 MOZ_ANDROID_HISTORY=
4205 case "$target_os" in
4208 AC_DEFINE(NS_ENABLE_TSF)
4213 *-android*|*-linuxandroid*)
4214 if test "$CPU_ARCH" = "arm" ; then
4220 MOZ_THEME_FASTSTRIPE=1
4228 MOZ_ARG_ENABLE_STRING(application,
4229 [ --enable-application=APP
4233 tools/update-packaging (AUS-related packaging tools)],
4234 [ MOZ_BUILD_APP=$enableval ] )
4236 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4237 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4238 XULRUNNER_STUB_NAME=$withval)
4240 if test -z "$XULRUNNER_STUB_NAME"; then
4241 case "$target_os" in
4243 XULRUNNER_STUB_NAME=xulrunner
4246 XULRUNNER_STUB_NAME=xulrunner-stub
4249 AC_SUBST(XULRUNNER_STUB_NAME)
4251 AC_MSG_CHECKING([for application to build])
4252 if test -z "$MOZ_BUILD_APP"; then
4253 AC_MSG_RESULT([browser])
4254 MOZ_BUILD_APP=browser
4256 # default mobile to be mobile/xul
4257 if test "$MOZ_BUILD_APP" = "mobile" ; then
4258 MOZ_BUILD_APP=mobile/xul
4260 # We have a valid application only if it has a build.mk file in its top
4262 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4263 AC_MSG_RESULT([none])
4264 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4266 AC_MSG_RESULT([$MOZ_BUILD_APP])
4270 # Allow the application to influence configure with a confvars.sh script.
4272 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4273 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4274 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4275 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4280 # Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
4281 MOZ_ARG_WITH_STRING(app-name,
4282 [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
4283 WITH_APP_NAME=$withval,
4286 if test -n "$WITH_APP_NAME" ; then
4287 MOZ_APP_NAME="$WITH_APP_NAME"
4290 MOZ_ARG_WITH_STRING(app-basename,
4291 [--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
4292 WITH_APP_BASENAME=$withval,
4295 if test -n "$WITH_APP_BASENAME" ; then
4296 MOZ_APP_BASENAME="$WITH_APP_BASENAME"
4299 # Now is a good time to test for logic errors, define mismatches, etc.
4300 case "$MOZ_BUILD_APP" in
4302 if test "$LIBXUL_SDK"; then
4303 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4308 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4309 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4311 case "$MOZ_BUILD_APP" in
4313 AC_DEFINE(MOZ_PHOENIX)
4317 AC_DEFINE(MOZ_XULRUNNER)
4321 AC_SUBST(MOZ_BUILD_APP)
4322 AC_SUBST(MOZ_PHOENIX)
4323 AC_SUBST(MOZ_XULRUNNER)
4325 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4327 dnl ========================================================
4328 dnl Check android sdk version depending on mobile target
4329 dnl ========================================================
4331 if test -z "$gonkdir" ; then
4332 # Minimum Android SDK API Level we require.
4333 case "$MOZ_BUILD_APP" in
4335 android_min_api_level=13
4338 android_min_api_level=14
4342 MOZ_ANDROID_SDK($android_min_api_level)
4345 dnl ========================================================
4347 dnl = Toolkit Options
4349 dnl ========================================================
4350 MOZ_ARG_HEADER(Toolkit Options)
4352 dnl ========================================================
4353 dnl = Select the default toolkit
4354 dnl ========================================================
4355 MOZ_ARG_ENABLE_STRING(default-toolkit,
4356 [ --enable-default-toolkit=TK
4357 Select default toolkit
4358 Platform specific defaults:
4359 Mac OS X - cairo-cocoa
4361 Win32 - cairo-windows
4364 [ _DEFAULT_TOOLKIT=$enableval ],
4365 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4367 if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4368 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4369 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4370 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4371 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4372 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
4373 -o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \
4374 -o "$_DEFAULT_TOOLKIT" = "cairo-android" \
4375 -o "$_DEFAULT_TOOLKIT" = "cairo-gonk"
4377 dnl nglayout only supports building with one toolkit,
4378 dnl so ignore everything after the first comma (",").
4379 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4381 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4384 MOZ_ARG_WITHOUT_BOOL(x,
4385 [ --without-x Build without X11],
4388 dnl ========================================================
4389 dnl = Enable the toolkit as needed =
4390 dnl ========================================================
4392 case "$MOZ_WIDGET_TOOLKIT" in
4395 MOZ_WIDGET_TOOLKIT=windows
4398 MOZ_INSTRUMENT_EVENT_LOOP=1
4401 cairo-gtk2|cairo-gtk2-x11)
4402 MOZ_WIDGET_TOOLKIT=gtk2
4404 MOZ_ENABLE_XREMOTE=1
4406 MOZ_GL_DEFAULT_PROVIDER=GLX
4412 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4413 TK_LIBS='$(MOZ_GTK2_LIBS)'
4414 AC_DEFINE(MOZ_WIDGET_GTK2)
4415 AC_DEFINE(MOZ_WIDGET_GTK,2)
4417 MOZ_INSTRUMENT_EVENT_LOOP=1
4421 MOZ_WIDGET_TOOLKIT=qt
4423 if test -z "$WITHOUT_X11"; then
4424 MOZ_ENABLE_XREMOTE=1
4425 MOZ_GL_DEFAULT_PROVIDER=GLX
4434 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4435 TK_LIBS='$(MOZ_QT_LIBS)'
4436 AC_DEFINE(MOZ_WIDGET_QT)
4441 MOZ_WIDGET_TOOLKIT=os2
4443 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4444 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4449 MOZ_WIDGET_TOOLKIT=cocoa
4450 AC_DEFINE(MOZ_WIDGET_COCOA)
4451 LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
4452 TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
4453 TK_CFLAGS="-DNO_X11"
4454 CFLAGS="$CFLAGS $TK_CFLAGS"
4455 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4456 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
4457 MOZ_USER_DIR="Mozilla"
4458 MOZ_FS_LAYOUT=bundle
4460 MOZ_INSTRUMENT_EVENT_LOOP=1
4464 MOZ_WIDGET_TOOLKIT=uikit
4465 AC_DEFINE(MOZ_WIDGET_UIKIT)
4466 LDFLAGS="$LDFLAGS -framework UIKit -lobjc"
4467 TK_CFLAGS="-DNO_X11"
4468 TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
4469 CFLAGS="$CFLAGS $TK_CFLAGS"
4470 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4471 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
4472 MOZ_USER_DIR="Mozilla"
4473 MOZ_FS_LAYOUT=bundle
4477 AC_DEFINE(MOZ_WIDGET_ANDROID)
4478 MOZ_WIDGET_TOOLKIT=android
4479 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4480 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4483 MOZ_INSTRUMENT_EVENT_LOOP=1
4484 if test "$MOZ_BUILD_APP" = "mobile/xul"; then
4490 AC_DEFINE(MOZ_WIDGET_GONK)
4491 AC_DEFINE(MOZ_TOUCH)
4492 MOZ_WIDGET_TOOLKIT=gonk
4493 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4494 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4502 AC_SUBST(MOZ_OLD_LINKER)
4503 AC_SUBST(MOZ_PDF_PRINTING)
4504 if test "$MOZ_PDF_PRINTING"; then
4505 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
4506 AC_DEFINE(MOZ_PDF_PRINTING)
4509 if test "$MOZ_ENABLE_XREMOTE"; then
4510 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4513 if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then
4514 AC_DEFINE(MOZ_INSTRUMENT_EVENT_LOOP)
4517 if test "$COMPILE_ENVIRONMENT"; then
4518 if test "$MOZ_ENABLE_GTK2"; then
4519 if test "$MOZ_X11"; then
4520 GDK_PACKAGES=gdk-x11-2.0
4523 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4526 fi # COMPILE_ENVIRONMENT
4528 AC_SUBST(MOZ_FS_LAYOUT)
4530 dnl ========================================================
4531 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4532 dnl their usage and use them in spidermonkey.
4533 dnl ========================================================
4534 MOZ_ARG_WITH_BOOL(arm-kuser,
4535 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4537 if test -n "$USE_ARM_KUSER"; then
4538 AC_DEFINE(USE_ARM_KUSER)
4541 dnl ========================================================
4542 dnl = startup-notification support module
4543 dnl ========================================================
4545 if test "$MOZ_ENABLE_GTK2"
4547 MOZ_ENABLE_STARTUP_NOTIFICATION=
4549 MOZ_ARG_ENABLE_BOOL(startup-notification,
4550 [ --enable-startup-notification
4551 Enable startup-notification support (default: disabled) ],
4552 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4553 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4554 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4556 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4557 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4558 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4559 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4561 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4563 MOZ_ENABLE_STARTUP_NOTIFICATION=
4567 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4568 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4571 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4573 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4574 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4575 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4577 dnl ========================================================
4579 dnl ========================================================
4580 if test "$MOZ_ENABLE_QT"
4582 MOZ_ARG_WITH_STRING(qtdir,
4583 [ --with-qtdir=\$dir Specify Qt directory ],
4586 if test -z "$QTDIR"; then
4587 PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore QtOpenGL)
4588 PKG_CHECK_MODULES(MOZ_QT5, QtWidgets QtMultimedia QtPrintSupport,
4591 if test "$MOZ_ENABLE_QT5"; then
4593 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $MOZ_QT5_CFLAGS"
4594 MOZ_QT_LIBS="$MOZ_QT_LIBS $MOZ_QT5_LIBS"
4597 AC_CHECK_PROGS(HOST_MOC, $MOC moc, "")
4598 AC_CHECK_PROGS(HOST_RCC, $RCC rcc, "")
4600 MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtXml -lQtOpenGL"
4602 MOZ_QT_CFLAGS="-DQT_SHARED"
4603 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
4604 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt"
4605 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
4606 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
4607 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
4608 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
4609 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDeclarative"
4610 HOST_MOC="$QTDIR/bin/moc"
4611 HOST_RCC="$QTDIR/bin/rcc"
4613 # QtWidgets was introduced only in Qt5
4614 if test -d $QTDIR/include/QtWidgets; then
4615 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtWidgets"
4616 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtPrintSupport"
4617 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtWidgets -lQtPrintSupport"
4620 if test -z "$HOST_MOC"; then
4621 AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is
4624 if test -z "$HOST_RCC"; then
4625 AC_MSG_ERROR([No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is
4632 MOZ_ENABLE_QMSYSTEM2=
4633 PKG_CHECK_MODULES(_QMSYSTEM2, qmsystem2,
4634 MOZ_ENABLE_QMSYSTEM2=1,
4635 MOZ_ENABLE_QMSYSTEM2=)
4637 if test "$MOZ_ENABLE_QMSYSTEM2"; then
4638 MOZ_ENABLE_QMSYSTEM2=1
4639 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QMSYSTEM2_CFLAGS"
4640 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QMSYSTEM2_LIBS"
4641 AC_DEFINE(MOZ_ENABLE_QMSYSTEM2)
4644 MOZ_ENABLE_QTNETWORK=
4645 PKG_CHECK_MODULES(_QTNETWORK, QtNetwork >= 4.7,
4646 MOZ_ENABLE_QTNETWORK=1,
4647 MOZ_ENABLE_QTNETWORK=)
4649 if test "$MOZ_ENABLE_QTNETWORK"; then
4650 MOZ_ENABLE_QTNETWORK=1
4651 AC_DEFINE(MOZ_ENABLE_QTNETWORK)
4654 MOZ_ENABLE_QTMOBILITY=
4655 PKG_CHECK_MODULES(_QTMOBILITY, QtSensors QtFeedback QtLocation,
4656 MOZ_ENABLE_QTMOBILITY=1,
4657 MOZ_ENABLE_QTMOBILITY=)
4658 if test "$MOZ_ENABLE_QTMOBILITY"; then
4659 MOZ_ENABLE_QTMOBILITY=1
4660 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
4661 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
4663 AC_CHECK_LIB(QtSensors, main, [
4664 MOZ_ENABLE_QTMOBILITY=1
4665 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtMobility"
4666 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtSensors"
4667 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtFeedback"
4668 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtLocation"
4669 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback -lQtLocation"
4672 if test "$MOZ_ENABLE_QTMOBILITY"; then
4673 AC_DEFINE(MOZ_ENABLE_QTMOBILITY)
4677 AC_SUBST(GTK_CONFIG)
4681 AC_SUBST(MOZ_ENABLE_GTK2)
4682 AC_SUBST(MOZ_ENABLE_QT)
4683 AC_SUBST(MOZ_ENABLE_QTNETWORK)
4684 AC_SUBST(MOZ_ENABLE_QMSYSTEM2)
4685 AC_SUBST(MOZ_ENABLE_QTMOBILITY)
4686 AC_SUBST(MOZ_ENABLE_XREMOTE)
4687 AC_SUBST(MOZ_GTK2_CFLAGS)
4688 AC_SUBST(MOZ_GTK2_LIBS)
4689 AC_SUBST(MOZ_QT_CFLAGS)
4690 AC_SUBST(MOZ_QT_LIBS)
4697 dnl ========================================================
4699 dnl = Components & Features
4701 dnl ========================================================
4702 MOZ_ARG_HEADER(Components and Features)
4704 dnl ========================================================
4706 dnl ========================================================
4707 MOZ_ARG_ENABLE_STRING(ui-locale,
4708 [ --enable-ui-locale=ab-CD
4709 Select the user interface locale (default: en-US)],
4710 MOZ_UI_LOCALE=$enableval )
4711 AC_SUBST(MOZ_UI_LOCALE)
4713 dnl ========================================================
4714 dnl = Trademarked Branding
4715 dnl ========================================================
4716 MOZ_ARG_ENABLE_BOOL(official-branding,
4717 [ --enable-official-branding
4718 Enable Official mozilla.org Branding
4719 Do not distribute builds with
4720 --enable-official-branding unless you have
4721 permission to use trademarks per
4722 http://www.mozilla.org/foundation/trademarks/ .],
4724 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
4725 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
4727 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
4728 MOZ_OFFICIAL_BRANDING=1
4730 ], MOZ_OFFICIAL_BRANDING=)
4732 AC_SUBST(MOZ_OFFICIAL_BRANDING)
4733 if test -n "$MOZ_OFFICIAL_BRANDING"; then
4734 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
4737 MOZ_ARG_WITH_STRING(branding,
4738 [ --with-branding=dir Use branding from the specified directory.],
4739 MOZ_BRANDING_DIRECTORY=$withval)
4741 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4742 if test -z "$REAL_BRANDING_DIRECTORY"; then
4743 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4746 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4747 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
4750 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4752 dnl ========================================================
4753 dnl = Distribution ID
4754 dnl ========================================================
4755 MOZ_ARG_WITH_STRING(distribution-id,
4756 [ --with-distribution-id=ID
4757 Set distribution-specific id (default=org.mozilla)],
4758 [ val=`echo $withval`
4759 MOZ_DISTRIBUTION_ID="$val"])
4761 if test -z "$MOZ_DISTRIBUTION_ID"; then
4762 MOZ_DISTRIBUTION_ID="org.mozilla"
4765 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4766 AC_SUBST(MOZ_DISTRIBUTION_ID)
4769 dnl ========================================================
4770 dnl complex text support off by default
4771 dnl ========================================================
4772 MOZ_ARG_DISABLE_BOOL(pango,
4773 [ --disable-pango Disable usage of Pango ],
4777 dnl ========================================================
4779 dnl ========================================================
4780 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
4784 if test "$MOZ_PANGO"
4786 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
4788 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION)
4789 AC_SUBST(MOZ_PANGO_CFLAGS)
4790 AC_SUBST(MOZ_PANGO_LIBS)
4791 AC_DEFINE(MOZ_PANGO)
4793 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0)
4794 AC_SUBST(FT2_CFLAGS)
4799 dnl ========================================================
4800 dnl = GnomeVFS, GIO and GConf support module
4801 dnl ========================================================
4805 dnl build the gnomevfs extension by default only when the
4806 dnl GTK2 toolkit is in use.
4807 if test "$MOZ_ENABLE_GTK2"
4809 MOZ_ENABLE_GNOMEVFS=1
4813 dnl ========================================================
4814 dnl = GnomeVFS support module
4815 dnl ========================================================
4816 MOZ_ARG_DISABLE_BOOL(gnomevfs,
4817 [ --disable-gnomevfs Disable GnomeVFS support ],
4818 MOZ_ENABLE_GNOMEVFS=,
4819 MOZ_ENABLE_GNOMEVFS=force)
4821 if test "$MOZ_ENABLE_GNOMEVFS"
4823 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4824 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4825 MOZ_ENABLE_GNOMEVFS=1
4826 AC_DEFINE(MOZ_ENABLE_GNOMEVFS)
4828 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
4830 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
4832 MOZ_ENABLE_GNOMEVFS=
4835 if test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
4836 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4837 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4842 AC_SUBST(MOZ_ENABLE_GNOMEVFS)
4843 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
4844 AC_SUBST(MOZ_GNOMEVFS_LIBS)
4846 dnl ========================================================
4847 dnl = GIO support module
4848 dnl ========================================================
4849 MOZ_ARG_ENABLE_BOOL(gio,
4850 [ --enable-gio Enable GIO support (default: disabled)],
4851 MOZ_ENABLE_GIO=force,
4854 if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK2"
4856 PKG_CHECK_MODULES(_GTKCHECK, gtk+-2.0 >= 2.14, ,
4857 [AC_MSG_ERROR([* * * Could not find gtk+-2.0 > 2.14. Required for build with gio.])])
4858 PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[
4859 MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
4861 AC_DEFINE(MOZ_ENABLE_GIO)
4863 if test "$MOZ_ENABLE_GIO" = "force"
4865 AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION])
4871 AC_SUBST(MOZ_ENABLE_GIO)
4872 AC_SUBST(MOZ_GIO_CFLAGS)
4873 AC_SUBST(MOZ_GIO_LIBS)
4875 dnl ========================================================
4876 dnl = GConf support module
4877 dnl ========================================================
4878 MOZ_ARG_DISABLE_BOOL(gconf,
4879 [ --disable-gconf Disable Gconf support ],
4881 MOZ_ENABLE_GCONF=force)
4883 if test "$MOZ_ENABLE_GCONF"
4885 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
4886 MOZ_GCONF_LIBS=`$PKG_CONFIG --libs gobject-2.0`
4889 if test "$MOZ_ENABLE_GCONF" = "force"
4891 AC_MSG_ERROR([* * * Could not find gconf-2.0 ])
4897 if test "$MOZ_ENABLE_GCONF"; then
4898 AC_DEFINE(MOZ_ENABLE_GCONF)
4901 AC_SUBST(MOZ_ENABLE_GCONF)
4902 AC_SUBST(MOZ_GCONF_CFLAGS)
4903 AC_SUBST(MOZ_GCONF_LIBS)
4906 dnl ========================================================
4907 dnl = libproxy support
4908 dnl ========================================================
4910 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
4912 MOZ_ENABLE_LIBPROXY=
4914 MOZ_ARG_ENABLE_BOOL(libproxy,
4915 [ --enable-libproxy Enable libproxy support ],
4916 MOZ_ENABLE_LIBPROXY=1,
4917 MOZ_ENABLE_LIBPROXY=)
4919 if test "$MOZ_ENABLE_LIBPROXY"
4921 PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
4922 AC_DEFINE(MOZ_ENABLE_LIBPROXY)
4925 AC_SUBST(MOZ_ENABLE_LIBPROXY)
4926 AC_SUBST(MOZ_LIBPROXY_CFLAGS)
4927 AC_SUBST(MOZ_LIBPROXY_LIBS)
4929 dnl ========================================================
4930 dnl = libnotify support
4931 dnl ========================================================
4933 if test "$MOZ_ENABLE_GTK2"
4935 MOZ_ENABLE_LIBNOTIFY=1
4937 MOZ_ARG_DISABLE_BOOL(libnotify,
4938 [ --disable-libnotify Disable libnotify support ],
4939 MOZ_ENABLE_LIBNOTIFY=,
4940 MOZ_ENABLE_LIBNOTIFY=1)
4942 if test "$MOZ_ENABLE_LIBNOTIFY"
4944 AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
4948 if test -z "$SKIP_LIBRARY_CHECKS"
4950 if test "$MOZ_ENABLE_GTK2"
4952 if test "$MOZ_ENABLE_LIBNOTIFY"
4954 PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
4958 AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
4959 AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
4960 AC_SUBST(MOZ_LIBNOTIFY_LIBS)
4962 dnl ========================================================
4963 dnl = GNOME component (mozgnome)
4964 dnl ========================================================
4966 # The GNOME component is built if one of
4967 # gnome-vfs, gio, gconf or libnotify is available.
4968 if test "$MOZ_ENABLE_GCONF" -o \
4969 "$MOZ_ENABLE_GNOMEVFS" -o \
4970 "$MOZ_ENABLE_GIO" -o \
4971 "$MOZ_ENABLE_LIBNOTIFY"; then
4972 MOZ_ENABLE_GNOME_COMPONENT=1
4974 MOZ_ENABLE_GNOME_COMPONENT=
4976 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
4978 dnl ========================================================
4979 dnl = libgnomeui support module
4980 dnl ========================================================
4982 if test "$MOZ_ENABLE_GTK2"
4984 MOZ_ENABLE_GNOMEUI=1
4986 MOZ_ARG_DISABLE_BOOL(gnomeui,
4987 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
4988 MOZ_ENABLE_GNOMEUI=,
4989 MOZ_ENABLE_GNOMEUI=force)
4991 if test "$MOZ_ENABLE_GNOMEUI"
4993 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
4995 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
4996 MOZ_ENABLE_GNOMEUI=1
4998 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5000 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5006 if test "$MOZ_ENABLE_GNOMEUI"; then
5007 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5011 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5012 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5013 AC_SUBST(MOZ_GNOMEUI_LIBS)
5015 dnl ========================================================
5017 dnl ========================================================
5019 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
5023 MOZ_ARG_DISABLE_BOOL(dbus,
5024 [ --disable-dbus Disable dbus support ],
5028 if test "$MOZ_ENABLE_DBUS"
5030 PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION)
5031 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5032 AC_DEFINE(MOZ_ENABLE_DBUS)
5035 AC_SUBST(MOZ_ENABLE_DBUS)
5036 AC_SUBST(MOZ_DBUS_CFLAGS)
5037 AC_SUBST(MOZ_DBUS_LIBS)
5038 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5039 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5041 dnl ========================================================
5042 dnl = Enable Android History instead of Places
5043 dnl ========================================================
5044 if test -n "$MOZ_ANDROID_HISTORY"; then
5045 dnl Do this if defined in confvars.sh
5046 AC_DEFINE(MOZ_ANDROID_HISTORY)
5050 dnl ========================================================
5051 dnl = Build with the Android Java compositor
5052 dnl ========================================================
5053 if test -n "$MOZ_JAVA_COMPOSITOR"; then
5054 dnl Do this if defined in confvars.sh
5055 AC_DEFINE(MOZ_JAVA_COMPOSITOR)
5058 dnl ========================================================
5059 dnl = Disable WebSMS backend
5060 dnl ========================================================
5061 MOZ_ARG_DISABLE_BOOL(websms-backend,
5062 [ --disable-websms-backend
5063 Disable WebSMS backend],
5064 MOZ_WEBSMS_BACKEND=,
5065 MOZ_WEBSMS_BACKEND=1)
5067 if test -n "$MOZ_WEBSMS_BACKEND"; then
5068 AC_DEFINE(MOZ_WEBSMS_BACKEND)
5071 dnl ========================================================
5072 dnl = Build Personal Security Manager
5073 dnl ========================================================
5074 MOZ_ARG_DISABLE_BOOL(crypto,
5075 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5079 dnl ========================================================
5080 dnl = JS Debugger XPCOM component (js/jsd)
5081 dnl ========================================================
5082 MOZ_ARG_DISABLE_BOOL(jsd,
5083 [ --disable-jsd Disable JavaScript debug library],
5088 dnl ========================================================
5089 dnl = Enable IPDL's "expensive" unit tests
5090 dnl ========================================================
5093 MOZ_ARG_ENABLE_BOOL(ipdl-tests,
5094 [ --enable-ipdl-tests Enable expensive IPDL tests],
5098 if test -n "$MOZ_IPDL_TESTS"; then
5099 AC_DEFINE(MOZ_IPDL_TESTS)
5102 AC_SUBST(MOZ_IPDL_TESTS)
5104 dnl ========================================================
5105 dnl = Turns off code necessary for e10s compatibility
5106 dnl ========================================================
5107 dnl This is a temporary flag to be removed in bug 662601 when
5108 dnl it's no longer needed
5112 MOZ_ARG_ENABLE_BOOL(e10s-compat,
5113 [ --enable-e10s-compat Turns off code for e10s compat],
5117 if test -n "$MOZ_E10S_COMPAT"; then
5118 AC_DEFINE(MOZ_E10S_COMPAT)
5121 dnl ========================================================
5122 dnl = Disable building dbm
5123 dnl ========================================================
5124 MOZ_ARG_DISABLE_BOOL(dbm,
5125 [ --disable-dbm Disable building dbm],
5129 dnl bi-directional support always on
5133 dnl ========================================================
5134 dnl accessibility support on by default on all platforms
5135 dnl ========================================================
5136 MOZ_ARG_DISABLE_BOOL(accessibility,
5137 [ --disable-accessibility Disable accessibility support],
5140 if test "$ACCESSIBILITY"; then
5141 AC_DEFINE(ACCESSIBILITY)
5144 dnl ========================================================
5145 dnl Disable printing
5146 dnl ========================================================
5147 MOZ_ARG_DISABLE_BOOL(printing,
5148 [ --disable-printing Disable printing support],
5152 if test "$NS_PRINTING"; then
5153 AC_DEFINE(NS_PRINTING)
5154 AC_DEFINE(NS_PRINT_PREVIEW)
5157 dnl Turn off webrtc for OS's we don't handle yet, but allow
5158 dnl --enable-webrtc to override. Can disable for everything in
5159 dnl the master list above.
5160 if test -n "$MOZ_WEBRTC"; then
5162 *-android*|*-linuxandroid*)
5163 dnl Make sure doesn't get matched by *-linux*
5166 *-linux*|*-mingw*|*-darwin*)
5170 dnl default to disabled for all others
5176 dnl ========================================================
5177 dnl = Disable WebRTC code
5178 dnl ========================================================
5179 MOZ_ARG_DISABLE_BOOL(webrtc,
5180 [ --disable-webrtc Disable support for WebRTC],
5184 if test -n "$MOZ_WEBRTC"; then
5185 AC_DEFINE(MOZ_WEBRTC)
5190 MOZ_VP8_ERROR_CONCEALMENT=1
5193 AC_SUBST(MOZ_WEBRTC)
5195 dnl ========================================================
5196 dnl = Enable Raw Codecs
5197 dnl ========================================================
5198 MOZ_ARG_ENABLE_BOOL(raw,
5199 [ --enable-raw Enable support for RAW media],
5203 if test -n "$MOZ_RAW"; then
5210 dnl ========================================================
5211 dnl = Disable Ogg Codecs
5212 dnl ========================================================
5213 MOZ_ARG_DISABLE_BOOL(ogg,
5214 [ --disable-ogg Disable support for OGG media (Theora video and Vorbis audio)],
5218 if test -n "$MOZ_OGG"; then
5223 case "$target_cpu" in
5232 dnl Checks for __attribute__(aligned()) directive
5233 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5234 [ac_cv_c_attribute_aligned],
5235 [ac_cv_c_attribute_aligned=0
5236 CFLAGS_save="${CFLAGS}"
5237 CFLAGS="${CFLAGS} -Werror"
5238 for ac_cv_c_attr_align_try in 64 32 16 8; do
5239 echo "trying $ac_cv_c_attr_align_try"
5241 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5242 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5243 if test "$ac_cv_c_attribute_aligned" != 0; then
5247 CFLAGS="${CFLAGS_save}"])
5248 if test "${ac_cv_c_attribute_aligned}" != "0"; then
5249 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5250 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5254 dnl ========================================================
5255 dnl = Disable Opus audio codec support
5256 dnl ========================================================
5257 MOZ_ARG_DISABLE_BOOL(opus,
5258 [ --disable-opus Disable support for Opus audio],
5262 dnl ========================================================
5263 dnl = Disable VP8 decoder support
5264 dnl ========================================================
5265 MOZ_ARG_DISABLE_BOOL(webm,
5266 [ --disable-webm Disable support for WebM media (VP8 video and Vorbis audio)],
5270 if test -n "$MOZ_WEBM"; then
5275 dnl ========================================================
5276 dnl = Enable media plugin support
5277 dnl ========================================================
5278 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
5279 dnl Enable support on android by default
5283 MOZ_ARG_ENABLE_BOOL(media-plugins,
5284 [ --enable-media-plugins Enable support for media plugins],
5285 MOZ_MEDIA_PLUGINS=1,
5288 if test -n "$MOZ_MEDIA_PLUGINS"; then
5289 AC_DEFINE(MOZ_MEDIA_PLUGINS)
5292 dnl ========================================================
5293 dnl = Enable getUserMedia support
5294 dnl ========================================================
5295 MOZ_ARG_ENABLE_BOOL(media-navigator,
5296 [ --enable-media-navigator Enable support for getUserMedia],
5297 MOZ_MEDIA_NAVIGATOR=1,
5298 MOZ_MEDIA_NAVIGATOR=)
5300 if test -n "$MOZ_MEDIA_NAVIGATOR"; then
5301 AC_DEFINE(MOZ_MEDIA_NAVIGATOR)
5304 dnl ========================================================
5305 dnl = Enable building OMX media plugin (B2G or Android)
5306 dnl ========================================================
5307 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
5308 dnl Enable support on android by default
5312 MOZ_ARG_ENABLE_BOOL(omx-plugin,
5313 [ --enable-omx-plugin Enable building OMX plugin (B2G)],
5317 if test -n "$MOZ_OMX_PLUGIN"; then
5318 if test "$OS_TARGET" = "Android"; then
5319 dnl Only allow building OMX plugin on Gonk (B2G) or Android
5320 AC_DEFINE(MOZ_OMX_PLUGIN)
5322 dnl fail if we're not building on Gonk or Android
5323 AC_MSG_ERROR([OMX media plugin can only be built on B2G or Android])
5327 dnl system libvpx Support
5328 dnl ========================================================
5329 MOZ_ARG_WITH_BOOL(system-libvpx,
5330 [ --with-system-libvpx Use system libvpx (located with pkgconfig)],
5331 MOZ_NATIVE_LIBVPX=1)
5336 if test -n "$MOZ_VP8"; then
5338 if test -n "$MOZ_VP8_ERROR_CONCEALMENT" ; then
5339 AC_DEFINE(MOZ_VP8_ERROR_CONCEALMENT)
5341 if test -n "$MOZ_VP8_ENCODER" ; then
5342 AC_DEFINE(MOZ_VP8_ENCODER)
5345 if test -n "$MOZ_NATIVE_LIBVPX"; then
5346 dnl ============================
5347 dnl === libvpx Version check ===
5348 dnl ============================
5349 dnl Check to see if we have a system libvpx package.
5350 PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.0.0)
5352 MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
5353 [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.])])
5356 AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
5357 [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
5362 AC_SUBST(MOZ_NATIVE_LIBVPX)
5363 AC_SUBST(MOZ_LIBVPX_CFLAGS)
5364 AC_SUBST(MOZ_LIBVPX_LIBS)
5366 if test "$MOZ_WEBM"; then
5370 case "$target_cpu" in
5380 if test -n "$MOZ_VP8" -a -z "$MOZ_NATIVE_LIBVPX"; then
5382 dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
5383 dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
5384 dnl We currently require gcc on all arm platforms.
5387 VPX_NEED_OBJ_INT_EXTRACT=
5389 dnl See if we have assembly on this platform.
5390 case "$OS_ARCH:$CPU_ARCH" in
5392 VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
5396 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
5400 VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
5404 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
5408 VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
5412 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
5416 VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
5420 VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC"
5424 VPX_ASFLAGS="-f x64 -rnasm -pnasm"
5428 dnl Check for yasm 1.1 or greater.
5429 if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then
5430 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.])
5431 elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
5432 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.])
5434 VPX_ASFLAGS="-f win32 -rnasm -pnasm -DPIC"
5436 dnl The encoder needs obj_int_extract to get asm offsets.
5440 if test -n "$GNU_AS" ; then
5442 dnl These flags are a lie; they're just used to enable the requisite
5443 dnl opcodes; actual arch detection is done at runtime.
5444 VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
5445 VPX_DASH_C_FLAG="-c"
5446 VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
5447 VPX_ASM_SUFFIX="$ASM_SUFFIX"
5452 if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then
5453 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.])
5456 if test -n "$MOZ_VP8_ENCODER" -a \
5457 -z "$GNU_CC" -a -z "$INTEL_CC" -a -z "$CLANG_CC" ; then
5458 dnl We prefer to get asm offsets using inline assembler, which the above
5459 dnl compilers can do. When we're not using one of those, we have to fall
5460 dnl back to obj_int_extract, which reads them from a compiled object
5461 dnl file. Unfortunately, that only works if we're compiling on a system
5462 dnl with the header files for the appropriate object file format.
5463 VPX_NEED_OBJ_INT_EXTRACT=1
5466 if test -n "$VPX_X86_ASM"; then
5467 AC_DEFINE(VPX_X86_ASM)
5468 elif test -n "$VPX_ARM_ASM"; then
5469 AC_DEFINE(VPX_ARM_ASM)
5471 AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.])
5475 dnl ========================================================
5476 dnl = Disable Wave decoder support
5477 dnl ========================================================
5478 MOZ_ARG_DISABLE_BOOL(wave,
5479 [ --disable-wave Disable Wave decoder support],
5483 if test -n "$MOZ_WAVE"; then
5490 dnl ========================================================
5491 dnl = Handle dependent SYDNEYAUDIO, CUBEB, and MEDIA defines
5492 dnl ========================================================
5494 if test -n "$MOZ_SYDNEYAUDIO"; then
5495 AC_DEFINE(MOZ_SYDNEYAUDIO)
5498 if test -n "$MOZ_SPEEX_RESAMPLER"; then
5499 AC_DEFINE(MOZ_SPEEX_RESAMPLER)
5502 if test -n "$MOZ_CUBEB"; then
5504 *-android*|*-linuxandroid*)
5505 dnl No Android implementation of libcubeb yet.
5508 AC_DEFINE(MOZ_CUBEB)
5511 AC_DEFINE(MOZ_CUBEB)
5514 AC_DEFINE(MOZ_CUBEB)
5517 AC_DEFINE(MOZ_CUBEB)
5520 dnl Other targets will be enabled soon.
5525 if test -n "$MOZ_MEDIA"; then
5526 AC_DEFINE(MOZ_MEDIA)
5529 if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
5530 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/])
5533 if test -n "$MOZ_VORBIS"; then
5534 AC_DEFINE(MOZ_VORBIS)
5537 if test -n "$MOZ_TREMOR"; then
5538 AC_DEFINE(MOZ_TREMOR)
5541 if test -n "$MOZ_OPUS"; then
5545 dnl ========================================================
5546 dnl = Check alsa availability on Linux if using sydneyaudio
5547 dnl ========================================================
5549 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5550 if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux"; then
5551 PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
5552 [echo "$MOZ_ALSA_PKG_ERRORS"
5553 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.)])])
5556 dnl ========================================================
5557 dnl = Enable PulseAudio
5558 dnl ========================================================
5560 MOZ_ARG_ENABLE_BOOL(pulseaudio,
5561 [ --enable-pulseaudio Enable PulseAudio support (experimental)],
5565 if test -n "$MOZ_PULSEAUDIO"; then
5566 AC_DEFINE(MOZ_CUBEB)
5567 PKG_CHECK_MODULES(MOZ_PULSEAUDIO, libpulse, ,
5568 [echo "$MOZ_PULSEAUDIO_PKG_ERRORS"
5569 AC_MSG_ERROR([pulseaudio audio backend requires libpulse package])])
5572 AC_SUBST(MOZ_PULSEAUDIO)
5573 AC_SUBST(MOZ_PULSEAUDIO_CFLAGS)
5574 AC_SUBST(MOZ_PULSEAUDIO_LIBS)
5576 dnl ========================================================
5577 dnl = Enable GStreamer
5578 dnl ========================================================
5579 MOZ_ARG_ENABLE_BOOL(gstreamer,
5580 [ --enable-gstreamer Enable GStreamer support],
5584 if test "$MOZ_GSTREAMER"; then
5585 # API version, eg 0.10, 1.0 etc
5586 GST_API_VERSION=0.10
5587 # core/base release number
5588 # depend on >= 0.10.33 as that's when the playbin2 source-setup signal was
5591 PKG_CHECK_MODULES(GSTREAMER,
5592 gstreamer-$GST_API_VERSION >= $GST_VERSION
5593 gstreamer-app-$GST_API_VERSION
5594 gstreamer-plugins-base-$GST_API_VERSION)
5595 if test -n "$GSTREAMER_LIBS"; then
5596 _SAVE_LDFLAGS=$LDFLAGS
5597 LDFLAGS="$LDFLAGS $GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
5598 AC_TRY_LINK(,[return 0;],_HAVE_LIBGSTVIDEO=1,_HAVE_LIBGSTVIDEO=)
5599 if test -n "$_HAVE_LIBGSTVIDEO" ; then
5600 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
5602 AC_MSG_ERROR([gstreamer video backend requires libgstvideo])
5604 LDFLAGS=$_SAVE_LDFLAGS
5606 AC_MSG_ERROR([gstreamer backend requires the gstreamer packages])
5609 AC_SUBST(GSTREAMER_CFLAGS)
5610 AC_SUBST(GSTREAMER_LIBS)
5611 AC_SUBST(MOZ_GSTREAMER)
5613 if test -n "$MOZ_GSTREAMER"; then
5614 AC_DEFINE(MOZ_GSTREAMER)
5619 dnl ========================================================
5620 dnl Permissions System
5621 dnl ========================================================
5622 MOZ_ARG_DISABLE_BOOL(permissions,
5623 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5628 dnl ========================================================
5630 dnl ========================================================
5631 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5632 [ --disable-negotiateauth Disable GSS-API negotiation ],
5633 MOZ_AUTH_EXTENSION=,
5634 MOZ_AUTH_EXTENSION=1 )
5636 dnl ========================================================
5638 dnl ========================================================
5639 MOZ_ARG_DISABLE_BOOL(xtf,
5640 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5643 if test "$MOZ_XTF"; then
5647 dnl ========================================================
5648 dnl Pref extensions (autoconfig)
5649 dnl ========================================================
5650 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5651 [ --disable-pref-extensions
5652 Disable pref extensions such as autoconfig],
5653 MOZ_PREF_EXTENSIONS=,
5654 MOZ_PREF_EXTENSIONS=1 )
5656 dnl ========================================================
5657 dnl Searching of system directories for extensions.
5658 dnl Note: this switch is meant to be used for test builds
5659 dnl whose behavior should not depend on what happens to be
5660 dnl installed on the local machine.
5661 dnl ========================================================
5662 MOZ_ARG_DISABLE_BOOL(system-extension-dirs,
5663 [ --disable-system-extension-dirs
5664 Disable searching system- and account-global
5665 directories for extensions of any kind; use
5666 only profile-specific extension directories],
5667 ENABLE_SYSTEM_EXTENSION_DIRS=,
5668 ENABLE_SYSTEM_EXTENSION_DIRS=1 )
5669 if test "$ENABLE_SYSTEM_EXTENSION_DIRS"; then
5670 AC_DEFINE(ENABLE_SYSTEM_EXTENSION_DIRS)
5673 dnl ========================================================
5674 dnl = Universalchardet
5675 dnl ========================================================
5676 MOZ_ARG_DISABLE_BOOL(universalchardet,
5677 [ --disable-universalchardet
5678 Disable universal encoding detection],
5679 MOZ_UNIVERSALCHARDET=,
5680 MOZ_UNIVERSALCHARDET=1 )
5682 if test -n "${JAVA_BIN_PATH}"; then
5683 dnl Look for javac and jar in the specified path.
5684 JAVA_PATH="$JAVA_BIN_PATH"
5686 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5687 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5690 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5691 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5692 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5694 if test -n "${JAVA_BIN_PATH}" -o \
5695 \( "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" \); then
5696 if test -z "$JAVA" -o "$JAVA" = ":" -o -z "$JAVAC" -o "$JAVAC" = ":" -o -z "$JAR" -o "$JAR" = ":"; then
5697 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}])
5701 dnl ========================================================
5702 dnl = ANGLE OpenGL->D3D translator for WebGL
5703 dnl = * only applies to win32
5704 dnl = * enabled by default (shipping build); requires explicit --disable to disable
5705 dnl ========================================================
5707 MOZ_DIRECTX_SDK_PATH=
5708 MOZ_DIRECTX_SDK_CPU_SUFFIX=
5711 MOZ_D3DCOMPILER_CAB=
5713 MOZ_D3DCOMPILER_DLL=
5714 case "$target_os" in
5716 MOZ_ANGLE_RENDERER=1
5720 # The DirectX SDK libraries are split into x86 and x64 sub-directories
5721 case "${target_cpu}" in
5723 MOZ_DIRECTX_SDK_CPU_SUFFIX=x86
5726 MOZ_DIRECTX_SDK_CPU_SUFFIX=x64
5730 MOZ_ARG_DISABLE_BOOL(webgl,
5731 [ --disable-webgl Disable building of the WebGL implementation],
5732 MOZ_WEBGL_DISABLED=1,
5733 MOZ_WEBGL_DISABLED=)
5735 if test -n "$MOZ_WEBGL_DISABLED"; then
5740 if test -n "$MOZ_ANGLE_RENDERER"; then
5741 # Get the SDK path from the registry.
5742 # First try to get the June 2010 SDK
5743 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1`
5744 if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then
5745 # Otherwise just take whatever comes first
5746 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
5749 if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then
5750 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.])
5752 MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/'`
5755 if test -n "$MOZ_DIRECTX_SDK_PATH" &&
5756 test -f "$MOZ_DIRECTX_SDK_PATH"/include/d3dx9.h &&
5757 test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
5758 AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH])
5760 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.])
5763 # Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib
5764 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'`
5766 if test -z "$MOZ_D3DX9_VERSION" ; then
5767 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.])
5770 MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
5771 MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
5773 MOZ_D3DX9_DLL=d3dx9_$MOZ_D3DX9_VERSION.dll
5774 MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll
5777 dnl ========================================================
5778 dnl = Breakpad crash reporting (on by default on supported platforms)
5779 dnl ========================================================
5782 i?86-*-mingw*|x86_64-*-mingw*)
5785 i?86-apple-darwin*|x86_64-apple-darwin*)
5788 i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
5789 if test "$MOZ_ENABLE_GTK2"; then
5793 *-android*|*-linuxandroid*)
5801 MOZ_ARG_DISABLE_BOOL(crashreporter,
5802 [ --disable-crashreporter Disable breakpad crash reporting],
5804 MOZ_CRASHREPORTER=1)
5806 if test -n "$MOZ_CRASHREPORTER"; then
5807 AC_DEFINE(MOZ_CRASHREPORTER)
5809 if test "$OS_TARGET" = "Linux" -o "$OS_ARCH" = "SunOS" && \
5810 test -z "$SKIP_LIBRARY_CHECKS"; then
5811 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5812 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5813 AC_SUBST(MOZ_GTHREAD_LIBS)
5815 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.])])
5818 if test "$OS_ARCH" != "$HOST_OS_ARCH"; then
5819 AC_MSG_ERROR([Breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH. Use --disable-crashreporter.])
5822 if test "$OS_ARCH" = "WINNT" -a -z "$HAVE_64BIT_OS"; then
5823 MOZ_CRASHREPORTER_INJECTOR=1
5824 AC_DEFINE(MOZ_CRASHREPORTER_INJECTOR)
5828 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5829 [ --with-crashreporter-enable-percent=NN
5830 Enable sending crash reports by default on NN% of users. (default=100)],
5831 [ val=`echo $withval | sed 's/[^0-9]//g'`
5832 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5834 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5835 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5837 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5839 dnl ========================================================
5840 dnl = libjpeg-turbo configuration
5841 dnl ========================================================
5843 if test -z "$MOZ_NATIVE_JPEG"; then
5847 MOZ_ARG_DISABLE_BOOL(libjpeg_turbo,
5848 [ --disable-libjpeg-turbo Disable optimized jpeg decoding routines],
5850 MOZ_LIBJPEG_TURBO=1)
5852 if test "$MOZ_NATIVE_JPEG" = 1 -a "$MOZ_LIBJPEG_TURBO" = 1; then
5853 AC_MSG_ERROR([cannot use --with-system-jpeg with --enable-libjpeg-turbo.])
5856 dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
5859 if test -n "$MOZ_LIBJPEG_TURBO"; then
5861 dnl Do we support libjpeg-turbo on this platform?
5862 case "$OS_ARCH:$OS_TEST" in
5863 Linux:x86|Linux:i?86)
5864 LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
5865 LIBJPEG_TURBO_X86_ASM=1
5868 LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
5869 LIBJPEG_TURBO_X64_ASM=1
5872 LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
5873 LIBJPEG_TURBO_X86_ASM=1
5876 LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
5877 LIBJPEG_TURBO_X64_ASM=1
5880 LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
5881 LIBJPEG_TURBO_X86_ASM=1
5884 LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
5885 LIBJPEG_TURBO_X64_ASM=1
5887 WINNT:x86|WINNT:i?86)
5888 LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
5889 LIBJPEG_TURBO_X86_ASM=1
5892 LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
5893 LIBJPEG_TURBO_X64_ASM=1
5896 LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon"
5897 LIBJPEG_TURBO_ARM_ASM=1
5903 dnl If we're on an x86 or x64 system which supports libjpeg-turbo's asm routines
5904 dnl and --disable-libjpeg-turbo wasn't passed, check for Yasm, and error out if
5905 dnl it doesn't exist or we have too old of a version.
5906 if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
5907 AC_MSG_CHECKING([for Yasm assembler])
5908 AC_CHECK_PROGS(LIBJPEG_TURBO_AS, yasm, "")
5910 if test -z "$LIBJPEG_TURBO_AS" ; then
5911 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.])
5914 dnl Check that we have the right yasm version. We require 1.0.1 or newer
5915 dnl on Linux and 1.1 or newer everywhere else.
5916 if test "$OS_ARCH" = "Linux" ; then
5917 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
5918 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.])
5921 if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
5922 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.])
5927 dnl If we're on an ARM system which supports libjpeg-turbo's asm routines and
5928 dnl --disable-libjpeg-turbo wasn't passed, use the C compiler as the assembler.
5929 if test -n "$LIBJPEG_TURBO_ARM_ASM" ; then
5930 echo "Using $AS as the assembler for ARM code."
5931 LIBJPEG_TURBO_AS=$AS
5934 if test -n "$LIBJPEG_TURBO_X86_ASM"; then
5935 AC_DEFINE(LIBJPEG_TURBO_X86_ASM)
5936 elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
5937 AC_DEFINE(LIBJPEG_TURBO_X64_ASM)
5938 elif test -n "$LIBJPEG_TURBO_ARM_ASM"; then
5939 AC_DEFINE(LIBJPEG_TURBO_ARM_ASM)
5940 elif test -n "$MOZ_LIBJPEG_TURBO"; then
5941 dnl Warn if we're not building the optimized routines, even though the user
5942 dnl didn't specify --disable-libjpeg-turbo.
5943 AC_MSG_WARN([No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.])
5946 dnl ========================================================
5947 dnl = Enable compilation of specific extension modules
5948 dnl ========================================================
5950 MOZ_ARG_ENABLE_STRING(extensions,
5951 [ --enable-extensions Enable extensions],
5952 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5953 if test "$option" = "yes" -o "$option" = "all"; then
5954 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5955 elif test "$option" = "no" -o "$option" = "none"; then
5957 elif test "$option" = "default"; then
5958 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5959 elif test `echo "$option" | grep -c \^-` != 0; then
5960 option=`echo $option | sed 's/^-//'`
5961 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5963 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5966 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5968 if test -z "$MOZ_ENABLE_GNOMEVFS" -a -z "$MOZ_GNOMEVFS_LIBS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5969 # Suppress warning on non-X11 platforms
5970 if test -n "$MOZ_X11"; then
5971 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5973 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5976 dnl Do not build gnomevfs with libxul based apps
5977 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5978 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5981 if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
5982 # Suppress warning on non-X11 platforms
5983 if test -n "$MOZ_X11"; then
5984 AC_MSG_WARN([Cannot build gio without required libraries. Removing gio from MOZ_EXTENSIONS.])
5986 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
5989 dnl Do not build gio with libxul based apps
5990 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
5991 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
5994 if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5995 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
5996 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
5999 dnl xforms requires xtf
6000 if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
6001 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
6002 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
6006 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
6008 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
6009 dnl when trying to build a nonexistent extension.
6010 for extension in $MOZ_EXTENSIONS; do
6011 if test ! -d "${srcdir}/extensions/${extension}"; then
6012 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
6016 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
6017 AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS)
6020 dnl ========================================================
6021 dnl CSS3 Flexbox Support
6022 dnl ========================================================
6023 if test -n "$MOZ_FLEXBOX"; then
6024 AC_DEFINE(MOZ_FLEXBOX)
6027 dnl ========================================================
6028 dnl Build Freetype in the tree
6029 dnl ========================================================
6030 MOZ_ARG_ENABLE_BOOL(tree-freetype,
6031 [ --enable-tree-freetype Enable Tree FreeType],
6032 MOZ_TREE_FREETYPE=1,
6033 MOZ_TREE_FREETYPE= )
6034 if test -n "$MOZ_TREE_FREETYPE"; then
6035 if test -n "$_WIN32_MSVC"; then
6036 AC_ERROR("building with in-tree freetype is not supported on MSVC")
6038 AC_DEFINE(MOZ_TREE_FREETYPE)
6039 AC_SUBST(MOZ_TREE_FREETYPE)
6040 MOZ_ENABLE_CAIRO_FT=1
6041 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6042 FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6043 CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6044 FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6046 CAIRO_FT_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6047 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
6048 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
6049 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
6050 AC_SUBST(CAIRO_FT_CFLAGS)
6053 dnl ========================================================
6055 dnl ========================================================
6056 dnl Abort Windows build if the required major version and
6057 dnl minimum minor version of Unicode NSIS isn't in the path
6058 dnl (unless in case of cross compiling, for which Unicode
6059 dnl is not yet sufficient).
6060 if test "$OS_ARCH" = "WINNT"; then
6061 REQ_NSIS_MAJOR_VER=2
6062 MIN_NSIS_MINOR_VER=33
6063 MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensisu-2.46 makensisu makensis)
6064 if test -n "$MAKENSISU" -a "$MAKENSISU" != ":"; then
6065 AC_MSG_RESULT([yes])
6067 MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\)\-Unicode$/\1/g'`
6069 if test ! "$MAKENSISU_VER" = ""; then
6070 MAKENSISU_MAJOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $1 }'`
6071 MAKENSISU_MINOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $2 }'`
6073 AC_MSG_CHECKING([for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER])
6074 if test "$MAKENSISU_VER" = "" || \
6075 test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \
6076 ! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then
6078 if test -z "$CROSS_COMPILE"; then
6079 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.])
6084 elif test -z "$CROSS_COMPILE"; then
6085 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.])
6091 dnl ========================================================
6093 dnl ========================================================
6094 MOZ_ARG_DISABLE_BOOL(webapp-runtime,
6095 [ --disable-webapp-runtime Disable Web App Runtime],
6096 MOZ_WEBAPP_RUNTIME=,
6097 MOZ_WEBAPP_RUNTIME=1)
6098 if test "$MOZ_WIDGET_TOOLKIT" != "windows" -a "$MOZ_WIDGET_TOOLKIT" != "cocoa" -a "$MOZ_WIDGET_TOOLKIT" != "gtk2"; then
6101 if test "$OS_ARCH" = "WINNT" -a -z "$MAKENSISU" -a -n "$CROSS_COMPILE"; then
6104 AC_SUBST(MOZ_WEBAPP_RUNTIME)
6105 if test "$MOZ_WEBAPP_RUNTIME"; then
6106 AC_DEFINE(MOZ_WEBAPP_RUNTIME)
6109 AC_MSG_CHECKING([for tar archiver])
6110 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6111 if test -z "$TAR"; then
6112 AC_MSG_ERROR([no tar archiver found in \$PATH])
6114 AC_MSG_RESULT([$TAR])
6117 AC_MSG_CHECKING([for wget])
6118 AC_CHECK_PROGS(WGET, wget, "")
6119 AC_MSG_RESULT([$WGET])
6122 dnl ========================================================
6124 dnl ========================================================
6126 if test -n "$MOZ_SIGN_CMD"; then
6127 AC_DEFINE(MOZ_SIGNING)
6130 dnl ========================================================
6131 dnl Maintenance Service
6132 dnl ========================================================
6134 MOZ_ARG_ENABLE_BOOL(maintenance-service,
6135 [ --enable-maintenance-service Enable building of maintenanceservice],
6136 MOZ_MAINTENANCE_SERVICE=1,
6137 MOZ_MAINTENANCE_SERVICE= )
6139 if test -n "$MOZ_MAINTENANCE_SERVICE"; then
6140 if test "$OS_ARCH" = "WINNT"; then
6141 AC_DEFINE(MOZ_MAINTENANCE_SERVICE)
6143 AC_MSG_ERROR([Can only build with --enable-maintenance-service with a Windows target])
6147 dnl ========================================================
6148 dnl Verify MAR signatures
6149 dnl ========================================================
6151 MOZ_ARG_ENABLE_BOOL(verify-mar,
6152 [ --enable-verify-mar Enable verifying MAR signatures],
6153 MOZ_VERIFY_MAR_SIGNATURE=1,
6154 MOZ_VERIFY_MAR_SIGNATURE= )
6156 if test -n "$MOZ_VERIFY_MAR_SIGNATURE"; then
6157 if test "$OS_ARCH" = "WINNT"; then
6158 AC_DEFINE(MOZ_VERIFY_MAR_SIGNATURE)
6160 AC_MSG_ERROR([Can only build with --enable-verify-mar with a Windows target])
6164 dnl ========================================================
6165 dnl Enable building the signmar program.
6166 dnl This option is much different than the --enable-verify-mar option.
6167 dnl --enable-verify-mar is for enabling the verification check on MAR
6168 dnl files in the updater. The --enable-signmar option is for building
6169 dnl the signmar program.
6170 dnl ========================================================
6172 MOZ_ARG_ENABLE_BOOL(signmar,
6173 [ --enable-signmar Enable building the signmar program],
6174 MOZ_ENABLE_SIGNMAR=1,
6175 MOZ_ENABLE_SIGNMAR= )
6177 if test -n "$MOZ_ENABLE_SIGNMAR"; then
6178 AC_DEFINE(MOZ_ENABLE_SIGNMAR)
6181 dnl ========================================================
6183 dnl ========================================================
6185 MOZ_ARG_DISABLE_BOOL(updater,
6186 [ --disable-updater Disable building of updater],
6190 if test -n "$MOZ_UPDATER"; then
6191 AC_DEFINE(MOZ_UPDATER)
6194 # app update channel is 'default' when not supplied.
6195 MOZ_ARG_ENABLE_STRING([update-channel],
6196 [ --enable-update-channel=CHANNEL
6197 Select application update channel (default=default)],
6198 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6200 if test -z "$MOZ_UPDATE_CHANNEL"; then
6201 MOZ_UPDATE_CHANNEL=default
6203 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6204 AC_SUBST(MOZ_UPDATE_CHANNEL)
6206 # tools/update-packaging is not checked out by default.
6207 MOZ_ARG_ENABLE_BOOL(update-packaging,
6208 [ --enable-update-packaging
6209 Enable tools/update-packaging],
6210 MOZ_UPDATE_PACKAGING=1,
6211 MOZ_UPDATE_PACKAGING= )
6212 AC_SUBST(MOZ_UPDATE_PACKAGING)
6214 dnl ========================================================
6215 dnl build the tests by default
6216 dnl ========================================================
6217 MOZ_ARG_DISABLE_BOOL(tests,
6218 [ --disable-tests Do not build test libraries & programs],
6222 dnl ========================================================
6223 dnl parental controls (for Windows Vista)
6224 dnl ========================================================
6225 MOZ_ARG_DISABLE_BOOL(parental-controls,
6226 [ --disable-parental-controls
6227 Do not build parental controls],
6228 MOZ_DISABLE_PARENTAL_CONTROLS=1,
6229 MOZ_DISABLE_PARENTAL_CONTROLS=)
6230 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6231 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6234 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6236 dnl ========================================================
6237 dnl = Disable DOMCrypto
6238 dnl ========================================================
6239 if test -n "$MOZ_DISABLE_DOMCRYPTO"; then
6240 AC_DEFINE(MOZ_DISABLE_DOMCRYPTO)
6243 dnl ========================================================
6245 dnl = Module specific options
6247 dnl ========================================================
6248 MOZ_ARG_HEADER(Individual module options)
6250 dnl ========================================================
6251 dnl = Disable feed handling components
6252 dnl ========================================================
6253 MOZ_ARG_DISABLE_BOOL(feeds,
6254 [ --disable-feeds Disable feed handling and processing components],
6257 if test -n "$MOZ_FEEDS"; then
6258 AC_DEFINE(MOZ_FEEDS)
6260 if test "$MOZ_BUILD_APP" = "browser"; then
6261 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6265 dnl ========================================================
6266 dnl Check for sqlite
6267 dnl ========================================================
6270 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6271 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6272 MOZ_NATIVE_SQLITE=1,
6273 MOZ_NATIVE_SQLITE= )
6275 if test -z "$MOZ_NATIVE_SQLITE"
6278 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)'
6280 dnl ============================
6281 dnl === SQLite Version check ===
6282 dnl ============================
6283 dnl Check to see if the system SQLite package is new enough.
6284 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6286 dnl ==================================
6287 dnl === SQLITE_SECURE_DELETE check ===
6288 dnl ==================================
6289 dnl Check to see if the system SQLite package is compiled with
6290 dnl SQLITE_SECURE_DELETE enabled.
6291 AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
6292 _SAVE_CFLAGS="$CFLAGS"
6293 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6295 LIBS="$LIBS $SQLITE_LIBS"
6296 AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
6298 #include "sqlite3.h"
6300 int main(int argc, char **argv){
6301 return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
6303 ac_cv_sqlite_secure_delete=yes,
6304 ac_cv_sqlite_secure_delete=no,
6305 ac_cv_sqlite_secure_delete=no
6308 AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
6309 CFLAGS="$_SAVE_CFLAGS"
6311 if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
6312 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
6315 dnl ===============================
6316 dnl === SQLITE_THREADSAFE check ===
6317 dnl ===============================
6318 dnl Check to see if the system SQLite package is compiled with
6319 dnl SQLITE_THREADSAFE enabled.
6320 AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
6321 _SAVE_CFLAGS="$CFLAGS"
6322 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6324 LIBS="$LIBS $SQLITE_LIBS"
6325 AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
6327 #include "sqlite3.h"
6329 int main(int argc, char **argv){
6330 return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
6332 ac_cv_sqlite_threadsafe=yes,
6333 ac_cv_sqlite_threadsafe=no,
6334 ac_cv_sqlite_threadsafe=no
6337 AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
6338 CFLAGS="$_SAVE_CFLAGS"
6340 if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
6341 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
6344 dnl ================================
6345 dnl === SQLITE_ENABLE_FTS3 check ===
6346 dnl ================================
6347 dnl check to see if the system SQLite package is compiled with
6348 dnl SQLITE_ENABLE_FTS3 enabled.
6349 AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
6350 _SAVE_CFLAGS="$CFLAGS"
6351 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6353 LIBS="$LIBS $SQLITE_LIBS"
6354 AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
6356 #include "sqlite3.h"
6358 int main(int argc, char **argv){
6359 return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
6361 ac_cv_sqlite_enable_fts3=yes,
6362 ac_cv_sqlite_enable_fts3=no,
6363 ac_cv_sqlite_enable_fts3=no
6366 AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
6367 CFLAGS="$_SAVE_CFLAGS"
6369 if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
6370 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
6373 dnl =========================================
6374 dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
6375 dnl =========================================
6376 dnl check to see if the system SQLite package is compiled with
6377 dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
6378 AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
6379 _SAVE_CFLAGS="$CFLAGS"
6380 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6382 LIBS="$LIBS $SQLITE_LIBS"
6383 AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
6385 #include "sqlite3.h"
6387 int main(int argc, char **argv){
6388 return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
6390 ac_cv_sqlite_enable_unlock_notify=yes,
6391 ac_cv_sqlite_enable_unlock_notify=no,
6392 ac_cv_sqlite_enable_unlock_notify=no
6395 AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
6396 CFLAGS="$_SAVE_CFLAGS"
6398 if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
6399 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
6403 if test -n "$MOZ_NATIVE_SQLITE"; then
6404 AC_DEFINE(MOZ_NATIVE_SQLITE)
6406 AC_SUBST(MOZ_NATIVE_SQLITE)
6408 dnl ========================================================
6409 dnl = Enable help viewer (off by default)
6410 dnl ========================================================
6411 if test -n "$MOZ_HELP_VIEWER"; then
6412 dnl Do this if defined in confvars.sh
6413 AC_DEFINE(MOZ_HELP_VIEWER)
6416 dnl ========================================================
6417 dnl = Enable safe browsing (anti-phishing)
6418 dnl ========================================================
6419 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6420 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6421 MOZ_SAFE_BROWSING=1,
6422 MOZ_SAFE_BROWSING= )
6423 if test -n "$MOZ_SAFE_BROWSING"; then
6424 AC_DEFINE(MOZ_SAFE_BROWSING)
6426 AC_SUBST(MOZ_SAFE_BROWSING)
6428 dnl ========================================================
6429 dnl = Enable url-classifier
6430 dnl ========================================================
6431 dnl Implicitly enabled by default if building with safe-browsing
6432 if test -n "$MOZ_SAFE_BROWSING"; then
6433 MOZ_URL_CLASSIFIER=1
6435 MOZ_ARG_ENABLE_BOOL(url-classifier,
6436 [ --enable-url-classifier Enable url classifier module],
6437 MOZ_URL_CLASSIFIER=1,
6438 MOZ_URL_CLASSIFIER= )
6439 if test -n "$MOZ_URL_CLASSIFIER"; then
6440 AC_DEFINE(MOZ_URL_CLASSIFIER)
6442 AC_SUBST(MOZ_URL_CLASSIFIER)
6444 dnl ========================================================
6445 dnl = Disable zipwriter
6446 dnl ========================================================
6447 MOZ_ARG_DISABLE_BOOL(zipwriter,
6448 [ --disable-zipwriter Disable zipwriter component],
6451 AC_SUBST(MOZ_ZIPWRITER)
6453 dnl ========================================================
6455 dnl ========================================================
6456 dnl superseded by QtNetwork starting from 4.7
6457 MOZ_ENABLE_LIBCONIC=1
6459 if test -n "$MOZ_ENABLE_QT"; then
6460 if test "$MOZ_ENABLE_QTNETWORK"; then
6461 MOZ_ENABLE_LIBCONIC=
6465 MOZ_ARG_DISABLE_BOOL(libconic,
6466 [ --disable-libconic Disable libconic],
6467 MOZ_ENABLE_LIBCONIC=,
6468 MOZ_ENABLE_LIBCONIC=1 )
6470 if test -n "$MOZ_ENABLE_LIBCONIC"; then
6471 PKG_CHECK_MODULES(LIBCONIC, conic,
6472 MOZ_ENABLE_LIBCONIC=1,
6473 MOZ_ENABLE_LIBCONIC=)
6475 if test "$MOZ_ENABLE_LIBCONIC"; then
6476 AC_DEFINE(MOZ_ENABLE_LIBCONIC)
6479 AC_SUBST(MOZ_ENABLE_LIBCONIC)
6480 AC_SUBST(LIBCONIC_CFLAGS)
6481 AC_SUBST(LIBCONIC_LIBS)
6483 dnl ========================================================
6485 dnl ========================================================
6487 MAEMO_SDK_TARGET_VER=-1
6489 MOZ_ARG_WITH_STRING(maemo-version,
6490 [ --with-maemo-version=MAEMO_SDK_TARGET_VER
6492 MAEMO_SDK_TARGET_VER=$withval)
6494 case "$MAEMO_SDK_TARGET_VER" in
6496 MOZ_PLATFORM_MAEMO=5
6500 MOZ_PLATFORM_MAEMO=6
6504 dnl We aren't compiling for Maemo, move on.
6507 AC_MSG_ERROR([Unknown Maemo Version. Try setting --with-maemo-version to 5 or 6.])
6511 if test $MOZ_PLATFORM_MAEMO; then
6512 AC_DEFINE_UNQUOTED([MOZ_PLATFORM_MAEMO], $MOZ_PLATFORM_MAEMO)
6514 if test -z "$MOZ_ENABLE_DBUS"; then
6515 AC_MSG_ERROR([DBus is required when building for Maemo])
6518 MOZ_GFX_OPTIMIZE_MOBILE=1
6519 MOZ_GL_DEFAULT_PROVIDER=EGL
6520 MOZ_MAEMO_LIBLOCATION=
6522 if test $MOZ_PLATFORM_MAEMO = 5; then
6523 dnl if we have Xcomposite we should also have Xdamage and Xfixes
6524 MOZ_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
6525 [AC_MSG_ERROR([Couldn't find X11/extensions/Xdamage.h which is required for composited plugins.])])
6526 AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
6527 [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
6529 AC_SUBST(XCOMPOSITE_LIBS)
6531 PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime, _LIB_FOUND=1, _LIB_FOUND=)
6532 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
6533 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
6534 if test -z "$_LIB_FOUND"; then
6535 AC_MSG_ERROR([Hildon Mime is required when building for Maemo])
6539 PKG_CHECK_MODULES(LIBOSSO,libosso, _LIB_FOUND=1, _LIB_FOUND=)
6540 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
6541 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
6542 if test -z "$_LIB_FOUND"; then
6543 AC_MSG_ERROR([LibOSSO is required when building for Maemo])
6546 PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2, _LIB_FOUND=1, _LIB_FOUND=)
6547 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
6548 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
6549 if test -z "$_LIB_FOUND"; then
6550 AC_MSG_ERROR([Hildon FM-2 is required when building for Maemo])
6554 if test $MOZ_PLATFORM_MAEMO = 6; then
6556 PKG_CHECK_MODULES(LIBCONTENTMANAGER, ContentManager QtSparql,
6559 if test "$_LIB_FOUND"; then
6560 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTMANAGER_LIBS"
6561 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTMANAGER_CFLAGS"
6562 MOZ_ENABLE_CONTENTMANAGER=1
6563 AC_DEFINE(MOZ_ENABLE_CONTENTMANAGER)
6565 AC_MSG_WARN([Cannot find libcontentmanager and or QtSparql building for Maemo 6])
6567 AC_SUBST(MOZ_ENABLE_CONTENTMANAGER)
6569 dnl ========================================================
6570 dnl = Enable meego libcontentaction
6571 dnl ========================================================
6572 MOZ_ARG_ENABLE_BOOL(meegocontentaction,
6573 [ --enable-meegocontentaction Enable meegocontentaction support],
6574 MOZ_MEEGOCONTENTACTION=1,
6575 MOZ_MEEGOCONTENTACTION=)
6577 if test -n "$MOZ_MEEGOCONTENTACTION"; then
6579 PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
6580 if test "$_LIB_FOUND"; then
6581 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTACTION_LIBS"
6582 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTACTION_CFLAGS"
6583 MOZ_ENABLE_CONTENTACTION=1
6584 AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
6585 AC_SUBST(MOZ_ENABLE_CONTENTACTION)
6589 MOZ_ARG_ENABLE_BOOL(meegotouch,
6590 [ --enable-meegotouch Enable meegotouch support],
6591 MOZ_MEEGOTOUCHENABLED=1,
6592 MOZ_MEEGOTOUCHENABLED=)
6594 if test -n "$MOZ_MEEGOTOUCHENABLED"; then
6595 PKG_CHECK_MODULES(MOZ_MEEGOTOUCH, meegotouchcore, _LIB_FOUND=1, _LIB_FOUND=)
6596 if test "$_LIB_FOUND"; then
6597 MOZ_QT_CFLAGS="$MOZ_MEEGOTOUCH_CFLAGS $MOZ_QT_CFLAGS"
6598 MOZ_QT_LIBS="$MOZ_MEEGOTOUCH_LIBS $MOZ_QT_LIBS"
6599 AC_DEFINE(MOZ_ENABLE_MEEGOTOUCH)
6601 AC_MSG_WARN([Cannot meegotouchcore-dev. Disabling Meegotouch support.])
6606 PKG_CHECK_MODULES(LIBLOCATION,liblocation, _LIB_FOUND=1, _LIB_FOUND=)
6607 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBLOCATION_LIBS"
6608 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBLOCATION_CFLAGS"
6609 if test "$_LIB_FOUND"; then
6610 MOZ_MAEMO_LIBLOCATION=1
6611 AC_DEFINE(MOZ_MAEMO_LIBLOCATION)
6613 AC_MSG_WARN([Cannot liblocation-dev. Disabling Maemo geolocation.])
6615 AC_SUBST(MOZ_MAEMO_LIBLOCATION)
6617 PKG_CHECK_MODULES(LIBMEEGOTOUCHSHARE, ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri, _LIB_FOUND=1, _LIB_FOUND=)
6618 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBMEEGOTOUCHSHARE_LIBS"
6619 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBMEEGOTOUCHSHARE_CFLAGS"
6620 if test "$_LIB_FOUND"; then
6621 MOZ_ENABLE_MEEGOTOUCHSHARE=1
6622 AC_DEFINE(MOZ_ENABLE_MEEGOTOUCHSHARE)
6624 AC_MSG_WARN([Cannot find maemo-meegotouch-interfaces-dev or libmdatauri-dev. Disabling meegotouch share ui.])
6626 AC_SUBST(MOZ_ENABLE_MEEGOTOUCHSHARE)
6628 AC_SUBST(MOZ_PLATFORM_MAEMO_LIBS)
6629 AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
6632 dnl ========================================================
6633 dnl = XRender Composite
6634 dnl ========================================================
6635 MOZ_ARG_ENABLE_BOOL(egl-xrender-composite,
6636 [ --enable-egl-xrender-composite
6637 Enable EGL xrender composite optimizations],
6638 MOZ_EGL_XRENDER_COMPOSITE=1)
6640 if test -n "$MOZ_EGL_XRENDER_COMPOSITE"; then
6641 AC_DEFINE(MOZ_EGL_XRENDER_COMPOSITE)
6644 AC_SUBST(MOZ_EGL_XRENDER_COMPOSITE)
6646 dnl ========================================================
6648 dnl ========================================================
6650 MOZ_ARG_WITH_STRING(gl-provider,
6651 [ --with-gl-provider=ID
6652 Set GL provider backend type],
6653 [ val=`echo $withval`
6654 MOZ_GL_PROVIDER="$val"])
6656 if test -n "$MOZ_GL_PROVIDER"; then
6657 MOZ_GL_DEFAULT_PROVIDER=$MOZ_GL_PROVIDER
6658 AC_SUBST(MOZ_GL_PROVIDER)
6659 AC_DEFINE_UNQUOTED(MOZ_GL_PROVIDER, GLContextProvider$MOZ_GL_PROVIDER)
6661 AC_SUBST(MOZ_GL_DEFAULT_PROVIDER)
6663 dnl ========================================================
6664 dnl = faststripe theme
6665 dnl ========================================================
6666 MOZ_ARG_ENABLE_BOOL(faststripe,
6667 [ --enable-faststripe Use faststripe theme],
6668 MOZ_THEME_FASTSTRIPE=1,
6669 MOZ_THEME_FASTSTRIPE= )
6670 AC_SUBST(MOZ_THEME_FASTSTRIPE)
6672 dnl ========================================================
6674 dnl = Feature options that require extra sources to be pulled
6676 dnl ========================================================
6677 dnl MOZ_ARG_HEADER(Features that require extra sources)
6679 dnl ========================================================
6681 dnl = Debugging Options
6683 dnl ========================================================
6684 MOZ_ARG_HEADER(Debugging and Optimizations)
6686 dnl ========================================================
6687 dnl = Disable building with debug info.
6688 dnl = Debugging is OFF by default
6689 dnl ========================================================
6690 if test -z "$MOZ_DEBUG_FLAGS"; then
6691 MOZ_DEBUG_FLAGS="-g"
6694 MOZ_ARG_ENABLE_STRING(debug,
6695 [ --enable-debug[=DBG] Enable building with developer debug info
6696 (using compiler flags DBG)],
6697 [ if test "$enableval" != "no"; then
6699 if test -n "$enableval" -a "$enableval" != "yes"; then
6700 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6701 _MOZ_DEBUG_FLAGS_SET=1
6708 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
6709 MOZ_ARG_WITH_STRING(debug-label,
6710 [ --with-debug-label=LABELS
6711 Define DEBUG_<value> for each comma-separated
6713 [ for option in `echo $withval | sed 's/,/ /g'`; do
6714 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
6717 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6719 if test -n "$MOZ_DEBUG"; then
6720 AC_MSG_CHECKING([for valid debug flags])
6721 _SAVE_CFLAGS=$CFLAGS
6722 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6723 AC_TRY_COMPILE([#include <stdio.h>],
6724 [printf("Hello World\n");],
6727 AC_MSG_RESULT([$_results])
6728 if test "$_results" = "no"; then
6729 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6731 CFLAGS=$_SAVE_CFLAGS
6734 dnl ========================================================
6735 dnl enable mobile optimizations
6736 dnl ========================================================
6737 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
6738 [ --enable-mobile-optimize
6739 Enable mobile optimizations],
6740 MOZ_GFX_OPTIMIZE_MOBILE=1)
6742 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
6744 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
6745 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6748 dnl ========================================================
6749 dnl = Enable code optimization. ON by default.
6750 dnl ========================================================
6751 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6752 MOZ_OPTIMIZE_FLAGS="-O"
6755 MOZ_ARG_ENABLE_STRING(optimize,
6756 [ --disable-optimize Disable compiler optimization
6757 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6758 [ if test "$enableval" != "no"; then
6760 if test -n "$enableval" -a "$enableval" != "yes"; then
6761 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6766 fi ], MOZ_OPTIMIZE=1)
6768 MOZ_SET_FRAMEPTR_FLAGS
6770 if test "$COMPILE_ENVIRONMENT"; then
6771 if test -n "$MOZ_OPTIMIZE"; then
6772 AC_MSG_CHECKING([for valid optimization flags])
6773 _SAVE_CFLAGS=$CFLAGS
6774 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6775 AC_TRY_COMPILE([#include <stdio.h>],
6776 [printf("Hello World\n");],
6779 AC_MSG_RESULT([$_results])
6780 if test "$_results" = "no"; then
6781 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6783 CFLAGS=$_SAVE_CFLAGS
6785 fi # COMPILE_ENVIRONMENT
6787 AC_SUBST(MOZ_OPTIMIZE)
6788 AC_SUBST(MOZ_FRAMEPTR_FLAGS)
6789 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6790 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6791 AC_SUBST(MOZ_ALLOW_HEAP_EXECUTE_FLAGS)
6792 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6793 AC_SUBST(MOZ_PGO_OPTIMIZE_FLAGS)
6795 dnl ========================================================
6796 dnl = Enable generation of debug symbols
6797 dnl ========================================================
6798 MOZ_ARG_ENABLE_STRING(debug-symbols,
6799 [ --enable-debug-symbols[=DBG]
6800 Enable debugging symbols (using compiler flags DBG)],
6801 [ if test "$enableval" != "no"; then
6803 if test -n "$enableval" -a "$enableval" != "yes"; then
6804 if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
6805 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6807 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
6813 MOZ_DEBUG_SYMBOLS=1)
6815 if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
6816 AC_DEFINE(MOZ_DEBUG_SYMBOLS)
6817 export MOZ_DEBUG_SYMBOLS
6820 dnl ========================================================
6821 dnl = Enable any treating of compile warnings as errors
6822 dnl ========================================================
6823 MOZ_ARG_ENABLE_BOOL(warnings-as-errors,
6824 [ --enable-warnings-as-errors
6825 Enable treating of warnings as errors],
6826 MOZ_ENABLE_WARNINGS_AS_ERRORS=1,
6827 MOZ_ENABLE_WARNINGS_AS_ERRORS=)
6828 if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
6829 WARNINGS_AS_ERRORS=''
6832 dnl ========================================================
6833 dnl = Disable runtime logging checks
6834 dnl ========================================================
6835 MOZ_ARG_DISABLE_BOOL(logging,
6836 [ --disable-logging Disable logging facilities],
6837 NS_DISABLE_LOGGING=1,
6838 NS_DISABLE_LOGGING= )
6839 if test "$NS_DISABLE_LOGGING"; then
6840 AC_DEFINE(NS_DISABLE_LOGGING)
6842 AC_DEFINE(MOZ_LOGGING)
6845 dnl ========================================================
6846 dnl = This will enable logging of addref, release, ctor, dtor.
6847 dnl ========================================================
6848 _ENABLE_LOGREFCNT=42
6849 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6850 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6851 _ENABLE_LOGREFCNT=1,
6852 _ENABLE_LOGREFCNT= )
6853 if test "$_ENABLE_LOGREFCNT" = "1"; then
6854 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6855 elif test -z "$_ENABLE_LOGREFCNT"; then
6856 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6859 dnl ========================================================
6860 dnl moz_dump_painting
6861 dnl ========================================================
6862 MOZ_ARG_ENABLE_BOOL(dump-painting,
6863 [ --enable-dump-painting Enable paint debugging.],
6864 MOZ_DUMP_PAINTING=1,
6865 MOZ_DUMP_PAINTING= )
6866 if test -n "$MOZ_DUMP_PAINTING"; then
6867 AC_DEFINE(MOZ_DUMP_PAINTING)
6868 AC_DEFINE(MOZ_LAYERS_HAVE_LOG)
6870 if test -n "$MOZ_DEBUG"; then
6871 AC_DEFINE(MOZ_DUMP_PAINTING)
6874 dnl ========================================================
6875 dnl = Enable trace malloc
6876 dnl ========================================================
6877 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6878 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6879 [ --enable-trace-malloc Enable malloc tracing; also disables jemalloc],
6882 if test "$NS_TRACE_MALLOC"; then
6883 # Please, Mr. Linker Man, don't take away our symbol names
6884 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6886 AC_DEFINE(NS_TRACE_MALLOC)
6888 AC_SUBST(NS_TRACE_MALLOC)
6890 dnl ========================================================
6891 dnl = Enable jemalloc
6892 dnl ========================================================
6893 MOZ_ARG_ENABLE_BOOL(jemalloc,
6894 [ --enable-jemalloc Replace memory allocator with jemalloc],
6898 if test "$NS_TRACE_MALLOC"; then
6901 if test "$MOZ_DMD"; then
6905 if test "${OS_TARGET}" = "Android"; then
6906 dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue
6908 elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "OS2"; then
6909 dnl On Windows, OSX and OS2, we want to link all our binaries against mozglue
6910 if test -z "$GNU_CC"; then
6911 MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
6913 MOZ_GLUE_LDFLAGS='-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)'
6916 dnl On other Unix systems, we only want to link executables against mozglue
6917 MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
6918 dnl On other Unix systems, where mozglue is a static library, jemalloc is
6919 dnl separated for the SDK, so we need to add it here.
6920 if test "$MOZ_MEMORY" = 1 -o \( "$LIBXUL_SDK" -a -f "$LIBXUL_SDK/lib/${LIB_PREFIX}memory.${LIB_SUFFIX}" \); then
6921 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)'
6923 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(MKSHLIB_UNFORCE_ALL)'
6924 if test -n "$GNU_CC"; then
6925 dnl And we need mozglue symbols to be exported.
6926 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
6928 if test "$MOZ_LINKER" = 1; then
6929 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $ZLIB_LIBS"
6933 if test -z "$MOZ_MEMORY"; then
6936 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
6937 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.])
6942 dnl Don't try to run compiler tests on Windows
6943 if test "$OS_ARCH" = "WINNT"; then
6944 if test -z "$HAVE_64BIT_OS"; then
6945 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6947 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6950 AC_CHECK_SIZEOF([int *], [4])
6951 case "${ac_cv_sizeof_int_p}" in
6953 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6956 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6959 AC_MSG_ERROR([Unexpected pointer size])
6964 AC_DEFINE(MOZ_MEMORY)
6965 if test -n "$MOZ_JEMALLOC"; then
6966 AC_DEFINE(MOZ_JEMALLOC)
6968 if test "x$MOZ_DEBUG" = "x1"; then
6969 AC_DEFINE(MOZ_MEMORY_DEBUG)
6971 dnl The generic feature tests that determine how to compute ncpus are long and
6972 dnl complicated. Therefore, simply define special cpp variables for the
6973 dnl platforms we have special knowledge of.
6976 AC_DEFINE(MOZ_MEMORY_DARWIN)
6979 AC_DEFINE(MOZ_MEMORY_BSD)
6981 *-android*|*-linuxandroid*)
6982 AC_DEFINE(MOZ_MEMORY_LINUX)
6983 AC_DEFINE(MOZ_MEMORY_ANDROID)
6984 if test -z "$gonkdir"; then
6987 AC_DEFINE(MOZ_MEMORY_GONK)
6992 AC_DEFINE(MOZ_MEMORY_LINUX)
6995 AC_DEFINE(MOZ_MEMORY_BSD)
6998 AC_DEFINE(MOZ_MEMORY_SOLARIS)
7001 AC_DEFINE(MOZ_MEMORY_WINDOWS)
7002 if test -z "$MOZ_DEBUG"; then
7003 WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
7005 WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
7007 dnl Look for a broken crtdll.obj
7008 WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
7009 lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
7010 if grep -q '__imp__\{0,1\}free' crtdll.obj; then
7011 MOZ_GLUE_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
7012 dnl Also pass this to NSPR/NSS
7013 DLLFLAGS="$DLLFLAGS $MOZ_GLUE_LDFLAGS"
7015 DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozglue"
7022 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
7026 AC_SUBST(MOZ_MEMORY)
7027 AC_SUBST(MOZ_JEMALLOC)
7028 AC_SUBST(MOZ_GLUE_LDFLAGS)
7029 AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS)
7030 AC_SUBST(WIN32_CRT_LIBS)
7031 dnl Need to set this for make because NSS doesn't have configure
7034 dnl We need to wrap dlopen and related functions on Android because we use
7036 if test "$OS_TARGET" = Android; then
7037 WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue"
7038 if test -n "$MOZ_OLD_LINKER"; then
7039 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
7041 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
7042 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise,--wrap=PR_GetEnv,--wrap=PR_SetEnv"
7045 dnl ========================================================
7046 dnl = Use malloc wrapper lib
7047 dnl ========================================================
7048 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
7049 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
7053 if test -n "$_WRAP_MALLOC"; then
7054 if test -n "$GNU_CC"; then
7055 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
7056 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
7057 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
7058 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
7059 dnl Wrap operator new and operator delete on Android.
7060 if test "$OS_TARGET" = "Android"; then
7061 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv"
7064 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
7068 dnl ========================================================
7069 dnl = Location of malloc wrapper lib
7070 dnl ========================================================
7071 MOZ_ARG_WITH_STRING(wrap-malloc,
7072 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
7073 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
7075 dnl ========================================================
7076 dnl = Use JS Call tracing
7077 dnl ========================================================
7078 MOZ_ARG_ENABLE_BOOL(trace-jscalls,
7079 [ --enable-trace-jscalls Enable JS call enter/exit callback (default=no)],
7080 MOZ_TRACE_JSCALLS=1,
7081 MOZ_TRACE_JSCALLS= )
7082 if test -n "$MOZ_TRACE_JSCALLS"; then
7083 AC_DEFINE(MOZ_TRACE_JSCALLS)
7086 dnl ========================================================
7087 dnl = Use incremental GC
7088 dnl ========================================================
7090 MOZ_ARG_DISABLE_BOOL(gcincremental,
7091 [ --disable-gcincremental Disable incremental GC],
7093 if test -n "$JSGC_INCREMENTAL"; then
7094 AC_DEFINE(JSGC_INCREMENTAL)
7097 dnl ========================================================
7098 dnl ETW - Event Tracing for Windows
7099 dnl ========================================================
7100 MOZ_ARG_ENABLE_BOOL(ETW,
7101 [ --enable-ETW Enable ETW (Event Tracing for Windows) event reporting],
7104 if test -n "$MOZ_ETW"; then
7108 if test -n "$MOZ_ETW"; then
7109 if test -z "$MOZ_WINSDK_TARGETVER"; then
7110 AC_MSG_ERROR([--enable-ETW is only valid on Windows])
7114 dnl ========================================================
7115 dnl Zealous JavaScript GC
7116 dnl ========================================================
7117 MOZ_ARG_ENABLE_BOOL(gczeal,
7118 [ --enable-gczeal Enable zealous JavaScript GCing],
7121 if test -n "$JS_GC_ZEAL"; then
7122 AC_DEFINE(JS_GC_ZEAL)
7125 dnl ========================================================
7126 dnl JS opt-mode assertions and minidump instrumentation
7127 dnl ========================================================
7128 MOZ_ARG_ENABLE_BOOL(js-diagnostics,
7129 [ --enable-js-diagnostics
7130 Enable JS diagnostic assertions and breakpad data],
7131 JS_CRASH_DIAGNOSTICS=1,
7132 JS_CRASH_DIAGNOSTICS= )
7133 if test -n "$JS_CRASH_DIAGNOSTICS"; then
7134 AC_DEFINE(JS_CRASH_DIAGNOSTICS)
7139 dnl ========================================================
7140 dnl = Enable static checking using gcc-dehydra
7141 dnl ========================================================
7143 MOZ_ARG_WITH_STRING(static-checking,
7144 [ --with-static-checking=path/to/gcc_dehydra.so
7145 Enable static checking of code using GCC-dehydra],
7146 DEHYDRA_PATH=$withval,
7149 if test -n "$DEHYDRA_PATH"; then
7150 if test ! -f "$DEHYDRA_PATH"; then
7151 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
7153 AC_DEFINE(NS_STATIC_CHECKING)
7155 AC_SUBST(DEHYDRA_PATH)
7157 dnl ========================================================
7158 dnl = Enable stripping of libs & executables
7159 dnl ========================================================
7160 MOZ_ARG_ENABLE_BOOL(strip,
7161 [ --enable-strip Enable stripping of libs & executables ],
7165 dnl ========================================================
7166 dnl = Enable stripping of libs & executables when packaging
7167 dnl ========================================================
7168 MOZ_ARG_ENABLE_BOOL(install-strip,
7169 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
7173 dnl ========================================================
7174 dnl = --enable-elf-dynstr-gc
7175 dnl ========================================================
7176 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
7177 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
7178 USE_ELF_DYNSTR_GC=1,
7179 USE_ELF_DYNSTR_GC= )
7181 dnl ========================================================
7182 dnl = --disable-elf-hack
7183 dnl ========================================================
7186 MOZ_ARG_DISABLE_BOOL(elf-hack,
7187 [ --disable-elf-hack Disable elf hacks],
7191 # Disable elf hack for profiling because the built in profiler
7192 # doesn't read the segments properly with elf hack. This is
7193 # temporary and should be fixed soon in the profiler.
7194 if test "$MOZ_PROFILING" = 1; then
7198 # Only enable elfhack where supported
7199 if test "$USE_ELF_HACK" = 1; then
7200 case "${HOST_OS_ARCH},${OS_ARCH}" in
7202 case "${CPU_ARCH}" in
7217 if test "$USE_ELF_HACK" = 1; then
7218 dnl PT_GNU_RELRO segment makes the dynamic linker set a read-only flag on
7219 dnl memory addresses it maps to. The result is that by the time elfhack
7220 dnl kicks in, it is not possible to apply relocations because of that,
7221 dnl thus elfhack effectively skips relocations inside the PT_GNU_RELRO
7222 dnl segment. It makes elfhack mostly useless, so considering the problems
7223 dnl we have we PT_GNU_RELRO (e.g. bug 664366), and until elfhack can deal
7224 dnl with PT_GNU_RELRO segments, it's just simpler to disable elfhack when
7225 dnl the linker creates PT_GNU_RELRO segments.
7226 AC_CACHE_CHECK([whether linker creates PT_GNU_RELRO segments],
7227 LINK_WITH_PT_GNU_RELRO,
7228 [echo "int main() {return 0;}" > conftest.${ac_ext}
7229 if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.${ac_ext} $LIBS 1>&2) &&
7230 test -s conftest${ac_exeext}; then
7231 if ${TOOLCHAIN_PREFIX}readelf -l conftest${ac_exeext} | grep GNU_RELRO > /dev/null; then
7232 LINK_WITH_PT_GNU_RELRO=yes
7234 LINK_WITH_PT_GNU_RELRO=no
7237 dnl We really don't expect to get here, but just in case
7238 AC_ERROR([couldn't compile a simple C file])
7241 if test "$LINK_WITH_PT_GNU_RELRO" = yes; then
7242 AC_MSG_WARN([Disabling elfhack])
7247 dnl ========================================================
7248 dnl = libstdc++ compatibility hacks
7249 dnl ========================================================
7252 MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
7253 [ --enable-stdcxx-compat Enable compatibility with older libstdc++],
7256 AC_SUBST(STDCXX_COMPAT)
7258 if test -n "$STDCXX_COMPAT"; then
7259 eval $(CXX="$CXX" MACOS_SDK_DIR="$MACOS_SDK_DIR" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
7260 AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION)
7261 AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION)
7264 dnl ========================================================
7266 dnl = Profiling and Instrumenting
7268 dnl ========================================================
7269 MOZ_ARG_HEADER(Profiling and Instrumenting)
7271 dnl ========================================================
7272 dnl = Enable NS_FUNCTION_TIMER, which provides Function
7273 dnl = timing for identifying code bottlenecks
7274 dnl = NS_FUNCTION_TIMER is off by default.
7275 dnl ========================================================
7276 MOZ_ARG_ENABLE_BOOL(functiontimer,
7277 [ --enable-functiontimer Enable NS_FUNCTION_TIMER ],
7278 NS_FUNCTION_TIMER=1,
7279 NS_FUNCTION_TIMER= )
7280 if test -n "$NS_FUNCTION_TIMER"; then
7281 AC_DEFINE(NS_FUNCTION_TIMER)
7284 dnl ========================================================
7285 dnl = Enable runtime visual profiling logger
7286 dnl ========================================================
7287 MOZ_ARG_ENABLE_BOOL(visual-event-tracer,
7288 [ --enable-visual-event-tracer Enable visual event tracer instrumentation],
7289 MOZ_VISUAL_EVENT_TRACER=1,
7290 MOZ_VISUAL_EVENT_TRACER=)
7291 if test -n "$MOZ_VISUAL_EVENT_TRACER"; then
7292 AC_DEFINE(MOZ_VISUAL_EVENT_TRACER)
7295 dnl ========================================================
7296 dnl Turn on reflow counting
7297 dnl ========================================================
7298 MOZ_ARG_ENABLE_BOOL(reflow-perf,
7299 [ --enable-reflow-perf Enable reflow performance tracing],
7302 if test -n "$MOZ_REFLOW_PERF"; then
7303 AC_DEFINE(MOZ_REFLOW_PERF)
7306 dnl ========================================================
7307 dnl Enable code size metrics.
7308 dnl ========================================================
7309 MOZ_ARG_ENABLE_BOOL(codesighs,
7310 [ --enable-codesighs Enable code size analysis tools],
7311 _ENABLE_CODESIGHS=1,
7312 _ENABLE_CODESIGHS= )
7313 if test -n "$_ENABLE_CODESIGHS"; then
7314 if test -d $srcdir/tools/codesighs; then
7317 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
7321 dnl ========================================================
7322 dnl = Enable Radio Interface for B2G (Gonk usually)
7323 dnl ========================================================
7324 MOZ_ARG_ENABLE_BOOL(b2g-ril,
7325 [ --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ],
7328 if test -n "$MOZ_B2G_RIL"; then
7329 AC_DEFINE(MOZ_B2G_RIL)
7331 AC_SUBST(MOZ_B2G_RIL)
7333 dnl ========================================================
7334 dnl = Enable Bluetooth Interface for B2G (Gonk usually)
7335 dnl ========================================================
7336 MOZ_ARG_ENABLE_BOOL(b2g-bt,
7337 [ --enable-b2g-bt Set compile flags necessary for compiling Bluetooth API for B2G ],
7340 if test -n "$MOZ_B2G_BT"; then
7341 AC_DEFINE(MOZ_B2G_BT)
7343 AC_SUBST(MOZ_B2G_BT)
7345 dnl ========================================================
7346 dnl = Enable Support for System Messages API
7347 dnl ========================================================
7348 if test -n "$MOZ_SYS_MSG"; then
7349 AC_DEFINE(MOZ_SYS_MSG)
7351 AC_SUBST(MOZ_SYS_MSG)
7353 dnl ========================================================
7354 dnl = Enable Camera Interface for B2G (Gonk usually)
7355 dnl ========================================================
7356 MOZ_ARG_ENABLE_BOOL(b2g-camera,
7357 [ --enable-b2g-camera Set compile flags necessary for compiling camera API for B2G ],
7360 if test -n "$MOZ_B2G_CAMERA"; then
7361 AC_DEFINE(MOZ_B2G_CAMERA)
7363 AC_SUBST(MOZ_B2G_CAMERA)
7365 dnl ========================================================
7366 dnl = Support for demangling undefined symbols
7367 dnl ========================================================
7368 if test -z "$SKIP_LIBRARY_CHECKS"; then
7371 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
7375 # Demangle only for debug or trace-malloc builds
7376 MOZ_DEMANGLE_SYMBOLS=
7377 if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
7378 MOZ_DEMANGLE_SYMBOLS=1
7379 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
7381 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
7383 dnl ========================================================
7384 dnl = Support for gcc stack unwinding (from gcc 3.3)
7385 dnl ========================================================
7386 if test -z "$SKIP_LIBRARY_CHECKS"; then
7387 MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
7390 dnl ========================================================
7392 dnl ========================================================
7394 MOZ_ARG_WITH_STRING(jitreport-granularity,
7395 [ --jitreport-granularity=N
7396 Default granularity at which to report JIT code
7399 1 - code ranges for whole functions only
7400 2 - per-line information
7401 3 - per-op information],
7402 JITREPORT_GRANULARITY=$withval,
7403 JITREPORT_GRANULARITY=3)
7405 AC_DEFINE_UNQUOTED(JS_DEFAULT_JITREPORT_GRANULARITY, $JITREPORT_GRANULARITY)
7407 dnl ========================================================
7411 dnl ========================================================
7412 MOZ_ARG_HEADER(Misc. Options)
7414 dnl ========================================================
7415 dnl update xterm title
7416 dnl ========================================================
7417 MOZ_ARG_ENABLE_BOOL(xterm-updates,
7418 [ --enable-xterm-updates Update XTERM titles with current command.],
7422 dnl =========================================================
7424 dnl =========================================================
7425 MOZ_ARG_ENABLE_STRING([chrome-format],
7426 [ --enable-chrome-format=jar|flat|both|symlink|omni
7427 Select FORMAT of chrome files (default=jar)],
7428 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
7430 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
7431 MOZ_CHROME_FILE_FORMAT=jar
7434 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
7435 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
7436 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
7437 test "$MOZ_CHROME_FILE_FORMAT" != "both" &&
7438 test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then
7439 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, symlink, or omni])
7442 dnl =========================================================
7443 dnl Omnijar packaging (bug 552121)
7444 dnl =========================================================
7445 dnl Omnijar packaging is compatible with flat packaging.
7446 dnl In unpackaged builds, omnijar looks for files as if
7447 dnl things were flat packaged. After packaging, all files
7448 dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT
7449 dnl is set to flat since putting files into jars is only
7450 dnl done during packaging with omnijar.
7451 if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
7453 AC_DEFINE(MOZ_OMNIJAR)
7454 if test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2" -o "$OS_TARGET" = "Android"; then
7455 MOZ_CHROME_FILE_FORMAT=flat
7457 MOZ_CHROME_FILE_FORMAT=symlink
7459 elif test "$MOZ_CHROME_FILE_FORMAT" = "jar"; then
7460 AC_DEFINE(MOZ_CHROME_FILE_FORMAT_JAR)
7463 OMNIJAR_NAME=omni.ja
7464 AC_SUBST(OMNIJAR_NAME)
7465 AC_SUBST(MOZ_OMNIJAR)
7467 dnl ========================================================
7468 dnl = Define default location for MOZILLA_FIVE_HOME
7469 dnl ========================================================
7470 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
7471 [ --with-default-mozilla-five-home
7472 Set the default value for MOZILLA_FIVE_HOME],
7473 [ val=`echo $withval`
7474 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7476 dnl ========================================================
7477 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7478 dnl ========================================================
7479 MOZ_ARG_WITH_STRING(user-appdir,
7480 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
7481 [ val=`echo $withval`
7482 if echo "$val" | grep "\/" >/dev/null; then
7483 AC_MSG_ERROR("Homedir must be single relative path.")
7488 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7490 dnl ========================================================
7491 dnl = Doxygen configuration
7492 dnl ========================================================
7493 dnl Use commas to specify multiple dirs to this arg
7494 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7495 MOZ_ARG_WITH_STRING(doc-input-dirs,
7496 [ --with-doc-input-dirs=DIRS
7497 Header/idl dirs to create docs from],
7498 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7499 AC_SUBST(MOZ_DOC_INPUT_DIRS)
7501 dnl Use commas to specify multiple dirs to this arg
7502 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7503 MOZ_ARG_WITH_STRING(doc-include-dirs,
7504 [ --with-doc-include-dirs=DIRS
7505 Include dirs to preprocess doc headers],
7506 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7507 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7509 MOZ_DOC_OUTPUT_DIR='./dist/docs'
7510 MOZ_ARG_WITH_STRING(doc-output-dir,
7511 [ --with-doc-output-dir=DIR
7512 Dir to generate docs into],
7513 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
7514 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7516 if test -z "$SKIP_COMPILER_CHECKS"; then
7517 dnl ========================================================
7519 dnl = Compiler Options
7521 dnl ========================================================
7522 MOZ_ARG_HEADER(Compiler Options)
7524 dnl ========================================================
7525 dnl Check for gcc -pipe support
7526 dnl ========================================================
7527 AC_MSG_CHECKING([for -pipe support])
7528 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
7529 dnl Any gcc that supports firefox supports -pipe.
7530 CFLAGS="$CFLAGS -pipe"
7531 CXXFLAGS="$CXXFLAGS -pipe"
7532 AC_MSG_RESULT([yes])
7537 dnl ========================================================
7538 dnl Profile guided optimization (gcc checks)
7539 dnl ========================================================
7540 dnl Test for profiling options
7541 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7543 _SAVE_CFLAGS="$CFLAGS"
7544 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
7546 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7547 AC_TRY_COMPILE([], [return 0;],
7548 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
7549 result="yes" ], result="no")
7550 AC_MSG_RESULT([$result])
7552 if test $result = "yes"; then
7553 PROFILE_GEN_LDFLAGS="-fprofile-generate"
7554 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
7555 PROFILE_USE_LDFLAGS="-fprofile-use"
7558 CFLAGS="$_SAVE_CFLAGS"
7560 if test -n "$INTEL_CC"; then
7561 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7562 PROFILE_GEN_LDFLAGS=
7563 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7564 PROFILE_USE_LDFLAGS=
7567 dnl Sun Studio on Solaris
7568 if test "$SOLARIS_SUNPRO_CC"; then
7569 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7570 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7571 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7572 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7575 AC_SUBST(PROFILE_GEN_CFLAGS)
7576 AC_SUBST(PROFILE_GEN_LDFLAGS)
7577 AC_SUBST(PROFILE_USE_CFLAGS)
7578 AC_SUBST(PROFILE_USE_LDFLAGS)
7582 dnl ========================================================
7583 dnl Test for -pedantic bustage
7584 dnl ========================================================
7585 MOZ_ARG_DISABLE_BOOL(pedantic,
7586 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7588 if test "$_PEDANTIC"; then
7589 _SAVE_CXXFLAGS=$CXXFLAGS
7590 CXXFLAGS="$CXXFLAGS -pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
7591 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7592 AC_TRY_COMPILE([$configure_static_assert_macros],
7593 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7594 result="no", result="yes" )
7595 AC_MSG_RESULT([$result])
7596 CXXFLAGS="$_SAVE_CXXFLAGS"
7600 _WARNINGS_CFLAGS="-pedantic ${_WARNINGS_CFLAGS} -Wno-long-long"
7601 _WARNINGS_CXXFLAGS="-pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
7604 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7609 dnl ========================================================
7610 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7611 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7612 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7613 dnl ========================================================
7614 _SAVE_CXXFLAGS=$CXXFLAGS
7615 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7616 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7617 ac_nscap_nonconst_opeq_bug,
7626 template <class T, class U>
7627 int operator==(const Pointer<T>& rhs, U* lhs)
7629 return rhs.myPtr == lhs;
7632 template <class T, class U>
7633 int operator==(const Pointer<T>& rhs, const U* lhs)
7635 return rhs.myPtr == lhs;
7643 ac_nscap_nonconst_opeq_bug="no",
7644 ac_nscap_nonconst_opeq_bug="yes")])
7645 CXXFLAGS="$_SAVE_CXXFLAGS"
7647 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7648 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7650 fi # ! SKIP_COMPILER_CHECKS
7652 AC_DEFINE(CPP_THROW_NEW, [throw()])
7655 if test "$COMPILE_ENVIRONMENT"; then
7657 fi # COMPILE_ENVIRONMENT
7659 dnl ========================================================
7661 dnl = Build depencency options
7663 dnl ========================================================
7664 MOZ_ARG_HEADER(Build dependencies)
7666 dnl ========================================================
7667 dnl = Do not auto generate dependency info
7668 dnl ========================================================
7670 MOZ_ARG_DISABLE_BOOL(auto-deps,
7671 [ --disable-auto-deps Do not automatically generate dependency info],
7675 if test -n "$MOZ_AUTO_DEPS"; then
7676 dnl ========================================================
7677 dnl = Use mkdepend instead of $CC -MD for dependency generation
7678 dnl ========================================================
7680 MOZ_ARG_DISABLE_BOOL(md,
7681 [ --disable-md Do not use compiler-based dependencies ],
7684 [dnl Default is to turn on -MD if using GNU-compatible compilers
7685 if test "$GNU_CC" -a "$GNU_CXX"; then
7688 dnl Default is to use -xM if using Sun Studio on Solaris
7689 if test "$SOLARIS_SUNPRO_CC"; then
7692 if test "$_cpp_md_flag"; then
7694 _DEPEND_CFLAGS='$(filter-out %/.pp,-MMD -MF $(MDDEPDIR)/$(@F).pp)'
7695 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7696 if test "$SOLARIS_SUNPRO_CC"; then
7701 dnl Don't override this for MSVC
7702 if test -z "$_WIN32_MSVC"; then
7703 _USE_CPP_INCLUDE_FLAG=
7704 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7705 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7707 echo '#include <stdio.h>' > dummy-hello.c
7709 CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'`
7711 if test -z "$CL_INCLUDES_PREFIX"; then
7712 AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
7714 AC_SUBST(CL_INCLUDES_PREFIX)
7721 AC_SUBST(MOZ_AUTO_DEPS)
7722 AC_SUBST(COMPILER_DEPEND)
7725 dnl ========================================================
7727 dnl = Static Build Options
7729 dnl ========================================================
7730 MOZ_ARG_HEADER(Static build options)
7732 # split JS out by default to avoid VS2005 PGO crash (bug 591836).
7733 if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" != "x86_64" ; then
7737 MOZ_ARG_ENABLE_BOOL(shared-js,
7738 [ --enable-shared-js
7739 Create a shared JavaScript library.],
7743 if test -n "$ENABLE_SHARED_JS"; then
7745 MOZ_JS_LIBS="$MOZ_JS_SHARED_LIBS"
7747 MOZ_JS_LIBS="$MOZ_JS_STATIC_LIBS"
7748 AC_DEFINE(MOZ_STATIC_JS)
7750 AC_SUBST(JS_SHARED_LIBRARY)
7752 AC_SUBST(LIBXUL_LIBS)
7753 XPCOM_LIBS="$LIBXUL_LIBS"
7755 dnl ========================================================
7757 dnl = Standalone module options
7759 dnl ========================================================
7760 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7763 dnl ========================================================
7765 if test -z "$SKIP_PATH_CHECKS"; then
7766 if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
7767 if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then
7768 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7773 if test -z "${GLIB_GMODULE_LIBS}" \
7774 -a -n "${GLIB_CONFIG}"\
7775 -a "${GLIB_CONFIG}" != no\
7777 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7780 AC_SUBST(GLIB_CFLAGS)
7782 AC_SUBST(GLIB_GMODULE_LIBS)
7784 dnl ========================================================
7785 dnl Graphics checks.
7786 dnl ========================================================
7788 if test "${OS_TARGET}" = "WINNT" -o "${OS_ARCH}" = "Darwin" -o "${MOZ_WIDGET_TOOLKIT}" = "android" -o "${MOZ_WIDGET_TOOLKIT}" = "gtk2"; then
7794 MOZ_ARG_ENABLE_BOOL(skia,
7795 [ --enable-skia Enable use of Skia],
7799 if test "$USE_FC_FREETYPE"; then
7800 if test "$COMPILE_ENVIRONMENT"; then
7801 dnl ========================================================
7802 dnl = Check for freetype2 and its functionality
7803 dnl ========================================================
7804 PKG_CHECK_MODULES(FT2, freetype2 >= 6.1.0, _HAVE_FREETYPE2=1, _HAVE_FREETYPE2=)
7806 if test "$_HAVE_FREETYPE2"; then
7808 _SAVE_CFLAGS="$CFLAGS"
7809 LIBS="$LIBS $FT2_LIBS"
7810 CFLAGS="$CFLAGS $FT2_CFLAGS"
7812 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
7813 ac_cv_member_FT_Bitmap_Size_y_ppem,
7814 [AC_TRY_COMPILE([#include <ft2build.h>
7815 #include FT_FREETYPE_H],
7817 if (sizeof s.y_ppem) return 0;
7819 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
7820 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
7821 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
7822 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
7824 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
7826 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
7827 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
7828 [FT_Bitmap_Size structure includes y_ppem field])
7830 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
7833 CFLAGS="$_SAVE_CFLAGS"
7836 _SAVE_CPPFLAGS="$CPPFLAGS"
7837 CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
7838 MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
7839 [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
7840 CPPFLAGS="$_SAVE_CPPFLAGS"
7842 AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
7845 PKG_CHECK_MODULES(_FONTCONFIG, fontconfig,
7847 if test "$MOZ_PANGO"; then
7848 MOZ_PANGO_CFLAGS="$MOZ_PANGO_CFLAGS $_FONTCONFIG_CFLAGS"
7849 MOZ_PANGO_LIBS="$MOZ_PANGO_LIBS $_FONTCONFIG_LIBS"
7851 FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
7852 FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
7857 dnl ========================================================
7858 dnl Check for pixman and cairo
7859 dnl ========================================================
7862 MOZ_ARG_ENABLE_BOOL(system-cairo,
7863 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7868 MOZ_ARG_ENABLE_BOOL(system-pixman,
7869 [ --enable-system-pixman Use system pixman (located with pkgconfig)],
7871 MOZ_TREE_PIXMAN=force,
7874 # System cairo depends on system pixman
7875 if test "$MOZ_TREE_PIXMAN" = "force"; then
7876 if test -z "$MOZ_TREE_CAIRO"; then
7877 AC_MSG_ERROR([--disable-system-pixman is incompatible with --enable-system-cairo.])
7881 elif test -z "$MOZ_TREE_CAIRO"; then
7885 if test "$MOZ_TREE_PIXMAN"; then
7886 AC_DEFINE(MOZ_TREE_PIXMAN)
7887 MOZ_PIXMAN_CFLAGS=""
7888 MOZ_PIXMAN_LIBS='$(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
7890 PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.19.2)
7891 MOZ_PIXMAN_CFLAGS="$PIXMAN_CFLAGS"
7892 MOZ_PIXMAN_LIBS="$PIXMAN_LIBS"
7894 AC_SUBST(MOZ_PIXMAN_CFLAGS)
7895 AC_SUBST(MOZ_PIXMAN_LIBS)
7897 # Check for headers defining standard int types.
7898 MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7900 if test "$MOZ_TREE_CAIRO"; then
7901 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7902 AC_DEFINE(MOZ_TREE_CAIRO)
7904 # For now we assume that we will have a uint64_t available through
7905 # one of the above headers or mozstdint.h.
7906 AC_DEFINE(HAVE_UINT64_T)
7908 # Define macros for cairo-features.h
7909 TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1"
7910 if test "$MOZ_X11"; then
7911 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7912 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7913 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7914 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7915 MOZ_ENABLE_CAIRO_FT=1
7916 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7918 case "$MOZ_WIDGET_TOOLKIT" in
7920 QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
7923 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7924 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7925 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7928 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7929 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7930 if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
7931 WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
7932 WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
7933 MOZ_ENABLE_D2D_SURFACE=1
7934 MOZ_ENABLE_DWRITE_FONT=1
7936 WIN32_DWRITE_FONT_FEATURE=
7937 WIN32_D2D_SURFACE_FEATURE=
7940 MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1)
7942 dnl D3D10 Layers depend on D2D Surfaces.
7943 if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
7944 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
7948 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7949 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7950 MOZ_ENABLE_CAIRO_FT=1
7951 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7952 CAIRO_FT_OSLIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7956 if test "$USE_FC_FREETYPE"; then
7957 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7959 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7960 AC_SUBST(MOZ_ENABLE_DWRITE_FONT)
7961 AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
7962 AC_SUBST(MOZ_ENABLE_D3D9_LAYER)
7963 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
7964 AC_SUBST(CAIRO_FT_CFLAGS)
7966 AC_SUBST(PS_SURFACE_FEATURE)
7967 AC_SUBST(PDF_SURFACE_FEATURE)
7968 AC_SUBST(SVG_SURFACE_FEATURE)
7969 AC_SUBST(XLIB_SURFACE_FEATURE)
7970 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7971 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7972 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7973 AC_SUBST(WIN32_SURFACE_FEATURE)
7974 AC_SUBST(OS2_SURFACE_FEATURE)
7975 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7976 AC_SUBST(FT_FONT_FEATURE)
7977 AC_SUBST(FC_FONT_FEATURE)
7978 AC_SUBST(WIN32_FONT_FEATURE)
7979 AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
7980 AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
7981 AC_SUBST(QUARTZ_FONT_FEATURE)
7982 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7983 AC_SUBST(QT_SURFACE_FEATURE)
7984 AC_SUBST(TEE_SURFACE_FEATURE)
7986 MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src)'" $CAIRO_FT_LIBS"
7987 MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'
7989 if test "$MOZ_X11"; then
7990 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
7993 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7995 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
7996 MOZ_CAIRO_CFLAGS="$CAIRO_CFLAGS"
7997 MOZ_CAIRO_LIBS="$CAIRO_LIBS"
7998 PKG_CHECK_MODULES(CAIRO_TEE, cairo-tee >= $CAIRO_VERSION)
7999 if test "$MOZ_X11"; then
8000 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
8001 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
8002 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_LIBS"
8003 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
8007 AC_SUBST(MOZ_TREE_CAIRO)
8008 AC_SUBST(MOZ_CAIRO_CFLAGS)
8009 AC_SUBST(MOZ_CAIRO_LIBS)
8010 AC_SUBST(MOZ_CAIRO_OSLIBS)
8011 AC_SUBST(MOZ_TREE_PIXMAN)
8013 dnl ========================================================
8015 dnl ========================================================
8017 QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'
8020 dnl ========================================================
8022 dnl ========================================================
8023 MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
8024 AC_SUBST(MOZ_HARFBUZZ_LIBS)
8026 dnl ========================================================
8028 dnl ========================================================
8029 if test "$MOZ_GRAPHITE"; then
8030 MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
8031 AC_DEFINE(MOZ_GRAPHITE)
8035 AC_SUBST(MOZ_GRAPHITE)
8036 AC_SUBST(MOZ_GRAPHITE_LIBS)
8038 dnl ========================================================
8040 dnl ========================================================
8041 MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
8042 AC_SUBST(MOZ_OTS_LIBS)
8044 dnl ========================================================
8046 dnl ========================================================
8047 if test "$MOZ_ENABLE_SKIA"; then
8048 MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
8049 AC_DEFINE(MOZ_ENABLE_SKIA)
8053 AC_SUBST(MOZ_ENABLE_SKIA)
8054 AC_SUBST(MOZ_SKIA_LIBS)
8056 dnl ========================================================
8058 dnl ========================================================
8059 MOZ_ARG_DISABLE_BOOL(xul,
8060 [ --disable-xul Disable XUL],
8062 if test "$MOZ_XUL"; then
8065 dnl remove extensions that require XUL
8066 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
8071 dnl ========================================================
8072 dnl disable profile locking
8073 dnl do no use this in applications that can have more than
8074 dnl one process accessing the profile directory.
8075 dnl ========================================================
8076 MOZ_ARG_DISABLE_BOOL(profilelocking,
8077 [ --disable-profilelocking
8078 Disable profile locking],
8079 MOZ_PROFILELOCKING=,
8080 MOZ_PROFILELOCKING=1 )
8081 if test "$MOZ_PROFILELOCKING"; then
8082 AC_DEFINE(MOZ_PROFILELOCKING)
8085 dnl ========================================================
8086 dnl necko configuration options
8087 dnl ========================================================
8090 dnl option to disable various necko protocols
8092 MOZ_ARG_ENABLE_STRING(necko-protocols,
8093 [ --enable-necko-protocols[={http,ftp,default,all,none}]
8094 Enable/disable specific protocol handlers],
8095 [ for option in `echo $enableval | sed 's/,/ /g'`; do
8096 if test "$option" = "yes" -o "$option" = "all"; then
8097 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8098 elif test "$option" = "no" -o "$option" = "none"; then
8100 elif test "$option" = "default"; then
8101 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8102 elif test `echo "$option" | grep -c \^-` != 0; then
8103 option=`echo $option | sed 's/^-//'`
8104 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
8106 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
8109 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
8111 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
8112 AC_SUBST(NECKO_PROTOCOLS)
8113 for p in $NECKO_PROTOCOLS; do
8114 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
8115 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_PROTOCOL_$p"
8119 dnl option to disable necko's wifi scanner
8121 MOZ_ARG_DISABLE_BOOL(necko-wifi,
8122 [ --disable-necko-wifi Disable necko wifi scanner],
8126 if test "$OS_ARCH" = "OS2"; then
8127 dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
8130 if test "$NECKO_WIFI" -a \
8131 "$OS_ARCH" != "Linux" -a \
8132 "$OS_ARCH" != "Darwin" -a \
8133 "$OS_ARCH" != "SunOS" -a \
8134 "$OS_ARCH" != "WINNT"; then
8135 AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
8138 if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
8140 MOZ_CHECK_HEADER([iwlib.h])
8141 if test "$ac_cv_header_iwlib_h" != "yes"; then
8142 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])
8146 if test "$NECKO_WIFI"; then
8147 AC_DEFINE(NECKO_WIFI)
8148 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
8150 AC_SUBST(NECKO_WIFI)
8153 dnl option to disable cookies
8155 MOZ_ARG_DISABLE_BOOL(cookies,
8156 [ --disable-cookies Disable cookie support],
8159 AC_SUBST(NECKO_COOKIES)
8160 if test "$NECKO_COOKIES"; then
8161 AC_DEFINE(NECKO_COOKIES)
8162 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES"
8166 dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
8168 MOZ_ARG_DISABLE_BOOL(ctypes,
8169 [ --disable-ctypes Disable js-ctypes],
8172 AC_SUBST(BUILD_CTYPES)
8173 if test "$BUILD_CTYPES"; then
8174 AC_DEFINE(BUILD_CTYPES)
8177 dnl Build Places if required
8178 if test "$MOZ_PLACES"; then
8179 AC_DEFINE(MOZ_PLACES)
8182 dnl Build Apps in the Cloud (AITC) if required
8183 AC_SUBST(MOZ_SERVICES_AITC)
8184 if test -n "$MOZ_SERVICES_AITC"; then
8185 AC_DEFINE(MOZ_SERVICES_AITC)
8188 dnl Build Notifications if required
8189 AC_SUBST(MOZ_SERVICES_NOTIFICATIONS)
8190 if test -n "$MOZ_SERVICES_NOTIFICATIONS"; then
8191 AC_DEFINE(MOZ_SERVICES_NOTIFICATIONS)
8194 dnl Build Sync Services if required
8195 AC_SUBST(MOZ_SERVICES_SYNC)
8196 if test -n "$MOZ_SERVICES_SYNC"; then
8197 AC_DEFINE(MOZ_SERVICES_SYNC)
8200 dnl ========================================================
8201 if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
8202 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
8205 if test "$MOZ_APP_COMPONENT_INCLUDE"; then
8206 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_INCLUDE, "$MOZ_APP_COMPONENT_INCLUDE")
8209 if test "$MOZ_APP_COMPONENT_MODULES"; then
8210 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_MODULES, $MOZ_APP_COMPONENT_MODULES)
8213 dnl ========================================================
8215 dnl = Maintainer debug option (no --enable equivalent)
8217 dnl ========================================================
8222 AC_SUBST(AR_EXTRACT)
8226 AC_SUBST(AS_DASH_C_FLAG)
8235 AC_SUBST(MOZ_WIDGET_TOOLKIT)
8236 AC_SUBST(MOZ_UPDATE_XTERM)
8237 AC_SUBST(MOZ_PLATFORM_MAEMO)
8238 AC_SUBST(MOZ_AUTH_EXTENSION)
8239 AC_SUBST(MOZ_PERMISSIONS)
8241 AC_SUBST(MOZ_PREF_EXTENSIONS)
8242 AC_SUBST(MOZ_JS_LIBS)
8245 AC_SUBST(MOZ_DEBUG_SYMBOLS)
8246 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
8247 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
8248 AC_SUBST(MOZ_DEBUG_FLAGS)
8249 AC_SUBST(MOZ_DEBUG_LDFLAGS)
8250 AC_SUBST(WARNINGS_AS_ERRORS)
8251 AC_SUBST(MOZ_EXTENSIONS)
8252 AC_SUBST(MOZ_JSDEBUGGER)
8253 AC_SUBST(MOZ_ENABLE_PROFILER_SPS)
8256 AC_SUBST(MOZ_CALLGRIND)
8259 AC_SUBST(MOZ_PROFILING)
8261 AC_SUBST(MOZ_PLACES)
8262 AC_SUBST(MOZ_TOOLKIT_SEARCH)
8264 AC_SUBST(NS_PRINTING)
8266 AC_SUBST(MOZ_HELP_VIEWER)
8267 AC_SUBST(TOOLCHAIN_PREFIX)
8273 AC_SUBST(MOZ_PROFILELOCKING)
8275 AC_SUBST(ENABLE_TESTS)
8276 AC_SUBST(ENABLE_MARIONETTE)
8278 AC_SUBST(MOZ_UNIVERSALCHARDET)
8279 AC_SUBST(ACCESSIBILITY)
8280 AC_SUBST(MOZ_SPELLCHECK)
8281 AC_SUBST(MOZ_JAVA_COMPOSITOR)
8282 AC_SUBST(MOZ_ONLY_TOUCH_EVENTS)
8283 AC_SUBST(MOZ_CRASHREPORTER)
8284 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
8285 AC_SUBST(MOZ_MAINTENANCE_SERVICE)
8286 AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
8287 AC_SUBST(MOZ_ENABLE_SIGNMAR)
8288 AC_SUBST(MOZ_UPDATER)
8289 AC_SUBST(MOZ_ANGLE_RENDERER)
8290 AC_SUBST(MOZ_DIRECTX_SDK_PATH)
8291 AC_SUBST(MOZ_DIRECTX_SDK_CPU_SUFFIX)
8292 AC_SUBST(MOZ_D3DX9_VERSION)
8293 AC_SUBST(MOZ_D3DX9_CAB)
8294 AC_SUBST(MOZ_D3DCOMPILER_CAB)
8295 AC_SUBST(MOZ_D3DX9_DLL)
8296 AC_SUBST(MOZ_D3DCOMPILER_DLL)
8299 AC_SUBST(MOZ_ANDROID_HISTORY)
8300 AC_SUBST(MOZ_WEBSMS_BACKEND)
8301 AC_SUBST(ENABLE_STRIP)
8302 AC_SUBST(PKG_SKIP_STRIP)
8303 AC_SUBST(STRIP_FLAGS)
8304 AC_SUBST(USE_ELF_DYNSTR_GC)
8305 AC_SUBST(USE_ELF_HACK)
8306 AC_SUBST(INCREMENTAL_LINKER)
8307 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
8308 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
8310 AC_SUBST(MOZ_FIX_LINK_PATHS)
8311 AC_SUBST(XPCOM_LIBS)
8312 AC_SUBST(XPCOM_FROZEN_LDOPTS)
8313 AC_SUBST(XPCOM_GLUE_LDOPTS)
8314 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
8315 AC_SUBST(XPCOM_STATICRUNTIME_GLUE_LDOPTS)
8316 AC_SUBST(XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS)
8318 AC_SUBST(USE_DEPENDENT_LIBS)
8320 AC_SUBST(MOZ_BUILD_ROOT)
8321 AC_SUBST(MOZ_OS2_TOOLS)
8323 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8324 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8325 AC_SUBST(MOZ_LINKER_EXTRACT)
8326 AC_SUBST(MOZ_PER_WINDOW_PRIVATE_BROWSING)
8328 dnl ========================================================
8329 dnl = Mac bundle name prefix
8330 dnl ========================================================
8331 MOZ_ARG_WITH_STRING(macbundlename-prefix,
8332 [ --with-macbundlename-prefix=prefix
8333 Prefix for MOZ_MACBUNDLE_NAME],
8334 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
8336 MOZ_MACBUNDLE_NAME=`echo $MOZ_APP_DISPLAYNAME | tr -d ' '`
8337 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
8338 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
8341 if test "$MOZ_DEBUG"; then
8342 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}Debug.app
8344 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
8346 AC_SUBST(MOZ_MACBUNDLE_NAME)
8348 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
8349 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr '[A-Z]' '[a-z]'`
8350 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
8351 if test "$MOZ_DEBUG"; then
8352 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
8355 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
8356 AC_SUBST(MOZ_MACBUNDLE_ID)
8358 # The following variables are available to branding and application
8359 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
8360 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
8361 # impacts profile location and user-visible fields.
8362 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
8363 # versions of a given application (e.g. Aurora and Firefox both use
8364 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
8365 # for application.ini's "Name" field, which controls profile location in
8366 # the absence of a "Profile" field (see below), and various system
8367 # integration hooks (Unix remoting, Windows MessageWindow name, etc.)
8368 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
8369 # Mac Bundle name, Updater, Installer), it is typically used for nightly
8370 # builds (e.g. Aurora for Firefox).
8371 # - MOZ_APP_VERSION: Defines the application version number.
8372 # - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
8373 # defaults to a lowercase form of MOZ_APP_BASENAME.
8374 # - MOZ_APP_PROFILE: When set, used for application.ini's
8375 # "Profile" field, which controls profile location.
8376 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
8377 # crash reporter server url.
8378 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
8379 # - MOZ_EXTENSION_MANAGER: When set, enabled extension manager.
8381 if test -z "$MOZ_APP_NAME"; then
8382 MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
8385 # For extensions and langpacks, we require a max version that is compatible
8386 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
8387 # 10.0a1 and 10.0a2 aren't affected
8388 # 10.0 becomes 10.0.*
8389 # 10.0.1 becomes 10.0.*
8390 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
8391 if test -z "$IS_ALPHA"; then
8393 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*.[0-9]*\).*|\1|"`.*
8396 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
8399 AC_SUBST(MOZ_APP_NAME)
8400 AC_SUBST(MOZ_APP_DISPLAYNAME)
8401 AC_SUBST(MOZ_APP_BASENAME)
8402 AC_SUBST(MOZ_APP_VENDOR)
8403 AC_SUBST(MOZ_APP_PROFILE)
8404 AC_SUBST(MOZ_APP_ID)
8405 AC_SUBST(MAR_CHANNEL_ID)
8406 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
8407 AC_SUBST(MOZ_PROFILE_MIGRATOR)
8408 AC_SUBST(MOZ_EXTENSION_MANAGER)
8409 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
8410 AC_SUBST(MOZ_APP_UA_NAME)
8411 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
8412 AC_SUBST(MOZ_APP_VERSION)
8413 AC_SUBST(MOZ_APP_MAXVERSION)
8414 AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIREFOX_VERSION)
8415 AC_SUBST(FIREFOX_VERSION)
8416 AC_SUBST(MOZ_UA_OS_AGNOSTIC)
8417 if test -n "$MOZ_UA_OS_AGNOSTIC"; then
8418 AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
8421 # We can't use the static application.ini data when building against
8423 if test -n "$LIBXUL_SDK"; then
8426 AC_SUBST(MOZ_APP_STATIC_INI)
8428 AC_SUBST(MOZ_PKG_SPECIAL)
8430 AC_SUBST(MOZILLA_OFFICIAL)
8432 if test "$MOZ_TELEMETRY_REPORTING"; then
8433 AC_DEFINE(MOZ_TELEMETRY_REPORTING)
8437 AC_SUBST(MOZ_MAPINFO)
8438 AC_SUBST(MOZ_BROWSE_INFO)
8439 AC_SUBST(MOZ_TOOLS_DIR)
8440 AC_SUBST(WIN32_REDIST_DIR)
8443 dnl Echo the CFLAGS to remove extra whitespace.
8449 $_WARNINGS_CXXFLAGS \
8452 COMPILE_CFLAGS=`echo \
8457 COMPILE_CXXFLAGS=`echo \
8458 $_DEFINES_CXXFLAGS \
8462 AC_SUBST(MOZ_NATIVE_MAKEDEPEND)
8463 AC_SUBST(SYSTEM_LIBXUL)
8464 AC_SUBST(MOZ_NATIVE_JPEG)
8465 AC_SUBST(MOZ_NATIVE_PNG)
8466 AC_SUBST(MOZ_NATIVE_BZ2)
8468 AC_SUBST(MOZ_FLEXBOX)
8469 AC_SUBST(MOZ_JPEG_CFLAGS)
8470 AC_SUBST(MOZ_JPEG_LIBS)
8471 AC_SUBST(MOZ_BZ2_CFLAGS)
8472 AC_SUBST(MOZ_BZ2_LIBS)
8473 AC_SUBST(MOZ_PNG_CFLAGS)
8474 AC_SUBST(MOZ_PNG_LIBS)
8476 AC_SUBST(NSPR_CFLAGS)
8478 AC_SUBST(MOZ_NATIVE_NSPR)
8480 AC_SUBST(NSS_CFLAGS)
8482 AC_SUBST(NSS_DEP_LIBS)
8483 AC_SUBST(MOZ_NATIVE_NSS)
8484 AC_SUBST(NSS_DISABLE_DBM)
8487 OS_CXXFLAGS="$CXXFLAGS"
8488 OS_CPPFLAGS="$CPPFLAGS"
8489 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
8490 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
8491 OS_LDFLAGS="$LDFLAGS"
8494 AC_SUBST(OS_CXXFLAGS)
8495 AC_SUBST(OS_CPPFLAGS)
8496 AC_SUBST(OS_COMPILE_CFLAGS)
8497 AC_SUBST(OS_COMPILE_CXXFLAGS)
8498 AC_SUBST(OS_LDFLAGS)
8500 AC_SUBST(CROSS_COMPILE)
8501 AC_SUBST(WCHAR_CFLAGS)
8505 AC_SUBST(HOST_CFLAGS)
8506 AC_SUBST(HOST_CXXFLAGS)
8507 AC_SUBST(HOST_LDFLAGS)
8508 AC_SUBST(HOST_OPTIMIZE_FLAGS)
8510 AC_SUBST(HOST_AR_FLAGS)
8512 AC_SUBST(HOST_RANLIB)
8513 AC_SUBST(HOST_NSPR_MDCPUCFG)
8514 AC_SUBST(HOST_BIN_SUFFIX)
8515 AC_SUBST(HOST_OS_ARCH)
8517 AC_SUBST(TARGET_CPU)
8518 AC_SUBST(TARGET_VENDOR)
8520 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8521 AC_SUBST(TARGET_MD_ARCH)
8522 AC_SUBST(TARGET_XPCOM_ABI)
8525 AC_SUBST(OS_RELEASE)
8528 AC_SUBST(INTEL_ARCHITECTURE)
8530 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8532 AC_SUBST(WRAP_LDFLAGS)
8535 AC_SUBST(MKSHLIB_FORCE_ALL)
8536 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8537 AC_SUBST(DSO_CFLAGS)
8538 AC_SUBST(DSO_PIC_CFLAGS)
8539 AC_SUBST(DSO_LDOPTS)
8540 AC_SUBST(LIB_PREFIX)
8541 AC_SUBST(DLL_PREFIX)
8542 AC_SUBST(DLL_SUFFIX)
8543 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8544 AC_SUBST(LIB_SUFFIX)
8545 AC_SUBST(OBJ_SUFFIX)
8546 AC_SUBST(BIN_SUFFIX)
8547 AC_SUBST(ASM_SUFFIX)
8548 AC_SUBST(IMPORT_LIB_SUFFIX)
8550 AC_SUBST(CC_VERSION)
8551 AC_SUBST(CXX_VERSION)
8552 AC_SUBST(MSMANIFEST_TOOL)
8553 AC_SUBST(NS_ENABLE_TSF)
8554 AC_SUBST(MOZ_NSS_PATCH)
8555 AC_SUBST(MOZ_APP_COMPONENT_LIBS)
8556 AC_SUBST(MOZ_APP_EXTRA_LIBS)
8559 AC_SUBST(MOZ_SYDNEYAUDIO)
8560 AC_SUBST(MOZ_SPEEX_RESAMPLER)
8563 AC_SUBST(MOZ_VORBIS)
8564 AC_SUBST(MOZ_TREMOR)
8567 AC_SUBST(MOZ_MEDIA_PLUGINS)
8568 AC_SUBST(MOZ_OMX_PLUGIN)
8569 AC_SUBST(MOZ_VP8_ERROR_CONCEALMENT)
8570 AC_SUBST(MOZ_VP8_ENCODER)
8573 AC_SUBST(MOZ_ALSA_LIBS)
8574 AC_SUBST(MOZ_ALSA_CFLAGS)
8576 AC_SUBST(VPX_ASFLAGS)
8577 AC_SUBST(VPX_DASH_C_FLAG)
8578 AC_SUBST(VPX_AS_CONVERSION)
8579 AC_SUBST(VPX_ASM_SUFFIX)
8580 AC_SUBST(VPX_X86_ASM)
8581 AC_SUBST(VPX_ARM_ASM)
8582 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT)
8583 AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP)
8584 AC_SUBST(LIBJPEG_TURBO_AS)
8585 AC_SUBST(LIBJPEG_TURBO_ASFLAGS)
8586 AC_SUBST(LIBJPEG_TURBO_X86_ASM)
8587 AC_SUBST(LIBJPEG_TURBO_X64_ASM)
8588 AC_SUBST(LIBJPEG_TURBO_ARM_ASM)
8590 AC_SUBST(MOZ_PACKAGE_JSSHELL)
8592 AC_MSG_CHECKING([for posix_fallocate])
8593 AC_TRY_LINK([#define _XOPEN_SOURCE 600
8594 #include <fcntl.h>],
8595 [posix_fallocate(0, 0, 0);],
8596 [ac_cv___posix_fallocate=true],
8597 [ac_cv___posix_fallocate=false])
8599 if test "$ac_cv___posix_fallocate" = true ; then
8600 AC_DEFINE(HAVE_POSIX_FALLOCATE)
8606 dnl Check for missing components
8607 if test "$COMPILE_ENVIRONMENT"; then
8608 if test "$MOZ_X11"; then
8609 if test "$WITHOUT_X11"; then
8610 AC_MSG_ERROR([--without-x specified and MOZ_X11 still defined])
8612 dnl ====================================================
8613 dnl = Check if X headers exist
8614 dnl ====================================================
8615 _SAVE_CFLAGS=$CFLAGS
8616 CFLAGS="$CFLAGS $XCFLAGS"
8620 #include <X11/Xlib.h>
8621 #include <X11/Intrinsic.h>
8622 #include <X11/extensions/XShm.h>
8626 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8627 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8631 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8632 CFLAGS="$_SAVE_CFLAGS"
8634 if test -n "$MISSING_X"; then
8635 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8640 dnl Check for headers, etc. needed by WebGL.
8641 if test "$MOZ_GL_DEFAULT_PROVIDER" = "GLX"; then
8642 MOZ_CHECK_HEADER(GL/glx.h)
8643 if test "$ac_cv_header_GL_glx_h" != "yes"; then
8644 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))])
8646 fi # MOZ_GL_DEFAULT_PROVIDER=GLX
8647 fi # COMPILE_ENVIRONMENT
8649 dnl Set various defines and substitutions
8650 dnl ========================================================
8652 if test "$OS_ARCH" = "Darwin"; then
8654 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
8658 if test "$MOZ_DEBUG"; then
8659 AC_DEFINE(MOZ_REFLOW_PERF)
8660 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8663 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8664 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8665 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8666 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8667 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8668 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8669 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8670 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8671 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8674 AC_SUBST(MOZILLA_VERSION)
8676 AC_SUBST(ac_configure_args)
8678 dnl Spit out some output
8679 dnl ========================================================
8681 dnl The following defines are used by xpcom
8682 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8684 HAVE_CPP_2BYTE_WCHAR_T
8685 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8687 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8688 HAVE_CPP_PARTIAL_SPECIALIZATION
8689 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8692 NEED_CPP_UNUSED_IMPLEMENTATIONS
8696 HAVE_ICONV_WITH_CONST_INPUT
8704 netwerk/necko-config.h
8705 xpcom/xpcom-config.h
8706 xpcom/xpcom-private.h
8709 # Hack around an Apple bug that affects the egrep that comes with OS X 10.7.
8710 # "env ARCHPREFERENCE=i386,x86_64 arch egrep" first tries to use the 32-bit
8711 # Intel part of the egrep fat binary, even on 64-bit systems, and falls back on
8712 # the 64-bit part if it's not a fat binary, as can happen with MacPorts. We
8713 # (apparently) only need this hack when egrep's "pattern" is particularly long
8714 # (as in the following code) and the first egrep on our $PATH is Apple's. See
8718 FIXED_EGREP="env ARCHPREFERENCE=i386,x86_64 arch egrep"
8725 dnl Create a virtualenv where we can install local Python packages
8726 AC_MSG_RESULT([Creating Python virtualenv])
8728 mkdir -p _virtualenv
8729 MACOSX_DEPLOYMENT_TARGET= PYTHONDONTWRITEBYTECODE= $PYTHON $_topsrcdir/python/virtualenv/virtualenv.py --system-site-packages ./_virtualenv
8732 PYTHON=$MOZ_BUILD_ROOT/_virtualenv/Scripts/python.exe
8735 PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python
8741 # Populate the virtualenv
8742 AC_MSG_RESULT([Populating Python virtualenv])
8743 MACOSX_DEPLOYMENT_TARGET= LDFLAGS="${HOST_LDFLAGS}" \
8744 CC="${HOST_CC}" CXX="${HOST_CXX}" \
8745 CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" \
8746 $PYTHON $_topsrcdir/build/virtualenv/populate_virtualenv.py \
8747 $_topsrcdir $_topsrcdir/build/virtualenv/packages.txt \
8750 dnl Load the list of Makefiles to generate.
8751 dnl To add new Makefiles, edit allmakefiles.sh.
8752 dnl allmakefiles.sh sets the variable, MAKEFILES.
8753 . ${srcdir}/allmakefiles.sh
8755 echo $MAKEFILES > unallmakefiles
8757 AC_OUTPUT($MAKEFILES)
8759 # Generate Makefiles for WebRTC directly from .gyp files
8760 if test "${OS_TARGET}" = "WINNT"; then
8761 if test "$HAVE_64BIT_OS"; then
8766 EXTRA_GYP_DEFINES="-D MSVS_VERSION=${_MSVS_VERSION} -D MSVS_OS_BITS=${OS_BITS}"
8769 if test -n "$MOZ_WEBRTC"; then
8770 AC_MSG_RESULT("generating WebRTC Makefiles...")
8772 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}"
8774 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8775 $GYP_WEBRTC_OPTIONS \
8776 --generator-output=${_objdir}/media/webrtc/trunk \
8777 ${srcdir}/media/webrtc/trunk/peerconnection.gyp
8778 if test "$?" != 0; then
8779 AC_MSG_ERROR([failed to generate WebRTC Makefiles])
8782 # XXX disable until we land the tranche with signaling
8783 if test -n "$MOZ_WEBRTC_SIGNALING"; then
8784 AC_MSG_RESULT("generating WebRTC/Signaling Makefiles...")
8785 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8786 $GYP_WEBRTC_OPTIONS \
8787 --generator-output=${_objdir}/media/webrtc/signaling \
8788 ${srcdir}/media/webrtc/signaling/signaling.gyp
8789 if test "$?" != 0; then
8790 AC_MSG_ERROR([failed to generate WebRTC/Signaling Makefiles])
8794 AC_MSG_RESULT("generating gtest Makefiles...")
8795 # Ok to pass some extra -D's that are ignored here
8796 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8797 $GYP_WEBRTC_OPTIONS \
8798 --generator-output=${_objdir}/media/webrtc/trunk/testing/ \
8799 ${srcdir}/media/webrtc/trunk/testing/gtest.gyp
8800 if test "$?" != 0; then
8801 AC_MSG_ERROR([failed to generate gtest Makefiles])
8805 # Generate a JSON config file for unittest harnesses etc to read
8806 # build configuration details from in a standardized way.
8807 OS_TARGET=${OS_TARGET} TARGET_CPU=${TARGET_CPU} MOZ_DEBUG=${MOZ_DEBUG} \
8808 MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
8809 $PYTHON ${_topsrcdir}/config/writemozinfo.py ./mozinfo.json.tmp
8810 if cmp -s ./mozinfo.json.tmp ./mozinfo.json; then
8811 rm ./mozinfo.json.tmp
8813 mv -f ./mozinfo.json.tmp ./mozinfo.json
8816 # Run jemalloc configure script
8818 if test "$MOZ_JEMALLOC" -a "$MOZ_MEMORY"; then
8819 ac_configure_args="$_SUBDIR_CONFIG_ARGS --build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_"
8820 if test "$OS_ARCH" = "Linux"; then
8821 MANGLE="malloc calloc valloc free realloc memalign posix_memalign malloc_usable_size"
8824 if test -n "$_WRAP_MALLOC"; then
8825 JEMALLOC_WRAPPER=__wrap_
8827 for mangle in ${MANGLE}; do
8828 if test -n "$MANGLED"; then
8829 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle,$MANGLED"
8831 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle"
8834 ac_configure_args="$ac_configure_args --with-mangling=$MANGLED"
8837 if test -z "$MOZ_TLS"; then
8838 ac_configure_args="$ac_configure_args --disable-tls"
8840 EXTRA_CFLAGS="$CFLAGS"
8841 for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do
8842 ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
8844 if test "$CROSS_COMPILE"; then
8845 ac_configure_args="$ac_configure_args je_cv_static_page_shift=12"
8847 _save_cache_file="$cache_file"
8848 cache_file=$_objdir/memory/jemalloc/src/config.cache
8849 AC_OUTPUT_SUBDIRS(memory/jemalloc/src)
8850 cache_file="$_save_cache_file"
8851 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8854 dnl Build libunwind for Android profiling builds
8855 if test "$OS_TARGET" = "Android" -a "$MOZ_PROFILING"; then
8856 old_ac_configure_arg="$ac_configure_args"
8857 ac_configure_args="--build=${build} --host=${target_alias} --disable-shared --enable-block-signals=no"
8858 if test "$MOZ_DEBUG"; then
8859 ac_configure_args="$ac_configure_args --enable-debug"
8861 if test "$DSO_PIC_CFLAGS"; then
8862 ac_configure_args="$ac_configure_args --with-pic"
8864 ac_configure_args="$ac_configure_args \
8868 CFLAGS=\"$CFLAGS\" \
8869 CXXFLAGS=\"$CXXFLAGS\" \
8870 CPPFLAGS=\"$CPPFLAGS\" \
8872 LDFLAGS=\"$LDFLAGS\" \
8874 RANLIB=\"$RANLIB\" \
8878 # Use a separate cache file for libunwind, since it does not use caching.
8879 mkdir -p $_objdir/tools/profiler/libunwind/src
8880 old_cache_file=$cache_file
8881 cache_file=$_objdir/tools/profiler/libunwind/src/config.cache
8882 old_config_files=$CONFIG_FILES
8884 AC_OUTPUT_SUBDIRS(tools/profiler/libunwind/src)
8885 cache_file=$old_cache_file
8886 ac_configure_args="$old_ac_configure_args"
8887 CONFIG_FILES=$old_config_files
8890 # Run freetype configure script
8892 if test "$MOZ_TREE_FREETYPE"; then
8893 export CFLAGS="$CFLAGS -std=c99"
8894 export CPPFLAGS="$CPPFLAGS"
8895 export CXXFLAGS="$CXXFLAGS"
8896 export LDFLAGS="$LDFLAGS"
8897 export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
8898 ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes"
8899 AC_OUTPUT_SUBDIRS(modules/freetype2)
8902 if test -z "$direct_nspr_config"; then
8903 dnl ========================================================
8904 dnl = Setup a nice relatively clean build environment for
8905 dnl = sub-configures.
8906 dnl ========================================================
8909 CFLAGS="$_SUBDIR_CFLAGS"
8910 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8911 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8912 LDFLAGS="$_SUBDIR_LDFLAGS"
8913 HOST_CC="$_SUBDIR_HOST_CC"
8914 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8915 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8922 # No need to run subconfigures when building with LIBXUL_SDK_DIR
8923 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8927 if test -n "$_WRAP_MALLOC"; then
8928 # Avoid doubling wrap malloc arguments
8929 _SUBDIR_CONFIG_ARGS="`echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'`"
8932 if test -z "$MOZ_NATIVE_NSPR"; then
8933 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8934 if test -z "$MOZ_DEBUG"; then
8935 ac_configure_args="$ac_configure_args --disable-debug"
8937 ac_configure_args="$ac_configure_args --enable-debug"
8939 if test "$MOZ_OPTIMIZE" = "1"; then
8940 ac_configure_args="$ac_configure_args --enable-optimize"
8941 elif test -z "$MOZ_OPTIMIZE"; then
8942 ac_configure_args="$ac_configure_args --disable-optimize"
8944 if test -n "$HAVE_64BIT_OS"; then
8945 ac_configure_args="$ac_configure_args --enable-64bit"
8947 if test -n "$USE_ARM_KUSER"; then
8948 ac_configure_args="$ac_configure_args --with-arm-kuser"
8950 ac_configure_args="$ac_configure_args $NSPR_CONFIGURE_ARGS"
8951 if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no ; then
8952 # dladdr is supported by the new linker, even when the system linker doesn't
8953 # support it. Trick nspr into using dladdr when it's not supported.
8954 _SAVE_CPPFLAGS="$CPPFLAGS"
8955 export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS"
8957 _SAVE_LDFLAGS="$LDFLAGS"
8958 export LDFLAGS="$LDFLAGS $NSPR_LDFLAGS"
8959 AC_OUTPUT_SUBDIRS(nsprpub)
8960 LDFLAGS="$_SAVE_LDFLAGS"
8961 if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no; then
8963 CPPFLAGS="$_SAVE_CFLAGS"
8965 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8968 dnl ========================================================
8969 dnl = Setup a nice relatively clean build environment for
8970 dnl = sub-configures.
8971 dnl ========================================================
8974 CFLAGS="$_SUBDIR_CFLAGS"
8975 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8976 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8977 LDFLAGS="$_SUBDIR_LDFLAGS"
8978 HOST_CC="$_SUBDIR_HOST_CC"
8979 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8980 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8983 # Run the SpiderMonkey 'configure' script.
8984 dist=$MOZ_BUILD_ROOT/dist
8985 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8986 ac_configure_args="$ac_configure_args --enable-threadsafe"
8987 if test "$BUILD_CTYPES"; then
8988 # Build js-ctypes on the platforms we can.
8989 ac_configure_args="$ac_configure_args --enable-ctypes"
8991 if test -z "$JS_SHARED_LIBRARY" ; then
8992 ac_configure_args="$ac_configure_args --disable-shared-js"
8994 if test -z "$MOZ_NATIVE_NSPR"; then
8995 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
8996 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
8998 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
8999 ac_configure_args="$ac_configure_args --prefix=$dist"
9000 if test "$MOZ_MEMORY"; then
9001 ac_configure_args="$ac_configure_args --enable-jemalloc"
9003 if test -n "$MOZ_GLUE_LDFLAGS"; then
9004 export MOZ_GLUE_LDFLAGS
9006 if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then
9007 export MOZ_GLUE_PROGRAM_LDFLAGS
9009 if test "$MOZ_NATIVE_ZLIB" != 1 -a "$OS_ARCH" = "WINNT"; then
9012 export MOZ_NATIVE_ZLIB
9013 export MOZ_ZLIB_CFLAGS
9014 export MOZ_ZLIB_LIBS
9016 export STLPORT_CPPFLAGS
9017 export STLPORT_LDFLAGS
9019 AC_OUTPUT_SUBDIRS(js/src)
9020 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9022 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR