Bug 1610307 [wpt PR 21266] - Update wpt metadata, a=testonly
[gecko.git] / old-configure.in
blob841a82d5e9178f2cda3a26677afb2f2a0a3d80df
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 ========================================================
9 AC_PREREQ(2.13)
10 AC_INIT(config/config.mk)
11 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
12 AC_CANONICAL_SYSTEM
14 dnl ========================================================
15 dnl =
16 dnl = Don't change the following lines. Doing so breaks:
17 dnl =
18 dnl = CFLAGS="-foo" ./configure
19 dnl =
20 dnl ========================================================
21 CFLAGS="${CFLAGS=}"
22 CPPFLAGS="${CPPFLAGS=}"
23 CXXFLAGS="${CXXFLAGS=}"
24 LDFLAGS="${LDFLAGS=}"
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 ========================================================
34 _SUBDIR_CC="$CC"
35 _SUBDIR_CXX="$CXX"
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 ========================================================
48 MOZPNG=10635
49 NSPR_VERSION=4
50 NSPR_MINVER=4.25
51 NSS_VERSION=3
53 dnl Set the minimum version of toolkit libs used by mozilla
54 dnl ========================================================
55 GLIB_VERSION=2.22
56 # 2_26 is the earliest version we can set GLIB_VERSION_MIN_REQUIRED.
57 # The macro won't be used when compiling with earlier versions anyway.
58 GLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_26
59 CAIRO_VERSION=1.10
60 GTK2_VERSION=2.18.0
61 GTK3_VERSION=3.4.0
62 GDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_4
63 W32API_VERSION=3.14
64 DBUS_VERSION=0.60
65 SQLITE_VERSION=3.30.1
67 dnl Set various checks
68 dnl ========================================================
69 MISSING_X=
71 dnl Initialize the Pthread test variables early so they can be
72 dnl  overridden by each platform.
73 dnl ========================================================
74 MOZ_USE_PTHREADS=
75 _PTHREAD_LDFLAGS=""
77 LDFLAGS="$LDFLAGS $LINKER_LDFLAGS"
79 if test "$COMPILE_ENVIRONMENT"; then
80     MOZ_ANDROID_NDK
81 fi # COMPILE_ENVIRONMENT
83 case "$target" in
84 *-android*|*-linuxandroid*)
85     ;;
86 *-linux*)
87     AC_PATH_PROG(OBJCOPY,objcopy)
88     ;;
89 esac
91 case "$target" in
92 *-apple-darwin*)
93     MOZ_IOS_SDK
94     ;;
95 esac
97 AC_SUBST(ANDROID_PACKAGE_NAME)
98 AC_SUBST(OBJCOPY)
100 dnl ========================================================
101 dnl Checks for compilers.
102 dnl ========================================================
104 if test "$COMPILE_ENVIRONMENT"; then
106 if test "$target" != "$host"; then
107     MOZ_CROSS_COMPILER
108 else
109     AC_PROG_CC
110     case "$target" in
111     *-mingw*)
112       # Work around the conftest.exe access problem on Windows
113       sleep 2
114     esac
115     AC_PROG_CXX
116     AC_PROG_RANLIB
117     MOZ_PATH_PROGS(AS, $AS as, $CC)
118     AC_CHECK_PROGS(STRIP, strip, :)
119     AC_CHECK_PROGS(OTOOL, otool, :)
122 if test -n "$MOZ_WINCONSOLE"; then
123     AC_DEFINE(MOZ_WINCONSOLE)
126 MOZ_TOOL_VARIABLES
128 dnl ========================================================
129 dnl Special win32 checks
130 dnl ========================================================
132 WINVER=601
134 case "$target" in
135 *-mingw*)
136     if test "$GCC" != "yes"; then
137         # Check to see if we are really running in a msvc environemnt
138         _WIN32_MSVC=1
140         # Make sure compilers are valid
141         CFLAGS="$CFLAGS -nologo"
142         CXXFLAGS="$CXXFLAGS -TP -nologo"
143         AC_LANG_SAVE
144         AC_LANG_C
145         AC_TRY_COMPILE([#include <stdio.h>],
146             [ printf("Hello World\n"); ],,
147             AC_MSG_ERROR([\$(CC) test failed.  You must have MS VC++ in your path to build.]) )
149         AC_LANG_CPLUSPLUS
150         AC_TRY_COMPILE([#include <new.h>],
151             [ unsigned *test = new unsigned(42); ],,
152             AC_MSG_ERROR([\$(CXX) test failed.  You must have MS VC++ in your path to build.]) )
153         AC_LANG_RESTORE
155         changequote(,)
156         _MSVC_VER_FILTER='s|.*[^!-~]([0-9]+\.[0-9]+\.[0-9]+(\.[0-9]+)?).*|\1|p'
157         changequote([,])
159         AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
160         AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
161         AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI.
163         _CC_SUITE=14
164         MSVC_C_RUNTIME_DLL=vcruntime140.dll
165         MSVC_CXX_RUNTIME_DLL=msvcp140.dll
167         # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
168         CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
170         if test -n "$WIN_UCRT_REDIST_DIR"; then
171           if test ! -d "$WIN_UCRT_REDIST_DIR"; then
172             AC_MSG_ERROR([Invalid Windows UCRT Redist directory: ${WIN_UCRT_REDIST_DIR}])
173           fi
174           WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && pwd -W`
175         fi
177         AC_SUBST(MSVC_C_RUNTIME_DLL)
178         AC_SUBST(MSVC_CXX_RUNTIME_DLL)
180         AC_DEFINE(HAVE_SEH_EXCEPTIONS)
182         if test -n "$WIN32_REDIST_DIR"; then
183           if test ! -d "$WIN32_REDIST_DIR"; then
184             AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
185           fi
186           WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && pwd -W`
187         fi
189         # Check linker version, except in lld builds
190         case "$LINKER" in
191         *lld*)
192             ;;
193         *)
194             _LD_FULL_VERSION=`"${LINKER}" -v 2>&1 | sed -nre "$_MSVC_VER_FILTER"`
195             _LD_MAJOR_VERSION=`echo ${_LD_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
196             if test "$_LD_MAJOR_VERSION" != "$_CC_SUITE"; then
197                 AC_MSG_ERROR([The linker major version, $_LD_FULL_VERSION,  does not match the compiler suite version, $_CC_SUITE.])
198             fi
199             ;;
200         esac
202         INCREMENTAL_LINKER=1
204         unset _MSVC_VER_FILTER
206         WRAP_STL_INCLUDES=1
207         STL_FLAGS="-I${DIST}/stl_wrappers"
208     else
209         # Check w32api version
210         _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
211         _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
212         AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
213         AC_TRY_COMPILE([#include <w32api.h>],
214             #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
215                 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
216                  __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
217                 #error "test failed."
218             #endif
219             , [ res=yes ], [ res=no ])
220         AC_MSG_RESULT([$res])
221         if test "$res" != "yes"; then
222             AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
223         fi
224         # strsafe.h on mingw uses macros for function deprecation that pollutes namespace
225         # causing problems with local implementations with the same name.
226         AC_DEFINE(STRSAFE_NO_DEPRECATE)
227     fi # !GNU_CC
229     CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
230     CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
232     AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
233     AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
234     # Require OS features provided by IE 8.0 (Win7)
235     AC_DEFINE_UNQUOTED(_WIN32_IE,0x0800)
237     ;;
238 esac
240 if test -n "$_WIN32_MSVC"; then
241     SKIP_PATH_CHECKS=1
242     SKIP_COMPILER_CHECKS=1
243     SKIP_LIBRARY_CHECKS=1
245     # Since we're skipping compiler and library checks, hard-code
246     # some facts here.
247     AC_DEFINE(HAVE_IO_H)
248     AC_DEFINE(HAVE_ISATTY)
251 fi # COMPILE_ENVIRONMENT
253 AC_SUBST(GNU_CC)
254 AC_SUBST(GNU_CXX)
256 AC_SUBST_LIST(STL_FLAGS)
257 AC_SUBST(WRAP_STL_INCLUDES)
259 dnl ========================================================
260 dnl Checks for programs.
261 dnl ========================================================
262 if test "$COMPILE_ENVIRONMENT"; then
264 AC_PATH_XTRA
266 XCFLAGS="$X_CFLAGS"
268 fi # COMPILE_ENVIRONMENT
270 dnl ========================================================
271 dnl set the defaults first
272 dnl ========================================================
273 MOZ_USER_DIR=".mozilla"
275 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
277 MOZ_FS_LAYOUT=unix
279 dnl Configure platform-specific CPU architecture compiler options.
280 dnl ==============================================================
281 if test "$COMPILE_ENVIRONMENT"; then
282     MOZ_ARCH_OPTS
283 fi # COMPILE_ENVIRONMENT
285 dnl ========================================================
286 dnl Android libstdc++
287 dnl ========================================================
289 MOZ_ANDROID_CPU_ARCH
290 if test "$COMPILE_ENVIRONMENT"; then
291     MOZ_ANDROID_STLPORT
292 fi # COMPILE_ENVIRONMENT
294 dnl ========================================================
295 dnl Suppress Clang Argument Warnings
296 dnl ========================================================
297 WARNINGS_CFLAGS="$_WARNINGS_CFLAGS"
298 if test -n "${CLANG_CC}${CLANG_CL}"; then
299     WARNINGS_CFLAGS="-Qunused-arguments $WARNINGS_CFLAGS"
300     CPPFLAGS="-Qunused-arguments ${CPPFLAGS}"
302 if test -n "${CLANG_CXX}${CLANG_CL}"; then
303     _WARNINGS_CXXFLAGS="-Qunused-arguments ${_WARNINGS_CXXFLAGS}"
306 if test -n "$COMPILE_ENVIRONMENT"; then
307    MOZ_CONFIG_SANITIZE
310 dnl ========================================================
311 dnl GNU specific defaults
312 dnl ========================================================
313 if test "$GNU_CC"; then
314     MMX_FLAGS="-mmmx"
315     SSE_FLAGS="-msse"
316     SSE2_FLAGS="-msse2"
317     SSSE3_FLAGS="-mssse3"
318     CFLAGS="$CFLAGS -fno-strict-aliasing"
319     DSO_CFLAGS=''
321     if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
322         DSO_PIC_CFLAGS='-fPIC'
323         ASFLAGS="$ASFLAGS -fPIC"
324     fi
326     AC_MSG_CHECKING([for --noexecstack option to as])
327     _SAVE_CFLAGS=$CFLAGS
328     CFLAGS="$CFLAGS -Wa,--noexecstack"
329     AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
330                      [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
331                      AC_MSG_RESULT([no]))
332     CFLAGS=$_SAVE_CFLAGS
333     AC_MSG_CHECKING([for -z noexecstack option to ld])
334     _SAVE_LDFLAGS=$LDFLAGS
335     LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
336     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
337                   AC_MSG_RESULT([no])
338                   LDFLAGS=$_SAVE_LDFLAGS)
340     AC_MSG_CHECKING([for -z text option to ld])
341     _SAVE_LDFLAGS=$LDFLAGS
342     LDFLAGS="$LDFLAGS -Wl,-z,text"
343     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
344                   AC_MSG_RESULT([no])
345                   LDFLAGS=$_SAVE_LDFLAGS)
347     AC_MSG_CHECKING([for -z relro option to ld])
348     _SAVE_LDFLAGS=$LDFLAGS
349     LDFLAGS="$LDFLAGS -Wl,-z,relro"
350     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
351                   AC_MSG_RESULT([no])
352                   LDFLAGS=$_SAVE_LDFLAGS)
354     AC_MSG_CHECKING([for -z nocopyreloc option to ld])
355     _SAVE_LDFLAGS=$LDFLAGS
356     LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
357     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
358                   AC_MSG_RESULT([no])
359                   LDFLAGS=$_SAVE_LDFLAGS)
361     AC_MSG_CHECKING([for -Bsymbolic-functions option to ld])
362     _SAVE_LDFLAGS=$LDFLAGS
363     LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
364     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
365                   AC_MSG_RESULT([no])
366                   LDFLAGS=$_SAVE_LDFLAGS)
368     AC_MSG_CHECKING([for --build-id=sha1 option to ld])
369     _SAVE_LDFLAGS=$LDFLAGS
370     LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
371     AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
372                   AC_MSG_RESULT([no])
373                   LDFLAGS=$_SAVE_LDFLAGS)
375     AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
376     HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
377     _SAVE_LDFLAGS=$LDFLAGS
378     LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
379     AC_TRY_LINK(,,AC_MSG_RESULT([yes])
380                   [HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1],
381                   AC_MSG_RESULT([no]))
382     LDFLAGS=$_SAVE_LDFLAGS
384     # Check for -mssse3 on $CC
385     AC_MSG_CHECKING([if toolchain supports -mssse3 option])
386     HAVE_TOOLCHAIN_SUPPORT_MSSSE3=
387     _SAVE_CFLAGS=$CFLAGS
388     CFLAGS="$CFLAGS -mssse3"
389     AC_TRY_COMPILE([asm ("pmaddubsw %xmm2,%xmm3");],,AC_MSG_RESULT([yes])
390                      [HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1],
391                      AC_MSG_RESULT([no]))
392     CFLAGS=$_SAVE_CFLAGS
394     # Check for -msse4.1 on $CC
395     AC_MSG_CHECKING([if toolchain supports -msse4.1 option])
396     HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=
397     _SAVE_CFLAGS=$CFLAGS
398     CFLAGS="$CFLAGS -msse4.1"
399     AC_TRY_COMPILE([asm ("pmulld %xmm6,%xmm0");],,AC_MSG_RESULT([yes])
400                      [HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1],
401                      AC_MSG_RESULT([no]))
402     CFLAGS=$_SAVE_CFLAGS
404     case "${CPU_ARCH}" in
405     x86 | x86_64)
406       AC_MSG_CHECKING(for x86 AVX2 asm support in compiler)
407       AC_TRY_COMPILE([],
408                      [asm volatile ("vpermq      \$0xd8,%ymm0,%ymm0 \n");],
409                      result="yes", result="no")
410       AC_MSG_RESULT("$result")
411       if test "$result" = "yes"; then
412           HAVE_X86_AVX2=1
413       fi
414       ;;
416     ppc*)
417       AC_MSG_CHECKING([whether we can enable AltiVec support])
418       HAVE_ALTIVEC=
419       _SAVE_CFLAGS=$CFLAGS
420       CFLAGS="$CFLAGS -maltivec"
421       AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
422                        [HAVE_ALTIVEC=1],
423                        AC_MSG_RESULT([no]))
424       CFLAGS=$_SAVE_CFLAGS
425       ;;
426     esac
428     DSO_LDOPTS='-shared'
429     if test "$GCC_USE_GNU_LD"; then
430         # Some tools like ASan use a runtime library that is only
431         # linked against executables, so we must allow undefined
432         # symbols for shared objects in some cases.
433         if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
434             # Don't allow undefined symbols in libraries
435             DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
437             # BSDs need `environ' exposed for posix_spawn (bug 753046)
438             case "$OS_TARGET" in
439             DragonFly|FreeBSD|NetBSD|OpenBSD)
440                 if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then
441                     DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
442                 else
443                     DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
444                 fi
445                 ;;
446             esac
447         fi
448     fi
450     _DEFINES_CFLAGS="-include $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
451     _USE_CPP_INCLUDE_FLAG=1
453     ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
456 if test "$GNU_CXX"; then
457     CXXFLAGS="$CXXFLAGS -fno-exceptions -fno-strict-aliasing"
459     _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
460     _USE_CPP_INCLUDE_FLAG=1
463 # For profiling builds keep the symbol information
464 if test "$MOZ_PROFILING" -a -z "$STRIP_FLAGS"; then
465     case "$OS_TARGET" in
466     Linux|DragonFly|FreeBSD|NetBSD|OpenBSD)
467         STRIP_FLAGS="--strip-debug"
468         ;;
469     esac
472 dnl ========================================================
473 dnl = Enable DMD
474 dnl ========================================================
476 if test "$MOZ_DMD"; then
477     if test "${CPU_ARCH}" = "arm"; then
478         CFLAGS="$CFLAGS -funwind-tables"
479         CXXFLAGS="$CXXFLAGS -funwind-tables"
480     fi
483 dnl ========================================================
484 dnl System overrides of the defaults for host
485 dnl ========================================================
486 case "$host" in
487 *mingw*)
488     if test -n "$_WIN32_MSVC"; then
489         HOST_CFLAGS="$HOST_CFLAGS -nologo"
490     else
491         HOST_CFLAGS="$HOST_CFLAGS -mwindows"
492     fi
493     HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
494     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
495     HOST_BIN_SUFFIX=.exe
497     case "${host_cpu}" in
498     i*86)
499         if test -n "$_WIN32_MSVC"; then
500             HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
501         fi
502         ;;
503     x86_64)
504         if test -n "$_WIN32_MSVC"; then
505             HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
506         fi
507         HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
508         ;;
509     esac
510     ;;
512 *-darwin*)
513     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
514     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
515     ;;
517 *-linux*|*-kfreebsd*-gnu|*-gnu*)
518     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
519     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
520     ;;
523     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
524     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
525     ;;
526 esac
528 dnl ========================================================
529 dnl System overrides of the defaults for target
530 dnl ========================================================
532 case "$target" in
533 *-darwin*)
534     MOZ_OPTIMIZE_FLAGS="-O3"
535     CXXFLAGS="$CXXFLAGS -stdlib=libc++"
536     DSO_LDOPTS=''
537     STRIP_FLAGS="$STRIP_FLAGS -x -S"
538     # Ensure that if we're targeting iOS an SDK was provided.
539     AC_CACHE_CHECK(for iOS target,
540                    ac_cv_ios_target,
541                    [AC_TRY_COMPILE([#include <TargetConditionals.h>
542 #if !(TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR)
543 #error not iOS
544 #endif],
545                                    [],
546                                    ac_cv_ios_target="yes",
547                                    ac_cv_ios_target="no")])
548     if test "$ac_cv_ios_target" = "yes" -a -z $MOZ_IOS; then
549        AC_MSG_ERROR([targeting iOS but not using an iOS SDK?])
550     fi
551     if test -z "$MOZ_IOS"; then
552         # The ExceptionHandling framework is needed for Objective-C exception
553         # logging code in nsObjCExceptions.h. Currently we only use that in debug
554         # builds.
555         MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -framework ExceptionHandling";
556     fi
558     dnl DTrace and -dead_strip don't interact well. See bug 403132.
559     dnl ===================================================================
560     if test "x$enable_dtrace" = "xyes"; then
561         echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
562     else
563         dnl check for the presence of the -dead_strip linker flag
564         AC_MSG_CHECKING([for -dead_strip option to ld])
565         _SAVE_LDFLAGS=$LDFLAGS
566         LDFLAGS="$LDFLAGS -Wl,-dead_strip"
567         AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
568         if test -n "$_HAVE_DEAD_STRIP" ; then
569             AC_MSG_RESULT([yes])
570             MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
571         else
572             AC_MSG_RESULT([no])
573         fi
575         LDFLAGS=$_SAVE_LDFLAGS
576     fi
578     MOZ_FIX_LINK_PATHS="-Wl,-executable_path,${DIST}/bin"
579     ;;
581 *-android*|*-linuxandroid*)
582     if test "$COMPILE_ENVIRONMENT" -a -n "$MOZ_MEMORY"; then
583         MOZ_LINKER=1
584     fi
586     MOZ_GFX_OPTIMIZE_MOBILE=1
587     if test -z "$CLANG_CC"; then
588         MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions -Os"
589     else
590         MOZ_OPTIMIZE_FLAGS="-O2"
591     fi
592     ;;
594 *-*linux*)
595     if test "$GNU_CC" -o "$GNU_CXX"; then
596         MOZ_PGO_OPTIMIZE_FLAGS="-O3"
597         if test -n "$MOZ_DEBUG"; then
598             MOZ_OPTIMIZE_FLAGS="-Os"
599         else
600             MOZ_OPTIMIZE_FLAGS="-O2"
601         fi
602         if test -z "$CLANG_CC"; then
603            MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
604         fi
605     fi
607     case "${target_cpu}" in
608     alpha*)
609         CFLAGS="$CFLAGS -mieee"
610         CXXFLAGS="$CXXFLAGS -mieee"
611     ;;
612     esac
613     ;;
614 *-mingw*)
615     DSO_CFLAGS=
616     DSO_PIC_CFLAGS=
617     # certain versions of cygwin's makedepend barf on the
618     # #include <string> vs -I./dist/include/string issue so don't use it
619     if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
620         # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
621         if test -z "$CLANG_CC"; then
622             AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
623         fi
625         DSO_LDOPTS='-shared'
626         # Use temp file for windres (bug 213281)
627         RCFLAGS='-O coff --use-temp-file'
628         # mingw doesn't require kernel32, user32, and advapi32 explicitly
629         LIBS="$LIBS -luuid -lusp10 -lgdi32 -lwinmm -lwsock32 -luserenv -lsecur32"
630         MOZ_FIX_LINK_PATHS=
632         MOZ_OPTIMIZE_FLAGS="-O2"
634         WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
635         WIN32_GUI_EXE_LDFLAGS=-mwindows
637         # Silence problematic clang warnings
638         CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
639     else
640         TARGET_COMPILER_ABI=msvc
641         RANLIB='echo not_ranlib'
642         STRIP='echo not_strip'
643         PKG_SKIP_STRIP=1
644         # aarch64 doesn't support subsystems below 6.02
645         if test "$CPU_ARCH" = "aarch64"; then
646             WIN32_SUBSYSTEM_VERSION=6.02
647         else
648             WIN32_SUBSYSTEM_VERSION=6.01
649         fi
650         WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
651         WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
652         DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
653         _USE_CPP_INCLUDE_FLAG=1
654         _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
655         _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
656         CFLAGS="$CFLAGS -W3 -Gy -Zc:inline"
657         CXXFLAGS="$CXXFLAGS -W3 -Gy -Zc:inline"
658         if test -z "$CLANG_CL"; then
659             CPPFLAGS="$CPPFLAGS -utf-8"
660         fi
661         if test "$CPU_ARCH" = "x86"; then
662             dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
663             dnl more recent, so set that explicitly here unless another
664             dnl target arch has already been set.
665             changequote(,)
666             if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
667               CFLAGS="$CFLAGS -arch:SSE2"
668             fi
669             if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
670               CXXFLAGS="$CXXFLAGS -arch:SSE2"
671             fi
672             changequote([,])
673             SSE_FLAGS="-arch:SSE"
674             SSE2_FLAGS="-arch:SSE2"
675             dnl MSVC allows the use of intrinsics without any flags
676             dnl and doesn't have a separate arch for SSSE3
677             SSSE3_FLAGS="-arch:SSE2"
678         fi
679         dnl clang-cl requires appropriate flags to enable SSSE3 support
680         dnl on all architectures.
681         if test -n "$CLANG_CL"; then
682             SSSE3_FLAGS="-mssse3"
683         fi
684         dnl VS2013+ supports -Gw for better linker optimizations.
685         dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
686         dnl Disabled on ASan because it causes false-positive ODR violations.
687         if test -z "$MOZ_ASAN"; then
688             CFLAGS="$CFLAGS -Gw"
689             CXXFLAGS="$CXXFLAGS -Gw"
690         else
691             # String tail merging doesn't play nice with ASan's ODR checker.
692             LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
693         fi
694         if test -n "$CLANG_CL"; then
695             # XXX We should combine some of these with our generic GCC-style
696             # warning checks.
697             #
698             # Suppress the clang-cl warning for the inline 'new' and 'delete' in mozalloc
699             CXXFLAGS="$CXXFLAGS -Wno-inline-new-delete"
700             # We use offsetof on non-POD objects all the time.
701             # We also suppress this warning on other platforms.
702             CXXFLAGS="$CXXFLAGS -Wno-invalid-offsetof"
703             # This warns for reasonable things like:
704             #   enum { X = 0xffffffffU };
705             # which is annoying for IDL headers.
706             CXXFLAGS="$CXXFLAGS -Wno-microsoft-enum-value"
707             # This warns for cases that would be reached by the Microsoft
708             # #include rules, but also currently warns on cases that would
709             # *also* be reached by standard C++ include rules.  That
710             # behavior doesn't seem useful, so we turn it off.
711             CXXFLAGS="$CXXFLAGS -Wno-microsoft-include"
712             # We normally error out on unknown pragmas, but since clang-cl
713             # claims to be MSVC, it would be difficult to add
714             # #if defined(_MSC_VER) && !defined(__clang__) everywhere we
715             # use such pragmas, so just ignore them.
716             CFLAGS="$CFLAGS -Wno-unknown-pragmas"
717             CXXFLAGS="$CXXFLAGS -Wno-unknown-pragmas"
718             # We get errors about various #pragma intrinsic directives from
719             # clang-cl, and we don't need to hear about those.
720             CFLAGS="$CFLAGS -Wno-ignored-pragmas"
721             CXXFLAGS="$CXXFLAGS -Wno-ignored-pragmas"
722             # clang-cl's Intrin.h marks things like _ReadWriteBarrier
723             # as __attribute((__deprecated__)).  This is nice to know,
724             # but since we don't get the equivalent warning from MSVC,
725             # let's just ignore it.
726             CFLAGS="$CFLAGS -Wno-deprecated-declarations"
727             CXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations"
728             # We use a function like:
729             #   __declspec(noreturn) __inline void f() {}
730             # which -Winvalid-noreturn complains about.  Again, MSVC seems
731             # OK with it, so let's silence the warning.
732             CFLAGS="$CFLAGS -Wno-invalid-noreturn"
733             CXXFLAGS="$CXXFLAGS -Wno-invalid-noreturn"
734             # Missing |override| on virtual function declarations isn't
735             # something that MSVC currently warns about.
736             CXXFLAGS="$CXXFLAGS -Wno-inconsistent-missing-override"
737             # We use -DHAS_EXCEPTIONS=0, which removes the |throw()|
738             # declaration on |operator delete(void*)|.  However, clang-cl
739             # must internally declare |operator delete(void*)| differently,
740             # which causes this warning for virtually every file in the
741             # tree.  clang-cl doesn't support -fno-exceptions or equivalent,
742             # so there doesn't seem to be any way to convince clang-cl to
743             # declare |delete| differently.  Therefore, suppress this
744             # warning.
745             CXXFLAGS="$CXXFLAGS -Wno-implicit-exception-spec-mismatch"
746             # Macros like STDMETHOD() and IFACEMETHOD() can declare
747             # __attribute__((nothrow)) on their respective method declarations,
748             # while the definitions are left without the matching attribute.
749             CXXFLAGS="$CXXFLAGS -Wno-microsoft-exception-spec"
750             # At least one MSVC header and several headers in-tree have
751             # unused typedefs, so turn this on.
752             CXXFLAGS="$CXXFLAGS -Wno-unused-local-typedef"
753             # jemalloc uses __declspec(allocator) as a profiler hint,
754             # which clang-cl doesn't understand.
755             CXXFLAGS="$CXXFLAGS -Wno-ignored-attributes"
756             # __attribute__((unused)) really means "might be unused" and
757             # we use it to avoid warnings about things that are unused
758             # in some compilation units, but used in many others.  This
759             # warning insists on complaining about the latter case, which
760             # is annoying, and rather noisy.
761             CXXFLAGS="$CXXFLAGS -Wno-used-but-marked-unused"
762         fi
763         # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
764         CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
765         LIBS="$LIBS user32.lib gdi32.lib winmm.lib wsock32.lib advapi32.lib secur32.lib"
766         MOZ_DEBUG_LDFLAGS='-DEBUG'
767         # Use a higher optimization level for clang-cl, so we can come closer
768         # to MSVC's performance numbers (see bug 1443590).
769         if test -n "$CLANG_CL"; then
770             MOZ_OPTIMIZE_FLAGS='-O2'
771         else
772             MOZ_OPTIMIZE_FLAGS='-O1 -Oi'
773         fi
774         MOZ_FIX_LINK_PATHS=
775         LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
776         if test -z "$DEVELOPER_OPTIONS"; then
777             LDFLAGS="$LDFLAGS -RELEASE"
778         fi
779         RCFLAGS="-nologo"
780         dnl Minimum reqiurement of Gecko is VS2015 or later which supports
781         dnl both SSSE3 and SSE4.1.
782         HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1
783         HAVE_TOOLCHAIN_SUPPORT_MSSE4_1=1
784         dnl allow AVX2 code from VS2015
785         HAVE_X86_AVX2=1
786     fi
787     AC_DEFINE(WIN32_LEAN_AND_MEAN)
788     dnl See http://support.microsoft.com/kb/143208 to use STL
789     AC_DEFINE(NOMINMAX)
790     BIN_SUFFIX='.exe'
791     MOZ_USER_DIR="Mozilla"
793     case "$host_os" in
794     cygwin*|msvc*|mks*)
795         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.])
796         ;;
797     esac
799     case "$target" in
800     i*86-*)
801         if test -n "$GNU_CC"; then
802             CFLAGS="$CFLAGS -mstackrealign"
803             CXXFLAGS="$CXXFLAGS -mstackrealign"
804             LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
805         else
806             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
807             LDFLAGS="$LDFLAGS -SAFESEH"
808         fi
810         AC_DEFINE(_X86_)
811         ;;
812     x86_64-*)
813         if test -n "$_WIN32_MSVC"; then
814             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
815         fi
816         AC_DEFINE(_AMD64_)
817         ;;
818     aarch64-*)
819         if test -n "$_WIN32_MSVC"; then
820             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
821         fi
822         AC_DEFINE(_ARM64_)
823         ;;
824     *)
825         AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
826         ;;
827     esac
828     ;;
830 *-netbsd*)
831     DSO_CFLAGS=''
832     CFLAGS="$CFLAGS -Dunix"
833     CXXFLAGS="$CXXFLAGS -Dunix"
834     if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
835         DSO_PIC_CFLAGS='-fPIC -DPIC'
836         DSO_LDOPTS='-shared'
837         MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
838     else
839         DSO_PIC_CFLAGS='-fPIC -DPIC'
840         DSO_LDOPTS='-shared'
841     fi
842     # This will fail on a.out systems prior to 1.5.1_ALPHA.
843     if test "$LIBRUNPATH"; then
844         DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
845     fi
846     ;;
848 *-openbsd*)
849     if test -z "$X11BASE"; then
850         X11BASE=/usr/X11R6
851     fi
852     MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
853     DSO_CFLAGS=''
854     DSO_PIC_CFLAGS='-fPIC'
855     DSO_LDOPTS='-shared -fPIC'
856     if test "$LIBRUNPATH"; then
857         DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
858     fi
859     ;;
861 *-solaris*)
862     MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
863     ;;
865 esac
867 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
868     MOZ_OPTIMIZE_FLAGS="-O"
871 AC_SUBST_LIST(MMX_FLAGS)
872 AC_SUBST_LIST(SSE_FLAGS)
873 AC_SUBST_LIST(SSE2_FLAGS)
874 AC_SUBST_LIST(SSSE3_FLAGS)
876 AC_SUBST(MOZ_LINKER)
877 if test -n "$MOZ_LINKER"; then
878   AC_DEFINE(MOZ_LINKER)
879   MOZ_LINKER_EXTRACT=1
880   AC_CHECK_PROGS(XZ, xz)
883 if test -z "$COMPILE_ENVIRONMENT"; then
884     SKIP_COMPILER_CHECKS=1
885     SKIP_LIBRARY_CHECKS=1
886     PKG_SKIP_STRIP=1
887     MOZ_DEBUGGING_OPTS
888 else
889     MOZ_COMPILER_OPTS
890 fi # COMPILE_ENVIRONMENT
892 if test -z "$SKIP_COMPILER_CHECKS"; then
893 dnl Checks for typedefs, structures, and compiler characteristics.
894 dnl ========================================================
895 AC_C_CONST
896 AC_TYPE_MODE_T
897 AC_TYPE_OFF_T
898 AC_TYPE_PID_T
899 AC_TYPE_SIZE_T
900 AC_LANG_CPLUSPLUS
901 AC_LANG_C
903 AC_LANG_CPLUSPLUS
905 MOZ_CXX11
907 AC_LANG_C
909 case "${OS_TARGET}" in
910 Darwin)
911   ;;
913   STL_FLAGS="-I${DIST}/stl_wrappers"
914   WRAP_STL_INCLUDES=1
915   ;;
916 esac
918 if test "$MOZ_BUILD_APP" = "tools/crashreporter"; then
919     WRAP_STL_INCLUDES=
922 dnl Checks for header files.
923 dnl ========================================================
924 AC_HEADER_DIRENT
925 case "$target_os" in
926 bitrig*|dragonfly*|freebsd*|openbsd*)
927 # for stuff like -lXshm
928     CPPFLAGS="${CPPFLAGS} ${X_CFLAGS}"
929     ;;
930 esac
932 dnl Check for sin_len and sin6_len - used by SCTP; only appears in Mac/*BSD generally
933 AC_CACHE_CHECK(for sockaddr_in.sin_len,
934                    ac_cv_sockaddr_in_sin_len,
935                    [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
936                                     #include <sys/types.h>
937                                     #endif
938                                     #include <netinet/in.h>
939                                     struct sockaddr_in x;
940                                     void *foo = (void*) &x.sin_len;],
941                                    [],
942                                    [ac_cv_sockaddr_in_sin_len=true],
943                                    [ac_cv_sockaddr_in_sin_len=false])])
944 if test "$ac_cv_sockaddr_in_sin_len" = true ; then
945   AC_DEFINE(HAVE_SIN_LEN)
946 dnl HAVE_CONN_LEN must be the same as HAVE_SIN_LEN (and HAVE_SIN6_LEN too)
947   AC_DEFINE(HAVE_SCONN_LEN)
950 AC_CACHE_CHECK(for sockaddr_in6.sin6_len,
951                ac_cv_sockaddr_in6_sin6_len,
952                [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
953                                 #include <sys/types.h>
954                                 #endif
955                                 #include <netinet/in.h>
956                                 struct sockaddr_in6 x;
957                                 void *foo = (void*) &x.sin6_len;],
958                                [],
959                                [ac_cv_sockaddr_in6_sin6_len=true],
960                                [ac_cv_sockaddr_in6_sin6_len=false])])
961 if test "$ac_cv_sockaddr_in6_sin6_len" = true ; then
962   AC_DEFINE(HAVE_SIN6_LEN)
965 AC_CACHE_CHECK(for sockaddr.sa_len,
966                ac_cv_sockaddr_sa_len,
967                [AC_TRY_COMPILE([#ifdef HAVE_SYS_TYPES_H
968                                 #include <sys/types.h>
969                                 #endif
970                                 #include <sys/socket.h>
971                                 struct sockaddr x;
972                                 void *foo = (void*) &x.sa_len;],
973                                [],
974                                [ac_cv_sockaddr_sa_len=true],
975                                [ac_cv_sockaddr_sa_len=false])])
976 if test "$ac_cv_sockaddr_sa_len" = true ; then
977   AC_DEFINE(HAVE_SA_LEN)
980 MOZ_ARG_ENABLE_BOOL(dtrace,
981               [  --enable-dtrace         build with dtrace support if available (default=no)],
982               [enable_dtrace="yes"],)
983 if test "x$enable_dtrace" = "xyes"; then
984   MOZ_CHECK_HEADER(sys/sdt.h, HAVE_DTRACE=1)
985   if test -n "$HAVE_DTRACE"; then
986       AC_DEFINE(INCLUDE_MOZILLA_DTRACE)
987   else
988       AC_MSG_ERROR([dtrace enabled but sys/sdt.h not found]);
989   fi
991 AC_SUBST(HAVE_DTRACE)
993 dnl Checks for libraries.
994 dnl ========================================================
995 AC_CHECK_LIB(c_r, gethostbyname_r)
997 dnl We don't want to link with libdl even if it's present on OS X, since
998 dnl it's not used and not part of the default installation. OS/2 has dlfcn
999 dnl in libc.
1000 dnl We don't want to link against libm or libpthread on Darwin since
1001 dnl they both are just symlinks to libSystem and explicitly linking
1002 dnl against libSystem causes issues when debugging (see bug 299601).
1003 case $target in
1004 *-darwin*)
1005     ;;
1007     AC_SEARCH_LIBS(dlopen, dl,
1008         MOZ_CHECK_HEADER(dlfcn.h,
1009         AC_DEFINE(HAVE_DLOPEN)))
1010     ;;
1011 esac
1013 _SAVE_CFLAGS="$CFLAGS"
1014 CFLAGS="$CFLAGS -D_GNU_SOURCE"
1015 AC_CHECK_FUNCS(dladdr memmem)
1016 CFLAGS="$_SAVE_CFLAGS"
1018 if test ! "$GNU_CXX"; then
1019     AC_CHECK_LIB(C, demangle)
1022 AC_CHECK_LIB(socket, socket)
1024 XLDFLAGS="$X_LIBS"
1025 XLIBS="$X_EXTRA_LIBS"
1027 dnl ========================================================
1028 dnl Checks for X libraries.
1029 dnl Ordering is important.
1030 dnl Xt is dependent upon SM as of X11R6
1031 dnl ========================================================
1032 if test -n "$MOZ_X11"; then
1033     AC_DEFINE_UNQUOTED(FUNCPROTO,15)
1034     _SAVE_LDFLAGS="$LDFLAGS"
1035     _SAVE_LIBS="$LIBS"
1036     LDFLAGS="$XLDFLAGS $LDFLAGS"
1037     AC_CHECK_LIB(X11, XDrawLines, [XLIBS="-lX11 $XLIBS"],
1038         [MISSING_X="$MISSING_X -lX11"], $XLIBS)
1039     AC_CHECK_LIB(Xext, XextAddDisplay, [XEXT_LIBS="-lXext"],
1040         [MISSING_X="$MISSING_X -lXext"], $XLIBS)
1042     AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt"], [
1043         unset ac_cv_lib_Xt_XtFree
1044         AC_CHECK_LIB(ICE, IceFlush, [XT_LIBS="-lICE $XT_LIBS"],, $XT_LIBS $XLIBS)
1045         AC_CHECK_LIB(SM, SmcCloseConnection, [XT_LIBS="-lSM $XT_LIBS"],, $XT_LIBS $XLIBS)
1046         AC_CHECK_LIB(Xt, XtFree, [ XT_LIBS="-lXt $XT_LIBS"],
1047             [MISSING_X="$MISSING_X -lXt"], $X_PRE_LIBS $XT_LIBS $XLIBS)
1048         ])
1050     dnl ========================================================
1051     dnl = Check for xcb
1052     dnl ========================================================
1053     AC_CHECK_LIB(xcb, xcb_connect, [XLIBS="-lxcb $XLIBS"],
1054         [MISSING_X="$MISSING_X -lxcb"], $XLIBS)
1055     AC_CHECK_LIB(xcb-shm, xcb_shm_query_version, [XLIBS="-lxcb-shm $XLIBS"],
1056         [MISSING_X="$MISSING_X -lxcb-shm"], $XLIBS)
1057     AC_CHECK_LIB(X11-xcb, XGetXCBConnection, [XLIBS="-lX11-xcb $XLIBS"],
1058         [MISSING_X="$MISSING_X -lX11-xcb"], $XLIBS)
1060     LDFLAGS="$_SAVE_LDFLAGS"
1061     LIBS="$_SAVE_LIBS"
1062 fi # $MOZ_X11
1064 AC_SUBST_LIST(XCFLAGS)
1065 AC_SUBST_LIST(XLDFLAGS)
1066 AC_SUBST_LIST(XLIBS)
1067 AC_SUBST_LIST(XEXT_LIBS)
1068 AC_SUBST_LIST(XT_LIBS)
1070 dnl ========================================================
1071 dnl = pthread support
1072 dnl = Start by checking whether the system support pthreads
1073 dnl ========================================================
1074 case "$target_os" in
1075 darwin*)
1076     MOZ_USE_PTHREADS=1
1077     ;;
1079     AC_CHECK_LIB(pthreads, pthread_create,
1080         MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
1081         AC_CHECK_LIB(pthread, pthread_create,
1082             MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
1083             AC_CHECK_LIB(c_r, pthread_create,
1084                 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
1085                 AC_CHECK_LIB(c, pthread_create,
1086                     MOZ_USE_PTHREADS=1
1087                 )
1088             )
1089         )
1090     )
1091     ;;
1092 esac
1094 dnl ========================================================
1095 dnl Do the platform specific pthread hackery
1096 dnl ========================================================
1097 if test "$MOZ_USE_PTHREADS"x != x
1098 then
1099     dnl
1100     dnl See if -pthread is supported.
1101     dnl
1102     rm -f conftest*
1103     ac_cv_have_dash_pthread=no
1104     AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
1105     echo 'int main() { return 0; }' | cat > conftest.c
1106     ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
1107     if test $? -eq 0; then
1108         if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
1109             ac_cv_have_dash_pthread=yes
1110             case "$target_os" in
1111             freebsd*)
1112 # Freebsd doesn't use -pthread for compiles, it uses them for linking
1113                 ;;
1114             *)
1115                 CFLAGS="$CFLAGS -pthread"
1116                 CXXFLAGS="$CXXFLAGS -pthread"
1117                 ;;
1118             esac
1119         fi
1120     fi
1121     rm -f conftest*
1122     AC_MSG_RESULT($ac_cv_have_dash_pthread)
1124     dnl
1125     dnl See if -pthreads is supported.
1126     dnl
1127     ac_cv_have_dash_pthreads=no
1128     if test "$ac_cv_have_dash_pthread" = "no"; then
1129         AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
1130         echo 'int main() { return 0; }' | cat > conftest.c
1131         ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
1132         if test $? -eq 0; then
1133             if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
1134                 ac_cv_have_dash_pthreads=yes
1135                 CFLAGS="$CFLAGS -pthreads"
1136                 CXXFLAGS="$CXXFLAGS -pthreads"
1137             fi
1138         fi
1139         rm -f conftest*
1140         AC_MSG_RESULT($ac_cv_have_dash_pthreads)
1141     fi
1143     case "$target" in
1144         *-*-freebsd*)
1145             AC_DEFINE(_REENTRANT)
1146             AC_DEFINE(_THREAD_SAFE)
1147             dnl -pthread links in -lpthread, so don't specify it explicitly.
1148             if test "$ac_cv_have_dash_pthread" = "yes"; then
1149                 _PTHREAD_LDFLAGS="-pthread"
1150             fi
1151             ;;
1153         *-*-openbsd*|*-*-bsdi*)
1154             AC_DEFINE(_REENTRANT)
1155             AC_DEFINE(_THREAD_SAFE)
1156             dnl -pthread links in -lc_r, so don't specify it explicitly.
1157             if test "$ac_cv_have_dash_pthread" = "yes"; then
1158                 _PTHREAD_LDFLAGS="-pthread"
1159             fi
1160             ;;
1162         *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
1163             AC_DEFINE(_REENTRANT)
1164             ;;
1166     esac
1167     LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
1168     AC_SUBST(MOZ_USE_PTHREADS)
1169     MOZ_CHECK_HEADERS(pthread.h)
1173 dnl Checks for library functions.
1174 dnl ========================================================
1175 AC_CHECK_FUNCS(stat64 lstat64 truncate64 statvfs64 statvfs statfs64 statfs getpagesize gmtime_r localtime_r arc4random arc4random_buf mallinfo gettid lchown setpriority strerror syscall)
1177 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
1178 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
1179                ac_cv_clock_monotonic,
1180                [for libs in "" -lrt; do
1181                     _SAVE_LIBS="$LIBS"
1182                     _SAVE_CFLAGS="$CFLAGS"
1183                     LIBS="$LIBS $libs"
1184                     CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
1185 dnl clock_gettime is available on OSX since 10.12, so depending on MACOSX_DEPLOYMENT_TARGET,
1186 dnl we should or not be able to use it. To detect if we can, we need to make the
1187 dnl availability attribute strict, so that compilation fails when the target is < 10.12.
1188                     AC_TRY_LINK([#define availability(os, ...) availability(os, strict, __VA_ARGS)
1189                                  #include <time.h>],
1190                                  [ struct timespec ts;
1191                                    clock_gettime(CLOCK_MONOTONIC, &ts); ],
1192                                  ac_cv_clock_monotonic=$libs
1193                                  LIBS="$_SAVE_LIBS"
1194                                  break,
1195                                  ac_cv_clock_monotonic=no)
1196                     LIBS="$_SAVE_LIBS"
1197                     CFLAGS="$_SAVE_CFLAGS"
1198                 done])
1199 if test "$ac_cv_clock_monotonic" != "no"; then
1200     HAVE_CLOCK_MONOTONIC=1
1201     REALTIME_LIBS=$ac_cv_clock_monotonic
1202     AC_DEFINE(HAVE_CLOCK_MONOTONIC)
1203     AC_SUBST(HAVE_CLOCK_MONOTONIC)
1204     AC_SUBST_LIST(REALTIME_LIBS)
1207 dnl Turn on warnings-as-errors to prevent implicit declaration of
1208 dnl pthread_cond_timedwait_monotonic_np, which can cause this test to
1209 dnl inadvertently pass even if the function does not really exist.
1210 _SAVE_CFLAGS="$CFLAGS"
1211 CFLAGS="$CFLAGS $WARNINGS_AS_ERRORS"
1212 AC_CACHE_CHECK(for pthread_cond_timedwait_monotonic_np,
1213                ac_cv_pthread_cond_timedwait_monotonic_np,
1214                AC_TRY_LINK([#include <pthread.h>],
1215                            [pthread_cond_timedwait_monotonic_np(0, 0, 0);],
1216                            ac_cv_pthread_cond_timewait_monotonic_np=yes,
1217                            ac_cv_pthread_cond_timewait_monotonic_np=no))
1218 if test "$ac_cv_pthread_cond_timewait_monotonic_np" != "no"; then
1219     AC_DEFINE(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)
1221 CFLAGS=$_SAVE_CFLAGS
1223 AC_CACHE_CHECK(
1224     [for res_ninit()],
1225     ac_cv_func_res_ninit,
1226     [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
1227         dnl no need for res_ninit() on NetBSD and OpenBSD
1228         ac_cv_func_res_ninit=no
1229      else
1230         AC_TRY_LINK([
1231             #ifdef linux
1232             #define _BSD_SOURCE 1
1233             #endif
1234             #include <sys/types.h>
1235             #include <netinet/in.h>
1236             #include <arpa/nameser.h>
1237             #include <resolv.h>
1238             ],
1239             [int foo = res_ninit(&_res);],
1240             [ac_cv_func_res_ninit=yes],
1241             [ac_cv_func_res_ninit=no])
1242      fi
1243     ])
1245 if test "$ac_cv_func_res_ninit" = "yes"; then
1246     AC_DEFINE(HAVE_RES_NINIT)
1247 dnl must add the link line we do something as foolish as this... dougt
1248 dnl else
1249 dnl    AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
1250 dnl        AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
1253 AC_LANG_C
1255 dnl **********************
1256 dnl *** va_copy checks ***
1257 AC_CACHE_CHECK([for an implementation of va_copy()],
1258                ac_cv_va_copy,
1259     [AC_TRY_COMPILE([#include <stdarg.h>
1260                      #include <stdlib.h>
1261         void f (int i, ...) {
1262             va_list args1, args2;
1263             va_start (args1, i);
1264             va_copy (args2, args1);
1265             if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
1266                 exit (1);
1267             va_end (args1); va_end (args2);
1268         }],
1269         [f(0, 42); return 0],
1270         [ac_cv_va_copy=yes],
1271         [ac_cv_va_copy=no]
1272     )]
1274 AC_CACHE_CHECK([whether va_list can be copied by value],
1275                ac_cv_va_val_copy,
1276     [AC_TRY_COMPILE([#include <stdarg.h>
1277                      #include <stdlib.h>
1278         void f (int i, ...) {
1279             va_list args1, args2;
1280             va_start (args1, i);
1281             args2 = args1;
1282             if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
1283                 exit (1);
1284             va_end (args1); va_end (args2);
1285         }],
1286         [f(0, 42); return 0],
1287         [ac_cv_va_val_copy=yes],
1288         [ac_cv_va_val_copy=no],
1289     )]
1291 if test "x$ac_cv_va_copy" = "xyes"; then
1292     AC_DEFINE(VA_COPY, va_copy)
1293     AC_DEFINE(HAVE_VA_COPY)
1296 if test "x$ac_cv_va_val_copy" = "xno"; then
1297    AC_DEFINE(HAVE_VA_LIST_AS_ARRAY)
1300 dnl ===================================================================
1301 dnl ========================================================
1302 dnl Put your C++ language/feature checks below
1303 dnl ========================================================
1304 AC_LANG_CPLUSPLUS
1306 ARM_ABI_PREFIX=
1307 if test "$GNU_CC"; then
1308   if test "$CPU_ARCH" = "arm" ; then
1309     AC_CACHE_CHECK(for ARM EABI,
1310         ac_cv_gcc_arm_eabi,
1311         [AC_TRY_COMPILE([],
1312                         [
1313 #if defined(__ARM_EABI__)
1314   return 0;
1315 #else
1316 #error Not ARM EABI.
1317 #endif
1318                         ],
1319                         ac_cv_gcc_arm_eabi="yes",
1320                         ac_cv_gcc_arm_eabi="no")])
1321     if test "$ac_cv_gcc_arm_eabi" = "yes"; then
1322         HAVE_ARM_EABI=1
1323         ARM_ABI_PREFIX=eabi-
1324     else
1325         ARM_ABI_PREFIX=oabi-
1326     fi
1327   fi
1329   TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
1332 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
1333 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
1334 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
1335 # linking XUL.
1336 _SAVE_LDFLAGS=$LDFLAGS
1337 LDFLAGS="$LDFLAGS $DSO_PIC_CFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
1338 AC_CACHE_CHECK(for __thread keyword for TLS variables,
1339                ac_cv_thread_keyword,
1340                [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
1341                             [return tlsIsMainThread;],
1342                             ac_cv_thread_keyword=yes,
1343                             ac_cv_thread_keyword=no)])
1344 LDFLAGS=$_SAVE_LDFLAGS
1345 # The custom dynamic linker doesn't support TLS variables
1346 MOZ_TLS=
1347 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
1348   # mips builds fail with TLS variables because of a binutils bug.
1349   # See bug 528687
1350   # OpenBSD doesn't have TLS support, and the test succeeds with clang++
1351   case "${target}" in
1352     mips*-*)
1353       :
1354       ;;
1355     *-android*|*-linuxandroid*)
1356       :
1357       ;;
1358     *-openbsd*)
1359       :
1360       ;;
1361     *)
1362       AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
1363       MOZ_TLS=1
1364       ;;
1365   esac
1368 dnl Using the custom linker on ARMv6 requires 16k alignment of ELF segments.
1369 if test -n "$MOZ_LINKER"; then
1370   if test "$CPU_ARCH" = arm; then
1371     dnl When building for < ARMv7, we need to ensure 16k alignment of ELF segments
1372     if test -n "$ARM_ARCH" && test "$ARM_ARCH" -lt 7; then
1373       LDFLAGS="$LDFLAGS -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000"
1374       _SUBDIR_LDFLAGS="$_SUBDIR_LDFLAGS -Wl,-z,max-page-size=0x4000 -Wl,-z,common-page-size=0x4000"
1375     fi
1376   fi
1378 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
1379 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
1380 dnl Since the linker only understands the sysv ones, no need to build the
1381 dnl gnu style tables anyways.
1382   LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
1385 dnl End of C++ language/feature checks
1386 AC_LANG_C
1388 dnl ========================================================
1389 dnl =  Internationalization checks
1390 dnl ========================================================
1392 dnl Internationalization and Locale support is different
1393 dnl on various UNIX platforms.  Checks for specific i18n
1394 dnl features go here.
1396 AC_HAVE_FUNCS(localeconv)
1398 fi # ! SKIP_COMPILER_CHECKS
1400 if test -n "${COMPILE_ENVIRONMENT}"; then
1401   MOZ_CHECK_ALLOCATOR
1404 TARGET_XPCOM_ABI=
1405 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
1406     TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
1407     AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
1410 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
1411 dnl features that Windows actually does support.
1413 if test -n "$SKIP_COMPILER_CHECKS"; then
1414    dnl Windows has malloc.h
1415    AC_DEFINE(MALLOC_H, [<malloc.h>])
1416    AC_DEFINE(HAVE_FORCEINLINE)
1417    AC_DEFINE(HAVE_LOCALECONV)
1418 fi # SKIP_COMPILER_CHECKS
1420 dnl Mozilla specific options
1421 dnl ========================================================
1422 dnl The macros used for command line options
1423 dnl are defined in build/autoconf/altoptions.m4.
1425 dnl ========================================================
1426 dnl =
1427 dnl = Check for external package dependencies
1428 dnl =
1429 dnl ========================================================
1430 MOZ_ARG_HEADER(External Packages)
1432 case "$OS_TARGET" in
1433 WINNT|Darwin|Android)
1434   MOZ_FOLD_LIBS=1
1435   ;;
1437   MOZ_FOLD_LIBS=
1438   ;;
1439 esac
1441 MOZ_CONFIG_NSPR()
1443 dnl ========================================================
1444 dnl system libevent Support
1445 dnl ========================================================
1446 MOZ_ARG_WITH_STRING(system-libevent,
1447 [  --with-system-libevent[=PFX]
1448                           Use system libevent [installed at prefix PFX]],
1449     LIBEVENT_DIR=$withval)
1451 _SAVE_CFLAGS=$CFLAGS
1452 _SAVE_LDFLAGS=$LDFLAGS
1453 _SAVE_LIBS=$LIBS
1454 if test "$LIBEVENT_DIR" = yes; then
1455     PKG_CHECK_MODULES(MOZ_LIBEVENT, libevent,
1456         MOZ_SYSTEM_LIBEVENT=1,
1457         LIBEVENT_DIR=/usr)
1459 if test -z "$LIBEVENT_DIR" -o "$LIBEVENT_DIR" = no; then
1460     MOZ_SYSTEM_LIBEVENT=
1461 elif test -z "$MOZ_SYSTEM_LIBEVENT"; then
1462     CFLAGS="-I${LIBEVENT_DIR}/include $CFLAGS"
1463     LDFLAGS="-L${LIBEVENT_DIR}/lib $LDFLAGS"
1464     MOZ_CHECK_HEADER(event.h,
1465         [if test ! -f "${LIBEVENT_DIR}/include/event.h"; then
1466              AC_MSG_ERROR([event.h found, but is not in ${LIBEVENT_DIR}/include])
1467          fi],
1468         AC_MSG_ERROR([--with-system-libevent requested but event.h not found]))
1469     AC_CHECK_LIB(event, event_init,
1470                  [MOZ_SYSTEM_LIBEVENT=1
1471                   MOZ_LIBEVENT_CFLAGS="-I${LIBEVENT_DIR}/include"
1472                   MOZ_LIBEVENT_LIBS="-L${LIBEVENT_DIR}/lib -levent"],
1473                  [MOZ_SYSTEM_LIBEVENT= MOZ_LIBEVENT_CFLAGS= MOZ_LIBEVENT_LIBS=])
1475 CFLAGS=$_SAVE_CFLAGS
1476 LDFLAGS=$_SAVE_LDFLAGS
1477 LIBS=$_SAVE_LIBS
1479 AC_SUBST(MOZ_SYSTEM_LIBEVENT)
1481 dnl ========================================================
1482 dnl = If NSS was not detected in the system,
1483 dnl = use the one in the source tree (mozilla/security/nss)
1484 dnl ========================================================
1486 MOZ_ARG_WITH_BOOL(system-nss,
1487 [  --with-system-nss       Use system installed NSS],
1488     _USE_SYSTEM_NSS=1 )
1490 if test -n "$_USE_SYSTEM_NSS"; then
1491     AM_PATH_NSS(3.50, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
1494 NSS_CFLAGS="$NSS_CFLAGS -I${DIST}/include/nss"
1495 if test -z "$MOZ_SYSTEM_NSS"; then
1496    case "${OS_ARCH}" in
1497         # Only few platforms have been tested with GYP
1498         WINNT|Darwin|Linux|DragonFly|FreeBSD|NetBSD|OpenBSD|SunOS)
1499             ;;
1500         *)
1501             AC_MSG_ERROR([building in-tree NSS is not supported on this platform. Use --with-system-nss])
1502             ;;
1503    esac
1506 dnl system ZLIB support
1507 dnl ========================================================
1508 MOZ_ZLIB_CHECK([1.2.3])
1510 if test -z "$SKIP_LIBRARY_CHECKS"; then
1512 dnl ========================================================
1513 dnl system PNG Support
1514 dnl ========================================================
1515 MOZ_ARG_WITH_STRING(system-png,
1516 [  --with-system-png[=PFX]
1517                           Use system libpng [installed at prefix PFX]],
1518     PNG_DIR=$withval)
1520 _SAVE_CFLAGS=$CFLAGS
1521 _SAVE_LDFLAGS=$LDFLAGS
1522 _SAVE_LIBS=$LIBS
1523 if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
1524     CFLAGS="-I${PNG_DIR}/include $CFLAGS"
1525     LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
1527 if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
1528     MOZ_SYSTEM_PNG=
1529 else
1530     AC_CHECK_LIB(png, png_get_valid, [MOZ_SYSTEM_PNG=1 MOZ_PNG_LIBS="-lpng"],
1531                  AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
1532     AC_CHECK_LIB(png, png_get_acTL, ,
1533                  AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]))
1535 if test "$MOZ_SYSTEM_PNG" = 1; then
1536     AC_TRY_COMPILE([ #include <stdio.h>
1537                      #include <sys/types.h>
1538                      #include <png.h> ],
1539                    [ #if PNG_LIBPNG_VER < $MOZPNG
1540                      #error "Insufficient libpng version ($MOZPNG required)."
1541                      #endif
1542                      #ifndef PNG_UINT_31_MAX
1543                      #error "Insufficient libpng version."
1544                      #endif ],
1545                    MOZ_SYSTEM_PNG=1,
1546                    AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
1548 CFLAGS=$_SAVE_CFLAGS
1549 LDFLAGS=$_SAVE_LDFLAGS
1550 LIBS=$_SAVE_LIBS
1552 if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_SYSTEM_PNG" = 1; then
1553     MOZ_PNG_CFLAGS="-I${PNG_DIR}/include"
1554     MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}"
1557 fi # SKIP_LIBRARY_CHECKS
1559 dnl ========================================================
1560 dnl =
1561 dnl = Application
1562 dnl =
1563 dnl ========================================================
1565 MOZ_ARG_HEADER(Application)
1567 ENABLE_SYSTEM_EXTENSION_DIRS=1
1568 MOZ_BRANDING_DIRECTORY=
1569 MOZ_OFFICIAL_BRANDING=
1570 MOZ_AUTH_EXTENSION=1
1571 if test "$MOZ_IOS"; then
1572    MOZ_AUTH_EXTENSION=
1574 MOZ_PREF_EXTENSIONS=1
1575 MOZ_SPELLCHECK=1
1576 MOZ_UNIVERSALCHARDET=1
1577 MOZ_XUL=1
1578 MOZ_ZIPWRITER=1
1579 MOZ_NO_SMART_CARDS=
1580 NECKO_COOKIES=1
1581 MOZ_USE_NATIVE_POPUP_WINDOWS=
1582 MOZ_EXCLUDE_HYPHENATION_DICTIONARIES=
1583 MOZ_SANDBOX=1
1584 MOZ_BINARY_EXTENSIONS=
1585 MOZ_DEVTOOLS=server
1587 case "$target_os" in
1588     mingw*)
1589         NS_ENABLE_TSF=1
1590         AC_DEFINE(NS_ENABLE_TSF)
1591         ;;
1592 esac
1594 # Optional Firefox for Android partner distribution directory.
1595 MOZ_ARG_WITH_STRING(android-distribution-directory,
1596 [  --with-android-distribution-directory=dir
1597                           Optional Firefox for Android partner distribution directory.],
1598   MOZ_ANDROID_DISTRIBUTION_DIRECTORY=$withval)
1600 if test -n "$MOZ_ANDROID_DISTRIBUTION_DIRECTORY"; then
1601   # A distribution directory must have an assets/distribution directory.
1602   # See https://wiki.mozilla.org/Mobile/Distribution_Files.
1603   if test ! -d "$MOZ_ANDROID_DISTRIBUTION_DIRECTORY/assets/distribution" ; then
1604     AC_MSG_ERROR([--with-android-distribution-directory does not contain assets/distribution;
1605                   (looked for ${MOZ_ANDROID_DISTRIBUTION_DIRECTORY}/assets/distribution).])
1606   fi
1608 AC_SUBST(MOZ_ANDROID_DISTRIBUTION_DIRECTORY)
1610 dnl ========================================================
1611 dnl = Trademarked Branding
1612 dnl ========================================================
1613 MOZ_ARG_ENABLE_BOOL(official-branding,
1614 [  --enable-official-branding
1615                           Enable Official mozilla.org Branding
1616                           Do not distribute builds with
1617                           --enable-official-branding unless you have
1618                           permission to use trademarks per
1619                           http://www.mozilla.org/foundation/trademarks/ .],
1620     MOZ_OFFICIAL_BRANDING=1,
1621     MOZ_OFFICIAL_BRANDING=)
1623 # Allow the application to influence configure with a confvars.sh script.
1624 AC_MSG_CHECKING([if app-specific confvars.sh exists])
1625 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
1626   AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
1627   . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
1628 else
1629   AC_MSG_RESULT([no])
1632 if test "$EARLY_BETA_OR_EARLIER"; then
1633     MOZ_NEW_CERT_STORAGE=1
1634     AC_DEFINE(MOZ_NEW_CERT_STORAGE)
1636 AC_SUBST(MOZ_NEW_CERT_STORAGE)
1638 # Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
1639 MOZ_ARG_WITH_STRING(app-name,
1640 [--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
1641 WITH_APP_NAME=$withval,
1644 if test -n "$WITH_APP_NAME" ; then
1645     MOZ_APP_NAME="$WITH_APP_NAME"
1648 MOZ_ARG_WITH_STRING(app-basename,
1649 [--with-app-basename=BASENAME sets MOZ_APP_BASENAME to BASENAME],
1650 WITH_APP_BASENAME=$withval,
1653 if test -n "$WITH_APP_BASENAME" ; then
1654     MOZ_APP_BASENAME="$WITH_APP_BASENAME"
1657 dnl ========================================================
1658 dnl Ensure Android SDK and build-tools versions depending on
1659 dnl mobile target.
1660 dnl ========================================================
1662 case "$MOZ_BUILD_APP" in
1663 mobile/android)
1664     MOZ_ANDROID_SDK
1665     ;;
1666 esac
1668 dnl ========================================================
1669 dnl =
1670 dnl = Toolkit Options
1671 dnl =
1672 dnl ========================================================
1673 MOZ_ARG_HEADER(Toolkit Options)
1675 dnl ========================================================
1676 dnl = Enable the toolkit as needed                         =
1677 dnl ========================================================
1679 case "$MOZ_WIDGET_TOOLKIT" in
1681 cocoa)
1682     LDFLAGS="$LDFLAGS -framework Cocoa"
1683     # Use -Wl as a trick to avoid -framework and framework names from
1684     # being separated by AC_SUBST_LIST.
1685     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'
1686     TK_CFLAGS=""
1687     CFLAGS="$CFLAGS $TK_CFLAGS"
1688     CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
1689     MOZ_USER_DIR="Mozilla"
1690     MOZ_FS_LAYOUT=bundle
1691     ;;
1693 uikit)
1694     LDFLAGS="$LDFLAGS -framework UIKit"
1695     TK_CFLAGS=""
1696     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'
1697     CFLAGS="$CFLAGS $TK_CFLAGS"
1698     CXXFLAGS="$CXXFLAGS $TK_CFLAGS"
1699     MOZ_USER_DIR="Mozilla"
1700     MOZ_FS_LAYOUT=bundle
1701     ;;
1703 esac
1705 if test "$OS_TARGET" = Darwin; then
1706     LDFLAGS="$LDFLAGS -lobjc"
1709 dnl there are a lot of tests on MOZ_ENABLE_GTK below, that are more convenient
1710 dnl to keep that way than testing against MOZ_WIDGET_TOOLKIT
1711 case "$MOZ_WIDGET_TOOLKIT" in
1712 gtk*)
1713     MOZ_ENABLE_GTK=1
1714     ;;
1715 esac
1717 if test "$COMPILE_ENVIRONMENT"; then
1718   if test "$MOZ_WIDGET_TOOLKIT" = gtk; then
1719     PKG_CHECK_MODULES(MOZ_GTK3, gtk+-3.0 >= $GTK3_VERSION gtk+-unix-print-3.0 glib-2.0 gobject-2.0 gio-unix-2.0 $GDK_PACKAGES)
1720     MOZ_GTK3_CFLAGS="-I${_topsrcdir}/widget/gtk/compat-gtk3 $MOZ_GTK3_CFLAGS"
1721     TK_CFLAGS=$MOZ_GTK3_CFLAGS
1722     TK_LIBS=$MOZ_GTK3_LIBS
1723     dnl GDK_VERSION_MIN_REQUIRED is not set here as GDK3 deprecated warnings
1724     dnl are suppressed by widget/gtk/compat-gtk3/gdk/gdkversionmacros.h.
1725     AC_DEFINE_UNQUOTED(GDK_VERSION_MAX_ALLOWED,$GDK_VERSION_MAX_ALLOWED)
1726     GLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_32
1727   fi
1728   if test "$MOZ_ENABLE_GTK"; then
1729     if test "$MOZ_X11"; then
1730       GDK_PACKAGES=gdk-x11-2.0
1731     fi
1732     AC_DEFINE_UNQUOTED(GLIB_VERSION_MIN_REQUIRED,$GLIB_VERSION_MIN_REQUIRED)
1733     AC_DEFINE_UNQUOTED(GLIB_VERSION_MAX_ALLOWED,$GLIB_VERSION_MAX_ALLOWED)
1735     PKG_CHECK_MODULES(MOZ_GTK2, gtk+-2.0 >= $GTK2_VERSION gtk+-unix-print-2.0 glib-2.0 >= $GLIB_VERSION gobject-2.0 gio-unix-2.0 $GDK_PACKAGES)
1736     MOZ_GTK2_CFLAGS="-I${_topsrcdir}/widget/gtk/compat $MOZ_GTK2_CFLAGS"
1737   fi
1738 fi # COMPILE_ENVIRONMENT
1740 AC_SUBST(MOZ_FS_LAYOUT)
1742 AC_SUBST_LIST(TK_CFLAGS)
1743 AC_SUBST_LIST(TK_LIBS)
1745 dnl ========================================================
1746 dnl =
1747 dnl = Components & Features
1748 dnl =
1749 dnl ========================================================
1750 MOZ_ARG_HEADER(Components and Features)
1752 AC_SUBST(MOZ_OFFICIAL_BRANDING)
1753 if test -n "$MOZ_OFFICIAL_BRANDING"; then
1754   if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
1755     AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
1756   else
1757     MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
1758     AC_DEFINE(MOZ_OFFICIAL_BRANDING)
1759   fi
1762 MOZ_ARG_WITH_STRING(branding,
1763 [  --with-branding=dir     Use branding from the specified directory.],
1764     MOZ_BRANDING_DIRECTORY=$withval)
1766 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
1767 if test -z "$REAL_BRANDING_DIRECTORY"; then
1768   REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
1771 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
1772   . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
1773 elif test -f "${EXTERNAL_SOURCE_DIR}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
1774   . "${EXTERNAL_SOURCE_DIR}/$REAL_BRANDING_DIRECTORY/configure.sh"
1777 AC_SUBST(MOZ_BRANDING_DIRECTORY)
1779 dnl ========================================================
1780 dnl = Distribution ID
1781 dnl ========================================================
1782 MOZ_ARG_WITH_STRING(distribution-id,
1783 [  --with-distribution-id=ID
1784                           Set distribution-specific id (default=org.mozilla)],
1785 [ val=`echo $withval`
1786     MOZ_DISTRIBUTION_ID="$val"])
1788 if test -z "$MOZ_DISTRIBUTION_ID"; then
1789    MOZ_DISTRIBUTION_ID="org.mozilla"
1792 AC_DEFINE_UNQUOTED(MOZ_DISTRIBUTION_ID,"$MOZ_DISTRIBUTION_ID")
1793 AC_SUBST(MOZ_DISTRIBUTION_ID)
1795 dnl ========================================================
1796 dnl = libproxy support
1797 dnl ========================================================
1799 if test "$MOZ_ENABLE_GTK"
1800 then
1801     MOZ_ENABLE_LIBPROXY=
1803     MOZ_ARG_ENABLE_BOOL(libproxy,
1804     [  --enable-libproxy         Enable libproxy support ],
1805     MOZ_ENABLE_LIBPROXY=1,
1806     MOZ_ENABLE_LIBPROXY=)
1808     if test "$MOZ_ENABLE_LIBPROXY"
1809     then
1810         PKG_CHECK_MODULES(MOZ_LIBPROXY, libproxy-1.0)
1811         AC_DEFINE(MOZ_ENABLE_LIBPROXY)
1812     fi
1814 AC_SUBST(MOZ_ENABLE_LIBPROXY)
1816 dnl ========================================================
1817 dnl = dbus support
1818 dnl ========================================================
1820 if test "$MOZ_ENABLE_GTK"
1821 then
1822     MOZ_ENABLE_DBUS=1
1824     MOZ_ARG_DISABLE_BOOL(dbus,
1825     [  --disable-dbus          Disable dbus support ],
1826         MOZ_ENABLE_DBUS=,
1827         MOZ_ENABLE_DBUS=1)
1829     if test "$MOZ_ENABLE_DBUS"
1830     then
1831         PKG_CHECK_MODULES(MOZ_DBUS, dbus-1 >= $DBUS_VERSION)
1832         PKG_CHECK_MODULES(MOZ_DBUS_GLIB, dbus-glib-1 >= $DBUS_VERSION)
1833         AC_DEFINE(MOZ_ENABLE_DBUS)
1834     fi
1836 AC_SUBST(MOZ_ENABLE_DBUS)
1838 dnl =========================================================
1839 dnl = Whether to exclude hyphenations files in the build
1840 dnl =========================================================
1841 if test -n "$MOZ_EXCLUDE_HYPHENATION_DICTIONARIES"; then
1842     AC_DEFINE(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
1845 AC_TRY_COMPILE([#include <linux/ethtool.h>],
1846                [ struct ethtool_cmd cmd; cmd.speed_hi = 0; ],
1847                MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI=1)
1849 AC_SUBST(MOZ_WEBRTC_HAVE_ETHTOOL_SPEED_HI)
1851 if test -n "$MOZ_WEBRTC"; then
1852     if test -n "$MOZ_X11"; then
1853       MOZ_WEBRTC_X11_LIBS="-lXext -lXdamage -lXfixes -lXcomposite"
1854     fi
1857 AC_SUBST_LIST(MOZ_WEBRTC_X11_LIBS)
1859 dnl ========================================================
1860 dnl = Apple platform decoder support
1861 dnl ========================================================
1862 if test "$COMPILE_ENVIRONMENT"; then
1863 if test -n "$MOZ_APPLEMEDIA"; then
1864   # hack in frameworks for fmp4 - see bug 1029974
1865   # We load VideoToolbox and CoreMedia dynamically, so they don't appear here.
1866   LDFLAGS="$LDFLAGS -framework AudioToolbox"
1867   dnl Verify CoreMedia is available.
1868   AC_CHECK_HEADERS([CoreMedia/CoreMedia.h VideoToolbox/VideoToolbox.h], [],
1869     [AC_MSG_ERROR([MacOS X 10.9 SDK or later is required])])
1871 fi # COMPILE_ENVIRONMENT
1873 dnl ========================================================
1874 dnl = Handle dependent MEDIA defines
1875 dnl ========================================================
1877 MOZ_WEBM_ENCODER=1
1878 AC_DEFINE(MOZ_WEBM_ENCODER)
1879 AC_SUBST(MOZ_WEBM_ENCODER)
1881 dnl ========================================================
1882 dnl NegotiateAuth
1883 dnl ========================================================
1885 MOZ_ARG_DISABLE_BOOL(negotiateauth,
1886 [  --disable-negotiateauth Disable GSS-API negotiation ],
1887     MOZ_AUTH_EXTENSION=,
1888     MOZ_AUTH_EXTENSION=1 )
1890 if test -n "$MOZ_IOS" -a -n "$MOZ_AUTH_EXTENSION"; then
1891    AC_MSG_ERROR([negotiateauth is not supported on iOS.])
1894 dnl ========================================================
1895 dnl Pref extensions (autoconfig)
1896 dnl ========================================================
1897 MOZ_ARG_DISABLE_BOOL(pref-extensions,
1898 [  --disable-pref-extensions
1899                           Disable pref extensions such as autoconfig],
1900   MOZ_PREF_EXTENSIONS=,
1901   MOZ_PREF_EXTENSIONS=1 )
1903 dnl ========================================================
1904 dnl Searching of system directories for extensions.
1905 dnl Note: this switch is meant to be used for test builds
1906 dnl whose behavior should not depend on what happens to be
1907 dnl installed on the local machine.
1908 dnl ========================================================
1909 MOZ_ARG_DISABLE_BOOL(system-extension-dirs,
1910 [  --disable-system-extension-dirs
1911                           Disable searching system- and account-global
1912                           directories for extensions of any kind; use
1913                           only profile-specific extension directories],
1914   ENABLE_SYSTEM_EXTENSION_DIRS=,
1915   ENABLE_SYSTEM_EXTENSION_DIRS=1 )
1916 if test "$ENABLE_SYSTEM_EXTENSION_DIRS"; then
1917   AC_DEFINE(ENABLE_SYSTEM_EXTENSION_DIRS)
1920 dnl ========================================================
1921 dnl = Universalchardet
1922 dnl ========================================================
1923 MOZ_ARG_DISABLE_BOOL(universalchardet,
1924 [  --disable-universalchardet
1925                           Disable universal encoding detection],
1926   MOZ_UNIVERSALCHARDET=,
1927   MOZ_UNIVERSALCHARDET=1 )
1929 dnl ========================================================
1930 dnl Gamepad support
1931 dnl ========================================================
1933 if test "$COMPILE_ENVIRONMENT" ; then
1935 dnl Moved gamepad platform check to moz.build, linux header check still needed here.
1936 if test "$OS_TARGET" = "Linux"; then
1937     MOZ_CHECK_HEADER([linux/joystick.h])
1938     if test "$ac_cv_header_linux_joystick_h" != "yes"; then
1939       AC_MSG_ERROR([Can't find header linux/joystick.h, needed for gamepad support. Please install Linux kernel headers.])
1940     fi
1943 fi # COMPILE_ENVIRONMENT
1946 dnl ========================================================
1947 dnl = Breakpad crash reporting (on by default on supported platforms)
1948 dnl ========================================================
1950 case $target in
1951 i?86-*-mingw*|x86_64-*-mingw*|aarch64-*-mingw*)
1952   MOZ_CRASHREPORTER=1
1953   ;;
1954 i?86-apple-darwin*|x86_64-apple-darwin*)
1955   if test -z "$MOZ_IOS"; then
1956     MOZ_CRASHREPORTER=1
1957   fi
1958   ;;
1959 *-android*|*-linuxandroid*)
1960   dnl Android/arm is arm-unknown-linux-androideabi, so android condition should
1961   dnl be before Linux condition
1962   MOZ_CRASHREPORTER=1
1963   ;;
1964 i?86-*-linux*|x86_64-*-linux*|arm-*-linux*)
1965   if test "$MOZ_ENABLE_GTK"; then
1966     MOZ_CRASHREPORTER=1
1967   fi
1968   ;;
1969 esac
1971 MOZ_ARG_DISABLE_BOOL(crashreporter,
1972 [  --disable-crashreporter Disable breakpad crash reporting],
1973     [MOZ_CRASHREPORTER=],
1974     [MOZ_CRASHREPORTER=F # Force enable breakpad])
1976 if test "$OS_ARCH" != "$HOST_OS_ARCH" -a "$OS_ARCH" != "WINNT" -a "$OS_ARCH" != "Darwin" -a "$MOZ_WIDGET_TOOLKIT" != "android"; then
1977   if test "$MOZ_CRASHREPORTER" = F; then
1978     AC_MSG_ERROR([Cannot --enable-crashreporter, as breakpad tools do not support compiling on $HOST_OS_ARCH while targeting $OS_ARCH.])
1979   fi
1980   MOZ_CRASHREPORTER=
1983 if test -n "$MOZ_CRASHREPORTER"; then
1984    AC_DEFINE(MOZ_CRASHREPORTER)
1986   if test "$OS_TARGET" = "Linux" && \
1987     test -z "$SKIP_LIBRARY_CHECKS"; then
1988     PKG_CHECK_MODULES(MOZ_GTHREAD, gthread-2.0)
1989   fi
1991   if test "$OS_ARCH" = "WINNT"; then
1992     if test -z "$HAVE_64BIT_BUILD" -a -n "$COMPILE_ENVIRONMENT"; then
1993       MOZ_CRASHREPORTER_INJECTOR=1
1994       AC_DEFINE(MOZ_CRASHREPORTER_INJECTOR)
1995     fi
1996   fi
1999 dnl ========================================================
2000 dnl = Enable compilation of specific extension modules
2001 dnl ========================================================
2003 MOZ_ARG_ENABLE_STRING(extensions,
2004 [  --enable-extensions     Enable extensions],
2005 [ for option in `echo $enableval | sed 's/,/ /g'`; do
2006     if test "$option" = "yes" -o "$option" = "all"; then
2007         AC_MSG_ERROR([--enable-extensions=$option is no longer supported.])
2008     elif test "$option" = "no" -o "$option" = "none"; then
2009         MOZ_EXTENSIONS=""
2010     elif test "$option" = "default"; then
2011         MOZ_EXTENSIONS="$MOZ_EXTENSIONS $MOZ_EXTENSIONS_DEFAULT"
2012     elif test `echo "$option" | grep -c \^-` != 0; then
2013         option=`echo $option | sed 's/^-//'`
2014         MOZ_EXTENSIONS=`echo "$MOZ_EXTENSIONS" | sed "s/ ${option}//"`
2015     else
2016         MOZ_EXTENSIONS="$MOZ_EXTENSIONS $option"
2017     fi
2018 done],
2019     MOZ_EXTENSIONS="$MOZ_EXTENSIONS_DEFAULT")
2021 dnl Ensure every extension exists, to avoid mostly-inscrutable error messages
2022 dnl when trying to build a nonexistent extension.
2023 for extension in $MOZ_EXTENSIONS; do
2024     if test ! -d "${srcdir}/extensions/${extension}"; then
2025         AC_MSG_ERROR([Unrecognized extension provided to --enable-extensions: ${extension}.])
2026     fi
2027 done
2029 if test -n "$MOZ_USE_NATIVE_POPUP_WINDOWS"; then
2030   AC_DEFINE(MOZ_USE_NATIVE_POPUP_WINDOWS)
2033 # Avoid defining MOZ_ENABLE_CAIRO_FT on Windows platforms because
2034 # "cairo-ft-font.c" includes <dlfcn.h>, which only exists on posix platforms
2035 if test -n "$MOZ_TREE_FREETYPE" -a "$OS_TARGET" != WINNT; then
2036    MOZ_ENABLE_CAIRO_FT=1
2037    FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
2038    CAIRO_FT_CFLAGS="-I$_topsrcdir/modules/freetype2/include"
2039    AC_SUBST_LIST(CAIRO_FT_CFLAGS)
2042 AC_CHECK_PROGS(WGET, wget, "")
2043 AC_SUBST(WGET)
2045 dnl ========================================================
2046 dnl Updater
2047 dnl ========================================================
2049 if test "$MOZ_IOS"; then
2050   MOZ_UPDATER=
2053 MOZ_ARG_DISABLE_BOOL(updater,
2054 [  --disable-updater       Disable building of updater],
2055     MOZ_UPDATER=,
2056     MOZ_UPDATER=1 )
2058 if test -n "$MOZ_UPDATER"; then
2059     AC_DEFINE(MOZ_UPDATER)
2062 dnl ========================================================
2063 dnl parental controls (for Windows Vista)
2064 dnl ========================================================
2065 MOZ_ARG_DISABLE_BOOL(parental-controls,
2066 [  --disable-parental-controls
2067                           Do not build parental controls],
2068    MOZ_DISABLE_PARENTAL_CONTROLS=1,
2069    MOZ_DISABLE_PARENTAL_CONTROLS=)
2070 if test -n "$MOZ_DISABLE_PARENTAL_CONTROLS"; then
2071     AC_DEFINE(MOZ_DISABLE_PARENTAL_CONTROLS)
2074 AC_SUBST(MOZ_DISABLE_PARENTAL_CONTROLS)
2076 dnl ========================================================
2077 dnl = Disable smartcard support
2078 dnl ========================================================
2079 if test -n "$MOZ_NO_SMART_CARDS"; then
2080     AC_DEFINE(MOZ_NO_SMART_CARDS)
2082 AC_SUBST(MOZ_NO_SMART_CARDS)
2084 dnl ========================================================
2085 dnl = Sandboxing support
2086 dnl ========================================================
2087 if test -n "$MOZ_TSAN" -o -n "$MOZ_ASAN"; then
2088     # Bug 1182565: TSan conflicts with sandboxing on Linux.
2089     # Bug 1287971: LSan also conflicts with sandboxing on Linux.
2090     case $OS_TARGET in
2091     Linux|Android)
2092         MOZ_SANDBOX=
2093         ;;
2094     esac
2097 MOZ_ARG_DISABLE_BOOL(sandbox,
2098 [  --disable-sandbox        Disable sandboxing support],
2099     MOZ_SANDBOX=,
2100     MOZ_SANDBOX=1)
2102 case "$OS_TARGET" in
2103 WINNT|Darwin|OpenBSD)
2105 Linux)
2106     case $CPU_ARCH in
2107         x86_64|x86)
2108         ;;
2109         # Linux sandbox is only available on x86 and x86_64.
2110         *)
2111             MOZ_SANDBOX=
2112         ;;
2113     esac
2114     ;;
2116     # Only enable the sandbox by default on Linux, OpenBSD, macOS, and Windows
2117     MOZ_SANDBOX=
2119 esac
2121 if test -n "$MOZ_SANDBOX"; then
2122     AC_DEFINE(MOZ_SANDBOX)
2125 AC_SUBST(MOZ_SANDBOX)
2128 dnl ========================================================
2129 dnl =
2130 dnl = Module specific options
2131 dnl =
2132 dnl ========================================================
2133 MOZ_ARG_HEADER(Individual module options)
2135 dnl ========================================================
2136 dnl Check for sqlite
2137 dnl ========================================================
2139 MOZ_SYSTEM_SQLITE=
2140 MOZ_ARG_ENABLE_BOOL(system-sqlite,
2141 [  --enable-system-sqlite  Use system sqlite (located with pkgconfig)],
2142 MOZ_SYSTEM_SQLITE=1,
2143 MOZ_SYSTEM_SQLITE= )
2145 if test -n "$MOZ_SYSTEM_SQLITE"
2146 then
2147     dnl ============================
2148     dnl === SQLite Version check ===
2149     dnl ============================
2150     dnl Check to see if the system SQLite package is new enough.
2151     PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
2152 else
2153     dnl ==============================
2154     dnl === SQLite fdatasync check ===
2155     dnl ==============================
2156     dnl Check to see if fdatasync is available
2157     AC_CHECK_FUNC(fdatasync)
2160 if test -n "$MOZ_SYSTEM_SQLITE"; then
2161     AC_DEFINE(MOZ_SYSTEM_SQLITE)
2163 AC_SUBST(MOZ_SYSTEM_SQLITE)
2165 dnl ========================================================
2166 dnl = Disable zipwriter
2167 dnl ========================================================
2168 MOZ_ARG_DISABLE_BOOL(zipwriter,
2169 [  --disable-zipwriter     Disable zipwriter component],
2170     MOZ_ZIPWRITER=,
2171     MOZ_ZIPWRITER=1 )
2172 AC_SUBST(MOZ_ZIPWRITER)
2174 dnl ========================================================
2175 dnl =
2176 dnl = Feature options that require extra sources to be pulled
2177 dnl =
2178 dnl ========================================================
2179 dnl MOZ_ARG_HEADER(Features that require extra sources)
2181 dnl ========================================================
2182 dnl =
2183 dnl = Runtime debugging and Optimization Options
2184 dnl =
2185 dnl ========================================================
2186 MOZ_ARG_HEADER(Runtime debugging and Optimizations)
2188 dnl ========================================================
2189 dnl enable mobile optimizations
2190 dnl ========================================================
2191 MOZ_ARG_ENABLE_BOOL(mobile-optimize,
2192 [  --enable-mobile-optimize
2193                           Enable mobile optimizations],
2194     MOZ_GFX_OPTIMIZE_MOBILE=1)
2196 AC_SUBST(MOZ_GFX_OPTIMIZE_MOBILE)
2198 if test "$MOZ_GFX_OPTIMIZE_MOBILE"; then
2199     # We ignore paint will resample on mobile for performance.
2200     # We may want to revisit this later.
2201     MOZ_IGNORE_PAINT_WILL_RESAMPLE=1
2203     AC_DEFINE(MOZ_GFX_OPTIMIZE_MOBILE)
2204     AC_DEFINE(MOZ_IGNORE_PAINT_WILL_RESAMPLE)
2207 dnl ========================================================
2208 dnl = Enable code optimization. ON by default.
2209 dnl ========================================================
2211 # Use value from moz.configure if one is defined. Else use our computed
2212 # value.
2213 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
2214     MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
2217 if test "$COMPILE_ENVIRONMENT"; then
2218 if test -n "$MOZ_OPTIMIZE"; then
2219     AC_MSG_CHECKING([for valid C compiler optimization flags])
2220     _SAVE_CFLAGS=$CFLAGS
2221     CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
2222     AC_TRY_COMPILE([#include <stdio.h>],
2223         [printf("Hello World\n");],
2224         _results=yes,
2225         _results=no)
2226     AC_MSG_RESULT([$_results])
2227     if test "$_results" = "no"; then
2228         AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
2229     fi
2230     CFLAGS=$_SAVE_CFLAGS
2231     if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
2232         # When using llvm-based LTO, non numeric optimization levels are
2233         # not supported by the linker, so force the linker to use -O2 (
2234         # which doesn't influence the level compilation units are actually
2235         # compiled at).
2236         case " $MOZ_OPTIMIZE_FLAGS " in
2237         *\ -Os\ *|*\ -Oz\ *)
2238             MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
2239             ;;
2240         esac
2241     fi
2243 fi # COMPILE_ENVIRONMENT
2245 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
2246 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
2247 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
2249 dnl ========================================================
2250 dnl = Enable runtime logging
2251 dnl ========================================================
2252 AC_DEFINE(MOZ_LOGGING)
2253 AC_DEFINE(FORCE_PR_LOG)
2255 dnl ========================================================
2256 dnl = This will enable logging of addref, release, ctor, dtor.
2257 dnl ========================================================
2258 _ENABLE_LOGREFCNT=42
2259 MOZ_ARG_ENABLE_BOOL(logrefcnt,
2260 [  --enable-logrefcnt      Enable logging of refcounts (default=debug) ],
2261     _ENABLE_LOGREFCNT=1,
2262     _ENABLE_LOGREFCNT= )
2263 if test "$_ENABLE_LOGREFCNT" = "1"; then
2264     AC_DEFINE(FORCE_BUILD_REFCNT_LOGGING)
2265 elif test -z "$_ENABLE_LOGREFCNT"; then
2266     AC_DEFINE(NO_BUILD_REFCNT_LOGGING)
2269 dnl ========================================================
2270 dnl moz_dump_painting
2271 dnl ========================================================
2272 MOZ_ARG_ENABLE_BOOL(dump-painting,
2273 [  --enable-dump-painting          Enable paint debugging.],
2274     MOZ_DUMP_PAINTING=1,
2275     MOZ_DUMP_PAINTING= )
2276 if test -n "$MOZ_DUMP_PAINTING"; then
2277     AC_DEFINE(MOZ_DUMP_PAINTING)
2278     AC_DEFINE(MOZ_LAYERS_HAVE_LOG)
2280 if test -n "$MOZ_DEBUG"; then
2281     AC_DEFINE(MOZ_DUMP_PAINTING)
2284 case "${OS_TARGET}" in
2285 Android|WINNT|Darwin)
2286   MOZ_GLUE_IN_PROGRAM=
2287   ;;
2289   dnl On !Android !Windows !OSX, we only want to link executables against mozglue
2290   MOZ_GLUE_IN_PROGRAM=1
2291   AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
2292   ;;
2293 esac
2295 dnl ========================================================
2296 dnl = Jemalloc build setup
2297 dnl ========================================================
2298 if test -z "$MOZ_MEMORY"; then
2299   case "${target}" in
2300     *-mingw*)
2301       if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
2302         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.])
2303       fi
2304       ;;
2305   esac
2306 else
2307   dnl The generic feature tests that determine how to compute ncpus are long and
2308   dnl complicated.  Therefore, simply define special cpp variables for the
2309   dnl platforms we have special knowledge of.
2310   case "${target}" in
2311   *-mingw*)
2312     export MOZ_NO_DEBUG_RTL=1
2313     ;;
2314   esac
2315 fi # MOZ_MEMORY
2316 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
2318 dnl ========================================================
2319 dnl = Enable using the clang plugin to build
2320 dnl ========================================================
2322 if test -n "$COMPILE_ENVIRONMENT"; then
2323 MOZ_CONFIG_CLANG_PLUGIN
2324 fi # COMPILE_ENVIRONMENT
2326 dnl ========================================================
2327 dnl = Enable stripping of libs & executables
2328 dnl ========================================================
2329 MOZ_ARG_ENABLE_BOOL(strip,
2330 [  --enable-strip          Enable stripping of libs & executables ],
2331     ENABLE_STRIP=1,
2332     ENABLE_STRIP= )
2334 dnl ========================================================
2335 dnl = Enable stripping of libs & executables when packaging
2336 dnl ========================================================
2337 MOZ_ARG_ENABLE_BOOL(install-strip,
2338 [  --enable-install-strip  Enable stripping of libs & executables when packaging ],
2339     PKG_SKIP_STRIP= ,
2340     PKG_SKIP_STRIP=1)
2342 dnl ========================================================
2343 dnl = frontend JS debug mode
2344 dnl ========================================================
2346 MOZ_ARG_ENABLE_BOOL(debug-js-modules,
2347 [  --enable-debug-js-modules  Enable debug mode for frontend JS libraries],
2348    DEBUG_JS_MODULES=1,
2349    DEBUG_JS_MODULES=)
2351 AC_SUBST(DEBUG_JS_MODULES)
2353 dnl ========================================================
2354 dnl =
2355 dnl = Profiling and Instrumenting
2356 dnl =
2357 dnl ========================================================
2358 MOZ_ARG_HEADER(Profiling and Instrumenting)
2360 dnl ========================================================
2361 dnl = Offer a way to disable the startup cache
2362 dnl ========================================================
2364 MOZ_ARG_DISABLE_BOOL(startupcache,
2365 [  --disable-startupcache          Disable startup cache ],
2366     MOZ_DISABLE_STARTUPCACHE=1,
2367     MOZ_DISABLE_STARTUPCACHE=)
2369 if test -n "$MOZ_DISABLE_STARTUPCACHE"; then
2370   AC_DEFINE(MOZ_DISABLE_STARTUPCACHE)
2372 AC_SUBST(MOZ_DISABLE_STARTUPCACHE)
2374 dnl ========================================================
2375 dnl = Support for demangling undefined symbols
2376 dnl ========================================================
2377 if test -z "$SKIP_LIBRARY_CHECKS"; then
2378     AC_LANG_SAVE
2379     AC_LANG_CPLUSPLUS
2380     AC_CHECK_FUNCS(__cxa_demangle, HAVE_DEMANGLE=1, HAVE_DEMANGLE=)
2381     AC_LANG_RESTORE
2384 # Demangle only for debug or DMD builds
2385 MOZ_DEMANGLE_SYMBOLS=
2386 if test "$HAVE_DEMANGLE" && test "$MOZ_DEBUG" -o "$MOZ_DMD"; then
2387     MOZ_DEMANGLE_SYMBOLS=1
2388     AC_DEFINE(MOZ_DEMANGLE_SYMBOLS)
2390 AC_SUBST(MOZ_DEMANGLE_SYMBOLS)
2392 dnl ========================================================
2393 dnl = Support for gcc stack unwinding (from gcc 3.3)
2394 dnl ========================================================
2395 if test -z "$SKIP_LIBRARY_CHECKS"; then
2396     AC_LANG_SAVE
2397     AC_LANG_CPLUSPLUS
2398     MOZ_CHECK_HEADER(unwind.h, AC_CHECK_FUNCS(_Unwind_Backtrace))
2399     AC_LANG_RESTORE
2402 dnl ========================================================
2403 dnl JIT observers
2404 dnl ========================================================
2406 MOZ_ARG_WITH_STRING(jitreport-granularity,
2407 [  --jitreport-granularity=N
2408                            Default granularity at which to report JIT code
2409                            to external tools
2410                              0 - no info
2411                              1 - code ranges for whole functions only
2412                              2 - per-line information
2413                              3 - per-op information],
2414   JITREPORT_GRANULARITY=$withval,
2415   JITREPORT_GRANULARITY=3)
2417 AC_DEFINE_UNQUOTED(JS_DEFAULT_JITREPORT_GRANULARITY, $JITREPORT_GRANULARITY)
2419 dnl ========================================================
2420 dnl =
2421 dnl = Misc. Options
2422 dnl =
2423 dnl ========================================================
2424 MOZ_ARG_HEADER(Misc. Options)
2426 dnl ========================================================
2427 dnl = Location of the mozilla user directory (default is ~/.mozilla).],
2428 dnl ========================================================
2429 MOZ_ARG_WITH_STRING(user-appdir,
2430 [  --with-user-appdir=DIR  Set user-specific appdir (default=.mozilla)],
2431 [ val=`echo $withval`
2432 if echo "$val" | grep "\/" >/dev/null; then
2433     AC_MSG_ERROR("Homedir must be single relative path.")
2434 else
2435     MOZ_USER_DIR="$val"
2436 fi])
2438 AC_DEFINE_UNQUOTED(MOZ_USER_DIR,"$MOZ_USER_DIR")
2440 if test -z "$SKIP_COMPILER_CHECKS"; then
2441 dnl ========================================================
2442 dnl =
2443 dnl = Compiler Options
2444 dnl =
2445 dnl ========================================================
2446 MOZ_ARG_HEADER(Compiler Options)
2448 dnl ========================================================
2449 dnl Check for gcc -pipe support
2450 dnl ========================================================
2451 AC_MSG_CHECKING([for -pipe support])
2452 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
2453     dnl Any gcc that supports firefox supports -pipe.
2454     CFLAGS="$CFLAGS -pipe"
2455     CXXFLAGS="$CXXFLAGS -pipe"
2456     AC_MSG_RESULT([yes])
2457 else
2458     AC_MSG_RESULT([no])
2461 fi # ! SKIP_COMPILER_CHECKS
2463 AC_LANG_C
2465 if test "$COMPILE_ENVIRONMENT"; then
2466 MOZ_EXPAND_LIBS
2467 fi # COMPILE_ENVIRONMENT
2469 dnl ========================================================
2470 dnl =
2471 dnl = Static Build Options
2472 dnl =
2473 dnl ========================================================
2474 MOZ_ARG_HEADER(Static build options)
2476 if test -z "$MOZ_SYSTEM_ZLIB"; then
2477 if test -n "$JS_SHARED_LIBRARY" -o -n "$MOZ_LINKER" -o "$MOZ_WIDGET_TOOLKIT" = android; then
2478   ZLIB_IN_MOZGLUE=1
2479   AC_DEFINE(ZLIB_IN_MOZGLUE)
2483 AC_SUBST(ZLIB_IN_MOZGLUE)
2485 dnl ========================================================
2486 dnl =
2487 dnl = Standalone module options
2488 dnl =
2489 dnl ========================================================
2490 MOZ_ARG_HEADER(Standalone module options (Not for building Mozilla))
2492 dnl Check for GLib.
2493 dnl ========================================================
2495 if test -z "$SKIP_PATH_CHECKS"; then
2496 if test -z "${GLIB_CFLAGS}" -o -z "${GLIB_LIBS}" ; then
2497     if test "$MOZ_ENABLE_GTK" ; then
2498         PKG_CHECK_MODULES(GLIB, glib-2.0 >= 1.3.7 gobject-2.0)
2499     fi
2503 if test -z "${GLIB_GMODULE_LIBS}" \
2504    -a -n "${GLIB_CONFIG}"\
2505     -a "${GLIB_CONFIG}" != no\
2506 ; then
2507     GLIB_GMODULE_LIBS=`$GLIB_CONFIG gmodule --libs`
2510 AC_SUBST_LIST(GLIB_GMODULE_LIBS)
2512 if test "$USE_FC_FREETYPE"; then
2513     if test "$COMPILE_ENVIRONMENT"; then
2514         dnl ========================================================
2515         dnl = Check for freetype2 functionality
2516         dnl ========================================================
2517         if test "$_HAVE_FREETYPE2" -a -z "$MOZ_TREE_FREETYPE"; then
2518             _SAVE_LIBS="$LIBS"
2519             _SAVE_CFLAGS="$CFLAGS"
2520             LIBS="$LIBS $FT2_LIBS"
2521             CFLAGS="$CFLAGS $FT2_CFLAGS"
2523             AC_CACHE_CHECK(for FT_Bitmap_Size.y_ppem,
2524                 ac_cv_member_FT_Bitmap_Size_y_ppem,
2525                 [AC_TRY_COMPILE([#include <ft2build.h>
2526                                  #include FT_FREETYPE_H],
2527                                 [FT_Bitmap_Size s;
2528                                  if (sizeof s.y_ppem) return 0;
2529                                  return 1],
2530                                 ac_cv_member_FT_Bitmap_Size_y_ppem=yes,
2531                                 ac_cv_member_FT_Bitmap_Size_y_ppem=no)])
2532             if test "$ac_cv_member_FT_Bitmap_Size_y_ppem" = yes; then
2533                 HAVE_FT_BITMAP_SIZE_Y_PPEM=1
2534             else
2535                 HAVE_FT_BITMAP_SIZE_Y_PPEM=0
2536             fi
2537             AC_DEFINE_UNQUOTED(HAVE_FT_BITMAP_SIZE_Y_PPEM,
2538                                $HAVE_FT_BITMAP_SIZE_Y_PPEM,
2539                                [FT_Bitmap_Size structure includes y_ppem field])
2541             AC_CHECK_FUNCS(FT_GlyphSlot_Embolden FT_Load_Sfnt_Table)
2543             LIBS="$_SAVE_LIBS"
2544             CFLAGS="$_SAVE_CFLAGS"
2545         fi
2547         _SAVE_CPPFLAGS="$CPPFLAGS"
2548         CPPFLAGS="$CPPFLAGS $FT2_CFLAGS $XCFLAGS"
2549         MOZ_CHECK_HEADERS([fontconfig/fcfreetype.h], ,
2550             [AC_MSG_ERROR(Can't find header fontconfig/fcfreetype.h.)], [#include <fontconfig/fontconfig.h>])
2551         CPPFLAGS="$_SAVE_CPPFLAGS"
2552     fi
2555 dnl ========================================================
2556 dnl Check if we need the 32-bit Linux SSE2 error dialog
2557 dnl ========================================================
2559 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
2561 dnl ========================================================
2562 dnl Check for pixman and cairo
2563 dnl ========================================================
2565 MOZ_TREE_CAIRO=1
2566 MOZ_ARG_ENABLE_BOOL(system-cairo,
2567 [ --enable-system-cairo  Obsolete: do not use this option],
2568 AC_MSG_ERROR(--enable-system-cairo is not supported),
2569 MOZ_TREE_CAIRO=1 )
2571 MOZ_TREE_PIXMAN=1
2572 MOZ_ARG_ENABLE_BOOL(system-pixman,
2573 [ --enable-system-pixman Use system pixman (located with pkgconfig)],
2574 MOZ_TREE_PIXMAN=,
2575 MOZ_TREE_PIXMAN=force,
2576 MOZ_TREE_PIXMAN=1 )
2578 if test "$MOZ_TREE_PIXMAN"; then
2579     AC_DEFINE(MOZ_TREE_PIXMAN)
2580 else
2581     PKG_CHECK_MODULES(MOZ_PIXMAN, pixman-1 >= 0.19.2)
2584 MOZ_CAIRO_CFLAGS="-I${DIST}/include/cairo"
2585 AC_DEFINE(MOZ_TREE_CAIRO)
2587 if test "$OS_ARCH" = "WINNT"; then
2588     # For now we assume that we will have a uint64_t available through
2589     # one of the above headers or mozstdint.h.
2590     AC_DEFINE(HAVE_UINT64_T)
2593 # Define macros for cairo-features.h
2594 TEE_SURFACE_FEATURE="#define CAIRO_HAS_TEE_SURFACE 1"
2595 if test "$MOZ_X11"; then
2596     XLIB_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_SURFACE 1"
2597     XLIB_XRENDER_SURFACE_FEATURE="#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1"
2598     PS_SURFACE_FEATURE="#define CAIRO_HAS_PS_SURFACE 1"
2600 if test "$_HAVE_FREETYPE2"; then
2601     FT_FONT_FEATURE="#define CAIRO_HAS_FT_FONT 1"
2602     MOZ_ENABLE_CAIRO_FT=1
2603     CAIRO_FT_CFLAGS="$FT2_CFLAGS"
2606 case "$MOZ_WIDGET_TOOLKIT" in
2607   cocoa | uikit)
2608     QUARTZ_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_SURFACE 1"
2609     QUARTZ_IMAGE_SURFACE_FEATURE="#define CAIRO_HAS_QUARTZ_IMAGE_SURFACE 1"
2610     QUARTZ_FONT_FEATURE="#define CAIRO_HAS_QUARTZ_FONT 1"
2611     ;;
2612   windows)
2613     WIN32_DWRITE_FONT_FEATURE="#define CAIRO_HAS_DWRITE_FONT 1"
2614     WIN32_FONT_FEATURE="#define CAIRO_HAS_WIN32_FONT 1"
2615     WIN32_SURFACE_FEATURE="#define CAIRO_HAS_WIN32_SURFACE 1"
2617     if test "$COMPILE_ENVIRONMENT"; then
2618       MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
2619     fi
2620     ;;
2621 esac
2622 if test "$USE_FC_FREETYPE"; then
2623     FC_FONT_FEATURE="#define CAIRO_HAS_FC_FONT 1"
2625 AC_SUBST(MOZ_ENABLE_CAIRO_FT)
2626 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
2628 AC_SUBST(PS_SURFACE_FEATURE)
2629 AC_SUBST(SVG_SURFACE_FEATURE)
2630 AC_SUBST(XLIB_SURFACE_FEATURE)
2631 AC_SUBST(XLIB_XRENDER_SURFACE_FEATURE)
2632 AC_SUBST(QUARTZ_SURFACE_FEATURE)
2633 AC_SUBST(QUARTZ_IMAGE_SURFACE_FEATURE)
2634 AC_SUBST(WIN32_SURFACE_FEATURE)
2635 AC_SUBST(OS2_SURFACE_FEATURE)
2636 AC_SUBST(DIRECTFB_SURFACE_FEATURE)
2637 AC_SUBST(FT_FONT_FEATURE)
2638 AC_SUBST(FC_FONT_FEATURE)
2639 AC_SUBST(WIN32_FONT_FEATURE)
2640 AC_SUBST(WIN32_DWRITE_FONT_FEATURE)
2641 AC_SUBST(QUARTZ_FONT_FEATURE)
2642 AC_SUBST(PNG_FUNCTIONS_FEATURE)
2643 AC_SUBST(QT_SURFACE_FEATURE)
2644 AC_SUBST(TEE_SURFACE_FEATURE)
2646 if test "$MOZ_X11"; then
2647     MOZ_CAIRO_OSLIBS="$MOZ_CAIRO_OSLIBS $XLDFLAGS -lXrender"
2650 CAIRO_FEATURES_H=gfx/cairo/cairo/src/cairo-features.h
2652 case "$MOZ_WIDGET_TOOLKIT" in
2653 android)
2654     TK_CFLAGS="$MOZ_CAIRO_CFLAGS $MOZ_PIXMAN_CFLAGS"
2655     TK_LIBS="$MOZ_CAIRO_LIBS $MOZ_PIXMAN_LIBS"
2656     ;;
2657 esac
2659 AC_SUBST(MOZ_TREE_CAIRO)
2660 AC_SUBST_LIST(MOZ_CAIRO_CFLAGS)
2661 AC_SUBST_LIST(MOZ_CAIRO_LIBS)
2662 AC_SUBST_LIST(MOZ_CAIRO_OSLIBS)
2663 AC_SUBST(MOZ_TREE_PIXMAN)
2665 BINDGEN_SYSTEM_FLAGS="$_BINDGEN_CFLAGS $NSPR_CFLAGS $NSS_CFLAGS $MOZ_PIXMAN_CFLAGS $MOZ_CAIRO_CFLAGS"
2666 AC_SUBST(BINDGEN_SYSTEM_FLAGS)
2667 BINDGEN_SYSTEM_TOML_FLAGS="$BINDGEN_SYSTEM_FLAGS"
2668 AC_SUBST_TOML_LIST(BINDGEN_SYSTEM_TOML_FLAGS)
2670 dnl ========================================================
2671 dnl disable xul
2672 dnl ========================================================
2673 MOZ_ARG_DISABLE_BOOL(xul,
2674 [  --disable-xul           Disable XUL],
2675     MOZ_XUL= )
2676 if test "$MOZ_XUL"; then
2677   AC_DEFINE(MOZ_XUL)
2678 else
2679   dnl remove extensions that require XUL
2680   MOZ_EXTENSIONS=`echo $MOZ_EXTENSIONS | sed -e 's/inspector//' -e 's/irc//' -e 's/tasks//'`
2683 AC_SUBST(MOZ_XUL)
2685 dnl ========================================================
2686 dnl necko configuration options
2687 dnl ========================================================
2690 dnl option to disable necko's wifi scanner
2693 if test "$MOZ_WIDGET_TOOLKIT"; then
2695   case "$OS_TARGET" in
2696     Darwin)
2697       if test -z "$MOZ_IOS"; then
2698         NECKO_WIFI=1
2699       fi
2700       ;;
2701     DragonFly|FreeBSD|WINNT)
2702       NECKO_WIFI=1
2703       ;;
2704     Linux)
2705       NECKO_WIFI=1
2706       NECKO_WIFI_DBUS=1
2707       ;;
2708   esac
2712 MOZ_ARG_DISABLE_BOOL(necko-wifi,
2713 [  --disable-necko-wifi    Disable necko wifi scanner],
2714     NECKO_WIFI=,
2715     NECKO_WIFI=1)
2717 if test "$NECKO_WIFI"; then
2718   if test -z "$MOZ_ENABLE_DBUS" -a -n "$NECKO_WIFI_DBUS"; then
2719     AC_MSG_ERROR([Necko WiFi scanning needs DBus on your platform, remove --disable-dbus or use --disable-necko-wifi])
2720   fi
2721   AC_DEFINE(NECKO_WIFI)
2722   _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_WIFI"
2724 AC_SUBST(NECKO_WIFI)
2725 AC_SUBST(NECKO_WIFI_DBUS)
2728 dnl option to disable cookies
2730 MOZ_ARG_DISABLE_BOOL(cookies,
2731 [  --disable-cookies       Disable cookie support],
2732     NECKO_COOKIES=,
2733     NECKO_COOKIES=1)
2734 AC_SUBST(NECKO_COOKIES)
2735 if test "$NECKO_COOKIES"; then
2736     AC_DEFINE(NECKO_COOKIES)
2737     _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES NECKO_COOKIES"
2740 dnl ========================================================
2741 dnl =
2742 dnl = Maintainer debug option (no --enable equivalent)
2743 dnl =
2744 dnl ========================================================
2746 AC_SUBST(NM)
2747 AC_SUBST_LIST(ASFLAGS)
2748 AC_SUBST(RCFLAGS)
2749 AC_SUBST(IMPLIB)
2750 AC_SUBST(FILTER)
2751 AC_SUBST(MOZ_AUTH_EXTENSION)
2752 AC_SUBST(MOZ_PREF_EXTENSIONS)
2753 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
2754 AC_SUBST_LIST(WARNINGS_CFLAGS)
2755 AC_SUBST_SET(MOZ_EXTENSIONS)
2757 AC_SUBST(MOZ_UNIVERSALCHARDET)
2758 AC_SUBST(MOZ_SPELLCHECK)
2759 AC_SUBST(MOZ_ANDROID_ANR_REPORTER)
2760 AC_SUBST(MOZ_CRASHREPORTER)
2761 AC_SUBST(MOZ_CRASHREPORTER_INJECTOR)
2762 AC_SUBST(MOZ_STUB_INSTALLER)
2763 AC_SUBST(MOZ_UPDATER)
2765 AC_SUBST(MOZ_ANDROID_APPLICATION_CLASS)
2766 AC_SUBST(MOZ_ANDROID_BROWSER_INTENT_CLASS)
2767 AC_SUBST(MOZ_EXCLUDE_HYPHENATION_DICTIONARIES)
2768 AC_SUBST(ENABLE_STRIP)
2769 AC_SUBST(PKG_SKIP_STRIP)
2770 AC_SUBST(STRIP_FLAGS)
2771 AC_SUBST(INCREMENTAL_LINKER)
2773 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
2775 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
2776 AC_SUBST(MOZ_LINKER_EXTRACT)
2778 if test -n "$MOZ_BINARY_EXTENSIONS"; then
2779   AC_DEFINE(MOZ_BINARY_EXTENSIONS)
2782 AC_SUBST(MOZ_REQUIRE_SIGNING)
2783 if test "$MOZ_REQUIRE_SIGNING" = 1; then
2784   AC_DEFINE(MOZ_REQUIRE_SIGNING)
2787 dnl ========================================================
2788 dnl = Mac bundle name prefix
2789 dnl ========================================================
2790 MOZ_ARG_WITH_STRING(macbundlename-prefix,
2791 [  --with-macbundlename-prefix=prefix
2792                           Prefix for MOZ_MACBUNDLE_NAME],
2793 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
2795 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
2796 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
2797   MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
2800 if test "$MOZ_DEBUG"; then
2801   MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
2802 else
2803   MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
2805 AC_SUBST(MOZ_MACBUNDLE_NAME)
2807 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
2808 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
2809 # Otherwise, use MOZ_APP_DISPLAYNAME
2810 if test -z "$MOZ_MACBUNDLE_ID"; then
2811    MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
2813 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
2814 if test "$MOZ_DEBUG"; then
2815   MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
2818 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
2819 AC_SUBST(MOZ_MACBUNDLE_ID)
2821 dnl ========================================================
2822 dnl = Child Process Name for IPC
2823 dnl ========================================================
2824 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
2825   MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
2826 else
2827   # We want to let Android unpack the file at install time, but it only does
2828   # so if the file is named libsomething.so. The lib/ path is also required
2829   # because the unpacked file will be under the lib/ subdirectory and will
2830   # need to be executed from that path.
2831   MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
2833 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
2834 MOZ_CHILD_PROCESS_BUNDLENAME="${MOZ_APP_DISPLAYNAME}CP"
2836 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
2837 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
2838 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
2840 # The following variables are available to branding and application
2841 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
2842 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
2843 # impacts profile location and user-visible fields.
2844 # - MOZ_APP_BASENAME: Typically stays consistent for multiple branded
2845 # versions of a given application (e.g. Aurora and Firefox both use
2846 # "Firefox"), but may vary for full rebrandings (e.g. Iceweasel). Used
2847 # for application.ini's "Name" field, which controls profile location in
2848 # the absence of a "Profile" field (see below), and various system
2849 # integration hooks (Unix remoting, Windows MessageWindow name, etc.)
2850 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
2851 # Mac Bundle name, Updater, Installer), it is typically used for nightly
2852 # builds (e.g. Aurora for Firefox).
2853 # - MOZ_APP_NAME: Used for e.g. the binary program file name. If not set,
2854 # defaults to a lowercase form of MOZ_APP_BASENAME.
2855 # - MOZ_APP_REMOTINGNAME: Used for the internal program name, which affects
2856 # profile name and remoting. If not set, defaults to MOZ_APP_NAME.
2857 # - MOZ_APP_PROFILE: When set, used for application.ini's
2858 # "Profile" field, which controls profile location.
2859 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
2860 # crash reporter server url.
2861 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
2863 # The following environment variables used to have an effect, but don't anymore:
2864 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
2865 # the contents from the version.txt file in the application directory, or
2866 # browser/config/version.txt if there isn't one.
2867 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
2868 # in the "About" window. This was replaced with the contents from the
2869 # version_display.txt or version.txt in the application directory, or
2870 # browser/config/version_display.txt.
2872 if test -z "$MOZ_APP_NAME"; then
2873    MOZ_APP_NAME=`echo $MOZ_APP_BASENAME | tr A-Z a-z`
2876 if test -z "$MOZ_APP_REMOTINGNAME"; then
2877    MOZ_APP_REMOTINGNAME=$MOZ_APP_NAME
2880 if test -z "$ANDROID_PACKAGE_NAME" ; then
2881    # When we got rid of the Aurora channel we decided to replace the old
2882    # Nightly ANDROID_PACKAGE_NAME with Aurora. To make sure this is inherited
2883    # by all mozilla-central based branches we make this the new "default"
2884    # for Fennec. Non mozilla-central based branches set ANDROID_PACKAGE_NAME
2885    # in their mozconfig, so they will never get this. If there are ever
2886    # non-Fennec builds for Android, they will fall into the else block
2887    # and use their own default name.
2888    # https://bugzilla.mozilla.org/show_bug.cgi?id=1357808 has additional
2889    # background on this.
2890    if test "$MOZ_APP_NAME" = "fennec"; then
2891       ANDROID_PACKAGE_NAME="org.mozilla.fennec_aurora"
2892    else
2893       ANDROID_PACKAGE_NAME="org.mozilla.$MOZ_APP_NAME"
2894    fi
2897 # For extensions and langpacks, we require a max version that is compatible
2898 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
2899 # 24.0a1 and 24.0a2 aren't affected
2900 # 24.0 becomes 24.*
2901 # 24.1.1 becomes 24.*
2902 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
2903 if test -z "$IS_ALPHA"; then
2904   changequote(,)
2905   if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
2906     MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
2907   else
2908     MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
2909   fi
2910   changequote([,])
2911 else
2912   MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
2915 AC_SUBST(MOZ_APP_NAME)
2916 AC_SUBST(MOZ_APP_REMOTINGNAME)
2917 AC_SUBST(MOZ_APP_DISPLAYNAME)
2918 AC_SUBST(MOZ_APP_BASENAME)
2919 AC_SUBST(MOZ_APP_VENDOR)
2920 AC_SUBST(MOZ_APP_PROFILE)
2921 AC_SUBST(MOZ_APP_ID)
2922 AC_SUBST(MAR_CHANNEL_ID)
2923 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
2924 AC_SUBST(MOZ_PROFILE_MIGRATOR)
2925 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
2926 AC_SUBST(MOZ_APP_UA_NAME)
2927 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
2928 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
2929 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
2931 AC_SUBST(MOZ_APP_MAXVERSION)
2932 AC_SUBST(MOZ_UA_OS_AGNOSTIC)
2933 if test -n "$MOZ_UA_OS_AGNOSTIC"; then
2934   AC_DEFINE(MOZ_UA_OS_AGNOSTIC)
2937 AC_SUBST(MOZ_PKG_SPECIAL)
2938 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
2940 if test "$MOZILLA_OFFICIAL"; then
2941     # Build revisions should always be present in official builds
2942     MOZ_INCLUDE_SOURCE_INFO=1
2945 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
2946 # explicitly set the repository and changeset information in.
2947 AC_SUBST(MOZ_SOURCE_REPO)
2948 AC_SUBST(MOZ_SOURCE_CHANGESET)
2949 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
2951 dnl If we have any service that uploads data (and requires data submission
2952 dnl policy alert), set MOZ_DATA_REPORTING.
2953 dnl We need SUBST for build system and DEFINE for xul preprocessor.
2954 if test -n "$MOZ_TELEMETRY_REPORTING" || test -n "$MOZ_SERVICES_HEALTHREPORT" || test -n "$MOZ_CRASHREPORTER"  || test -n "$MOZ_NORMANDY"; then
2955   MOZ_DATA_REPORTING=1
2956   AC_DEFINE(MOZ_DATA_REPORTING)
2957   AC_SUBST(MOZ_DATA_REPORTING)
2960 dnl win32 options
2961 AC_SUBST(WIN32_REDIST_DIR)
2962 AC_SUBST(WIN_UCRT_REDIST_DIR)
2964 dnl ========================================================
2965 dnl ICU Support
2966 dnl ========================================================
2968 _INTL_API=yes
2970 if test "$MOZ_WIDGET_TOOLKIT" = "cocoa"; then
2971     USE_ICU=1
2974 MOZ_CONFIG_ICU()
2976 dnl Echo the CFLAGS to remove extra whitespace.
2977 CFLAGS=`echo \
2978     $_COMPILATION_CFLAGS \
2979     $CFLAGS`
2981 CXXFLAGS=`echo \
2982     $_WARNINGS_CXXFLAGS \
2983     $_COMPILATION_CXXFLAGS \
2984     $CXXFLAGS`
2986 COMPILE_CFLAGS=`echo \
2987     $_DEFINES_CFLAGS \
2988     $COMPILE_CFLAGS`
2990 COMPILE_CXXFLAGS=`echo \
2991     $_DEFINES_CXXFLAGS \
2992     $COMPILE_CXXFLAGS`
2994 HOST_CFLAGS=`echo \
2995     $_WARNINGS_HOST_CFLAGS \
2996     $_COMPILATION_HOST_CFLAGS \
2997     $HOST_CFLAGS`
2999 HOST_CXXFLAGS=`echo \
3000     $_WARNINGS_HOST_CXXFLAGS \
3001     $_COMPILATION_HOST_CXXFLAGS \
3002     $HOST_CXXFLAGS`
3004 AC_SUBST(MOZ_SYSTEM_PNG)
3006 AC_SUBST_LIST(MOZ_PNG_CFLAGS)
3007 AC_SUBST_LIST(MOZ_PNG_LIBS)
3009 AC_SUBST(MOZ_SYSTEM_NSPR)
3011 AC_SUBST(MOZ_SYSTEM_NSS)
3013 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
3014 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
3015 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
3016 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
3017 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
3018   OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
3019   OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
3021 AC_SUBST(HOST_CMFLAGS)
3022 AC_SUBST(HOST_CMMFLAGS)
3023 AC_SUBST(OS_COMPILE_CMFLAGS)
3024 AC_SUBST(OS_COMPILE_CMMFLAGS)
3026 OS_CFLAGS="$CFLAGS"
3027 OS_CXXFLAGS="$CXXFLAGS"
3028 OS_CPPFLAGS="$CPPFLAGS"
3029 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
3030 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
3031 OS_LDFLAGS="$LDFLAGS"
3032 OS_LIBS="$LIBS"
3033 AC_SUBST_LIST(OS_CFLAGS)
3034 AC_SUBST_LIST(OS_CXXFLAGS)
3035 AC_SUBST_LIST(OS_CPPFLAGS)
3036 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
3037 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
3038 AC_SUBST_LIST(OS_LDFLAGS)
3039 AC_SUBST(OS_LIBS)
3041 AC_SUBST(HOST_CC)
3042 AC_SUBST(HOST_CXX)
3043 AC_SUBST_LIST(HOST_CFLAGS)
3044 AC_SUBST_LIST(HOST_CPPFLAGS)
3045 AC_SUBST_LIST(HOST_CXXFLAGS)
3046 AC_SUBST(HOST_LDFLAGS)
3047 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
3048 AC_SUBST(HOST_BIN_SUFFIX)
3050 AC_SUBST(TARGET_XPCOM_ABI)
3051 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSSE3)
3052 AC_SUBST(HAVE_TOOLCHAIN_SUPPORT_MSSE4_1)
3053 AC_SUBST(HAVE_X86_AVX2)
3054 AC_SUBST(HAVE_ALTIVEC)
3056 AC_SUBST_LIST(DSO_CFLAGS)
3057 AC_SUBST_LIST(DSO_PIC_CFLAGS)
3058 AC_SUBST(DSO_LDOPTS)
3059 AC_SUBST(BIN_SUFFIX)
3060 AC_SUBST(USE_N32)
3061 AC_SUBST(NS_ENABLE_TSF)
3062 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
3063 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
3065 AC_SUBST(MOZ_DEVTOOLS)
3067 AC_SUBST(MOZ_PACKAGE_JSSHELL)
3068 AC_SUBST(MOZ_FOLD_LIBS)
3069 AC_SUBST_LIST(MOZ_FOLD_LIBS_FLAGS)
3071 AC_SUBST(DMG_TOOL)
3073 dnl Host JavaScript runtime, if any, to use during cross compiles.
3074 AC_SUBST(JS_BINARY)
3076 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
3078 if test -n "$COMPILE_ENVIRONMENT"; then
3079 AC_CHECK_FUNCS(posix_fadvise posix_fallocate)
3081 dnl Check for missing components
3082 if test "$MOZ_X11"; then
3083     dnl ====================================================
3084     dnl = Check if X headers exist
3085     dnl ====================================================
3086     _SAVE_CFLAGS=$CFLAGS
3087     CFLAGS="$CFLAGS $XCFLAGS"
3088     AC_TRY_COMPILE([
3089         #include <stdio.h>
3090         #include <stdlib.h>
3091         #include <X11/Xlib.h>
3092         #include <X11/Intrinsic.h>
3093         #include <X11/extensions/XShm.h>
3094     ],
3095     [
3096         Display *dpy = 0;
3097         if ((dpy = XOpenDisplay(NULL)) == NULL) {
3098             fprintf(stderr, ": can't open %s\n", XDisplayName(NULL));
3099             exit(1);
3100         }
3101     ], [],
3102     [ AC_MSG_ERROR([Can't find X headers (install libxt-dev (Debian/Ubuntu), libXt-devel (Fedora), or xorg-x11-libXt-devel (SuSE)).]) ])
3103     CFLAGS="$_SAVE_CFLAGS"
3105     if test -n "$MISSING_X"; then
3106         AC_MSG_ERROR([ Could not find the following X libraries: $MISSING_X ]);
3107     fi
3109 fi # MOZ_X11
3111 fi # COMPILE_ENVIRONMENT
3113 dnl Set various defines and substitutions
3114 dnl ========================================================
3116 if test "$ACCESSIBILITY" -a "$MOZ_ENABLE_GTK" ; then
3117     AC_DEFINE(MOZ_ACCESSIBILITY_ATK)
3118     ATK_FULL_VERSION=`$PKG_CONFIG --modversion atk`
3119     ATK_MAJOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $1 }'`
3120     ATK_MINOR_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $2 }'`
3121     ATK_REV_VERSION=`echo ${ATK_FULL_VERSION} | $AWK -F\. '{ print $3 }'`
3122     AC_DEFINE_UNQUOTED(ATK_MAJOR_VERSION, $ATK_MAJOR_VERSION)
3123     AC_DEFINE_UNQUOTED(ATK_MINOR_VERSION, $ATK_MINOR_VERSION)
3124     AC_DEFINE_UNQUOTED(ATK_REV_VERSION, $ATK_REV_VERSION)
3127 AC_SUBST(MOZ_DEV_EDITION)
3128 if test -n "$MOZ_DEV_EDITION"; then
3129     AC_DEFINE(MOZ_DEV_EDITION)
3132 if test "$MOZ_DEBUG" -o "$DEVELOPER_OPTIONS"; then
3133     A11Y_LOG=1
3135 AC_SUBST(A11Y_LOG)
3136 if test -n "$A11Y_LOG"; then
3137     AC_DEFINE(A11Y_LOG)
3140 dnl Spit out some output
3141 dnl ========================================================
3143 dnl The following defines are used by xpcom
3144 _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
3145 HAVE_GETPAGESIZE
3146 HAVE_STATVFS64
3147 HAVE_STATVFS
3148 HAVE_STATFS64
3149 HAVE_STATFS
3150 HAVE_SYS_STATVFS_H
3151 HAVE_SYS_STATFS_H
3152 HAVE_SYS_VFS_H
3153 HAVE_SYS_MOUNT_H
3156 # Avoid using obsolete NSPR features
3157 AC_DEFINE(NO_NSPR_10_SUPPORT)
3159 MOZ_CREATE_CONFIG_STATUS()
3161 rm -fr confdefs* $ac_clean_files