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 ========================================================
10 AC_INIT(config/config.mk)
11 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
14 dnl ========================================================
16 dnl = Don't change the following two lines. Doing so breaks:
18 dnl = CFLAGS="-foo" ./configure
20 dnl ========================================================
22 CPPFLAGS="${CPPFLAGS=}"
23 CXXFLAGS="${CXXFLAGS=}"
25 HOST_CFLAGS="${HOST_CFLAGS=}"
26 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
27 HOST_LDFLAGS="${HOST_LDFLAGS=}"
29 dnl ========================================================
30 dnl = Preserve certain environment flags passed to configure
31 dnl = We want sub projects to receive the same flags
32 dnl = untainted by this configure script
33 dnl ========================================================
36 _SUBDIR_CFLAGS="$CFLAGS"
37 _SUBDIR_CPPFLAGS="$CPPFLAGS"
38 _SUBDIR_CXXFLAGS="$CXXFLAGS"
39 _SUBDIR_LDFLAGS="$LDFLAGS"
40 _SUBDIR_HOST_CC="$HOST_CC"
41 _SUBDIR_HOST_CFLAGS="$HOST_CFLAGS"
42 _SUBDIR_HOST_CXXFLAGS="$HOST_CXXFLAGS"
43 _SUBDIR_HOST_LDFLAGS="$HOST_LDFLAGS"
44 _SUBDIR_CONFIG_ARGS="$ac_configure_args"
46 dnl Set the version number of the libs included with mozilla
47 dnl ========================================================
54 dnl Set the minimum version of toolkit libs used by mozilla
55 dnl ========================================================
57 # 2_26 is the earliest version we can set GLIB_VERSION_MIN_REQUIRED.
58 # The macro won't be used when compiling with earlier versions anyway.
59 GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26
63 GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
64 WINDRES_VERSION=2.14.90
67 STARTUP_NOTIFICATION_VERSION=0.8
71 dnl Set various checks
72 dnl ========================================================
75 dnl Initialize the Pthread test variables early so they can be
76 dnl overridden by each platform.
77 dnl ========================================================
83 if test "$COMPILE_ENVIRONMENT"; then
85 fi # COMPILE_ENVIRONMENT
88 *-android*|*-linuxandroid*)
92 AC_PATH_PROG(OBJCOPY,objcopy)
102 AC_SUBST(ANDROID_SOURCE)
103 AC_SUBST(ANDROID_PACKAGE_NAME)
106 dnl ========================================================
107 dnl Checks for compilers.
108 dnl ========================================================
110 dnl AR_FLAGS set here so HOST_AR_FLAGS can be set correctly (see bug 538269)
113 if test "$COMPILE_ENVIRONMENT"; then
115 if test "$target" != "$host"; then
121 # Work around the conftest.exe access problem on Windows
126 MOZ_PATH_PROGS(AS, $AS as, $CC)
127 AC_CHECK_PROGS(AR, ar, :)
128 AC_CHECK_PROGS(STRIP, strip, :)
129 AC_CHECK_PROGS(WINDRES, windres, :)
130 AC_CHECK_PROGS(OTOOL, otool, :)
131 if test -z "$HOST_RANLIB"; then
132 HOST_RANLIB="$RANLIB"
134 if test -z "$HOST_AR"; then
137 if test -z "$HOST_AR_FLAGS"; then
138 HOST_AR_FLAGS="$AR_FLAGS"
142 if test -n "$MOZ_WINCONSOLE"; then
143 AC_DEFINE(MOZ_WINCONSOLE)
148 dnl ========================================================
149 dnl Special win32 checks
150 dnl ========================================================
156 if test "$GCC" != "yes"; then
157 # Check to see if we are really running in a msvc environemnt
159 AC_CHECK_PROGS(MIDL, midl)
161 # Make sure compilers are valid
162 CFLAGS="$CFLAGS -TC -nologo"
163 CXXFLAGS="$CXXFLAGS -TP -nologo"
166 AC_TRY_COMPILE([#include <stdio.h>],
167 [ printf("Hello World\n"); ],,
168 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
171 AC_TRY_COMPILE([#include <new.h>],
172 [ unsigned *test = new unsigned(42); ],,
173 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
177 _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
180 _MSC_VER=`echo ${CC_VERSION} | cut -c 1-2,4-5`
182 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
183 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
184 AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI.
187 MSVC_C_RUNTIME_DLL=vcruntime140.dll
188 MSVC_CXX_RUNTIME_DLL=msvcp140.dll
190 MOZ_CHECK_HEADER(dia2.h, MSVC_HAS_DIA_SDK=1)
191 if test -n "$MSVC_HAS_DIA_SDK"; then
192 AC_DEFINE(MSVC_HAS_DIA_SDK)
195 if test "$_MSC_VER" -ge "1910"; then # VS2017+
196 # C5038: Enable initializer list order warnings
197 # The -w1#### flag treats warning C#### as if it was a warning level
198 # 1 warning, and thus enables it because we enable /W3 warnings. We
199 # don't use -we#### because it would enable warning C#### but treat
200 # it as an error, even in third-party code.
201 # https://docs.microsoft.com/en-us/cpp/build/reference/compiler-option-warning-level
202 CXXFLAGS="$CXXFLAGS -w15038"
205 # C5026: move constructor was implicitly defined as deleted
206 CXXFLAGS="$CXXFLAGS -wd5026"
208 # C5027: move assignment operator was implicitly defined as deleted
209 CXXFLAGS="$CXXFLAGS -wd5027"
211 # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
212 CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
214 # https://connect.microsoft.com/VisualStudio/feedback/details/888527/warnings-on-dbghelp-h
215 # for dbghelp.h, imagehlp.h, and shobj.h
216 # C4091: 'typedef ': ignored on left of '' when no variable is declared
217 CFLAGS="$CFLAGS -wd4091"
218 CXXFLAGS="$CXXFLAGS -wd4091"
220 # This is intended as a temporary hack to support building with VS2015.
221 # 'noexcept' used with no exception handling mode specified;
222 # termination on exception is not guaranteed. Specify /EHsc
223 CXXFLAGS="$CXXFLAGS -wd4577"
225 if test -n "$WIN_UCRT_REDIST_DIR"; then
226 if test ! -d "$WIN_UCRT_REDIST_DIR"; then
227 AC_MSG_ERROR([Invalid Windows UCRT Redist directory: ${WIN_UCRT_REDIST_DIR}])
229 WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && pwd -W`
232 AC_SUBST(MSVC_HAS_DIA_SDK)
233 AC_SUBST(MSVC_C_RUNTIME_DLL)
234 AC_SUBST(MSVC_CXX_RUNTIME_DLL)
236 AC_DEFINE(HAVE_SEH_EXCEPTIONS)
238 if test -n "$WIN32_REDIST_DIR"; then
239 if test ! -d "$WIN32_REDIST_DIR"; then
240 AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
242 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd -W`
245 # Check linker version, except in lld builds
250 _LD_FULL_VERSION=`"${LINKER}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
251 _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
252 if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
253 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION, does not match the compiler suite version, $_CC_SUITE.])
260 # Set midl environment
263 MIDL_FLAGS="${MIDL_FLAGS} -env win32"
266 MIDL_FLAGS="${MIDL_FLAGS} -env x64"
270 unset _MSVC_VER_FILTER
272 AC_CACHE_CHECK(for overridable _RAISE,
277 _SAVE_CXXFLAGS="$CXXFLAGS"
278 CXXFLAGS="${CXXFLAGS} -D_HAS_EXCEPTIONS=0"
279 AC_TRY_COMPILE([#include <xstddef>
281 #define _RAISE(x) externallyDefinedFunction((x).what())
284 [std::vector<int> v; return v.at(1);],
285 ac_cv_have__RAISE="no",
286 ac_cv_have__RAISE="yes")
287 CXXFLAGS="$_SAVE_CXXFLAGS"
290 if test "$ac_cv_have__RAISE" = "yes"; then
292 MOZ_MSVC_STL_WRAP_RAISE=1
293 AC_DEFINE(MOZ_MSVC_STL_WRAP_RAISE)
295 AC_MSG_ERROR([Gecko exception wrapping doesn't understand your your MSVC/SDK. Please file a bug describing this error and your build configuration.])
298 if test "$WRAP_STL_INCLUDES" = "1"; then
299 STL_FLAGS="-I${DIST}/stl_wrappers"
301 CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
302 CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
304 # Check w32api version
305 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
306 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
307 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
308 AC_TRY_COMPILE([#include <w32api.h>],
309 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
310 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
311 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
312 #error "test failed."
314 , [ res=yes ], [ res=no ])
315 AC_MSG_RESULT([$res])
316 if test "$res" != "yes"; then
317 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
319 # Check windres version
320 AC_MSG_CHECKING([for windres version >= $WINDRES_VERSION])
321 _WINDRES_VERSION=`${WINDRES} --version 2>&1 | grep -i windres 2>/dev/null | $AWK '{ print $3 }'`
322 AC_MSG_RESULT([$_WINDRES_VERSION])
323 _WINDRES_MAJOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
324 _WINDRES_MINOR_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
325 _WINDRES_RELEASE_VERSION=`echo $_WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
326 WINDRES_MAJOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $1 }'`
327 WINDRES_MINOR_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $2 }'`
328 WINDRES_RELEASE_VERSION=`echo $WINDRES_VERSION | $AWK -F\. '{ print $3 }'`
329 if test "$_WINDRES_MAJOR_VERSION" -lt "$WINDRES_MAJOR_VERSION" -o \
330 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
331 "$_WINDRES_MINOR_VERSION" -lt "$WINDRES_MINOR_VERSION" -o \
332 "$_WINDRES_MAJOR_VERSION" -eq "$WINDRES_MAJOR_VERSION" -a \
333 "$_WINDRES_MINOR_VERSION" -eq "$WINDRES_MINOR_VERSION" -a \
334 "$_WINDRES_RELEASE_VERSION" -lt "$WINDRES_RELEASE_VERSION"
336 AC_MSG_ERROR([windres version $WINDRES_VERSION or higher is required to build.])
339 AC_CHECK_PROGS(MIDL, $target-widl widl)
340 if test -n "$MIDL"; then
343 MIDL_FLAGS="$MIDL_FLAGS --win32 -m32"
346 MIDL_FLAGS="$MIDL_FLAGS --win64 -m64"
351 # strsafe.h on mingw uses macros for function deprecation that pollutes namespace
352 # causing problems with local implementations with the same name.
353 AC_DEFINE(STRSAFE_NO_DEPRECATE)
356 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
357 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
358 # Require OS features provided by IE 8.0 (Win7)
359 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0800)
364 if test -n "$_WIN32_MSVC"; then
366 SKIP_COMPILER_CHECKS=1
367 SKIP_LIBRARY_CHECKS=1
369 # Since we're skipping compiler and library checks, hard-code
372 AC_DEFINE(HAVE_ISATTY)
375 fi # COMPILE_ENVIRONMENT
384 AC_SUBST_LIST(STL_FLAGS)
385 AC_SUBST(WRAP_STL_INCLUDES)
386 AC_SUBST(MOZ_MSVC_STL_WRAP_RAISE)
388 dnl ========================================================
389 dnl Checks for programs.
390 dnl ========================================================
391 if test "$COMPILE_ENVIRONMENT"; then
393 dnl ========================================================
394 dnl = Mac OS X SDK support
395 dnl ========================================================
397 MOZ_ARG_WITH_STRING(macos-sdk,
398 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
399 MACOS_SDK_DIR=$withval)
401 MACOS_PRIVATE_FRAMEWORKS_DIR_DEFAULTED=
402 MOZ_ARG_WITH_STRING(macos-private-frameworks,
403 [ --with-macos-private-frameworks=dir Location of private frameworks to use (Mac OS X only)],
404 MACOS_PRIVATE_FRAMEWORKS_DIR=$withval,
405 MACOS_PRIVATE_FRAMEWORKS_DIR=/System/Library/PrivateFrameworks
406 MACOS_PRIVATE_FRAMEWORKS_DEFAULTED=1)
408 if test -z "${MACOS_PRIVATE_FRAMEWORKS_DEFAULTED}"; then
409 if test -z "$CROSS_COMPILE"; then
410 AC_MSG_WARN([You should only be using --with-macos-private-frameworks when cross-compiling.])
412 if test ! -d "$MACOS_PRIVATE_FRAMEWORKS_DIR"; then
413 AC_MSG_ERROR([PrivateFrameworks directory not found.])
417 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is in use.
418 AC_SUBST(MACOS_SDK_DIR)
419 AC_SUBST(MACOS_PRIVATE_FRAMEWORKS_DIR)
421 if test "$MACOS_SDK_DIR"; then
422 dnl Sync this section with the ones in NSPR and NSS.
423 dnl Changes to the cross environment here need to be accounted for in
424 dnl the libIDL checks (below) and xpidl build.
426 if test ! -d "$MACOS_SDK_DIR"; then
427 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
428 specify a valid SDK. SDKs are installed when the optional cross-development
429 tools are selected during the Xcode/Developer Tools installation.])
432 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
433 CXXFLAGS="$CXXFLAGS -isysroot ${MACOS_SDK_DIR}"
435 dnl CPP/CXXCPP needs to be set for MOZ_CHECK_HEADER.
436 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
437 CXXCPP="$CXXCPP -isysroot ${MACOS_SDK_DIR}"
440 AC_MSG_CHECKING([for valid compiler/Mac OS X SDK combination])
442 AC_TRY_COMPILE([#include <new>],[],
446 AC_MSG_RESULT($result)
448 if test "$result" = "no" ; then
449 AC_MSG_ERROR([The selected compiler and Mac OS X SDK are incompatible.])
457 fi # COMPILE_ENVIRONMENT
459 dnl ========================================================
460 dnl set the defaults first
461 dnl ========================================================
466 MOZ_USER_DIR=".mozilla"
468 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
472 dnl Configure platform-specific CPU architecture compiler options.
473 dnl ==============================================================
474 if test "$COMPILE_ENVIRONMENT"; then
477 if test "$OS_TARGET" = Android; then
478 dnl Default Android builds to ARMv7.
481 fi # COMPILE_ENVIRONMENT
483 dnl ========================================================
484 dnl Android libstdc++, placed here so it can use MOZ_ARCH
486 dnl ========================================================
489 if test "$COMPILE_ENVIRONMENT"; then
491 fi # COMPILE_ENVIRONMENT
493 dnl ========================================================
494 dnl Suppress Clang Argument Warnings
495 dnl ========================================================
496 if test -n "${CLANG_CC}${CLANG_CL}"; then
497 _WARNINGS_CFLAGS="-Qunused-arguments ${_WARNINGS_CFLAGS}"
498 CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
500 if test -n "${CLANG_CXX}${CLANG_CL}"; then
501 _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
504 if test -n "$COMPILE_ENVIRONMENT"; then
508 dnl ========================================================
509 dnl Add optional and non-optional hardening flags
510 dnl ========================================================
512 CFLAGS="$CFLAGS $MOZ_HARDENING_CFLAGS"
513 CPPFLAGS="$CPPFLAGS $MOZ_HARDENING_CFLAGS"
514 CXXFLAGS="$CXXFLAGS $MOZ_HARDENING_CFLAGS"
516 dnl ========================================================
517 dnl GNU specific defaults
518 dnl ========================================================
519 if test "$GNU_CC"; then
523 SSSE3_FLAGS="-mssse3"
524 # FIXME: Let us build with strict aliasing. bug 414641.
525 CFLAGS="$CFLAGS -fno-strict-aliasing"
526 MKSHLIB='$(CXX) $(COMPUTED_CXX_LDFLAGS) $(PGO_CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(DSO_SONAME) -o $@'
527 MKCSHLIB='$(CC) $(COMPUTED_C_LDFLAGS) $(PGO_CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-h,$(DSO_SONAME) -o $@'
528 WARNINGS_AS_ERRORS='-Werror'
530 DSO_PIC_CFLAGS='-fPIC'
531 ASFLAGS="$ASFLAGS -fPIC"
532 AC_MSG_CHECKING([for --noexecstack option to as])
534 CFLAGS="$CFLAGS -Wa,--noexecstack"
535 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
536 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
539 AC_MSG_CHECKING([for -z noexecstack option to ld])
540 _SAVE_LDFLAGS=$LDFLAGS
541 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
542 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
544 LDFLAGS=$_SAVE_LDFLAGS)
546 AC_MSG_CHECKING([for -z text option to ld])
547 _SAVE_LDFLAGS=$LDFLAGS
548 LDFLAGS="$LDFLAGS -Wl,-z,text"
549 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
551 LDFLAGS=$_SAVE_LDFLAGS)
553 AC_MSG_CHECKING([for -z relro option to ld])
554 _SAVE_LDFLAGS=$LDFLAGS
555 LDFLAGS="$LDFLAGS -Wl,-z,relro"
556 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
558 LDFLAGS=$_SAVE_LDFLAGS)
560 AC_MSG_CHECKING([for --build-id option to ld])
561 _SAVE_LDFLAGS=$LDFLAGS
562 LDFLAGS="$LDFLAGS -Wl,--build-id"
563 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
565 LDFLAGS=$_SAVE_LDFLAGS)
567 AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
568 HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
569 _SAVE_LDFLAGS=$LDFLAGS
570 LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
571 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
572 [HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1],
574 LDFLAGS=$_SAVE_LDFLAGS
576 # Check for -mssse3 on $CC
577 AC_MSG_CHECKING([if toolchain supports -mssse3 option])
578 HAVE_TOOLCHAIN_SUPPORT_MSSSE3=
580 CFLAGS="$CFLAGS -mssse3"
581 AC_TRY_COMPILE([asm ("pmaddubsw %xmm2,%xmm3");],,AC_MSG_RESULT([yes])
582 [HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1],
586 # Check for -msse4.1 on $CC
587 AC_MSG_CHECKING([if toolchain supports -msse4.1 option])
588 HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=
590 CFLAGS="$CFLAGS -msse4.1"
591 AC_TRY_COMPILE([asm ("pmulld %xmm6,%xmm0");],,AC_MSG_RESULT([yes])
592 [HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1],
596 case "${CPU_ARCH}" in
598 AC_MSG_CHECKING(for x86 AVX2 asm support in compiler)
600 [asm volatile ("vpermq \$0xd8,%ymm0,%ymm0 \n");],
601 result="yes", result="no")
602 AC_MSG_RESULT("$result")
603 if test "$result" = "yes"; then
609 AC_MSG_CHECKING([whether we can enable AltiVec support])
612 CFLAGS="$CFLAGS -maltivec"
613 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
621 if test "$GCC_USE_GNU_LD"; then
622 # Some tools like ASan use a runtime library that is only
623 # linked against executables, so we must allow undefined
624 # symbols for shared objects in some cases.
625 if test -z "$MOZ_NO_WLZDEFS"; then
626 # Don't allow undefined symbols in libraries
627 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
629 # BSDs need `environ' exposed for posix_spawn (bug 753046)
631 DragonFly|FreeBSD|NetBSD|OpenBSD)
632 if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then
633 DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
635 DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
642 _DEFINES_CFLAGS="-include $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
643 _USE_CPP_INCLUDE_FLAG=1
645 ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
648 if test "$GNU_CXX"; then
649 # FIXME: Let us build with strict aliasing. bug 414641.
650 CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"
652 _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
653 _USE_CPP_INCLUDE_FLAG=1
656 dnl ========================================================
658 dnl ========================================================
659 MOZ_ARG_ENABLE_BOOL(valgrind,
660 [ --enable-valgrind Enable Valgrind integration hooks (default=no)],
663 if test -n "$MOZ_VALGRIND"; then
664 MOZ_CHECK_HEADER([valgrind/valgrind.h], [],
666 [--enable-valgrind specified but Valgrind is not installed]))
667 AC_DEFINE(MOZ_VALGRIND)
669 AC_SUBST(MOZ_VALGRIND)
671 # For profiling builds keep the symbol information
672 if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
674 Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
675 STRIP_FLAGS="--strip-debug"
680 dnl ========================================================
682 dnl ========================================================
684 if test "$MOZ_DMD"; then
685 if test "${CPU_ARCH}" = "arm"; then
686 CFLAGS="$CFLAGS -funwind-tables"
687 CXXFLAGS="$CXXFLAGS -funwind-tables"
691 dnl ========================================================
692 dnl System overrides of the defaults for host
693 dnl ========================================================
696 if test -n "$_WIN32_MSVC"; then
698 HOST_AR_FLAGS='-NOLOGO -OUT:$@'
699 HOST_CFLAGS="$HOST_CFLAGS -TC -nologo"
700 HOST_RANLIB='echo ranlib'
702 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
704 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
705 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
708 case "${host_cpu}" in
710 if test -n "$_WIN32_MSVC"; then
711 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
715 if test -n "$_WIN32_MSVC"; then
716 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
718 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
724 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
725 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
728 *-linux*|*-kfreebsd*-gnu|*-gnu*)
729 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
730 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
734 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
735 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
739 dnl Get version of various core apps from the version files.
740 FIREFOX_VERSION=`cat $_topsrcdir/browser/config/version.txt`
741 FIREFOX_VERSION_DISPLAY=`cat $_topsrcdir/browser/config/version_display.txt`
743 if test -z "$FIREFOX_VERSION"; then
744 AC_MSG_ERROR([FIREFOX_VERSION is unexpectedly blank.])
747 if test -z "$FIREFOX_VERSION_DISPLAY"; then
748 AC_MSG_ERROR([FIREFOX_VERSION_DISPLAY is unexpectedly blank.])
751 MOZ_DOING_LTO(lto_is_enabled)
753 dnl ========================================================
754 dnl System overrides of the defaults for target
755 dnl ========================================================
759 MKSHLIB='$(CXX) $(COMPUTED_CXX_LDFLAGS) $(PGO_CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
760 MKCSHLIB='$(CC) $(COMPUTED_C_LDFLAGS) $(PGO_CFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -o $@'
761 MOZ_OPTIMIZE_FLAGS="-O3"
762 CXXFLAGS="$CXXFLAGS -stdlib=libc++"
764 STRIP_FLAGS="$STRIP_FLAGS -x -S"
765 # Ensure that if we're targeting iOS an SDK was provided.
766 AC_CACHE_CHECK(for iOS target,
768 [AC_TRY_COMPILE([#include <TargetConditionals.h>
769 #if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
773 ac_cv_ios_target="yes",
774 ac_cv_ios_target="no")])
775 if test "$ac_cv_ios_target" = "yes" -a -z $MOZ_IOS; then
776 AC_MSG_ERROR([targeting iOS but not using an iOS SDK?])
778 if test -n "$MOZ_IOS"; then
781 # The ExceptionHandling framework is needed for Objective-C exception
782 # logging code in nsObjCExceptions.h. Currently we only use that in debug
784 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
787 if test "x$lto_is_enabled" = "xyes"; then
788 echo "Skipping -dead_strip because lto is enabled."
789 dnl DTrace and -dead_strip don't interact well. See bug 403132.
790 dnl ===================================================================
791 elif test "x$enable_dtrace" = "xyes"; then
792 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
794 dnl check for the presence of the -dead_strip linker flag
795 AC_MSG_CHECKING([for -dead_strip option to ld])
796 _SAVE_LDFLAGS=$LDFLAGS
797 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
798 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
799 if test -n "$_HAVE_DEAD_STRIP" ; then
801 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
806 LDFLAGS=$_SAVE_LDFLAGS
809 MOZ_FIX_LINK_PATHS="-Wl,-executable_path,${DIST}/bin"
812 *-android*|*-linuxandroid*)
813 AC_DEFINE(NO_PW_GECOS)
815 if test "$COMPILE_ENVIRONMENT"; then
819 MOZ_GFX_OPTIMIZE_MOBILE=1
820 if test -z "$CLANG_CC"; then
821 MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions -Os"
823 # From https://github.com/android-ndk/ndk/issues/133#issuecomment-308549264
824 # -Oz is smaller than -Os on clang.
825 MOZ_OPTIMIZE_FLAGS="-Oz"
830 if test "$GNU_CC" -o "$GNU_CXX"; then
831 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
832 if test -n "$MOZ_DEBUG"; then
833 MOZ_OPTIMIZE_FLAGS="-Os"
835 MOZ_OPTIMIZE_FLAGS="-O2"
837 if test -z "$CLANG_CC"; then
838 MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
842 case "${target_cpu}" in
844 CFLAGS="$CFLAGS -mieee"
845 CXXFLAGS="$CXXFLAGS -mieee"
853 # certain versions of cygwin's makedepend barf on the
854 # #include <string> vs -I./dist/include/string issue so don't use it
855 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
859 CFLAGS="$CFLAGS -mms-bitfields"
860 CXXFLAGS="$CXXFLAGS -mms-bitfields"
862 MKSHLIB='$(CXX) $(DSO_LDOPTS) -o $@'
863 MKCSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
865 # Use static libgcc and libstdc++
866 LDFLAGS="$LDFLAGS -static"
867 # Use temp file for windres (bug 213281)
868 RCFLAGS='-O coff --use-temp-file'
869 # mingw doesn't require kernel32, user32, and advapi32 explicitly
870 LIBS="$LIBS -luuid -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32"
873 WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
874 WIN32_GUI_EXE_LDFLAGS=-mwindows
876 # GCC/binutils can't link to a function if we try to include dllexport function
877 # in the same library as dllimport caller. To work around it, we build NSPR
878 # and NSS with -mnop-fun-dllimport flag. The drawback of this solution is that
879 # function thunks need to be generated for cross-DLL calls.
880 MOZ_FOLD_LIBS_FLAGS="-mnop-fun-dllimport"
882 TARGET_COMPILER_ABI=msvc
883 if test "$AS_BIN"; then
884 AS="$(basename "$AS_BIN")"
887 AR_FLAGS='-NOLOGO -OUT:$@'
889 RANLIB='echo not_ranlib'
890 STRIP='echo not_strip'
892 MKSHLIB='$(LINKER) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
893 MKCSHLIB='$(LINKER) -NOLOGO -DLL -OUT:$@ -PDB:$(LINK_PDBFILE) $(DSO_LDOPTS)'
894 WIN32_SUBSYSTEM_VERSION=6.01
895 WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
896 WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
897 DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
898 _USE_CPP_INCLUDE_FLAG=1
899 _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
900 _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
901 CFLAGS="$CFLAGS -W3 -Gy -Zc:inline"
902 CXXFLAGS="$CXXFLAGS -W3 -Gy -Zc:inline"
903 if test -z "$CLANG_CL"; then
904 CPPFLAGS="$CPPFLAGS -utf-8"
906 if test "$CPU_ARCH" = "x86"; then
907 dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
908 dnl more recent, so set that explicitly here unless another
909 dnl target arch has already been set.
911 if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
912 CFLAGS="$CFLAGS -arch:SSE2"
914 if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
915 CXXFLAGS="$CXXFLAGS -arch:SSE2"
918 SSE_FLAGS="-arch:SSE"
919 SSE2_FLAGS="-arch:SSE2"
920 dnl MSVC allows the use of intrinsics without any flags
921 dnl and doesn't have a separate arch for SSSE3
922 SSSE3_FLAGS="-arch:SSE2"
924 dnl clang-cl requires appropriate flags to enable SSSE3 support
925 dnl on all architectures.
926 if test -n "$CLANG_CL"; then
927 SSSE3_FLAGS="-mssse3"
929 dnl VS2013+ supports -Gw for better linker optimizations.
930 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
931 dnl Disabled on ASan because it causes false-positive ODR violations.
932 if test -z "$MOZ_ASAN"; then
934 CXXFLAGS="$CXXFLAGS -Gw"
936 # khuey says we can safely ignore MSVC warning C4251
937 # MSVC warning C4244 (implicit type conversion may lose data) warns
938 # and requires workarounds for perfectly valid code. Also, GCC/clang
939 # don't warn about it by default. So for consistency/sanity, we turn
940 # it off on MSVC, too.
941 # MSVC warning C4267 warns for narrowing type conversions from size_t
942 # to 32-bit integer types on 64-bit platforms. Since this is virtually
943 # the same thing as C4244, we disable C4267, too.
944 # MSVC warning C4800 warns when a value is implicitly cast to bool,
945 # because this also forces narrowing to a single byte, which can be a
946 # perf hit. But this matters so little in practice (and often we want
947 # that behavior) that it's better to turn it off.
948 # MSVC warning C4595 warns non-member operator new or delete functions
949 # may not be declared inline, as of VS2015 Update 2.
950 CFLAGS="$CFLAGS -wd4244 -wd4267"
951 CXXFLAGS="$CXXFLAGS -wd4251 -wd4244 -wd4267 -wd4800 -wd4595"
952 if test -n "$CLANG_CL"; then
953 # XXX We should combine some of these with our generic GCC-style
956 # Suppress the clang-cl warning for the inline 'new' and 'delete' in mozalloc
957 CXXFLAGS="$CXXFLAGS -Wno-inline-new-delete"
958 # We use offsetof on non-POD objects all the time.
959 # We also suppress this warning on other platforms.
960 CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof"
961 # This warns for reasonable things like:
962 # enum { X = 0xffffffffU };
963 # which is annoying for IDL headers.
964 CXXFLAGS="$CXXFLAGS -Wno-microsoft-enum-value"
965 # This warns for cases that would be reached by the Microsoft
966 # #include rules, but also currently warns on cases that would
967 # *also* be reached by standard C++ include rules. That
968 # behavior doesn't seem useful, so we turn it off.
969 CXXFLAGS="$CXXFLAGS -Wno-microsoft-include"
970 # We normally error out on unknown pragmas, but since clang-cl
971 # claims to be MSVC, it would be difficult to add
972 # #if defined(_MSC_VER) && !defined(__clang__) everywhere we
973 # use such pragmas, so just ignore them.
974 CFLAGS="$CFLAGS -Wno-unknown-pragmas"
975 CXXFLAGS="$CXXFLAGS -Wno-unknown-pragmas"
976 # We get errors about various #pragma intrinsic directives from
977 # clang-cl, and we don't need to hear about those.
978 CFLAGS="$CFLAGS -Wno-ignored-pragmas"
979 CXXFLAGS="$CXXFLAGS -Wno-ignored-pragmas"
980 # clang-cl's Intrin.h marks things like _ReadWriteBarrier
981 # as __attribute((__deprecated__)). This is nice to know,
982 # but since we don't get the equivalent warning from MSVC,
983 # let's just ignore it.
984 CFLAGS="$CFLAGS -Wno-deprecated-declarations"
985 CXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations"
986 # We use a function like:
987 # __declspec(noreturn) __inline void f() {}
988 # which -Winvalid-noreturn complains about. Again, MSVC seems
989 # OK with it, so let's silence the warning.
990 CFLAGS="$CFLAGS -Wno-invalid-noreturn"
991 CXXFLAGS="$CXXFLAGS -Wno-invalid-noreturn"
992 # Missing |override| on virtual function declarations isn't
993 # something that MSVC currently warns about.
994 CXXFLAGS="$CXXFLAGS -Wno-inconsistent-missing-override"
995 # We use -DHAS_EXCEPTIONS=0, which removes the |throw()|
996 # declaration on |operator delete(void*)|. However, clang-cl
997 # must internally declare |operator delete(void*)| differently,
998 # which causes this warning for virtually every file in the
999 # tree. clang-cl doesn't support -fno-exceptions or equivalent,
1000 # so there doesn't seem to be any way to convince clang-cl to
1001 # declare |delete| differently. Therefore, suppress this
1003 CXXFLAGS="$CXXFLAGS -Wno-implicit-exception-spec-mismatch"
1004 # At least one MSVC header and several headers in-tree have
1005 # unused typedefs, so turn this on.
1006 CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedef"
1007 # jemalloc uses __declspec(allocator) as a profiler hint,
1008 # which clang-cl doesn't understand.
1009 CXXFLAGS="$CXXFLAGS -Wno-ignored-attributes"
1011 # make 'foo == bar;' error out
1012 CFLAGS="$CFLAGS -we4553"
1013 CXXFLAGS="$CXXFLAGS -we4553"
1014 # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
1015 CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
1016 LIBS="$LIBS kernel32.lib user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib"
1017 MOZ_DEBUG_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1018 WARNINGS_AS_ERRORS='-WX'
1019 # Use a higher optimization level for clang-cl, so we can come closer
1020 # to MSVC's performance numbers (see bug 1443590).
1021 if test -n "$CLANG_CL"; then
1022 MOZ_OPTIMIZE_FLAGS='-O2'
1024 MOZ_OPTIMIZE_FLAGS='-O1 -Oi'
1027 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE -NXCOMPAT"
1028 if test -z "$DEVELOPER_OPTIONS"; then
1029 LDFLAGS="$LDFLAGS -RELEASE"
1031 LDFLAGS="$LDFLAGS -DYNAMICBASE"
1033 dnl Minimum reqiurement of Gecko is VS2015 or later which supports
1034 dnl both SSSE3 and SSE4.1.
1035 HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1
1036 HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1
1037 dnl allow AVX2 code from VS2015
1040 AC_DEFINE(WIN32_LEAN_AND_MEAN)
1041 dnl See http://support.microsoft.com/kb/143208 to use STL
1044 MOZ_USER_DIR="Mozilla"
1048 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.])
1054 if test -n "$GNU_CC"; then
1055 CFLAGS="$CFLAGS -mstackrealign -fno-keep-inline-dllexport"
1056 CXXFLAGS="$CXXFLAGS -mstackrealign -fno-keep-inline-dllexport"
1057 LDFLAGS="$LDFLAGS -Wl,--enable-stdcall-fixup -Wl,--large-address-aware"
1059 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
1060 LDFLAGS="$LDFLAGS -SAFESEH"
1066 if test -n "$_WIN32_MSVC"; then
1067 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
1072 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
1079 CFLAGS="$CFLAGS -Dunix"
1080 CXXFLAGS="$CXXFLAGS -Dunix"
1081 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
1082 DSO_PIC_CFLAGS='-fPIC -DPIC'
1083 DSO_LDOPTS='-shared'
1084 MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
1086 DSO_PIC_CFLAGS='-fPIC -DPIC'
1087 DSO_LDOPTS='-shared'
1089 # This will fail on a.out systems prior to 1.5.1_ALPHA.
1090 if test "$LIBRUNPATH"; then
1091 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
1093 MKSHLIB='$(CXX) $(COMPUTED_CXX_LDFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(DSO_SONAME) -o $@'
1094 MKCSHLIB='$(CC) $(COMPUTED_C_LDFLAGS) $(DSO_PIC_CFLAGS) $(DSO_LDOPTS) -Wl,-soname,$(DSO_SONAME) -o $@'
1098 if test -z "$X11BASE"; then
1101 MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
1103 DSO_PIC_CFLAGS='-fPIC'
1104 DSO_LDOPTS='-shared -fPIC'
1105 if test "$LIBRUNPATH"; then
1106 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
1111 MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
1116 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
1117 MOZ_OPTIMIZE_FLAGS="-O"
1120 AC_SUBST_LIST(MMX_FLAGS)
1121 AC_SUBST_LIST(SSE_FLAGS)
1122 AC_SUBST_LIST(SSE2_FLAGS)
1123 AC_SUBST_LIST(SSSE3_FLAGS)
1125 AC_SUBST(MOZ_LINKER)
1126 if test -n "$MOZ_LINKER"; then
1127 AC_DEFINE(MOZ_LINKER)
1128 MOZ_LINKER_EXTRACT=1
1129 AC_CHECK_PROGS(XZ, xz)
1132 if test -z "$COMPILE_ENVIRONMENT"; then
1133 SKIP_COMPILER_CHECKS=1
1134 SKIP_LIBRARY_CHECKS=1
1139 fi # COMPILE_ENVIRONMENT
1141 if test -z "$SKIP_COMPILER_CHECKS"; then
1142 dnl Checks for typedefs, structures, and compiler characteristics.
1143 dnl ========================================================
1158 case "${OS_TARGET}" in
1162 STL_FLAGS="-I${DIST}/stl_wrappers"
1167 dnl Checks for header files.
1168 dnl ========================================================
1170 case "$target_os" in
1171 bitrig*|dragonfly*|freebsd*|openbsd*)
1172 # for stuff like -lXshm
1173 CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
1177 dnl Check for sin_len and sin6_len - used by SCTP; only appears in Mac/*BSD generally
1178 AC_CACHE_CHECK(for sockaddr_in.sin_len,
1179 ac_cv_sockaddr_in_sin_len,
1180 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
1181 #include <sys/types.h>
1183 #include <netinet/in.h>
1184 struct sockaddr_in x;
1185 void *foo = (void*) &x.sin_len;],
1187 [ac_cv_sockaddr_in_sin_len=true],
1188 [ac_cv_sockaddr_in_sin_len=false])])
1189 if test "$ac_cv_sockaddr_in_sin_len" = true ; then
1190 AC_DEFINE(HAVE_SIN_LEN)
1191 dnl HAVE_CONN_LEN must be the same as HAVE_SIN_LEN (and HAVE_SIN6_LEN too)
1192 AC_DEFINE(HAVE_SCONN_LEN)
1195 AC_CACHE_CHECK(for sockaddr_in6.sin6_len,
1196 ac_cv_sockaddr_in6_sin6_len,
1197 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
1198 #include <sys/types.h>
1200 #include <netinet/in.h>
1201 struct sockaddr_in6 x;
1202 void *foo = (void*) &x.sin6_len;],
1204 [ac_cv_sockaddr_in6_sin6_len=true],
1205 [ac_cv_sockaddr_in6_sin6_len=false])])
1206 if test "$ac_cv_sockaddr_in6_sin6_len" = true ; then
1207 AC_DEFINE(HAVE_SIN6_LEN)
1210 AC_CACHE_CHECK(for sockaddr.sa_len,
1211 ac_cv_sockaddr_sa_len,
1212 [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
1213 #include <sys/types.h>
1215 #include <sys/socket.h>
1217 void *foo = (void*) &x.sa_len;],
1219 [ac_cv_sockaddr_sa_len=true],
1220 [ac_cv_sockaddr_sa_len=false])])
1221 if test "$ac_cv_sockaddr_sa_len" = true ; then
1222 AC_DEFINE(HAVE_SA_LEN)
1225 MOZ_ARG_ENABLE_BOOL(dtrace,
1226 [ --enable-dtrace build with dtrace support if available (default=no)],
1227 [enable_dtrace="yes"],)
1228 if test "x$enable_dtrace" = "xyes"; then
1229 MOZ_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
1230 if test -n "$HAVE_DTRACE"; then
1231 AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
1233 AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
1236 AC_SUBST(HAVE_DTRACE)
1238 dnl Checks for libraries.
1239 dnl ========================================================
1240 AC_CHECK_LIB(c_r, gethostbyname_r)
1242 dnl We don't want to link with libdl even if it's present on OS X, since
1243 dnl it's not used and not part of the default installation. OS/2 has dlfcn
1245 dnl We don't want to link against libm or libpthread on Darwin since
1246 dnl they both are just symlinks to libSystem and explicitly linking
1247 dnl against libSystem causes issues when debugging (see bug 299601).
1252 AC_SEARCH_LIBS(dlopen, dl,
1253 MOZ_CHECK_HEADER(dlfcn.h,
1254 AC_DEFINE(HAVE_DLOPEN)))
1258 _SAVE_CFLAGS="$CFLAGS"
1259 CFLAGS="$CFLAGS -D_GNU_SOURCE"
1260 AC_CHECK_FUNCS(dladdr memmem)
1261 CFLAGS="$_SAVE_CFLAGS"
1263 if test ! "$GNU_CXX"; then
1264 AC_CHECK_LIB(C, demangle)
1267 AC_CHECK_LIB(socket, socket)
1270 XLIBS="$X_EXTRA_LIBS"
1272 dnl ========================================================
1273 dnl Checks for X libraries.
1274 dnl Ordering is important.
1275 dnl Xt is dependent upon SM as of X11R6
1276 dnl ========================================================
1277 if test -n "$MOZ_X11"; then
1278 AC_DEFINE_UNQUOTED(FUNCPROTO,15)
1279 _SAVE_LDFLAGS="$LDFLAGS"
1281 LDFLAGS="$XLDFLAGS $LDFLAGS"
1282 AC_CHECK_LIB(X11, XDrawLines, [XLIBS="-lX11 $XLIBS"],
1283 [MISSING_X="$MISSING_X -lX11"], $XLIBS)
1284 AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
1285 [MISSING_X="$MISSING_X -lXext"], $XLIBS)
1287 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
1288 unset ac_cv_lib_Xt_XtFree
1289 AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
1290 AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
1291 AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
1292 [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
1295 dnl ========================================================
1297 dnl ========================================================
1298 AC_CHECK_LIB(xcb, xcb_connect, [XLIBS="-lxcb $XLIBS"],
1299 [MISSING_X="$MISSING_X -lxcb"], $XLIBS)
1300 AC_CHECK_LIB(xcb-shm, xcb_shm_query_version, [XLIBS="-lxcb-shm $XLIBS"],
1301 [MISSING_X="$MISSING_X -lxcb-shm"], $XLIBS)
1302 AC_CHECK_LIB(X11-xcb, XGetXCBConnection, [XLIBS="-lX11-xcb $XLIBS"],
1303 [MISSING_X="$MISSING_X -lX11-xcb"], $XLIBS)
1305 LDFLAGS="$_SAVE_LDFLAGS"
1309 AC_SUBST_LIST(XCFLAGS)
1310 AC_SUBST_LIST(XLDFLAGS)
1311 AC_SUBST_LIST(XLIBS)
1312 AC_SUBST_LIST(XEXT_LIBS)
1313 AC_SUBST_LIST(XT_LIBS)
1315 dnl ========================================================
1316 dnl = pthread support
1317 dnl = Start by checking whether the system support pthreads
1318 dnl ========================================================
1319 case "$target_os" in
1324 AC_CHECK_LIB(pthreads, pthread_create,
1325 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
1326 AC_CHECK_LIB(pthread, pthread_create,
1327 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
1328 AC_CHECK_LIB(c_r, pthread_create,
1329 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
1330 AC_CHECK_LIB(c, pthread_create,
1339 dnl ========================================================
1340 dnl Check the command line for --with-pthreads
1341 dnl ========================================================
1342 MOZ_ARG_WITH_BOOL(pthreads,
1343 [ --with-pthreads Force use of system pthread library with NSPR ],
1344 [ if test "$MOZ_USE_PTHREADS"x = x; then
1345 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
1351 dnl ========================================================
1352 dnl Do the platform specific pthread hackery
1353 dnl ========================================================
1354 if test "$MOZ_USE_PTHREADS"x != x
1357 dnl See if -pthread is supported.
1360 ac_cv_have_dash_pthread=no
1361 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
1362 echo 'int main() { return 0; }' | cat > conftest.c
1363 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
1364 if test $? -eq 0; then
1365 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
1366 ac_cv_have_dash_pthread=yes
1367 case "$target_os" in
1369 # Freebsd doesn't use -pthread for compiles, it uses them for linking
1372 CFLAGS="$CFLAGS -pthread"
1373 CXXFLAGS="$CXXFLAGS -pthread"
1379 AC_MSG_RESULT($ac_cv_have_dash_pthread)
1382 dnl See if -pthreads is supported.
1384 ac_cv_have_dash_pthreads=no
1385 if test "$ac_cv_have_dash_pthread" = "no"; then
1386 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
1387 echo 'int main() { return 0; }' | cat > conftest.c
1388 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
1389 if test $? -eq 0; then
1390 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
1391 ac_cv_have_dash_pthreads=yes
1392 CFLAGS="$CFLAGS -pthreads"
1393 CXXFLAGS="$CXXFLAGS -pthreads"
1397 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
1402 AC_DEFINE(_REENTRANT)
1403 AC_DEFINE(_THREAD_SAFE)
1404 dnl -pthread links in -lpthread, so don't specify it explicitly.
1405 if test "$ac_cv_have_dash_pthread" = "yes"; then
1406 _PTHREAD_LDFLAGS="-pthread"
1410 *-*-openbsd*|*-*-bsdi*)
1411 AC_DEFINE(_REENTRANT)
1412 AC_DEFINE(_THREAD_SAFE)
1413 dnl -pthread links in -lc_r, so don't specify it explicitly.
1414 if test "$ac_cv_have_dash_pthread" = "yes"; then
1415 _PTHREAD_LDFLAGS="-pthread"
1419 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
1420 AC_DEFINE(_REENTRANT)
1424 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
1425 AC_SUBST(MOZ_USE_PTHREADS)
1426 MOZ_CHECK_HEADERS(pthread.h)
1430 dnl Checks for library functions.
1431 dnl ========================================================
1432 AC_PROG_GCC_TRADITIONAL
1434 AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize gmtime_r localtime_r arc4random arc4random_buf mallinfo gettid lchown setpriority strerror syscall)
1436 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
1437 dnl avoid this on Darwin, since depending on your system config, we may think
1438 dnl it exists but it really doesn't
1439 case "$OS_TARGET" in
1443 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
1444 ac_cv_clock_monotonic,
1445 [for libs in "" -lrt; do
1448 AC_TRY_LINK([#include <time.h>],
1449 [ struct timespec ts;
1450 clock_gettime(CLOCK_MONOTONIC, &ts); ],
1451 ac_cv_clock_monotonic=$libs
1454 ac_cv_clock_monotonic=no)
1457 if test "$ac_cv_clock_monotonic" != "no"; then
1458 HAVE_CLOCK_MONOTONIC=1
1459 REALTIME_LIBS=$ac_cv_clock_monotonic
1460 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
1461 AC_SUBST(HAVE_CLOCK_MONOTONIC)
1462 AC_SUBST_LIST(REALTIME_LIBS)
1467 AC_CACHE_CHECK(for pthread_cond_timedwait_monotonic_np,
1468 ac_cv_pthread_cond_timedwait_monotonic_np,
1469 AC_TRY_LINK([#include <pthread.h>],
1470 [pthread_cond_timedwait_monotonic_np(0, 0, 0);],
1471 ac_cv_pthread_cond_timewait_monotonic_np=yes,
1472 ac_cv_pthread_cond_timewait_monotonic_np=no))
1473 if test "$ac_cv_pthread_cond_timewait_monotonic_np" != "no"; then
1474 AC_DEFINE(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)
1479 ac_cv_func_res_ninit,
1480 [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
1481 dnl no need for res_ninit() on NetBSD and OpenBSD
1482 ac_cv_func_res_ninit=no
1486 #define _BSD_SOURCE 1
1488 #include <sys/types.h>
1489 #include <netinet/in.h>
1490 #include <arpa/nameser.h>
1493 [int foo = res_ninit(&_res);],
1494 [ac_cv_func_res_ninit=yes],
1495 [ac_cv_func_res_ninit=no])
1499 if test "$ac_cv_func_res_ninit" = "yes"; then
1500 AC_DEFINE(HAVE_RES_NINIT)
1501 dnl must add the link line we do something as foolish as this... dougt
1503 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
1504 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
1509 dnl **********************
1510 dnl *** va_copy checks ***
1511 AC_CACHE_CHECK([for an implementation of va_copy()],
1513 [AC_TRY_COMPILE([#include <stdarg.h>
1515 void f (int i, ...) {
1516 va_list args1, args2;
1517 va_start (args1, i);
1518 va_copy (args2, args1);
1519 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
1521 va_end (args1); va_end (args2);
1523 [f(0, 42); return 0],
1524 [ac_cv_va_copy=yes],
1528 AC_CACHE_CHECK([whether va_list can be copied by value],
1530 [AC_TRY_COMPILE([#include <stdarg.h>
1532 void f (int i, ...) {
1533 va_list args1, args2;
1534 va_start (args1, i);
1536 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
1538 va_end (args1); va_end (args2);
1540 [f(0, 42); return 0],
1541 [ac_cv_va_val_copy=yes],
1542 [ac_cv_va_val_copy=no],
1545 if test "x$ac_cv_va_copy" = "xyes"; then
1546 AC_DEFINE(VA_COPY, va_copy)
1547 AC_DEFINE(HAVE_VA_COPY)
1550 if test "x$ac_cv_va_val_copy" = "xno"; then
1551 AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
1554 dnl ===================================================================
1555 dnl ========================================================
1556 dnl Put your C++ language/feature checks below
1557 dnl ========================================================
1561 if test "$GNU_CC"; then
1562 if test "$CPU_ARCH" = "arm" ; then
1563 AC_CACHE_CHECK(for ARM EABI,
1567 #if defined(__ARM_EABI__)
1570 #error Not ARM EABI.
1573 ac_cv_gcc_arm_eabi="yes",
1574 ac_cv_gcc_arm_eabi="no")])
1575 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
1577 ARM_ABI_PREFIX=eabi-
1579 ARM_ABI_PREFIX=oabi-
1583 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
1586 dnl See if a dynamic_cast to void* gives the most derived object.
1587 AC_CACHE_CHECK(for C++ dynamic_cast to void*,
1588 ac_cv_cpp_dynamic_cast_void_ptr,
1589 [AC_TRY_RUN([class X { int i; public: virtual ~X() { } };
1590 class Y { int j; public: virtual ~Y() { } };
1591 class Z : public X, public Y { int k; };
1597 return !((((void*)&mdo != (void*)subx) &&
1598 ((void*)&mdo == dynamic_cast<void*>(subx))) ||
1599 (((void*)&mdo != (void*)suby) &&
1600 ((void*)&mdo == dynamic_cast<void*>(suby))));
1602 ac_cv_cpp_dynamic_cast_void_ptr=yes,
1603 ac_cv_cpp_dynamic_cast_void_ptr=no,
1604 ac_cv_cpp_dynamic_cast_void_ptr=no)])
1605 if test "$ac_cv_cpp_dynamic_cast_void_ptr" = yes ; then
1606 AC_DEFINE(HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR)
1610 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
1611 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
1612 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
1614 _SAVE_LDFLAGS=$LDFLAGS
1615 LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
1616 AC_CACHE_CHECK(for __thread keyword for TLS variables,
1617 ac_cv_thread_keyword,
1618 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
1619 [return tlsIsMainThread;],
1620 ac_cv_thread_keyword=yes,
1621 ac_cv_thread_keyword=no)])
1622 LDFLAGS=$_SAVE_LDFLAGS
1623 # The custom dynamic linker doesn't support TLS variables
1625 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
1626 # mips builds fail with TLS variables because of a binutils bug.
1628 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
1633 *-android*|*-linuxandroid*)
1640 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
1646 dnl Using the custom linker on ARMv6 requires 16k alignment of ELF segments.
1647 if test -n "$MOZ_LINKER"; then
1648 if test "$CPU_ARCH" = arm; then
1649 dnl When building for < ARMv7, we need to ensure 16k alignment of ELF segments
1650 if test -n "$ARM_ARCH" && test "$ARM_ARCH" -lt 7; then
1651 LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000"
1652 _SUBDIR_LDFLAGS="$_SUBDIR_LDFLAGS -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000"
1656 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
1657 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
1658 dnl Since the linker only understands the sysv ones, no need to build the
1659 dnl gnu style tables anyways.
1660 LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
1663 dnl End of C++ language/feature checks
1666 dnl ========================================================
1667 dnl = Internationalization checks
1668 dnl ========================================================
1670 dnl Internationalization and Locale support is different
1671 dnl on various UNIX platforms. Checks for specific i18n
1672 dnl features go here.
1674 AC_HAVE_FUNCS(localeconv)
1676 fi # ! SKIP_COMPILER_CHECKS
1678 if test -n "${COMPILE_ENVIRONMENT}"; then
1683 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
1684 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
1685 AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
1688 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
1689 dnl features that Windows actually does support.
1691 if test -n "$SKIP_COMPILER_CHECKS"; then
1692 dnl Windows has malloc.h
1693 AC_DEFINE(MALLOC_H, [<malloc.h>])
1694 AC_DEFINE(HAVE_FORCEINLINE)
1695 AC_DEFINE(HAVE_LOCALECONV)
1696 fi # SKIP_COMPILER_CHECKS
1698 dnl Mozilla specific options
1699 dnl ========================================================
1700 dnl The macros used for command line options
1701 dnl are defined in build/autoconf/altoptions.m4.
1703 dnl ========================================================
1705 dnl = Check for external package dependencies
1707 dnl ========================================================
1708 MOZ_ARG_HEADER(External Packages)
1710 case "$OS_TARGET" in
1711 WINNT|Darwin|Android)
1721 dnl ========================================================
1722 dnl system libevent Support
1723 dnl ========================================================
1724 MOZ_ARG_WITH_STRING(system-libevent,
1725 [ --with-system-libevent[=PFX]
1726 Use system libevent [installed at prefix PFX]],
1727 LIBEVENT_DIR=$withval)
1729 _SAVE_CFLAGS=$CFLAGS
1730 _SAVE_LDFLAGS=$LDFLAGS
1732 if test "$LIBEVENT_DIR" = yes; then
1733 PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
1734 MOZ_SYSTEM_LIBEVENT=1,
1737 if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
1738 MOZ_SYSTEM_LIBEVENT=
1739 elif test -z "$MOZ_SYSTEM_LIBEVENT"; then
1740 CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
1741 LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
1742 MOZ_CHECK_HEADER(event.h,
1743 [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
1744 AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
1746 AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
1747 AC_CHECK_LIB(event, event_init,
1748 [MOZ_SYSTEM_LIBEVENT=1
1749 MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
1750 MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
1751 [MOZ_SYSTEM_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
1753 CFLAGS=$_SAVE_CFLAGS
1754 LDFLAGS=$_SAVE_LDFLAGS
1757 AC_SUBST(MOZ_SYSTEM_LIBEVENT)
1759 dnl ========================================================
1760 dnl = If NSS was not detected in the system,
1761 dnl = use the one in the source tree (mozilla/security/nss)
1762 dnl ========================================================
1764 MOZ_ARG_WITH_BOOL(system-nss,
1765 [ --with-system-nss Use system installed NSS],
1768 if test -n "$_USE_SYSTEM_NSS"; then
1769 AM_PATH_NSS(3.36, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
1772 if test -z "$MOZ_SYSTEM_NSS"; then
1773 NSS_CFLAGS="-I${DIST}/include/nss"
1774 case "${OS_ARCH}" in
1775 # Only few platforms have been tested with GYP
1776 WINNT|Darwin|Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|SunOS)
1779 AC_MSG_ERROR([building in-tree NSS is not supported on this platform. Use --with-system-nss])
1784 if test -z "$SKIP_LIBRARY_CHECKS"; then
1785 dnl system JPEG support
1786 dnl ========================================================
1787 MOZ_ARG_WITH_STRING(system-jpeg,
1788 [ --with-system-jpeg[=PFX]
1789 Use system libjpeg [installed at prefix PFX]],
1792 _SAVE_CFLAGS=$CFLAGS
1793 _SAVE_LDFLAGS=$LDFLAGS
1795 if test -n "${JPEG_DIR}" -a "${JPEG_DIR}" != "yes"; then
1796 CFLAGS="-I${JPEG_DIR}/include $CFLAGS"
1797 LDFLAGS="-L${JPEG_DIR}/lib $LDFLAGS"
1799 if test -z "$JPEG_DIR" -o "$JPEG_DIR" = no; then
1802 AC_CHECK_LIB(jpeg, jpeg_destroy_compress, [MOZ_SYSTEM_JPEG=1 MOZ_JPEG_LIBS="-ljpeg"], MOZ_SYSTEM_JPEG=)
1805 if test "$MOZ_SYSTEM_JPEG" = 1; then
1806 AC_TRY_COMPILE([ #include <stdio.h>
1807 #include <sys/types.h>
1808 #include <jpeglib.h> ],
1809 [ #if JPEG_LIB_VERSION < $MOZJPEG
1810 #error "Insufficient JPEG library version ($MOZJPEG required)."
1812 #ifndef JCS_EXTENSIONS
1813 #error "libjpeg-turbo JCS_EXTENSIONS required"
1817 AC_MSG_ERROR([Insufficient JPEG library version for --with-system-jpeg]))
1819 CFLAGS=$_SAVE_CFLAGS
1820 LDFLAGS=$_SAVE_LDFLAGS
1823 if test -n "${JPEG_DIR}" -a -d "${JPEG_DIR}" -a "$MOZ_SYSTEM_JPEG" = 1; then
1824 MOZ_JPEG_CFLAGS="-I${JPEG_DIR}/include"
1825 MOZ_JPEG_LIBS="-L${JPEG_DIR}/lib ${MOZ_JPEG_LIBS}"
1827 fi # SKIP_LIBRARY_CHECKS
1829 dnl system ZLIB support
1830 dnl ========================================================
1831 MOZ_ZLIB_CHECK([1.2.3])
1833 if test -z "$SKIP_LIBRARY_CHECKS"; then
1834 dnl system BZIP2 Support
1835 dnl ========================================================
1836 MOZ_ARG_WITH_STRING(system-bz2,
1837 [ --with-system-bz2[=PFX]
1838 Use system libbz2 [installed at prefix PFX]],
1841 _SAVE_CFLAGS=$CFLAGS
1842 _SAVE_LDFLAGS=$LDFLAGS
1844 if test -n "${BZ2_DIR}" -a "${BZ2_DIR}" != "yes"; then
1845 CFLAGS="-I${BZ2_DIR}/include $CFLAGS"
1846 LDFLAGS="-L${BZ2_DIR}/lib $LDFLAGS"
1848 if test -z "$BZ2_DIR" -o "$BZ2_DIR" = no; then
1851 AC_CHECK_LIB(bz2, BZ2_bzread, [MOZ_SYSTEM_BZ2=1 MOZ_BZ2_LIBS="-lbz2"],
1852 [MOZ_SYSTEM_BZ2= MOZ_BZ2_CFLAGS= MOZ_BZ2_LIBS=])
1854 CFLAGS=$_SAVE_CFLAGS
1855 LDFLAGS=$_SAVE_LDFLAGS
1858 if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$MOZ_SYSTEM_BZ2" = 1; then
1859 MOZ_BZ2_CFLAGS="-I${BZ2_DIR}/include"
1860 MOZ_BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
1863 dnl ========================================================
1864 dnl system PNG Support
1865 dnl ========================================================
1866 MOZ_ARG_WITH_STRING(system-png,
1867 [ --with-system-png[=PFX]
1868 Use system libpng [installed at prefix PFX]],
1871 _SAVE_CFLAGS=$CFLAGS
1872 _SAVE_LDFLAGS=$LDFLAGS
1874 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
1875 CFLAGS="-I${PNG_DIR}/include $CFLAGS"
1876 LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
1878 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
1881 AC_CHECK_LIB(png, png_get_valid, [MOZ_SYSTEM_PNG=1 MOZ_PNG_LIBS="-lpng"],
1882 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
1883 AC_CHECK_LIB(png, png_get_acTL, ,
1884 AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]))
1886 if test "$MOZ_SYSTEM_PNG" = 1; then
1887 AC_TRY_COMPILE([ #include <stdio.h>
1888 #include <sys/types.h>
1890 [ #if PNG_LIBPNG_VER < $MOZPNG
1891 #error "Insufficient libpng version ($MOZPNG required)."
1893 #ifndef PNG_UINT_31_MAX
1894 #error "Insufficient libpng version."
1897 AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
1899 CFLAGS=$_SAVE_CFLAGS
1900 LDFLAGS=$_SAVE_LDFLAGS
1903 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_SYSTEM_PNG" = 1; then
1904 MOZ_PNG_CFLAGS="-I${PNG_DIR}/include"
1905 MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}"
1908 fi # SKIP_LIBRARY_CHECKS
1910 dnl ========================================================
1914 dnl ========================================================
1916 MOZ_ARG_HEADER(Application)
1918 ENABLE_SYSTEM_EXTENSION_DIRS=1
1919 MOZ_BRANDING_DIRECTORY=
1920 MOZ_OFFICIAL_BRANDING=
1922 MOZ_AUTH_EXTENSION=1
1923 if test "$MOZ_IOS"; then
1929 MOZ_SAMPLE_TYPE_FLOAT32=
1930 MOZ_SAMPLE_TYPE_S16=
1932 MOZ_WEBRTC_HARDWARE_AEC_NS=
1940 LIBJPEG_TURBO_ASFLAGS=
1941 MOZ_PREF_EXTENSIONS=1
1944 MOZ_TOOLKIT_SEARCH=1
1945 MOZ_UNIVERSALCHARDET=1
1950 MOZ_USE_NATIVE_POPUP_WINDOWS=
1951 MOZ_EXCLUDE_HYPHENATION_DICTIONARIES=
1953 MOZ_CONTENT_SANDBOX=
1956 MOZ_BINARY_EXTENSIONS=
1959 case "$target_os" in
1962 AC_DEFINE(NS_ENABLE_TSF)
1967 *-android*|*-linuxandroid*)
1973 # Optional Firefox for Android partner distribution directory.
1974 MOZ_ARG_WITH_STRING(android-distribution-directory,
1975 [ --with-android-distribution-directory=dir
1976 Optional Firefox for Android partner distribution directory.],
1977 MOZ_ANDROID_DISTRIBUTION_DIRECTORY=$withval)
1979 if test -n "$MOZ_ANDROID_DISTRIBUTION_DIRECTORY"; then
1980 # A distribution directory must have an assets/distribution directory.
1981 # See https://wiki.mozilla.org/Mobile/Distribution_Files.
1982 if test ! -d "$MOZ_ANDROID_DISTRIBUTION_DIRECTORY/assets/distribution" ; then
1983 AC_MSG_ERROR([--with-android-distribution-directory does not contain assets/distribution;
1984 (looked for ${MOZ_ANDROID_DISTRIBUTION_DIRECTORY}/assets/distribution).])
1987 AC_SUBST(MOZ_ANDROID_DISTRIBUTION_DIRECTORY)
1989 dnl ========================================================
1990 dnl = Trademarked Branding
1991 dnl ========================================================
1992 MOZ_ARG_ENABLE_BOOL(official-branding,
1993 [ --enable-official-branding
1994 Enable Official mozilla.org Branding
1995 Do not distribute builds with
1996 --enable-official-branding unless you have
1997 permission to use trademarks per
1998 http://www.mozilla.org/foundation/trademarks/ .],
1999 MOZ_OFFICIAL_BRANDING=1,
2000 MOZ_OFFICIAL_BRANDING=)
2002 # Allow the application to influence configure with a confvars.sh script.
2003 AC_MSG_CHECKING([if app-specific confvars.sh exists])
2004 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
2005 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
2006 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
2011 # Allow influencing configure with a defines.sh script.
2012 . "${srcdir}/build/defines.sh"
2014 # If we're not building a release build, define EARLY_BETA_OR_EARLIER if it is
2016 if test "$BUILDING_RELEASE"; then
2017 # Override value in defines.sh, if any
2018 EARLY_BETA_OR_EARLIER=
2019 elif test "$EARLY_BETA_OR_EARLIER"; then
2020 AC_DEFINE(EARLY_BETA_OR_EARLIER)
2022 AC_SUBST(EARLY_BETA_OR_EARLIER)
2024 # Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
2025 MOZ_ARG_WITH_STRING(app-name,
2026 [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
2027 WITH_APP_NAME=$withval,
2030 if test -n "$WITH_APP_NAME" ; then
2031 MOZ_APP_NAME="$WITH_APP_NAME"
2034 MOZ_ARG_WITH_STRING(app-basename,
2035 [--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
2036 WITH_APP_BASENAME=$withval,
2039 if test -n "$WITH_APP_BASENAME" ; then
2040 MOZ_APP_BASENAME="$WITH_APP_BASENAME"
2043 # Special cases where we need to AC_DEFINE something. Also a holdover for apps
2044 # that haven't made a confvars.sh yet. Don't add new stuff here, use
2046 case "$MOZ_BUILD_APP" in
2048 AC_DEFINE(MOZ_PHOENIX)
2052 AC_DEFINE(MOZ_XULRUNNER)
2056 # Graphene is a desktop runtime for running applications with a HTML UI.
2057 if test -n "$MOZ_GRAPHENE"; then
2058 AC_DEFINE(MOZ_GRAPHENE)
2061 if test -n "$MOZ_MULET"; then
2062 AC_DEFINE(MOZ_MULET)
2065 AC_SUBST(MOZ_PHOENIX)
2066 AC_SUBST(MOZ_XULRUNNER)
2069 dnl ========================================================
2070 dnl Ensure Android SDK and build-tools versions depending on
2072 dnl ========================================================
2074 case "$MOZ_BUILD_APP" in
2076 MOZ_ANDROID_SDK(23, 23, 26.0.2, 26.0.0 26.0.0-dev 25.3.2 25.3.1)
2080 dnl ========================================================
2082 dnl = Toolkit Options
2084 dnl ========================================================
2085 MOZ_ARG_HEADER(Toolkit Options)
2087 dnl ========================================================
2088 dnl = Enable the toolkit as needed =
2089 dnl ========================================================
2091 case "$MOZ_WIDGET_TOOLKIT" in
2094 LDFLAGS="$LDFLAGS -framework Cocoa -lobjc"
2095 # Use -Wl as a trick to avoid -framework and framework names from
2096 # being separated by AC_SUBST_LIST.
2097 TK_LIBS='-Wl,-framework,Foundation -Wl,-framework,CoreFoundation -Wl,-framework,CoreLocation -Wl,-framework,QuartzCore -Wl,-framework,Carbon -Wl,-framework,CoreAudio -Wl,-framework,CoreVideo -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,AddressBook -Wl,-framework,OpenGL -Wl,-framework,Security -Wl,-framework,ServiceManagement -Wl,-framework,CoreServices -Wl,-framework,ApplicationServices -Wl,-framework,AppKit'
2099 CFLAGS="$CFLAGS $TK_CFLAGS"
2100 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
2101 MOZ_USER_DIR="Mozilla"
2102 MOZ_FS_LAYOUT=bundle
2106 LDFLAGS="$LDFLAGS -framework UIKit -lobjc"
2108 TK_LIBS='-Wl,-framework,Foundation -Wl,-framework,CoreFoundation -Wl,-framework,CoreGraphics -Wl,-framework,CoreText -Wl,-framework,AVFoundation -Wl,-framework,AudioToolbox -Wl,-framework,CoreMedia -Wl,-framework,CoreVideo -Wl,-framework,OpenGLES -Wl,-framework,QuartzCore'
2109 CFLAGS="$CFLAGS $TK_CFLAGS"
2110 CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
2111 MOZ_USER_DIR="Mozilla"
2112 MOZ_FS_LAYOUT=bundle
2117 dnl there are a lot of tests on MOZ_ENABLE_GTK below, that are more convenient
2118 dnl to keep that way than testing against MOZ_WIDGET_TOOLKIT
2119 case "$MOZ_WIDGET_TOOLKIT" in
2125 if test "$COMPILE_ENVIRONMENT"; then
2126 if test "$MOZ_WIDGET_TOOLKIT" = gtk3; then
2127 PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 $GDK_PACKAGES)
2128 MOZ_GTK3_CFLAGS="-I${_topsrcdir}/widget/gtk/compat-gtk3 $MOZ_GTK3_CFLAGS"
2129 TK_CFLAGS=$MOZ_GTK3_CFLAGS
2130 TK_LIBS=$MOZ_GTK3_LIBS
2131 dnl GDK_VERSION_MIN_REQUIRED is not set here as GDK3 deprecated warnings
2132 dnl are suppressed by widget/gtk/compat-gtk3/gdk/gdkversionmacros.h.
2133 AC_DEFINE_UNQUOTED(GDK_VERSION_MAX_ALLOWED,$GDK_VERSION_MAX_ALLOWED)
2134 GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32
2136 if test "$MOZ_WIDGET_TOOLKIT" = gtk2; then
2137 GLIB_VERSION_MAX_ALLOWED=$GLIB_VERSION_MIN_REQUIRED
2139 if test "$MOZ_ENABLE_GTK"; then
2140 if test "$MOZ_X11"; then
2141 GDK_PACKAGES=gdk-x11-2.0
2143 AC_DEFINE_UNQUOTED(GLIB_VERSION_MIN_REQUIRED,$GLIB_VERSION_MIN_REQUIRED)
2144 AC_DEFINE_UNQUOTED(GLIB_VERSION_MAX_ALLOWED,$GLIB_VERSION_MAX_ALLOWED)
2146 PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 $GDK_PACKAGES)
2147 MOZ_GTK2_CFLAGS="-I${_topsrcdir}/widget/gtk/compat $MOZ_GTK2_CFLAGS"
2149 if test "$MOZ_WIDGET_TOOLKIT" = gtk2; then
2150 TK_CFLAGS=$MOZ_GTK2_CFLAGS
2151 TK_LIBS=$MOZ_GTK2_LIBS
2153 fi # COMPILE_ENVIRONMENT
2155 AC_SUBST(MOZ_FS_LAYOUT)
2157 dnl ========================================================
2158 dnl = startup-notification support module
2159 dnl ========================================================
2161 if test "$MOZ_ENABLE_GTK"
2163 MOZ_ENABLE_STARTUP_NOTIFICATION=
2165 MOZ_ARG_ENABLE_BOOL(startup-notification,
2166 [ --enable-startup-notification
2167 Enable startup-notification support (default: disabled) ],
2168 MOZ_ENABLE_STARTUP_NOTIFICATION=force,
2169 MOZ_ENABLE_STARTUP_NOTIFICATION=)
2170 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"
2172 PKG_CHECK_MODULES(MOZ_STARTUP_NOTIFICATION,
2173 libstartup-notification-1.0 >= $STARTUP_NOTIFICATION_VERSION,
2174 [MOZ_ENABLE_STARTUP_NOTIFICATION=1], [
2175 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION" = "force"
2177 AC_MSG_ERROR([* * * Could not find startup-notification >= $STARTUP_NOTIFICATION_VERSION])
2179 MOZ_ENABLE_STARTUP_NOTIFICATION=
2183 if test "$MOZ_ENABLE_STARTUP_NOTIFICATION"; then
2184 AC_DEFINE(MOZ_ENABLE_STARTUP_NOTIFICATION)
2187 TK_LIBS="$TK_LIBS $MOZ_STARTUP_NOTIFICATION_LIBS"
2189 AC_SUBST(MOZ_ENABLE_STARTUP_NOTIFICATION)
2191 AC_SUBST_LIST(TK_CFLAGS)
2192 AC_SUBST_LIST(TK_LIBS)
2197 dnl ========================================================
2199 dnl = Components & Features
2201 dnl ========================================================
2202 MOZ_ARG_HEADER(Components and Features)
2204 AC_SUBST(MOZ_OFFICIAL_BRANDING)
2205 if test -n "$MOZ_OFFICIAL_BRANDING"; then
2206 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
2207 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
2209 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
2210 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
2214 MOZ_ARG_WITH_STRING(branding,
2215 [ --with-branding=dir Use branding from the specified directory.],
2216 MOZ_BRANDING_DIRECTORY=$withval)
2218 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
2219 if test -z "$REAL_BRANDING_DIRECTORY"; then
2220 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
2223 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
2224 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
2225 elif test -f "${EXTERNAL_SOURCE_DIR}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
2226 . "${EXTERNAL_SOURCE_DIR}/$REAL_BRANDING_DIRECTORY/configure.sh"
2229 AC_SUBST(MOZ_BRANDING_DIRECTORY)
2231 dnl ========================================================
2232 dnl = Distribution ID
2233 dnl ========================================================
2234 MOZ_ARG_WITH_STRING(distribution-id,
2235 [ --with-distribution-id=ID
2236 Set distribution-specific id (default=org.mozilla)],
2237 [ val=`echo $withval`
2238 MOZ_DISTRIBUTION_ID="$val"])
2240 if test -z "$MOZ_DISTRIBUTION_ID"; then
2241 MOZ_DISTRIBUTION_ID="org.mozilla"
2244 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
2245 AC_SUBST(MOZ_DISTRIBUTION_ID)
2247 dnl ========================================================
2248 dnl = GConf support module
2249 dnl ========================================================
2253 if test "$MOZ_ENABLE_GTK"
2258 dnl ========================================================
2259 dnl = GConf support module
2260 dnl ========================================================
2261 MOZ_ARG_DISABLE_BOOL(gconf,
2262 [ --disable-gconf Disable Gconf support ],
2266 if test "$MOZ_ENABLE_GCONF"
2268 PKG_CHECK_MODULES(MOZ_GCONF, gconf-2.0 >= $GCONF_VERSION gobject-2.0 ,[
2269 MOZ_GCONF_LIBS=`$PKG_CONFIG --libs gobject-2.0`
2272 if test -n "$MOZ_ENABLE_GCONF";
2274 AC_MSG_ERROR([* * * Could not find gconf-2.0 ])
2276 AC_MSG_WARN([Many automated tests will fail with --disable-gconf. See bug 1167201.])
2281 if test "$MOZ_ENABLE_GCONF"; then
2282 AC_DEFINE(MOZ_ENABLE_GCONF)
2285 AC_SUBST(MOZ_ENABLE_GCONF)
2288 dnl ========================================================
2289 dnl = libproxy support
2290 dnl ========================================================
2292 if test "$MOZ_ENABLE_GTK"
2294 MOZ_ENABLE_LIBPROXY=
2296 MOZ_ARG_ENABLE_BOOL(libproxy,
2297 [ --enable-libproxy Enable libproxy support ],
2298 MOZ_ENABLE_LIBPROXY=1,
2299 MOZ_ENABLE_LIBPROXY=)
2301 if test "$MOZ_ENABLE_LIBPROXY"
2303 PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
2304 AC_DEFINE(MOZ_ENABLE_LIBPROXY)
2307 AC_SUBST(MOZ_ENABLE_LIBPROXY)
2309 dnl ========================================================
2311 dnl ========================================================
2313 if test "$MOZ_ENABLE_GTK"
2317 MOZ_ARG_DISABLE_BOOL(dbus,
2318 [ --disable-dbus Disable dbus support ],
2322 if test "$MOZ_ENABLE_DBUS"
2324 PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION)
2325 PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
2326 AC_DEFINE(MOZ_ENABLE_DBUS)
2329 AC_SUBST(MOZ_ENABLE_DBUS)
2331 dnl =========================================================
2332 dnl = Whether to exclude hyphenations files in the build
2333 dnl =========================================================
2334 if test -n "$MOZ_EXCLUDE_HYPHENATION_DICTIONARIES"; then
2335 AC_DEFINE(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
2338 dnl ========================================================
2339 dnl accessibility support on by default on all platforms
2340 dnl ========================================================
2341 MOZ_ARG_DISABLE_BOOL(accessibility,
2342 [ --disable-accessibility Disable accessibility support],
2345 if test "$ACCESSIBILITY"; then
2348 if test -z "$MIDL"; then
2349 if test "$GCC" != "yes"; then
2350 AC_MSG_ERROR([MIDL could not be found. Building accessibility without MIDL is not supported.])
2352 AC_MSG_ERROR([You have accessibility enabled, but widl could not be found. Add --disable-accessibility to your mozconfig or install widl. See https://developer.mozilla.org/en-US/docs/Cross_Compile_Mozilla_for_Mingw32 for details.])
2356 AC_DEFINE(ACCESSIBILITY)
2359 dnl ========================================================
2360 dnl Accessibility is required for the linuxgl widget
2362 dnl ========================================================
2363 if test "${MOZ_WIDGET_TOOLKIT}" = "linuxgl" -a "$ACCESSIBILITY" != "1"; then
2364 AC_MSG_ERROR(["Accessibility is required for the linuxgl widget backend"])
2367 AC_TRY_COMPILE([#include <linux/ethtool.h>],
2368 [ struct ethtool_cmd cmd; cmd.speed_hi = 0; ],
2369 MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI=1)
2371 AC_SUBST(MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI)
2373 if test -n "$MOZ_WEBRTC"; then
2379 if test -n "$MOZ_X11"; then
2380 MOZ_WEBRTC_X11_LIBS="-lXext -lXdamage -lXfixes -lXcomposite"
2384 dnl ========================================================
2385 dnl = Force hardware AEC, disable webrtc.org AEC
2386 dnl ========================================================
2387 MOZ_ARG_ENABLE_BOOL(hardware-aec-ns,
2388 [ --enable-hardware-aec-ns Enable support for hardware AEC and noise suppression],
2389 MOZ_WEBRTC_HARDWARE_AEC_NS=1,
2390 MOZ_WEBRTC_HARDWARE_AEC_NS=)
2392 if test -n "$MOZ_WEBRTC_HARDWARE_AEC_NS"; then
2393 AC_DEFINE(MOZ_WEBRTC_HARDWARE_AEC_NS)
2396 AC_SUBST(MOZ_WEBRTC_HARDWARE_AEC_NS)
2399 AC_SUBST_LIST(MOZ_WEBRTC_X11_LIBS)
2401 dnl Use integers over floats for audio on B2G and Android
2402 dnl (regarless of the CPU architecture, because audio
2403 dnl backends for those platforms don't support floats. We also
2404 dnl use integers on ARM with other OS, because it's more efficient.
2405 if test "$OS_TARGET" = "Android" -o "$CPU_ARCH" = "arm"; then
2406 MOZ_SAMPLE_TYPE_S16=1
2407 AC_DEFINE(MOZ_SAMPLE_TYPE_S16)
2408 AC_SUBST(MOZ_SAMPLE_TYPE_S16)
2410 MOZ_SAMPLE_TYPE_FLOAT32=1
2411 AC_DEFINE(MOZ_SAMPLE_TYPE_FLOAT32)
2412 AC_SUBST(MOZ_SAMPLE_TYPE_FLOAT32)
2415 dnl ========================================================
2416 dnl = Enable Raw Codecs
2417 dnl ========================================================
2418 MOZ_ARG_ENABLE_BOOL(raw,
2419 [ --enable-raw Enable support for RAW media],
2423 if test -n "$MOZ_RAW"; then
2429 dnl ========================================================
2430 dnl = Apple platform decoder support
2431 dnl ========================================================
2432 if test "$COMPILE_ENVIRONMENT"; then
2433 if test -n "$MOZ_APPLEMEDIA"; then
2434 # hack in frameworks for fmp4 - see bug 1029974
2435 # We load VideoToolbox and CoreMedia dynamically, so they don't appear here.
2436 LDFLAGS="$LDFLAGS -framework AudioToolbox"
2437 dnl Verify CoreMedia is available.
2438 AC_CHECK_HEADER([CoreMedia/CoreMedia.h], [],
2439 [AC_MSG_ERROR([MacOS X 10.7 SDK or later is required])])
2441 fi # COMPILE_ENVIRONMENT
2443 dnl system libvpx Support
2444 dnl ========================================================
2445 MOZ_ARG_WITH_BOOL(system-libvpx,
2446 [ --with-system-libvpx Use system libvpx (located with pkgconfig)],
2447 MOZ_SYSTEM_LIBVPX=1)
2452 _SAVE_CFLAGS=$CFLAGS
2454 if test -n "$MOZ_SYSTEM_LIBVPX"; then
2455 dnl ============================
2456 dnl === libvpx Version check ===
2457 dnl ============================
2458 dnl Check to see if we have a system libvpx package.
2459 PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.5.0)
2461 CFLAGS="$CFLAGS $MOZ_LIBVPX_CFLAGS"
2462 LIBS="$LIBS $MOZ_LIBVPX_LIBS"
2464 MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
2465 [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.])])
2467 AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
2468 [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
2470 MOZ_CHECK_HEADER([vpx_mem/vpx_mem.h],
2471 [AC_CHECK_FUNC(vpx_mem_set_functions)])
2472 if test "$ac_cv_header_vpx_mem_vpx_mem_h" = no -o \
2473 "$ac_cv_func_vpx_mem_set_functions" = no; then
2474 AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING)
2477 CFLAGS=$_SAVE_CFLAGS
2480 AC_SUBST(MOZ_SYSTEM_LIBVPX)
2481 AC_SUBST_LIST(MOZ_LIBVPX_CFLAGS)
2482 AC_SUBST_LIST(MOZ_LIBVPX_LIBS)
2484 if test "$MOZ_SAMPLE_TYPE_FLOAT32"; then
2490 if test -z "$MOZ_SYSTEM_LIBVPX"; then
2492 dnl Detect if we can use an assembler to compile optimized assembly for libvpx.
2493 dnl We currently require yasm on all x86 platforms and require yasm 1.1.0 on Win32.
2494 dnl We currently require gcc on all arm platforms.
2496 dnl See if we have assembly on this platform.
2497 case "$OS_ARCH:$CPU_ARCH" in
2511 dnl Check for yasm 1.1 or greater.
2512 if test -n "$COMPILE_ENVIRONMENT" -a -z "$YASM"; then
2513 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.])
2514 elif test -n "$COMPILE_ENVIRONMENT" -a "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
2515 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.])
2519 dnl The encoder needs obj_int_extract to get asm offsets.
2520 fi # COMPILE_ENVIRONMENT and others
2523 if test -n "$GNU_AS" ; then
2524 dnl These flags are a lie; they're just used to enable the requisite
2525 dnl opcodes; actual arch detection is done at runtime.
2526 VPX_ASFLAGS="-march=armv7-a -mfpu=neon"
2527 VPX_AS_CONVERSION='$(PERL) $(topsrcdir)/media/libvpx/libvpx/build/make/ads2gas.pl'
2529 dnl Building with -mfpu=neon requires either the "softfp" or the
2530 dnl "hardfp" ABI. Depending on the compiler's default target, and the
2531 dnl CFLAGS, the default ABI might be neither, in which case it is the
2532 dnl "softfloat" ABI.
2533 dnl The "softfloat" ABI is binary-compatible with the "softfp" ABI, so
2534 dnl we can safely mix code built with both ABIs. So, if we detect
2535 dnl that compiling uses the "softfloat" ABI, force the use of the
2536 dnl "softfp" ABI instead.
2537 dnl Confusingly, the __SOFTFP__ preprocessor variable indicates the
2538 dnl "softfloat" ABI, not the "softfp" ABI.
2539 dnl Note: VPX_ASFLAGS is also used in CFLAGS.
2542 #error "compiler target supports -mfpu=neon, so we don't have to add extra flags"
2544 VPX_ASFLAGS="$VPX_ASFLAGS -mfloat-abi=softfp"
2549 if $CC -E -dM -</dev/null | grep -q __ELF__; then
2555 if $CC -E -dM -</dev/null | grep -q __ELF__; then
2562 if test -n "$COMPILE_ENVIRONMENT" -a -n "$VPX_USE_YASM" -a -z "$YASM"; then
2563 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.])
2564 fi # COMPILE_ENVIRONMENT and others
2566 if test -n "$VPX_USE_YASM" && test "$OS_ARCH:$CPU_ARCH" != "WINNT:x86_64"; then
2570 if test -n "$VPX_X86_ASM"; then
2571 AC_DEFINE(VPX_X86_ASM)
2572 elif test -n "$VPX_ARM_ASM"; then
2573 AC_DEFINE(VPX_ARM_ASM)
2575 AC_MSG_WARN([No assembler or assembly support for libvpx. Using unoptimized C routines.])
2578 dnl native libvpx no longer has vpx_mem_set_functions
2579 AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING)
2582 dnl ========================================================
2583 dnl = Handle dependent MEDIA defines
2584 dnl ========================================================
2586 if test -n "$MOZ_VORBIS" -a -n "$MOZ_TREMOR"; then
2587 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/])
2590 if test -n "$MOZ_VORBIS"; then
2591 AC_DEFINE(MOZ_VORBIS)
2594 if test -n "$MOZ_TREMOR"; then
2595 AC_DEFINE(MOZ_TREMOR)
2599 AC_DEFINE(MOZ_WEBM_ENCODER)
2600 AC_SUBST(MOZ_WEBM_ENCODER)
2602 dnl ========================================================
2604 dnl ========================================================
2606 MOZ_ARG_DISABLE_BOOL(negotiateauth,
2607 [ --disable-negotiateauth Disable GSS-API negotiation ],
2608 MOZ_AUTH_EXTENSION=,
2609 MOZ_AUTH_EXTENSION=1 )
2611 if test -n "$MOZ_IOS" -a -n "$MOZ_AUTH_EXTENSION"; then
2612 AC_MSG_ERROR([negotiateauth is not supported on iOS.])
2615 dnl ========================================================
2616 dnl Pref extensions (autoconfig)
2617 dnl ========================================================
2618 MOZ_ARG_DISABLE_BOOL(pref-extensions,
2619 [ --disable-pref-extensions
2620 Disable pref extensions such as autoconfig],
2621 MOZ_PREF_EXTENSIONS=,
2622 MOZ_PREF_EXTENSIONS=1 )
2624 dnl ========================================================
2625 dnl Searching of system directories for extensions.
2626 dnl Note: this switch is meant to be used for test builds
2627 dnl whose behavior should not depend on what happens to be
2628 dnl installed on the local machine.
2629 dnl ========================================================
2630 MOZ_ARG_DISABLE_BOOL(system-extension-dirs,
2631 [ --disable-system-extension-dirs
2632 Disable searching system- and account-global
2633 directories for extensions of any kind; use
2634 only profile-specific extension directories],
2635 ENABLE_SYSTEM_EXTENSION_DIRS=,
2636 ENABLE_SYSTEM_EXTENSION_DIRS=1 )
2637 if test "$ENABLE_SYSTEM_EXTENSION_DIRS"; then
2638 AC_DEFINE(ENABLE_SYSTEM_EXTENSION_DIRS)
2641 dnl ========================================================
2642 dnl = Universalchardet
2643 dnl ========================================================
2644 MOZ_ARG_DISABLE_BOOL(universalchardet,
2645 [ --disable-universalchardet
2646 Disable universal encoding detection],
2647 MOZ_UNIVERSALCHARDET=,
2648 MOZ_UNIVERSALCHARDET=1 )
2650 dnl ========================================================
2651 dnl = ANGLE OpenGL->D3D translator for WebGL
2652 dnl = * only applies to win32 (and then, not MINGW)
2653 dnl ========================================================
2657 MOZ_HAS_WINSDK_WITH_D3D=
2658 MOZ_D3DCOMPILER_VISTA_DLL=
2659 MOZ_D3DCOMPILER_VISTA_DLL_PATH=
2661 if test "$COMPILE_ENVIRONMENT" ; then
2662 case "$target_os" in
2664 MOZ_ANGLE_RENDERER=1
2668 # The DirectX SDK libraries are split into x86 and x64 sub-directories
2669 case "${target_cpu}" in
2671 MOZ_D3D_CPU_SUFFIX=x86
2674 MOZ_D3D_CPU_SUFFIX=x64
2678 dnl ========================================================
2679 dnl D3D compiler DLL
2680 dnl ========================================================
2681 MOZ_FOUND_D3D_COMPILERS=
2683 if test -n "$MOZ_ANGLE_RENDERER"; then
2684 if test -z "$MOZ_D3D_CPU_SUFFIX"; then
2685 AC_MSG_ERROR([Couldn't determine MOZ_D3D_CPU_SUFFIX.])
2688 ######################################
2689 # Find _46+ for use by Vista+.
2691 # Find a D3D compiler DLL in a Windows SDK.
2692 MOZ_D3DCOMPILER_VISTA_DLL=
2693 case "$MOZ_WINSDK_MAXVER" in
2695 MOZ_D3DCOMPILER_VISTA_DLL=d3dcompiler_47.dll
2696 AC_MSG_RESULT([Found D3D compiler in Windows SDK.])
2700 if test -n "$MOZ_D3DCOMPILER_VISTA_DLL"; then
2701 # We have a name, now track down the path.
2702 if test -n "$WINDOWSSDKDIR"; then
2703 MOZ_D3DCOMPILER_VISTA_DLL_PATH="$WINDOWSSDKDIR/Redist/D3D/$MOZ_D3D_CPU_SUFFIX/$MOZ_D3DCOMPILER_VISTA_DLL"
2704 if test -f "$MOZ_D3DCOMPILER_VISTA_DLL_PATH"; then
2705 AC_MSG_RESULT([Found MOZ_D3DCOMPILER_VISTA_DLL_PATH: $MOZ_D3DCOMPILER_VISTA_DLL_PATH])
2706 MOZ_HAS_WINSDK_WITH_D3D=1
2708 AC_MSG_RESULT([MOZ_D3DCOMPILER_VISTA_DLL_PATH doesn't exist: $MOZ_D3DCOMPILER_VISTA_DLL_PATH])
2709 AC_MSG_ERROR([Windows SDK at "$WINDOWSSDKDIR" appears broken. Try updating to MozillaBuild 1.9 final or higher.])
2710 MOZ_D3DCOMPILER_VISTA_DLL_PATH=
2713 AC_MSG_RESULT([Windows SDK not found.])
2716 if test "$OS_ARCH" = "$HOST_OS_ARCH"; then
2717 AC_MSG_ERROR([Couldn't find Windows SDK 8.1 or higher needed for ANGLE.])
2719 AC_MSG_RESULT([Windows SDK not needed for ANGLE in Linux MinGW build.])
2723 if test -z "$MOZ_D3DCOMPILER_VISTA_DLL_PATH"; then
2724 MOZ_D3DCOMPILER_VISTA_DLL=
2727 # On mingw, check if headers are provided by toolchain.
2728 if test -n "$GNU_CC"; then
2729 MOZ_CHECK_HEADER(d3d10.h, MOZ_HAS_WINSDK_WITH_D3D=1)
2732 ######################################
2733 # Check that we found what we needed.
2734 MOZ_FOUND_A_D3D_COMPILER=
2736 if test -n "$MOZ_D3DCOMPILER_VISTA_DLL"; then
2737 MOZ_FOUND_A_D3D_COMPILER=1
2738 AC_MSG_RESULT([Found d3dcompiler DLL for Vista+: $MOZ_D3DCOMPILER_VISTA_DLL])
2741 if test -z "$CROSS_COMPILE"; then
2742 if test -z "MOZ_FOUND_A_D3D_COMPILER"; then
2743 AC_MSG_ERROR([Couldn't find an acceptable D3D compiler DLL.])
2746 fi # MOZ_ANGLE_RENDERER
2748 fi # COMPILE_ENVIRONMENT
2751 dnl ========================================================
2753 dnl ========================================================
2754 MOZ_GAMEPAD_BACKEND=stub
2756 case "$OS_TARGET" in
2758 if test -z "$MOZ_IOS"; then
2759 MOZ_GAMEPAD_BACKEND=cocoa
2763 MOZ_GAMEPAD_BACKEND=windows
2766 MOZ_CHECK_HEADER([linux/joystick.h])
2767 if test "$ac_cv_header_linux_joystick_h" != "yes"; then
2768 AC_MSG_ERROR([Can't find header linux/joystick.h, needed for gamepad support. Please install Linux kernel headers.])
2770 MOZ_GAMEPAD_BACKEND=linux
2773 MOZ_GAMEPAD_BACKEND=android
2779 AC_SUBST(MOZ_GAMEPAD_BACKEND)
2781 dnl ========================================================
2782 dnl = Breakpad crash reporting (on by default on supported platforms)
2783 dnl ========================================================
2786 i?86-*-mingw*|x86_64-*-mingw*)
2789 i?86-apple-darwin*|x86_64-apple-darwin*)
2790 if test -z "$MOZ_IOS"; then
2794 *-android*|*-linuxandroid*)
2795 dnl Android/arm is arm-unknown-linux-androideabi, so android condition should
2796 dnl be before Linux condition
2799 i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
2800 if test "$MOZ_ENABLE_GTK"; then
2806 MOZ_ARG_DISABLE_BOOL(crashreporter,
2807 [ --disable-crashreporter Disable breakpad crash reporting],
2808 [MOZ_CRASHREPORTER=],
2809 [MOZ_CRASHREPORTER=F # Force enable breakpad])
2811 if test "$OS_ARCH" != "$HOST_OS_ARCH" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "Darwin"; then
2812 if test "$MOZ_CRASHREPORTER" = F; then
2813 AC_MSG_ERROR([Cannot --enable-crashreporter, as breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH.])
2818 if test -n "$MOZ_CRASHREPORTER"; then
2819 AC_DEFINE(MOZ_CRASHREPORTER)
2821 if test "$OS_TARGET" = "Linux" && \
2822 test -z "$SKIP_LIBRARY_CHECKS"; then
2823 PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
2826 if test "$OS_ARCH" = "WINNT"; then
2827 if test -z "$HAVE_64BIT_BUILD" -a -n "$COMPILE_ENVIRONMENT"; then
2828 MOZ_CRASHREPORTER_INJECTOR=1
2829 AC_DEFINE(MOZ_CRASHREPORTER_INJECTOR)
2834 dnl ========================================================
2835 dnl = libjpeg-turbo configuration
2836 dnl ========================================================
2838 LIBJPEG_TURBO_USE_YASM=
2839 if test -z "$MOZ_SYSTEM_JPEG"; then
2843 MOZ_ARG_DISABLE_BOOL(libjpeg_turbo,
2844 [ --disable-libjpeg-turbo Disable optimized jpeg decoding routines],
2846 MOZ_LIBJPEG_TURBO=1)
2848 if test "$MOZ_SYSTEM_JPEG" = 1 -a "$MOZ_LIBJPEG_TURBO" = 1; then
2849 AC_MSG_ERROR([cannot use --with-system-jpeg with --enable-libjpeg-turbo.])
2852 dnl Detect if we can use yasm to compile libjpeg-turbo's optimized assembly
2855 if test -n "$MOZ_LIBJPEG_TURBO" -a -n "$COMPILE_ENVIRONMENT"; then
2857 dnl Do we support libjpeg-turbo on this platform?
2858 case "$OS_ARCH:$CPU_ARCH" in
2860 LIBJPEG_TURBO_ASFLAGS="-DPIC -DMACHO"
2863 LIBJPEG_TURBO_ASFLAGS="-D__x86_64__ -DPIC -DMACHO"
2868 LIBJPEG_TURBO_ASFLAGS="-DPIC -DWIN32"
2871 LIBJPEG_TURBO_ASFLAGS="-D__x86_64__ -DPIC -DWIN64 -DMSVC"
2874 LIBJPEG_TURBO_ASFLAGS="-march=armv7-a -mfpu=neon"
2877 LIBJPEG_TURBO_ASFLAGS="-march=armv8-a"
2880 LIBJPEG_TURBO_ASFLAGS="-mdspr2"
2883 if $CC -E -dM -</dev/null | grep -q __ELF__; then
2884 LIBJPEG_TURBO_ASFLAGS="-DPIC -DELF"
2888 if $CC -E -dM -</dev/null | grep -q __ELF__; then
2889 LIBJPEG_TURBO_ASFLAGS="-D__x86_64__ -DPIC -DELF"
2895 if test -n "$LIBJPEG_TURBO_ASFLAGS"; then
2897 dnl If we're on an x86 or x64 system which supports libjpeg-turbo's asm routines
2898 dnl and --disable-libjpeg-turbo wasn't passed, check for Yasm, and error out if
2899 dnl it doesn't exist or we have too old of a version.
2901 LIBJPEG_TURBO_USE_YASM=1
2903 if test -z "$YASM" ; then
2904 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.])
2907 dnl Check that we have the right yasm version. We require 1.0.1 or newer
2908 dnl on Linux and 1.1 or newer everywhere else.
2909 if test "$OS_ARCH" = "Linux" ; then
2910 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
2911 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.])
2914 if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
2915 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.])
2922 dnl ========================================================
2923 dnl = libav-fft configuration
2924 dnl ========================================================
2928 dnl Turn on libav-fft for 32-bit windows, and all 64-bit supported platforms.
2929 dnl 32-bit linux/os x have text relocation issues.
2931 case "$OS_ARCH:$CPU_ARCH" in
2940 dnl Detect if we can use yasm to compile libav's assembly
2942 if test -n "$MOZ_LIBAV_FFT" -a -n "$COMPILE_ENVIRONMENT"; then
2943 AC_DEFINE(MOZ_LIBAV_FFT)
2944 dnl Do we support libav-fft on this platform?
2945 case "$OS_ARCH:$CPU_ARCH" in
2947 LIBAV_FFT_ASFLAGS="-D__x86_64__ -DPIC -DMACHO"
2950 LIBAV_FFT_ASFLAGS="-DPIC -DWIN32"
2953 LIBAV_FFT_ASFLAGS="-D__x86_64__ -DPIC -DWIN64 -DMSVC"
2956 if $CC -E -dM -</dev/null | grep -q __ELF__; then
2957 LIBAV_FFT_ASFLAGS="-D__x86_64__ -DPIC -DELF"
2961 AC_MSG_ERROR([libav's FFT routines are only available for 32-bit windows or 64-bit x86 based platforms.])
2966 if test -n "$LIBAV_FFT_ASFLAGS"; then
2967 dnl If we're on an x86 or x64 system which supports libav-fft's asm routines
2968 dnl check for Yasm, and error out if it doesn't exist or we have too old of a
2970 if test -z "$YASM" ; then
2971 AC_MSG_ERROR([Yasm is required to build with libav's optimized FFT routines, but you do not appear to have Yasm installed. See https://developer.mozilla.org/en/YASM for more details.])
2973 dnl Check that we have the right yasm version. We require 1.0.1 or newer
2974 dnl on Linux and 1.1 or newer everywhere else.
2975 if test "$OS_ARCH" = "Linux" ; then
2976 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
2977 AC_MSG_ERROR([Yasm 1.0.1 or greater is required to build with libav's optimized FFT routines, but you do not appear to have Yasm installed. See https://developer.mozilla.org/en/YASM for more details.])
2980 if test "$_YASM_MAJOR_VERSION" -lt "1" -o \( "$_YASM_MAJOR_VERSION" -eq "1" -a "$_YASM_MINOR_VERSION" -lt "1" \) ; then
2981 AC_MSG_ERROR([Yasm 1.1 or greater is required to build with libav's optimized FFT routines, but you do not appear to have Yasm installed. See https://developer.mozilla.org/en/YASM for more details.])
2984 elif test -n "$MOZ_LIBAV_FFT" -a "${CPU_ARCH}" != "arm"; then
2985 dnl Warn if we're not building either libav or opendl-max optimized routines.
2986 AC_MSG_WARN([No assembler or assembly support for libav-fft. Using unoptimized C routines.])
2989 dnl ========================================================
2990 dnl = FFmpeg's ffvpx configuration
2991 dnl ========================================================
2998 dnl Use same conditional as MOZ_LIBAV_FFT to enable FFmpeg's ffvpx assembly decoder.
2999 if test -n "$LIBAV_FFT_ASFLAGS"; then
3000 FFVPX_ASFLAGS=$LIBAV_FFT_ASFLAGS
3002 dnl On x86 system with assembly optimizations disabled, the ffvp9 and
3003 dnl ffvp8 decoders give worse performance than libvpx ones. So we only
3004 dnl enable the FFmpeg FLAC decoder on those machines.
3005 MOZ_FFVPX_FLACONLY=1
3010 MOZ_FFVPX_FLACONLY=1
3011 dnl Use same conditional as MOZ_LIBVPX to enable FFmpeg's ffvpx assembly decoder.
3012 dnl aarch 64 FLAC decoder for now will be C only.
3013 FFVPX_ASFLAGS=$VPX_ASFLAGS
3017 if test -n "$MOZ_FFVPX"; then
3018 AC_DEFINE(MOZ_FFVPX)
3020 if test -n "$MOZ_FFVPX_FLACONLY"; then
3021 AC_DEFINE(MOZ_FFVPX_FLACONLY)
3024 dnl ========================================================
3025 dnl = Enable compilation of specific extension modules
3026 dnl ========================================================
3028 MOZ_ARG_ENABLE_STRING(extensions,
3029 [ --enable-extensions Enable extensions],
3030 [ for option in `echo $enableval | sed 's/,/ /g'`; do
3031 if test "$option" = "yes" -o "$option" = "all"; then
3032 AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
3033 elif test "$option" = "no" -o "$option" = "none"; then
3035 elif test "$option" = "default"; then
3036 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
3037 elif test `echo "$option" | grep -c \^-` != 0; then
3038 option=`echo $option | sed 's/^-//'`
3039 MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
3041 MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
3044 MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
3046 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
3047 dnl when trying to build a nonexistent extension.
3048 for extension in $MOZ_EXTENSIONS; do
3049 if test ! -d "${srcdir}/extensions/${extension}"; then
3050 AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
3054 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
3055 AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS)
3058 # Avoid defining MOZ_ENABLE_CAIRO_FT on Windows platforms because
3059 # "cairo-ft-font.c" includes <dlfcn.h>, which only exists on posix platforms
3060 if test -n "$MOZ_TREE_FREETYPE" -a "$OS_TARGET" != WINNT; then
3061 MOZ_ENABLE_CAIRO_FT=1
3062 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
3063 CAIRO_FT_CFLAGS="-I$_topsrcdir/modules/freetype2/include"
3064 AC_SUBST_LIST(CAIRO_FT_CFLAGS)
3067 AC_CHECK_PROGS(WGET, wget, "")
3070 dnl ========================================================
3071 dnl Maintenance Service
3072 dnl ========================================================
3074 MOZ_ARG_ENABLE_BOOL(maintenance-service,
3075 [ --enable-maintenance-service Enable building of maintenanceservice],
3076 MOZ_MAINTENANCE_SERVICE=1,
3077 MOZ_MAINTENANCE_SERVICE= )
3079 if test -n "$MOZ_MAINTENANCE_SERVICE"; then
3080 if test "$OS_ARCH" = "WINNT"; then
3081 AC_DEFINE(MOZ_MAINTENANCE_SERVICE)
3083 AC_MSG_ERROR([Can only build with --enable-maintenance-service with a Windows target])
3087 dnl ========================================================
3088 dnl Bundled fonts on desktop platforms
3089 dnl ========================================================
3091 MOZ_ARG_ENABLE_BOOL(bundled-fonts,
3092 [ --enable-bundled-fonts Enable support for bundled fonts on desktop platforms],
3093 MOZ_BUNDLED_FONTS=1,
3096 if test -n "$MOZ_BUNDLED_FONTS"; then
3097 AC_DEFINE(MOZ_BUNDLED_FONTS)
3100 dnl ========================================================
3101 dnl Verify MAR signatures
3102 dnl ========================================================
3104 MOZ_ARG_ENABLE_BOOL(verify-mar,
3105 [ --enable-verify-mar Enable verifying MAR signatures],
3106 MOZ_VERIFY_MAR_SIGNATURE=1,
3107 MOZ_VERIFY_MAR_SIGNATURE= )
3109 if test -n "$MOZ_VERIFY_MAR_SIGNATURE"; then
3110 AC_DEFINE(MOZ_VERIFY_MAR_SIGNATURE)
3113 dnl ========================================================
3114 dnl Enable building the signmar program.
3115 dnl This option is much different than the --enable-verify-mar option.
3116 dnl --enable-verify-mar is for enabling the verification check on MAR
3117 dnl files in the updater. The --enable-signmar option is for building
3118 dnl the signmar program.
3119 dnl ========================================================
3121 MOZ_ARG_ENABLE_BOOL(signmar,
3122 [ --enable-signmar Enable building the signmar program],
3123 MOZ_ENABLE_SIGNMAR=1,
3124 MOZ_ENABLE_SIGNMAR= )
3126 if test -n "$MOZ_ENABLE_SIGNMAR"; then
3127 if test -z "$COMPILE_ENVIRONMENT" ; then
3128 AC_MSG_WARN([Cannot --enable-signmar with --disable-compile-environment])
3131 AC_DEFINE(MOZ_ENABLE_SIGNMAR)
3135 dnl ========================================================
3137 dnl ========================================================
3139 if test "$MOZ_IOS"; then
3143 MOZ_ARG_DISABLE_BOOL(updater,
3144 [ --disable-updater Disable building of updater],
3148 if test -n "$MOZ_UPDATER"; then
3149 AC_DEFINE(MOZ_UPDATER)
3152 dnl ========================================================
3153 dnl parental controls (for Windows Vista)
3154 dnl ========================================================
3155 MOZ_ARG_DISABLE_BOOL(parental-controls,
3156 [ --disable-parental-controls
3157 Do not build parental controls],
3158 MOZ_DISABLE_PARENTAL_CONTROLS=1,
3159 MOZ_DISABLE_PARENTAL_CONTROLS=)
3160 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
3161 AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
3164 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
3166 dnl ========================================================
3167 dnl = Disable smartcard support
3168 dnl ========================================================
3169 if test -n "$MOZ_NO_SMART_CARDS"; then
3170 AC_DEFINE(MOZ_NO_SMART_CARDS)
3172 AC_SUBST(MOZ_NO_SMART_CARDS)
3174 dnl ========================================================
3175 dnl = Sandboxing support
3176 dnl ========================================================
3177 if test -n "$MOZ_TSAN" -o -n "$MOZ_ASAN"; then
3178 # Bug 1182565: TSan conflicts with sandboxing on Linux.
3179 # Bug 1287971: LSan also conflicts with sandboxing on Linux.
3187 MOZ_ARG_DISABLE_BOOL(sandbox,
3188 [ --disable-sandbox Disable sandboxing support],
3192 dnl ========================================================
3193 dnl = Content process sandboxing
3194 dnl ========================================================
3196 case "$OS_TARGET" in
3198 MOZ_CONTENT_SANDBOX=$MOZ_SANDBOX
3201 MOZ_CONTENT_SANDBOX=$MOZ_SANDBOX
3206 MOZ_CONTENT_SANDBOX=$MOZ_SANDBOX
3212 MOZ_ARG_ENABLE_BOOL(content-sandbox,
3213 [ --enable-content-sandbox Enable sandboxing support for content-processes
3214 --disable-content-sandbox Disable sandboxing support for content-processes],
3215 MOZ_CONTENT_SANDBOX=1,
3216 MOZ_CONTENT_SANDBOX=)
3218 if test -n "$MOZ_CONTENT_SANDBOX" -a -z "$MOZ_SANDBOX"; then
3219 AC_MSG_ERROR([--enable-content-sandbox and --disable-sandbox are conflicting options])
3222 if test -n "$MOZ_CONTENT_SANDBOX"; then
3223 AC_DEFINE(MOZ_CONTENT_SANDBOX)
3226 AC_SUBST(MOZ_CONTENT_SANDBOX)
3228 dnl ========================================================
3229 dnl = Gecko Media Plugin sandboxing
3230 dnl ========================================================
3233 MOZ_GMP_SANDBOX=$MOZ_SANDBOX
3238 MOZ_GMP_SANDBOX=$MOZ_SANDBOX
3243 MOZ_GMP_SANDBOX=$MOZ_SANDBOX
3247 if test -n "$MOZ_GMP_SANDBOX"; then
3248 AC_DEFINE(MOZ_GMP_SANDBOX)
3251 AC_SUBST(MOZ_GMP_SANDBOX)
3253 if test -z "$MOZ_CONTENT_SANDBOX" -a -z "$MOZ_GMP_SANDBOX"; then
3257 if test -n "$MOZ_SANDBOX"; then
3258 AC_DEFINE(MOZ_SANDBOX)
3261 AC_SUBST(MOZ_SANDBOX)
3264 dnl ========================================================
3266 dnl = Module specific options
3268 dnl ========================================================
3269 MOZ_ARG_HEADER(Individual module options)
3271 dnl ========================================================
3272 dnl = Disable feed handling components
3273 dnl ========================================================
3274 MOZ_ARG_DISABLE_BOOL(feeds,
3275 [ --disable-feeds Disable feed handling and processing components],
3278 if test -n "$MOZ_FEEDS"; then
3279 AC_DEFINE(MOZ_FEEDS)
3281 if test "$MOZ_BUILD_APP" = "browser"; then
3282 AC_MSG_ERROR([Cannot build Firefox with --disable-feeds.])
3286 dnl ========================================================
3287 dnl Check for sqlite
3288 dnl ========================================================
3291 MOZ_ARG_ENABLE_BOOL(system-sqlite,
3292 [ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
3293 MOZ_SYSTEM_SQLITE=1,
3294 MOZ_SYSTEM_SQLITE= )
3296 if test -n "$MOZ_SYSTEM_SQLITE"
3298 dnl ============================
3299 dnl === SQLite Version check ===
3300 dnl ============================
3301 dnl Check to see if the system SQLite package is new enough.
3302 PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
3304 dnl ==================================
3305 dnl === SQLITE_SECURE_DELETE check ===
3306 dnl ==================================
3307 dnl Check to see if the system SQLite package is compiled with
3308 dnl SQLITE_SECURE_DELETE enabled.
3309 AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
3310 _SAVE_CFLAGS="$CFLAGS"
3311 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
3313 LIBS="$LIBS $SQLITE_LIBS"
3314 AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
3316 #include "sqlite3.h"
3318 int main(int argc, char **argv){
3319 return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
3321 ac_cv_sqlite_secure_delete=yes,
3322 ac_cv_sqlite_secure_delete=no,
3323 ac_cv_sqlite_secure_delete=no
3326 AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
3327 CFLAGS="$_SAVE_CFLAGS"
3329 if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
3330 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
3333 dnl ===============================
3334 dnl === SQLITE_THREADSAFE check ===
3335 dnl ===============================
3336 dnl Check to see if the system SQLite package is compiled with
3337 dnl SQLITE_THREADSAFE enabled.
3338 AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
3339 _SAVE_CFLAGS="$CFLAGS"
3340 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
3342 LIBS="$LIBS $SQLITE_LIBS"
3343 AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
3345 #include "sqlite3.h"
3347 int main(int argc, char **argv){
3348 return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
3350 ac_cv_sqlite_threadsafe=yes,
3351 ac_cv_sqlite_threadsafe=no,
3352 ac_cv_sqlite_threadsafe=no
3355 AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
3356 CFLAGS="$_SAVE_CFLAGS"
3358 if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
3359 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
3362 dnl ================================
3363 dnl === SQLITE_ENABLE_FTS3 check ===
3364 dnl ================================
3365 dnl check to see if the system SQLite package is compiled with
3366 dnl SQLITE_ENABLE_FTS3 enabled.
3367 AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
3368 _SAVE_CFLAGS="$CFLAGS"
3369 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
3371 LIBS="$LIBS $SQLITE_LIBS"
3372 AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
3374 #include "sqlite3.h"
3376 int main(int argc, char **argv){
3377 return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
3379 ac_cv_sqlite_enable_fts3=yes,
3380 ac_cv_sqlite_enable_fts3=no,
3381 ac_cv_sqlite_enable_fts3=no
3384 AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
3385 CFLAGS="$_SAVE_CFLAGS"
3387 if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
3388 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
3391 dnl =========================================
3392 dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
3393 dnl =========================================
3394 dnl check to see if the system SQLite package is compiled with
3395 dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
3396 AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
3397 _SAVE_CFLAGS="$CFLAGS"
3398 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
3400 LIBS="$LIBS $SQLITE_LIBS"
3401 AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
3403 #include "sqlite3.h"
3405 int main(int argc, char **argv){
3406 return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
3408 ac_cv_sqlite_enable_unlock_notify=yes,
3409 ac_cv_sqlite_enable_unlock_notify=no,
3410 ac_cv_sqlite_enable_unlock_notify=no
3413 AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
3414 CFLAGS="$_SAVE_CFLAGS"
3416 if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
3417 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
3420 dnl =========================================
3421 dnl === SQLITE_ENABLE_DBSTAT_VTAB check ===
3422 dnl =========================================
3423 dnl check to see if the system SQLite package is compiled with
3424 dnl SQLITE_ENABLE_DBSTAT_VTAB.
3425 AC_MSG_CHECKING(for SQLITE_ENABLE_DBSTAT_VTAB support in system SQLite)
3426 _SAVE_CFLAGS="$CFLAGS"
3427 CFLAGS="$CFLAGS $SQLITE_CFLAGS"
3429 LIBS="$LIBS $SQLITE_LIBS"
3430 AC_CACHE_VAL(ac_cv_sqlite_dbstat_vtab,[
3432 #include "sqlite3.h"
3434 int main(int argc, char **argv){
3435 return !sqlite3_compileoption_used("SQLITE_ENABLE_DBSTAT_VTAB");
3437 ac_cv_sqlite_dbstat_vtab=yes,
3438 ac_cv_sqlite_dbstat_vtab=no,
3439 ac_cv_sqlite_dbstat_vtab=no
3442 AC_MSG_RESULT($ac_cv_sqlite_dbstat_vtab)
3443 CFLAGS="$_SAVE_CFLAGS"
3445 if test "x$ac_cv_sqlite_dbstat_vtab" = "xno"; then
3446 AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_DBSTAT_VTAB.])
3449 dnl ==============================
3450 dnl === SQLite fdatasync check ===
3451 dnl ==============================
3452 dnl Check to see if fdatasync is available
3453 AC_CHECK_FUNC(fdatasync)
3456 if test -n "$MOZ_SYSTEM_SQLITE"; then
3457 AC_DEFINE(MOZ_SYSTEM_SQLITE)
3459 AC_SUBST(MOZ_SYSTEM_SQLITE)
3461 dnl ========================================================
3462 dnl = Disable zipwriter
3463 dnl ========================================================
3464 MOZ_ARG_DISABLE_BOOL(zipwriter,
3465 [ --disable-zipwriter Disable zipwriter component],
3468 AC_SUBST(MOZ_ZIPWRITER)
3470 dnl ========================================================
3472 dnl = Feature options that require extra sources to be pulled
3474 dnl ========================================================
3475 dnl MOZ_ARG_HEADER(Features that require extra sources)
3477 dnl ========================================================
3479 dnl = Runtime debugging and Optimization Options
3481 dnl ========================================================
3482 MOZ_ARG_HEADER(Runtime debugging and Optimizations)
3484 dnl ========================================================
3485 dnl enable mobile optimizations
3486 dnl ========================================================
3487 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
3488 [ --enable-mobile-optimize
3489 Enable mobile optimizations],
3490 MOZ_GFX_OPTIMIZE_MOBILE=1)
3492 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
3494 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
3495 # We ignore paint will resample on mobile for performance.
3496 # We may want to revisit this later.
3497 MOZ_IGNORE_PAINT_WILL_RESAMPLE=1
3499 AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
3500 AC_DEFINE(MOZ_IGNORE_PAINT_WILL_RESAMPLE)
3503 dnl ========================================================
3504 dnl = Enable code optimization. ON by default.
3505 dnl ========================================================
3507 # Use value from moz.configure if one is defined. Else use our computed
3509 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
3510 MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
3513 MOZ_SET_FRAMEPTR_FLAGS
3515 if test "$COMPILE_ENVIRONMENT"; then
3516 if test -n "$MOZ_OPTIMIZE"; then
3517 AC_MSG_CHECKING([for valid C compiler optimization flags])
3518 _SAVE_CFLAGS=$CFLAGS
3519 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
3520 AC_TRY_COMPILE([#include <stdio.h>],
3521 [printf("Hello World\n");],
3524 AC_MSG_RESULT([$_results])
3525 if test "$_results" = "no"; then
3526 AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
3528 CFLAGS=$_SAVE_CFLAGS
3530 fi # COMPILE_ENVIRONMENT
3532 AC_SUBST_LIST(MOZ_FRAMEPTR_FLAGS)
3533 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
3534 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
3535 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
3537 dnl ========================================================
3538 dnl = Disable treating compiler warnings as errors
3539 dnl ========================================================
3540 if test -z "$MOZ_ENABLE_WARNINGS_AS_ERRORS"; then
3541 WARNINGS_AS_ERRORS=''
3544 dnl ========================================================
3545 dnl = Enable runtime logging
3546 dnl ========================================================
3547 AC_DEFINE(MOZ_LOGGING)
3548 AC_DEFINE(FORCE_PR_LOG)
3550 dnl ========================================================
3551 dnl = This will enable logging of addref, release, ctor, dtor.
3552 dnl ========================================================
3553 _ENABLE_LOGREFCNT=42
3554 MOZ_ARG_ENABLE_BOOL(logrefcnt,
3555 [ --enable-logrefcnt Enable logging of refcounts (default=debug) ],
3556 _ENABLE_LOGREFCNT=1,
3557 _ENABLE_LOGREFCNT= )
3558 if test "$_ENABLE_LOGREFCNT" = "1"; then
3559 AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
3560 elif test -z "$_ENABLE_LOGREFCNT"; then
3561 AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
3564 dnl ========================================================
3565 dnl moz_dump_painting
3566 dnl ========================================================
3567 MOZ_ARG_ENABLE_BOOL(dump-painting,
3568 [ --enable-dump-painting Enable paint debugging.],
3569 MOZ_DUMP_PAINTING=1,
3570 MOZ_DUMP_PAINTING= )
3571 if test -n "$MOZ_DUMP_PAINTING"; then
3572 AC_DEFINE(MOZ_DUMP_PAINTING)
3573 AC_DEFINE(MOZ_LAYERS_HAVE_LOG)
3575 if test -n "$MOZ_DEBUG"; then
3576 AC_DEFINE(MOZ_DUMP_PAINTING)
3579 case "${OS_TARGET}" in
3580 Android|WINNT|Darwin)
3581 MOZ_GLUE_IN_PROGRAM=
3584 dnl On !Android !Windows !OSX, we only want to link executables against mozglue
3585 MOZ_GLUE_IN_PROGRAM=1
3586 AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
3590 dnl ========================================================
3591 dnl = Jemalloc build setup
3592 dnl ========================================================
3593 if test -z "$MOZ_MEMORY"; then
3596 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
3597 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.])
3602 dnl The generic feature tests that determine how to compute ncpus are long and
3603 dnl complicated. Therefore, simply define special cpp variables for the
3604 dnl platforms we have special knowledge of.
3607 export MOZ_NO_DEBUG_RTL=1
3611 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
3613 # Allow the application to provide a subconfigure script.
3614 # This should be after 'export MOZ_NO_DEBUG_RTL=1' since
3615 # ldap/c-sdk/configure refers to the enviroment value.
3616 if test -f "${srcdir}/${MOZ_BUILD_APP}/configure.in" ; then
3617 do_output_subdirs() {
3618 if test -n "$_subconfigure_subdirs"; then
3619 AC_MSG_ERROR([Cannot specify more than one sub-sub-configure])
3621 _subconfigure_subdir="$1"
3622 _subconfigure_config_args="$ac_configure_args"
3624 tmpscript=`$PYTHON -c 'import os, tempfile; print tempfile.mktemp(prefix="subscript.").replace(os.sep, "/")'` || exit 1
3625 m4 "${srcdir}/build/autoconf/subconfigure.m4" \
3626 "${srcdir}/build/autoconf/altoptions.m4" \
3627 "${srcdir}/${MOZ_BUILD_APP}/configure.in" > $tmpscript
3632 AC_SUBST_LIST(MOZ_GLUE_WRAP_LDFLAGS)
3633 export MOZ_GLUE_WRAP_LDFLAGS
3635 dnl ========================================================
3636 dnl = Enable using the clang plugin to build
3637 dnl ========================================================
3639 if test -n "$COMPILE_ENVIRONMENT"; then
3640 MOZ_CONFIG_CLANG_PLUGIN
3641 fi # COMPILE_ENVIRONMENT
3643 dnl ========================================================
3644 dnl = Enable stripping of libs & executables
3645 dnl ========================================================
3646 MOZ_ARG_ENABLE_BOOL(strip,
3647 [ --enable-strip Enable stripping of libs & executables ],
3651 dnl ========================================================
3652 dnl = Enable stripping of libs & executables when packaging
3653 dnl ========================================================
3654 MOZ_ARG_ENABLE_BOOL(install-strip,
3655 [ --enable-install-strip Enable stripping of libs & executables when packaging ],
3659 dnl ========================================================
3660 dnl = frontend JS debug mode
3661 dnl ========================================================
3663 MOZ_ARG_ENABLE_BOOL(debug-js-modules,
3664 [ --enable-debug-js-modules Enable debug mode for frontend JS libraries],
3668 AC_SUBST(DEBUG_JS_MODULES)
3670 dnl ========================================================
3672 dnl = Profiling and Instrumenting
3674 dnl ========================================================
3675 MOZ_ARG_HEADER(Profiling and Instrumenting)
3677 dnl ========================================================
3678 dnl = Enable TaskTracer
3679 dnl ========================================================
3680 MOZ_ARG_ENABLE_BOOL(tasktracer,
3681 [ --enable-tasktracer Set compile flags necessary for using TaskTracer],
3684 if test -n "$MOZ_TASK_TRACER"; then
3685 AC_DEFINE(MOZ_TASK_TRACER)
3686 AC_SUBST(MOZ_TASK_TRACER)
3689 dnl ========================================================
3690 dnl Turn on reflow counting
3691 dnl ========================================================
3692 MOZ_ARG_ENABLE_BOOL(reflow-perf,
3693 [ --enable-reflow-perf Enable reflow performance tracing],
3696 if test -n "$MOZ_REFLOW_PERF"; then
3697 AC_DEFINE(MOZ_REFLOW_PERF)
3700 dnl ========================================================
3701 dnl = Offer a way to disable the startup cache
3702 dnl ========================================================
3704 MOZ_ARG_DISABLE_BOOL(startupcache,
3705 [ --disable-startupcache Disable startup cache ],
3706 MOZ_DISABLE_STARTUPCACHE=1,
3707 MOZ_DISABLE_STARTUPCACHE=)
3709 if test -n "$MOZ_DISABLE_STARTUPCACHE"; then
3710 AC_DEFINE(MOZ_DISABLE_STARTUPCACHE)
3712 AC_SUBST(MOZ_DISABLE_STARTUPCACHE)
3714 dnl ========================================================
3715 dnl = Support for demangling undefined symbols
3716 dnl ========================================================
3717 if test -z "$SKIP_LIBRARY_CHECKS"; then
3720 AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
3724 # Demangle only for debug or DMD builds
3725 MOZ_DEMANGLE_SYMBOLS=
3726 if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$MOZ_DMD"; then
3727 MOZ_DEMANGLE_SYMBOLS=1
3728 AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
3730 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
3732 dnl ========================================================
3733 dnl = Support for gcc stack unwinding (from gcc 3.3)
3734 dnl ========================================================
3735 if test -z "$SKIP_LIBRARY_CHECKS"; then
3738 MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
3742 dnl ========================================================
3744 dnl ========================================================
3746 MOZ_ARG_WITH_STRING(jitreport-granularity,
3747 [ --jitreport-granularity=N
3748 Default granularity at which to report JIT code
3751 1 - code ranges for whole functions only
3752 2 - per-line information
3753 3 - per-op information],
3754 JITREPORT_GRANULARITY=$withval,
3755 JITREPORT_GRANULARITY=3)
3757 AC_DEFINE_UNQUOTED(JS_DEFAULT_JITREPORT_GRANULARITY, $JITREPORT_GRANULARITY)
3759 dnl ========================================================
3763 dnl ========================================================
3764 MOZ_ARG_HEADER(Misc. Options)
3766 dnl ========================================================
3767 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
3768 dnl ========================================================
3769 MOZ_ARG_WITH_STRING(user-appdir,
3770 [ --with-user-appdir=DIR Set user-specific appdir (default=.mozilla)],
3771 [ val=`echo $withval`
3772 if echo "$val" | grep "\/" >/dev/null; then
3773 AC_MSG_ERROR("Homedir must be single relative path.")
3778 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
3780 if test -z "$SKIP_COMPILER_CHECKS"; then
3781 dnl ========================================================
3783 dnl = Compiler Options
3785 dnl ========================================================
3786 MOZ_ARG_HEADER(Compiler Options)
3788 dnl ========================================================
3789 dnl Check for gcc -pipe support
3790 dnl ========================================================
3791 AC_MSG_CHECKING([for -pipe support])
3792 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
3793 dnl Any gcc that supports firefox supports -pipe.
3794 CFLAGS="$CFLAGS -pipe"
3795 CXXFLAGS="$CXXFLAGS -pipe"
3796 AC_MSG_RESULT([yes])
3801 fi # ! SKIP_COMPILER_CHECKS
3803 AC_DEFINE(CPP_THROW_NEW, [throw()])
3806 if test "$COMPILE_ENVIRONMENT"; then
3808 fi # COMPILE_ENVIRONMENT
3810 dnl ========================================================
3812 dnl = Build depencency options
3814 dnl ========================================================
3815 MOZ_ARG_HEADER(Build dependencies)
3817 if test "$COMPILE_ENVIRONMENT"; then
3818 if test "$GNU_CC" -a "$GNU_CXX"; then
3819 _DEPEND_CFLAGS='-MD -MP -MF $(MDDEPDIR)/$(@F).pp'
3821 # clang-cl doesn't accept the normal -MD -MP -MF options that clang does, but
3822 # the underlying cc1 binary understands how to generate dependency files.
3823 # These options are based on analyzing what the normal clang driver sends to
3824 # cc1 when given the "correct" dependency options.
3825 if test -n "$CLANG_CL"; then
3826 _DEPEND_CFLAGS='-Xclang -MP -Xclang -MG -Xclang -dependency-file -Xclang $(MDDEPDIR)/$(@F).pp -Xclang -MT -Xclang $@'
3828 dnl Don't override this for MSVC
3829 if test -z "$_WIN32_MSVC"; then
3830 _USE_CPP_INCLUDE_FLAG=
3831 _DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
3832 _DEFINES_CXXFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
3834 echo '#include <stdio.h>' > dummy-hello.c
3836 dnl This output is localized, split at the first double space or colon and space.
3837 _CL_PREFIX_REGEX="^\([^:]*:.*[ :] \)\(.*\\\stdio.h\)$"
3838 CL_INCLUDES_PREFIX=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\1/p'`
3839 _CL_STDIO_PATH=`${CC} -showIncludes -c -Fonul dummy-hello.c 2>&1 | sed -ne 's/'"$_CL_PREFIX_REGEX"'/\2/p'`
3841 if ! test -e "$_CL_STDIO_PATH"; then
3842 AC_MSG_ERROR([Unable to parse cl -showIncludes prefix. This compiler's locale has an unsupported formatting.])
3844 if test -z "$CL_INCLUDES_PREFIX"; then
3845 AC_MSG_ERROR([Cannot find cl -showIncludes prefix.])
3847 AC_SUBST(CL_INCLUDES_PREFIX)
3850 dnl Make sure that the build system can handle non-ASCII characters
3851 dnl in environment variables to prevent it from breaking silently on
3852 dnl non-English systems.
3853 NONASCII=$'\241\241'
3857 fi # COMPILE_ENVIRONMENT
3859 dnl ========================================================
3861 dnl = Static Build Options
3863 dnl ========================================================
3864 MOZ_ARG_HEADER(Static build options)
3866 if test -z "$MOZ_SYSTEM_ZLIB"; then
3867 if test -n "$JS_SHARED_LIBRARY" -o -n "$MOZ_LINKER"; then
3869 AC_DEFINE(ZLIB_IN_MOZGLUE)
3873 AC_SUBST(ZLIB_IN_MOZGLUE)
3875 dnl ========================================================
3877 dnl = Standalone module options
3879 dnl ========================================================
3880 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
3883 dnl ========================================================
3885 if test -z "$SKIP_PATH_CHECKS"; then
3886 if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
3887 if test "$MOZ_ENABLE_GTK" ; then
3888 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
3893 if test -z "${GLIB_GMODULE_LIBS}" \
3894 -a -n "${GLIB_CONFIG}"\
3895 -a "${GLIB_CONFIG}" != no\
3897 GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
3900 AC_SUBST_LIST(GLIB_GMODULE_LIBS)
3902 if test "$USE_FC_FREETYPE"; then
3903 if test "$COMPILE_ENVIRONMENT"; then
3904 dnl ========================================================
3905 dnl = Check for freetype2 functionality
3906 dnl ========================================================
3907 if test "$_HAVE_FREETYPE2" -a -z "$MOZ_TREE_FREETYPE"; then
3909 _SAVE_CFLAGS="$CFLAGS"
3910 LIBS="$LIBS $FT2_LIBS"
3911 CFLAGS="$CFLAGS $FT2_CFLAGS"
3913 AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
3914 ac_cv_member_FT_Bitmap_Size_y_ppem,
3915 [AC_TRY_COMPILE([#include <ft2build.h>
3916 #include FT_FREETYPE_H],
3918 if (sizeof s.y_ppem) return 0;
3920 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
3921 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
3922 if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
3923 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
3925 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
3927 AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
3928 $HAVE_FT_BITMAP_SIZE_Y_PPEM,
3929 [FT_Bitmap_Size structure includes y_ppem field])
3931 AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table)
3934 CFLAGS="$_SAVE_CFLAGS"
3937 _SAVE_CPPFLAGS="$CPPFLAGS"
3938 CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
3939 MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
3940 [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
3941 CPPFLAGS="$_SAVE_CPPFLAGS"
3945 dnl ========================================================
3946 dnl Check if we need the 32-bit Linux SSE2 error dialog
3947 dnl ========================================================
3949 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
3951 dnl ========================================================
3952 dnl Check for pixman and cairo
3953 dnl ========================================================
3956 MOZ_ARG_ENABLE_BOOL(system-cairo,
3957 [ --enable-system-cairo Obsolete: do not use this option],
3958 AC_MSG_ERROR(--enable-system-cairo is not supported),
3962 MOZ_ARG_ENABLE_BOOL(system-pixman,
3963 [ --enable-system-pixman Use system pixman (located with pkgconfig)],
3965 MOZ_TREE_PIXMAN=force,
3968 if test "$MOZ_TREE_PIXMAN"; then
3969 AC_DEFINE(MOZ_TREE_PIXMAN)
3971 PKG_CHECK_MODULES(MOZ_PIXMAN, pixman-1 >= 0.19.2)
3974 MOZ_CAIRO_CFLAGS="-I${DIST}/include/cairo"
3975 AC_DEFINE(MOZ_TREE_CAIRO)
3977 if test "$OS_ARCH" = "WINNT"; then
3978 # For now we assume that we will have a uint64_t available through
3979 # one of the above headers or mozstdint.h.
3980 AC_DEFINE(HAVE_UINT64_T)
3983 # Define macros for cairo-features.h
3984 TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1"
3985 if test "$MOZ_X11"; then
3986 XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
3987 XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
3988 PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
3990 if test "$_HAVE_FREETYPE2"; then
3991 FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
3992 MOZ_ENABLE_CAIRO_FT=1
3993 CAIRO_FT_CFLAGS="$FT2_CFLAGS"
3996 case "$MOZ_WIDGET_TOOLKIT" in
3998 QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
3999 QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
4000 QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
4003 WIN32_D2D_SURFACE_FEATURE="#define CAIRO_HAS_D2D_SURFACE 1"
4004 WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
4005 WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
4006 WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
4007 MOZ_ENABLE_D2D_SURFACE=1
4009 if test "$COMPILE_ENVIRONMENT"; then
4011 dnl D3D10 Layers depend on D2D Surfaces.
4012 if test -n "$WIN32_D2D_SURFACE_FEATURE"; then
4013 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
4018 if test "$USE_FC_FREETYPE"; then
4019 FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
4021 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
4022 AC_SUBST(MOZ_ENABLE_D2D_SURFACE)
4023 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
4025 AC_SUBST(PS_SURFACE_FEATURE)
4026 AC_SUBST(SVG_SURFACE_FEATURE)
4027 AC_SUBST(XLIB_SURFACE_FEATURE)
4028 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
4029 AC_SUBST(QUARTZ_SURFACE_FEATURE)
4030 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
4031 AC_SUBST(WIN32_SURFACE_FEATURE)
4032 AC_SUBST(OS2_SURFACE_FEATURE)
4033 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
4034 AC_SUBST(FT_FONT_FEATURE)
4035 AC_SUBST(FC_FONT_FEATURE)
4036 AC_SUBST(WIN32_FONT_FEATURE)
4037 AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
4038 AC_SUBST(WIN32_D2D_SURFACE_FEATURE)
4039 AC_SUBST(QUARTZ_FONT_FEATURE)
4040 AC_SUBST(PNG_FUNCTIONS_FEATURE)
4041 AC_SUBST(QT_SURFACE_FEATURE)
4042 AC_SUBST(TEE_SURFACE_FEATURE)
4044 if test "$MOZ_X11"; then
4045 MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
4048 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
4050 case "$MOZ_WIDGET_TOOLKIT" in
4052 TK_CFLAGS="$MOZ_CAIRO_CFLAGS $MOZ_PIXMAN_CFLAGS"
4053 TK_LIBS="$MOZ_CAIRO_LIBS $MOZ_PIXMAN_LIBS"
4057 AC_SUBST(MOZ_TREE_CAIRO)
4058 AC_SUBST_LIST(MOZ_CAIRO_CFLAGS)
4059 AC_SUBST_LIST(MOZ_CAIRO_LIBS)
4060 AC_SUBST_LIST(MOZ_CAIRO_OSLIBS)
4061 AC_SUBST(MOZ_TREE_PIXMAN)
4063 BINDGEN_SYSTEM_FLAGS="$_BINDGEN_CFLAGS $NSPR_CFLAGS $NSS_CFLAGS $MOZ_PIXMAN_CFLAGS $MOZ_CAIRO_CFLAGS"
4064 AC_SUBST_TOML_LIST(BINDGEN_SYSTEM_FLAGS)
4066 dnl ========================================================
4068 dnl ========================================================
4069 MOZ_ARG_DISABLE_BOOL(xul,
4070 [ --disable-xul Disable XUL],
4072 if test "$MOZ_XUL"; then
4075 dnl remove extensions that require XUL
4076 MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/irc//' -e 's/tasks//'`
4081 dnl ========================================================
4082 dnl necko configuration options
4083 dnl ========================================================
4086 dnl option to disable necko's wifi scanner
4089 if test "$MOZ_WIDGET_TOOLKIT"; then
4091 case "$OS_TARGET" in
4093 if test -z "$MOZ_IOS"; then
4097 DragonFly|FreeBSD|WINNT)
4108 MOZ_ARG_DISABLE_BOOL(necko-wifi,
4109 [ --disable-necko-wifi Disable necko wifi scanner],
4113 if test "$NECKO_WIFI"; then
4114 if test -z "$MOZ_ENABLE_DBUS" -a -n "$NECKO_WIFI_DBUS"; then
4115 AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
4117 AC_DEFINE(NECKO_WIFI)
4118 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
4120 AC_SUBST(NECKO_WIFI)
4121 AC_SUBST(NECKO_WIFI_DBUS)
4124 dnl option to disable cookies
4126 MOZ_ARG_DISABLE_BOOL(cookies,
4127 [ --disable-cookies Disable cookie support],
4130 AC_SUBST(NECKO_COOKIES)
4131 if test "$NECKO_COOKIES"; then
4132 AC_DEFINE(NECKO_COOKIES)
4133 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES"
4136 dnl ========================================================
4138 dnl = Maintainer debug option (no --enable equivalent)
4140 dnl ========================================================
4144 AC_SUBST(AR_EXTRACT)
4146 AC_SUBST_LIST(ASFLAGS)
4147 AC_SUBST(AS_DASH_C_FLAG)
4153 AC_SUBST(MOZ_AUTH_EXTENSION)
4154 AC_SUBST(MOZ_PREF_EXTENSIONS)
4155 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
4156 AC_SUBST(WARNINGS_AS_ERRORS)
4157 AC_SUBST_SET(MOZ_EXTENSIONS)
4158 AC_SUBST(MOZ_TOOLKIT_SEARCH)
4161 AC_SUBST(MOZ_UNIVERSALCHARDET)
4162 AC_SUBST(ACCESSIBILITY)
4163 AC_SUBST(MOZ_SPELLCHECK)
4164 AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
4165 AC_SUBST(MOZ_CRASHREPORTER)
4166 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
4167 AC_SUBST(MOZ_MAINTENANCE_SERVICE)
4168 AC_SUBST(MOZ_STUB_INSTALLER)
4169 AC_SUBST(MOZ_VERIFY_MAR_SIGNATURE)
4170 AC_SUBST(MOZ_ENABLE_SIGNMAR)
4171 AC_SUBST(MOZ_UPDATER)
4173 AC_SUBST(MOZ_ANGLE_RENDERER)
4174 AC_SUBST(MOZ_D3D_CPU_SUFFIX)
4175 AC_SUBST(MOZ_HAS_WINSDK_WITH_D3D)
4176 AC_SUBST(MOZ_D3DCOMPILER_VISTA_DLL)
4177 AC_SUBST(MOZ_D3DCOMPILER_VISTA_DLL_PATH)
4179 AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)
4180 AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS)
4181 AC_SUBST(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
4182 AC_SUBST(ENABLE_STRIP)
4183 AC_SUBST(PKG_SKIP_STRIP)
4184 AC_SUBST(STRIP_FLAGS)
4185 AC_SUBST(INCREMENTAL_LINKER)
4187 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
4189 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
4190 AC_SUBST(MOZ_LINKER_EXTRACT)
4192 if test -n "$MOZ_BINARY_EXTENSIONS"; then
4193 AC_DEFINE(MOZ_BINARY_EXTENSIONS)
4196 AC_SUBST(MOZ_ADDON_SIGNING)
4197 if test "$MOZ_ADDON_SIGNING" = 1; then
4198 AC_DEFINE(MOZ_ADDON_SIGNING)
4200 AC_SUBST(MOZ_REQUIRE_SIGNING)
4201 if test "$MOZ_REQUIRE_SIGNING" = 1; then
4202 AC_DEFINE(MOZ_REQUIRE_SIGNING)
4205 dnl ========================================================
4206 dnl = Mac bundle name prefix
4207 dnl ========================================================
4208 MOZ_ARG_WITH_STRING(macbundlename-prefix,
4209 [ --with-macbundlename-prefix=prefix
4210 Prefix for MOZ_MACBUNDLE_NAME],
4211 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
4213 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
4214 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
4215 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
4218 if test "$MOZ_DEBUG"; then
4219 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
4221 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
4223 AC_SUBST(MOZ_MACBUNDLE_NAME)
4225 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
4226 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
4227 # Otherwise, use MOZ_APP_DISPLAYNAME
4228 if test -z "$MOZ_MACBUNDLE_ID"; then
4229 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
4231 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
4232 if test "$MOZ_DEBUG"; then
4233 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
4236 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
4237 AC_SUBST(MOZ_MACBUNDLE_ID)
4239 dnl ========================================================
4240 dnl = Child Process Name for IPC
4241 dnl ========================================================
4242 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
4243 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
4245 # We want to let Android unpack the file at install time, but it only does
4246 # so if the file is named libsomething.so. The lib/ path is also required
4247 # because the unpacked file will be under the lib/ subdirectory and will
4248 # need to be executed from that path.
4249 MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
4251 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
4252 MOZ_CHILD_PROCESS_BUNDLENAME="${MOZ_APP_DISPLAYNAME}CP"
4254 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
4255 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
4256 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
4258 # The following variables are available to branding and application
4259 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
4260 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
4261 # impacts profile location and user-visible fields.
4262 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
4263 # versions of a given application (e.g. Aurora and Firefox both use
4264 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
4265 # for application.ini's "Name" field, which controls profile location in
4266 # the absence of a "Profile" field (see below), and various system
4267 # integration hooks (Unix remoting, Windows MessageWindow name, etc.)
4268 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
4269 # Mac Bundle name, Updater, Installer), it is typically used for nightly
4270 # builds (e.g. Aurora for Firefox).
4271 # - MOZ_APP_VERSION: Defines the application version number.
4272 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
4273 # in the "About" window. If not set, defaults to MOZ_APP_VERSION.
4274 # - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
4275 # defaults to a lowercase form of MOZ_APP_BASENAME.
4276 # - MOZ_APP_REMOTINGNAME: Used for the internal program name, which affects
4277 # profile name and remoting. If not set, defaults to MOZ_APP_NAME.
4278 # - MOZ_APP_PROFILE: When set, used for application.ini's
4279 # "Profile" field, which controls profile location.
4280 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
4281 # crash reporter server url.
4282 # - MOZ_APP_ANDROID_VERSION_CODE: On Android, "android:versionCode" for
4283 # the main application is set to the value of this variable. If not
4284 # set, it falls back to a Mozilla-specific value derived from the
4286 # - MOZ_ANDROID_SHARED_ID: On Android, "android:sharedUserId" for all Android
4287 # packages produced.
4288 # - MOZ_ANDROID_GCM_SENDERID: On Android, the Android GCM Sender ID used. GCM
4289 # sender IDs are not sensitive: see, http://stackoverflow.com/a/18216063.
4290 # - MOZ_MMA_GCM_SENDERID: This GCM Sender ID is used for MMA integration.
4291 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
4293 if test -z "$MOZ_APP_NAME"; then
4294 MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
4297 if test -z "$MOZ_APP_REMOTINGNAME"; then
4298 MOZ_APP_REMOTINGNAME=$MOZ_APP_NAME
4301 if test -z "$MOZ_APP_VERSION_DISPLAY"; then
4302 MOZ_APP_VERSION_DISPLAY=$MOZ_APP_VERSION
4305 if test -z "$ANDROID_PACKAGE_NAME" ; then
4306 # When we got rid of the Aurora channel we decided to replace the old
4307 # Nightly ANDROID_PACKAGE_NAME with Aurora. To make sure this is inherited
4308 # by all mozilla-central based branches we make this the new "default"
4309 # for Fennec. Non mozilla-central based branches set ANDROID_PACKAGE_NAME
4310 # in their mozconfig, so they will never get this. If there are ever
4311 # non-Fennec builds for Android, they will fall into the else block
4312 # and use their own default name.
4313 # https://bugzilla.mozilla.org/show_bug.cgi?id=1357808 has additional
4314 # background on this.
4315 if test "$MOZ_APP_NAME" = "fennec"; then
4316 ANDROID_PACKAGE_NAME="org.mozilla.fennec_aurora"
4318 ANDROID_PACKAGE_NAME="org.mozilla.$MOZ_APP_NAME"
4322 # Mozilla released Firefox for Android {Release,Beta} and {Aurora,Nightly} to
4323 # the public with specific common shared IDs and we need to keep them
4324 # consistent forever. The specific common values are set by per-channel
4325 # branding; all other channels use a generic sharedID, set below.
4326 if test -z "$MOZ_ANDROID_SHARED_ID" ; then
4327 MOZ_ANDROID_SHARED_ID="${ANDROID_PACKAGE_NAME}.sharedID"
4330 # For extensions and langpacks, we require a max version that is compatible
4331 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
4332 # 24.0a1 and 24.0a2 aren't affected
4334 # 24.1.1 becomes 24.*
4335 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
4336 if test -z "$IS_ALPHA"; then
4338 if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
4339 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
4341 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
4345 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
4348 AC_SUBST(MOZ_APP_NAME)
4349 AC_SUBST(MOZ_APP_REMOTINGNAME)
4350 AC_SUBST(MOZ_APP_DISPLAYNAME)
4351 AC_SUBST(MOZ_APP_BASENAME)
4352 AC_SUBST(MOZ_APP_VENDOR)
4353 AC_SUBST(MOZ_APP_PROFILE)
4354 AC_SUBST(MOZ_APP_ID)
4355 AC_SUBST(MOZ_APP_ANDROID_VERSION_CODE)
4356 AC_SUBST(MOZ_ANDROID_SHARED_ID)
4357 AC_SUBST(MOZ_ANDROID_GCM_SENDERID)
4358 AC_SUBST(MOZ_MMA_GCM_SENDERID)
4359 AC_SUBST(MAR_CHANNEL_ID)
4360 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
4361 AC_SUBST(MOZ_PROFILE_MIGRATOR)
4362 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
4363 AC_SUBST(MOZ_APP_UA_NAME)
4364 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
4365 AC_SUBST(MOZ_APP_VERSION)
4366 AC_SUBST(MOZ_APP_VERSION_DISPLAY)
4367 AC_SUBST(MOZ_APP_MAXVERSION)
4368 AC_DEFINE_UNQUOTED(FIREFOX_VERSION,$FIREFOX_VERSION)
4369 AC_SUBST(FIREFOX_VERSION)
4370 AC_SUBST(MOZ_UA_OS_AGNOSTIC)
4371 if test -n "$MOZ_UA_OS_AGNOSTIC"; then
4372 AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
4375 AC_SUBST(MOZ_PKG_SPECIAL)
4376 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
4378 if test "$MOZILLA_OFFICIAL"; then
4379 # Build revisions should always be present in official builds
4380 MOZ_INCLUDE_SOURCE_INFO=1
4383 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
4384 # explicitly set the repository and changeset information in.
4385 AC_SUBST(MOZ_SOURCE_REPO)
4386 AC_SUBST(MOZ_SOURCE_CHANGESET)
4387 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
4389 if test "$MOZ_TELEMETRY_REPORTING"; then
4390 AC_DEFINE(MOZ_TELEMETRY_REPORTING)
4392 # Enable Telemetry by default for nightly and aurora channels
4393 if test -z "$RELEASE_OR_BETA"; then
4394 AC_DEFINE(MOZ_TELEMETRY_ON_BY_DEFAULT)
4398 dnl If we have any service that uploads data (and requires data submission
4399 dnl policy alert), set MOZ_DATA_REPORTING.
4400 dnl We need SUBST for build system and DEFINE for xul preprocessor.
4401 if test -n "$MOZ_TELEMETRY_REPORTING" || test -n "$MOZ_SERVICES_HEALTHREPORT" || test -n "$MOZ_CRASHREPORTER"; then
4402 MOZ_DATA_REPORTING=1
4403 AC_DEFINE(MOZ_DATA_REPORTING)
4404 AC_SUBST(MOZ_DATA_REPORTING)
4408 AC_SUBST(WIN32_REDIST_DIR)
4409 AC_SUBST(WIN_UCRT_REDIST_DIR)
4411 dnl ========================================================
4413 dnl ========================================================
4417 if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
4423 dnl Echo the CFLAGS to remove extra whitespace.
4426 $_COMPILATION_CFLAGS \
4430 $_WARNINGS_CXXFLAGS \
4431 $_COMPILATION_CXXFLAGS \
4434 COMPILE_CFLAGS=`echo \
4438 COMPILE_CXXFLAGS=`echo \
4439 $_DEFINES_CXXFLAGS \
4443 $_WARNINGS_HOST_CFLAGS \
4444 $_COMPILATION_HOST_CFLAGS \
4447 HOST_CXXFLAGS=`echo \
4448 $_WARNINGS_HOST_CXXFLAGS \
4449 $_COMPILATION_HOST_CXXFLAGS \
4452 AC_SUBST(_DEPEND_CFLAGS)
4453 AC_SUBST(MOZ_SYSTEM_JPEG)
4454 AC_SUBST(MOZ_SYSTEM_PNG)
4455 AC_SUBST(MOZ_SYSTEM_BZ2)
4457 AC_SUBST_LIST(MOZ_JPEG_CFLAGS)
4458 AC_SUBST_LIST(MOZ_JPEG_LIBS)
4459 AC_SUBST_LIST(MOZ_BZ2_CFLAGS)
4460 AC_SUBST_LIST(MOZ_BZ2_LIBS)
4461 AC_SUBST_LIST(MOZ_PNG_CFLAGS)
4462 AC_SUBST_LIST(MOZ_PNG_LIBS)
4464 AC_SUBST(MOZ_SYSTEM_NSPR)
4466 AC_SUBST(MOZ_SYSTEM_NSS)
4468 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
4469 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
4470 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
4471 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
4472 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
4473 OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
4474 OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
4476 AC_SUBST(HOST_CMFLAGS)
4477 AC_SUBST(HOST_CMMFLAGS)
4478 AC_SUBST(OS_COMPILE_CMFLAGS)
4479 AC_SUBST(OS_COMPILE_CMMFLAGS)
4482 OS_CXXFLAGS="$CXXFLAGS"
4483 OS_CPPFLAGS="$CPPFLAGS"
4484 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
4485 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
4486 OS_LDFLAGS="$LDFLAGS"
4488 AC_SUBST_LIST(OS_CFLAGS)
4489 AC_SUBST_LIST(OS_CXXFLAGS)
4490 AC_SUBST_LIST(OS_CPPFLAGS)
4491 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
4492 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
4493 AC_SUBST_LIST(OS_LDFLAGS)
4498 AC_SUBST_LIST(HOST_CFLAGS)
4499 AC_SUBST_LIST(HOST_CPPFLAGS)
4500 AC_SUBST_LIST(HOST_CXXFLAGS)
4501 AC_SUBST(HOST_LDFLAGS)
4502 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
4504 AC_SUBST(HOST_AR_FLAGS)
4505 AC_SUBST(HOST_RANLIB)
4506 AC_SUBST(HOST_BIN_SUFFIX)
4508 AC_SUBST(TARGET_XPCOM_ABI)
4509 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
4510 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1)
4511 AC_SUBST(HAVE_X86_AVX2)
4512 AC_SUBST(HAVE_ALTIVEC)
4513 AC_SUBST(GCC_USE_GNU_LD)
4517 AC_SUBST_LIST(DSO_CFLAGS)
4518 AC_SUBST_LIST(DSO_PIC_CFLAGS)
4519 AC_SUBST(DSO_LDOPTS)
4520 AC_SUBST(BIN_SUFFIX)
4522 AC_SUBST(CC_VERSION)
4523 AC_SUBST(NS_ENABLE_TSF)
4524 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
4525 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
4527 AC_SUBST(MOZ_VORBIS)
4528 AC_SUBST(MOZ_TREMOR)
4530 AC_SUBST(MOZ_FFVPX_FLACONLY)
4531 AC_SUBST_LIST(FFVPX_ASFLAGS)
4532 AC_SUBST(VPX_USE_YASM)
4533 AC_SUBST_LIST(VPX_ASFLAGS)
4534 AC_SUBST(VPX_AS_CONVERSION)
4535 AC_SUBST(VPX_X86_ASM)
4536 AC_SUBST(VPX_ARM_ASM)
4537 AC_SUBST(LIBJPEG_TURBO_USE_YASM)
4538 AC_SUBST_LIST(LIBJPEG_TURBO_ASFLAGS)
4539 AC_SUBST(MOZ_LIBAV_FFT)
4540 AC_SUBST_LIST(LIBAV_FFT_ASFLAGS)
4541 AC_SUBST(MOZ_DEVTOOLS)
4543 AC_SUBST(MOZ_PACKAGE_JSSHELL)
4544 AC_SUBST(MOZ_FOLD_LIBS)
4545 AC_SUBST_LIST(MOZ_FOLD_LIBS_FLAGS)
4549 dnl Host JavaScript runtime, if any, to use during cross compiles.
4552 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
4554 if test -n "$COMPILE_ENVIRONMENT"; then
4555 AC_CHECK_FUNCS(posix_fadvise posix_fallocate)
4557 dnl Check for missing components
4558 if test "$MOZ_X11"; then
4559 dnl ====================================================
4560 dnl = Check if X headers exist
4561 dnl ====================================================
4562 _SAVE_CFLAGS=$CFLAGS
4563 CFLAGS="$CFLAGS $XCFLAGS"
4567 #include <X11/Xlib.h>
4568 #include <X11/Intrinsic.h>
4569 #include <X11/extensions/XShm.h>
4573 if ((dpy = XOpenDisplay(NULL)) == NULL) {
4574 fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
4578 [ AC_MSG_ERROR([Can't find X headers (install libxt-dev (Debian/Ubuntu), libXt-devel (Fedora), or xorg-x11-libXt-devel (SuSE)).]) ])
4579 CFLAGS="$_SAVE_CFLAGS"
4581 if test -n "$MISSING_X"; then
4582 AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
4587 fi # COMPILE_ENVIRONMENT
4589 dnl Set various defines and substitutions
4590 dnl ========================================================
4592 if test "$MOZ_DEBUG"; then
4593 AC_DEFINE(MOZ_REFLOW_PERF)
4594 AC_DEFINE(MOZ_REFLOW_PERF_DSP)
4597 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK" ; then
4598 AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
4599 ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
4600 ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
4601 ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
4602 ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
4603 AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
4604 AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
4605 AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
4608 AC_SUBST(MOZ_DEV_EDITION)
4609 if test -n "$MOZ_DEV_EDITION"; then
4610 AC_DEFINE(MOZ_DEV_EDITION)
4613 if test "$MOZ_DEBUG"; then
4616 case "$MOZ_UPDATE_CHANNEL" in
4617 aurora|beta|release|esr)
4624 if test -n "$A11Y_LOG"; then
4628 dnl Spit out some output
4629 dnl ========================================================
4631 dnl The following defines are used by xpcom
4632 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
4634 HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
4646 # Avoid using obsolete NSPR features
4647 AC_DEFINE(NO_NSPR_10_SUPPORT)
4649 # Don't build NSS libpkix
4650 NSS_DISABLE_LIBPKIX=1
4651 AC_SUBST(NSS_DISABLE_LIBPKIX)
4653 MOZ_CREATE_CONFIG_STATUS()
4655 if test -z "$direct_nspr_config"; then
4656 dnl ========================================================
4657 dnl = Setup a nice relatively clean build environment for
4658 dnl = sub-configures.
4659 dnl ========================================================
4662 CFLAGS="$_SUBDIR_CFLAGS"
4663 CPPFLAGS="$_SUBDIR_CPPFLAGS"
4664 CXXFLAGS="$_SUBDIR_CXXFLAGS"
4665 LDFLAGS="$_SUBDIR_LDFLAGS"
4666 HOST_CC="$_SUBDIR_HOST_CC"
4667 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
4668 HOST_CXXFLAGS="$_SUBDIR_HOST_CXXFLAGS"
4669 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
4676 # Run all configure scripts specified by a subconfigure
4677 if test -n "$_subconfigure_subdir"; then
4678 _save_srcdir="$srcdir"
4680 _save_ac_configure_args="$ac_configure_args"
4681 ac_configure_args="$_subconfigure_config_args"
4682 AC_OUTPUT_SUBDIRS_NOW("$_subconfigure_subdir",$cache_file)
4683 ac_configure_args="$_save_ac_configure_args"
4684 srcdir="$_save_srcdir"
4687 if test "$COMPILE_ENVIRONMENT" -a "$MOZ_WIDGET_TOOLKIT"; then
4690 dnl ========================================================
4691 dnl = Setup a nice relatively clean build environment for
4692 dnl = sub-configures.
4693 dnl ========================================================
4696 CFLAGS="$_SUBDIR_CFLAGS"
4697 CPPFLAGS="$_SUBDIR_CPPFLAGS"
4698 CXXFLAGS="$_SUBDIR_CXXFLAGS"
4699 LDFLAGS="$_SUBDIR_LDFLAGS"
4700 HOST_CC="$_SUBDIR_HOST_CC"
4701 HOST_CFLAGS="$_SUBDIR_HOST_CFLAGS"
4702 HOST_CXXFLAGS="$_SUBDIR_HOST_CXXFLAGS"
4703 HOST_LDFLAGS="$_SUBDIR_HOST_LDFLAGS"
4706 # Run the SpiderMonkey 'configure' script.
4707 dist=$MOZ_BUILD_ROOT/dist
4708 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
4710 # --with-system-nspr will have been converted into the relevant $NSPR_CFLAGS
4712 ac_configure_args="`echo $ac_configure_args | sed -e 's/--with-system-nspr\S* *//'`"
4714 if test "$_INTL_API" = no; then
4715 ac_configure_args="$ac_configure_args --without-intl-api"
4718 if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
4719 ac_configure_args="$ac_configure_args --with-nspr-cflags='$NSPR_CFLAGS'"
4720 ac_configure_args="$ac_configure_args --with-nspr-libs='$NSPR_LIBS'"
4722 ac_configure_args="$ac_configure_args --prefix=$dist"
4723 if test -n "$ZLIB_IN_MOZGLUE"; then
4726 export MOZ_SYSTEM_ZLIB
4727 export MOZ_ZLIB_CFLAGS
4728 export MOZ_ZLIB_LIBS
4730 export MOZ_APP_REMOTINGNAME
4731 export MOZ_DEV_EDITION
4733 export MOZILLA_CENTRAL_PATH=$_topsrcdir
4734 export STLPORT_CPPFLAGS
4739 export ZLIB_IN_MOZGLUE
4753 export HOST_CPPFLAGS
4754 export HOST_CXXFLAGS
4757 if ! test -e js; then
4761 ac_configure_args="$ac_configure_args JS_STANDALONE="
4762 AC_OUTPUT_SUBDIRS(js/src,$cache_file)
4763 ac_configure_args="$_SUBDIR_CONFIG_ARGS"
4765 fi # COMPILE_ENVIRONMENT
4767 dnl we need to run config.status after js/src subconfigure because we're
4768 dnl traversing its moz.build and we need its config.status for that.
4769 dnl However, writing our own config.status needs to happen before
4770 dnl subconfigures because the setup surrounding subconfigures alters
4771 dnl many AC_SUBSTed variables.
4772 MOZ_RUN_ALL_SUBCONFIGURES()
4774 rm -fr confdefs* $ac_clean_files