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
4147 MOZ_SAMPLE_TYPE_FLOAT32=
4148 MOZ_SAMPLE_TYPE_S16LE=
4153 MOZ_WEBRTC_SIGNALING=
4155 MOZ_MEDIA_NAVIGATOR=
4158 MOZ_VP8_ERROR_CONCEALMENT=
4168 LIBJPEG_TURBO_ASFLAGS=
4169 LIBJPEG_TURBO_X86_ASM=
4170 LIBJPEG_TURBO_X64_ASM=
4171 LIBJPEG_TURBO_ARM_ASM=
4175 MOZ_PREF_EXTENSIONS=1
4176 MOZ_PROFILELOCKING=1
4182 MOZ_JAVA_COMPOSITOR=
4183 MOZ_ONLY_TOUCH_EVENTS=
4184 MOZ_TOOLKIT_SEARCH=1
4186 MOZ_UNIVERSALCHARDET=1
4193 MOZ_DISABLE_DOMCRYPTO=
4197 NECKO_PROTOCOLS_DEFAULT="about data file ftp http res viewsource websocket wyciwyg device"
4200 MOZ_USE_NATIVE_POPUP_WINDOWS=
4201 MOZ_ANDROID_HISTORY=
4207 case "$target_os" in
4210 AC_DEFINE(NS_ENABLE_TSF)
4215 *-android*|*-linuxandroid*)
4216 if test "$CPU_ARCH" = "arm" ; then
4222 MOZ_THEME_FASTSTRIPE=1
4230 MOZ_ARG_ENABLE_STRING(application,
4231 [ --enable-application=APP
4235 tools/update-packaging (AUS-related packaging tools)],
4236 [ MOZ_BUILD_APP=$enableval ] )
4238 MOZ_ARG_WITH_STRING(xulrunner-stub-name,
4239 [ --with-xulrunner-stub-name=appname Create the xulrunner stub with the given name],
4240 XULRUNNER_STUB_NAME=$withval)
4242 if test -z "$XULRUNNER_STUB_NAME"; then
4243 case "$target_os" in
4245 XULRUNNER_STUB_NAME=xulrunner
4248 XULRUNNER_STUB_NAME=xulrunner-stub
4251 AC_SUBST(XULRUNNER_STUB_NAME)
4253 AC_MSG_CHECKING([for application to build])
4254 if test -z "$MOZ_BUILD_APP"; then
4255 AC_MSG_RESULT([browser])
4256 MOZ_BUILD_APP=browser
4258 # default mobile to be mobile/xul
4259 if test "$MOZ_BUILD_APP" = "mobile" ; then
4260 MOZ_BUILD_APP=mobile/xul
4262 # We have a valid application only if it has a build.mk file in its top
4264 if test ! -f "${srcdir}/${MOZ_BUILD_APP}/build.mk" ; then
4265 AC_MSG_RESULT([none])
4266 AC_MSG_ERROR([--enable-application value not recognized (${MOZ_BUILD_APP}/build.mk does not exist).])
4268 AC_MSG_RESULT([$MOZ_BUILD_APP])
4272 # Allow the application to influence configure with a confvars.sh script.
4274 AC_MSG_CHECKING([if app-specific confvars.sh exists])
4275 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
4276 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
4277 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
4282 # Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
4283 MOZ_ARG_WITH_STRING(app-name,
4284 [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
4285 WITH_APP_NAME=$withval,
4288 if test -n "$WITH_APP_NAME" ; then
4289 MOZ_APP_NAME="$WITH_APP_NAME"
4292 MOZ_ARG_WITH_STRING(app-basename,
4293 [--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
4294 WITH_APP_BASENAME=$withval,
4297 if test -n "$WITH_APP_BASENAME" ; then
4298 MOZ_APP_BASENAME="$WITH_APP_BASENAME"
4301 # Now is a good time to test for logic errors, define mismatches, etc.
4302 case "$MOZ_BUILD_APP" in
4304 if test "$LIBXUL_SDK"; then
4305 AC_MSG_ERROR([Building XULRunner --with-libxul-sdk doesn't make sense; XULRunner provides the libxul SDK.])
4310 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
4311 # that haven't made a confvars.sh yet. Don't add new stuff here, use
4313 case "$MOZ_BUILD_APP" in
4315 AC_DEFINE(MOZ_PHOENIX)
4319 AC_DEFINE(MOZ_XULRUNNER)
4323 AC_SUBST(MOZ_BUILD_APP)
4324 AC_SUBST(MOZ_PHOENIX)
4325 AC_SUBST(MOZ_XULRUNNER)
4327 AC_DEFINE_UNQUOTED(MOZ_BUILD_APP,$MOZ_BUILD_APP)
4329 dnl ========================================================
4330 dnl Check android sdk version depending on mobile target
4331 dnl ========================================================
4333 if test -z "$gonkdir" ; then
4334 # Minimum Android SDK API Level we require.
4335 case "$MOZ_BUILD_APP" in
4337 android_min_api_level=13
4340 android_min_api_level=16
4344 MOZ_ANDROID_SDK($android_min_api_level)
4347 dnl ========================================================
4349 dnl = Toolkit Options
4351 dnl ========================================================
4352 MOZ_ARG_HEADER(Toolkit Options)
4354 dnl ========================================================
4355 dnl = Select the default toolkit
4356 dnl ========================================================
4357 MOZ_ARG_ENABLE_STRING(default-toolkit,
4358 [ --enable-default-toolkit=TK
4359 Select default toolkit
4360 Platform specific defaults:
4361 Mac OS X - cairo-cocoa
4363 Win32 - cairo-windows
4366 [ _DEFAULT_TOOLKIT=$enableval ],
4367 [ _DEFAULT_TOOLKIT=$_PLATFORM_DEFAULT_TOOLKIT])
4369 if test "$_DEFAULT_TOOLKIT" = "cairo-windows" \
4370 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2" \
4371 -o "$_DEFAULT_TOOLKIT" = "cairo-gtk2-x11" \
4372 -o "$_DEFAULT_TOOLKIT" = "cairo-qt" \
4373 -o "$_DEFAULT_TOOLKIT" = "cairo-os2" \
4374 -o "$_DEFAULT_TOOLKIT" = "cairo-cocoa" \
4375 -o "$_DEFAULT_TOOLKIT" = "cairo-uikit" \
4376 -o "$_DEFAULT_TOOLKIT" = "cairo-android" \
4377 -o "$_DEFAULT_TOOLKIT" = "cairo-gonk"
4379 dnl nglayout only supports building with one toolkit,
4380 dnl so ignore everything after the first comma (",").
4381 MOZ_WIDGET_TOOLKIT=`echo "$_DEFAULT_TOOLKIT" | sed -e "s/,.*$//"`
4383 AC_MSG_ERROR([You must specify a default toolkit (perhaps $_PLATFORM_DEFAULT_TOOLKIT).])
4386 MOZ_ARG_WITHOUT_BOOL(x,
4387 [ --without-x Build without X11],
4390 dnl ========================================================
4391 dnl = Enable the toolkit as needed =
4392 dnl ========================================================
4394 case "$MOZ_WIDGET_TOOLKIT" in
4397 MOZ_WIDGET_TOOLKIT=windows
4400 MOZ_INSTRUMENT_EVENT_LOOP=1
4403 cairo-gtk2|cairo-gtk2-x11)
4404 MOZ_WIDGET_TOOLKIT=gtk2
4406 MOZ_ENABLE_XREMOTE=1
4408 MOZ_GL_DEFAULT_PROVIDER=GLX
4414 TK_CFLAGS='$(MOZ_GTK2_CFLAGS)'
4415 TK_LIBS='$(MOZ_GTK2_LIBS)'
4416 AC_DEFINE(MOZ_WIDGET_GTK2)
4417 AC_DEFINE(MOZ_WIDGET_GTK,2)
4419 MOZ_INSTRUMENT_EVENT_LOOP=1
4423 MOZ_WIDGET_TOOLKIT=qt
4425 if test -z "$WITHOUT_X11"; then
4426 MOZ_ENABLE_XREMOTE=1
4427 MOZ_GL_DEFAULT_PROVIDER=GLX
4436 TK_CFLAGS='$(MOZ_QT_CFLAGS)'
4437 TK_LIBS='$(MOZ_QT_LIBS)'
4438 AC_DEFINE(MOZ_WIDGET_QT)
4443 MOZ_WIDGET_TOOLKIT=os2
4445 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4446 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4451 MOZ_WIDGET_TOOLKIT=cocoa
4452 AC_DEFINE(MOZ_WIDGET_COCOA)
4453 LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
4454 TK_LIBS='-framework QuartzCore -framework Carbon -framework CoreAudio -framework AudioToolbox -framework AudioUnit -framework AddressBook -framework OpenGL'
4455 TK_CFLAGS="-DNO_X11"
4456 CFLAGS="$CFLAGS $TK_CFLAGS"
4457 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4458 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
4459 MOZ_USER_DIR="Mozilla"
4460 MOZ_FS_LAYOUT=bundle
4462 MOZ_INSTRUMENT_EVENT_LOOP=1
4466 MOZ_WIDGET_TOOLKIT=uikit
4467 AC_DEFINE(MOZ_WIDGET_UIKIT)
4468 LDFLAGS="$LDFLAGS -framework UIKit -lobjc"
4469 TK_CFLAGS="-DNO_X11"
4470 TK_LIBS='-framework Foundation -framework CoreFoundation -framework CoreGraphics -framework CoreText'
4471 CFLAGS="$CFLAGS $TK_CFLAGS"
4472 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
4473 LIBXUL_LIBS='$(XPCOM_FROZEN_LDOPTS) $(LIBXUL_DIST)/bin/XUL'
4474 MOZ_USER_DIR="Mozilla"
4475 MOZ_FS_LAYOUT=bundle
4479 AC_DEFINE(MOZ_WIDGET_ANDROID)
4480 MOZ_WIDGET_TOOLKIT=android
4481 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4482 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4485 MOZ_INSTRUMENT_EVENT_LOOP=1
4486 if test "$MOZ_BUILD_APP" = "mobile/xul"; then
4492 AC_DEFINE(MOZ_WIDGET_GONK)
4493 AC_DEFINE(MOZ_TOUCH)
4494 MOZ_WIDGET_TOOLKIT=gonk
4495 TK_CFLAGS='$(MOZ_CAIRO_CFLAGS) $(MOZ_PIXMAN_CFLAGS)'
4496 TK_LIBS='$(MOZ_CAIRO_LIBS) $(MOZ_PIXMAN_LIBS)'
4504 AC_SUBST(MOZ_OLD_LINKER)
4505 AC_SUBST(MOZ_PDF_PRINTING)
4506 if test "$MOZ_PDF_PRINTING"; then
4507 PDF_SURFACE_FEATURE="#define CAIRO_HAS_PDF_SURFACE 1"
4508 AC_DEFINE(MOZ_PDF_PRINTING)
4511 if test "$MOZ_ENABLE_XREMOTE"; then
4512 AC_DEFINE(MOZ_ENABLE_XREMOTE)
4515 if test "$MOZ_INSTRUMENT_EVENT_LOOP"; then
4516 AC_DEFINE(MOZ_INSTRUMENT_EVENT_LOOP)
4519 if test "$COMPILE_ENVIRONMENT"; then
4520 if test "$MOZ_ENABLE_GTK2"; then
4521 if test "$MOZ_X11"; then
4522 GDK_PACKAGES=gdk-x11-2.0
4525 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
4528 fi # COMPILE_ENVIRONMENT
4530 AC_SUBST(MOZ_FS_LAYOUT)
4532 dnl ========================================================
4533 dnl Use ARM userspace kernel helpers; tell NSPR to enable
4534 dnl their usage and use them in spidermonkey.
4535 dnl ========================================================
4536 MOZ_ARG_WITH_BOOL(arm-kuser,
4537 [ --with-arm-kuser Use kuser helpers (Linux/ARM only -- requires kernel 2.6.13 or later)],
4539 if test -n "$USE_ARM_KUSER"; then
4540 AC_DEFINE(USE_ARM_KUSER)
4543 dnl ========================================================
4544 dnl = startup-notification support module
4545 dnl ========================================================
4547 if test "$MOZ_ENABLE_GTK2"
4549 MOZ_ENABLE_STARTUP_NOTIFICATION=
4551 MOZ_ARG_ENABLE_BOOL(startup-notification,
4552 [ --enable-startup-notification
4553 Enable startup-notification support (default: disabled) ],
4554 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
4555 MOZ_ENABLE_STARTUP_NOTIFICATION=)
4556 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
4558 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
4559 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
4560 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
4561 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
4563 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
4565 MOZ_ENABLE_STARTUP_NOTIFICATION=
4569 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
4570 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
4573 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
4575 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
4576 AC_SUBST(MOZ_STARTUP_NOTIFICATION_CFLAGS)
4577 AC_SUBST(MOZ_STARTUP_NOTIFICATION_LIBS)
4579 dnl ========================================================
4581 dnl ========================================================
4582 if test "$MOZ_ENABLE_QT"
4584 MOZ_ARG_WITH_STRING(qtdir,
4585 [ --with-qtdir=\$dir Specify Qt directory ],
4588 if test -z "$QTDIR"; then
4589 PKG_CHECK_MODULES(MOZ_QT, QtGui QtNetwork QtCore QtOpenGL)
4590 PKG_CHECK_MODULES(MOZ_QT5, QtWidgets QtMultimedia QtPrintSupport,
4593 if test "$MOZ_ENABLE_QT5"; then
4595 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $MOZ_QT5_CFLAGS"
4596 MOZ_QT_LIBS="$MOZ_QT_LIBS $MOZ_QT5_LIBS"
4599 AC_CHECK_PROGS(HOST_MOC, $MOC moc, "")
4600 AC_CHECK_PROGS(HOST_RCC, $RCC rcc, "")
4602 MOZ_QT_LIBS="-L$QTDIR/lib/ -lQtGui -lQtNetwork -lQtCore -lQtXml -lQtOpenGL"
4604 MOZ_QT_CFLAGS="-DQT_SHARED"
4605 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include"
4606 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/Qt"
4607 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtGui"
4608 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtCore"
4609 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtNetwork"
4610 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtXml"
4611 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtDeclarative"
4612 HOST_MOC="$QTDIR/bin/moc"
4613 HOST_RCC="$QTDIR/bin/rcc"
4615 # QtWidgets was introduced only in Qt5
4616 if test -d $QTDIR/include/QtWidgets; then
4617 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtWidgets"
4618 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtPrintSupport"
4619 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtWidgets -lQtPrintSupport"
4622 if test -z "$HOST_MOC"; then
4623 AC_MSG_ERROR([No acceptable moc preprocessor found. Qt SDK is not installed or --with-qt is
4626 if test -z "$HOST_RCC"; then
4627 AC_MSG_ERROR([No acceptable rcc preprocessor found. Qt SDK is not installed or --with-qt is
4634 MOZ_ENABLE_QMSYSTEM2=
4635 PKG_CHECK_MODULES(_QMSYSTEM2, qmsystem2,
4636 MOZ_ENABLE_QMSYSTEM2=1,
4637 MOZ_ENABLE_QMSYSTEM2=)
4639 if test "$MOZ_ENABLE_QMSYSTEM2"; then
4640 MOZ_ENABLE_QMSYSTEM2=1
4641 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QMSYSTEM2_CFLAGS"
4642 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QMSYSTEM2_LIBS"
4643 AC_DEFINE(MOZ_ENABLE_QMSYSTEM2)
4646 MOZ_ENABLE_QTNETWORK=
4647 PKG_CHECK_MODULES(_QTNETWORK, QtNetwork >= 4.7,
4648 MOZ_ENABLE_QTNETWORK=1,
4649 MOZ_ENABLE_QTNETWORK=)
4651 if test "$MOZ_ENABLE_QTNETWORK"; then
4652 MOZ_ENABLE_QTNETWORK=1
4653 AC_DEFINE(MOZ_ENABLE_QTNETWORK)
4656 MOZ_ENABLE_QTMOBILITY=
4657 PKG_CHECK_MODULES(_QTMOBILITY, QtSensors QtFeedback QtLocation,
4658 MOZ_ENABLE_QTMOBILITY=1,
4659 MOZ_ENABLE_QTMOBILITY=)
4660 if test "$MOZ_ENABLE_QTMOBILITY"; then
4661 MOZ_ENABLE_QTMOBILITY=1
4662 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS $_QTMOBILITY_CFLAGS"
4663 MOZ_QT_LIBS="$MOZ_QT_LIBS $_QTMOBILITY_LIBS"
4665 AC_CHECK_LIB(QtSensors, main, [
4666 MOZ_ENABLE_QTMOBILITY=1
4667 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtMobility"
4668 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtSensors"
4669 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtFeedback"
4670 MOZ_QT_CFLAGS="$MOZ_QT_CFLAGS -I$QTDIR/include/QtLocation"
4671 MOZ_QT_LIBS="$MOZ_QT_LIBS -lQtSensors -lQtFeedback -lQtLocation"
4674 if test "$MOZ_ENABLE_QTMOBILITY"; then
4675 AC_DEFINE(MOZ_ENABLE_QTMOBILITY)
4679 AC_SUBST(GTK_CONFIG)
4683 AC_SUBST(MOZ_ENABLE_GTK2)
4684 AC_SUBST(MOZ_ENABLE_QT)
4685 AC_SUBST(MOZ_ENABLE_QTNETWORK)
4686 AC_SUBST(MOZ_ENABLE_QMSYSTEM2)
4687 AC_SUBST(MOZ_ENABLE_QTMOBILITY)
4688 AC_SUBST(MOZ_ENABLE_XREMOTE)
4689 AC_SUBST(MOZ_GTK2_CFLAGS)
4690 AC_SUBST(MOZ_GTK2_LIBS)
4691 AC_SUBST(MOZ_QT_CFLAGS)
4692 AC_SUBST(MOZ_QT_LIBS)
4699 dnl ========================================================
4701 dnl = Components & Features
4703 dnl ========================================================
4704 MOZ_ARG_HEADER(Components and Features)
4706 dnl ========================================================
4708 dnl ========================================================
4709 MOZ_ARG_ENABLE_STRING(ui-locale,
4710 [ --enable-ui-locale=ab-CD
4711 Select the user interface locale (default: en-US)],
4712 MOZ_UI_LOCALE=$enableval )
4713 AC_SUBST(MOZ_UI_LOCALE)
4715 dnl ========================================================
4716 dnl = Trademarked Branding
4717 dnl ========================================================
4718 MOZ_ARG_ENABLE_BOOL(official-branding,
4719 [ --enable-official-branding
4720 Enable Official mozilla.org Branding
4721 Do not distribute builds with
4722 --enable-official-branding unless you have
4723 permission to use trademarks per
4724 http://www.mozilla.org/foundation/trademarks/ .],
4726 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
4727 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
4729 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
4730 MOZ_OFFICIAL_BRANDING=1
4732 ], MOZ_OFFICIAL_BRANDING=)
4734 AC_SUBST(MOZ_OFFICIAL_BRANDING)
4735 if test -n "$MOZ_OFFICIAL_BRANDING"; then
4736 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
4739 MOZ_ARG_WITH_STRING(branding,
4740 [ --with-branding=dir Use branding from the specified directory.],
4741 MOZ_BRANDING_DIRECTORY=$withval)
4743 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
4744 if test -z "$REAL_BRANDING_DIRECTORY"; then
4745 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
4748 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
4749 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
4752 AC_SUBST(MOZ_BRANDING_DIRECTORY)
4754 dnl ========================================================
4755 dnl = Distribution ID
4756 dnl ========================================================
4757 MOZ_ARG_WITH_STRING(distribution-id,
4758 [ --with-distribution-id=ID
4759 Set distribution-specific id (default=org.mozilla)],
4760 [ val=`echo $withval`
4761 MOZ_DISTRIBUTION_ID="$val"])
4763 if test -z "$MOZ_DISTRIBUTION_ID"; then
4764 MOZ_DISTRIBUTION_ID="org.mozilla"
4767 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
4768 AC_SUBST(MOZ_DISTRIBUTION_ID)
4771 dnl ========================================================
4772 dnl complex text support off by default
4773 dnl ========================================================
4774 MOZ_ARG_DISABLE_BOOL(pango,
4775 [ --disable-pango Disable usage of Pango ],
4779 dnl ========================================================
4781 dnl ========================================================
4782 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
4786 if test "$MOZ_PANGO"
4788 PKG_CHECK_MODULES(_PANGOCHK, pango >= $PANGO_VERSION)
4790 PKG_CHECK_MODULES(MOZ_PANGO, pango >= $PANGO_VERSION pangoft2 >= $PANGO_VERSION pangocairo >= $PANGO_VERSION)
4791 AC_SUBST(MOZ_PANGO_CFLAGS)
4792 AC_SUBST(MOZ_PANGO_LIBS)
4793 AC_DEFINE(MOZ_PANGO)
4795 PKG_CHECK_MODULES(FT2, freetype2 > 6.1.0)
4796 AC_SUBST(FT2_CFLAGS)
4801 dnl ========================================================
4802 dnl = GnomeVFS, GIO and GConf support module
4803 dnl ========================================================
4807 dnl build the gnomevfs extension by default only when the
4808 dnl GTK2 toolkit is in use.
4809 if test "$MOZ_ENABLE_GTK2"
4811 MOZ_ENABLE_GNOMEVFS=1
4815 dnl ========================================================
4816 dnl = GnomeVFS support module
4817 dnl ========================================================
4818 MOZ_ARG_DISABLE_BOOL(gnomevfs,
4819 [ --disable-gnomevfs Disable GnomeVFS support ],
4820 MOZ_ENABLE_GNOMEVFS=,
4821 MOZ_ENABLE_GNOMEVFS=force)
4823 if test "$MOZ_ENABLE_GNOMEVFS"
4825 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4826 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4827 MOZ_ENABLE_GNOMEVFS=1
4828 AC_DEFINE(MOZ_ENABLE_GNOMEVFS)
4830 if test "$MOZ_ENABLE_GNOMEVFS" = "force"
4832 AC_MSG_ERROR([* * * Could not find gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION])
4834 MOZ_ENABLE_GNOMEVFS=
4837 if test `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
4838 PKG_CHECK_MODULES(MOZ_GNOMEVFS, gnome-vfs-2.0 >= $GNOMEVFS_VERSION gnome-vfs-module-2.0 >= $GNOMEVFS_VERSION,[
4839 MOZ_GNOMEVFS_LIBS=`echo $MOZ_GNOMEVFS_LIBS | sed 's/-llinc\>//'`
4844 AC_SUBST(MOZ_ENABLE_GNOMEVFS)
4845 AC_SUBST(MOZ_GNOMEVFS_CFLAGS)
4846 AC_SUBST(MOZ_GNOMEVFS_LIBS)
4848 dnl ========================================================
4849 dnl = GIO support module
4850 dnl ========================================================
4851 MOZ_ARG_ENABLE_BOOL(gio,
4852 [ --enable-gio Enable GIO support (default: disabled)],
4853 MOZ_ENABLE_GIO=force,
4856 if test "$MOZ_ENABLE_GIO" -a "$MOZ_ENABLE_GTK2"
4858 PKG_CHECK_MODULES(_GTKCHECK, gtk+-2.0 >= 2.14, ,
4859 [AC_MSG_ERROR([* * * Could not find gtk+-2.0 > 2.14. Required for build with gio.])])
4860 PKG_CHECK_MODULES(MOZ_GIO, gio-2.0 >= $GIO_VERSION,[
4861 MOZ_GIO_LIBS=`echo $MOZ_GIO_LIBS | sed 's/-llinc\>//'`
4863 AC_DEFINE(MOZ_ENABLE_GIO)
4865 if test "$MOZ_ENABLE_GIO" = "force"
4867 AC_MSG_ERROR([* * * Could not find gio-2.0 >= $GIO_VERSION])
4873 AC_SUBST(MOZ_ENABLE_GIO)
4874 AC_SUBST(MOZ_GIO_CFLAGS)
4875 AC_SUBST(MOZ_GIO_LIBS)
4877 dnl ========================================================
4878 dnl = GConf support module
4879 dnl ========================================================
4880 MOZ_ARG_DISABLE_BOOL(gconf,
4881 [ --disable-gconf Disable Gconf support ],
4883 MOZ_ENABLE_GCONF=force)
4885 if test "$MOZ_ENABLE_GCONF"
4887 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
4888 MOZ_GCONF_LIBS=`$PKG_CONFIG --libs gobject-2.0`
4891 if test "$MOZ_ENABLE_GCONF" = "force"
4893 AC_MSG_ERROR([* * * Could not find gconf-2.0 ])
4899 if test "$MOZ_ENABLE_GCONF"; then
4900 AC_DEFINE(MOZ_ENABLE_GCONF)
4903 AC_SUBST(MOZ_ENABLE_GCONF)
4904 AC_SUBST(MOZ_GCONF_CFLAGS)
4905 AC_SUBST(MOZ_GCONF_LIBS)
4908 dnl ========================================================
4909 dnl = libproxy support
4910 dnl ========================================================
4912 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
4914 MOZ_ENABLE_LIBPROXY=
4916 MOZ_ARG_ENABLE_BOOL(libproxy,
4917 [ --enable-libproxy Enable libproxy support ],
4918 MOZ_ENABLE_LIBPROXY=1,
4919 MOZ_ENABLE_LIBPROXY=)
4921 if test "$MOZ_ENABLE_LIBPROXY"
4923 PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
4924 AC_DEFINE(MOZ_ENABLE_LIBPROXY)
4927 AC_SUBST(MOZ_ENABLE_LIBPROXY)
4928 AC_SUBST(MOZ_LIBPROXY_CFLAGS)
4929 AC_SUBST(MOZ_LIBPROXY_LIBS)
4931 dnl ========================================================
4932 dnl = libnotify support
4933 dnl ========================================================
4935 if test "$MOZ_ENABLE_GTK2"
4937 MOZ_ENABLE_LIBNOTIFY=1
4939 MOZ_ARG_DISABLE_BOOL(libnotify,
4940 [ --disable-libnotify Disable libnotify support ],
4941 MOZ_ENABLE_LIBNOTIFY=,
4942 MOZ_ENABLE_LIBNOTIFY=1)
4944 if test "$MOZ_ENABLE_LIBNOTIFY"
4946 AC_DEFINE(MOZ_ENABLE_LIBNOTIFY)
4950 if test -z "$SKIP_LIBRARY_CHECKS"
4952 if test "$MOZ_ENABLE_GTK2"
4954 if test "$MOZ_ENABLE_LIBNOTIFY"
4956 PKG_CHECK_MODULES(MOZ_LIBNOTIFY, libnotify >= $LIBNOTIFY_VERSION)
4960 AC_SUBST(MOZ_ENABLE_LIBNOTIFY)
4961 AC_SUBST(MOZ_LIBNOTIFY_CFLAGS)
4962 AC_SUBST(MOZ_LIBNOTIFY_LIBS)
4964 dnl ========================================================
4965 dnl = GNOME component (mozgnome)
4966 dnl ========================================================
4968 # The GNOME component is built if one of
4969 # gnome-vfs, gio, gconf or libnotify is available.
4970 if test "$MOZ_ENABLE_GCONF" -o \
4971 "$MOZ_ENABLE_GNOMEVFS" -o \
4972 "$MOZ_ENABLE_GIO" -o \
4973 "$MOZ_ENABLE_LIBNOTIFY"; then
4974 MOZ_ENABLE_GNOME_COMPONENT=1
4976 MOZ_ENABLE_GNOME_COMPONENT=
4978 AC_SUBST(MOZ_ENABLE_GNOME_COMPONENT)
4980 dnl ========================================================
4981 dnl = libgnomeui support module
4982 dnl ========================================================
4984 if test "$MOZ_ENABLE_GTK2"
4986 MOZ_ENABLE_GNOMEUI=1
4988 MOZ_ARG_DISABLE_BOOL(gnomeui,
4989 [ --disable-gnomeui Disable libgnomeui support (default: auto, optional at runtime) ],
4990 MOZ_ENABLE_GNOMEUI=,
4991 MOZ_ENABLE_GNOMEUI=force)
4993 if test "$MOZ_ENABLE_GNOMEUI"
4995 PKG_CHECK_MODULES(MOZ_GNOMEUI, libgnomeui-2.0 >= $GNOMEUI_VERSION,
4997 MOZ_GNOMEUI_LIBS=`echo $MOZ_GNOMEUI_LIBS | sed 's/-llinc\>//'`
4998 MOZ_ENABLE_GNOMEUI=1
5000 if test "$MOZ_ENABLE_GNOMEUI" = "force"
5002 AC_MSG_ERROR([* * * Could not find libgnomeui-2.0 >= $GNOMEUI_VERSION])
5008 if test "$MOZ_ENABLE_GNOMEUI"; then
5009 AC_DEFINE(MOZ_ENABLE_GNOMEUI)
5013 AC_SUBST(MOZ_ENABLE_GNOMEUI)
5014 AC_SUBST(MOZ_GNOMEUI_CFLAGS)
5015 AC_SUBST(MOZ_GNOMEUI_LIBS)
5017 dnl ========================================================
5019 dnl ========================================================
5021 if test "$MOZ_ENABLE_GTK2" -o "$MOZ_ENABLE_QT"
5025 MOZ_ARG_DISABLE_BOOL(dbus,
5026 [ --disable-dbus Disable dbus support ],
5030 if test "$MOZ_ENABLE_DBUS"
5032 PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION)
5033 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
5034 AC_DEFINE(MOZ_ENABLE_DBUS)
5037 AC_SUBST(MOZ_ENABLE_DBUS)
5038 AC_SUBST(MOZ_DBUS_CFLAGS)
5039 AC_SUBST(MOZ_DBUS_LIBS)
5040 AC_SUBST(MOZ_DBUS_GLIB_CFLAGS)
5041 AC_SUBST(MOZ_DBUS_GLIB_LIBS)
5043 dnl ========================================================
5044 dnl = Enable Android History instead of Places
5045 dnl ========================================================
5046 if test -n "$MOZ_ANDROID_HISTORY"; then
5047 dnl Do this if defined in confvars.sh
5048 AC_DEFINE(MOZ_ANDROID_HISTORY)
5052 dnl ========================================================
5053 dnl = Build with the Android Java compositor
5054 dnl ========================================================
5055 if test -n "$MOZ_JAVA_COMPOSITOR"; then
5056 dnl Do this if defined in confvars.sh
5057 AC_DEFINE(MOZ_JAVA_COMPOSITOR)
5060 dnl ========================================================
5061 dnl = Disable WebSMS backend
5062 dnl ========================================================
5063 MOZ_ARG_DISABLE_BOOL(websms-backend,
5064 [ --disable-websms-backend
5065 Disable WebSMS backend],
5066 MOZ_WEBSMS_BACKEND=,
5067 MOZ_WEBSMS_BACKEND=1)
5069 if test -n "$MOZ_WEBSMS_BACKEND"; then
5070 AC_DEFINE(MOZ_WEBSMS_BACKEND)
5073 dnl ========================================================
5074 dnl = Build Personal Security Manager
5075 dnl ========================================================
5076 MOZ_ARG_DISABLE_BOOL(crypto,
5077 [ --disable-crypto Disable crypto support (Personal Security Manager)],
5081 dnl ========================================================
5082 dnl = JS Debugger XPCOM component (js/jsd)
5083 dnl ========================================================
5084 MOZ_ARG_DISABLE_BOOL(jsd,
5085 [ --disable-jsd Disable JavaScript debug library],
5090 dnl ========================================================
5091 dnl = Enable IPDL's "expensive" unit tests
5092 dnl ========================================================
5095 MOZ_ARG_ENABLE_BOOL(ipdl-tests,
5096 [ --enable-ipdl-tests Enable expensive IPDL tests],
5100 if test -n "$MOZ_IPDL_TESTS"; then
5101 AC_DEFINE(MOZ_IPDL_TESTS)
5104 AC_SUBST(MOZ_IPDL_TESTS)
5106 dnl ========================================================
5107 dnl = Turns off code necessary for e10s compatibility
5108 dnl ========================================================
5109 dnl This is a temporary flag to be removed in bug 662601 when
5110 dnl it's no longer needed
5114 MOZ_ARG_ENABLE_BOOL(e10s-compat,
5115 [ --enable-e10s-compat Turns off code for e10s compat],
5119 if test -n "$MOZ_E10S_COMPAT"; then
5120 AC_DEFINE(MOZ_E10S_COMPAT)
5123 dnl ========================================================
5124 dnl = Disable building dbm
5125 dnl ========================================================
5126 MOZ_ARG_DISABLE_BOOL(dbm,
5127 [ --disable-dbm Disable building dbm],
5131 dnl bi-directional support always on
5135 dnl ========================================================
5136 dnl accessibility support on by default on all platforms
5137 dnl ========================================================
5138 MOZ_ARG_DISABLE_BOOL(accessibility,
5139 [ --disable-accessibility Disable accessibility support],
5142 if test "$ACCESSIBILITY"; then
5143 AC_DEFINE(ACCESSIBILITY)
5146 dnl ========================================================
5147 dnl Disable printing
5148 dnl ========================================================
5149 MOZ_ARG_DISABLE_BOOL(printing,
5150 [ --disable-printing Disable printing support],
5154 if test "$NS_PRINTING"; then
5155 AC_DEFINE(NS_PRINTING)
5156 AC_DEFINE(NS_PRINT_PREVIEW)
5159 dnl Turn off webrtc for OS's we don't handle yet, but allow
5160 dnl --enable-webrtc to override. Can disable for everything in
5161 dnl the master list above.
5162 if test -n "$MOZ_WEBRTC"; then
5164 *-android*|*-linuxandroid*)
5165 dnl Make sure doesn't get matched by *-linux*
5168 *-linux*|*-mingw*|*-darwin*)
5172 dnl default to disabled for all others
5178 dnl ========================================================
5179 dnl = Disable WebRTC code
5180 dnl ========================================================
5181 MOZ_ARG_DISABLE_BOOL(webrtc,
5182 [ --disable-webrtc Disable support for WebRTC],
5186 if test -n "$MOZ_WEBRTC"; then
5187 AC_DEFINE(MOZ_WEBRTC)
5192 MOZ_VP8_ERROR_CONCEALMENT=1
5195 AC_SUBST(MOZ_WEBRTC)
5197 case "$target_cpu" in
5199 MOZ_SAMPLE_TYPE_S16LE=1
5200 AC_DEFINE(MOZ_SAMPLE_TYPE_S16LE)
5201 AC_SUBST(MOZ_SAMPLE_TYPE_S16LE)
5204 MOZ_SAMPLE_TYPE_FLOAT32=1
5205 AC_DEFINE(MOZ_SAMPLE_TYPE_FLOAT32)
5206 AC_SUBST(MOZ_SAMPLE_TYPE_FLOAT32)
5210 dnl ========================================================
5211 dnl = Enable Raw Codecs
5212 dnl ========================================================
5213 MOZ_ARG_ENABLE_BOOL(raw,
5214 [ --enable-raw Enable support for RAW media],
5218 if test -n "$MOZ_RAW"; then
5225 dnl ========================================================
5226 dnl = Disable Ogg Codecs
5227 dnl ========================================================
5228 MOZ_ARG_DISABLE_BOOL(ogg,
5229 [ --disable-ogg Disable support for OGG media (Theora video and Vorbis audio)],
5233 if test -n "$MOZ_OGG"; then
5239 dnl Checks for __attribute__(aligned()) directive
5240 AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
5241 [ac_cv_c_attribute_aligned],
5242 [ac_cv_c_attribute_aligned=0
5243 CFLAGS_save="${CFLAGS}"
5244 CFLAGS="${CFLAGS} -Werror"
5245 for ac_cv_c_attr_align_try in 64 32 16 8; do
5246 echo "trying $ac_cv_c_attr_align_try"
5248 [static char c __attribute__ ((aligned(${ac_cv_c_attr_align_try}))) = 0; return c;],
5249 [ac_cv_c_attribute_aligned="${ac_cv_c_attr_align_try}"])
5250 if test "$ac_cv_c_attribute_aligned" != 0; then
5254 CFLAGS="${CFLAGS_save}"])
5255 if test "${ac_cv_c_attribute_aligned}" != "0"; then
5256 AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
5257 [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
5261 dnl ========================================================
5262 dnl = Disable Opus audio codec support
5263 dnl ========================================================
5264 MOZ_ARG_DISABLE_BOOL(opus,
5265 [ --disable-opus Disable support for Opus audio],
5269 dnl ========================================================
5270 dnl = Disable VP8 decoder support
5271 dnl ========================================================
5272 MOZ_ARG_DISABLE_BOOL(webm,
5273 [ --disable-webm Disable support for WebM media (VP8 video and Vorbis audio)],
5277 if test -n "$MOZ_WEBM"; then
5282 dnl ========================================================
5283 dnl = Enable media plugin support
5284 dnl ========================================================
5285 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
5286 dnl Enable support on android by default
5290 MOZ_ARG_ENABLE_BOOL(media-plugins,
5291 [ --enable-media-plugins Enable support for media plugins],
5292 MOZ_MEDIA_PLUGINS=1,
5295 if test -n "$MOZ_MEDIA_PLUGINS"; then
5296 AC_DEFINE(MOZ_MEDIA_PLUGINS)
5299 dnl ========================================================
5300 dnl = Enable getUserMedia support
5301 dnl ========================================================
5302 MOZ_ARG_ENABLE_BOOL(media-navigator,
5303 [ --enable-media-navigator Enable support for getUserMedia],
5304 MOZ_MEDIA_NAVIGATOR=1,
5305 MOZ_MEDIA_NAVIGATOR=)
5307 if test -n "$MOZ_MEDIA_NAVIGATOR"; then
5308 AC_DEFINE(MOZ_MEDIA_NAVIGATOR)
5311 dnl ========================================================
5312 dnl = Enable building OMX media plugin (B2G or Android)
5313 dnl ========================================================
5314 if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
5315 dnl Enable support on android by default
5319 MOZ_ARG_ENABLE_BOOL(omx-plugin,
5320 [ --enable-omx-plugin Enable building OMX plugin (B2G)],
5324 if test -n "$MOZ_OMX_PLUGIN"; then
5325 if test "$OS_TARGET" = "Android"; then
5326 dnl Only allow building OMX plugin on Gonk (B2G) or Android
5327 AC_DEFINE(MOZ_OMX_PLUGIN)
5329 dnl fail if we're not building on Gonk or Android
5330 AC_MSG_ERROR([OMX media plugin can only be built on B2G or Android])
5334 dnl system libvpx Support
5335 dnl ========================================================
5336 MOZ_ARG_WITH_BOOL(system-libvpx,
5337 [ --with-system-libvpx Use system libvpx (located with pkgconfig)],
5338 MOZ_NATIVE_LIBVPX=1)
5343 if test -n "$MOZ_VP8"; then
5345 if test -n "$MOZ_VP8_ERROR_CONCEALMENT" ; then
5346 AC_DEFINE(MOZ_VP8_ERROR_CONCEALMENT)
5348 if test -n "$MOZ_VP8_ENCODER" ; then
5349 AC_DEFINE(MOZ_VP8_ENCODER)
5352 if test -n "$MOZ_NATIVE_LIBVPX"; then
5353 dnl ============================
5354 dnl === libvpx Version check ===
5355 dnl ============================
5356 dnl Check to see if we have a system libvpx package.
5357 PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.0.0)
5359 MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
5360 [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.])])
5363 AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
5364 [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
5369 AC_SUBST(MOZ_NATIVE_LIBVPX)
5370 AC_SUBST(MOZ_LIBVPX_CFLAGS)
5371 AC_SUBST(MOZ_LIBVPX_LIBS)
5373 if test "$MOZ_WEBM"; then
5377 if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then
5384 if test -n "$MOZ_VP8" -a -z "$MOZ_NATIVE_LIBVPX"; then
5386 dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
5387 dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
5388 dnl We currently require gcc on all arm platforms.
5391 VPX_NEED_OBJ_INT_EXTRACT=
5393 dnl See if we have assembly on this platform.
5394 case "$OS_ARCH:$CPU_ARCH" in
5396 VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
5400 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
5404 VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
5408 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
5412 VPX_ASFLAGS="-f elf32 -rnasm -pnasm"
5416 VPX_ASFLAGS="-f elf64 -rnasm -pnasm -DPIC"
5420 VPX_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC"
5424 VPX_ASFLAGS="-f macho64 -rnasm -pnasm -DPIC"
5428 VPX_ASFLAGS="-f x64 -rnasm -pnasm"
5432 dnl Check for yasm 1.1 or greater.
5433 if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then
5434 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.])
5435 elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
5436 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.])
5438 VPX_ASFLAGS="-f win32 -rnasm -pnasm -DPIC"
5440 dnl The encoder needs obj_int_extract to get asm offsets.
5444 if test -n "$GNU_AS" ; then
5446 dnl These flags are a lie; they're just used to enable the requisite
5447 dnl opcodes; actual arch detection is done at runtime.
5448 VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
5449 VPX_DASH_C_FLAG="-c"
5450 VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/build/make/ads2gas.pl'
5451 VPX_ASM_SUFFIX="$ASM_SUFFIX"
5456 if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_X86_ASM" -a -z "$VPX_AS"; then
5457 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.])
5460 if test -n "$MOZ_VP8_ENCODER" -a \
5461 -z "$GNU_CC" -a -z "$INTEL_CC" -a -z "$CLANG_CC" ; then
5462 dnl We prefer to get asm offsets using inline assembler, which the above
5463 dnl compilers can do. When we're not using one of those, we have to fall
5464 dnl back to obj_int_extract, which reads them from a compiled object
5465 dnl file. Unfortunately, that only works if we're compiling on a system
5466 dnl with the header files for the appropriate object file format.
5467 VPX_NEED_OBJ_INT_EXTRACT=1
5470 if test -n "$VPX_X86_ASM"; then
5471 AC_DEFINE(VPX_X86_ASM)
5472 elif test -n "$VPX_ARM_ASM"; then
5473 AC_DEFINE(VPX_ARM_ASM)
5475 AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.])
5479 dnl ========================================================
5480 dnl = Disable Wave decoder support
5481 dnl ========================================================
5482 MOZ_ARG_DISABLE_BOOL(wave,
5483 [ --disable-wave Disable Wave decoder support],
5487 if test -n "$MOZ_WAVE"; then
5494 dnl ========================================================
5495 dnl = Handle dependent SYDNEYAUDIO, CUBEB, and MEDIA defines
5496 dnl ========================================================
5498 if test -n "$MOZ_SYDNEYAUDIO"; then
5499 AC_DEFINE(MOZ_SYDNEYAUDIO)
5502 if test -n "$MOZ_SPEEX_RESAMPLER"; then
5503 AC_DEFINE(MOZ_SPEEX_RESAMPLER)
5506 if test -n "$MOZ_CUBEB"; then
5508 *-android*|*-linuxandroid*)
5509 dnl No Android implementation of libcubeb yet.
5512 AC_DEFINE(MOZ_CUBEB)
5515 AC_DEFINE(MOZ_CUBEB)
5518 AC_DEFINE(MOZ_CUBEB)
5521 AC_DEFINE(MOZ_CUBEB)
5524 dnl Other targets will be enabled soon.
5529 if test -n "$MOZ_MEDIA"; then
5530 AC_DEFINE(MOZ_MEDIA)
5533 if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
5534 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/])
5537 if test -n "$MOZ_VORBIS"; then
5538 AC_DEFINE(MOZ_VORBIS)
5541 if test -n "$MOZ_TREMOR"; then
5542 AC_DEFINE(MOZ_TREMOR)
5545 if test -n "$MOZ_OPUS"; then
5549 dnl ========================================================
5550 dnl = Check alsa availability on Linux if using sydneyaudio
5551 dnl ========================================================
5553 dnl If using sydneyaudio with Linux, ensure that the alsa library is available
5554 if test -n "$MOZ_SYDNEYAUDIO" -a "$OS_TARGET" = "Linux"; then
5555 PKG_CHECK_MODULES(MOZ_ALSA, alsa, ,
5556 [echo "$MOZ_ALSA_PKG_ERRORS"
5557 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.)])])
5560 dnl ========================================================
5561 dnl = Enable PulseAudio
5562 dnl ========================================================
5564 MOZ_ARG_ENABLE_BOOL(pulseaudio,
5565 [ --enable-pulseaudio Enable PulseAudio support (experimental)],
5569 if test -n "$MOZ_PULSEAUDIO"; then
5570 AC_DEFINE(MOZ_CUBEB)
5571 PKG_CHECK_MODULES(MOZ_PULSEAUDIO, libpulse, ,
5572 [echo "$MOZ_PULSEAUDIO_PKG_ERRORS"
5573 AC_MSG_ERROR([pulseaudio audio backend requires libpulse package])])
5576 AC_SUBST(MOZ_PULSEAUDIO)
5577 AC_SUBST(MOZ_PULSEAUDIO_CFLAGS)
5578 AC_SUBST(MOZ_PULSEAUDIO_LIBS)
5580 dnl ========================================================
5581 dnl = Enable GStreamer
5582 dnl ========================================================
5583 MOZ_ARG_ENABLE_BOOL(gstreamer,
5584 [ --enable-gstreamer Enable GStreamer support],
5588 if test "$MOZ_GSTREAMER"; then
5589 # API version, eg 0.10, 1.0 etc
5590 GST_API_VERSION=0.10
5591 # core/base release number
5592 # depend on >= 0.10.33 as that's when the playbin2 source-setup signal was
5595 PKG_CHECK_MODULES(GSTREAMER,
5596 gstreamer-$GST_API_VERSION >= $GST_VERSION
5597 gstreamer-app-$GST_API_VERSION
5598 gstreamer-plugins-base-$GST_API_VERSION)
5599 if test -n "$GSTREAMER_LIBS"; then
5600 _SAVE_LDFLAGS=$LDFLAGS
5601 LDFLAGS="$LDFLAGS $GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
5602 AC_TRY_LINK(,[return 0;],_HAVE_LIBGSTVIDEO=1,_HAVE_LIBGSTVIDEO=)
5603 if test -n "$_HAVE_LIBGSTVIDEO" ; then
5604 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstvideo-$GST_API_VERSION"
5606 AC_MSG_ERROR([gstreamer video backend requires libgstvideo])
5608 LDFLAGS=$_SAVE_LDFLAGS
5610 AC_MSG_ERROR([gstreamer backend requires the gstreamer packages])
5613 AC_SUBST(GSTREAMER_CFLAGS)
5614 AC_SUBST(GSTREAMER_LIBS)
5615 AC_SUBST(MOZ_GSTREAMER)
5617 if test -n "$MOZ_GSTREAMER"; then
5618 AC_DEFINE(MOZ_GSTREAMER)
5623 dnl ========================================================
5624 dnl Permissions System
5625 dnl ========================================================
5626 MOZ_ARG_DISABLE_BOOL(permissions,
5627 [ --disable-permissions Disable permissions (popup and cookie blocking)],
5632 dnl ========================================================
5634 dnl ========================================================
5635 MOZ_ARG_DISABLE_BOOL(negotiateauth,
5636 [ --disable-negotiateauth Disable GSS-API negotiation ],
5637 MOZ_AUTH_EXTENSION=,
5638 MOZ_AUTH_EXTENSION=1 )
5640 dnl ========================================================
5642 dnl ========================================================
5643 MOZ_ARG_DISABLE_BOOL(xtf,
5644 [ --disable-xtf Disable XTF (pluggable xml tags) support],
5647 if test "$MOZ_XTF"; then
5651 dnl ========================================================
5652 dnl Pref extensions (autoconfig)
5653 dnl ========================================================
5654 MOZ_ARG_DISABLE_BOOL(pref-extensions,
5655 [ --disable-pref-extensions
5656 Disable pref extensions such as autoconfig],
5657 MOZ_PREF_EXTENSIONS=,
5658 MOZ_PREF_EXTENSIONS=1 )
5660 dnl ========================================================
5661 dnl Searching of system directories for extensions.
5662 dnl Note: this switch is meant to be used for test builds
5663 dnl whose behavior should not depend on what happens to be
5664 dnl installed on the local machine.
5665 dnl ========================================================
5666 MOZ_ARG_DISABLE_BOOL(system-extension-dirs,
5667 [ --disable-system-extension-dirs
5668 Disable searching system- and account-global
5669 directories for extensions of any kind; use
5670 only profile-specific extension directories],
5671 ENABLE_SYSTEM_EXTENSION_DIRS=,
5672 ENABLE_SYSTEM_EXTENSION_DIRS=1 )
5673 if test "$ENABLE_SYSTEM_EXTENSION_DIRS"; then
5674 AC_DEFINE(ENABLE_SYSTEM_EXTENSION_DIRS)
5677 dnl ========================================================
5678 dnl = Universalchardet
5679 dnl ========================================================
5680 MOZ_ARG_DISABLE_BOOL(universalchardet,
5681 [ --disable-universalchardet
5682 Disable universal encoding detection],
5683 MOZ_UNIVERSALCHARDET=,
5684 MOZ_UNIVERSALCHARDET=1 )
5686 if test -n "${JAVA_BIN_PATH}"; then
5687 dnl Look for javac and jar in the specified path.
5688 JAVA_PATH="$JAVA_BIN_PATH"
5690 dnl No path specified, so look for javac and jar in $JAVA_HOME & $PATH.
5691 JAVA_PATH="$JAVA_HOME/bin:$PATH"
5694 MOZ_PATH_PROG(JAVA, java, :, [$JAVA_PATH])
5695 MOZ_PATH_PROG(JAVAC, javac, :, [$JAVA_PATH])
5696 MOZ_PATH_PROG(JAR, jar, :, [$JAVA_PATH])
5698 if test -n "${JAVA_BIN_PATH}" -o \
5699 \( "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" \); then
5700 if test -z "$JAVA" -o "$JAVA" = ":" -o -z "$JAVAC" -o "$JAVAC" = ":" -o -z "$JAR" -o "$JAR" = ":"; then
5701 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}])
5705 dnl ========================================================
5706 dnl = ANGLE OpenGL->D3D translator for WebGL
5707 dnl = * only applies to win32
5708 dnl = * enabled by default (shipping build); requires explicit --disable to disable
5709 dnl ========================================================
5711 MOZ_DIRECTX_SDK_PATH=
5712 MOZ_DIRECTX_SDK_CPU_SUFFIX=
5715 MOZ_D3DCOMPILER_CAB=
5717 MOZ_D3DCOMPILER_DLL=
5718 case "$target_os" in
5720 MOZ_ANGLE_RENDERER=1
5724 # The DirectX SDK libraries are split into x86 and x64 sub-directories
5725 case "${target_cpu}" in
5727 MOZ_DIRECTX_SDK_CPU_SUFFIX=x86
5730 MOZ_DIRECTX_SDK_CPU_SUFFIX=x64
5734 MOZ_ARG_DISABLE_BOOL(webgl,
5735 [ --disable-webgl Disable building of the WebGL implementation],
5736 MOZ_WEBGL_DISABLED=1,
5737 MOZ_WEBGL_DISABLED=)
5739 if test -n "$MOZ_WEBGL_DISABLED"; then
5744 if test -n "$MOZ_ANGLE_RENDERER"; then
5745 # Get the SDK path from the registry.
5746 # First try to get the June 2010 SDK
5747 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK (June 2010)' | head -n 1`
5748 if test -z "$MOZ_DIRECTX_SDK_REG_KEY" ; then
5749 # Otherwise just take whatever comes first
5750 MOZ_DIRECTX_SDK_REG_KEY=`reg query 'HKLM\Software\Microsoft\DirectX' //s | grep 'Microsoft DirectX SDK' | head -n 1`
5753 if test -n "`echo $MOZ_DIRECTX_SDK_REG_KEY | grep 'February 2010'`" ; then
5754 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.])
5756 MOZ_DIRECTX_SDK_PATH=`reg query "$MOZ_DIRECTX_SDK_REG_KEY" //v InstallPath | grep REG_SZ | sed 's/.*\([[a-zA-Z]]\)\\:\\\\/\\1\\:\\\\/'`
5759 if test -n "$MOZ_DIRECTX_SDK_PATH" &&
5760 test -f "$MOZ_DIRECTX_SDK_PATH"/include/d3dx9.h &&
5761 test -f "$MOZ_DIRECTX_SDK_PATH"/lib/$MOZ_DIRECTX_SDK_CPU_SUFFIX/dxguid.lib ; then
5762 AC_MSG_RESULT([Found DirectX SDK via registry, using $MOZ_DIRECTX_SDK_PATH])
5764 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.])
5767 # Get the SDK numeric version (e.g. 43) by looking at the dependencies of d3dx9.lib
5768 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'`
5770 if test -z "$MOZ_D3DX9_VERSION" ; then
5771 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.])
5774 MOZ_D3DX9_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *d3dx9_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
5775 MOZ_D3DCOMPILER_CAB=`find "$MOZ_DIRECTX_SDK_PATH"/Redist -name *D3DCompiler_${MOZ_D3DX9_VERSION}_${MOZ_DIRECTX_SDK_CPU_SUFFIX}.cab | head -n1`
5777 MOZ_D3DX9_DLL=d3dx9_$MOZ_D3DX9_VERSION.dll
5778 MOZ_D3DCOMPILER_DLL=D3DCompiler_$MOZ_D3DX9_VERSION.dll
5781 dnl ========================================================
5782 dnl = Breakpad crash reporting (on by default on supported platforms)
5783 dnl ========================================================
5786 i?86-*-mingw*|x86_64-*-mingw*)
5789 i?86-apple-darwin*|x86_64-apple-darwin*)
5792 i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
5793 if test "$MOZ_ENABLE_GTK2"; then
5797 *-android*|*-linuxandroid*)
5805 MOZ_ARG_DISABLE_BOOL(crashreporter,
5806 [ --disable-crashreporter Disable breakpad crash reporting],
5808 MOZ_CRASHREPORTER=1)
5810 if test -n "$MOZ_CRASHREPORTER"; then
5811 AC_DEFINE(MOZ_CRASHREPORTER)
5813 if test "$OS_TARGET" = "Linux" -o "$OS_ARCH" = "SunOS" && \
5814 test -z "$SKIP_LIBRARY_CHECKS"; then
5815 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
5816 AC_SUBST(MOZ_GTHREAD_CFLAGS)
5817 AC_SUBST(MOZ_GTHREAD_LIBS)
5819 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.])])
5822 if test "$OS_ARCH" != "$HOST_OS_ARCH"; then
5823 AC_MSG_ERROR([Breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH. Use --disable-crashreporter.])
5826 if test "$OS_ARCH" = "WINNT" -a -z "$HAVE_64BIT_OS"; then
5827 MOZ_CRASHREPORTER_INJECTOR=1
5828 AC_DEFINE(MOZ_CRASHREPORTER_INJECTOR)
5832 MOZ_ARG_WITH_STRING(crashreporter-enable-percent,
5833 [ --with-crashreporter-enable-percent=NN
5834 Enable sending crash reports by default on NN% of users. (default=100)],
5835 [ val=`echo $withval | sed 's/[^0-9]//g'`
5836 MOZ_CRASHREPORTER_ENABLE_PERCENT="$val"])
5838 if test -z "$MOZ_CRASHREPORTER_ENABLE_PERCENT"; then
5839 MOZ_CRASHREPORTER_ENABLE_PERCENT=100
5841 AC_DEFINE_UNQUOTED(MOZ_CRASHREPORTER_ENABLE_PERCENT, $MOZ_CRASHREPORTER_ENABLE_PERCENT)
5843 dnl ========================================================
5844 dnl = libjpeg-turbo configuration
5845 dnl ========================================================
5847 if test -z "$MOZ_NATIVE_JPEG"; then
5851 MOZ_ARG_DISABLE_BOOL(libjpeg_turbo,
5852 [ --disable-libjpeg-turbo Disable optimized jpeg decoding routines],
5854 MOZ_LIBJPEG_TURBO=1)
5856 if test "$MOZ_NATIVE_JPEG" = 1 -a "$MOZ_LIBJPEG_TURBO" = 1; then
5857 AC_MSG_ERROR([cannot use --with-system-jpeg with --enable-libjpeg-turbo.])
5860 dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
5863 if test -n "$MOZ_LIBJPEG_TURBO"; then
5865 dnl Do we support libjpeg-turbo on this platform?
5866 case "$OS_ARCH:$OS_TEST" in
5867 Linux:x86|Linux:i?86)
5868 LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
5869 LIBJPEG_TURBO_X86_ASM=1
5872 LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
5873 LIBJPEG_TURBO_X64_ASM=1
5876 LIBJPEG_TURBO_ASFLAGS="-f elf32 -rnasm -pnasm -DPIC -DELF"
5877 LIBJPEG_TURBO_X86_ASM=1
5880 LIBJPEG_TURBO_ASFLAGS="-f elf64 -rnasm -pnasm -D__x86_64__ -DPIC -DELF"
5881 LIBJPEG_TURBO_X64_ASM=1
5884 LIBJPEG_TURBO_ASFLAGS="-f macho32 -rnasm -pnasm -DPIC -DMACHO"
5885 LIBJPEG_TURBO_X86_ASM=1
5888 LIBJPEG_TURBO_ASFLAGS="-f macho64 -rnasm -pnasm -D__x86_64__ -DPIC -DMACHO"
5889 LIBJPEG_TURBO_X64_ASM=1
5891 WINNT:x86|WINNT:i?86)
5892 LIBJPEG_TURBO_ASFLAGS="-f win32 -rnasm -pnasm -DPIC -DWIN32"
5893 LIBJPEG_TURBO_X86_ASM=1
5896 LIBJPEG_TURBO_ASFLAGS="-f win64 -rnasm -pnasm -D__x86_64__ -DPIC -DWIN64 -DMSVC"
5897 LIBJPEG_TURBO_X64_ASM=1
5900 LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon"
5901 LIBJPEG_TURBO_ARM_ASM=1
5907 dnl If we're on an x86 or x64 system which supports libjpeg-turbo's asm routines
5908 dnl and --disable-libjpeg-turbo wasn't passed, check for Yasm, and error out if
5909 dnl it doesn't exist or we have too old of a version.
5910 if test -n "$LIBJPEG_TURBO_X86_ASM" -o -n "$LIBJPEG_TURBO_X64_ASM" ; then
5911 AC_MSG_CHECKING([for Yasm assembler])
5912 AC_CHECK_PROGS(LIBJPEG_TURBO_AS, yasm, "")
5914 if test -z "$LIBJPEG_TURBO_AS" ; then
5915 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.])
5918 dnl Check that we have the right yasm version. We require 1.0.1 or newer
5919 dnl on Linux and 1.1 or newer everywhere else.
5920 if test "$OS_ARCH" = "Linux" ; then
5921 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
5922 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.])
5925 if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
5926 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.])
5931 dnl If we're on an ARM system which supports libjpeg-turbo's asm routines and
5932 dnl --disable-libjpeg-turbo wasn't passed, use the C compiler as the assembler.
5933 if test -n "$LIBJPEG_TURBO_ARM_ASM" ; then
5934 echo "Using $AS as the assembler for ARM code."
5935 LIBJPEG_TURBO_AS=$AS
5938 if test -n "$LIBJPEG_TURBO_X86_ASM"; then
5939 AC_DEFINE(LIBJPEG_TURBO_X86_ASM)
5940 elif test -n "$LIBJPEG_TURBO_X64_ASM"; then
5941 AC_DEFINE(LIBJPEG_TURBO_X64_ASM)
5942 elif test -n "$LIBJPEG_TURBO_ARM_ASM"; then
5943 AC_DEFINE(LIBJPEG_TURBO_ARM_ASM)
5944 elif test -n "$MOZ_LIBJPEG_TURBO"; then
5945 dnl Warn if we're not building the optimized routines, even though the user
5946 dnl didn't specify --disable-libjpeg-turbo.
5947 AC_MSG_WARN([No assembler or assembly support for libjpeg-turbo. Using unoptimized C routines.])
5950 dnl ========================================================
5951 dnl = Enable compilation of specific extension modules
5952 dnl ========================================================
5954 MOZ_ARG_ENABLE_STRING(extensions,
5955 [ --enable-extensions Enable extensions],
5956 [ for option in `echo $enableval | sed 's/,/ /g'`; do
5957 if test "$option" = "yes" -o "$option" = "all"; then
5958 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
5959 elif test "$option" = "no" -o "$option" = "none"; then
5961 elif test "$option" = "default"; then
5962 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
5963 elif test `echo "$option" | grep -c \^-` != 0; then
5964 option=`echo $option | sed 's/^-//'`
5965 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
5967 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
5970 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
5972 if test -z "$MOZ_ENABLE_GNOMEVFS" -a -z "$MOZ_GNOMEVFS_LIBS" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5973 # Suppress warning on non-X11 platforms
5974 if test -n "$MOZ_X11"; then
5975 AC_MSG_WARN([Cannot build gnomevfs without required libraries. Removing gnomevfs from MOZ_EXTENSIONS.])
5977 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5980 dnl Do not build gnomevfs with libxul based apps
5981 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gnomevfs` -ne 0; then
5982 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gnomevfs||'`
5985 if test -z "$MOZ_ENABLE_GIO" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
5986 # Suppress warning on non-X11 platforms
5987 if test -n "$MOZ_X11"; then
5988 AC_MSG_WARN([Cannot build gio without required libraries. Removing gio from MOZ_EXTENSIONS.])
5990 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
5993 dnl Do not build gio with libxul based apps
5994 if test -n "$LIBXUL_SDK_DIR" -a `echo "$MOZ_EXTENSIONS" | grep -c gio` -ne 0; then
5995 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|gio||'`
5998 if test -z "$MOZ_JSDEBUGGER" -a `echo "$MOZ_EXTENSIONS" | grep -c venkman` -ne 0; then
5999 AC_MSG_WARN([Cannot build venkman without JavaScript debug library. Removing venkman from MOZ_EXTENSIONS.])
6000 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|venkman||'`
6003 dnl xforms requires xtf
6004 if test -z "$MOZ_XTF" -a `echo "$MOZ_EXTENSIONS" | grep -c xforms` -ne 0; then
6005 AC_MSG_WARN([Cannot build XForms without XTF support. Removing XForms from MOZ_EXTENSIONS.])
6006 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's|xforms||g'`
6010 MOZ_EXTENSIONS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_EXTENSIONS}`
6012 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
6013 dnl when trying to build a nonexistent extension.
6014 for extension in $MOZ_EXTENSIONS; do
6015 if test ! -d "${srcdir}/extensions/${extension}"; then
6016 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
6020 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
6021 AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS)
6024 dnl ========================================================
6025 dnl CSS3 Flexbox Support
6026 dnl ========================================================
6027 if test -n "$MOZ_FLEXBOX"; then
6028 AC_DEFINE(MOZ_FLEXBOX)
6031 dnl ========================================================
6032 dnl Build Freetype in the tree
6033 dnl ========================================================
6034 MOZ_ARG_ENABLE_BOOL(tree-freetype,
6035 [ --enable-tree-freetype Enable Tree FreeType],
6036 MOZ_TREE_FREETYPE=1,
6037 MOZ_TREE_FREETYPE= )
6038 if test -n "$MOZ_TREE_FREETYPE"; then
6039 if test -n "$_WIN32_MSVC"; then
6040 AC_ERROR("building with in-tree freetype is not supported on MSVC")
6042 AC_DEFINE(MOZ_TREE_FREETYPE)
6043 AC_SUBST(MOZ_TREE_FREETYPE)
6044 MOZ_ENABLE_CAIRO_FT=1
6045 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
6046 FT2_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6047 CAIRO_FT_CFLAGS='-I$(topsrcdir)/modules/freetype2/include'
6048 FT2_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6050 CAIRO_FT_LIBS='$(call EXPAND_LIBNAME_PATH,freetype,$(DEPTH)/modules/freetype2/.libs)'
6051 AC_DEFINE(HAVE_FT_BITMAP_SIZE_Y_PPEM)
6052 AC_DEFINE(HAVE_FT_GLYPHSLOT_EMBOLDEN)
6053 AC_DEFINE(HAVE_FT_LOAD_SFNT_TABLE)
6054 AC_SUBST(CAIRO_FT_CFLAGS)
6057 dnl ========================================================
6059 dnl ========================================================
6060 dnl Abort Windows build if the required major version and
6061 dnl minimum minor version of Unicode NSIS isn't in the path
6062 dnl (unless in case of cross compiling, for which Unicode
6063 dnl is not yet sufficient).
6064 if test "$OS_ARCH" = "WINNT"; then
6065 REQ_NSIS_MAJOR_VER=2
6066 MIN_NSIS_MINOR_VER=33
6067 MOZ_PATH_PROGS(MAKENSISU, $MAKENSISU makensisu-2.46 makensisu makensis)
6068 if test -n "$MAKENSISU" -a "$MAKENSISU" != ":"; then
6069 AC_MSG_RESULT([yes])
6071 MAKENSISU_VER=`"$MAKENSISU" -version 2>/dev/null | sed -e '/-Unicode/!s/.*//g' -e 's/^v\([0-9]\+\.[0-9]\+\)\-Unicode$/\1/g'`
6073 if test ! "$MAKENSISU_VER" = ""; then
6074 MAKENSISU_MAJOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $1 }'`
6075 MAKENSISU_MINOR_VER=`echo $MAKENSISU_VER | $AWK -F\. '{ print $2 }'`
6077 AC_MSG_CHECKING([for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER])
6078 if test "$MAKENSISU_VER" = "" || \
6079 test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \
6080 ! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then
6082 if test -z "$CROSS_COMPILE"; then
6083 AC_MSG_ERROR([To build the installer you must have the latest MozillaBuild or Unicode NSIS with a major version of $REQ_NSIS_MAJOR_VER and a minimum minor version of $MIN_NSIS_MINOR_VER in your path.])
6088 elif test -z "$CROSS_COMPILE"; then
6089 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.])
6095 dnl ========================================================
6097 dnl ========================================================
6098 MOZ_ARG_DISABLE_BOOL(webapp-runtime,
6099 [ --disable-webapp-runtime Disable Web App Runtime],
6100 MOZ_WEBAPP_RUNTIME=,
6101 MOZ_WEBAPP_RUNTIME=1)
6102 if test "$MOZ_WIDGET_TOOLKIT" != "windows" -a "$MOZ_WIDGET_TOOLKIT" != "cocoa" -a "$MOZ_WIDGET_TOOLKIT" != "gtk2"; then
6105 if test "$OS_ARCH" = "WINNT" -a -z "$MAKENSISU" -a -n "$CROSS_COMPILE"; then
6108 AC_SUBST(MOZ_WEBAPP_RUNTIME)
6109 if test "$MOZ_WEBAPP_RUNTIME"; then
6110 AC_DEFINE(MOZ_WEBAPP_RUNTIME)
6113 AC_MSG_CHECKING([for tar archiver])
6114 AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
6115 if test -z "$TAR"; then
6116 AC_MSG_ERROR([no tar archiver found in \$PATH])
6118 AC_MSG_RESULT([$TAR])
6121 AC_MSG_CHECKING([for wget])
6122 AC_CHECK_PROGS(WGET, wget, "")
6123 AC_MSG_RESULT([$WGET])
6126 dnl ========================================================
6128 dnl ========================================================
6130 if test -n "$MOZ_SIGN_CMD"; then
6131 AC_DEFINE(MOZ_SIGNING)
6134 dnl ========================================================
6135 dnl Maintenance Service
6136 dnl ========================================================
6138 MOZ_ARG_ENABLE_BOOL(maintenance-service,
6139 [ --enable-maintenance-service Enable building of maintenanceservice],
6140 MOZ_MAINTENANCE_SERVICE=1,
6141 MOZ_MAINTENANCE_SERVICE= )
6143 if test -n "$MOZ_MAINTENANCE_SERVICE"; then
6144 if test "$OS_ARCH" = "WINNT"; then
6145 AC_DEFINE(MOZ_MAINTENANCE_SERVICE)
6147 AC_MSG_ERROR([Can only build with --enable-maintenance-service with a Windows target])
6151 dnl ========================================================
6152 dnl Verify MAR signatures
6153 dnl ========================================================
6155 MOZ_ARG_ENABLE_BOOL(verify-mar,
6156 [ --enable-verify-mar Enable verifying MAR signatures],
6157 MOZ_VERIFY_MAR_SIGNATURE=1,
6158 MOZ_VERIFY_MAR_SIGNATURE= )
6160 if test -n "$MOZ_VERIFY_MAR_SIGNATURE"; then
6161 if test "$OS_ARCH" = "WINNT"; then
6162 AC_DEFINE(MOZ_VERIFY_MAR_SIGNATURE)
6164 AC_MSG_ERROR([Can only build with --enable-verify-mar with a Windows target])
6168 dnl ========================================================
6169 dnl Enable building the signmar program.
6170 dnl This option is much different than the --enable-verify-mar option.
6171 dnl --enable-verify-mar is for enabling the verification check on MAR
6172 dnl files in the updater. The --enable-signmar option is for building
6173 dnl the signmar program.
6174 dnl ========================================================
6176 MOZ_ARG_ENABLE_BOOL(signmar,
6177 [ --enable-signmar Enable building the signmar program],
6178 MOZ_ENABLE_SIGNMAR=1,
6179 MOZ_ENABLE_SIGNMAR= )
6181 if test -n "$MOZ_ENABLE_SIGNMAR"; then
6182 AC_DEFINE(MOZ_ENABLE_SIGNMAR)
6185 dnl ========================================================
6187 dnl ========================================================
6189 MOZ_ARG_DISABLE_BOOL(updater,
6190 [ --disable-updater Disable building of updater],
6194 if test -n "$MOZ_UPDATER"; then
6195 AC_DEFINE(MOZ_UPDATER)
6198 # app update channel is 'default' when not supplied.
6199 MOZ_ARG_ENABLE_STRING([update-channel],
6200 [ --enable-update-channel=CHANNEL
6201 Select application update channel (default=default)],
6202 MOZ_UPDATE_CHANNEL=`echo $enableval | tr A-Z a-z`)
6204 if test -z "$MOZ_UPDATE_CHANNEL"; then
6205 MOZ_UPDATE_CHANNEL=default
6207 AC_DEFINE_UNQUOTED(MOZ_UPDATE_CHANNEL, $MOZ_UPDATE_CHANNEL)
6208 AC_SUBST(MOZ_UPDATE_CHANNEL)
6210 # tools/update-packaging is not checked out by default.
6211 MOZ_ARG_ENABLE_BOOL(update-packaging,
6212 [ --enable-update-packaging
6213 Enable tools/update-packaging],
6214 MOZ_UPDATE_PACKAGING=1,
6215 MOZ_UPDATE_PACKAGING= )
6216 AC_SUBST(MOZ_UPDATE_PACKAGING)
6218 dnl ========================================================
6219 dnl build the tests by default
6220 dnl ========================================================
6221 MOZ_ARG_DISABLE_BOOL(tests,
6222 [ --disable-tests Do not build test libraries & programs],
6226 dnl ========================================================
6227 dnl parental controls (for Windows Vista)
6228 dnl ========================================================
6229 MOZ_ARG_DISABLE_BOOL(parental-controls,
6230 [ --disable-parental-controls
6231 Do not build parental controls],
6232 MOZ_DISABLE_PARENTAL_CONTROLS=1,
6233 MOZ_DISABLE_PARENTAL_CONTROLS=)
6234 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
6235 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
6238 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
6240 dnl ========================================================
6241 dnl = Disable DOMCrypto
6242 dnl ========================================================
6243 if test -n "$MOZ_DISABLE_DOMCRYPTO"; then
6244 AC_DEFINE(MOZ_DISABLE_DOMCRYPTO)
6247 dnl ========================================================
6249 dnl = Module specific options
6251 dnl ========================================================
6252 MOZ_ARG_HEADER(Individual module options)
6254 dnl ========================================================
6255 dnl = Disable feed handling components
6256 dnl ========================================================
6257 MOZ_ARG_DISABLE_BOOL(feeds,
6258 [ --disable-feeds Disable feed handling and processing components],
6261 if test -n "$MOZ_FEEDS"; then
6262 AC_DEFINE(MOZ_FEEDS)
6264 if test "$MOZ_BUILD_APP" = "browser"; then
6265 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
6269 dnl ========================================================
6270 dnl Check for sqlite
6271 dnl ========================================================
6274 MOZ_ARG_ENABLE_BOOL(system-sqlite,
6275 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
6276 MOZ_NATIVE_SQLITE=1,
6277 MOZ_NATIVE_SQLITE= )
6279 if test -z "$MOZ_NATIVE_SQLITE"
6282 SQLITE_LIBS='$(call EXPAND_LIBNAME_PATH,mozsqlite3,$(DIST)/lib)'
6284 dnl ============================
6285 dnl === SQLite Version check ===
6286 dnl ============================
6287 dnl Check to see if the system SQLite package is new enough.
6288 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
6290 dnl ==================================
6291 dnl === SQLITE_SECURE_DELETE check ===
6292 dnl ==================================
6293 dnl Check to see if the system SQLite package is compiled with
6294 dnl SQLITE_SECURE_DELETE enabled.
6295 AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
6296 _SAVE_CFLAGS="$CFLAGS"
6297 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6299 LIBS="$LIBS $SQLITE_LIBS"
6300 AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
6302 #include "sqlite3.h"
6304 int main(int argc, char **argv){
6305 return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
6307 ac_cv_sqlite_secure_delete=yes,
6308 ac_cv_sqlite_secure_delete=no,
6309 ac_cv_sqlite_secure_delete=no
6312 AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
6313 CFLAGS="$_SAVE_CFLAGS"
6315 if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
6316 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
6319 dnl ===============================
6320 dnl === SQLITE_THREADSAFE check ===
6321 dnl ===============================
6322 dnl Check to see if the system SQLite package is compiled with
6323 dnl SQLITE_THREADSAFE enabled.
6324 AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
6325 _SAVE_CFLAGS="$CFLAGS"
6326 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6328 LIBS="$LIBS $SQLITE_LIBS"
6329 AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
6331 #include "sqlite3.h"
6333 int main(int argc, char **argv){
6334 return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
6336 ac_cv_sqlite_threadsafe=yes,
6337 ac_cv_sqlite_threadsafe=no,
6338 ac_cv_sqlite_threadsafe=no
6341 AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
6342 CFLAGS="$_SAVE_CFLAGS"
6344 if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
6345 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
6348 dnl ================================
6349 dnl === SQLITE_ENABLE_FTS3 check ===
6350 dnl ================================
6351 dnl check to see if the system SQLite package is compiled with
6352 dnl SQLITE_ENABLE_FTS3 enabled.
6353 AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
6354 _SAVE_CFLAGS="$CFLAGS"
6355 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6357 LIBS="$LIBS $SQLITE_LIBS"
6358 AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
6360 #include "sqlite3.h"
6362 int main(int argc, char **argv){
6363 return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
6365 ac_cv_sqlite_enable_fts3=yes,
6366 ac_cv_sqlite_enable_fts3=no,
6367 ac_cv_sqlite_enable_fts3=no
6370 AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
6371 CFLAGS="$_SAVE_CFLAGS"
6373 if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
6374 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
6377 dnl =========================================
6378 dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
6379 dnl =========================================
6380 dnl check to see if the system SQLite package is compiled with
6381 dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
6382 AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
6383 _SAVE_CFLAGS="$CFLAGS"
6384 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
6386 LIBS="$LIBS $SQLITE_LIBS"
6387 AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
6389 #include "sqlite3.h"
6391 int main(int argc, char **argv){
6392 return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
6394 ac_cv_sqlite_enable_unlock_notify=yes,
6395 ac_cv_sqlite_enable_unlock_notify=no,
6396 ac_cv_sqlite_enable_unlock_notify=no
6399 AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
6400 CFLAGS="$_SAVE_CFLAGS"
6402 if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
6403 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
6407 if test -n "$MOZ_NATIVE_SQLITE"; then
6408 AC_DEFINE(MOZ_NATIVE_SQLITE)
6410 AC_SUBST(MOZ_NATIVE_SQLITE)
6412 dnl ========================================================
6413 dnl = Enable help viewer (off by default)
6414 dnl ========================================================
6415 if test -n "$MOZ_HELP_VIEWER"; then
6416 dnl Do this if defined in confvars.sh
6417 AC_DEFINE(MOZ_HELP_VIEWER)
6420 dnl ========================================================
6421 dnl = Enable safe browsing (anti-phishing)
6422 dnl ========================================================
6423 MOZ_ARG_ENABLE_BOOL(safe-browsing,
6424 [ --enable-safe-browsing Enable safe browsing (anti-phishing) implementation],
6425 MOZ_SAFE_BROWSING=1,
6426 MOZ_SAFE_BROWSING= )
6427 if test -n "$MOZ_SAFE_BROWSING"; then
6428 AC_DEFINE(MOZ_SAFE_BROWSING)
6430 AC_SUBST(MOZ_SAFE_BROWSING)
6432 dnl ========================================================
6433 dnl = Enable url-classifier
6434 dnl ========================================================
6435 dnl Implicitly enabled by default if building with safe-browsing
6436 if test -n "$MOZ_SAFE_BROWSING"; then
6437 MOZ_URL_CLASSIFIER=1
6439 MOZ_ARG_ENABLE_BOOL(url-classifier,
6440 [ --enable-url-classifier Enable url classifier module],
6441 MOZ_URL_CLASSIFIER=1,
6442 MOZ_URL_CLASSIFIER= )
6443 if test -n "$MOZ_URL_CLASSIFIER"; then
6444 AC_DEFINE(MOZ_URL_CLASSIFIER)
6446 AC_SUBST(MOZ_URL_CLASSIFIER)
6448 dnl ========================================================
6449 dnl = Disable zipwriter
6450 dnl ========================================================
6451 MOZ_ARG_DISABLE_BOOL(zipwriter,
6452 [ --disable-zipwriter Disable zipwriter component],
6455 AC_SUBST(MOZ_ZIPWRITER)
6457 dnl ========================================================
6459 dnl ========================================================
6460 dnl superseded by QtNetwork starting from 4.7
6461 MOZ_ENABLE_LIBCONIC=1
6463 if test -n "$MOZ_ENABLE_QT"; then
6464 if test "$MOZ_ENABLE_QTNETWORK"; then
6465 MOZ_ENABLE_LIBCONIC=
6469 MOZ_ARG_DISABLE_BOOL(libconic,
6470 [ --disable-libconic Disable libconic],
6471 MOZ_ENABLE_LIBCONIC=,
6472 MOZ_ENABLE_LIBCONIC=1 )
6474 if test -n "$MOZ_ENABLE_LIBCONIC"; then
6475 PKG_CHECK_MODULES(LIBCONIC, conic,
6476 MOZ_ENABLE_LIBCONIC=1,
6477 MOZ_ENABLE_LIBCONIC=)
6479 if test "$MOZ_ENABLE_LIBCONIC"; then
6480 AC_DEFINE(MOZ_ENABLE_LIBCONIC)
6483 AC_SUBST(MOZ_ENABLE_LIBCONIC)
6484 AC_SUBST(LIBCONIC_CFLAGS)
6485 AC_SUBST(LIBCONIC_LIBS)
6487 dnl ========================================================
6489 dnl ========================================================
6491 MAEMO_SDK_TARGET_VER=-1
6493 MOZ_ARG_WITH_STRING(maemo-version,
6494 [ --with-maemo-version=MAEMO_SDK_TARGET_VER
6496 MAEMO_SDK_TARGET_VER=$withval)
6498 case "$MAEMO_SDK_TARGET_VER" in
6500 MOZ_PLATFORM_MAEMO=5
6504 MOZ_PLATFORM_MAEMO=6
6508 dnl We aren't compiling for Maemo, move on.
6511 AC_MSG_ERROR([Unknown Maemo Version. Try setting --with-maemo-version to 5 or 6.])
6515 if test $MOZ_PLATFORM_MAEMO; then
6516 AC_DEFINE_UNQUOTED([MOZ_PLATFORM_MAEMO], $MOZ_PLATFORM_MAEMO)
6518 if test -z "$MOZ_ENABLE_DBUS"; then
6519 AC_MSG_ERROR([DBus is required when building for Maemo])
6522 MOZ_GFX_OPTIMIZE_MOBILE=1
6523 MOZ_GL_DEFAULT_PROVIDER=EGL
6524 MOZ_MAEMO_LIBLOCATION=
6526 if test $MOZ_PLATFORM_MAEMO = 5; then
6527 dnl if we have Xcomposite we should also have Xdamage and Xfixes
6528 MOZ_CHECK_HEADERS([X11/extensions/Xdamage.h], [],
6529 [AC_MSG_ERROR([Couldn't find X11/extensions/Xdamage.h which is required for composited plugins.])])
6530 AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, [XCOMPOSITE_LIBS="-lXcomposite -lXdamage -lXfixes"],
6531 [MISSING_X="$MISSING_X -lXcomposite"], $XLIBS)
6533 AC_SUBST(XCOMPOSITE_LIBS)
6535 PKG_CHECK_MODULES(LIBHILDONMIME,libhildonmime, _LIB_FOUND=1, _LIB_FOUND=)
6536 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONMIME_LIBS"
6537 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONMIME_CFLAGS"
6538 if test -z "$_LIB_FOUND"; then
6539 AC_MSG_ERROR([Hildon Mime is required when building for Maemo])
6543 PKG_CHECK_MODULES(LIBOSSO,libosso, _LIB_FOUND=1, _LIB_FOUND=)
6544 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBOSSO_LIBS"
6545 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBOSSO_CFLAGS"
6546 if test -z "$_LIB_FOUND"; then
6547 AC_MSG_ERROR([LibOSSO is required when building for Maemo])
6550 PKG_CHECK_MODULES(LIBHILDONFM,hildon-fm-2, _LIB_FOUND=1, _LIB_FOUND=)
6551 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBHILDONFM_LIBS"
6552 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBHILDONFM_CFLAGS"
6553 if test -z "$_LIB_FOUND"; then
6554 AC_MSG_ERROR([Hildon FM-2 is required when building for Maemo])
6558 if test $MOZ_PLATFORM_MAEMO = 6; then
6560 PKG_CHECK_MODULES(LIBCONTENTMANAGER, ContentManager QtSparql,
6563 if test "$_LIB_FOUND"; then
6564 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTMANAGER_LIBS"
6565 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTMANAGER_CFLAGS"
6566 MOZ_ENABLE_CONTENTMANAGER=1
6567 AC_DEFINE(MOZ_ENABLE_CONTENTMANAGER)
6569 AC_MSG_WARN([Cannot find libcontentmanager and or QtSparql building for Maemo 6])
6571 AC_SUBST(MOZ_ENABLE_CONTENTMANAGER)
6573 dnl ========================================================
6574 dnl = Enable meego libcontentaction
6575 dnl ========================================================
6576 MOZ_ARG_ENABLE_BOOL(meegocontentaction,
6577 [ --enable-meegocontentaction Enable meegocontentaction support],
6578 MOZ_MEEGOCONTENTACTION=1,
6579 MOZ_MEEGOCONTENTACTION=)
6581 if test -n "$MOZ_MEEGOCONTENTACTION"; then
6583 PKG_CHECK_MODULES(LIBCONTENTACTION, contentaction-0.1, _LIB_FOUND=1, _LIB_FOUND=)
6584 if test "$_LIB_FOUND"; then
6585 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBCONTENTACTION_LIBS"
6586 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBCONTENTACTION_CFLAGS"
6587 MOZ_ENABLE_CONTENTACTION=1
6588 AC_DEFINE(MOZ_ENABLE_CONTENTACTION)
6589 AC_SUBST(MOZ_ENABLE_CONTENTACTION)
6593 MOZ_ARG_ENABLE_BOOL(meegotouch,
6594 [ --enable-meegotouch Enable meegotouch support],
6595 MOZ_MEEGOTOUCHENABLED=1,
6596 MOZ_MEEGOTOUCHENABLED=)
6598 if test -n "$MOZ_MEEGOTOUCHENABLED"; then
6599 PKG_CHECK_MODULES(MOZ_MEEGOTOUCH, meegotouchcore, _LIB_FOUND=1, _LIB_FOUND=)
6600 if test "$_LIB_FOUND"; then
6601 MOZ_QT_CFLAGS="$MOZ_MEEGOTOUCH_CFLAGS $MOZ_QT_CFLAGS"
6602 MOZ_QT_LIBS="$MOZ_MEEGOTOUCH_LIBS $MOZ_QT_LIBS"
6603 AC_DEFINE(MOZ_ENABLE_MEEGOTOUCH)
6605 AC_MSG_WARN([Cannot meegotouchcore-dev. Disabling Meegotouch support.])
6610 PKG_CHECK_MODULES(LIBLOCATION,liblocation, _LIB_FOUND=1, _LIB_FOUND=)
6611 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBLOCATION_LIBS"
6612 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBLOCATION_CFLAGS"
6613 if test "$_LIB_FOUND"; then
6614 MOZ_MAEMO_LIBLOCATION=1
6615 AC_DEFINE(MOZ_MAEMO_LIBLOCATION)
6617 AC_MSG_WARN([Cannot liblocation-dev. Disabling Maemo geolocation.])
6619 AC_SUBST(MOZ_MAEMO_LIBLOCATION)
6621 PKG_CHECK_MODULES(LIBMEEGOTOUCHSHARE, ShareUiInterface-maemo-meegotouch >= 0.3.31 mdatauri, _LIB_FOUND=1, _LIB_FOUND=)
6622 MOZ_PLATFORM_MAEMO_LIBS="$MOZ_PLATFORM_MAEMO_LIBS $LIBMEEGOTOUCHSHARE_LIBS"
6623 MOZ_PLATFORM_MAEMO_CFLAGS="$MOZ_PLATFORM_MAEMO_CFLAGS $LIBMEEGOTOUCHSHARE_CFLAGS"
6624 if test "$_LIB_FOUND"; then
6625 MOZ_ENABLE_MEEGOTOUCHSHARE=1
6626 AC_DEFINE(MOZ_ENABLE_MEEGOTOUCHSHARE)
6628 AC_MSG_WARN([Cannot find maemo-meegotouch-interfaces-dev or libmdatauri-dev. Disabling meegotouch share ui.])
6630 AC_SUBST(MOZ_ENABLE_MEEGOTOUCHSHARE)
6632 AC_SUBST(MOZ_PLATFORM_MAEMO_LIBS)
6633 AC_SUBST(MOZ_PLATFORM_MAEMO_CFLAGS)
6636 dnl ========================================================
6637 dnl = XRender Composite
6638 dnl ========================================================
6639 MOZ_ARG_ENABLE_BOOL(egl-xrender-composite,
6640 [ --enable-egl-xrender-composite
6641 Enable EGL xrender composite optimizations],
6642 MOZ_EGL_XRENDER_COMPOSITE=1)
6644 if test -n "$MOZ_EGL_XRENDER_COMPOSITE"; then
6645 AC_DEFINE(MOZ_EGL_XRENDER_COMPOSITE)
6648 AC_SUBST(MOZ_EGL_XRENDER_COMPOSITE)
6650 dnl ========================================================
6652 dnl ========================================================
6654 MOZ_ARG_WITH_STRING(gl-provider,
6655 [ --with-gl-provider=ID
6656 Set GL provider backend type],
6657 [ val=`echo $withval`
6658 MOZ_GL_PROVIDER="$val"])
6660 if test -n "$MOZ_GL_PROVIDER"; then
6661 MOZ_GL_DEFAULT_PROVIDER=$MOZ_GL_PROVIDER
6662 AC_SUBST(MOZ_GL_PROVIDER)
6663 AC_DEFINE_UNQUOTED(MOZ_GL_PROVIDER, GLContextProvider$MOZ_GL_PROVIDER)
6665 AC_SUBST(MOZ_GL_DEFAULT_PROVIDER)
6667 dnl ========================================================
6668 dnl = faststripe theme
6669 dnl ========================================================
6670 MOZ_ARG_ENABLE_BOOL(faststripe,
6671 [ --enable-faststripe Use faststripe theme],
6672 MOZ_THEME_FASTSTRIPE=1,
6673 MOZ_THEME_FASTSTRIPE= )
6674 AC_SUBST(MOZ_THEME_FASTSTRIPE)
6676 dnl ========================================================
6678 dnl = Feature options that require extra sources to be pulled
6680 dnl ========================================================
6681 dnl MOZ_ARG_HEADER(Features that require extra sources)
6683 dnl ========================================================
6685 dnl = Debugging Options
6687 dnl ========================================================
6688 MOZ_ARG_HEADER(Debugging and Optimizations)
6690 dnl ========================================================
6691 dnl = Disable building with debug info.
6692 dnl = Debugging is OFF by default
6693 dnl ========================================================
6694 if test -z "$MOZ_DEBUG_FLAGS"; then
6695 MOZ_DEBUG_FLAGS="-g"
6698 MOZ_ARG_ENABLE_STRING(debug,
6699 [ --enable-debug[=DBG] Enable building with developer debug info
6700 (using compiler flags DBG)],
6701 [ if test "$enableval" != "no"; then
6703 if test -n "$enableval" -a "$enableval" != "yes"; then
6704 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6705 _MOZ_DEBUG_FLAGS_SET=1
6712 MOZ_DEBUG_ENABLE_DEFS="-DDEBUG -D_DEBUG -DTRACING"
6713 MOZ_ARG_WITH_STRING(debug-label,
6714 [ --with-debug-label=LABELS
6715 Define DEBUG_<value> for each comma-separated
6717 [ for option in `echo $withval | sed 's/,/ /g'`; do
6718 MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_${option}"
6721 MOZ_DEBUG_DISABLE_DEFS="-DNDEBUG -DTRIMMED"
6723 if test -n "$MOZ_DEBUG"; then
6724 AC_MSG_CHECKING([for valid debug flags])
6725 _SAVE_CFLAGS=$CFLAGS
6726 CFLAGS="$CFLAGS $MOZ_DEBUG_FLAGS"
6727 AC_TRY_COMPILE([#include <stdio.h>],
6728 [printf("Hello World\n");],
6731 AC_MSG_RESULT([$_results])
6732 if test "$_results" = "no"; then
6733 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_DEBUG_FLAGS])
6735 CFLAGS=$_SAVE_CFLAGS
6738 dnl ========================================================
6739 dnl enable mobile optimizations
6740 dnl ========================================================
6741 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
6742 [ --enable-mobile-optimize
6743 Enable mobile optimizations],
6744 MOZ_GFX_OPTIMIZE_MOBILE=1)
6746 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
6748 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
6749 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
6752 dnl ========================================================
6753 dnl = Enable code optimization. ON by default.
6754 dnl ========================================================
6755 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
6756 MOZ_OPTIMIZE_FLAGS="-O"
6759 MOZ_ARG_ENABLE_STRING(optimize,
6760 [ --disable-optimize Disable compiler optimization
6761 --enable-optimize=[OPT] Specify compiler optimization flags [OPT=-O]],
6762 [ if test "$enableval" != "no"; then
6764 if test -n "$enableval" -a "$enableval" != "yes"; then
6765 MOZ_OPTIMIZE_FLAGS=`echo "$enableval" | sed -e 's|\\\ | |g'`
6770 fi ], MOZ_OPTIMIZE=1)
6772 MOZ_SET_FRAMEPTR_FLAGS
6774 if test "$COMPILE_ENVIRONMENT"; then
6775 if test -n "$MOZ_OPTIMIZE"; then
6776 AC_MSG_CHECKING([for valid optimization flags])
6777 _SAVE_CFLAGS=$CFLAGS
6778 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
6779 AC_TRY_COMPILE([#include <stdio.h>],
6780 [printf("Hello World\n");],
6783 AC_MSG_RESULT([$_results])
6784 if test "$_results" = "no"; then
6785 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
6787 CFLAGS=$_SAVE_CFLAGS
6789 fi # COMPILE_ENVIRONMENT
6791 AC_SUBST(MOZ_OPTIMIZE)
6792 AC_SUBST(MOZ_FRAMEPTR_FLAGS)
6793 AC_SUBST(MOZ_OPTIMIZE_FLAGS)
6794 AC_SUBST(MOZ_OPTIMIZE_LDFLAGS)
6795 AC_SUBST(MOZ_ALLOW_HEAP_EXECUTE_FLAGS)
6796 AC_SUBST(MOZ_OPTIMIZE_SIZE_TWEAK)
6797 AC_SUBST(MOZ_PGO_OPTIMIZE_FLAGS)
6799 dnl ========================================================
6800 dnl = Enable generation of debug symbols
6801 dnl ========================================================
6802 MOZ_ARG_ENABLE_STRING(debug-symbols,
6803 [ --enable-debug-symbols[=DBG]
6804 Enable debugging symbols (using compiler flags DBG)],
6805 [ if test "$enableval" != "no"; then
6807 if test -n "$enableval" -a "$enableval" != "yes"; then
6808 if test -z "$_MOZ_DEBUG_FLAGS_SET"; then
6809 MOZ_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
6811 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
6817 MOZ_DEBUG_SYMBOLS=1)
6819 if test -n "$MOZ_DEBUG" -o -n "$MOZ_DEBUG_SYMBOLS"; then
6820 AC_DEFINE(MOZ_DEBUG_SYMBOLS)
6821 export MOZ_DEBUG_SYMBOLS
6824 dnl ========================================================
6825 dnl = Enable any treating of compile warnings as errors
6826 dnl ========================================================
6827 MOZ_ARG_ENABLE_BOOL(warnings-as-errors,
6828 [ --enable-warnings-as-errors
6829 Enable treating of warnings as errors],
6830 MOZ_ENABLE_WARNINGS_AS_ERRORS=1,
6831 MOZ_ENABLE_WARNINGS_AS_ERRORS=)
6832 if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
6833 WARNINGS_AS_ERRORS=''
6836 dnl ========================================================
6837 dnl = Disable runtime logging checks
6838 dnl ========================================================
6839 MOZ_ARG_DISABLE_BOOL(logging,
6840 [ --disable-logging Disable logging facilities],
6841 NS_DISABLE_LOGGING=1,
6842 NS_DISABLE_LOGGING= )
6843 if test "$NS_DISABLE_LOGGING"; then
6844 AC_DEFINE(NS_DISABLE_LOGGING)
6846 AC_DEFINE(MOZ_LOGGING)
6849 dnl ========================================================
6850 dnl = This will enable logging of addref, release, ctor, dtor.
6851 dnl ========================================================
6852 _ENABLE_LOGREFCNT=42
6853 MOZ_ARG_ENABLE_BOOL(logrefcnt,
6854 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
6855 _ENABLE_LOGREFCNT=1,
6856 _ENABLE_LOGREFCNT= )
6857 if test "$_ENABLE_LOGREFCNT" = "1"; then
6858 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
6859 elif test -z "$_ENABLE_LOGREFCNT"; then
6860 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
6863 dnl ========================================================
6864 dnl moz_dump_painting
6865 dnl ========================================================
6866 MOZ_ARG_ENABLE_BOOL(dump-painting,
6867 [ --enable-dump-painting Enable paint debugging.],
6868 MOZ_DUMP_PAINTING=1,
6869 MOZ_DUMP_PAINTING= )
6870 if test -n "$MOZ_DUMP_PAINTING"; then
6871 AC_DEFINE(MOZ_DUMP_PAINTING)
6872 AC_DEFINE(MOZ_LAYERS_HAVE_LOG)
6874 if test -n "$MOZ_DEBUG"; then
6875 AC_DEFINE(MOZ_DUMP_PAINTING)
6878 dnl ========================================================
6879 dnl = Enable trace malloc
6880 dnl ========================================================
6881 NS_TRACE_MALLOC=${MOZ_TRACE_MALLOC}
6882 MOZ_ARG_ENABLE_BOOL(trace-malloc,
6883 [ --enable-trace-malloc Enable malloc tracing; also disables jemalloc],
6886 if test "$NS_TRACE_MALLOC"; then
6887 # Please, Mr. Linker Man, don't take away our symbol names
6888 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
6890 AC_DEFINE(NS_TRACE_MALLOC)
6892 AC_SUBST(NS_TRACE_MALLOC)
6894 dnl ========================================================
6895 dnl = Enable jemalloc
6896 dnl ========================================================
6897 MOZ_ARG_ENABLE_BOOL(jemalloc,
6898 [ --enable-jemalloc Replace memory allocator with jemalloc],
6902 if test "$NS_TRACE_MALLOC"; then
6905 if test "$MOZ_DMD"; then
6909 if test "${OS_TARGET}" = "Android"; then
6910 dnl On Android, we use WRAP_LDFLAGS to link everything to mozglue
6912 elif test "${OS_TARGET}" = "WINNT" -o "${OS_TARGET}" = "Darwin" -o "${OS_TARGET}" = "OS2"; then
6913 dnl On Windows, OSX and OS2, we want to link all our binaries against mozglue
6914 if test -z "$GNU_CC"; then
6915 MOZ_GLUE_LDFLAGS='$(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
6917 MOZ_GLUE_LDFLAGS='-L$(LIBXUL_DIST)/lib $(call EXPAND_LIBNAME,mozglue)'
6920 dnl On other Unix systems, we only want to link executables against mozglue
6921 MOZ_GLUE_PROGRAM_LDFLAGS='$(MKSHLIB_FORCE_ALL) $(call EXPAND_LIBNAME_PATH,mozglue,$(LIBXUL_DIST)/lib)'
6922 dnl On other Unix systems, where mozglue is a static library, jemalloc is
6923 dnl separated for the SDK, so we need to add it here.
6924 if test "$MOZ_MEMORY" = 1 -o \( "$LIBXUL_SDK" -a -f "$LIBXUL_SDK/lib/${LIB_PREFIX}memory.${LIB_SUFFIX}" \); then
6925 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(call EXPAND_LIBNAME_PATH,memory,$(LIBXUL_DIST)/lib)'
6927 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS "'$(MKSHLIB_UNFORCE_ALL)'
6928 if test -n "$GNU_CC"; then
6929 dnl And we need mozglue symbols to be exported.
6930 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS -rdynamic"
6932 if test "$MOZ_LINKER" = 1; then
6933 MOZ_GLUE_PROGRAM_LDFLAGS="$MOZ_GLUE_PROGRAM_LDFLAGS $ZLIB_LIBS"
6937 if test -z "$MOZ_MEMORY"; then
6940 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
6941 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.])
6946 dnl Don't try to run compiler tests on Windows
6947 if test "$OS_ARCH" = "WINNT"; then
6948 if test -z "$HAVE_64BIT_OS"; then
6949 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6951 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6954 AC_CHECK_SIZEOF([int *], [4])
6955 case "${ac_cv_sizeof_int_p}" in
6957 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 2)
6960 AC_DEFINE_UNQUOTED([MOZ_MEMORY_SIZEOF_PTR_2POW], 3)
6963 AC_MSG_ERROR([Unexpected pointer size])
6968 AC_DEFINE(MOZ_MEMORY)
6969 if test -n "$MOZ_JEMALLOC"; then
6970 AC_DEFINE(MOZ_JEMALLOC)
6972 if test "x$MOZ_DEBUG" = "x1"; then
6973 AC_DEFINE(MOZ_MEMORY_DEBUG)
6975 dnl The generic feature tests that determine how to compute ncpus are long and
6976 dnl complicated. Therefore, simply define special cpp variables for the
6977 dnl platforms we have special knowledge of.
6980 AC_DEFINE(MOZ_MEMORY_DARWIN)
6983 AC_DEFINE(MOZ_MEMORY_BSD)
6985 *-android*|*-linuxandroid*)
6986 AC_DEFINE(MOZ_MEMORY_LINUX)
6987 AC_DEFINE(MOZ_MEMORY_ANDROID)
6988 if test -z "$gonkdir"; then
6991 AC_DEFINE(MOZ_MEMORY_GONK)
6996 AC_DEFINE(MOZ_MEMORY_LINUX)
6999 AC_DEFINE(MOZ_MEMORY_BSD)
7002 AC_DEFINE(MOZ_MEMORY_SOLARIS)
7005 AC_DEFINE(MOZ_MEMORY_WINDOWS)
7006 if test -z "$MOZ_DEBUG"; then
7007 WIN32_CRT_LIBS="msvcrt.lib msvcprt.lib"
7009 WIN32_CRT_LIBS="msvcrtd.lib msvcprtd.lib"
7011 dnl Look for a broken crtdll.obj
7012 WIN32_CRTDLL_FULLPATH=`lib -nologo -list $WIN32_CRT_LIBS | grep crtdll\\.obj`
7013 lib -NOLOGO -OUT:crtdll.obj $WIN32_CRT_LIBS -EXTRACT:$WIN32_CRTDLL_FULLPATH
7014 if grep -q '__imp__\{0,1\}free' crtdll.obj; then
7015 MOZ_GLUE_LDFLAGS='-LIBPATH:$(DIST)/lib -NODEFAULTLIB:msvcrt -NODEFAULTLIB:msvcrtd -NODEFAULTLIB:msvcprt -NODEFAULTLIB:msvcprtd -DEFAULTLIB:mozcrt'
7016 dnl Also pass this to NSPR/NSS
7017 DLLFLAGS="$DLLFLAGS $MOZ_GLUE_LDFLAGS"
7019 DLLFLAGS="$DLLFLAGS -LIBPATH:\$(DIST)/lib -DEFAULTLIB:mozglue"
7026 AC_MSG_ERROR([--enable-jemalloc not supported on ${target}])
7030 AC_SUBST(MOZ_MEMORY)
7031 AC_SUBST(MOZ_JEMALLOC)
7032 AC_SUBST(MOZ_GLUE_LDFLAGS)
7033 AC_SUBST(MOZ_GLUE_PROGRAM_LDFLAGS)
7034 AC_SUBST(WIN32_CRT_LIBS)
7035 dnl Need to set this for make because NSS doesn't have configure
7038 dnl We need to wrap dlopen and related functions on Android because we use
7040 if test "$OS_TARGET" = Android; then
7041 WRAP_LDFLAGS="${WRAP_LDFLAGS} -L$_objdir/dist/lib -lmozglue"
7042 if test -n "$MOZ_OLD_LINKER"; then
7043 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=dlopen,--wrap=dlclose,--wrap=dlerror,--wrap=dlsym,--wrap=dladdr"
7045 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
7046 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork,--wrap=raise,--wrap=PR_GetEnv,--wrap=PR_SetEnv"
7049 dnl ========================================================
7050 dnl = Use malloc wrapper lib
7051 dnl ========================================================
7052 MOZ_ARG_ENABLE_BOOL(wrap-malloc,
7053 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
7057 if test -n "$_WRAP_MALLOC"; then
7058 if test -n "$GNU_CC"; then
7059 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
7060 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
7061 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
7062 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
7063 dnl Wrap operator new and operator delete on Android.
7064 if test "$OS_TARGET" = "Android"; then
7065 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=_Znwj,--wrap=_Znaj,--wrap=_ZdlPv,--wrap=_ZdaPv"
7068 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
7072 dnl ========================================================
7073 dnl = Location of malloc wrapper lib
7074 dnl ========================================================
7075 MOZ_ARG_WITH_STRING(wrap-malloc,
7076 [ --with-wrap-malloc=DIR Location of malloc wrapper library],
7077 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
7079 dnl ========================================================
7080 dnl = Use JS Call tracing
7081 dnl ========================================================
7082 MOZ_ARG_ENABLE_BOOL(trace-jscalls,
7083 [ --enable-trace-jscalls Enable JS call enter/exit callback (default=no)],
7084 MOZ_TRACE_JSCALLS=1,
7085 MOZ_TRACE_JSCALLS= )
7086 if test -n "$MOZ_TRACE_JSCALLS"; then
7087 AC_DEFINE(MOZ_TRACE_JSCALLS)
7090 dnl ========================================================
7091 dnl = Use incremental GC
7092 dnl ========================================================
7094 MOZ_ARG_DISABLE_BOOL(gcincremental,
7095 [ --disable-gcincremental Disable incremental GC],
7097 if test -n "$JSGC_INCREMENTAL"; then
7098 AC_DEFINE(JSGC_INCREMENTAL)
7101 dnl ========================================================
7102 dnl ETW - Event Tracing for Windows
7103 dnl ========================================================
7104 MOZ_ARG_ENABLE_BOOL(ETW,
7105 [ --enable-ETW Enable ETW (Event Tracing for Windows) event reporting],
7108 if test -n "$MOZ_ETW"; then
7112 if test -n "$MOZ_ETW"; then
7113 if test -z "$MOZ_WINSDK_TARGETVER"; then
7114 AC_MSG_ERROR([--enable-ETW is only valid on Windows])
7118 dnl ========================================================
7119 dnl Zealous JavaScript GC
7120 dnl ========================================================
7121 MOZ_ARG_ENABLE_BOOL(gczeal,
7122 [ --enable-gczeal Enable zealous JavaScript GCing],
7125 if test -n "$JS_GC_ZEAL"; then
7126 AC_DEFINE(JS_GC_ZEAL)
7129 dnl ========================================================
7130 dnl JS opt-mode assertions and minidump instrumentation
7131 dnl ========================================================
7132 MOZ_ARG_ENABLE_BOOL(js-diagnostics,
7133 [ --enable-js-diagnostics
7134 Enable JS diagnostic assertions and breakpad data],
7135 JS_CRASH_DIAGNOSTICS=1,
7136 JS_CRASH_DIAGNOSTICS= )
7137 if test -n "$JS_CRASH_DIAGNOSTICS"; then
7138 AC_DEFINE(JS_CRASH_DIAGNOSTICS)
7143 dnl ========================================================
7144 dnl = Enable static checking using gcc-dehydra
7145 dnl ========================================================
7147 MOZ_ARG_WITH_STRING(static-checking,
7148 [ --with-static-checking=path/to/gcc_dehydra.so
7149 Enable static checking of code using GCC-dehydra],
7150 DEHYDRA_PATH=$withval,
7153 if test -n "$DEHYDRA_PATH"; then
7154 if test ! -f "$DEHYDRA_PATH"; then
7155 AC_MSG_ERROR([The dehydra plugin is not at the specified path.])
7157 AC_DEFINE(NS_STATIC_CHECKING)
7159 AC_SUBST(DEHYDRA_PATH)
7161 dnl ========================================================
7162 dnl = Enable stripping of libs & executables
7163 dnl ========================================================
7164 MOZ_ARG_ENABLE_BOOL(strip,
7165 [ --enable-strip Enable stripping of libs & executables ],
7169 dnl ========================================================
7170 dnl = Enable stripping of libs & executables when packaging
7171 dnl ========================================================
7172 MOZ_ARG_ENABLE_BOOL(install-strip,
7173 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
7177 dnl ========================================================
7178 dnl = --enable-elf-dynstr-gc
7179 dnl ========================================================
7180 MOZ_ARG_ENABLE_BOOL(elf-dynstr-gc,
7181 [ --enable-elf-dynstr-gc Enable elf dynstr garbage collector (opt builds only)],
7182 USE_ELF_DYNSTR_GC=1,
7183 USE_ELF_DYNSTR_GC= )
7185 dnl ========================================================
7186 dnl = --disable-elf-hack
7187 dnl ========================================================
7190 MOZ_ARG_DISABLE_BOOL(elf-hack,
7191 [ --disable-elf-hack Disable elf hacks],
7195 # Disable elf hack for profiling because the built in profiler
7196 # doesn't read the segments properly with elf hack. This is
7197 # temporary and should be fixed soon in the profiler.
7198 if test "$MOZ_PROFILING" = 1; then
7202 # Only enable elfhack where supported
7203 if test "$USE_ELF_HACK" = 1; then
7204 case "${HOST_OS_ARCH},${OS_ARCH}" in
7206 case "${CPU_ARCH}" in
7221 if test "$USE_ELF_HACK" = 1; then
7222 dnl PT_GNU_RELRO segment makes the dynamic linker set a read-only flag on
7223 dnl memory addresses it maps to. The result is that by the time elfhack
7224 dnl kicks in, it is not possible to apply relocations because of that,
7225 dnl thus elfhack effectively skips relocations inside the PT_GNU_RELRO
7226 dnl segment. It makes elfhack mostly useless, so considering the problems
7227 dnl we have we PT_GNU_RELRO (e.g. bug 664366), and until elfhack can deal
7228 dnl with PT_GNU_RELRO segments, it's just simpler to disable elfhack when
7229 dnl the linker creates PT_GNU_RELRO segments.
7230 AC_CACHE_CHECK([whether linker creates PT_GNU_RELRO segments],
7231 LINK_WITH_PT_GNU_RELRO,
7232 [echo "int main() {return 0;}" > conftest.${ac_ext}
7233 if AC_TRY_COMMAND(${CC-cc} -o conftest${ac_exeext} $LDFLAGS conftest.${ac_ext} $LIBS 1>&2) &&
7234 test -s conftest${ac_exeext}; then
7235 if ${TOOLCHAIN_PREFIX}readelf -l conftest${ac_exeext} | grep GNU_RELRO > /dev/null; then
7236 LINK_WITH_PT_GNU_RELRO=yes
7238 LINK_WITH_PT_GNU_RELRO=no
7241 dnl We really don't expect to get here, but just in case
7242 AC_ERROR([couldn't compile a simple C file])
7245 if test "$LINK_WITH_PT_GNU_RELRO" = yes; then
7246 AC_MSG_WARN([Disabling elfhack])
7251 dnl ========================================================
7252 dnl = libstdc++ compatibility hacks
7253 dnl ========================================================
7256 MOZ_ARG_ENABLE_BOOL(stdcxx-compat,
7257 [ --enable-stdcxx-compat Enable compatibility with older libstdc++],
7260 AC_SUBST(STDCXX_COMPAT)
7262 if test -n "$STDCXX_COMPAT"; then
7263 eval $(CXX="$CXX" MACOS_SDK_DIR="$MACOS_SDK_DIR" $PYTHON $_topsrcdir/build/autoconf/libstdcxx.py)
7264 AC_SUBST(MOZ_LIBSTDCXX_TARGET_VERSION)
7265 AC_SUBST(MOZ_LIBSTDCXX_HOST_VERSION)
7268 dnl ========================================================
7270 dnl = Profiling and Instrumenting
7272 dnl ========================================================
7273 MOZ_ARG_HEADER(Profiling and Instrumenting)
7275 dnl ========================================================
7276 dnl = Enable NS_FUNCTION_TIMER, which provides Function
7277 dnl = timing for identifying code bottlenecks
7278 dnl = NS_FUNCTION_TIMER is off by default.
7279 dnl ========================================================
7280 MOZ_ARG_ENABLE_BOOL(functiontimer,
7281 [ --enable-functiontimer Enable NS_FUNCTION_TIMER ],
7282 NS_FUNCTION_TIMER=1,
7283 NS_FUNCTION_TIMER= )
7284 if test -n "$NS_FUNCTION_TIMER"; then
7285 AC_DEFINE(NS_FUNCTION_TIMER)
7288 dnl ========================================================
7289 dnl = Enable runtime visual profiling logger
7290 dnl ========================================================
7291 MOZ_ARG_ENABLE_BOOL(visual-event-tracer,
7292 [ --enable-visual-event-tracer Enable visual event tracer instrumentation],
7293 MOZ_VISUAL_EVENT_TRACER=1,
7294 MOZ_VISUAL_EVENT_TRACER=)
7295 if test -n "$MOZ_VISUAL_EVENT_TRACER"; then
7296 AC_DEFINE(MOZ_VISUAL_EVENT_TRACER)
7299 dnl ========================================================
7300 dnl Turn on reflow counting
7301 dnl ========================================================
7302 MOZ_ARG_ENABLE_BOOL(reflow-perf,
7303 [ --enable-reflow-perf Enable reflow performance tracing],
7306 if test -n "$MOZ_REFLOW_PERF"; then
7307 AC_DEFINE(MOZ_REFLOW_PERF)
7310 dnl ========================================================
7311 dnl Enable code size metrics.
7312 dnl ========================================================
7313 MOZ_ARG_ENABLE_BOOL(codesighs,
7314 [ --enable-codesighs Enable code size analysis tools],
7315 _ENABLE_CODESIGHS=1,
7316 _ENABLE_CODESIGHS= )
7317 if test -n "$_ENABLE_CODESIGHS"; then
7318 if test -d $srcdir/tools/codesighs; then
7321 AC_MSG_ERROR([Codesighs directory $srcdir/tools/codesighs required.])
7325 dnl ========================================================
7326 dnl = Enable Radio Interface for B2G (Gonk usually)
7327 dnl ========================================================
7328 MOZ_ARG_ENABLE_BOOL(b2g-ril,
7329 [ --enable-b2g-ril Set compile flags necessary for testing B2G Radio Interface Layer via network sockets ],
7332 if test -n "$MOZ_B2G_RIL"; then
7333 AC_DEFINE(MOZ_B2G_RIL)
7335 AC_SUBST(MOZ_B2G_RIL)
7337 dnl ========================================================
7338 dnl = Enable Bluetooth Interface for B2G (Gonk usually)
7339 dnl ========================================================
7340 MOZ_ARG_ENABLE_BOOL(b2g-bt,
7341 [ --enable-b2g-bt Set compile flags necessary for compiling Bluetooth API for B2G ],
7344 if test -n "$MOZ_B2G_BT"; then
7345 AC_DEFINE(MOZ_B2G_BT)
7347 AC_SUBST(MOZ_B2G_BT)
7349 dnl ========================================================
7350 dnl = Enable Support for System Messages API
7351 dnl ========================================================
7352 if test -n "$MOZ_SYS_MSG"; then
7353 AC_DEFINE(MOZ_SYS_MSG)
7355 AC_SUBST(MOZ_SYS_MSG)
7357 dnl ========================================================
7358 dnl = Enable Camera Interface for B2G (Gonk usually)
7359 dnl ========================================================
7360 MOZ_ARG_ENABLE_BOOL(b2g-camera,
7361 [ --enable-b2g-camera Set compile flags necessary for compiling camera API for B2G ],
7364 if test -n "$MOZ_B2G_CAMERA"; then
7365 AC_DEFINE(MOZ_B2G_CAMERA)
7367 AC_SUBST(MOZ_B2G_CAMERA)
7369 dnl ========================================================
7370 dnl = Support for demangling undefined symbols
7371 dnl ========================================================
7372 if test -z "$SKIP_LIBRARY_CHECKS"; then
7375 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
7379 # Demangle only for debug or trace-malloc builds
7380 MOZ_DEMANGLE_SYMBOLS=
7381 if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
7382 MOZ_DEMANGLE_SYMBOLS=1
7383 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
7385 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
7387 dnl ========================================================
7388 dnl = Support for gcc stack unwinding (from gcc 3.3)
7389 dnl ========================================================
7390 if test -z "$SKIP_LIBRARY_CHECKS"; then
7391 MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
7394 dnl ========================================================
7396 dnl ========================================================
7398 MOZ_ARG_WITH_STRING(jitreport-granularity,
7399 [ --jitreport-granularity=N
7400 Default granularity at which to report JIT code
7403 1 - code ranges for whole functions only
7404 2 - per-line information
7405 3 - per-op information],
7406 JITREPORT_GRANULARITY=$withval,
7407 JITREPORT_GRANULARITY=3)
7409 AC_DEFINE_UNQUOTED(JS_DEFAULT_JITREPORT_GRANULARITY, $JITREPORT_GRANULARITY)
7411 dnl ========================================================
7415 dnl ========================================================
7416 MOZ_ARG_HEADER(Misc. Options)
7418 dnl ========================================================
7419 dnl update xterm title
7420 dnl ========================================================
7421 MOZ_ARG_ENABLE_BOOL(xterm-updates,
7422 [ --enable-xterm-updates Update XTERM titles with current command.],
7426 dnl =========================================================
7428 dnl =========================================================
7429 MOZ_ARG_ENABLE_STRING([chrome-format],
7430 [ --enable-chrome-format=jar|flat|both|symlink|omni
7431 Select FORMAT of chrome files (default=jar)],
7432 MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
7434 if test -z "$MOZ_CHROME_FILE_FORMAT"; then
7435 MOZ_CHROME_FILE_FORMAT=jar
7438 if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
7439 test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
7440 test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
7441 test "$MOZ_CHROME_FILE_FORMAT" != "both" &&
7442 test "$MOZ_CHROME_FILE_FORMAT" != "omni"; then
7443 AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, symlink, or omni])
7446 dnl =========================================================
7447 dnl Omnijar packaging (bug 552121)
7448 dnl =========================================================
7449 dnl Omnijar packaging is compatible with flat packaging.
7450 dnl In unpackaged builds, omnijar looks for files as if
7451 dnl things were flat packaged. After packaging, all files
7452 dnl are loaded from a single jar. MOZ_CHROME_FILE_FORMAT
7453 dnl is set to flat since putting files into jars is only
7454 dnl done during packaging with omnijar.
7455 if test "$MOZ_CHROME_FILE_FORMAT" = "omni"; then
7457 AC_DEFINE(MOZ_OMNIJAR)
7458 if test "$OS_ARCH" = "WINNT" -o "$OS_ARCH" = "OS2" -o "$OS_TARGET" = "Android"; then
7459 MOZ_CHROME_FILE_FORMAT=flat
7461 MOZ_CHROME_FILE_FORMAT=symlink
7463 elif test "$MOZ_CHROME_FILE_FORMAT" = "jar"; then
7464 AC_DEFINE(MOZ_CHROME_FILE_FORMAT_JAR)
7467 OMNIJAR_NAME=omni.ja
7468 AC_SUBST(OMNIJAR_NAME)
7469 AC_SUBST(MOZ_OMNIJAR)
7471 dnl ========================================================
7472 dnl = Define default location for MOZILLA_FIVE_HOME
7473 dnl ========================================================
7474 MOZ_ARG_WITH_STRING(default-mozilla-five-home,
7475 [ --with-default-mozilla-five-home
7476 Set the default value for MOZILLA_FIVE_HOME],
7477 [ val=`echo $withval`
7478 AC_DEFINE_UNQUOTED(MOZ_DEFAULT_MOZILLA_FIVE_HOME,"$val") ])
7480 dnl ========================================================
7481 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
7482 dnl ========================================================
7483 MOZ_ARG_WITH_STRING(user-appdir,
7484 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
7485 [ val=`echo $withval`
7486 if echo "$val" | grep "\/" >/dev/null; then
7487 AC_MSG_ERROR("Homedir must be single relative path.")
7492 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
7494 dnl ========================================================
7495 dnl = Doxygen configuration
7496 dnl ========================================================
7497 dnl Use commas to specify multiple dirs to this arg
7498 MOZ_DOC_INPUT_DIRS='./dist/include ./dist/idl'
7499 MOZ_ARG_WITH_STRING(doc-input-dirs,
7500 [ --with-doc-input-dirs=DIRS
7501 Header/idl dirs to create docs from],
7502 [ MOZ_DOC_INPUT_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7503 AC_SUBST(MOZ_DOC_INPUT_DIRS)
7505 dnl Use commas to specify multiple dirs to this arg
7506 MOZ_DOC_INCLUDE_DIRS='./dist/include ./dist/include/nspr'
7507 MOZ_ARG_WITH_STRING(doc-include-dirs,
7508 [ --with-doc-include-dirs=DIRS
7509 Include dirs to preprocess doc headers],
7510 [ MOZ_DOC_INCLUDE_DIRS=`echo "$withval" | sed "s/,/ /g"` ] )
7511 AC_SUBST(MOZ_DOC_INCLUDE_DIRS)
7513 MOZ_DOC_OUTPUT_DIR='./dist/docs'
7514 MOZ_ARG_WITH_STRING(doc-output-dir,
7515 [ --with-doc-output-dir=DIR
7516 Dir to generate docs into],
7517 [ MOZ_DOC_OUTPUT_DIR=$withval ] )
7518 AC_SUBST(MOZ_DOC_OUTPUT_DIR)
7520 if test -z "$SKIP_COMPILER_CHECKS"; then
7521 dnl ========================================================
7523 dnl = Compiler Options
7525 dnl ========================================================
7526 MOZ_ARG_HEADER(Compiler Options)
7528 dnl ========================================================
7529 dnl Check for gcc -pipe support
7530 dnl ========================================================
7531 AC_MSG_CHECKING([for -pipe support])
7532 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
7533 dnl Any gcc that supports firefox supports -pipe.
7534 CFLAGS="$CFLAGS -pipe"
7535 CXXFLAGS="$CXXFLAGS -pipe"
7536 AC_MSG_RESULT([yes])
7541 dnl ========================================================
7542 dnl Profile guided optimization (gcc checks)
7543 dnl ========================================================
7544 dnl Test for profiling options
7545 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
7547 _SAVE_CFLAGS="$CFLAGS"
7548 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
7550 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
7551 AC_TRY_COMPILE([], [return 0;],
7552 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
7553 result="yes" ], result="no")
7554 AC_MSG_RESULT([$result])
7556 if test $result = "yes"; then
7557 PROFILE_GEN_LDFLAGS="-fprofile-generate"
7558 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
7559 PROFILE_USE_LDFLAGS="-fprofile-use"
7562 CFLAGS="$_SAVE_CFLAGS"
7564 if test -n "$INTEL_CC"; then
7565 PROFILE_GEN_CFLAGS="-prof-gen -prof-dir ."
7566 PROFILE_GEN_LDFLAGS=
7567 PROFILE_USE_CFLAGS="-prof-use -prof-dir ."
7568 PROFILE_USE_LDFLAGS=
7571 dnl Sun Studio on Solaris
7572 if test "$SOLARIS_SUNPRO_CC"; then
7573 PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
7574 PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
7575 PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
7576 PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
7579 AC_SUBST(PROFILE_GEN_CFLAGS)
7580 AC_SUBST(PROFILE_GEN_LDFLAGS)
7581 AC_SUBST(PROFILE_USE_CFLAGS)
7582 AC_SUBST(PROFILE_USE_LDFLAGS)
7586 dnl ========================================================
7587 dnl Test for -pedantic bustage
7588 dnl ========================================================
7589 MOZ_ARG_DISABLE_BOOL(pedantic,
7590 [ --disable-pedantic Issue all warnings demanded by strict ANSI C ],
7592 if test "$_PEDANTIC"; then
7593 _SAVE_CXXFLAGS=$CXXFLAGS
7594 CXXFLAGS="$CXXFLAGS -pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
7595 AC_MSG_CHECKING([whether C++ compiler has -pedantic long long bug])
7596 AC_TRY_COMPILE([$configure_static_assert_macros],
7597 [CONFIGURE_STATIC_ASSERT(sizeof(long long) == 8)],
7598 result="no", result="yes" )
7599 AC_MSG_RESULT([$result])
7600 CXXFLAGS="$_SAVE_CXXFLAGS"
7604 _WARNINGS_CFLAGS="-pedantic ${_WARNINGS_CFLAGS} -Wno-long-long"
7605 _WARNINGS_CXXFLAGS="-pedantic ${_WARNINGS_CXXFLAGS} -Wno-long-long"
7608 AC_MSG_ERROR([Your compiler appears to have a known bug where long long is miscompiled when using -pedantic. Reconfigure using --disable-pedantic. ])
7613 dnl ========================================================
7614 dnl Autoconf test for gcc 2.7.2.x (and maybe others?) so that we don't
7615 dnl provide non-const forms of the operator== for comparing nsCOMPtrs to
7616 dnl raw pointers in nsCOMPtr.h. (VC++ has the same bug.)
7617 dnl ========================================================
7618 _SAVE_CXXFLAGS=$CXXFLAGS
7619 CXXFLAGS="$CXXFLAGS ${_WARNINGS_CXXFLAGS}"
7620 AC_CACHE_CHECK(for correct overload resolution with const and templates,
7621 ac_nscap_nonconst_opeq_bug,
7630 template <class T, class U>
7631 int operator==(const Pointer<T>& rhs, U* lhs)
7633 return rhs.myPtr == lhs;
7636 template <class T, class U>
7637 int operator==(const Pointer<T>& rhs, const U* lhs)
7639 return rhs.myPtr == lhs;
7647 ac_nscap_nonconst_opeq_bug="no",
7648 ac_nscap_nonconst_opeq_bug="yes")])
7649 CXXFLAGS="$_SAVE_CXXFLAGS"
7651 if test "$ac_nscap_nonconst_opeq_bug" = "yes" ; then
7652 AC_DEFINE(NSCAP_DONT_PROVIDE_NONCONST_OPEQ)
7654 fi # ! SKIP_COMPILER_CHECKS
7656 AC_DEFINE(CPP_THROW_NEW, [throw()])
7659 if test "$COMPILE_ENVIRONMENT"; then
7661 fi # COMPILE_ENVIRONMENT
7663 dnl ========================================================
7665 dnl = Build depencency options
7667 dnl ========================================================
7668 MOZ_ARG_HEADER(Build dependencies)
7670 dnl ========================================================
7671 dnl = Do not auto generate dependency info
7672 dnl ========================================================
7674 MOZ_ARG_DISABLE_BOOL(auto-deps,
7675 [ --disable-auto-deps Do not automatically generate dependency info],
7679 if test -n "$MOZ_AUTO_DEPS"; then
7680 dnl ========================================================
7681 dnl = Use mkdepend instead of $CC -MD for dependency generation
7682 dnl ========================================================
7684 MOZ_ARG_DISABLE_BOOL(md,
7685 [ --disable-md Do not use compiler-based dependencies ],
7688 [dnl Default is to turn on -MD if using GNU-compatible compilers
7689 if test "$GNU_CC" -a "$GNU_CXX"; then
7692 dnl Default is to use -xM if using Sun Studio on Solaris
7693 if test "$SOLARIS_SUNPRO_CC"; then
7696 if test "$_cpp_md_flag"; then
7698 _DEPEND_CFLAGS='$(filter-out %/.pp,-MMD -MF $(MDDEPDIR)/$(@F).pp)'
7699 dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
7700 if test "$SOLARIS_SUNPRO_CC"; then
7705 dnl Don't override this for MSVC
7706 if test -z "$_WIN32_MSVC"; then
7707 _USE_CPP_INCLUDE_FLAG=
7708 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7709 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
7711 echo '#include <stdio.h>' > dummy-hello.c
7713 CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/^\([^:]*:[^:]*:\).*stdio.h$/\1/p'`
7715 if test -z "$CL_INCLUDES_PREFIX"; then
7716 AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
7718 AC_SUBST(CL_INCLUDES_PREFIX)
7725 AC_SUBST(MOZ_AUTO_DEPS)
7726 AC_SUBST(COMPILER_DEPEND)
7729 dnl ========================================================
7731 dnl = Static Build Options
7733 dnl ========================================================
7734 MOZ_ARG_HEADER(Static build options)
7736 # split JS out by default to avoid VS2005 PGO crash (bug 591836).
7737 if test "$OS_ARCH" = "WINNT" -a "$CPU_ARCH" != "x86_64" ; then
7741 MOZ_ARG_ENABLE_BOOL(shared-js,
7742 [ --enable-shared-js
7743 Create a shared JavaScript library.],
7747 if test -n "$ENABLE_SHARED_JS"; then
7749 MOZ_JS_LIBS="$MOZ_JS_SHARED_LIBS"
7751 MOZ_JS_LIBS="$MOZ_JS_STATIC_LIBS"
7752 AC_DEFINE(MOZ_STATIC_JS)
7754 AC_SUBST(JS_SHARED_LIBRARY)
7756 AC_SUBST(LIBXUL_LIBS)
7757 XPCOM_LIBS="$LIBXUL_LIBS"
7759 dnl ========================================================
7761 dnl = Standalone module options
7763 dnl ========================================================
7764 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
7767 dnl ========================================================
7769 if test -z "$SKIP_PATH_CHECKS"; then
7770 if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
7771 if test "$MOZ_ENABLE_GTK2" -o "$USE_ELF_DYNSTR_GC" ; then
7772 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
7777 if test -z "${GLIB_GMODULE_LIBS}" \
7778 -a -n "${GLIB_CONFIG}"\
7779 -a "${GLIB_CONFIG}" != no\
7781 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
7784 AC_SUBST(GLIB_CFLAGS)
7786 AC_SUBST(GLIB_GMODULE_LIBS)
7788 dnl ========================================================
7789 dnl Graphics checks.
7790 dnl ========================================================
7792 if test "${OS_TARGET}" = "WINNT" -o "${OS_ARCH}" = "Darwin" -o "${MOZ_WIDGET_TOOLKIT}" = "android" -o "${MOZ_WIDGET_TOOLKIT}" = "gtk2"; then
7798 MOZ_ARG_ENABLE_BOOL(skia,
7799 [ --enable-skia Enable use of Skia],
7803 if test "$USE_FC_FREETYPE"; then
7804 if test "$COMPILE_ENVIRONMENT"; then
7805 dnl ========================================================
7806 dnl = Check for freetype2 and its functionality
7807 dnl ========================================================
7808 PKG_CHECK_MODULES(FT2, freetype2 >= 6.1.0, _HAVE_FREETYPE2=1, _HAVE_FREETYPE2=)
7810 if test "$_HAVE_FREETYPE2"; then
7812 _SAVE_CFLAGS="$CFLAGS"
7813 LIBS="$LIBS $FT2_LIBS"
7814 CFLAGS="$CFLAGS $FT2_CFLAGS"
7816 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
7817 ac_cv_member_FT_Bitmap_Size_y_ppem,
7818 [AC_TRY_COMPILE([#include <ft2build.h>
7819 #include FT_FREETYPE_H],
7821 if (sizeof s.y_ppem) return 0;
7823 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
7824 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
7825 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
7826 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
7828 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
7830 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
7831 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
7832 [FT_Bitmap_Size structure includes y_ppem field])
7834 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table FT_Select_Size)
7837 CFLAGS="$_SAVE_CFLAGS"
7840 _SAVE_CPPFLAGS="$CPPFLAGS"
7841 CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
7842 MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
7843 [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
7844 CPPFLAGS="$_SAVE_CPPFLAGS"
7846 AC_DEFINE(HAVE_FONTCONFIG_FCFREETYPE_H)
7849 PKG_CHECK_MODULES(_FONTCONFIG, fontconfig,
7851 if test "$MOZ_PANGO"; then
7852 MOZ_PANGO_CFLAGS="$MOZ_PANGO_CFLAGS $_FONTCONFIG_CFLAGS"
7853 MOZ_PANGO_LIBS="$MOZ_PANGO_LIBS $_FONTCONFIG_LIBS"
7855 FT2_CFLAGS="$FT2_CFLAGS $_FONTCONFIG_CFLAGS"
7856 FT2_LIBS="$FT2_LIBS $_FONTCONFIG_LIBS"
7861 dnl ========================================================
7862 dnl Check for pixman and cairo
7863 dnl ========================================================
7866 MOZ_ARG_ENABLE_BOOL(system-cairo,
7867 [ --enable-system-cairo Use system cairo (located with pkgconfig)],
7872 MOZ_ARG_ENABLE_BOOL(system-pixman,
7873 [ --enable-system-pixman Use system pixman (located with pkgconfig)],
7875 MOZ_TREE_PIXMAN=force,
7878 # System cairo depends on system pixman
7879 if test "$MOZ_TREE_PIXMAN" = "force"; then
7880 if test -z "$MOZ_TREE_CAIRO"; then
7881 AC_MSG_ERROR([--disable-system-pixman is incompatible with --enable-system-cairo.])
7885 elif test -z "$MOZ_TREE_CAIRO"; then
7889 if test "$MOZ_TREE_PIXMAN"; then
7890 AC_DEFINE(MOZ_TREE_PIXMAN)
7891 MOZ_PIXMAN_CFLAGS=""
7892 MOZ_PIXMAN_LIBS='$(call EXPAND_LIBNAME_PATH,mozlibpixman,$(DEPTH)/gfx/cairo/libpixman/src)'
7894 PKG_CHECK_MODULES(PIXMAN, pixman-1 >= 0.19.2)
7895 MOZ_PIXMAN_CFLAGS="$PIXMAN_CFLAGS"
7896 MOZ_PIXMAN_LIBS="$PIXMAN_LIBS"
7898 AC_SUBST(MOZ_PIXMAN_CFLAGS)
7899 AC_SUBST(MOZ_PIXMAN_LIBS)
7901 # Check for headers defining standard int types.
7902 MOZ_CHECK_HEADERS(stdint.h inttypes.h sys/int_types.h)
7904 if test "$MOZ_TREE_CAIRO"; then
7905 MOZ_CAIRO_CFLAGS='-I$(LIBXUL_DIST)/include/cairo'
7906 AC_DEFINE(MOZ_TREE_CAIRO)
7908 # For now we assume that we will have a uint64_t available through
7909 # one of the above headers or mozstdint.h.
7910 AC_DEFINE(HAVE_UINT64_T)
7912 # Define macros for cairo-features.h
7913 TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1"
7914 if test "$MOZ_X11"; then
7915 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
7916 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
7917 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
7918 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7919 MOZ_ENABLE_CAIRO_FT=1
7920 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
7922 case "$MOZ_WIDGET_TOOLKIT" in
7924 QT_SURFACE_FEATURE="#define CAIRO_HAS_QT_SURFACE 1"
7927 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
7928 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
7929 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
7932 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
7933 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
7934 if test "$MOZ_WINSDK_TARGETVER" -ge "06010000"; then
7935 WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
7936 WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
7937 MOZ_ENABLE_D2D_SURFACE=1
7938 MOZ_ENABLE_DWRITE_FONT=1
7940 WIN32_DWRITE_FONT_FEATURE=
7941 WIN32_D2D_SURFACE_FEATURE=
7944 MOZ_CHECK_HEADER(d3d9.h, MOZ_ENABLE_D3D9_LAYER=1)
7946 dnl D3D10 Layers depend on D2D Surfaces.
7947 if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
7948 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
7952 OS2_SURFACE_FEATURE="#define CAIRO_HAS_OS2_SURFACE 1"
7953 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
7954 MOZ_ENABLE_CAIRO_FT=1
7955 CAIRO_FT_CFLAGS="-I${MZFTCFGFT2}/include"
7956 CAIRO_FT_OSLIBS="-L${MZFTCFGFT2}/lib -lmozft -lmzfntcfg"
7960 if test "$USE_FC_FREETYPE"; then
7961 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
7963 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
7964 AC_SUBST(MOZ_ENABLE_DWRITE_FONT)
7965 AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
7966 AC_SUBST(MOZ_ENABLE_D3D9_LAYER)
7967 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
7968 AC_SUBST(CAIRO_FT_CFLAGS)
7970 AC_SUBST(PS_SURFACE_FEATURE)
7971 AC_SUBST(PDF_SURFACE_FEATURE)
7972 AC_SUBST(SVG_SURFACE_FEATURE)
7973 AC_SUBST(XLIB_SURFACE_FEATURE)
7974 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
7975 AC_SUBST(QUARTZ_SURFACE_FEATURE)
7976 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
7977 AC_SUBST(WIN32_SURFACE_FEATURE)
7978 AC_SUBST(OS2_SURFACE_FEATURE)
7979 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
7980 AC_SUBST(FT_FONT_FEATURE)
7981 AC_SUBST(FC_FONT_FEATURE)
7982 AC_SUBST(WIN32_FONT_FEATURE)
7983 AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
7984 AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
7985 AC_SUBST(QUARTZ_FONT_FEATURE)
7986 AC_SUBST(PNG_FUNCTIONS_FEATURE)
7987 AC_SUBST(QT_SURFACE_FEATURE)
7988 AC_SUBST(TEE_SURFACE_FEATURE)
7990 MOZ_CAIRO_LIBS='$(call EXPAND_LIBNAME_PATH,mozcairo,$(DEPTH)/gfx/cairo/cairo/src)'" $CAIRO_FT_LIBS"
7991 MOZ_CAIRO_OSLIBS='${CAIRO_FT_OSLIBS}'
7993 if test "$MOZ_X11"; then
7994 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
7997 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
7999 PKG_CHECK_MODULES(CAIRO, cairo >= $CAIRO_VERSION)
8000 MOZ_CAIRO_CFLAGS="$CAIRO_CFLAGS"
8001 MOZ_CAIRO_LIBS="$CAIRO_LIBS"
8002 PKG_CHECK_MODULES(CAIRO_TEE, cairo-tee >= $CAIRO_VERSION)
8003 if test "$MOZ_X11"; then
8004 PKG_CHECK_MODULES(CAIRO_XRENDER, cairo-xlib-xrender >= $CAIRO_VERSION)
8005 MOZ_CAIRO_LIBS="$MOZ_CAIRO_LIBS $XLDFLAGS $CAIRO_XRENDER_LIBS"
8006 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_LIBS"
8007 MOZ_CAIRO_CFLAGS="$MOZ_CAIRO_CFLAGS $CAIRO_XRENDER_CFLAGS"
8011 AC_SUBST(MOZ_TREE_CAIRO)
8012 AC_SUBST(MOZ_CAIRO_CFLAGS)
8013 AC_SUBST(MOZ_CAIRO_LIBS)
8014 AC_SUBST(MOZ_CAIRO_OSLIBS)
8015 AC_SUBST(MOZ_TREE_PIXMAN)
8017 dnl ========================================================
8019 dnl ========================================================
8021 QCMS_LIBS='$(DEPTH)/gfx/qcms/$(LIB_PREFIX)mozqcms.$(LIB_SUFFIX)'
8024 dnl ========================================================
8026 dnl ========================================================
8027 MOZ_HARFBUZZ_LIBS='$(DEPTH)/gfx/harfbuzz/src/$(LIB_PREFIX)mozharfbuzz.$(LIB_SUFFIX)'
8028 AC_SUBST(MOZ_HARFBUZZ_LIBS)
8030 dnl ========================================================
8032 dnl ========================================================
8033 if test "$MOZ_GRAPHITE"; then
8034 MOZ_GRAPHITE_LIBS='$(DEPTH)/gfx/graphite2/src/$(LIB_PREFIX)mozgraphite2.$(LIB_SUFFIX)'
8035 AC_DEFINE(MOZ_GRAPHITE)
8039 AC_SUBST(MOZ_GRAPHITE)
8040 AC_SUBST(MOZ_GRAPHITE_LIBS)
8042 dnl ========================================================
8044 dnl ========================================================
8045 MOZ_OTS_LIBS='$(DEPTH)/gfx/ots/src/$(LIB_PREFIX)mozots.$(LIB_SUFFIX)'
8046 AC_SUBST(MOZ_OTS_LIBS)
8048 dnl ========================================================
8050 dnl ========================================================
8051 if test "$MOZ_ENABLE_SKIA"; then
8052 MOZ_SKIA_LIBS='$(DEPTH)/gfx/skia/$(LIB_PREFIX)skia.$(LIB_SUFFIX)'
8053 AC_DEFINE(MOZ_ENABLE_SKIA)
8057 AC_SUBST(MOZ_ENABLE_SKIA)
8058 AC_SUBST(MOZ_SKIA_LIBS)
8060 dnl ========================================================
8062 dnl ========================================================
8063 MOZ_ARG_DISABLE_BOOL(xul,
8064 [ --disable-xul Disable XUL],
8066 if test "$MOZ_XUL"; then
8069 dnl remove extensions that require XUL
8070 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/venkman//' -e 's/irc//' -e 's/tasks//'`
8075 dnl ========================================================
8076 dnl disable profile locking
8077 dnl do no use this in applications that can have more than
8078 dnl one process accessing the profile directory.
8079 dnl ========================================================
8080 MOZ_ARG_DISABLE_BOOL(profilelocking,
8081 [ --disable-profilelocking
8082 Disable profile locking],
8083 MOZ_PROFILELOCKING=,
8084 MOZ_PROFILELOCKING=1 )
8085 if test "$MOZ_PROFILELOCKING"; then
8086 AC_DEFINE(MOZ_PROFILELOCKING)
8089 dnl ========================================================
8090 dnl necko configuration options
8091 dnl ========================================================
8094 dnl option to disable various necko protocols
8096 MOZ_ARG_ENABLE_STRING(necko-protocols,
8097 [ --enable-necko-protocols[={http,ftp,default,all,none}]
8098 Enable/disable specific protocol handlers],
8099 [ for option in `echo $enableval | sed 's/,/ /g'`; do
8100 if test "$option" = "yes" -o "$option" = "all"; then
8101 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8102 elif test "$option" = "no" -o "$option" = "none"; then
8104 elif test "$option" = "default"; then
8105 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $NECKO_PROTOCOLS_DEFAULT"
8106 elif test `echo "$option" | grep -c \^-` != 0; then
8107 option=`echo $option | sed 's/^-//'`
8108 NECKO_PROTOCOLS=`echo "$NECKO_PROTOCOLS" | sed "s/ ${option}//"`
8110 NECKO_PROTOCOLS="$NECKO_PROTOCOLS $option"
8113 NECKO_PROTOCOLS="$NECKO_PROTOCOLS_DEFAULT")
8115 NECKO_PROTOCOLS=`${PERL} ${srcdir}/build/unix/uniq.pl ${NECKO_PROTOCOLS}`
8116 AC_SUBST(NECKO_PROTOCOLS)
8117 for p in $NECKO_PROTOCOLS; do
8118 AC_DEFINE_UNQUOTED(NECKO_PROTOCOL_$p)
8119 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_PROTOCOL_$p"
8123 dnl option to disable necko's wifi scanner
8125 MOZ_ARG_DISABLE_BOOL(necko-wifi,
8126 [ --disable-necko-wifi Disable necko wifi scanner],
8130 if test "$OS_ARCH" = "OS2"; then
8131 dnl OS/2 implementation of Necko-WiFi support will be added in bug 506566
8134 if test "$NECKO_WIFI" -a \
8135 "$OS_ARCH" != "Linux" -a \
8136 "$OS_ARCH" != "Darwin" -a \
8137 "$OS_ARCH" != "SunOS" -a \
8138 "$OS_ARCH" != "WINNT"; then
8139 AC_MSG_ERROR([Necko WiFi scanning not supported on your platform, use --disable-necko-wifi])
8142 if test -z "$SKIP_LIBRARY_CHECKS" -a "$NECKO_WIFI" -a "$OS_ARCH" = "Linux"
8144 MOZ_CHECK_HEADER([iwlib.h])
8145 if test "$ac_cv_header_iwlib_h" != "yes"; then
8146 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])
8150 if test "$NECKO_WIFI"; then
8151 AC_DEFINE(NECKO_WIFI)
8152 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
8154 AC_SUBST(NECKO_WIFI)
8157 dnl option to disable cookies
8159 MOZ_ARG_DISABLE_BOOL(cookies,
8160 [ --disable-cookies Disable cookie support],
8163 AC_SUBST(NECKO_COOKIES)
8164 if test "$NECKO_COOKIES"; then
8165 AC_DEFINE(NECKO_COOKIES)
8166 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES"
8170 dnl Build jsctypes on the platforms we can, unless it's explicitly disabled.
8172 MOZ_ARG_DISABLE_BOOL(ctypes,
8173 [ --disable-ctypes Disable js-ctypes],
8176 AC_SUBST(BUILD_CTYPES)
8177 if test "$BUILD_CTYPES"; then
8178 AC_DEFINE(BUILD_CTYPES)
8181 dnl Build Places if required
8182 if test "$MOZ_PLACES"; then
8183 AC_DEFINE(MOZ_PLACES)
8186 dnl Build Apps in the Cloud (AITC) if required
8187 AC_SUBST(MOZ_SERVICES_AITC)
8188 if test -n "$MOZ_SERVICES_AITC"; then
8189 AC_DEFINE(MOZ_SERVICES_AITC)
8192 dnl Build Notifications if required
8193 AC_SUBST(MOZ_SERVICES_NOTIFICATIONS)
8194 if test -n "$MOZ_SERVICES_NOTIFICATIONS"; then
8195 AC_DEFINE(MOZ_SERVICES_NOTIFICATIONS)
8198 dnl Build Sync Services if required
8199 AC_SUBST(MOZ_SERVICES_SYNC)
8200 if test -n "$MOZ_SERVICES_SYNC"; then
8201 AC_DEFINE(MOZ_SERVICES_SYNC)
8204 dnl ========================================================
8205 if test "$MOZ_DEBUG" -o "$NS_TRACE_MALLOC"; then
8206 MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS=
8209 if test "$MOZ_APP_COMPONENT_INCLUDE"; then
8210 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_INCLUDE, "$MOZ_APP_COMPONENT_INCLUDE")
8213 if test "$MOZ_APP_COMPONENT_MODULES"; then
8214 AC_DEFINE_UNQUOTED(MOZ_APP_COMPONENT_MODULES, $MOZ_APP_COMPONENT_MODULES)
8217 dnl ========================================================
8219 dnl = Maintainer debug option (no --enable equivalent)
8221 dnl ========================================================
8226 AC_SUBST(AR_EXTRACT)
8230 AC_SUBST(AS_DASH_C_FLAG)
8239 AC_SUBST(MOZ_WIDGET_TOOLKIT)
8240 AC_SUBST(MOZ_UPDATE_XTERM)
8241 AC_SUBST(MOZ_PLATFORM_MAEMO)
8242 AC_SUBST(MOZ_AUTH_EXTENSION)
8243 AC_SUBST(MOZ_PERMISSIONS)
8245 AC_SUBST(MOZ_PREF_EXTENSIONS)
8246 AC_SUBST(MOZ_JS_LIBS)
8249 AC_SUBST(MOZ_DEBUG_SYMBOLS)
8250 AC_SUBST(MOZ_DEBUG_ENABLE_DEFS)
8251 AC_SUBST(MOZ_DEBUG_DISABLE_DEFS)
8252 AC_SUBST(MOZ_DEBUG_FLAGS)
8253 AC_SUBST(MOZ_DEBUG_LDFLAGS)
8254 AC_SUBST(WARNINGS_AS_ERRORS)
8255 AC_SUBST(MOZ_EXTENSIONS)
8256 AC_SUBST(MOZ_JSDEBUGGER)
8257 AC_SUBST(MOZ_ENABLE_PROFILER_SPS)
8260 AC_SUBST(MOZ_CALLGRIND)
8263 AC_SUBST(MOZ_PROFILING)
8265 AC_SUBST(MOZ_PLACES)
8266 AC_SUBST(MOZ_TOOLKIT_SEARCH)
8268 AC_SUBST(NS_PRINTING)
8270 AC_SUBST(MOZ_HELP_VIEWER)
8271 AC_SUBST(TOOLCHAIN_PREFIX)
8277 AC_SUBST(MOZ_PROFILELOCKING)
8279 AC_SUBST(ENABLE_TESTS)
8280 AC_SUBST(ENABLE_MARIONETTE)
8282 AC_SUBST(MOZ_UNIVERSALCHARDET)
8283 AC_SUBST(ACCESSIBILITY)
8284 AC_SUBST(MOZ_SPELLCHECK)
8285 AC_SUBST(MOZ_JAVA_COMPOSITOR)
8286 AC_SUBST(MOZ_ONLY_TOUCH_EVENTS)
8287 AC_SUBST(MOZ_CRASHREPORTER)
8288 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
8289 AC_SUBST(MOZ_MAINTENANCE_SERVICE)
8290 AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
8291 AC_SUBST(MOZ_ENABLE_SIGNMAR)
8292 AC_SUBST(MOZ_UPDATER)
8293 AC_SUBST(MOZ_ANGLE_RENDERER)
8294 AC_SUBST(MOZ_DIRECTX_SDK_PATH)
8295 AC_SUBST(MOZ_DIRECTX_SDK_CPU_SUFFIX)
8296 AC_SUBST(MOZ_D3DX9_VERSION)
8297 AC_SUBST(MOZ_D3DX9_CAB)
8298 AC_SUBST(MOZ_D3DCOMPILER_CAB)
8299 AC_SUBST(MOZ_D3DX9_DLL)
8300 AC_SUBST(MOZ_D3DCOMPILER_DLL)
8303 AC_SUBST(MOZ_ANDROID_HISTORY)
8304 AC_SUBST(MOZ_WEBSMS_BACKEND)
8305 AC_SUBST(ENABLE_STRIP)
8306 AC_SUBST(PKG_SKIP_STRIP)
8307 AC_SUBST(STRIP_FLAGS)
8308 AC_SUBST(USE_ELF_DYNSTR_GC)
8309 AC_SUBST(USE_ELF_HACK)
8310 AC_SUBST(INCREMENTAL_LINKER)
8311 AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
8312 AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
8314 AC_SUBST(MOZ_FIX_LINK_PATHS)
8315 AC_SUBST(XPCOM_LIBS)
8316 AC_SUBST(XPCOM_FROZEN_LDOPTS)
8317 AC_SUBST(XPCOM_GLUE_LDOPTS)
8318 AC_SUBST(XPCOM_STANDALONE_GLUE_LDOPTS)
8319 AC_SUBST(XPCOM_STATICRUNTIME_GLUE_LDOPTS)
8320 AC_SUBST(XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS)
8322 AC_SUBST(USE_DEPENDENT_LIBS)
8324 AC_SUBST(MOZ_BUILD_ROOT)
8325 AC_SUBST(MOZ_OS2_TOOLS)
8327 AC_SUBST(MOZ_POST_DSO_LIB_COMMAND)
8328 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
8329 AC_SUBST(MOZ_LINKER_EXTRACT)
8330 AC_SUBST(MOZ_PER_WINDOW_PRIVATE_BROWSING)
8332 dnl ========================================================
8333 dnl = Mac bundle name prefix
8334 dnl ========================================================
8335 MOZ_ARG_WITH_STRING(macbundlename-prefix,
8336 [ --with-macbundlename-prefix=prefix
8337 Prefix for MOZ_MACBUNDLE_NAME],
8338 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
8340 MOZ_MACBUNDLE_NAME=`echo $MOZ_APP_DISPLAYNAME | tr -d ' '`
8341 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
8342 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
8345 if test "$MOZ_DEBUG"; then
8346 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}Debug.app
8348 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
8350 AC_SUBST(MOZ_MACBUNDLE_NAME)
8352 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
8353 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr '[A-Z]' '[a-z]'`
8354 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
8355 if test "$MOZ_DEBUG"; then
8356 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
8359 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
8360 AC_SUBST(MOZ_MACBUNDLE_ID)
8362 # The following variables are available to branding and application
8363 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
8364 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
8365 # impacts profile location and user-visible fields.
8366 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
8367 # versions of a given application (e.g. Aurora and Firefox both use
8368 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
8369 # for application.ini's "Name" field, which controls profile location in
8370 # the absence of a "Profile" field (see below), and various system
8371 # integration hooks (Unix remoting, Windows MessageWindow name, etc.)
8372 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
8373 # Mac Bundle name, Updater, Installer), it is typically used for nightly
8374 # builds (e.g. Aurora for Firefox).
8375 # - MOZ_APP_VERSION: Defines the application version number.
8376 # - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
8377 # defaults to a lowercase form of MOZ_APP_BASENAME.
8378 # - MOZ_APP_PROFILE: When set, used for application.ini's
8379 # "Profile" field, which controls profile location.
8380 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
8381 # crash reporter server url.
8382 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
8383 # - MOZ_EXTENSION_MANAGER: When set, enabled extension manager.
8385 if test -z "$MOZ_APP_NAME"; then
8386 MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
8389 # For extensions and langpacks, we require a max version that is compatible
8390 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
8391 # 10.0a1 and 10.0a2 aren't affected
8392 # 10.0 becomes 10.0.*
8393 # 10.0.1 becomes 10.0.*
8394 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
8395 if test -z "$IS_ALPHA"; then
8397 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*.[0-9]*\).*|\1|"`.*
8400 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
8403 AC_SUBST(MOZ_APP_NAME)
8404 AC_SUBST(MOZ_APP_DISPLAYNAME)
8405 AC_SUBST(MOZ_APP_BASENAME)
8406 AC_SUBST(MOZ_APP_VENDOR)
8407 AC_SUBST(MOZ_APP_PROFILE)
8408 AC_SUBST(MOZ_APP_ID)
8409 AC_SUBST(MAR_CHANNEL_ID)
8410 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
8411 AC_SUBST(MOZ_PROFILE_MIGRATOR)
8412 AC_SUBST(MOZ_EXTENSION_MANAGER)
8413 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
8414 AC_SUBST(MOZ_APP_UA_NAME)
8415 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
8416 AC_SUBST(MOZ_APP_VERSION)
8417 AC_SUBST(MOZ_APP_MAXVERSION)
8418 AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIREFOX_VERSION)
8419 AC_SUBST(FIREFOX_VERSION)
8420 AC_SUBST(MOZ_UA_OS_AGNOSTIC)
8421 if test -n "$MOZ_UA_OS_AGNOSTIC"; then
8422 AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
8425 # We can't use the static application.ini data when building against
8427 if test -n "$LIBXUL_SDK"; then
8430 AC_SUBST(MOZ_APP_STATIC_INI)
8432 AC_SUBST(MOZ_PKG_SPECIAL)
8434 AC_SUBST(MOZILLA_OFFICIAL)
8436 if test "$MOZ_TELEMETRY_REPORTING"; then
8437 AC_DEFINE(MOZ_TELEMETRY_REPORTING)
8441 AC_SUBST(MOZ_MAPINFO)
8442 AC_SUBST(MOZ_BROWSE_INFO)
8443 AC_SUBST(MOZ_TOOLS_DIR)
8444 AC_SUBST(WIN32_REDIST_DIR)
8447 dnl Echo the CFLAGS to remove extra whitespace.
8453 $_WARNINGS_CXXFLAGS \
8456 COMPILE_CFLAGS=`echo \
8461 COMPILE_CXXFLAGS=`echo \
8462 $_DEFINES_CXXFLAGS \
8466 AC_SUBST(MOZ_NATIVE_MAKEDEPEND)
8467 AC_SUBST(SYSTEM_LIBXUL)
8468 AC_SUBST(MOZ_NATIVE_JPEG)
8469 AC_SUBST(MOZ_NATIVE_PNG)
8470 AC_SUBST(MOZ_NATIVE_BZ2)
8472 AC_SUBST(MOZ_FLEXBOX)
8473 AC_SUBST(MOZ_JPEG_CFLAGS)
8474 AC_SUBST(MOZ_JPEG_LIBS)
8475 AC_SUBST(MOZ_BZ2_CFLAGS)
8476 AC_SUBST(MOZ_BZ2_LIBS)
8477 AC_SUBST(MOZ_PNG_CFLAGS)
8478 AC_SUBST(MOZ_PNG_LIBS)
8480 AC_SUBST(NSPR_CFLAGS)
8482 AC_SUBST(MOZ_NATIVE_NSPR)
8484 AC_SUBST(NSS_CFLAGS)
8486 AC_SUBST(NSS_DEP_LIBS)
8487 AC_SUBST(MOZ_NATIVE_NSS)
8488 AC_SUBST(NSS_DISABLE_DBM)
8491 OS_CXXFLAGS="$CXXFLAGS"
8492 OS_CPPFLAGS="$CPPFLAGS"
8493 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
8494 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
8495 OS_LDFLAGS="$LDFLAGS"
8498 AC_SUBST(OS_CXXFLAGS)
8499 AC_SUBST(OS_CPPFLAGS)
8500 AC_SUBST(OS_COMPILE_CFLAGS)
8501 AC_SUBST(OS_COMPILE_CXXFLAGS)
8502 AC_SUBST(OS_LDFLAGS)
8504 AC_SUBST(CROSS_COMPILE)
8505 AC_SUBST(WCHAR_CFLAGS)
8509 AC_SUBST(HOST_CFLAGS)
8510 AC_SUBST(HOST_CXXFLAGS)
8511 AC_SUBST(HOST_LDFLAGS)
8512 AC_SUBST(HOST_OPTIMIZE_FLAGS)
8514 AC_SUBST(HOST_AR_FLAGS)
8516 AC_SUBST(HOST_RANLIB)
8517 AC_SUBST(HOST_NSPR_MDCPUCFG)
8518 AC_SUBST(HOST_BIN_SUFFIX)
8519 AC_SUBST(HOST_OS_ARCH)
8521 AC_SUBST(TARGET_CPU)
8522 AC_SUBST(TARGET_VENDOR)
8524 AC_SUBST(TARGET_NSPR_MDCPUCFG)
8525 AC_SUBST(TARGET_MD_ARCH)
8526 AC_SUBST(TARGET_XPCOM_ABI)
8529 AC_SUBST(OS_RELEASE)
8532 AC_SUBST(INTEL_ARCHITECTURE)
8534 AC_SUBST(MOZ_CHROME_FILE_FORMAT)
8536 AC_SUBST(WRAP_LDFLAGS)
8539 AC_SUBST(MKSHLIB_FORCE_ALL)
8540 AC_SUBST(MKSHLIB_UNFORCE_ALL)
8541 AC_SUBST(DSO_CFLAGS)
8542 AC_SUBST(DSO_PIC_CFLAGS)
8543 AC_SUBST(DSO_LDOPTS)
8544 AC_SUBST(LIB_PREFIX)
8545 AC_SUBST(DLL_PREFIX)
8546 AC_SUBST(DLL_SUFFIX)
8547 AC_DEFINE_UNQUOTED(MOZ_DLL_SUFFIX, "$DLL_SUFFIX")
8548 AC_SUBST(LIB_SUFFIX)
8549 AC_SUBST(OBJ_SUFFIX)
8550 AC_SUBST(BIN_SUFFIX)
8551 AC_SUBST(ASM_SUFFIX)
8552 AC_SUBST(IMPORT_LIB_SUFFIX)
8554 AC_SUBST(CC_VERSION)
8555 AC_SUBST(CXX_VERSION)
8556 AC_SUBST(MSMANIFEST_TOOL)
8557 AC_SUBST(NS_ENABLE_TSF)
8558 AC_SUBST(MOZ_NSS_PATCH)
8559 AC_SUBST(MOZ_APP_COMPONENT_LIBS)
8560 AC_SUBST(MOZ_APP_EXTRA_LIBS)
8563 AC_SUBST(MOZ_SYDNEYAUDIO)
8564 AC_SUBST(MOZ_SPEEX_RESAMPLER)
8567 AC_SUBST(MOZ_VORBIS)
8568 AC_SUBST(MOZ_TREMOR)
8571 AC_SUBST(MOZ_MEDIA_PLUGINS)
8572 AC_SUBST(MOZ_OMX_PLUGIN)
8573 AC_SUBST(MOZ_VP8_ERROR_CONCEALMENT)
8574 AC_SUBST(MOZ_VP8_ENCODER)
8577 AC_SUBST(MOZ_ALSA_LIBS)
8578 AC_SUBST(MOZ_ALSA_CFLAGS)
8580 AC_SUBST(VPX_ASFLAGS)
8581 AC_SUBST(VPX_DASH_C_FLAG)
8582 AC_SUBST(VPX_AS_CONVERSION)
8583 AC_SUBST(VPX_ASM_SUFFIX)
8584 AC_SUBST(VPX_X86_ASM)
8585 AC_SUBST(VPX_ARM_ASM)
8586 AC_SUBST(VPX_NEED_OBJ_INT_EXTRACT)
8587 AC_SUBST(MOZ_INSTRUMENT_EVENT_LOOP)
8588 AC_SUBST(LIBJPEG_TURBO_AS)
8589 AC_SUBST(LIBJPEG_TURBO_ASFLAGS)
8590 AC_SUBST(LIBJPEG_TURBO_X86_ASM)
8591 AC_SUBST(LIBJPEG_TURBO_X64_ASM)
8592 AC_SUBST(LIBJPEG_TURBO_ARM_ASM)
8594 AC_SUBST(MOZ_PACKAGE_JSSHELL)
8596 AC_MSG_CHECKING([for posix_fallocate])
8597 AC_TRY_LINK([#define _XOPEN_SOURCE 600
8598 #include <fcntl.h>],
8599 [posix_fallocate(0, 0, 0);],
8600 [ac_cv___posix_fallocate=true],
8601 [ac_cv___posix_fallocate=false])
8603 if test "$ac_cv___posix_fallocate" = true ; then
8604 AC_DEFINE(HAVE_POSIX_FALLOCATE)
8610 dnl Check for missing components
8611 if test "$COMPILE_ENVIRONMENT"; then
8612 if test "$MOZ_X11"; then
8613 if test "$WITHOUT_X11"; then
8614 AC_MSG_ERROR([--without-x specified and MOZ_X11 still defined])
8616 dnl ====================================================
8617 dnl = Check if X headers exist
8618 dnl ====================================================
8619 _SAVE_CFLAGS=$CFLAGS
8620 CFLAGS="$CFLAGS $XCFLAGS"
8624 #include <X11/Xlib.h>
8625 #include <X11/Intrinsic.h>
8626 #include <X11/extensions/XShm.h>
8630 if ((dpy = XOpenDisplay(NULL)) == NULL) {
8631 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
8635 [ AC_MSG_ERROR([Could not compile basic X program.]) ])
8636 CFLAGS="$_SAVE_CFLAGS"
8638 if test -n "$MISSING_X"; then
8639 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
8644 dnl Check for headers, etc. needed by WebGL.
8645 if test "$MOZ_GL_DEFAULT_PROVIDER" = "GLX"; then
8646 MOZ_CHECK_HEADER(GL/glx.h)
8647 if test "$ac_cv_header_GL_glx_h" != "yes"; then
8648 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))])
8650 fi # MOZ_GL_DEFAULT_PROVIDER=GLX
8651 fi # COMPILE_ENVIRONMENT
8653 dnl Set various defines and substitutions
8654 dnl ========================================================
8656 if test "$OS_ARCH" = "Darwin"; then
8658 elif test "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "OS2"; then
8662 if test "$MOZ_DEBUG"; then
8663 AC_DEFINE(MOZ_REFLOW_PERF)
8664 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
8667 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK2" ; then
8668 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
8669 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
8670 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
8671 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
8672 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
8673 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
8674 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
8675 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
8678 AC_SUBST(MOZILLA_VERSION)
8680 AC_SUBST(ac_configure_args)
8682 dnl Spit out some output
8683 dnl ========================================================
8685 dnl The following defines are used by xpcom
8686 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
8688 HAVE_CPP_2BYTE_WCHAR_T
8689 HAVE_CPP_AMBIGUITY_RESOLVING_USING
8691 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
8692 HAVE_CPP_PARTIAL_SPECIALIZATION
8693 HAVE_CPP_TROUBLE_COMPARING_TO_ZERO
8696 NEED_CPP_UNUSED_IMPLEMENTATIONS
8700 HAVE_ICONV_WITH_CONST_INPUT
8708 netwerk/necko-config.h
8709 xpcom/xpcom-config.h
8710 xpcom/xpcom-private.h
8713 # Hack around an Apple bug that affects the egrep that comes with OS X 10.7.
8714 # "env ARCHPREFERENCE=i386,x86_64 arch egrep" first tries to use the 32-bit
8715 # Intel part of the egrep fat binary, even on 64-bit systems, and falls back on
8716 # the 64-bit part if it's not a fat binary, as can happen with MacPorts. We
8717 # (apparently) only need this hack when egrep's "pattern" is particularly long
8718 # (as in the following code) and the first egrep on our $PATH is Apple's. See
8722 FIXED_EGREP="env ARCHPREFERENCE=i386,x86_64 arch egrep"
8729 dnl Create a virtualenv where we can install local Python packages
8730 AC_MSG_RESULT([Creating Python virtualenv])
8732 mkdir -p _virtualenv
8733 MACOSX_DEPLOYMENT_TARGET= PYTHONDONTWRITEBYTECODE= $PYTHON $_topsrcdir/python/virtualenv/virtualenv.py --system-site-packages ./_virtualenv
8736 PYTHON=$MOZ_BUILD_ROOT/_virtualenv/Scripts/python.exe
8739 PYTHON=$MOZ_BUILD_ROOT/_virtualenv/bin/python
8745 # Populate the virtualenv
8746 AC_MSG_RESULT([Populating Python virtualenv])
8747 MACOSX_DEPLOYMENT_TARGET= LDFLAGS="${HOST_LDFLAGS}" \
8748 CC="${HOST_CC}" CXX="${HOST_CXX}" \
8749 CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" \
8750 $PYTHON $_topsrcdir/build/virtualenv/populate_virtualenv.py \
8751 $_topsrcdir $_topsrcdir/build/virtualenv/packages.txt \
8754 dnl Load the list of Makefiles to generate.
8755 dnl To add new Makefiles, edit allmakefiles.sh.
8756 dnl allmakefiles.sh sets the variable, MAKEFILES.
8757 . ${srcdir}/allmakefiles.sh
8759 echo $MAKEFILES > unallmakefiles
8761 AC_OUTPUT($MAKEFILES)
8763 # Generate Makefiles for WebRTC directly from .gyp files
8764 if test "${OS_TARGET}" = "WINNT"; then
8765 if test "$HAVE_64BIT_OS"; then
8770 EXTRA_GYP_DEFINES="-D MSVS_VERSION=${_MSVS_VERSION} -D MSVS_OS_BITS=${OS_BITS}"
8773 if test -n "$MOZ_WEBRTC"; then
8774 AC_MSG_RESULT("generating WebRTC Makefiles...")
8776 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}"
8778 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8779 $GYP_WEBRTC_OPTIONS \
8780 --generator-output=${_objdir}/media/webrtc/trunk \
8781 ${srcdir}/media/webrtc/trunk/peerconnection.gyp
8782 if test "$?" != 0; then
8783 AC_MSG_ERROR([failed to generate WebRTC Makefiles])
8786 # XXX disable until we land the tranche with signaling
8787 if test -n "$MOZ_WEBRTC_SIGNALING"; then
8788 AC_MSG_RESULT("generating WebRTC/Signaling Makefiles...")
8789 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8790 $GYP_WEBRTC_OPTIONS \
8791 --generator-output=${_objdir}/media/webrtc/signaling \
8792 ${srcdir}/media/webrtc/signaling/signaling.gyp
8793 if test "$?" != 0; then
8794 AC_MSG_ERROR([failed to generate WebRTC/Signaling Makefiles])
8798 AC_MSG_RESULT("generating gtest Makefiles...")
8799 # Ok to pass some extra -D's that are ignored here
8800 $PYTHON ${srcdir}/media/webrtc/trunk/build/gyp_chromium \
8801 $GYP_WEBRTC_OPTIONS \
8802 --generator-output=${_objdir}/media/webrtc/trunk/testing/ \
8803 ${srcdir}/media/webrtc/trunk/testing/gtest.gyp
8804 if test "$?" != 0; then
8805 AC_MSG_ERROR([failed to generate gtest Makefiles])
8809 # Generate a JSON config file for unittest harnesses etc to read
8810 # build configuration details from in a standardized way.
8811 OS_TARGET=${OS_TARGET} TARGET_CPU=${TARGET_CPU} MOZ_DEBUG=${MOZ_DEBUG} \
8812 MOZ_WIDGET_TOOLKIT=${MOZ_WIDGET_TOOLKIT} UNIVERSAL_BINARY=${UNIVERSAL_BINARY} \
8813 $PYTHON ${_topsrcdir}/config/writemozinfo.py ./mozinfo.json.tmp
8814 if cmp -s ./mozinfo.json.tmp ./mozinfo.json; then
8815 rm ./mozinfo.json.tmp
8817 mv -f ./mozinfo.json.tmp ./mozinfo.json
8820 # Run jemalloc configure script
8822 if test "$MOZ_JEMALLOC" -a "$MOZ_MEMORY"; then
8823 ac_configure_args="$_SUBDIR_CONFIG_ARGS --build=$build --host=$target --enable-stats --with-jemalloc-prefix=je_"
8824 if test "$OS_ARCH" = "Linux"; then
8825 MANGLE="malloc calloc valloc free realloc memalign posix_memalign malloc_usable_size"
8828 if test -n "$_WRAP_MALLOC"; then
8829 JEMALLOC_WRAPPER=__wrap_
8831 for mangle in ${MANGLE}; do
8832 if test -n "$MANGLED"; then
8833 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle,$MANGLED"
8835 MANGLED="$mangle:$JEMALLOC_WRAPPER$mangle"
8838 ac_configure_args="$ac_configure_args --with-mangling=$MANGLED"
8841 if test -z "$MOZ_TLS"; then
8842 ac_configure_args="$ac_configure_args --disable-tls"
8844 EXTRA_CFLAGS="$CFLAGS"
8845 for var in AS CC CXX CPP LD AR RANLIB STRIP CPPFLAGS EXTRA_CFLAGS LDFLAGS; do
8846 ac_configure_args="$ac_configure_args $var='`eval echo \\${${var}}`'"
8848 if test "$CROSS_COMPILE"; then
8849 ac_configure_args="$ac_configure_args je_cv_static_page_shift=12"
8851 _save_cache_file="$cache_file"
8852 cache_file=$_objdir/memory/jemalloc/src/config.cache
8853 AC_OUTPUT_SUBDIRS(memory/jemalloc/src)
8854 cache_file="$_save_cache_file"
8855 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8858 dnl Build libunwind for Android profiling builds
8859 if test "$OS_TARGET" = "Android" -a "$MOZ_PROFILING"; then
8860 old_ac_configure_arg="$ac_configure_args"
8861 ac_configure_args="--build=${build} --host=${target_alias} --disable-shared --enable-block-signals=no"
8862 if test "$MOZ_DEBUG"; then
8863 ac_configure_args="$ac_configure_args --enable-debug"
8865 if test "$DSO_PIC_CFLAGS"; then
8866 ac_configure_args="$ac_configure_args --with-pic"
8868 ac_configure_args="$ac_configure_args \
8872 CFLAGS=\"$CFLAGS\" \
8873 CXXFLAGS=\"$CXXFLAGS\" \
8874 CPPFLAGS=\"$CPPFLAGS\" \
8876 LDFLAGS=\"$LDFLAGS\" \
8878 RANLIB=\"$RANLIB\" \
8882 # Use a separate cache file for libunwind, since it does not use caching.
8883 mkdir -p $_objdir/tools/profiler/libunwind/src
8884 old_cache_file=$cache_file
8885 cache_file=$_objdir/tools/profiler/libunwind/src/config.cache
8886 old_config_files=$CONFIG_FILES
8888 AC_OUTPUT_SUBDIRS(tools/profiler/libunwind/src)
8889 cache_file=$old_cache_file
8890 ac_configure_args="$old_ac_configure_args"
8891 CONFIG_FILES=$old_config_files
8894 # Run freetype configure script
8896 if test "$MOZ_TREE_FREETYPE"; then
8897 export CFLAGS="$CFLAGS -std=c99"
8898 export CPPFLAGS="$CPPFLAGS"
8899 export CXXFLAGS="$CXXFLAGS"
8900 export LDFLAGS="$LDFLAGS"
8901 export CONFIG_FILES="unix-cc.mk:unix-cc.in unix-def.mk:unix-def.in freetype-config freetype2.pc:freetype2.in"
8902 ac_configure_args="$ac_configure_args --host=$target --disable-shared --with-pic=yes"
8903 AC_OUTPUT_SUBDIRS(modules/freetype2)
8906 if test -z "$direct_nspr_config"; then
8907 dnl ========================================================
8908 dnl = Setup a nice relatively clean build environment for
8909 dnl = sub-configures.
8910 dnl ========================================================
8913 CFLAGS="$_SUBDIR_CFLAGS"
8914 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8915 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8916 LDFLAGS="$_SUBDIR_LDFLAGS"
8917 HOST_CC="$_SUBDIR_HOST_CC"
8918 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8919 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8926 # No need to run subconfigures when building with LIBXUL_SDK_DIR
8927 if test "$COMPILE_ENVIRONMENT" -a -z "$LIBXUL_SDK_DIR"; then
8931 if test -n "$_WRAP_MALLOC"; then
8932 # Avoid doubling wrap malloc arguments
8933 _SUBDIR_CONFIG_ARGS="`echo $_SUBDIR_CONFIG_ARGS | sed -e 's/--enable-wrap-malloc *//'`"
8936 if test -z "$MOZ_NATIVE_NSPR"; then
8937 ac_configure_args="$_SUBDIR_CONFIG_ARGS --with-dist-prefix=$MOZ_BUILD_ROOT/dist --with-mozilla"
8938 if test -z "$MOZ_DEBUG"; then
8939 ac_configure_args="$ac_configure_args --disable-debug"
8941 ac_configure_args="$ac_configure_args --enable-debug"
8943 if test "$MOZ_OPTIMIZE" = "1"; then
8944 ac_configure_args="$ac_configure_args --enable-optimize"
8945 elif test -z "$MOZ_OPTIMIZE"; then
8946 ac_configure_args="$ac_configure_args --disable-optimize"
8948 if test -n "$HAVE_64BIT_OS"; then
8949 ac_configure_args="$ac_configure_args --enable-64bit"
8951 if test -n "$USE_ARM_KUSER"; then
8952 ac_configure_args="$ac_configure_args --with-arm-kuser"
8954 ac_configure_args="$ac_configure_args $NSPR_CONFIGURE_ARGS"
8955 if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no ; then
8956 # dladdr is supported by the new linker, even when the system linker doesn't
8957 # support it. Trick nspr into using dladdr when it's not supported.
8958 _SAVE_CPPFLAGS="$CPPFLAGS"
8959 export CPPFLAGS="-include $_topsrcdir/mozglue/linker/dladdr.h $CPPFLAGS"
8961 _SAVE_LDFLAGS="$LDFLAGS"
8962 export LDFLAGS="$LDFLAGS $NSPR_LDFLAGS"
8963 AC_OUTPUT_SUBDIRS(nsprpub)
8964 LDFLAGS="$_SAVE_LDFLAGS"
8965 if test -n "$MOZ_LINKER" -a -z "$MOZ_OLD_LINKER" -a "$ac_cv_func_dladdr" = no; then
8967 CPPFLAGS="$_SAVE_CFLAGS"
8969 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8972 dnl ========================================================
8973 dnl = Setup a nice relatively clean build environment for
8974 dnl = sub-configures.
8975 dnl ========================================================
8978 CFLAGS="$_SUBDIR_CFLAGS"
8979 CPPFLAGS="$_SUBDIR_CPPFLAGS"
8980 CXXFLAGS="$_SUBDIR_CXXFLAGS"
8981 LDFLAGS="$_SUBDIR_LDFLAGS"
8982 HOST_CC="$_SUBDIR_HOST_CC"
8983 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
8984 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
8987 # Run the SpiderMonkey 'configure' script.
8988 dist=$MOZ_BUILD_ROOT/dist
8989 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
8990 ac_configure_args="$ac_configure_args --enable-threadsafe"
8991 if test "$BUILD_CTYPES"; then
8992 # Build js-ctypes on the platforms we can.
8993 ac_configure_args="$ac_configure_args --enable-ctypes"
8995 if test -z "$JS_SHARED_LIBRARY" ; then
8996 ac_configure_args="$ac_configure_args --disable-shared-js"
8998 if test -z "$MOZ_NATIVE_NSPR"; then
8999 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
9000 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
9002 ac_configure_args="$ac_configure_args --with-dist-dir=../../dist"
9003 ac_configure_args="$ac_configure_args --prefix=$dist"
9004 if test "$MOZ_MEMORY"; then
9005 ac_configure_args="$ac_configure_args --enable-jemalloc"
9007 if test -n "$MOZ_GLUE_LDFLAGS"; then
9008 export MOZ_GLUE_LDFLAGS
9010 if test -n "$MOZ_GLUE_PROGRAM_LDFLAGS"; then
9011 export MOZ_GLUE_PROGRAM_LDFLAGS
9013 if test "$MOZ_NATIVE_ZLIB" != 1 -a "$OS_ARCH" = "WINNT"; then
9016 export MOZ_NATIVE_ZLIB
9017 export MOZ_ZLIB_CFLAGS
9018 export MOZ_ZLIB_LIBS
9020 export STLPORT_CPPFLAGS
9021 export STLPORT_LDFLAGS
9023 AC_OUTPUT_SUBDIRS(js/src)
9024 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
9026 fi # COMPILE_ENVIRONMENT && !LIBXUL_SDK_DIR