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)
102 AC_DEFINE(_USE_MATH_DEFINES) # Otherwise MSVC's math.h doesn't #define M_PI.
104 MSVC_C_RUNTIME_DLL=vcruntime140.dll
105 MSVC_CXX_RUNTIME_DLL=msvcp140.dll
107 # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
108 CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
110 if test -n "$WIN_UCRT_REDIST_DIR"; then
111 if test ! -d "$WIN_UCRT_REDIST_DIR"; then
112 AC_MSG_ERROR([Invalid Windows UCRT Redist directory: ${WIN_UCRT_REDIST_DIR}])
114 WIN_UCRT_REDIST_DIR=`cd "$WIN_UCRT_REDIST_DIR" && (pwd -W 2>/dev/null || pwd)`
117 AC_SUBST(MSVC_C_RUNTIME_DLL)
118 AC_SUBST(MSVC_CXX_RUNTIME_DLL)
120 AC_DEFINE(HAVE_SEH_EXCEPTIONS)
122 if test -n "$WIN32_REDIST_DIR"; then
123 if test ! -d "$WIN32_REDIST_DIR"; then
124 AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
126 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && (pwd -W 2>/dev/null || pwd)`
130 STL_FLAGS="-I${DIST}/stl_wrappers"
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 CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
153 CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
155 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
156 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
157 # Require OS features provided by IE 8.0 (Win7)
158 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0800)
163 if test -n "$_WIN32_MSVC"; then
165 SKIP_COMPILER_CHECKS=1
166 SKIP_LIBRARY_CHECKS=1
168 # Since we're skipping compiler and library checks, hard-code
171 AC_DEFINE(HAVE_ISATTY)
174 fi # COMPILE_ENVIRONMENT
179 AC_SUBST_LIST(STL_FLAGS)
180 AC_SUBST(WRAP_STL_INCLUDES)
182 dnl ========================================================
183 dnl set the defaults first
184 dnl ========================================================
185 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
187 dnl Configure platform-specific CPU architecture compiler options.
188 dnl ==============================================================
189 if test "$COMPILE_ENVIRONMENT"; then
191 fi # COMPILE_ENVIRONMENT
193 dnl ========================================================
194 dnl Android libstdc++
195 dnl ========================================================
197 if test "$COMPILE_ENVIRONMENT"; then
199 fi # COMPILE_ENVIRONMENT
201 if test -n "$COMPILE_ENVIRONMENT"; then
205 dnl ========================================================
206 dnl GNU specific defaults
207 dnl ========================================================
208 if test "$GNU_CC"; then
209 if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
210 DSO_PIC_CFLAGS='-fPIC'
211 ASFLAGS="$ASFLAGS -fPIC"
214 AC_MSG_CHECKING([for --noexecstack option to as])
216 CFLAGS="$CFLAGS -Wa,--noexecstack"
217 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
218 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
221 AC_MSG_CHECKING([for -z noexecstack option to ld])
222 _SAVE_LDFLAGS=$LDFLAGS
223 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
224 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
226 LDFLAGS=$_SAVE_LDFLAGS)
228 AC_MSG_CHECKING([for -z text option to ld])
229 _SAVE_LDFLAGS=$LDFLAGS
230 LDFLAGS="$LDFLAGS -Wl,-z,text"
231 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
233 LDFLAGS=$_SAVE_LDFLAGS)
235 AC_MSG_CHECKING([for -z relro option to ld])
236 _SAVE_LDFLAGS=$LDFLAGS
237 LDFLAGS="$LDFLAGS -Wl,-z,relro"
238 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
240 LDFLAGS=$_SAVE_LDFLAGS)
242 AC_MSG_CHECKING([for -z nocopyreloc option to ld])
243 _SAVE_LDFLAGS=$LDFLAGS
244 LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
245 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
247 LDFLAGS=$_SAVE_LDFLAGS)
249 AC_MSG_CHECKING([for -Bsymbolic-functions option to ld])
250 _SAVE_LDFLAGS=$LDFLAGS
251 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
252 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
254 LDFLAGS=$_SAVE_LDFLAGS)
256 if test -z "$DEVELOPER_OPTIONS" -o "$OS_TARGET" = "Android"; then
257 AC_MSG_CHECKING([for --build-id=sha1 option to ld])
258 _SAVE_LDFLAGS=$LDFLAGS
259 LDFLAGS="$LDFLAGS -Wl,--build-id=sha1"
260 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
262 LDFLAGS=$_SAVE_LDFLAGS)
265 AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
266 HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
267 _SAVE_LDFLAGS=$LDFLAGS
268 LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
269 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
270 [HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1],
272 LDFLAGS=$_SAVE_LDFLAGS
275 if test "$GCC_USE_GNU_LD"; then
276 # Some tools like ASan use a runtime library that is only
277 # linked against executables, so we must allow undefined
278 # symbols for shared objects in some cases.
279 if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
280 # Don't allow undefined symbols in libraries
281 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
283 # BSDs need `environ' exposed for posix_spawn (bug 753046)
285 DragonFly|FreeBSD|NetBSD|OpenBSD)
286 if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then
287 DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
289 DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
296 _DEFINES_CFLAGS="-include $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
298 ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
301 if test "$GNU_CXX"; then
302 CXXFLAGS="$CXXFLAGS -fno-exceptions"
304 _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
307 dnl ========================================================
308 dnl System overrides of the defaults for host
309 dnl ========================================================
312 if test -n "$_WIN32_MSVC"; then
313 HOST_CFLAGS="$HOST_CFLAGS"
315 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
317 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
318 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
321 case "${host_cpu}" in
323 if test -n "$_WIN32_MSVC"; then
324 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
328 if test -n "$_WIN32_MSVC"; then
329 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
331 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
337 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
338 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
341 *-linux*|*-kfreebsd*-gnu|*-gnu*)
342 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
343 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
347 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
348 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
352 dnl ========================================================
353 dnl System overrides of the defaults for target
354 dnl ========================================================
358 MOZ_OPTIMIZE_FLAGS="-O3"
361 dnl DTrace and -dead_strip don't interact well. See bug 403132.
362 dnl ===================================================================
363 if test "x$enable_dtrace" = "xyes"; then
364 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
366 dnl check for the presence of the -dead_strip linker flag
367 AC_MSG_CHECKING([for -dead_strip option to ld])
368 _SAVE_LDFLAGS=$LDFLAGS
369 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
370 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
371 if test -n "$_HAVE_DEAD_STRIP" ; then
373 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
378 LDFLAGS=$_SAVE_LDFLAGS
384 *-android*|*-linuxandroid*)
385 if test -z "$CLANG_CC"; then
386 MOZ_OPTIMIZE_FLAGS="-freorder-blocks -fno-reorder-functions -Os"
388 # From https://github.com/android-ndk/ndk/issues/133#issuecomment-308549264
389 # -Oz is smaller than -Os on clang.
390 MOZ_OPTIMIZE_FLAGS="-Oz"
391 # Disable the outliner, which causes performance regressions, and is
392 # enabled on some platforms at -Oz.
393 if test -z "$MOZ_LTO"; then
394 DISABLE_OUTLINER="-mno-outline"
396 CFLAGS="$CFLAGS $DISABLE_OUTLINER"
397 AC_TRY_COMPILE(,,[MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS $DISABLE_OUTLINER"])
398 CFLAGS="$_SAVE_CFLAGS"
400 DISABLE_OUTLINER="-Wl,-plugin-opt=-enable-machine-outliner=never"
401 _SAVE_LDFLAGS=$LDFLAGS
402 LDFLAGS="$LDFLAGS $MOZ_LTO_LDFLAGS $DISABLE_OUTLINER"
403 AC_TRY_LINK(,,[MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS $DISABLE_OUTLINER"])
404 LDFLAGS="$_SAVE_LDFLAGS"
410 if test "$GNU_CC" -o "$GNU_CXX"; then
411 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
412 if test -n "$MOZ_DEBUG"; then
413 MOZ_OPTIMIZE_FLAGS="-Os"
415 MOZ_OPTIMIZE_FLAGS="-O2"
417 if test -z "$CLANG_CC"; then
418 MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
422 case "${target_cpu}" in
424 CFLAGS="$CFLAGS -mieee"
425 CXXFLAGS="$CXXFLAGS -mieee"
431 # certain versions of cygwin's makedepend barf on the
432 # #include <string> vs -I./dist/include/string issue so don't use it
433 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
434 # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
435 if test -z "$CLANG_CC"; then
436 AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
442 MOZ_OPTIMIZE_FLAGS="-O2"
444 WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
445 WIN32_GUI_EXE_LDFLAGS=-mwindows
447 # Silence problematic clang warnings
448 CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
449 LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
451 TARGET_COMPILER_ABI=msvc
452 # aarch64 doesn't support subsystems below 6.02
453 if test "$CPU_ARCH" = "aarch64"; then
454 WIN32_SUBSYSTEM_VERSION=6.02
456 WIN32_SUBSYSTEM_VERSION=6.01
458 WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
459 WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
460 DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
461 _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
462 _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
463 CFLAGS="$CFLAGS -Gy -Zc:inline"
464 CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
465 if test "$CPU_ARCH" = "x86"; then
466 dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
467 dnl more recent, so set that explicitly here unless another
468 dnl target arch has already been set.
470 if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
471 CFLAGS="$CFLAGS -arch:SSE2"
473 if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
474 CXXFLAGS="$CXXFLAGS -arch:SSE2"
478 dnl VS2013+ supports -Gw for better linker optimizations.
479 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
480 dnl Disabled on ASan because it causes false-positive ODR violations.
481 if test -z "$MOZ_ASAN"; then
483 CXXFLAGS="$CXXFLAGS -Gw"
485 # String tail merging doesn't play nice with ASan's ODR checker.
486 LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
488 # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
489 CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
490 MOZ_DEBUG_LDFLAGS='-DEBUG'
491 if test "$HOST_OS_ARCH" != "WINNT"; then
492 # %_PDB% is a special signal to emit only the PDB basename. This
493 # avoids problems in Windows tools that don't like forward-slashes.
494 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -PDBALTPATH:%_PDB%"
496 MOZ_OPTIMIZE_FLAGS='-O2'
498 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
500 AC_DEFINE(WIN32_LEAN_AND_MEAN)
501 dnl See http://support.microsoft.com/kb/143208 to use STL
507 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.])
513 if test -n "$GNU_CC"; then
514 CFLAGS="$CFLAGS -mstackrealign"
515 CXXFLAGS="$CXXFLAGS -mstackrealign"
516 LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
518 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
519 LDFLAGS="$LDFLAGS -SAFESEH"
525 if test -n "$_WIN32_MSVC"; then
526 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
531 if test -n "$_WIN32_MSVC"; then
532 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
537 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
543 CFLAGS="$CFLAGS -Dunix"
544 CXXFLAGS="$CXXFLAGS -Dunix"
545 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
546 DSO_PIC_CFLAGS='-fPIC -DPIC'
548 MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
550 DSO_PIC_CFLAGS='-fPIC -DPIC'
553 # This will fail on a.out systems prior to 1.5.1_ALPHA.
554 if test "$LIBRUNPATH"; then
555 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
560 if test -z "$X11BASE"; then
563 MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
564 DSO_PIC_CFLAGS='-fPIC'
565 DSO_LDOPTS='-shared -fPIC'
566 if test "$LIBRUNPATH"; then
567 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
572 MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
577 CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
578 CXXFLAGS="$CXXFLAGS $DSO_PIC_CFLAGS"
580 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
581 MOZ_OPTIMIZE_FLAGS="-O"
585 if test -z "$COMPILE_ENVIRONMENT"; then
586 SKIP_COMPILER_CHECKS=1
587 SKIP_LIBRARY_CHECKS=1
591 fi # COMPILE_ENVIRONMENT
593 if test -z "$SKIP_COMPILER_CHECKS"; then
594 dnl Checks for typedefs, structures, and compiler characteristics.
595 dnl ========================================================
610 case "${OS_TARGET}" in
614 STL_FLAGS="-I${DIST}/stl_wrappers"
619 if test "$MOZ_BUILD_APP" = "tools/crashreporter/injector"; then
623 dnl Checks for header files.
624 dnl ========================================================
627 dnl Checks for libraries.
628 dnl ========================================================
629 AC_CHECK_LIB(c_r, gethostbyname_r)
631 dnl We don't want to link with libdl even if it's present on OS X, since
632 dnl it's not used and not part of the default installation. OS/2 has dlfcn
634 dnl We don't want to link against libm or libpthread on Darwin since
635 dnl they both are just symlinks to libSystem and explicitly linking
636 dnl against libSystem causes issues when debugging (see bug 299601).
641 AC_SEARCH_LIBS(dlopen, dl,
642 MOZ_CHECK_HEADER(dlfcn.h,
643 AC_DEFINE(HAVE_DLOPEN)))
647 _SAVE_CFLAGS="$CFLAGS"
648 CFLAGS="$CFLAGS -D_GNU_SOURCE"
649 AC_CHECK_FUNCS(dladdr)
650 CFLAGS="$_SAVE_CFLAGS"
652 if test ! "$GNU_CXX"; then
653 AC_CHECK_LIB(C, demangle)
656 AC_CHECK_LIB(socket, socket)
658 dnl ========================================================
659 dnl = pthread support
660 dnl = Start by checking whether the system support pthreads
661 dnl ========================================================
667 AC_CHECK_LIB(pthreads, pthread_create,
668 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
669 AC_CHECK_LIB(pthread, pthread_create,
670 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
671 AC_CHECK_LIB(c_r, pthread_create,
672 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
673 AC_CHECK_LIB(c, pthread_create,
682 dnl ========================================================
683 dnl Do the platform specific pthread hackery
684 dnl ========================================================
685 if test "$MOZ_USE_PTHREADS"x != x
688 dnl See if -pthread is supported.
691 ac_cv_have_dash_pthread=no
692 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
693 echo 'int main() { return 0; }' | cat > conftest.c
694 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
695 if test $? -eq 0; then
696 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
697 ac_cv_have_dash_pthread=yes
700 # Freebsd doesn't use -pthread for compiles, it uses them for linking
703 CFLAGS="$CFLAGS -pthread"
704 CXXFLAGS="$CXXFLAGS -pthread"
710 AC_MSG_RESULT($ac_cv_have_dash_pthread)
713 dnl See if -pthreads is supported.
715 ac_cv_have_dash_pthreads=no
716 if test "$ac_cv_have_dash_pthread" = "no"; then
717 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
718 echo 'int main() { return 0; }' | cat > conftest.c
719 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
720 if test $? -eq 0; then
721 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
722 ac_cv_have_dash_pthreads=yes
723 CFLAGS="$CFLAGS -pthreads"
724 CXXFLAGS="$CXXFLAGS -pthreads"
728 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
733 AC_DEFINE(_REENTRANT)
734 AC_DEFINE(_THREAD_SAFE)
735 dnl -pthread links in -lpthread, so don't specify it explicitly.
736 if test "$ac_cv_have_dash_pthread" = "yes"; then
737 _PTHREAD_LDFLAGS="-pthread"
741 *-*-openbsd*|*-*-bsdi*)
742 AC_DEFINE(_REENTRANT)
743 AC_DEFINE(_THREAD_SAFE)
744 dnl -pthread links in -lc_r, so don't specify it explicitly.
745 if test "$ac_cv_have_dash_pthread" = "yes"; then
746 _PTHREAD_LDFLAGS="-pthread"
750 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
751 AC_DEFINE(_REENTRANT)
755 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
756 AC_SUBST(MOZ_USE_PTHREADS)
757 MOZ_CHECK_HEADERS(pthread.h)
761 dnl Checks for library functions.
762 dnl ========================================================
764 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
765 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
766 ac_cv_clock_monotonic,
767 [for libs in "" -lrt; do
770 dnl clock_gettime is available on OSX since 10.12, so depending on MACOSX_DEPLOYMENT_TARGET,
771 dnl we should or not be able to use it. To detect if we can, we need to make the
772 dnl availability attribute strict, so that compilation fails when the target is < 10.12.
773 AC_TRY_LINK([#define availability(os, ...) availability(os, strict, __VA_ARGS)
775 [ struct timespec ts;
776 clock_gettime(CLOCK_MONOTONIC, &ts); ],
777 ac_cv_clock_monotonic=$libs
780 ac_cv_clock_monotonic=no)
783 if test "$ac_cv_clock_monotonic" != "no"; then
784 HAVE_CLOCK_MONOTONIC=1
785 REALTIME_LIBS=$ac_cv_clock_monotonic
786 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
787 AC_SUBST(HAVE_CLOCK_MONOTONIC)
788 AC_SUBST_LIST(REALTIME_LIBS)
793 ac_cv_func_res_ninit,
794 [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
795 dnl no need for res_ninit() on NetBSD and OpenBSD
796 ac_cv_func_res_ninit=no
800 #define _BSD_SOURCE 1
802 #include <sys/types.h>
803 #include <netinet/in.h>
804 #include <arpa/nameser.h>
807 [int foo = res_ninit(&_res);],
808 [ac_cv_func_res_ninit=yes],
809 [ac_cv_func_res_ninit=no])
813 if test "$ac_cv_func_res_ninit" = "yes"; then
814 AC_DEFINE(HAVE_RES_NINIT)
815 dnl must add the link line we do something as foolish as this... dougt
817 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
818 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
823 dnl ===================================================================
824 dnl ========================================================
825 dnl Put your C++ language/feature checks below
826 dnl ========================================================
830 if test "$GNU_CC"; then
831 if test "$CPU_ARCH" = "arm" ; then
832 AC_CACHE_CHECK(for ARM EABI,
836 #if defined(__ARM_EABI__)
842 ac_cv_gcc_arm_eabi="yes",
843 ac_cv_gcc_arm_eabi="no")])
844 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
852 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
855 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
856 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
857 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
859 _SAVE_LDFLAGS=$LDFLAGS
860 LDFLAGS="$LDFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
861 AC_CACHE_CHECK(for __thread keyword for TLS variables,
862 ac_cv_thread_keyword,
863 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
864 [return tlsIsMainThread;],
865 ac_cv_thread_keyword=yes,
866 ac_cv_thread_keyword=no)])
867 LDFLAGS=$_SAVE_LDFLAGS
868 # The custom dynamic linker doesn't support TLS variables
869 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
870 # mips builds fail with TLS variables because of a binutils bug.
872 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
877 *-android*|*-linuxandroid*)
884 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
889 if test -n "$MOZ_LINKER"; then
890 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
891 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
892 dnl Since the linker only understands the sysv ones, no need to build the
893 dnl gnu style tables anyways.
894 LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
897 dnl End of C++ language/feature checks
900 fi # ! SKIP_COMPILER_CHECKS
902 if test -n "${COMPILE_ENVIRONMENT}"; then
907 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
908 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
909 AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
912 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
913 dnl features that Windows actually does support.
915 if test -n "$SKIP_COMPILER_CHECKS"; then
916 dnl Windows has malloc.h
917 AC_DEFINE(MALLOC_H, [<malloc.h>])
918 AC_DEFINE(HAVE_FORCEINLINE)
919 fi # SKIP_COMPILER_CHECKS
921 dnl Mozilla specific options
922 dnl ========================================================
923 dnl The macros used for command line options
924 dnl are defined in build/autoconf/altoptions.m4.
926 dnl ========================================================
930 dnl ========================================================
932 MOZ_BRANDING_DIRECTORY=
933 MOZ_OFFICIAL_BRANDING=
935 MOZ_BINARY_EXTENSIONS=
938 dnl ========================================================
939 dnl = Trademarked Branding
940 dnl ========================================================
941 MOZ_ARG_ENABLE_BOOL(official-branding,
942 [ --enable-official-branding
943 Enable Official mozilla.org Branding
944 Do not distribute builds with
945 --enable-official-branding unless you have
946 permission to use trademarks per
947 http://www.mozilla.org/foundation/trademarks/ .],
948 MOZ_OFFICIAL_BRANDING=1,
949 MOZ_OFFICIAL_BRANDING=)
951 # Allow the application to influence configure with a confvars.sh script.
952 AC_MSG_CHECKING([if app-specific confvars.sh exists])
953 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
954 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
955 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
960 AC_SUBST(MOZ_OFFICIAL_BRANDING)
961 if test -n "$MOZ_OFFICIAL_BRANDING"; then
962 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
963 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
965 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
966 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
970 MOZ_ARG_WITH_STRING(branding,
971 [ --with-branding=dir Use branding from the specified directory.],
972 MOZ_BRANDING_DIRECTORY=$withval)
974 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
975 if test -z "$REAL_BRANDING_DIRECTORY"; then
976 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
979 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
980 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
983 AC_SUBST(MOZ_BRANDING_DIRECTORY)
985 dnl ========================================================
986 dnl = Distribution ID
987 dnl ========================================================
988 MOZ_ARG_WITH_STRING(distribution-id,
989 [ --with-distribution-id=ID
990 Set distribution-specific id (default=org.mozilla)],
991 [ val=`echo $withval`
992 MOZ_DISTRIBUTION_ID="$val"])
994 if test -z "$MOZ_DISTRIBUTION_ID"; then
995 MOZ_DISTRIBUTION_ID="org.mozilla"
998 AC_SUBST(MOZ_DISTRIBUTION_ID)
1000 dnl ========================================================
1001 dnl = Enable code optimization. ON by default.
1002 dnl ========================================================
1004 # Use value from moz.configure if one is defined. Else use our computed
1006 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
1007 MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
1010 if test "$COMPILE_ENVIRONMENT"; then
1011 if test -n "$MOZ_OPTIMIZE"; then
1012 AC_MSG_CHECKING([for valid C compiler optimization flags])
1013 _SAVE_CFLAGS=$CFLAGS
1014 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
1015 AC_TRY_COMPILE([#include <stdio.h>],
1016 [printf("Hello World\n");],
1019 AC_MSG_RESULT([$_results])
1020 if test "$_results" = "no"; then
1021 AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
1023 CFLAGS=$_SAVE_CFLAGS
1024 if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
1025 # When using llvm-based LTO, non numeric optimization levels are
1026 # not supported by the linker, so force the linker to use -O2 (
1027 # which doesn't influence the level compilation units are actually
1029 case " $MOZ_OPTIMIZE_FLAGS " in
1030 *\ -Os\ *|*\ -Oz\ *)
1031 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
1036 fi # COMPILE_ENVIRONMENT
1038 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
1039 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
1040 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
1042 case "${OS_TARGET}" in
1043 Android|WINNT|Darwin)
1044 MOZ_GLUE_IN_PROGRAM=
1047 dnl On !Android !Windows !OSX, we only want to link executables against mozglue
1048 MOZ_GLUE_IN_PROGRAM=1
1049 AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
1053 dnl ========================================================
1054 dnl = Jemalloc build setup
1055 dnl ========================================================
1056 if test -z "$MOZ_MEMORY"; then
1059 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
1060 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.])
1065 dnl The generic feature tests that determine how to compute ncpus are long and
1066 dnl complicated. Therefore, simply define special cpp variables for the
1067 dnl platforms we have special knowledge of.
1070 export MOZ_NO_DEBUG_RTL=1
1074 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
1076 dnl ========================================================
1077 dnl = Enable using the clang plugin to build
1078 dnl ========================================================
1080 if test -n "$COMPILE_ENVIRONMENT"; then
1081 MOZ_CONFIG_CLANG_PLUGIN
1082 fi # COMPILE_ENVIRONMENT
1084 if test -z "$SKIP_COMPILER_CHECKS"; then
1085 dnl ========================================================
1086 dnl Check for gcc -pipe support
1087 dnl ========================================================
1088 AC_MSG_CHECKING([for -pipe support])
1089 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
1090 dnl Any gcc that supports firefox supports -pipe.
1091 CFLAGS="$CFLAGS -pipe"
1092 CXXFLAGS="$CXXFLAGS -pipe"
1093 AC_MSG_RESULT([yes])
1098 fi # ! SKIP_COMPILER_CHECKS
1102 if test "$COMPILE_ENVIRONMENT"; then
1104 fi # COMPILE_ENVIRONMENT
1106 dnl ========================================================
1107 dnl Check if we need the 32-bit Linux SSE2 error dialog
1108 dnl ========================================================
1110 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
1112 dnl ========================================================
1114 dnl ========================================================
1116 if test "$OS_ARCH" = "WINNT"; then
1117 # For now we assume that we will have a uint64_t available through
1118 # one of the above headers or mozstdint.h.
1119 AC_DEFINE(HAVE_UINT64_T)
1122 case "$MOZ_WIDGET_TOOLKIT" in
1124 if test "$COMPILE_ENVIRONMENT"; then
1125 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
1129 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
1131 dnl ========================================================
1133 dnl = Maintainer debug option (no --enable equivalent)
1135 dnl ========================================================
1137 AC_SUBST_LIST(ASFLAGS)
1138 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
1140 AC_SUBST(MOZ_STUB_INSTALLER)
1142 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
1144 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
1146 if test -n "$MOZ_BINARY_EXTENSIONS"; then
1147 AC_DEFINE(MOZ_BINARY_EXTENSIONS)
1150 dnl ========================================================
1151 dnl = Mac bundle name prefix
1152 dnl ========================================================
1153 MOZ_ARG_WITH_STRING(macbundlename-prefix,
1154 [ --with-macbundlename-prefix=prefix
1155 Prefix for MOZ_MACBUNDLE_NAME],
1156 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
1158 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
1159 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
1160 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
1163 if test "$MOZ_DEBUG"; then
1164 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
1166 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
1168 AC_SUBST(MOZ_MACBUNDLE_NAME)
1170 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
1171 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
1172 # Otherwise, use MOZ_APP_DISPLAYNAME
1173 if test -z "$MOZ_MACBUNDLE_ID"; then
1174 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
1176 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
1177 if test "$MOZ_DEBUG"; then
1178 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
1181 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
1182 AC_SUBST(MOZ_MACBUNDLE_ID)
1184 dnl ========================================================
1185 dnl = Child Process Name for IPC
1186 dnl ========================================================
1187 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
1188 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
1190 # We want to let Android unpack the file at install time, but it only does
1191 # so if the file is named libsomething.so. The lib/ path is also required
1192 # because the unpacked file will be under the lib/ subdirectory and will
1193 # need to be executed from that path.
1194 MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
1196 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
1197 MOZ_CHILD_PROCESS_BUNDLENAME="${MOZ_APP_DISPLAYNAME}CP"
1199 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
1200 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
1201 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
1203 # The following variables are available to branding and application
1204 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
1205 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
1206 # impacts profile location and user-visible fields.
1207 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
1208 # Mac Bundle name, Updater, Installer), it is typically used for nightly
1209 # builds (e.g. Aurora for Firefox).
1210 # - MOZ_APP_PROFILE: When set, used for application.ini's
1211 # "Profile" field, which controls profile location.
1212 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
1213 # crash reporter server url.
1214 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
1216 # The following environment variables used to have an effect, but don't anymore:
1217 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
1218 # the contents from the version.txt file in the application directory, or
1219 # browser/config/version.txt if there isn't one.
1220 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
1221 # in the "About" window. This was replaced with the contents from the
1222 # version_display.txt or version.txt in the application directory, or
1223 # browser/config/version_display.txt.
1225 # For extensions and langpacks, we require a max version that is compatible
1226 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
1227 # 24.0a1 and 24.0a2 aren't affected
1229 # 24.1.1 becomes 24.*
1230 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
1231 if test -z "$IS_ALPHA"; then
1233 if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
1234 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
1236 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
1240 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
1243 AC_SUBST(MOZ_APP_DISPLAYNAME)
1244 AC_SUBST(MOZ_APP_VENDOR)
1245 AC_SUBST(MOZ_APP_PROFILE)
1246 AC_SUBST(MOZ_APP_ID)
1247 AC_SUBST(MAR_CHANNEL_ID)
1248 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
1249 AC_SUBST(MOZ_PROFILE_MIGRATOR)
1250 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
1251 AC_SUBST(MOZ_APP_UA_NAME)
1252 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
1253 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
1254 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
1256 AC_SUBST(MOZ_APP_MAXVERSION)
1257 AC_SUBST(MOZ_PKG_SPECIAL)
1258 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
1260 if test "$MOZILLA_OFFICIAL"; then
1261 # Build revisions should always be present in official builds
1262 MOZ_INCLUDE_SOURCE_INFO=1
1265 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
1266 # explicitly set the repository and changeset information in.
1267 AC_SUBST(MOZ_SOURCE_REPO)
1268 AC_SUBST(MOZ_SOURCE_CHANGESET)
1269 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
1272 AC_SUBST(WIN32_REDIST_DIR)
1273 AC_SUBST(WIN_UCRT_REDIST_DIR)
1275 dnl Echo the CFLAGS to remove extra whitespace.
1277 $_COMPILATION_CFLAGS \
1281 $_COMPILATION_CXXFLAGS \
1284 COMPILE_CFLAGS=`echo \
1288 COMPILE_CXXFLAGS=`echo \
1289 $_DEFINES_CXXFLAGS \
1293 $_COMPILATION_HOST_CFLAGS \
1296 HOST_CXXFLAGS=`echo \
1297 $_COMPILATION_HOST_CXXFLAGS \
1300 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
1301 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1302 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
1303 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1304 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
1305 OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1306 OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1308 AC_SUBST(HOST_CMFLAGS)
1309 AC_SUBST(HOST_CMMFLAGS)
1310 AC_SUBST(OS_COMPILE_CMFLAGS)
1311 AC_SUBST(OS_COMPILE_CMMFLAGS)
1314 OS_CXXFLAGS="$CXXFLAGS"
1315 OS_CPPFLAGS="$CPPFLAGS"
1316 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
1317 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
1318 OS_LDFLAGS="$LDFLAGS"
1320 AC_SUBST_LIST(OS_CFLAGS)
1321 AC_SUBST_LIST(OS_CXXFLAGS)
1322 AC_SUBST_LIST(OS_CPPFLAGS)
1323 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
1324 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
1325 AC_SUBST_LIST(OS_LDFLAGS)
1330 AC_SUBST_LIST(HOST_CFLAGS)
1331 AC_SUBST_LIST(HOST_CPPFLAGS)
1332 AC_SUBST_LIST(HOST_CXXFLAGS)
1333 AC_SUBST(HOST_LDFLAGS)
1334 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
1335 AC_SUBST(HOST_BIN_SUFFIX)
1337 AC_SUBST(TARGET_XPCOM_ABI)
1339 AC_SUBST(DSO_LDOPTS)
1340 AC_SUBST(BIN_SUFFIX)
1342 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
1343 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
1345 AC_SUBST(MOZ_DEVTOOLS)
1347 AC_SUBST(MOZ_PACKAGE_JSSHELL)
1351 dnl Host JavaScript runtime, if any, to use during cross compiles.
1354 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
1356 dnl Set various defines and substitutions
1357 dnl ========================================================
1359 AC_SUBST(MOZ_DEV_EDITION)
1360 if test -n "$MOZ_DEV_EDITION"; then
1361 AC_DEFINE(MOZ_DEV_EDITION)
1364 dnl Windows AccessibilityHandler
1365 dnl ========================================================
1367 if test -z "$MOZ_HANDLER_CLSID"; then
1368 MOZ_HANDLER_CLSID="4a195748-dca2-45fb-9295-0a139e76a9e7"
1369 MOZ_IHANDLERCONTROL_IID="3316ce35-f892-4832-97c5-06c52c03cdba"
1370 MOZ_ASYNCIHANDLERCONTROL_IID="15b48b76-ad38-4ad3-bd1a-d3c48a5a9947"
1371 MOZ_IGECKOBACKCHANNEL_IID="dd2e4a89-999e-4d65-8b65-440c923ddb61"
1374 AC_SUBST(MOZ_HANDLER_CLSID)
1375 AC_SUBST(MOZ_IHANDLERCONTROL_IID)
1376 AC_SUBST(MOZ_ASYNCIHANDLERCONTROL_IID)
1377 AC_SUBST(MOZ_IGECKOBACKCHANNEL_IID)
1379 dnl Spit out some output
1380 dnl ========================================================
1382 # Avoid using obsolete NSPR features
1383 AC_DEFINE(NO_NSPR_10_SUPPORT)
1385 MOZ_CREATE_CONFIG_STATUS()
1387 rm -fr confdefs* $ac_clean_files