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 $PACK_REL_RELOC_FLAGS"
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
73 dnl ========================================================
74 dnl Special win32 checks
75 dnl ========================================================
81 if test "$GCC" != "yes"; then
82 # Check to see if we are really running in a msvc environemnt
85 # Make sure compilers are valid
86 CXXFLAGS="$CXXFLAGS -TP"
89 AC_TRY_COMPILE([#include <stdio.h>],
90 [ printf("Hello World\n"); ],,
91 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
94 AC_TRY_COMPILE([#include <new.h>],
95 [ unsigned *test = new unsigned(42); ],,
96 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
99 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
100 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
102 MSVC_C_RUNTIME_DLL=vcruntime140.dll
103 if test -n "$IS_VS2019_OR_MORE" -a "$CPU_ARCH" != "x86"; then
104 MSVC_C_RUNTIME_1_DLL=vcruntime140_1.dll
106 MSVC_CXX_RUNTIME_DLL=msvcp140.dll
108 # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
109 CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
111 AC_SUBST(MSVC_C_RUNTIME_DLL)
112 AC_SUBST(MSVC_C_RUNTIME_1_DLL)
113 AC_SUBST(MSVC_CXX_RUNTIME_DLL)
115 AC_DEFINE(HAVE_SEH_EXCEPTIONS)
117 if test -n "$WIN32_REDIST_DIR"; then
118 if test ! -d "$WIN32_REDIST_DIR"; then
119 AC_MSG_ERROR([Invalid Win32 Redist directory: ${WIN32_REDIST_DIR}])
121 WIN32_REDIST_DIR=`cd "$WIN32_REDIST_DIR" && (pwd -W 2>/dev/null || pwd)`
124 # Check w32api version
125 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
126 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
127 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
128 AC_TRY_COMPILE([#include <w32api.h>],
129 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
130 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
131 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
132 #error "test failed."
134 , [ res=yes ], [ res=no ])
135 AC_MSG_RESULT([$res])
136 if test "$res" != "yes"; then
137 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
139 # strsafe.h on mingw uses macros for function deprecation that pollutes namespace
140 # causing problems with local implementations with the same name.
141 AC_DEFINE(STRSAFE_NO_DEPRECATE)
144 AC_DEFINE(_USE_MATH_DEFINES) # Otherwise Windows' math.h doesn't #define M_PI.
146 CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
147 CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
149 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
150 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
151 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0A00)
156 if test -n "$_WIN32_MSVC"; then
158 SKIP_COMPILER_CHECKS=1
159 SKIP_LIBRARY_CHECKS=1
161 # Since we're skipping compiler and library checks, hard-code
164 AC_DEFINE(HAVE_ISATTY)
167 fi # COMPILE_ENVIRONMENT
172 dnl ========================================================
173 dnl set the defaults first
174 dnl ========================================================
175 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
177 dnl Configure platform-specific CPU architecture compiler options.
178 dnl ==============================================================
179 if test "$COMPILE_ENVIRONMENT"; then
181 fi # COMPILE_ENVIRONMENT
183 if test -n "$COMPILE_ENVIRONMENT"; then
187 dnl ========================================================
188 dnl GNU specific defaults
189 dnl ========================================================
190 if test "$GNU_CC"; then
191 if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
192 DSO_PIC_CFLAGS='-fPIC'
193 ASFLAGS="$ASFLAGS -fPIC"
196 AC_MSG_CHECKING([for --noexecstack option to as])
198 CFLAGS="$CFLAGS -Wa,--noexecstack"
199 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
200 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
203 AC_MSG_CHECKING([for -z noexecstack option to ld])
204 _SAVE_LDFLAGS=$LDFLAGS
205 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
206 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
208 LDFLAGS=$_SAVE_LDFLAGS)
210 AC_MSG_CHECKING([for -z text option to ld])
211 _SAVE_LDFLAGS=$LDFLAGS
212 LDFLAGS="$LDFLAGS -Wl,-z,text"
213 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
215 LDFLAGS=$_SAVE_LDFLAGS)
217 AC_MSG_CHECKING([for -z relro option to ld])
218 _SAVE_LDFLAGS=$LDFLAGS
219 LDFLAGS="$LDFLAGS -Wl,-z,relro"
220 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
222 LDFLAGS=$_SAVE_LDFLAGS)
224 AC_MSG_CHECKING([for -z nocopyreloc option to ld])
225 _SAVE_LDFLAGS=$LDFLAGS
226 LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
227 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
229 LDFLAGS=$_SAVE_LDFLAGS)
231 AC_MSG_CHECKING([for -Bsymbolic-functions option to ld])
232 _SAVE_LDFLAGS=$LDFLAGS
233 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
234 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
236 LDFLAGS=$_SAVE_LDFLAGS)
238 # While sha1 is deterministic, it is slower.
239 if test -z "$DEVELOPER_OPTIONS"; then
244 AC_MSG_CHECKING([for --build-id=$build_id option to ld])
245 _SAVE_LDFLAGS=$LDFLAGS
246 LDFLAGS="$LDFLAGS -Wl,--build-id=$build_id"
247 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
249 LDFLAGS=$_SAVE_LDFLAGS)
251 AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
252 HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
253 _SAVE_LDFLAGS=$LDFLAGS
254 LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
255 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
256 [HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1],
258 LDFLAGS=$_SAVE_LDFLAGS
261 if test "$GCC_USE_GNU_LD"; then
262 # Some tools like ASan use a runtime library that is only
263 # linked against executables, so we must allow undefined
264 # symbols for shared objects in some cases.
265 if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
266 # Don't allow undefined symbols in libraries
267 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
269 # BSDs need `environ' exposed for posix_spawn (bug 753046)
271 DragonFly|FreeBSD|NetBSD|OpenBSD)
272 if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then
273 DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
275 DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
282 _DEFINES_CFLAGS="-include $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
284 ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
287 if test "$GNU_CXX"; then
288 CXXFLAGS="$CXXFLAGS -fno-exceptions"
290 _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
293 dnl ========================================================
294 dnl System overrides of the defaults for host
295 dnl ========================================================
298 if test -n "$_WIN32_MSVC"; then
299 HOST_CFLAGS="$HOST_CFLAGS"
301 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
303 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
304 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
307 case "${host_cpu}" in
309 if test -n "$_WIN32_MSVC"; then
310 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
314 if test -n "$_WIN32_MSVC"; then
315 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
317 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
323 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
324 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
327 *-linux*|*-kfreebsd*-gnu|*-gnu*)
328 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
329 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
333 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
334 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
338 dnl ========================================================
339 dnl System overrides of the defaults for target
340 dnl ========================================================
344 MOZ_OPTIMIZE_FLAGS="-O3"
347 dnl DTrace and -dead_strip don't interact well. See bug 403132.
348 dnl ===================================================================
349 if test "x$enable_dtrace" = "xyes"; then
350 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
352 dnl check for the presence of the -dead_strip linker flag
353 AC_MSG_CHECKING([for -dead_strip option to ld])
354 _SAVE_LDFLAGS=$LDFLAGS
355 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
356 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
357 if test -n "$_HAVE_DEAD_STRIP" ; then
359 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
364 LDFLAGS=$_SAVE_LDFLAGS
370 *-android*|*-linuxandroid*)
371 # From https://github.com/android-ndk/ndk/issues/133#issuecomment-308549264
372 # -Oz is smaller than -Os on clang.
373 MOZ_OPTIMIZE_FLAGS="-Oz"
374 # Disable the outliner, which causes performance regressions, and is
375 # enabled on some platforms at -Oz.
376 if test -z "$MOZ_LTO"; then
377 DISABLE_OUTLINER="-mno-outline"
379 CFLAGS="$CFLAGS $DISABLE_OUTLINER"
380 AC_TRY_COMPILE(,,[MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS $DISABLE_OUTLINER"])
381 CFLAGS="$_SAVE_CFLAGS"
383 DISABLE_OUTLINER="-Wl,-plugin-opt=-enable-machine-outliner=never"
384 _SAVE_LDFLAGS=$LDFLAGS
385 LDFLAGS="$LDFLAGS $MOZ_LTO_LDFLAGS $DISABLE_OUTLINER"
386 AC_TRY_LINK(,,[MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS $DISABLE_OUTLINER"])
387 LDFLAGS="$_SAVE_LDFLAGS"
392 if test "$GNU_CC" -o "$GNU_CXX"; then
393 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
394 if test -n "$MOZ_DEBUG"; then
395 MOZ_OPTIMIZE_FLAGS="-Os"
397 MOZ_OPTIMIZE_FLAGS="-O2"
399 if test -z "$CLANG_CC"; then
400 MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
404 case "${target_cpu}" in
406 CFLAGS="$CFLAGS -mieee"
407 CXXFLAGS="$CXXFLAGS -mieee"
413 # certain versions of cygwin's makedepend barf on the
414 # #include <string> vs -I./dist/include/string issue so don't use it
415 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
416 # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
417 if test -z "$CLANG_CC"; then
418 AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
424 MOZ_OPTIMIZE_FLAGS="-O2"
426 WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
427 WIN32_GUI_EXE_LDFLAGS=-mwindows
429 # Silence problematic clang warnings
430 CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
431 LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
433 TARGET_COMPILER_ABI=msvc
434 WIN32_SUBSYSTEM_VERSION=10.0
435 WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
436 WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
437 DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
438 _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
439 _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
440 CFLAGS="$CFLAGS -Gy -Zc:inline"
441 CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
442 if test "$CPU_ARCH" = "x86"; then
443 dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
444 dnl more recent, so set that explicitly here unless another
445 dnl target arch has already been set.
447 if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
448 CFLAGS="$CFLAGS -arch:SSE2"
450 if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
451 CXXFLAGS="$CXXFLAGS -arch:SSE2"
455 dnl VS2013+ supports -Gw for better linker optimizations.
456 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
457 dnl Disabled on ASan because it causes false-positive ODR violations.
458 if test -z "$MOZ_ASAN"; then
460 CXXFLAGS="$CXXFLAGS -Gw"
462 # String tail merging doesn't play nice with ASan's ODR checker.
463 LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
465 # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
466 CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
467 MOZ_DEBUG_LDFLAGS='-DEBUG'
468 if test "$HOST_OS_ARCH" != "WINNT"; then
469 # %_PDB% is a special signal to emit only the PDB basename. This
470 # avoids problems in Windows tools that don't like forward-slashes.
471 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -PDBALTPATH:%_PDB%"
473 MOZ_OPTIMIZE_FLAGS='-O2'
475 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
477 AC_DEFINE(WIN32_LEAN_AND_MEAN)
478 dnl See http://support.microsoft.com/kb/143208 to use STL
484 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.])
490 if test -n "$GNU_CC"; then
491 CFLAGS="$CFLAGS -mstackrealign"
492 CXXFLAGS="$CXXFLAGS -mstackrealign"
493 LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
495 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
496 LDFLAGS="$LDFLAGS -SAFESEH"
502 if test -n "$_WIN32_MSVC"; then
503 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
508 if test -n "$_WIN32_MSVC"; then
509 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
514 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
520 CFLAGS="$CFLAGS -Dunix"
521 CXXFLAGS="$CXXFLAGS -Dunix"
522 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
523 DSO_PIC_CFLAGS='-fPIC -DPIC'
525 MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
527 DSO_PIC_CFLAGS='-fPIC -DPIC'
530 # This will fail on a.out systems prior to 1.5.1_ALPHA.
531 if test "$LIBRUNPATH"; then
532 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
537 if test -z "$X11BASE"; then
540 MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
541 DSO_PIC_CFLAGS='-fPIC'
542 DSO_LDOPTS='-shared -fPIC'
543 if test "$LIBRUNPATH"; then
544 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
549 MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
554 CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
555 CXXFLAGS="$CXXFLAGS $DSO_PIC_CFLAGS"
557 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
558 MOZ_OPTIMIZE_FLAGS="-O"
562 if test -z "$COMPILE_ENVIRONMENT"; then
563 SKIP_COMPILER_CHECKS=1
564 SKIP_LIBRARY_CHECKS=1
568 fi # COMPILE_ENVIRONMENT
570 if test -z "$SKIP_COMPILER_CHECKS"; then
571 dnl Checks for typedefs, structures, and compiler characteristics.
572 dnl ========================================================
587 dnl Checks for header files.
588 dnl ========================================================
591 dnl Checks for libraries.
592 dnl ========================================================
593 AC_CHECK_LIB(c_r, gethostbyname_r)
595 dnl We don't want to link with libdl even if it's present on OS X, since
596 dnl it's not used and not part of the default installation. OS/2 has dlfcn
598 dnl We don't want to link against libm or libpthread on Darwin since
599 dnl they both are just symlinks to libSystem and explicitly linking
600 dnl against libSystem causes issues when debugging (see bug 299601).
605 AC_SEARCH_LIBS(dlopen, dl,
606 MOZ_CHECK_HEADER(dlfcn.h,
607 AC_DEFINE(HAVE_DLOPEN)))
611 _SAVE_CFLAGS="$CFLAGS"
612 CFLAGS="$CFLAGS -D_GNU_SOURCE"
613 AC_CHECK_FUNCS(dladdr)
614 CFLAGS="$_SAVE_CFLAGS"
616 if test ! "$GNU_CXX"; then
617 AC_CHECK_LIB(C, demangle)
620 AC_CHECK_LIB(socket, socket)
622 dnl ========================================================
623 dnl = pthread support
624 dnl = Start by checking whether the system support pthreads
625 dnl ========================================================
631 AC_CHECK_LIB(pthreads, pthread_create,
632 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
633 AC_CHECK_LIB(pthread, pthread_create,
634 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
635 AC_CHECK_LIB(c_r, pthread_create,
636 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
637 AC_CHECK_LIB(c, pthread_create,
646 dnl ========================================================
647 dnl Do the platform specific pthread hackery
648 dnl ========================================================
649 if test "$MOZ_USE_PTHREADS"x != x
652 dnl See if -pthread is supported.
655 ac_cv_have_dash_pthread=no
656 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
657 echo 'int main() { return 0; }' | cat > conftest.c
658 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
659 if test $? -eq 0; then
660 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
661 ac_cv_have_dash_pthread=yes
664 # Freebsd doesn't use -pthread for compiles, it uses them for linking
667 CFLAGS="$CFLAGS -pthread"
668 CXXFLAGS="$CXXFLAGS -pthread"
674 AC_MSG_RESULT($ac_cv_have_dash_pthread)
677 dnl See if -pthreads is supported.
679 ac_cv_have_dash_pthreads=no
680 if test "$ac_cv_have_dash_pthread" = "no"; then
681 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
682 echo 'int main() { return 0; }' | cat > conftest.c
683 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
684 if test $? -eq 0; then
685 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
686 ac_cv_have_dash_pthreads=yes
687 CFLAGS="$CFLAGS -pthreads"
688 CXXFLAGS="$CXXFLAGS -pthreads"
692 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
697 AC_DEFINE(_REENTRANT)
698 AC_DEFINE(_THREAD_SAFE)
699 dnl -pthread links in -lpthread, so don't specify it explicitly.
700 if test "$ac_cv_have_dash_pthread" = "yes"; then
701 _PTHREAD_LDFLAGS="-pthread"
705 *-*-openbsd*|*-*-bsdi*)
706 AC_DEFINE(_REENTRANT)
707 AC_DEFINE(_THREAD_SAFE)
708 dnl -pthread links in -lc_r, so don't specify it explicitly.
709 if test "$ac_cv_have_dash_pthread" = "yes"; then
710 _PTHREAD_LDFLAGS="-pthread"
714 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
715 AC_DEFINE(_REENTRANT)
719 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
720 AC_SUBST(MOZ_USE_PTHREADS)
721 MOZ_CHECK_HEADERS(pthread.h)
725 dnl Checks for library functions.
726 dnl ========================================================
728 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
729 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
730 ac_cv_clock_monotonic,
731 [for libs in "" -lrt; do
734 dnl clock_gettime is available on OSX since 10.12, so depending on MACOSX_DEPLOYMENT_TARGET,
735 dnl we should or not be able to use it. To detect if we can, we need to make the
736 dnl availability attribute strict, so that compilation fails when the target is < 10.12.
737 AC_TRY_LINK([#define availability(os, ...) availability(os, strict, __VA_ARGS)
739 [ struct timespec ts;
740 clock_gettime(CLOCK_MONOTONIC, &ts); ],
741 ac_cv_clock_monotonic=$libs
744 ac_cv_clock_monotonic=no)
747 if test "$ac_cv_clock_monotonic" != "no"; then
748 HAVE_CLOCK_MONOTONIC=1
749 REALTIME_LIBS=$ac_cv_clock_monotonic
750 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
751 AC_SUBST(HAVE_CLOCK_MONOTONIC)
752 AC_SUBST_LIST(REALTIME_LIBS)
757 ac_cv_func_res_ninit,
758 [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
759 dnl no need for res_ninit() on NetBSD and OpenBSD
760 ac_cv_func_res_ninit=no
764 #define _BSD_SOURCE 1
766 #include <sys/types.h>
767 #include <netinet/in.h>
768 #include <arpa/nameser.h>
771 [int foo = res_ninit(&_res);],
772 [ac_cv_func_res_ninit=yes],
773 [ac_cv_func_res_ninit=no])
777 if test "$ac_cv_func_res_ninit" = "yes"; then
778 AC_DEFINE(HAVE_RES_NINIT)
779 dnl must add the link line we do something as foolish as this... dougt
781 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
782 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
787 dnl ===================================================================
788 dnl ========================================================
789 dnl Put your C++ language/feature checks below
790 dnl ========================================================
794 if test "$GNU_CC"; then
795 if test "$CPU_ARCH" = "arm" ; then
796 AC_CACHE_CHECK(for ARM EABI,
800 #if defined(__ARM_EABI__)
806 ac_cv_gcc_arm_eabi="yes",
807 ac_cv_gcc_arm_eabi="no")])
808 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
816 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
819 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
820 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
821 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
823 _SAVE_LDFLAGS=$LDFLAGS
824 LDFLAGS="$LDFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
825 AC_CACHE_CHECK(for __thread keyword for TLS variables,
826 ac_cv_thread_keyword,
827 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
828 [return tlsIsMainThread;],
829 ac_cv_thread_keyword=yes,
830 ac_cv_thread_keyword=no)])
831 LDFLAGS=$_SAVE_LDFLAGS
832 # The custom dynamic linker doesn't support TLS variables
833 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
834 # mips builds fail with TLS variables because of a binutils bug.
836 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
841 *-android*|*-linuxandroid*)
848 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
853 if test -n "$MOZ_LINKER"; then
854 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
855 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
856 dnl Since the linker only understands the sysv ones, no need to build the
857 dnl gnu style tables anyways.
858 LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
861 dnl End of C++ language/feature checks
864 fi # ! SKIP_COMPILER_CHECKS
866 if test -n "${COMPILE_ENVIRONMENT}"; then
871 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
872 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
873 AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
876 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
877 dnl features that Windows actually does support.
879 if test -n "$SKIP_COMPILER_CHECKS"; then
880 dnl Windows has malloc.h
881 AC_DEFINE(MALLOC_H, [<malloc.h>])
882 AC_DEFINE(HAVE_FORCEINLINE)
883 fi # SKIP_COMPILER_CHECKS
885 dnl Mozilla specific options
886 dnl ========================================================
887 dnl The macros used for command line options
888 dnl are defined in build/autoconf/altoptions.m4.
890 dnl ========================================================
894 dnl ========================================================
896 MOZ_BRANDING_DIRECTORY=
897 MOZ_OFFICIAL_BRANDING=
899 MOZ_BINARY_EXTENSIONS=
902 dnl ========================================================
903 dnl = Trademarked Branding
904 dnl ========================================================
905 MOZ_ARG_ENABLE_BOOL(official-branding,
906 [ --enable-official-branding
907 Enable Official mozilla.org Branding
908 Do not distribute builds with
909 --enable-official-branding unless you have
910 permission to use trademarks per
911 http://www.mozilla.org/foundation/trademarks/ .],
912 MOZ_OFFICIAL_BRANDING=1,
913 MOZ_OFFICIAL_BRANDING=)
915 # Allow the application to influence configure with a confvars.sh script.
916 AC_MSG_CHECKING([if app-specific confvars.sh exists])
917 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
918 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
919 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
924 AC_SUBST(MOZ_OFFICIAL_BRANDING)
925 if test -n "$MOZ_OFFICIAL_BRANDING"; then
926 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
927 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
929 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
930 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
934 MOZ_ARG_WITH_STRING(branding,
935 [ --with-branding=dir Use branding from the specified directory.],
936 MOZ_BRANDING_DIRECTORY=$withval)
938 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
939 if test -z "$REAL_BRANDING_DIRECTORY"; then
940 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
943 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
944 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
947 AC_SUBST(MOZ_BRANDING_DIRECTORY)
949 dnl ========================================================
950 dnl = Distribution ID
951 dnl ========================================================
952 MOZ_ARG_WITH_STRING(distribution-id,
953 [ --with-distribution-id=ID
954 Set distribution-specific id (default=org.mozilla)],
955 [ val=`echo $withval`
956 MOZ_DISTRIBUTION_ID="$val"])
958 if test -z "$MOZ_DISTRIBUTION_ID"; then
959 MOZ_DISTRIBUTION_ID="org.mozilla"
962 AC_SUBST(MOZ_DISTRIBUTION_ID)
964 dnl ========================================================
965 dnl = Enable code optimization. ON by default.
966 dnl ========================================================
968 # Use value from moz.configure if one is defined. Else use our computed
970 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
971 MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
974 if test "$COMPILE_ENVIRONMENT"; then
975 if test -n "$MOZ_OPTIMIZE"; then
976 AC_MSG_CHECKING([for valid C compiler optimization flags])
978 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
979 AC_TRY_COMPILE([#include <stdio.h>],
980 [printf("Hello World\n");],
983 AC_MSG_RESULT([$_results])
984 if test "$_results" = "no"; then
985 AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
988 if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
989 # When using llvm-based LTO, non numeric optimization levels are
990 # not supported by the linker, so force the linker to use -O2 (
991 # which doesn't influence the level compilation units are actually
993 case " $MOZ_OPTIMIZE_FLAGS " in
995 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
1000 fi # COMPILE_ENVIRONMENT
1002 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
1003 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
1004 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
1006 case "${OS_TARGET}" in
1007 Android|WINNT|Darwin)
1008 MOZ_GLUE_IN_PROGRAM=
1011 dnl On !Android !Windows !OSX, we only want to link executables against mozglue
1012 MOZ_GLUE_IN_PROGRAM=1
1013 AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
1017 dnl ========================================================
1018 dnl = Jemalloc build setup
1019 dnl ========================================================
1020 if test -z "$MOZ_MEMORY"; then
1023 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
1024 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.])
1029 dnl The generic feature tests that determine how to compute ncpus are long and
1030 dnl complicated. Therefore, simply define special cpp variables for the
1031 dnl platforms we have special knowledge of.
1034 export MOZ_NO_DEBUG_RTL=1
1038 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
1040 dnl ========================================================
1041 dnl = Enable using the clang plugin to build
1042 dnl ========================================================
1044 if test -n "$COMPILE_ENVIRONMENT"; then
1045 MOZ_CONFIG_CLANG_PLUGIN
1046 fi # COMPILE_ENVIRONMENT
1048 if test -z "$SKIP_COMPILER_CHECKS"; then
1049 dnl ========================================================
1050 dnl Check for gcc -pipe support
1051 dnl ========================================================
1052 AC_MSG_CHECKING([for -pipe support])
1053 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
1054 dnl Any gcc that supports firefox supports -pipe.
1055 CFLAGS="$CFLAGS -pipe"
1056 CXXFLAGS="$CXXFLAGS -pipe"
1057 AC_MSG_RESULT([yes])
1062 fi # ! SKIP_COMPILER_CHECKS
1066 if test "$COMPILE_ENVIRONMENT"; then
1068 fi # COMPILE_ENVIRONMENT
1070 dnl ========================================================
1071 dnl Check if we need the 32-bit Linux SSE2 error dialog
1072 dnl ========================================================
1074 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
1076 dnl ========================================================
1078 dnl ========================================================
1080 if test "$OS_ARCH" = "WINNT"; then
1081 # For now we assume that we will have a uint64_t available through
1082 # one of the above headers or mozstdint.h.
1083 AC_DEFINE(HAVE_UINT64_T)
1086 case "$MOZ_WIDGET_TOOLKIT" in
1088 if test "$COMPILE_ENVIRONMENT"; then
1089 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
1093 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
1095 dnl ========================================================
1097 dnl = Maintainer debug option (no --enable equivalent)
1099 dnl ========================================================
1101 AC_SUBST_LIST(ASFLAGS)
1102 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
1104 AC_SUBST(MOZ_STUB_INSTALLER)
1106 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
1108 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
1110 if test -n "$MOZ_BINARY_EXTENSIONS"; then
1111 AC_DEFINE(MOZ_BINARY_EXTENSIONS)
1114 dnl ========================================================
1115 dnl = Mac bundle name prefix
1116 dnl ========================================================
1117 MOZ_ARG_WITH_STRING(macbundlename-prefix,
1118 [ --with-macbundlename-prefix=prefix
1119 Prefix for MOZ_MACBUNDLE_NAME],
1120 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
1122 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
1123 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
1124 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
1127 if test "$MOZ_DEBUG"; then
1128 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
1130 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
1132 AC_SUBST(MOZ_MACBUNDLE_NAME)
1134 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
1135 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
1136 # Otherwise, use MOZ_APP_DISPLAYNAME
1137 if test -z "$MOZ_MACBUNDLE_ID"; then
1138 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
1140 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
1141 if test "$MOZ_DEBUG"; then
1142 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
1145 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
1146 AC_SUBST(MOZ_MACBUNDLE_ID)
1148 dnl ========================================================
1149 dnl = Child Process Name for IPC
1150 dnl ========================================================
1151 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
1152 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
1154 # We want to let Android unpack the file at install time, but it only does
1155 # so if the file is named libsomething.so. The lib/ path is also required
1156 # because the unpacked file will be under the lib/ subdirectory and will
1157 # need to be executed from that path.
1158 MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
1160 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
1161 MOZ_CHILD_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.plugincontainer
1162 MOZ_CHILD_PROCESS_BUNDLENAME="plugin-container.app"
1163 MOZ_CHILD_PROCESS_APPNAME="${MOZ_APP_DISPLAYNAME}CP"
1165 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
1166 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
1167 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLEID)
1168 AC_SUBST(MOZ_CHILD_PROCESS_APPNAME)
1169 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
1171 dnl ==========================================================
1172 dnl = Mac Media Plugin Helper (GMP Child) Process Name for IPC
1173 dnl ==========================================================
1174 MOZ_EME_PROCESS_NAME="media-plugin-helper"
1175 MOZ_EME_PROCESS_NAME_BRANDED="$MOZ_APP_DISPLAYNAME Media Plugin Helper"
1176 MOZ_EME_PROCESS_BUNDLENAME="${MOZ_EME_PROCESS_NAME}.app"
1177 # Generate a lower case string with no spaces to be used as the bundle ID
1178 # for the EME helper .app of the form org.mozilla.<executable-name>.
1179 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_APP_DISPLAYNAME" | tr ' ' '-'`
1180 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_EME_PROCESS_BUNDLEID" | tr 'A-Z' 'a-z'`
1181 MOZ_EME_PROCESS_BUNDLEID=${MOZ_EME_PROCESS_BUNDLEID}-${MOZ_EME_PROCESS_NAME}
1182 MOZ_EME_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.${MOZ_EME_PROCESS_BUNDLEID}
1184 AC_SUBST(MOZ_EME_PROCESS_NAME)
1185 AC_SUBST(MOZ_EME_PROCESS_NAME_BRANDED)
1186 AC_SUBST(MOZ_EME_PROCESS_BUNDLENAME)
1187 AC_SUBST(MOZ_EME_PROCESS_BUNDLEID)
1189 # The following variables are available to branding and application
1190 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
1191 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
1192 # impacts profile location and user-visible fields.
1193 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
1194 # Mac Bundle name, Updater, Installer), it is typically used for nightly
1195 # builds (e.g. Aurora for Firefox).
1196 # - MOZ_APP_PROFILE: When set, used for application.ini's
1197 # "Profile" field, which controls profile location.
1198 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
1199 # crash reporter server url.
1200 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
1202 # The following environment variables used to have an effect, but don't anymore:
1203 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
1204 # the contents from the version.txt file in the application directory, or
1205 # browser/config/version.txt if there isn't one.
1206 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
1207 # in the "About" window. This was replaced with the contents from the
1208 # version_display.txt or version.txt in the application directory, or
1209 # browser/config/version_display.txt.
1211 # For extensions and langpacks, we require a max version that is compatible
1212 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
1213 # 24.0a1 and 24.0a2 aren't affected
1215 # 24.1.1 becomes 24.*
1216 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
1217 if test -z "$IS_ALPHA"; then
1219 if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
1220 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
1222 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
1226 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
1229 AC_SUBST(MOZ_APP_DISPLAYNAME)
1230 AC_SUBST(MOZ_APP_VENDOR)
1231 AC_SUBST(MOZ_APP_PROFILE)
1232 AC_SUBST(MOZ_APP_ID)
1233 AC_SUBST(MAR_CHANNEL_ID)
1234 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
1235 AC_SUBST(MOZ_PROFILE_MIGRATOR)
1236 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
1237 AC_SUBST(MOZ_APP_UA_NAME)
1238 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
1239 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
1240 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
1242 AC_SUBST(MOZ_APP_MAXVERSION)
1243 AC_SUBST(MOZ_PKG_SPECIAL)
1244 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
1246 if test "$MOZILLA_OFFICIAL"; then
1247 # Build revisions should always be present in official builds
1248 MOZ_INCLUDE_SOURCE_INFO=1
1251 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
1252 # explicitly set the repository and changeset information in.
1253 AC_SUBST(MOZ_SOURCE_REPO)
1254 AC_SUBST(MOZ_SOURCE_CHANGESET)
1255 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
1258 AC_SUBST(WIN32_REDIST_DIR)
1260 dnl Echo the CFLAGS to remove extra whitespace.
1262 $_COMPILATION_CFLAGS \
1266 $_COMPILATION_CXXFLAGS \
1269 COMPILE_CFLAGS=`echo \
1273 COMPILE_CXXFLAGS=`echo \
1274 $_DEFINES_CXXFLAGS \
1278 $_COMPILATION_HOST_CFLAGS \
1281 HOST_CXXFLAGS=`echo \
1282 $_COMPILATION_HOST_CXXFLAGS \
1285 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
1286 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1287 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
1288 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1289 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
1290 OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1291 OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1293 AC_SUBST(HOST_CMFLAGS)
1294 AC_SUBST(HOST_CMMFLAGS)
1295 AC_SUBST(OS_COMPILE_CMFLAGS)
1296 AC_SUBST(OS_COMPILE_CMMFLAGS)
1299 OS_CXXFLAGS="$CXXFLAGS"
1300 OS_CPPFLAGS="$CPPFLAGS"
1301 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
1302 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
1303 OS_LDFLAGS="$LDFLAGS"
1305 AC_SUBST_LIST(OS_CFLAGS)
1306 AC_SUBST_LIST(OS_CXXFLAGS)
1307 AC_SUBST_LIST(OS_CPPFLAGS)
1308 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
1309 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
1310 AC_SUBST_LIST(OS_LDFLAGS)
1315 AC_SUBST_LIST(HOST_CFLAGS)
1316 AC_SUBST_LIST(HOST_CPPFLAGS)
1317 AC_SUBST_LIST(HOST_CXXFLAGS)
1318 AC_SUBST(HOST_LDFLAGS)
1319 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
1320 AC_SUBST(HOST_BIN_SUFFIX)
1322 AC_SUBST(TARGET_XPCOM_ABI)
1324 AC_SUBST(DSO_LDOPTS)
1325 AC_SUBST(BIN_SUFFIX)
1327 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
1328 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
1330 AC_SUBST(MOZ_DEVTOOLS)
1332 AC_SUBST(MOZ_PACKAGE_JSSHELL)
1336 dnl Host JavaScript runtime, if any, to use during cross compiles.
1339 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
1341 dnl Set various defines and substitutions
1342 dnl ========================================================
1344 AC_SUBST(MOZ_DEV_EDITION)
1345 if test -n "$MOZ_DEV_EDITION"; then
1346 AC_DEFINE(MOZ_DEV_EDITION)
1349 dnl Spit out some output
1350 dnl ========================================================
1352 # Avoid using obsolete NSPR features
1353 AC_DEFINE(NO_NSPR_10_SUPPORT)
1355 MOZ_CREATE_CONFIG_STATUS()
1357 rm -fr confdefs* $ac_clean_files