Bug 1890793: Assert CallArgs::newTarget is not gray. r=spidermonkey-reviewers,sfink...
[gecko.git] / old-configure.in
blob83464f931900ac64a40208a88aaea24d3c20401e
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_LANG_CPLUSPLUS
474 MOZ_CXX11
476 AC_LANG_C
478 dnl Checks for libraries.
479 dnl ========================================================
480 AC_CHECK_LIB(c_r, gethostbyname_r)
482 dnl We don't want to link with libdl even if it's present on OS X, since
483 dnl it's not used and not part of the default installation. OS/2 has dlfcn
484 dnl in libc.
485 dnl We don't want to link against libm or libpthread on Darwin since
486 dnl they both are just symlinks to libSystem and explicitly linking
487 dnl against libSystem causes issues when debugging (see bug 299601).
488 case $target in
489 *-darwin*)
490     ;;
492     AC_SEARCH_LIBS(dlopen, dl,
493         MOZ_CHECK_HEADER(dlfcn.h,
494         AC_DEFINE(HAVE_DLOPEN)))
495     ;;
496 esac
498 _SAVE_CFLAGS="$CFLAGS"
499 CFLAGS="$CFLAGS -D_GNU_SOURCE"
500 AC_CHECK_FUNCS(dladdr)
501 CFLAGS="$_SAVE_CFLAGS"
503 if test ! "$GNU_CXX"; then
504     AC_CHECK_LIB(C, demangle)
507 AC_CHECK_LIB(socket, socket)
509 dnl ========================================================
510 dnl = pthread support
511 dnl = Start by checking whether the system support pthreads
512 dnl ========================================================
513 case "$target_os" in
514 darwin*)
515     MOZ_USE_PTHREADS=1
516     ;;
518     AC_CHECK_LIB(pthreads, pthread_create,
519         MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
520         AC_CHECK_LIB(pthread, pthread_create,
521             MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
522             AC_CHECK_LIB(c_r, pthread_create,
523                 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
524                 AC_CHECK_LIB(c, pthread_create,
525                     MOZ_USE_PTHREADS=1
526                 )
527             )
528         )
529     )
530     ;;
531 esac
533 dnl ========================================================
534 dnl Do the platform specific pthread hackery
535 dnl ========================================================
536 if test "$MOZ_USE_PTHREADS"x != x
537 then
538     dnl
539     dnl See if -pthread is supported.
540     dnl
541     rm -f conftest*
542     ac_cv_have_dash_pthread=no
543     AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
544     echo 'int main() { return 0; }' | cat > conftest.c
545     ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
546     if test $? -eq 0; then
547         if test -z "`grep -E -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`grep -E -i '(error|incorrect)' conftest.out`" ; then
548             ac_cv_have_dash_pthread=yes
549             case "$target_os" in
550             freebsd*)
551 # Freebsd doesn't use -pthread for compiles, it uses them for linking
552                 ;;
553             *)
554                 CFLAGS="$CFLAGS -pthread"
555                 CXXFLAGS="$CXXFLAGS -pthread"
556                 ;;
557             esac
558         fi
559     fi
560     rm -f conftest*
561     AC_MSG_RESULT($ac_cv_have_dash_pthread)
563     dnl
564     dnl See if -pthreads is supported.
565     dnl
566     ac_cv_have_dash_pthreads=no
567     if test "$ac_cv_have_dash_pthread" = "no"; then
568         AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
569         echo 'int main() { return 0; }' | cat > conftest.c
570         ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
571         if test $? -eq 0; then
572             if test -z "`grep -E -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`grep -E -i '(error|incorrect)' conftest.out`" ; then
573                 ac_cv_have_dash_pthreads=yes
574                 CFLAGS="$CFLAGS -pthreads"
575                 CXXFLAGS="$CXXFLAGS -pthreads"
576             fi
577         fi
578         rm -f conftest*
579         AC_MSG_RESULT($ac_cv_have_dash_pthreads)
580     fi
582     case "$target" in
583         *-*-freebsd*)
584             AC_DEFINE(_REENTRANT)
585             AC_DEFINE(_THREAD_SAFE)
586             dnl -pthread links in -lpthread, so don't specify it explicitly.
587             if test "$ac_cv_have_dash_pthread" = "yes"; then
588                 _PTHREAD_LDFLAGS="-pthread"
589             fi
590             ;;
592         *-*-openbsd*|*-*-bsdi*)
593             AC_DEFINE(_REENTRANT)
594             AC_DEFINE(_THREAD_SAFE)
595             dnl -pthread links in -lc_r, so don't specify it explicitly.
596             if test "$ac_cv_have_dash_pthread" = "yes"; then
597                 _PTHREAD_LDFLAGS="-pthread"
598             fi
599             ;;
601         *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
602             AC_DEFINE(_REENTRANT)
603             ;;
605     esac
606     LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
607     AC_SUBST(MOZ_USE_PTHREADS)
608     MOZ_CHECK_HEADERS(pthread.h)
612 dnl ========================================================
613 dnl Put your C++ language/feature checks below
614 dnl ========================================================
615 AC_LANG_CPLUSPLUS
617 ARM_ABI_PREFIX=
618 if test "$GNU_CC"; then
619   if test "$TARGET_CPU" = "arm" ; then
620     AC_CACHE_CHECK(for ARM EABI,
621         ac_cv_gcc_arm_eabi,
622         [AC_TRY_COMPILE([],
623                         [
624 #if defined(__ARM_EABI__)
625   return 0;
626 #else
627 #error Not ARM EABI.
628 #endif
629                         ],
630                         ac_cv_gcc_arm_eabi="yes",
631                         ac_cv_gcc_arm_eabi="no")])
632     if test "$ac_cv_gcc_arm_eabi" = "yes"; then
633         HAVE_ARM_EABI=1
634         ARM_ABI_PREFIX=eabi-
635     else
636         ARM_ABI_PREFIX=oabi-
637     fi
638   fi
640   TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
643 if test -n "$MOZ_LINKER"; then
644 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
645 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
646 dnl Since the linker only understands the sysv ones, no need to build the
647 dnl gnu style tables anyways.
648   LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
651 dnl End of C++ language/feature checks
652 AC_LANG_C
654 fi # ! SKIP_COMPILER_CHECKS
656 if test -n "${COMPILE_ENVIRONMENT}"; then
657   MOZ_CHECK_ALLOCATOR
660 TARGET_XPCOM_ABI=
661 if test -n "${TARGET_CPU}" -a -n "${TARGET_COMPILER_ABI}"; then
662     TARGET_XPCOM_ABI="${TARGET_CPU}-${TARGET_COMPILER_ABI}"
663     AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
666 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
667 dnl features that Windows actually does support.
669 if test -n "$SKIP_COMPILER_CHECKS"; then
670    dnl Windows has malloc.h
671    AC_DEFINE(MALLOC_H, [<malloc.h>])
672    AC_DEFINE(HAVE_FORCEINLINE)
673 fi # SKIP_COMPILER_CHECKS
675 dnl Mozilla specific options
676 dnl ========================================================
677 dnl The macros used for command line options
678 dnl are defined in build/autoconf/altoptions.m4.
680 dnl ========================================================
681 dnl =
682 dnl = Application
683 dnl =
684 dnl ========================================================
686 MOZ_BRANDING_DIRECTORY=
687 MOZ_OFFICIAL_BRANDING=
688 MOZ_NO_SMART_CARDS=
689 MOZ_BINARY_EXTENSIONS=
690 MOZ_DEVTOOLS=server
692 dnl ========================================================
693 dnl = Trademarked Branding
694 dnl ========================================================
695 MOZ_ARG_ENABLE_BOOL(official-branding,
696 [  --enable-official-branding
697                           Enable Official mozilla.org Branding
698                           Do not distribute builds with
699                           --enable-official-branding unless you have
700                           permission to use trademarks per
701                           http://www.mozilla.org/foundation/trademarks/ .],
702     MOZ_OFFICIAL_BRANDING=1,
703     MOZ_OFFICIAL_BRANDING=)
705 # Allow the application to influence configure with a confvars.sh script.
706 AC_MSG_CHECKING([if app-specific confvars.sh exists])
707 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
708   AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
709   . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
710 else
711   AC_MSG_RESULT([no])
714 AC_SUBST(MOZ_OFFICIAL_BRANDING)
715 if test -n "$MOZ_OFFICIAL_BRANDING"; then
716   if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
717     AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
718   else
719     MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
720     AC_DEFINE(MOZ_OFFICIAL_BRANDING)
721   fi
724 MOZ_ARG_WITH_STRING(branding,
725 [  --with-branding=dir     Use branding from the specified directory.],
726     MOZ_BRANDING_DIRECTORY=$withval)
728 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
729 if test -z "$REAL_BRANDING_DIRECTORY"; then
730   REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
733 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
734   . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
737 AC_SUBST(MOZ_BRANDING_DIRECTORY)
739 dnl ========================================================
740 dnl = Distribution ID
741 dnl ========================================================
742 MOZ_ARG_WITH_STRING(distribution-id,
743 [  --with-distribution-id=ID
744                           Set distribution-specific id (default=org.mozilla)],
745 [ val=`echo $withval`
746     MOZ_DISTRIBUTION_ID="$val"])
748 if test -z "$MOZ_DISTRIBUTION_ID"; then
749    MOZ_DISTRIBUTION_ID="org.mozilla"
752 AC_SUBST(MOZ_DISTRIBUTION_ID)
754 dnl ========================================================
755 dnl = Enable code optimization. ON by default.
756 dnl ========================================================
758 # Use value from moz.configure if one is defined. Else use our computed
759 # value.
760 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
761     MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
764 if test "$COMPILE_ENVIRONMENT"; then
765 if test -n "$MOZ_OPTIMIZE"; then
766     AC_MSG_CHECKING([for valid C compiler optimization flags])
767     _SAVE_CFLAGS=$CFLAGS
768     CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
769     AC_TRY_COMPILE([#include <stdio.h>],
770         [printf("Hello World\n");],
771         _results=yes,
772         _results=no)
773     AC_MSG_RESULT([$_results])
774     if test "$_results" = "no"; then
775         AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
776     fi
777     CFLAGS=$_SAVE_CFLAGS
778     if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
779         # When using llvm-based LTO, non numeric optimization levels are
780         # not supported by the linker, so force the linker to use -O2 (
781         # which doesn't influence the level compilation units are actually
782         # compiled at).
783         case " $MOZ_OPTIMIZE_FLAGS " in
784         *\ -Os\ *|*\ -Oz\ *)
785             MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
786             ;;
787         esac
788     fi
790 fi # COMPILE_ENVIRONMENT
792 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
793 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
794 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
796 case "${OS_TARGET}" in
797 Android|WINNT|Darwin)
798   MOZ_GLUE_IN_PROGRAM=
799   ;;
801   dnl On !Android !Windows !OSX, we only want to link executables against mozglue
802   MOZ_GLUE_IN_PROGRAM=1
803   AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
804   ;;
805 esac
807 dnl ========================================================
808 dnl = Jemalloc build setup
809 dnl ========================================================
810 if test -n "$MOZ_MEMORY"; then
811   case "${target}" in
812   *-mingw*)
813     export MOZ_NO_DEBUG_RTL=1
814     ;;
815   esac
816 fi # MOZ_MEMORY
817 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
819 dnl ========================================================
820 dnl = Enable using the clang plugin to build
821 dnl ========================================================
823 if test -n "$COMPILE_ENVIRONMENT"; then
824 MOZ_CONFIG_CLANG_PLUGIN
825 fi # COMPILE_ENVIRONMENT
827 AC_LANG_C
829 if test "$COMPILE_ENVIRONMENT"; then
830 MOZ_EXPAND_LIBS
831 fi # COMPILE_ENVIRONMENT
833 dnl ========================================================
834 dnl Check if we need the 32-bit Linux SSE2 error dialog
835 dnl ========================================================
837 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
839 dnl ========================================================
840 dnl Check for cairo
841 dnl ========================================================
843 if test "$OS_ARCH" = "WINNT"; then
844     # For now we assume that we will have a uint64_t available through
845     # one of the above headers or mozstdint.h.
846     AC_DEFINE(HAVE_UINT64_T)
849 case "$MOZ_WIDGET_TOOLKIT" in
850   windows)
851     if test "$COMPILE_ENVIRONMENT"; then
852       MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
853     fi
854     ;;
855 esac
856 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
858 dnl ========================================================
859 dnl =
860 dnl = Maintainer debug option (no --enable equivalent)
861 dnl =
862 dnl ========================================================
864 AC_SUBST_LIST(ASFLAGS)
865 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
867 AC_SUBST(MOZ_STUB_INSTALLER)
869 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
871 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
873 if test -n "$MOZ_BINARY_EXTENSIONS"; then
874   AC_DEFINE(MOZ_BINARY_EXTENSIONS)
877 dnl ========================================================
878 dnl = Mac bundle name prefix
879 dnl ========================================================
880 MOZ_ARG_WITH_STRING(macbundlename-prefix,
881 [  --with-macbundlename-prefix=prefix
882                           Prefix for MOZ_MACBUNDLE_NAME],
883 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
885 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
886 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
887   MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
890 if test "$MOZ_DEBUG"; then
891   MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
892 else
893   MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
895 AC_SUBST(MOZ_MACBUNDLE_NAME)
897 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
898 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
899 # Otherwise, use MOZ_APP_DISPLAYNAME
900 if test -z "$MOZ_MACBUNDLE_ID"; then
901    MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
903 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
904 if test "$MOZ_DEBUG"; then
905   MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
908 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
909 AC_SUBST(MOZ_MACBUNDLE_ID)
911 dnl ========================================================
912 dnl = Child Process Name for IPC
913 dnl ========================================================
914 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
915   MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
916 else
917   # We want to let Android unpack the file at install time, but it only does
918   # so if the file is named libsomething.so. The lib/ path is also required
919   # because the unpacked file will be under the lib/ subdirectory and will
920   # need to be executed from that path.
921   MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
923 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
924 MOZ_CHILD_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.plugincontainer
925 MOZ_CHILD_PROCESS_BUNDLENAME="plugin-container.app"
926 MOZ_CHILD_PROCESS_APPNAME="${MOZ_APP_DISPLAYNAME}CP"
928 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
929 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
930 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLEID)
931 AC_SUBST(MOZ_CHILD_PROCESS_APPNAME)
932 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
934 dnl ==========================================================
935 dnl = Mac Media Plugin Helper (GMP Child) Process Name for IPC
936 dnl ==========================================================
937 MOZ_EME_PROCESS_NAME="media-plugin-helper"
938 MOZ_EME_PROCESS_NAME_BRANDED="$MOZ_APP_DISPLAYNAME Media Plugin Helper"
939 MOZ_EME_PROCESS_BUNDLENAME="${MOZ_EME_PROCESS_NAME}.app"
940 # Generate a lower case string with no spaces to be used as the bundle ID
941 # for the EME helper .app of the form org.mozilla.<executable-name>.
942 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_APP_DISPLAYNAME" | tr ' ' '-'`
943 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_EME_PROCESS_BUNDLEID" | tr 'A-Z' 'a-z'`
944 MOZ_EME_PROCESS_BUNDLEID=${MOZ_EME_PROCESS_BUNDLEID}-${MOZ_EME_PROCESS_NAME}
945 MOZ_EME_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.${MOZ_EME_PROCESS_BUNDLEID}
947 AC_SUBST(MOZ_EME_PROCESS_NAME)
948 AC_SUBST(MOZ_EME_PROCESS_NAME_BRANDED)
949 AC_SUBST(MOZ_EME_PROCESS_BUNDLENAME)
950 AC_SUBST(MOZ_EME_PROCESS_BUNDLEID)
952 # The following variables are available to branding and application
953 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
954 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
955 # impacts profile location and user-visible fields.
956 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
957 # Mac Bundle name, Updater, Installer), it is typically used for nightly
958 # builds (e.g. Aurora for Firefox).
959 # - MOZ_APP_PROFILE: When set, used for application.ini's
960 # "Profile" field, which controls profile location.
961 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
962 # crash reporter server url.
963 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
965 # The following environment variables used to have an effect, but don't anymore:
966 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
967 # the contents from the version.txt file in the application directory, or
968 # browser/config/version.txt if there isn't one.
969 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
970 # in the "About" window. This was replaced with the contents from the
971 # version_display.txt or version.txt in the application directory, or
972 # browser/config/version_display.txt.
974 # For extensions and langpacks, we require a max version that is compatible
975 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
976 # 24.0a1 and 24.0a2 aren't affected
977 # 24.0 becomes 24.*
978 # 24.1.1 becomes 24.*
979 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
980 if test -z "$IS_ALPHA"; then
981   changequote(,)
982   if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
983     MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
984   else
985     MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
986   fi
987   changequote([,])
988 else
989   MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
992 AC_SUBST(MOZ_APP_DISPLAYNAME)
993 AC_SUBST(MOZ_APP_VENDOR)
994 AC_SUBST(MOZ_APP_PROFILE)
995 AC_SUBST(MOZ_APP_ID)
996 AC_SUBST(MAR_CHANNEL_ID)
997 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
998 AC_SUBST(MOZ_PROFILE_MIGRATOR)
999 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
1000 AC_SUBST(MOZ_APP_UA_NAME)
1001 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
1002 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
1003 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
1005 AC_SUBST(MOZ_APP_MAXVERSION)
1006 AC_SUBST(MOZ_PKG_SPECIAL)
1007 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
1009 if test "$MOZILLA_OFFICIAL"; then
1010     # Build revisions should always be present in official builds
1011     MOZ_INCLUDE_SOURCE_INFO=1
1014 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
1015 # explicitly set the repository and changeset information in.
1016 AC_SUBST(MOZ_SOURCE_REPO)
1017 AC_SUBST(MOZ_SOURCE_CHANGESET)
1018 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
1020 dnl Echo the CFLAGS to remove extra whitespace.
1021 CFLAGS=`echo \
1022     $_COMPILATION_CFLAGS \
1023     $CFLAGS`
1025 CXXFLAGS=`echo \
1026     $_COMPILATION_CXXFLAGS \
1027     $CXXFLAGS`
1029 ASFLAGS=`echo \
1030     $_COMPILATION_ASFLAGS \
1031     $ASFLAGS`
1033 COMPILE_CFLAGS=`echo \
1034     $_DEFINES_CFLAGS \
1035     $COMPILE_CFLAGS`
1037 COMPILE_CXXFLAGS=`echo \
1038     $_DEFINES_CXXFLAGS \
1039     $COMPILE_CXXFLAGS`
1041 HOST_CFLAGS=`echo \
1042     $_COMPILATION_HOST_CFLAGS \
1043     $HOST_CFLAGS`
1045 HOST_CXXFLAGS=`echo \
1046     $_COMPILATION_HOST_CXXFLAGS \
1047     $HOST_CXXFLAGS`
1049 LDFLAGS=`echo \
1050     $LDFLAGS \
1051     $_COMPILATION_LDFLAGS`
1053 HOST_LDFLAGS=`echo \
1054     $HOST_LDFLAGS \
1055     $_COMPILATION_HOST_LDFLAGS`
1057 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
1058 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1059 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
1060 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1061 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
1062   OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1063   OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1065 AC_SUBST(HOST_CMFLAGS)
1066 AC_SUBST(HOST_CMMFLAGS)
1067 AC_SUBST(OS_COMPILE_CMFLAGS)
1068 AC_SUBST(OS_COMPILE_CMMFLAGS)
1070 OS_CFLAGS="$CFLAGS"
1071 OS_CXXFLAGS="$CXXFLAGS"
1072 OS_CPPFLAGS="$CPPFLAGS"
1073 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
1074 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
1075 OS_LDFLAGS="$LDFLAGS"
1076 OS_LIBS="$LIBS"
1077 AC_SUBST_LIST(OS_CFLAGS)
1078 AC_SUBST_LIST(OS_CXXFLAGS)
1079 AC_SUBST_LIST(OS_CPPFLAGS)
1080 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
1081 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
1082 AC_SUBST_LIST(OS_LDFLAGS)
1083 AC_SUBST(OS_LIBS)
1085 AC_SUBST(HOST_CC)
1086 AC_SUBST(HOST_CXX)
1087 AC_SUBST_LIST(HOST_CFLAGS)
1088 AC_SUBST_LIST(HOST_CPPFLAGS)
1089 AC_SUBST_LIST(HOST_CXXFLAGS)
1090 AC_SUBST(HOST_LDFLAGS)
1091 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
1092 AC_SUBST(HOST_BIN_SUFFIX)
1094 AC_SUBST(TARGET_XPCOM_ABI)
1096 AC_SUBST(DSO_LDOPTS)
1097 AC_SUBST(BIN_SUFFIX)
1098 AC_SUBST(USE_N32)
1099 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
1100 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
1102 AC_SUBST(MOZ_DEVTOOLS)
1104 AC_SUBST(MOZ_PACKAGE_JSSHELL)
1106 AC_SUBST(DMG_TOOL)
1108 dnl Host JavaScript runtime, if any, to use during cross compiles.
1109 AC_SUBST(JS_BINARY)
1111 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
1113 dnl Set various defines and substitutions
1114 dnl ========================================================
1116 AC_SUBST(MOZ_DEV_EDITION)
1117 if test -n "$MOZ_DEV_EDITION"; then
1118     AC_DEFINE(MOZ_DEV_EDITION)
1121 dnl Spit out some output
1122 dnl ========================================================
1124 # Avoid using obsolete NSPR features
1125 AC_DEFINE(NO_NSPR_10_SUPPORT)
1127 MOZ_CREATE_CONFIG_STATUS()
1129 rm -fr confdefs* $ac_clean_files