1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2 dnl vi: set tabstop=4 shiftwidth=4 expandtab syntax=m4:
3 dnl This Source Code Form is subject to the terms of the Mozilla Public
4 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
5 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 dnl Process this file with autoconf to produce a configure script.
8 dnl ========================================================
10 AC_INIT(config/config.mk)
11 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
14 dnl ========================================================
16 dnl = Don't change the following lines. Doing so breaks:
18 dnl = CFLAGS="-foo" ./configure
20 dnl ========================================================
22 CPPFLAGS="${CPPFLAGS=}"
23 CXXFLAGS="${CXXFLAGS=}"
25 HOST_CFLAGS="${HOST_CFLAGS=}"
26 HOST_CXXFLAGS="${HOST_CXXFLAGS=}"
27 HOST_LDFLAGS="${HOST_LDFLAGS=}"
29 dnl Set the minimum version of toolkit libs used by mozilla
30 dnl ========================================================
33 dnl Set various checks
34 dnl ========================================================
37 dnl Initialize the Pthread test variables early so they can be
38 dnl overridden by each platform.
39 dnl ========================================================
43 LDFLAGS="$LDFLAGS $LINKER_LDFLAGS"
44 HOST_LDFLAGS="$HOST_LDFLAGS $HOST_LINKER_LDFLAGS"
46 if test "$COMPILE_ENVIRONMENT"; then
48 fi # COMPILE_ENVIRONMENT
50 dnl ========================================================
51 dnl Checks for compilers.
52 dnl ========================================================
54 if test "$COMPILE_ENVIRONMENT"; then
56 # Run some logic to figure out exe extensions (mostly for mingw's sake)
59 if test "$target" != "$host"; then
65 # Work around the conftest.exe access problem on Windows
69 AC_CHECK_PROGS(OTOOL, otool, :)
74 dnl ========================================================
75 dnl Special win32 checks
76 dnl ========================================================
82 if test "$GCC" != "yes"; then
83 # Check to see if we are really running in a msvc environemnt
86 # Make sure compilers are valid
87 CXXFLAGS="$CXXFLAGS -TP"
90 AC_TRY_COMPILE([#include <stdio.h>],
91 [ printf("Hello World\n"); ],,
92 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
95 AC_TRY_COMPILE([#include <new.h>],
96 [ unsigned *test = new unsigned(42); ],,
97 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
100 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
101 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
103 MSVC_C_RUNTIME_DLL=vcruntime140.dll
104 if test -n "$IS_VS2019_OR_MORE" -a "$CPU_ARCH" != "x86"; then
105 MSVC_C_RUNTIME_1_DLL=vcruntime140_1.dll
107 MSVC_CXX_RUNTIME_DLL=msvcp140.dll
109 # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
110 CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
112 if test -n "$WIN_UCRT_REDIST_DIR"; then
113 if test ! -d "$WIN_UCRT_REDIST_DIR"; then
114 AC_MSG_ERROR([Invalid Windows UCRT Redist directory: ${WIN_UCRT_REDIST_DIR}])
116 WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && (pwd -W 2>/dev/null || pwd)`
119 AC_SUBST(MSVC_C_RUNTIME_DLL)
120 AC_SUBST(MSVC_C_RUNTIME_1_DLL)
121 AC_SUBST(MSVC_CXX_RUNTIME_DLL)
123 AC_DEFINE(HAVE_SEH_EXCEPTIONS)
125 if test -n "$WIN32_REDIST_DIR"; then
126 if test ! -d "$WIN32_REDIST_DIR"; then
127 AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
129 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && (pwd -W 2>/dev/null || pwd)`
132 # Check w32api version
133 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
134 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
135 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
136 AC_TRY_COMPILE([#include <w32api.h>],
137 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
138 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
139 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
140 #error "test failed."
142 , [ res=yes ], [ res=no ])
143 AC_MSG_RESULT([$res])
144 if test "$res" != "yes"; then
145 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
147 # strsafe.h on mingw uses macros for function deprecation that pollutes namespace
148 # causing problems with local implementations with the same name.
149 AC_DEFINE(STRSAFE_NO_DEPRECATE)
152 AC_DEFINE(_USE_MATH_DEFINES) # Otherwise Windows' math.h doesn't #define M_PI.
154 CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
155 CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
157 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
158 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
159 # Require OS features provided by IE 8.0 (Win7)
160 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0800)
165 if test -n "$_WIN32_MSVC"; then
167 SKIP_COMPILER_CHECKS=1
168 SKIP_LIBRARY_CHECKS=1
170 # Since we're skipping compiler and library checks, hard-code
173 AC_DEFINE(HAVE_ISATTY)
176 fi # COMPILE_ENVIRONMENT
181 dnl ========================================================
182 dnl set the defaults first
183 dnl ========================================================
184 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
186 dnl Configure platform-specific CPU architecture compiler options.
187 dnl ==============================================================
188 if test "$COMPILE_ENVIRONMENT"; then
190 fi # COMPILE_ENVIRONMENT
192 if test -n "$COMPILE_ENVIRONMENT"; then
196 dnl ========================================================
197 dnl GNU specific defaults
198 dnl ========================================================
199 if test "$GNU_CC"; then
200 if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
201 DSO_PIC_CFLAGS='-fPIC'
202 ASFLAGS="$ASFLAGS -fPIC"
205 AC_MSG_CHECKING([for --noexecstack option to as])
207 CFLAGS="$CFLAGS -Wa,--noexecstack"
208 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
209 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
212 AC_MSG_CHECKING([for -z noexecstack option to ld])
213 _SAVE_LDFLAGS=$LDFLAGS
214 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
215 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
217 LDFLAGS=$_SAVE_LDFLAGS)
219 AC_MSG_CHECKING([for -z text option to ld])
220 _SAVE_LDFLAGS=$LDFLAGS
221 LDFLAGS="$LDFLAGS -Wl,-z,text"
222 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
224 LDFLAGS=$_SAVE_LDFLAGS)
226 AC_MSG_CHECKING([for -z relro option to ld])
227 _SAVE_LDFLAGS=$LDFLAGS
228 LDFLAGS="$LDFLAGS -Wl,-z,relro"
229 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
231 LDFLAGS=$_SAVE_LDFLAGS)
233 AC_MSG_CHECKING([for -z nocopyreloc option to ld])
234 _SAVE_LDFLAGS=$LDFLAGS
235 LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
236 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
238 LDFLAGS=$_SAVE_LDFLAGS)
240 AC_MSG_CHECKING([for -Bsymbolic-functions option to ld])
241 _SAVE_LDFLAGS=$LDFLAGS
242 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
243 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
245 LDFLAGS=$_SAVE_LDFLAGS)
247 # While sha1 is deterministic, it is slower.
248 if test -z "$DEVELOPER_OPTIONS"; then
253 AC_MSG_CHECKING([for --build-id=$build_id option to ld])
254 _SAVE_LDFLAGS=$LDFLAGS
255 LDFLAGS="$LDFLAGS -Wl,--build-id=$build_id"
256 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
258 LDFLAGS=$_SAVE_LDFLAGS)
260 AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
261 HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
262 _SAVE_LDFLAGS=$LDFLAGS
263 LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
264 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
265 [HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1],
267 LDFLAGS=$_SAVE_LDFLAGS
270 if test "$GCC_USE_GNU_LD"; then
271 # Some tools like ASan use a runtime library that is only
272 # linked against executables, so we must allow undefined
273 # symbols for shared objects in some cases.
274 if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
275 # Don't allow undefined symbols in libraries
276 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
278 # BSDs need `environ' exposed for posix_spawn (bug 753046)
280 DragonFly|FreeBSD|NetBSD|OpenBSD)
281 if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then
282 DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
284 DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
291 _DEFINES_CFLAGS="-include $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
293 ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
296 if test "$GNU_CXX"; then
297 CXXFLAGS="$CXXFLAGS -fno-exceptions"
299 _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
302 dnl ========================================================
303 dnl System overrides of the defaults for host
304 dnl ========================================================
307 if test -n "$_WIN32_MSVC"; then
308 HOST_CFLAGS="$HOST_CFLAGS"
310 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
312 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
313 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
316 case "${host_cpu}" in
318 if test -n "$_WIN32_MSVC"; then
319 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
323 if test -n "$_WIN32_MSVC"; then
324 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
326 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
332 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
333 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
336 *-linux*|*-kfreebsd*-gnu|*-gnu*)
337 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
338 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
342 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
343 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
347 dnl ========================================================
348 dnl System overrides of the defaults for target
349 dnl ========================================================
353 MOZ_OPTIMIZE_FLAGS="-O3"
356 dnl DTrace and -dead_strip don't interact well. See bug 403132.
357 dnl ===================================================================
358 if test "x$enable_dtrace" = "xyes"; then
359 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
361 dnl check for the presence of the -dead_strip linker flag
362 AC_MSG_CHECKING([for -dead_strip option to ld])
363 _SAVE_LDFLAGS=$LDFLAGS
364 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
365 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
366 if test -n "$_HAVE_DEAD_STRIP" ; then
368 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
373 LDFLAGS=$_SAVE_LDFLAGS
379 *-android*|*-linuxandroid*)
380 if test -z "$CLANG_CC"; then
381 MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions -Os"
383 # From https://github.com/android-ndk/ndk/issues/133#issuecomment-308549264
384 # -Oz is smaller than -Os on clang.
385 MOZ_OPTIMIZE_FLAGS="-Oz"
386 # Disable the outliner, which causes performance regressions, and is
387 # enabled on some platforms at -Oz.
388 if test -z "$MOZ_LTO"; then
389 DISABLE_OUTLINER="-mno-outline"
391 CFLAGS="$CFLAGS $DISABLE_OUTLINER"
392 AC_TRY_COMPILE(,,[MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS $DISABLE_OUTLINER"])
393 CFLAGS="$_SAVE_CFLAGS"
395 DISABLE_OUTLINER="-Wl,-plugin-opt=-enable-machine-outliner=never"
396 _SAVE_LDFLAGS=$LDFLAGS
397 LDFLAGS="$LDFLAGS $MOZ_LTO_LDFLAGS $DISABLE_OUTLINER"
398 AC_TRY_LINK(,,[MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS $DISABLE_OUTLINER"])
399 LDFLAGS="$_SAVE_LDFLAGS"
405 if test "$GNU_CC" -o "$GNU_CXX"; then
406 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
407 if test -n "$MOZ_DEBUG"; then
408 MOZ_OPTIMIZE_FLAGS="-Os"
410 MOZ_OPTIMIZE_FLAGS="-O2"
412 if test -z "$CLANG_CC"; then
413 MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
417 case "${target_cpu}" in
419 CFLAGS="$CFLAGS -mieee"
420 CXXFLAGS="$CXXFLAGS -mieee"
426 # certain versions of cygwin's makedepend barf on the
427 # #include <string> vs -I./dist/include/string issue so don't use it
428 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
429 # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
430 if test -z "$CLANG_CC"; then
431 AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
437 MOZ_OPTIMIZE_FLAGS="-O2"
439 WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
440 WIN32_GUI_EXE_LDFLAGS=-mwindows
442 # Silence problematic clang warnings
443 CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
444 LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
446 TARGET_COMPILER_ABI=msvc
447 # aarch64 doesn't support subsystems below 6.02
448 if test "$CPU_ARCH" = "aarch64"; then
449 WIN32_SUBSYSTEM_VERSION=6.02
451 WIN32_SUBSYSTEM_VERSION=6.01
453 WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
454 WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
455 DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
456 _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
457 _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
458 CFLAGS="$CFLAGS -Gy -Zc:inline"
459 CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
460 if test "$CPU_ARCH" = "x86"; then
461 dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
462 dnl more recent, so set that explicitly here unless another
463 dnl target arch has already been set.
465 if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
466 CFLAGS="$CFLAGS -arch:SSE2"
468 if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
469 CXXFLAGS="$CXXFLAGS -arch:SSE2"
473 dnl VS2013+ supports -Gw for better linker optimizations.
474 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
475 dnl Disabled on ASan because it causes false-positive ODR violations.
476 if test -z "$MOZ_ASAN"; then
478 CXXFLAGS="$CXXFLAGS -Gw"
480 # String tail merging doesn't play nice with ASan's ODR checker.
481 LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
483 # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
484 CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
485 MOZ_DEBUG_LDFLAGS='-DEBUG'
486 if test "$HOST_OS_ARCH" != "WINNT"; then
487 # %_PDB% is a special signal to emit only the PDB basename. This
488 # avoids problems in Windows tools that don't like forward-slashes.
489 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -PDBALTPATH:%_PDB%"
491 MOZ_OPTIMIZE_FLAGS='-O2'
493 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
495 AC_DEFINE(WIN32_LEAN_AND_MEAN)
496 dnl See http://support.microsoft.com/kb/143208 to use STL
502 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.])
508 if test -n "$GNU_CC"; then
509 CFLAGS="$CFLAGS -mstackrealign"
510 CXXFLAGS="$CXXFLAGS -mstackrealign"
511 LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
513 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
514 LDFLAGS="$LDFLAGS -SAFESEH"
520 if test -n "$_WIN32_MSVC"; then
521 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
526 if test -n "$_WIN32_MSVC"; then
527 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
532 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
538 CFLAGS="$CFLAGS -Dunix"
539 CXXFLAGS="$CXXFLAGS -Dunix"
540 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
541 DSO_PIC_CFLAGS='-fPIC -DPIC'
543 MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
545 DSO_PIC_CFLAGS='-fPIC -DPIC'
548 # This will fail on a.out systems prior to 1.5.1_ALPHA.
549 if test "$LIBRUNPATH"; then
550 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
555 if test -z "$X11BASE"; then
558 MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
559 DSO_PIC_CFLAGS='-fPIC'
560 DSO_LDOPTS='-shared -fPIC'
561 if test "$LIBRUNPATH"; then
562 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
567 MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
572 CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
573 CXXFLAGS="$CXXFLAGS $DSO_PIC_CFLAGS"
575 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
576 MOZ_OPTIMIZE_FLAGS="-O"
580 if test -z "$COMPILE_ENVIRONMENT"; then
581 SKIP_COMPILER_CHECKS=1
582 SKIP_LIBRARY_CHECKS=1
586 fi # COMPILE_ENVIRONMENT
588 if test -z "$SKIP_COMPILER_CHECKS"; then
589 dnl Checks for typedefs, structures, and compiler characteristics.
590 dnl ========================================================
605 dnl Checks for header files.
606 dnl ========================================================
609 dnl Checks for libraries.
610 dnl ========================================================
611 AC_CHECK_LIB(c_r, gethostbyname_r)
613 dnl We don't want to link with libdl even if it's present on OS X, since
614 dnl it's not used and not part of the default installation. OS/2 has dlfcn
616 dnl We don't want to link against libm or libpthread on Darwin since
617 dnl they both are just symlinks to libSystem and explicitly linking
618 dnl against libSystem causes issues when debugging (see bug 299601).
623 AC_SEARCH_LIBS(dlopen, dl,
624 MOZ_CHECK_HEADER(dlfcn.h,
625 AC_DEFINE(HAVE_DLOPEN)))
629 _SAVE_CFLAGS="$CFLAGS"
630 CFLAGS="$CFLAGS -D_GNU_SOURCE"
631 AC_CHECK_FUNCS(dladdr)
632 CFLAGS="$_SAVE_CFLAGS"
634 if test ! "$GNU_CXX"; then
635 AC_CHECK_LIB(C, demangle)
638 AC_CHECK_LIB(socket, socket)
640 dnl ========================================================
641 dnl = pthread support
642 dnl = Start by checking whether the system support pthreads
643 dnl ========================================================
649 AC_CHECK_LIB(pthreads, pthread_create,
650 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
651 AC_CHECK_LIB(pthread, pthread_create,
652 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
653 AC_CHECK_LIB(c_r, pthread_create,
654 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
655 AC_CHECK_LIB(c, pthread_create,
664 dnl ========================================================
665 dnl Do the platform specific pthread hackery
666 dnl ========================================================
667 if test "$MOZ_USE_PTHREADS"x != x
670 dnl See if -pthread is supported.
673 ac_cv_have_dash_pthread=no
674 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
675 echo 'int main() { return 0; }' | cat > conftest.c
676 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
677 if test $? -eq 0; then
678 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
679 ac_cv_have_dash_pthread=yes
682 # Freebsd doesn't use -pthread for compiles, it uses them for linking
685 CFLAGS="$CFLAGS -pthread"
686 CXXFLAGS="$CXXFLAGS -pthread"
692 AC_MSG_RESULT($ac_cv_have_dash_pthread)
695 dnl See if -pthreads is supported.
697 ac_cv_have_dash_pthreads=no
698 if test "$ac_cv_have_dash_pthread" = "no"; then
699 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
700 echo 'int main() { return 0; }' | cat > conftest.c
701 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
702 if test $? -eq 0; then
703 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
704 ac_cv_have_dash_pthreads=yes
705 CFLAGS="$CFLAGS -pthreads"
706 CXXFLAGS="$CXXFLAGS -pthreads"
710 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
715 AC_DEFINE(_REENTRANT)
716 AC_DEFINE(_THREAD_SAFE)
717 dnl -pthread links in -lpthread, so don't specify it explicitly.
718 if test "$ac_cv_have_dash_pthread" = "yes"; then
719 _PTHREAD_LDFLAGS="-pthread"
723 *-*-openbsd*|*-*-bsdi*)
724 AC_DEFINE(_REENTRANT)
725 AC_DEFINE(_THREAD_SAFE)
726 dnl -pthread links in -lc_r, so don't specify it explicitly.
727 if test "$ac_cv_have_dash_pthread" = "yes"; then
728 _PTHREAD_LDFLAGS="-pthread"
732 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
733 AC_DEFINE(_REENTRANT)
737 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
738 AC_SUBST(MOZ_USE_PTHREADS)
739 MOZ_CHECK_HEADERS(pthread.h)
743 dnl Checks for library functions.
744 dnl ========================================================
746 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
747 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
748 ac_cv_clock_monotonic,
749 [for libs in "" -lrt; do
752 dnl clock_gettime is available on OSX since 10.12, so depending on MACOSX_DEPLOYMENT_TARGET,
753 dnl we should or not be able to use it. To detect if we can, we need to make the
754 dnl availability attribute strict, so that compilation fails when the target is < 10.12.
755 AC_TRY_LINK([#define availability(os, ...) availability(os, strict, __VA_ARGS)
757 [ struct timespec ts;
758 clock_gettime(CLOCK_MONOTONIC, &ts); ],
759 ac_cv_clock_monotonic=$libs
762 ac_cv_clock_monotonic=no)
765 if test "$ac_cv_clock_monotonic" != "no"; then
766 HAVE_CLOCK_MONOTONIC=1
767 REALTIME_LIBS=$ac_cv_clock_monotonic
768 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
769 AC_SUBST(HAVE_CLOCK_MONOTONIC)
770 AC_SUBST_LIST(REALTIME_LIBS)
775 ac_cv_func_res_ninit,
776 [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
777 dnl no need for res_ninit() on NetBSD and OpenBSD
778 ac_cv_func_res_ninit=no
782 #define _BSD_SOURCE 1
784 #include <sys/types.h>
785 #include <netinet/in.h>
786 #include <arpa/nameser.h>
789 [int foo = res_ninit(&_res);],
790 [ac_cv_func_res_ninit=yes],
791 [ac_cv_func_res_ninit=no])
795 if test "$ac_cv_func_res_ninit" = "yes"; then
796 AC_DEFINE(HAVE_RES_NINIT)
797 dnl must add the link line we do something as foolish as this... dougt
799 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
800 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
805 dnl ===================================================================
806 dnl ========================================================
807 dnl Put your C++ language/feature checks below
808 dnl ========================================================
812 if test "$GNU_CC"; then
813 if test "$CPU_ARCH" = "arm" ; then
814 AC_CACHE_CHECK(for ARM EABI,
818 #if defined(__ARM_EABI__)
824 ac_cv_gcc_arm_eabi="yes",
825 ac_cv_gcc_arm_eabi="no")])
826 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
834 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
837 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
838 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
839 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
841 _SAVE_LDFLAGS=$LDFLAGS
842 LDFLAGS="$LDFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
843 AC_CACHE_CHECK(for __thread keyword for TLS variables,
844 ac_cv_thread_keyword,
845 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
846 [return tlsIsMainThread;],
847 ac_cv_thread_keyword=yes,
848 ac_cv_thread_keyword=no)])
849 LDFLAGS=$_SAVE_LDFLAGS
850 # The custom dynamic linker doesn't support TLS variables
851 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
852 # mips builds fail with TLS variables because of a binutils bug.
854 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
859 *-android*|*-linuxandroid*)
866 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
871 if test -n "$MOZ_LINKER"; then
872 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
873 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
874 dnl Since the linker only understands the sysv ones, no need to build the
875 dnl gnu style tables anyways.
876 LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
879 dnl End of C++ language/feature checks
882 fi # ! SKIP_COMPILER_CHECKS
884 if test -n "${COMPILE_ENVIRONMENT}"; then
889 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
890 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
891 AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
894 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
895 dnl features that Windows actually does support.
897 if test -n "$SKIP_COMPILER_CHECKS"; then
898 dnl Windows has malloc.h
899 AC_DEFINE(MALLOC_H, [<malloc.h>])
900 AC_DEFINE(HAVE_FORCEINLINE)
901 fi # SKIP_COMPILER_CHECKS
903 dnl Mozilla specific options
904 dnl ========================================================
905 dnl The macros used for command line options
906 dnl are defined in build/autoconf/altoptions.m4.
908 dnl ========================================================
912 dnl ========================================================
914 MOZ_BRANDING_DIRECTORY=
915 MOZ_OFFICIAL_BRANDING=
917 MOZ_BINARY_EXTENSIONS=
920 dnl ========================================================
921 dnl = Trademarked Branding
922 dnl ========================================================
923 MOZ_ARG_ENABLE_BOOL(official-branding,
924 [ --enable-official-branding
925 Enable Official mozilla.org Branding
926 Do not distribute builds with
927 --enable-official-branding unless you have
928 permission to use trademarks per
929 http://www.mozilla.org/foundation/trademarks/ .],
930 MOZ_OFFICIAL_BRANDING=1,
931 MOZ_OFFICIAL_BRANDING=)
933 # Allow the application to influence configure with a confvars.sh script.
934 AC_MSG_CHECKING([if app-specific confvars.sh exists])
935 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
936 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
937 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
942 AC_SUBST(MOZ_OFFICIAL_BRANDING)
943 if test -n "$MOZ_OFFICIAL_BRANDING"; then
944 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
945 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
947 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
948 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
952 MOZ_ARG_WITH_STRING(branding,
953 [ --with-branding=dir Use branding from the specified directory.],
954 MOZ_BRANDING_DIRECTORY=$withval)
956 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
957 if test -z "$REAL_BRANDING_DIRECTORY"; then
958 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
961 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
962 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
965 AC_SUBST(MOZ_BRANDING_DIRECTORY)
967 dnl ========================================================
968 dnl = Distribution ID
969 dnl ========================================================
970 MOZ_ARG_WITH_STRING(distribution-id,
971 [ --with-distribution-id=ID
972 Set distribution-specific id (default=org.mozilla)],
973 [ val=`echo $withval`
974 MOZ_DISTRIBUTION_ID="$val"])
976 if test -z "$MOZ_DISTRIBUTION_ID"; then
977 MOZ_DISTRIBUTION_ID="org.mozilla"
980 AC_SUBST(MOZ_DISTRIBUTION_ID)
982 dnl ========================================================
983 dnl = Enable code optimization. ON by default.
984 dnl ========================================================
986 # Use value from moz.configure if one is defined. Else use our computed
988 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
989 MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
992 if test "$COMPILE_ENVIRONMENT"; then
993 if test -n "$MOZ_OPTIMIZE"; then
994 AC_MSG_CHECKING([for valid C compiler optimization flags])
996 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
997 AC_TRY_COMPILE([#include <stdio.h>],
998 [printf("Hello World\n");],
1001 AC_MSG_RESULT([$_results])
1002 if test "$_results" = "no"; then
1003 AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
1005 CFLAGS=$_SAVE_CFLAGS
1006 if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
1007 # When using llvm-based LTO, non numeric optimization levels are
1008 # not supported by the linker, so force the linker to use -O2 (
1009 # which doesn't influence the level compilation units are actually
1011 case " $MOZ_OPTIMIZE_FLAGS " in
1012 *\ -Os\ *|*\ -Oz\ *)
1013 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
1018 fi # COMPILE_ENVIRONMENT
1020 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
1021 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
1022 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
1024 case "${OS_TARGET}" in
1025 Android|WINNT|Darwin)
1026 MOZ_GLUE_IN_PROGRAM=
1029 dnl On !Android !Windows !OSX, we only want to link executables against mozglue
1030 MOZ_GLUE_IN_PROGRAM=1
1031 AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
1035 dnl ========================================================
1036 dnl = Jemalloc build setup
1037 dnl ========================================================
1038 if test -z "$MOZ_MEMORY"; then
1041 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
1042 AC_MSG_WARN([When not building jemalloc, you need to set WIN32_REDIST_DIR to the path to the Visual C++ Redist (usually VCINSTALLDIR/redist/x86/Microsoft.VC80.CRT, for VC++ v8) if you intend to distribute your build.])
1047 dnl The generic feature tests that determine how to compute ncpus are long and
1048 dnl complicated. Therefore, simply define special cpp variables for the
1049 dnl platforms we have special knowledge of.
1052 export MOZ_NO_DEBUG_RTL=1
1056 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
1058 dnl ========================================================
1059 dnl = Enable using the clang plugin to build
1060 dnl ========================================================
1062 if test -n "$COMPILE_ENVIRONMENT"; then
1063 MOZ_CONFIG_CLANG_PLUGIN
1064 fi # COMPILE_ENVIRONMENT
1066 if test -z "$SKIP_COMPILER_CHECKS"; then
1067 dnl ========================================================
1068 dnl Check for gcc -pipe support
1069 dnl ========================================================
1070 AC_MSG_CHECKING([for -pipe support])
1071 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
1072 dnl Any gcc that supports firefox supports -pipe.
1073 CFLAGS="$CFLAGS -pipe"
1074 CXXFLAGS="$CXXFLAGS -pipe"
1075 AC_MSG_RESULT([yes])
1080 fi # ! SKIP_COMPILER_CHECKS
1084 if test "$COMPILE_ENVIRONMENT"; then
1086 fi # COMPILE_ENVIRONMENT
1088 dnl ========================================================
1089 dnl Check if we need the 32-bit Linux SSE2 error dialog
1090 dnl ========================================================
1092 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
1094 dnl ========================================================
1096 dnl ========================================================
1098 if test "$OS_ARCH" = "WINNT"; then
1099 # For now we assume that we will have a uint64_t available through
1100 # one of the above headers or mozstdint.h.
1101 AC_DEFINE(HAVE_UINT64_T)
1104 case "$MOZ_WIDGET_TOOLKIT" in
1106 if test "$COMPILE_ENVIRONMENT"; then
1107 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
1111 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
1113 dnl ========================================================
1115 dnl = Maintainer debug option (no --enable equivalent)
1117 dnl ========================================================
1119 AC_SUBST_LIST(ASFLAGS)
1120 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
1122 AC_SUBST(MOZ_STUB_INSTALLER)
1124 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
1126 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
1128 if test -n "$MOZ_BINARY_EXTENSIONS"; then
1129 AC_DEFINE(MOZ_BINARY_EXTENSIONS)
1132 dnl ========================================================
1133 dnl = Mac bundle name prefix
1134 dnl ========================================================
1135 MOZ_ARG_WITH_STRING(macbundlename-prefix,
1136 [ --with-macbundlename-prefix=prefix
1137 Prefix for MOZ_MACBUNDLE_NAME],
1138 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
1140 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
1141 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
1142 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
1145 if test "$MOZ_DEBUG"; then
1146 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
1148 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
1150 AC_SUBST(MOZ_MACBUNDLE_NAME)
1152 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
1153 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
1154 # Otherwise, use MOZ_APP_DISPLAYNAME
1155 if test -z "$MOZ_MACBUNDLE_ID"; then
1156 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
1158 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
1159 if test "$MOZ_DEBUG"; then
1160 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
1163 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
1164 AC_SUBST(MOZ_MACBUNDLE_ID)
1166 dnl ========================================================
1167 dnl = Child Process Name for IPC
1168 dnl ========================================================
1169 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
1170 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
1172 # We want to let Android unpack the file at install time, but it only does
1173 # so if the file is named libsomething.so. The lib/ path is also required
1174 # because the unpacked file will be under the lib/ subdirectory and will
1175 # need to be executed from that path.
1176 MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
1178 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
1179 MOZ_CHILD_PROCESS_BUNDLENAME="${MOZ_APP_DISPLAYNAME}CP"
1181 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
1182 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
1183 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
1185 # The following variables are available to branding and application
1186 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
1187 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
1188 # impacts profile location and user-visible fields.
1189 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
1190 # Mac Bundle name, Updater, Installer), it is typically used for nightly
1191 # builds (e.g. Aurora for Firefox).
1192 # - MOZ_APP_PROFILE: When set, used for application.ini's
1193 # "Profile" field, which controls profile location.
1194 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
1195 # crash reporter server url.
1196 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
1198 # The following environment variables used to have an effect, but don't anymore:
1199 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
1200 # the contents from the version.txt file in the application directory, or
1201 # browser/config/version.txt if there isn't one.
1202 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
1203 # in the "About" window. This was replaced with the contents from the
1204 # version_display.txt or version.txt in the application directory, or
1205 # browser/config/version_display.txt.
1207 # For extensions and langpacks, we require a max version that is compatible
1208 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
1209 # 24.0a1 and 24.0a2 aren't affected
1211 # 24.1.1 becomes 24.*
1212 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
1213 if test -z "$IS_ALPHA"; then
1215 if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
1216 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
1218 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
1222 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
1225 AC_SUBST(MOZ_APP_DISPLAYNAME)
1226 AC_SUBST(MOZ_APP_VENDOR)
1227 AC_SUBST(MOZ_APP_PROFILE)
1228 AC_SUBST(MOZ_APP_ID)
1229 AC_SUBST(MAR_CHANNEL_ID)
1230 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
1231 AC_SUBST(MOZ_PROFILE_MIGRATOR)
1232 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
1233 AC_SUBST(MOZ_APP_UA_NAME)
1234 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
1235 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
1236 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
1238 AC_SUBST(MOZ_APP_MAXVERSION)
1239 AC_SUBST(MOZ_PKG_SPECIAL)
1240 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
1242 if test "$MOZILLA_OFFICIAL"; then
1243 # Build revisions should always be present in official builds
1244 MOZ_INCLUDE_SOURCE_INFO=1
1247 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
1248 # explicitly set the repository and changeset information in.
1249 AC_SUBST(MOZ_SOURCE_REPO)
1250 AC_SUBST(MOZ_SOURCE_CHANGESET)
1251 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
1254 AC_SUBST(WIN32_REDIST_DIR)
1255 AC_SUBST(WIN_UCRT_REDIST_DIR)
1257 dnl Echo the CFLAGS to remove extra whitespace.
1259 $_COMPILATION_CFLAGS \
1263 $_COMPILATION_CXXFLAGS \
1266 COMPILE_CFLAGS=`echo \
1270 COMPILE_CXXFLAGS=`echo \
1271 $_DEFINES_CXXFLAGS \
1275 $_COMPILATION_HOST_CFLAGS \
1278 HOST_CXXFLAGS=`echo \
1279 $_COMPILATION_HOST_CXXFLAGS \
1282 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
1283 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1284 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
1285 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1286 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
1287 OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1288 OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1290 AC_SUBST(HOST_CMFLAGS)
1291 AC_SUBST(HOST_CMMFLAGS)
1292 AC_SUBST(OS_COMPILE_CMFLAGS)
1293 AC_SUBST(OS_COMPILE_CMMFLAGS)
1296 OS_CXXFLAGS="$CXXFLAGS"
1297 OS_CPPFLAGS="$CPPFLAGS"
1298 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
1299 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
1300 OS_LDFLAGS="$LDFLAGS"
1302 AC_SUBST_LIST(OS_CFLAGS)
1303 AC_SUBST_LIST(OS_CXXFLAGS)
1304 AC_SUBST_LIST(OS_CPPFLAGS)
1305 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
1306 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
1307 AC_SUBST_LIST(OS_LDFLAGS)
1312 AC_SUBST_LIST(HOST_CFLAGS)
1313 AC_SUBST_LIST(HOST_CPPFLAGS)
1314 AC_SUBST_LIST(HOST_CXXFLAGS)
1315 AC_SUBST(HOST_LDFLAGS)
1316 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
1317 AC_SUBST(HOST_BIN_SUFFIX)
1319 AC_SUBST(TARGET_XPCOM_ABI)
1321 AC_SUBST(DSO_LDOPTS)
1322 AC_SUBST(BIN_SUFFIX)
1324 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
1325 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
1327 AC_SUBST(MOZ_DEVTOOLS)
1329 AC_SUBST(MOZ_PACKAGE_JSSHELL)
1333 dnl Host JavaScript runtime, if any, to use during cross compiles.
1336 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
1338 dnl Set various defines and substitutions
1339 dnl ========================================================
1341 AC_SUBST(MOZ_DEV_EDITION)
1342 if test -n "$MOZ_DEV_EDITION"; then
1343 AC_DEFINE(MOZ_DEV_EDITION)
1346 dnl Windows AccessibilityHandler
1347 dnl ========================================================
1349 if test -z "$MOZ_HANDLER_CLSID"; then
1350 MOZ_HANDLER_CLSID="4a195748-dca2-45fb-9295-0a139e76a9e7"
1351 MOZ_IHANDLERCONTROL_IID="3316ce35-f892-4832-97c5-06c52c03cdba"
1352 MOZ_ASYNCIHANDLERCONTROL_IID="15b48b76-ad38-4ad3-bd1a-d3c48a5a9947"
1353 MOZ_IGECKOBACKCHANNEL_IID="dd2e4a89-999e-4d65-8b65-440c923ddb61"
1356 AC_SUBST(MOZ_HANDLER_CLSID)
1357 AC_SUBST(MOZ_IHANDLERCONTROL_IID)
1358 AC_SUBST(MOZ_ASYNCIHANDLERCONTROL_IID)
1359 AC_SUBST(MOZ_IGECKOBACKCHANNEL_IID)
1361 dnl Spit out some output
1362 dnl ========================================================
1364 # Avoid using obsolete NSPR features
1365 AC_DEFINE(NO_NSPR_10_SUPPORT)
1367 MOZ_CREATE_CONFIG_STATUS()
1369 rm -fr confdefs* $ac_clean_files