Backed out 3 changesets (bug 1764201) for causing multiple failures, including build...
[gecko.git] / old-configure.in
blobab6d9e9d8ffe697398e4e9b79b42083aa4a969f8
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 Set the minimum version of toolkit libs used by mozilla
30 dnl ========================================================
31 W32API_VERSION=3.14
33 dnl Initialize the Pthread test variables early so they can be
34 dnl  overridden by each platform.
35 dnl ========================================================
36 MOZ_USE_PTHREADS=
37 _PTHREAD_LDFLAGS=""
39 LDFLAGS="$LDFLAGS $LINKER_LDFLAGS $PACK_REL_RELOC_FLAGS"
40 HOST_LDFLAGS="$HOST_LDFLAGS $HOST_LINKER_LDFLAGS"
42 if test "$COMPILE_ENVIRONMENT"; then
43     MOZ_ANDROID_NDK
44 fi # COMPILE_ENVIRONMENT
46 dnl ========================================================
47 dnl Checks for compilers.
48 dnl ========================================================
50 if test "$COMPILE_ENVIRONMENT"; then
52 # Run some logic to figure out exe extensions (mostly for mingw's sake)
53 AC_EXEEXT
55 if test "$target" != "$host"; then
56     MOZ_CROSS_COMPILER
57 else
58     AC_PROG_CC
59     case "$target" in
60     *-mingw*)
61       # Work around the conftest.exe access problem on Windows
62       sleep 2
63     esac
64     AC_PROG_CXX
67 MOZ_TOOL_VARIABLES
69 dnl ========================================================
70 dnl Special win32 checks
71 dnl ========================================================
73 WINVER=0A00
75 case "$target" in
76 *-mingw*)
77     if test "$GCC" != "yes"; then
78         # Check to see if we are really running in a msvc environemnt
79         _WIN32_MSVC=1
81         # Make sure compilers are valid
82         CXXFLAGS="$CXXFLAGS -TP"
83         AC_LANG_SAVE
84         AC_LANG_C
85         AC_TRY_COMPILE([#include <stdio.h>],
86             [ printf("Hello World\n"); ],,
87             AC_MSG_ERROR([\$(CC) test failed.  You must have MS VC++ in your path to build.]) )
89         AC_LANG_CPLUSPLUS
90         AC_TRY_COMPILE([#include <new.h>],
91             [ unsigned *test = new unsigned(42); ],,
92             AC_MSG_ERROR([\$(CXX) test failed.  You must have MS VC++ in your path to build.]) )
93         AC_LANG_RESTORE
95         AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
96         AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
98         MSVC_C_RUNTIME_DLL=vcruntime140.dll
99         if test "$TARGET_CPU" != "x86"; then
100             MSVC_C_RUNTIME_1_DLL=vcruntime140_1.dll
101         fi
102         MSVC_CXX_RUNTIME_DLL=msvcp140.dll
104         # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
105         CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
107         AC_SUBST(MSVC_C_RUNTIME_DLL)
108         AC_SUBST(MSVC_C_RUNTIME_1_DLL)
109         AC_SUBST(MSVC_CXX_RUNTIME_DLL)
111         AC_DEFINE(HAVE_SEH_EXCEPTIONS)
112     else
113         # Check w32api version
114         _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
115         _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
116         AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
117         AC_TRY_COMPILE([#include <w32api.h>],
118             #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
119                 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
120                  __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
121                 #error "test failed."
122             #endif
123             , [ res=yes ], [ res=no ])
124         AC_MSG_RESULT([$res])
125         if test "$res" != "yes"; then
126             AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
127         fi
128         # strsafe.h on mingw uses macros for function deprecation that pollutes namespace
129         # causing problems with local implementations with the same name.
130         AC_DEFINE(STRSAFE_NO_DEPRECATE)
131     fi # !GNU_CC
133     AC_DEFINE(_USE_MATH_DEFINES) # Otherwise Windows' math.h doesn't #define M_PI.
135     CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
136     CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
138     AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
139     AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
140     AC_DEFINE_UNQUOTED(_WIN32_IE,0x0A00)
142     ;;
143 esac
145 if test -n "$_WIN32_MSVC"; then
146     SKIP_PATH_CHECKS=1
147     SKIP_COMPILER_CHECKS=1
148     SKIP_LIBRARY_CHECKS=1
150     # Since we're skipping compiler and library checks, hard-code
151     # some facts here.
152     AC_DEFINE(HAVE_IO_H)
153     AC_DEFINE(HAVE_ISATTY)
156 fi # COMPILE_ENVIRONMENT
158 AC_SUBST(GNU_CC)
159 AC_SUBST(GNU_CXX)
161 dnl ========================================================
162 dnl set the defaults first
163 dnl ========================================================
164 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
166 dnl Configure platform-specific CPU architecture compiler options.
167 dnl ==============================================================
168 if test "$COMPILE_ENVIRONMENT"; then
169     MOZ_ARCH_OPTS
170 fi # COMPILE_ENVIRONMENT
172 if test -n "$COMPILE_ENVIRONMENT"; then
173    MOZ_CONFIG_SANITIZE
176 dnl ========================================================
177 dnl GNU specific defaults
178 dnl ========================================================
179 if test "$GNU_CC"; then
180     if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
181         DSO_PIC_CFLAGS='-fPIC'
182         ASFLAGS="$ASFLAGS -fPIC"
183     fi
185     DSO_LDOPTS='-shared'
186     if test "$GCC_USE_GNU_LD"; then
187         # Some tools like ASan use a runtime library that is only
188         # linked against executables, so we must allow undefined
189         # symbols for shared objects in some cases.
190         if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
191             # Don't allow undefined symbols in libraries
192             DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
194             # BSDs need `environ' exposed for posix_spawn (bug 753046)
195             case "$OS_TARGET" in
196             DragonFly|FreeBSD|NetBSD|OpenBSD)
197                 if test "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED" = 1; then
198                     DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
199                 else
200                     DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
201                 fi
202                 ;;
203             esac
204         fi
205     fi
207     _DEFINES_CFLAGS="-include $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
209     ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
212 if test "$GNU_CXX"; then
213     CXXFLAGS="$CXXFLAGS -fno-exceptions"
215     _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
218 dnl ========================================================
219 dnl System overrides of the defaults for host
220 dnl ========================================================
221 case "$host" in
222 *mingw*)
223     if test -n "$_WIN32_MSVC"; then
224         HOST_CFLAGS="$HOST_CFLAGS"
225     else
226         HOST_CFLAGS="$HOST_CFLAGS -mwindows"
227     fi
228     HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
229     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
230     HOST_BIN_SUFFIX=.exe
232     case "${host_cpu}" in
233     i*86)
234         if test -n "$_WIN32_MSVC"; then
235             HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
236         fi
237         ;;
238     x86_64)
239         if test -n "$_WIN32_MSVC"; then
240             HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
241         fi
242         HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
243         ;;
244     esac
245     ;;
247 *-darwin*)
248     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
249     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
250     ;;
252 *-linux*|*-kfreebsd*-gnu|*-gnu*)
253     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
254     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
255     ;;
258     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
259     HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
260     ;;
261 esac
263 dnl ========================================================
264 dnl System overrides of the defaults for target
265 dnl ========================================================
267 MOZ_OPTIMIZE_LDFLAGS="${_COMPILATION_OPTIMIZE_LDFLAGS} ${MOZ_OPTIMIZE_FLAGS}"
269 case "$target" in
270 *-darwin*)
271     MOZ_OPTIMIZE_FLAGS="-O3"
272     DSO_LDOPTS=''
273     MOZ_FIX_LINK_PATHS=
274     ;;
276 *-android*|*-linuxandroid*)
277     # From https://github.com/android-ndk/ndk/issues/133#issuecomment-308549264
278     # -Oz is smaller than -Os on clang.
279     MOZ_OPTIMIZE_FLAGS="-Oz"
280     # Disable the outliner, which causes performance regressions, and is
281     # enabled on some platforms at -Oz.
282     if test -z "$MOZ_LTO"; then
283         DISABLE_OUTLINER="-mno-outline"
284         _SAVE_CFLAGS=$CFLAGS
285         CFLAGS="$CFLAGS $DISABLE_OUTLINER"
286         AC_TRY_COMPILE(,,[MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS $DISABLE_OUTLINER"])
287         CFLAGS="$_SAVE_CFLAGS"
288    else
289         DISABLE_OUTLINER="-Wl,-plugin-opt=-enable-machine-outliner=never"
290         _SAVE_LDFLAGS=$LDFLAGS
291         LDFLAGS="$LDFLAGS $MOZ_LTO_LDFLAGS $DISABLE_OUTLINER"
292         AC_TRY_LINK(,,[MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS $DISABLE_OUTLINER"])
293         LDFLAGS="$_SAVE_LDFLAGS"
294     fi
295     ;;
297 *-*linux*)
298     if test "$GNU_CC" -o "$GNU_CXX"; then
299         MOZ_PGO_OPTIMIZE_FLAGS="-O3"
300         MOZ_OPTIMIZE_FLAGS="-O2"
301     fi
303     case "${target_cpu}" in
304     alpha*)
305         CFLAGS="$CFLAGS -mieee"
306         CXXFLAGS="$CXXFLAGS -mieee"
307     ;;
308     esac
309     ;;
310 *-mingw*)
311     DSO_PIC_CFLAGS=
312     # certain versions of cygwin's makedepend barf on the
313     # #include <string> vs -I./dist/include/string issue so don't use it
314     if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
315         # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
316         if test -z "$CLANG_CC"; then
317             AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
318         fi
320         DSO_LDOPTS='-shared'
321         MOZ_FIX_LINK_PATHS=
323         MOZ_OPTIMIZE_FLAGS="-O2"
325         WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
326         WIN32_GUI_EXE_LDFLAGS=-mwindows
328         # Silence problematic clang warnings
329         CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
330         LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
331     else
332         TARGET_COMPILER_ABI=msvc
333         WIN32_SUBSYSTEM_VERSION=10.0
334         WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
335         WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
336         DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
337         _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
338         _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
339         CFLAGS="$CFLAGS -Gy -Zc:inline"
340         CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
341         if test "$TARGET_CPU" = "x86"; then
342             dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
343             dnl more recent, so set that explicitly here unless another
344             dnl target arch has already been set.
345             changequote(,)
346             if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
347               CFLAGS="$CFLAGS -arch:SSE2"
348             fi
349             if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
350               CXXFLAGS="$CXXFLAGS -arch:SSE2"
351             fi
352             changequote([,])
353         fi
354         dnl VS2013+ supports -Gw for better linker optimizations.
355         dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
356         dnl Disabled on ASan because it causes false-positive ODR violations.
357         if test -z "$MOZ_ASAN"; then
358             CFLAGS="$CFLAGS -Gw"
359             CXXFLAGS="$CXXFLAGS -Gw"
360         else
361             # String tail merging doesn't play nice with ASan's ODR checker.
362             LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
363         fi
364         # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
365         CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
366         MOZ_DEBUG_LDFLAGS='-DEBUG'
367         if test "$HOST_OS_ARCH" != "WINNT"; then
368           # %_PDB% is a special signal to emit only the PDB basename. This
369           # avoids problems in Windows tools that don't like forward-slashes.
370           MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -PDBALTPATH:%_PDB%"
371         fi
372         MOZ_OPTIMIZE_FLAGS='-O2'
373         MOZ_FIX_LINK_PATHS=
374         LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
375     fi
376     AC_DEFINE(WIN32_LEAN_AND_MEAN)
377     dnl See http://support.microsoft.com/kb/143208 to use STL
378     AC_DEFINE(NOMINMAX)
379     BIN_SUFFIX='.exe'
381     case "$host_os" in
382     cygwin*|msvc*|mks*)
383         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.])
384         ;;
385     esac
387     case "$target" in
388     i*86-*)
389         if test -n "$GNU_CC"; then
390             CFLAGS="$CFLAGS -mstackrealign"
391             CXXFLAGS="$CXXFLAGS -mstackrealign"
392             LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
393         else
394             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
395             LDFLAGS="$LDFLAGS -SAFESEH"
396         fi
398         AC_DEFINE(_X86_)
399         ;;
400     x86_64-*)
401         if test -n "$_WIN32_MSVC"; then
402             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
403         fi
404         AC_DEFINE(_AMD64_)
405         ;;
406     aarch64-*)
407         if test -n "$_WIN32_MSVC"; then
408             DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
409         fi
410         AC_DEFINE(_ARM64_)
411         ;;
412     *)
413         AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
414         ;;
415     esac
416     ;;
418 *-netbsd*)
419     CFLAGS="$CFLAGS -Dunix"
420     CXXFLAGS="$CXXFLAGS -Dunix"
421     if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
422         DSO_PIC_CFLAGS='-fPIC -DPIC'
423         DSO_LDOPTS='-shared'
424         MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
425     else
426         DSO_PIC_CFLAGS='-fPIC -DPIC'
427         DSO_LDOPTS='-shared'
428     fi
429     # This will fail on a.out systems prior to 1.5.1_ALPHA.
430     if test "$LIBRUNPATH"; then
431         DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
432     fi
433     ;;
435 *-openbsd*)
436     if test -z "$X11BASE"; then
437         X11BASE=/usr/X11R6
438     fi
439     MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
440     DSO_PIC_CFLAGS='-fPIC'
441     DSO_LDOPTS='-shared -fPIC'
442     if test "$LIBRUNPATH"; then
443         DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
444     fi
445     ;;
447 *-solaris*)
448     MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
449     ;;
451 esac
453 CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
454 CXXFLAGS="$CXXFLAGS $DSO_PIC_CFLAGS"
456 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
457     MOZ_OPTIMIZE_FLAGS="-O"
461 if test -z "$COMPILE_ENVIRONMENT"; then
462     SKIP_COMPILER_CHECKS=1
463     SKIP_LIBRARY_CHECKS=1
464     MOZ_DEBUGGING_OPTS
465 else
466     MOZ_COMPILER_OPTS
467 fi # COMPILE_ENVIRONMENT
469 if test -z "$SKIP_COMPILER_CHECKS"; then
470 dnl Checks for typedefs, structures, and compiler characteristics.
471 dnl ========================================================
472 AC_TYPE_MODE_T
473 AC_TYPE_OFF_T
474 AC_TYPE_PID_T
476 AC_LANG_CPLUSPLUS
478 MOZ_CXX11
480 AC_LANG_C
482 dnl Checks for header files.
483 dnl ========================================================
484 AC_HEADER_DIRENT
486 dnl Checks for libraries.
487 dnl ========================================================
488 AC_CHECK_LIB(c_r, gethostbyname_r)
490 dnl We don't want to link with libdl even if it's present on OS X, since
491 dnl it's not used and not part of the default installation. OS/2 has dlfcn
492 dnl in libc.
493 dnl We don't want to link against libm or libpthread on Darwin since
494 dnl they both are just symlinks to libSystem and explicitly linking
495 dnl against libSystem causes issues when debugging (see bug 299601).
496 case $target in
497 *-darwin*)
498     ;;
500     AC_SEARCH_LIBS(dlopen, dl,
501         MOZ_CHECK_HEADER(dlfcn.h,
502         AC_DEFINE(HAVE_DLOPEN)))
503     ;;
504 esac
506 _SAVE_CFLAGS="$CFLAGS"
507 CFLAGS="$CFLAGS -D_GNU_SOURCE"
508 AC_CHECK_FUNCS(dladdr)
509 CFLAGS="$_SAVE_CFLAGS"
511 if test ! "$GNU_CXX"; then
512     AC_CHECK_LIB(C, demangle)
515 AC_CHECK_LIB(socket, socket)
517 dnl ========================================================
518 dnl = pthread support
519 dnl = Start by checking whether the system support pthreads
520 dnl ========================================================
521 case "$target_os" in
522 darwin*)
523     MOZ_USE_PTHREADS=1
524     ;;
526     AC_CHECK_LIB(pthreads, pthread_create,
527         MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
528         AC_CHECK_LIB(pthread, pthread_create,
529             MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
530             AC_CHECK_LIB(c_r, pthread_create,
531                 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
532                 AC_CHECK_LIB(c, pthread_create,
533                     MOZ_USE_PTHREADS=1
534                 )
535             )
536         )
537     )
538     ;;
539 esac
541 dnl ========================================================
542 dnl Do the platform specific pthread hackery
543 dnl ========================================================
544 if test "$MOZ_USE_PTHREADS"x != x
545 then
546     dnl
547     dnl See if -pthread is supported.
548     dnl
549     rm -f conftest*
550     ac_cv_have_dash_pthread=no
551     AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
552     echo 'int main() { return 0; }' | cat > conftest.c
553     ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
554     if test $? -eq 0; then
555         if test -z "`grep -E -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`grep -E -i '(error|incorrect)' conftest.out`" ; then
556             ac_cv_have_dash_pthread=yes
557             case "$target_os" in
558             freebsd*)
559 # Freebsd doesn't use -pthread for compiles, it uses them for linking
560                 ;;
561             *)
562                 CFLAGS="$CFLAGS -pthread"
563                 CXXFLAGS="$CXXFLAGS -pthread"
564                 ;;
565             esac
566         fi
567     fi
568     rm -f conftest*
569     AC_MSG_RESULT($ac_cv_have_dash_pthread)
571     dnl
572     dnl See if -pthreads is supported.
573     dnl
574     ac_cv_have_dash_pthreads=no
575     if test "$ac_cv_have_dash_pthread" = "no"; then
576         AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
577         echo 'int main() { return 0; }' | cat > conftest.c
578         ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
579         if test $? -eq 0; then
580             if test -z "`grep -E -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`grep -E -i '(error|incorrect)' conftest.out`" ; then
581                 ac_cv_have_dash_pthreads=yes
582                 CFLAGS="$CFLAGS -pthreads"
583                 CXXFLAGS="$CXXFLAGS -pthreads"
584             fi
585         fi
586         rm -f conftest*
587         AC_MSG_RESULT($ac_cv_have_dash_pthreads)
588     fi
590     case "$target" in
591         *-*-freebsd*)
592             AC_DEFINE(_REENTRANT)
593             AC_DEFINE(_THREAD_SAFE)
594             dnl -pthread links in -lpthread, so don't specify it explicitly.
595             if test "$ac_cv_have_dash_pthread" = "yes"; then
596                 _PTHREAD_LDFLAGS="-pthread"
597             fi
598             ;;
600         *-*-openbsd*|*-*-bsdi*)
601             AC_DEFINE(_REENTRANT)
602             AC_DEFINE(_THREAD_SAFE)
603             dnl -pthread links in -lc_r, so don't specify it explicitly.
604             if test "$ac_cv_have_dash_pthread" = "yes"; then
605                 _PTHREAD_LDFLAGS="-pthread"
606             fi
607             ;;
609         *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
610             AC_DEFINE(_REENTRANT)
611             ;;
613     esac
614     LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
615     AC_SUBST(MOZ_USE_PTHREADS)
616     MOZ_CHECK_HEADERS(pthread.h)
620 dnl ========================================================
621 dnl Put your C++ language/feature checks below
622 dnl ========================================================
623 AC_LANG_CPLUSPLUS
625 ARM_ABI_PREFIX=
626 if test "$GNU_CC"; then
627   if test "$TARGET_CPU" = "arm" ; then
628     AC_CACHE_CHECK(for ARM EABI,
629         ac_cv_gcc_arm_eabi,
630         [AC_TRY_COMPILE([],
631                         [
632 #if defined(__ARM_EABI__)
633   return 0;
634 #else
635 #error Not ARM EABI.
636 #endif
637                         ],
638                         ac_cv_gcc_arm_eabi="yes",
639                         ac_cv_gcc_arm_eabi="no")])
640     if test "$ac_cv_gcc_arm_eabi" = "yes"; then
641         HAVE_ARM_EABI=1
642         ARM_ABI_PREFIX=eabi-
643     else
644         ARM_ABI_PREFIX=oabi-
645     fi
646   fi
648   TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
651 if test -n "$MOZ_LINKER"; then
652 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
653 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
654 dnl Since the linker only understands the sysv ones, no need to build the
655 dnl gnu style tables anyways.
656   LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
659 dnl End of C++ language/feature checks
660 AC_LANG_C
662 fi # ! SKIP_COMPILER_CHECKS
664 if test -n "${COMPILE_ENVIRONMENT}"; then
665   MOZ_CHECK_ALLOCATOR
668 TARGET_XPCOM_ABI=
669 if test -n "${TARGET_CPU}" -a -n "${TARGET_COMPILER_ABI}"; then
670     TARGET_XPCOM_ABI="${TARGET_CPU}-${TARGET_COMPILER_ABI}"
671     AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
674 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
675 dnl features that Windows actually does support.
677 if test -n "$SKIP_COMPILER_CHECKS"; then
678    dnl Windows has malloc.h
679    AC_DEFINE(MALLOC_H, [<malloc.h>])
680    AC_DEFINE(HAVE_FORCEINLINE)
681 fi # SKIP_COMPILER_CHECKS
683 dnl Mozilla specific options
684 dnl ========================================================
685 dnl The macros used for command line options
686 dnl are defined in build/autoconf/altoptions.m4.
688 dnl ========================================================
689 dnl =
690 dnl = Application
691 dnl =
692 dnl ========================================================
694 MOZ_BRANDING_DIRECTORY=
695 MOZ_OFFICIAL_BRANDING=
696 MOZ_NO_SMART_CARDS=
697 MOZ_BINARY_EXTENSIONS=
698 MOZ_DEVTOOLS=server
700 dnl ========================================================
701 dnl = Trademarked Branding
702 dnl ========================================================
703 MOZ_ARG_ENABLE_BOOL(official-branding,
704 [  --enable-official-branding
705                           Enable Official mozilla.org Branding
706                           Do not distribute builds with
707                           --enable-official-branding unless you have
708                           permission to use trademarks per
709                           http://www.mozilla.org/foundation/trademarks/ .],
710     MOZ_OFFICIAL_BRANDING=1,
711     MOZ_OFFICIAL_BRANDING=)
713 # Allow the application to influence configure with a confvars.sh script.
714 AC_MSG_CHECKING([if app-specific confvars.sh exists])
715 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
716   AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
717   . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
718 else
719   AC_MSG_RESULT([no])
722 AC_SUBST(MOZ_OFFICIAL_BRANDING)
723 if test -n "$MOZ_OFFICIAL_BRANDING"; then
724   if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
725     AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
726   else
727     MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
728     AC_DEFINE(MOZ_OFFICIAL_BRANDING)
729   fi
732 MOZ_ARG_WITH_STRING(branding,
733 [  --with-branding=dir     Use branding from the specified directory.],
734     MOZ_BRANDING_DIRECTORY=$withval)
736 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
737 if test -z "$REAL_BRANDING_DIRECTORY"; then
738   REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
741 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
742   . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
745 AC_SUBST(MOZ_BRANDING_DIRECTORY)
747 dnl ========================================================
748 dnl = Distribution ID
749 dnl ========================================================
750 MOZ_ARG_WITH_STRING(distribution-id,
751 [  --with-distribution-id=ID
752                           Set distribution-specific id (default=org.mozilla)],
753 [ val=`echo $withval`
754     MOZ_DISTRIBUTION_ID="$val"])
756 if test -z "$MOZ_DISTRIBUTION_ID"; then
757    MOZ_DISTRIBUTION_ID="org.mozilla"
760 AC_SUBST(MOZ_DISTRIBUTION_ID)
762 dnl ========================================================
763 dnl = Enable code optimization. ON by default.
764 dnl ========================================================
766 # Use value from moz.configure if one is defined. Else use our computed
767 # value.
768 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
769     MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
772 if test "$COMPILE_ENVIRONMENT"; then
773 if test -n "$MOZ_OPTIMIZE"; then
774     AC_MSG_CHECKING([for valid C compiler optimization flags])
775     _SAVE_CFLAGS=$CFLAGS
776     CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
777     AC_TRY_COMPILE([#include <stdio.h>],
778         [printf("Hello World\n");],
779         _results=yes,
780         _results=no)
781     AC_MSG_RESULT([$_results])
782     if test "$_results" = "no"; then
783         AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
784     fi
785     CFLAGS=$_SAVE_CFLAGS
786     if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
787         # When using llvm-based LTO, non numeric optimization levels are
788         # not supported by the linker, so force the linker to use -O2 (
789         # which doesn't influence the level compilation units are actually
790         # compiled at).
791         case " $MOZ_OPTIMIZE_FLAGS " in
792         *\ -Os\ *|*\ -Oz\ *)
793             MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
794             ;;
795         esac
796     fi
798 fi # COMPILE_ENVIRONMENT
800 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
801 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
802 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
804 case "${OS_TARGET}" in
805 Android|WINNT|Darwin)
806   MOZ_GLUE_IN_PROGRAM=
807   ;;
809   dnl On !Android !Windows !OSX, we only want to link executables against mozglue
810   MOZ_GLUE_IN_PROGRAM=1
811   AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
812   ;;
813 esac
815 dnl ========================================================
816 dnl = Jemalloc build setup
817 dnl ========================================================
818 if test -n "$MOZ_MEMORY"; then
819   case "${target}" in
820   *-mingw*)
821     export MOZ_NO_DEBUG_RTL=1
822     ;;
823   esac
824 fi # MOZ_MEMORY
825 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
827 dnl ========================================================
828 dnl = Enable using the clang plugin to build
829 dnl ========================================================
831 if test -n "$COMPILE_ENVIRONMENT"; then
832 MOZ_CONFIG_CLANG_PLUGIN
833 fi # COMPILE_ENVIRONMENT
835 AC_LANG_C
837 if test "$COMPILE_ENVIRONMENT"; then
838 MOZ_EXPAND_LIBS
839 fi # COMPILE_ENVIRONMENT
841 dnl ========================================================
842 dnl Check if we need the 32-bit Linux SSE2 error dialog
843 dnl ========================================================
845 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
847 dnl ========================================================
848 dnl Check for cairo
849 dnl ========================================================
851 if test "$OS_ARCH" = "WINNT"; then
852     # For now we assume that we will have a uint64_t available through
853     # one of the above headers or mozstdint.h.
854     AC_DEFINE(HAVE_UINT64_T)
857 case "$MOZ_WIDGET_TOOLKIT" in
858   windows)
859     if test "$COMPILE_ENVIRONMENT"; then
860       MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
861     fi
862     ;;
863 esac
864 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
866 dnl ========================================================
867 dnl =
868 dnl = Maintainer debug option (no --enable equivalent)
869 dnl =
870 dnl ========================================================
872 AC_SUBST_LIST(ASFLAGS)
873 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
875 AC_SUBST(MOZ_STUB_INSTALLER)
877 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
879 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
881 if test -n "$MOZ_BINARY_EXTENSIONS"; then
882   AC_DEFINE(MOZ_BINARY_EXTENSIONS)
885 dnl ========================================================
886 dnl = Mac bundle name prefix
887 dnl ========================================================
888 MOZ_ARG_WITH_STRING(macbundlename-prefix,
889 [  --with-macbundlename-prefix=prefix
890                           Prefix for MOZ_MACBUNDLE_NAME],
891 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
893 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
894 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
895   MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
898 if test "$MOZ_DEBUG"; then
899   MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
900 else
901   MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
903 AC_SUBST(MOZ_MACBUNDLE_NAME)
905 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
906 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
907 # Otherwise, use MOZ_APP_DISPLAYNAME
908 if test -z "$MOZ_MACBUNDLE_ID"; then
909    MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
911 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
912 if test "$MOZ_DEBUG"; then
913   MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
916 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
917 AC_SUBST(MOZ_MACBUNDLE_ID)
919 dnl ========================================================
920 dnl = Child Process Name for IPC
921 dnl ========================================================
922 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
923   MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
924 else
925   # We want to let Android unpack the file at install time, but it only does
926   # so if the file is named libsomething.so. The lib/ path is also required
927   # because the unpacked file will be under the lib/ subdirectory and will
928   # need to be executed from that path.
929   MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
931 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
932 MOZ_CHILD_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.plugincontainer
933 MOZ_CHILD_PROCESS_BUNDLENAME="plugin-container.app"
934 MOZ_CHILD_PROCESS_APPNAME="${MOZ_APP_DISPLAYNAME}CP"
936 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
937 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
938 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLEID)
939 AC_SUBST(MOZ_CHILD_PROCESS_APPNAME)
940 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
942 dnl ==========================================================
943 dnl = Mac Media Plugin Helper (GMP Child) Process Name for IPC
944 dnl ==========================================================
945 MOZ_EME_PROCESS_NAME="media-plugin-helper"
946 MOZ_EME_PROCESS_NAME_BRANDED="$MOZ_APP_DISPLAYNAME Media Plugin Helper"
947 MOZ_EME_PROCESS_BUNDLENAME="${MOZ_EME_PROCESS_NAME}.app"
948 # Generate a lower case string with no spaces to be used as the bundle ID
949 # for the EME helper .app of the form org.mozilla.<executable-name>.
950 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_APP_DISPLAYNAME" | tr ' ' '-'`
951 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_EME_PROCESS_BUNDLEID" | tr 'A-Z' 'a-z'`
952 MOZ_EME_PROCESS_BUNDLEID=${MOZ_EME_PROCESS_BUNDLEID}-${MOZ_EME_PROCESS_NAME}
953 MOZ_EME_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.${MOZ_EME_PROCESS_BUNDLEID}
955 AC_SUBST(MOZ_EME_PROCESS_NAME)
956 AC_SUBST(MOZ_EME_PROCESS_NAME_BRANDED)
957 AC_SUBST(MOZ_EME_PROCESS_BUNDLENAME)
958 AC_SUBST(MOZ_EME_PROCESS_BUNDLEID)
960 # The following variables are available to branding and application
961 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
962 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
963 # impacts profile location and user-visible fields.
964 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
965 # Mac Bundle name, Updater, Installer), it is typically used for nightly
966 # builds (e.g. Aurora for Firefox).
967 # - MOZ_APP_PROFILE: When set, used for application.ini's
968 # "Profile" field, which controls profile location.
969 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
970 # crash reporter server url.
971 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
973 # The following environment variables used to have an effect, but don't anymore:
974 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
975 # the contents from the version.txt file in the application directory, or
976 # browser/config/version.txt if there isn't one.
977 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
978 # in the "About" window. This was replaced with the contents from the
979 # version_display.txt or version.txt in the application directory, or
980 # browser/config/version_display.txt.
982 # For extensions and langpacks, we require a max version that is compatible
983 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
984 # 24.0a1 and 24.0a2 aren't affected
985 # 24.0 becomes 24.*
986 # 24.1.1 becomes 24.*
987 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
988 if test -z "$IS_ALPHA"; then
989   changequote(,)
990   if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
991     MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
992   else
993     MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
994   fi
995   changequote([,])
996 else
997   MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
1000 AC_SUBST(MOZ_APP_DISPLAYNAME)
1001 AC_SUBST(MOZ_APP_VENDOR)
1002 AC_SUBST(MOZ_APP_PROFILE)
1003 AC_SUBST(MOZ_APP_ID)
1004 AC_SUBST(MAR_CHANNEL_ID)
1005 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
1006 AC_SUBST(MOZ_PROFILE_MIGRATOR)
1007 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
1008 AC_SUBST(MOZ_APP_UA_NAME)
1009 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
1010 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
1011 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
1013 AC_SUBST(MOZ_APP_MAXVERSION)
1014 AC_SUBST(MOZ_PKG_SPECIAL)
1015 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
1017 if test "$MOZILLA_OFFICIAL"; then
1018     # Build revisions should always be present in official builds
1019     MOZ_INCLUDE_SOURCE_INFO=1
1022 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
1023 # explicitly set the repository and changeset information in.
1024 AC_SUBST(MOZ_SOURCE_REPO)
1025 AC_SUBST(MOZ_SOURCE_CHANGESET)
1026 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
1028 dnl Echo the CFLAGS to remove extra whitespace.
1029 CFLAGS=`echo \
1030     $_COMPILATION_CFLAGS \
1031     $CFLAGS`
1033 CXXFLAGS=`echo \
1034     $_COMPILATION_CXXFLAGS \
1035     $CXXFLAGS`
1037 ASFLAGS=`echo \
1038     $_COMPILATION_ASFLAGS \
1039     $ASFLAGS`
1041 COMPILE_CFLAGS=`echo \
1042     $_DEFINES_CFLAGS \
1043     $COMPILE_CFLAGS`
1045 COMPILE_CXXFLAGS=`echo \
1046     $_DEFINES_CXXFLAGS \
1047     $COMPILE_CXXFLAGS`
1049 HOST_CFLAGS=`echo \
1050     $_COMPILATION_HOST_CFLAGS \
1051     $HOST_CFLAGS`
1053 HOST_CXXFLAGS=`echo \
1054     $_COMPILATION_HOST_CXXFLAGS \
1055     $HOST_CXXFLAGS`
1057 LDFLAGS=`echo \
1058     $LDFLAGS \
1059     $_COMPILATION_LDFLAGS`
1061 HOST_LDFLAGS=`echo \
1062     $HOST_LDFLAGS \
1063     $_COMPILATION_HOST_LDFLAGS`
1065 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
1066 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1067 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
1068 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1069 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
1070   OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1071   OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1073 AC_SUBST(HOST_CMFLAGS)
1074 AC_SUBST(HOST_CMMFLAGS)
1075 AC_SUBST(OS_COMPILE_CMFLAGS)
1076 AC_SUBST(OS_COMPILE_CMMFLAGS)
1078 OS_CFLAGS="$CFLAGS"
1079 OS_CXXFLAGS="$CXXFLAGS"
1080 OS_CPPFLAGS="$CPPFLAGS"
1081 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
1082 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
1083 OS_LDFLAGS="$LDFLAGS"
1084 OS_LIBS="$LIBS"
1085 AC_SUBST_LIST(OS_CFLAGS)
1086 AC_SUBST_LIST(OS_CXXFLAGS)
1087 AC_SUBST_LIST(OS_CPPFLAGS)
1088 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
1089 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
1090 AC_SUBST_LIST(OS_LDFLAGS)
1091 AC_SUBST(OS_LIBS)
1093 AC_SUBST(HOST_CC)
1094 AC_SUBST(HOST_CXX)
1095 AC_SUBST_LIST(HOST_CFLAGS)
1096 AC_SUBST_LIST(HOST_CPPFLAGS)
1097 AC_SUBST_LIST(HOST_CXXFLAGS)
1098 AC_SUBST(HOST_LDFLAGS)
1099 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
1100 AC_SUBST(HOST_BIN_SUFFIX)
1102 AC_SUBST(TARGET_XPCOM_ABI)
1104 AC_SUBST(DSO_LDOPTS)
1105 AC_SUBST(BIN_SUFFIX)
1106 AC_SUBST(USE_N32)
1107 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
1108 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
1110 AC_SUBST(MOZ_DEVTOOLS)
1112 AC_SUBST(MOZ_PACKAGE_JSSHELL)
1114 AC_SUBST(DMG_TOOL)
1116 dnl Host JavaScript runtime, if any, to use during cross compiles.
1117 AC_SUBST(JS_BINARY)
1119 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
1121 dnl Set various defines and substitutions
1122 dnl ========================================================
1124 AC_SUBST(MOZ_DEV_EDITION)
1125 if test -n "$MOZ_DEV_EDITION"; then
1126     AC_DEFINE(MOZ_DEV_EDITION)
1129 dnl Spit out some output
1130 dnl ========================================================
1132 # Avoid using obsolete NSPR features
1133 AC_DEFINE(NO_NSPR_10_SUPPORT)
1135 MOZ_CREATE_CONFIG_STATUS()
1137 rm -fr confdefs* $ac_clean_files