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