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 # Require OS features provided by IE 8.0 (Win7)
152 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0800)
157 if test -n "$_WIN32_MSVC"; then
159 SKIP_COMPILER_CHECKS=1
160 SKIP_LIBRARY_CHECKS=1
162 # Since we're skipping compiler and library checks, hard-code
165 AC_DEFINE(HAVE_ISATTY)
168 fi # COMPILE_ENVIRONMENT
173 dnl ========================================================
174 dnl set the defaults first
175 dnl ========================================================
176 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
178 dnl Configure platform-specific CPU architecture compiler options.
179 dnl ==============================================================
180 if test "$COMPILE_ENVIRONMENT"; then
182 fi # COMPILE_ENVIRONMENT
184 if test -n "$COMPILE_ENVIRONMENT"; then
188 dnl ========================================================
189 dnl GNU specific defaults
190 dnl ========================================================
191 if test "$GNU_CC"; then
192 if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
193 DSO_PIC_CFLAGS='-fPIC'
194 ASFLAGS="$ASFLAGS -fPIC"
197 AC_MSG_CHECKING([for --noexecstack option to as])
199 CFLAGS="$CFLAGS -Wa,--noexecstack"
200 AC_TRY_COMPILE(,,AC_MSG_RESULT([yes])
201 [ASFLAGS="$ASFLAGS -Wa,--noexecstack"],
204 AC_MSG_CHECKING([for -z noexecstack option to ld])
205 _SAVE_LDFLAGS=$LDFLAGS
206 LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"
207 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
209 LDFLAGS=$_SAVE_LDFLAGS)
211 AC_MSG_CHECKING([for -z text option to ld])
212 _SAVE_LDFLAGS=$LDFLAGS
213 LDFLAGS="$LDFLAGS -Wl,-z,text"
214 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
216 LDFLAGS=$_SAVE_LDFLAGS)
218 AC_MSG_CHECKING([for -z relro option to ld])
219 _SAVE_LDFLAGS=$LDFLAGS
220 LDFLAGS="$LDFLAGS -Wl,-z,relro"
221 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
223 LDFLAGS=$_SAVE_LDFLAGS)
225 AC_MSG_CHECKING([for -z nocopyreloc option to ld])
226 _SAVE_LDFLAGS=$LDFLAGS
227 LDFLAGS="$LDFLAGS -Wl,-z,nocopyreloc"
228 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
230 LDFLAGS=$_SAVE_LDFLAGS)
232 AC_MSG_CHECKING([for -Bsymbolic-functions option to ld])
233 _SAVE_LDFLAGS=$LDFLAGS
234 LDFLAGS="$LDFLAGS -Wl,-Bsymbolic-functions"
235 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
237 LDFLAGS=$_SAVE_LDFLAGS)
239 # While sha1 is deterministic, it is slower.
240 if test -z "$DEVELOPER_OPTIONS"; then
245 AC_MSG_CHECKING([for --build-id=$build_id option to ld])
246 _SAVE_LDFLAGS=$LDFLAGS
247 LDFLAGS="$LDFLAGS -Wl,--build-id=$build_id"
248 AC_TRY_LINK(,,AC_MSG_RESULT([yes]),
250 LDFLAGS=$_SAVE_LDFLAGS)
252 AC_MSG_CHECKING([for --ignore-unresolved-symbol option to ld])
253 HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=
254 _SAVE_LDFLAGS=$LDFLAGS
255 LDFLAGS="$LDFLAGS -Wl,--ignore-unresolved-symbol,environ"
256 AC_TRY_LINK(,,AC_MSG_RESULT([yes])
257 [HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED=1],
259 LDFLAGS=$_SAVE_LDFLAGS
262 if test "$GCC_USE_GNU_LD"; then
263 # Some tools like ASan use a runtime library that is only
264 # linked against executables, so we must allow undefined
265 # symbols for shared objects in some cases.
266 if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
267 # Don't allow undefined symbols in libraries
268 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
270 # BSDs need `environ' exposed for posix_spawn (bug 753046)
272 DragonFly|FreeBSD|NetBSD|OpenBSD)
273 if test -n "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED"; then
274 DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
276 DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
283 _DEFINES_CFLAGS="-include $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
285 ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
288 if test "$GNU_CXX"; then
289 CXXFLAGS="$CXXFLAGS -fno-exceptions"
291 _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
294 dnl ========================================================
295 dnl System overrides of the defaults for host
296 dnl ========================================================
299 if test -n "$_WIN32_MSVC"; then
300 HOST_CFLAGS="$HOST_CFLAGS"
302 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
304 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
305 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
308 case "${host_cpu}" in
310 if test -n "$_WIN32_MSVC"; then
311 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
315 if test -n "$_WIN32_MSVC"; then
316 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
318 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
324 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
325 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
328 *-linux*|*-kfreebsd*-gnu|*-gnu*)
329 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
330 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
334 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
335 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
339 dnl ========================================================
340 dnl System overrides of the defaults for target
341 dnl ========================================================
345 MOZ_OPTIMIZE_FLAGS="-O3"
348 dnl DTrace and -dead_strip don't interact well. See bug 403132.
349 dnl ===================================================================
350 if test "x$enable_dtrace" = "xyes"; then
351 echo "Skipping -dead_strip because DTrace is enabled. See bug 403132."
353 dnl check for the presence of the -dead_strip linker flag
354 AC_MSG_CHECKING([for -dead_strip option to ld])
355 _SAVE_LDFLAGS=$LDFLAGS
356 LDFLAGS="$LDFLAGS -Wl,-dead_strip"
357 AC_TRY_LINK(,[return 0;],_HAVE_DEAD_STRIP=1,_HAVE_DEAD_STRIP=)
358 if test -n "$_HAVE_DEAD_STRIP" ; then
360 MOZ_OPTIMIZE_LDFLAGS="-Wl,-dead_strip"
365 LDFLAGS=$_SAVE_LDFLAGS
371 *-android*|*-linuxandroid*)
372 # From https://github.com/android-ndk/ndk/issues/133#issuecomment-308549264
373 # -Oz is smaller than -Os on clang.
374 MOZ_OPTIMIZE_FLAGS="-Oz"
375 # Disable the outliner, which causes performance regressions, and is
376 # enabled on some platforms at -Oz.
377 if test -z "$MOZ_LTO"; then
378 DISABLE_OUTLINER="-mno-outline"
380 CFLAGS="$CFLAGS $DISABLE_OUTLINER"
381 AC_TRY_COMPILE(,,[MOZ_OPTIMIZE_FLAGS="$MOZ_OPTIMIZE_FLAGS $DISABLE_OUTLINER"])
382 CFLAGS="$_SAVE_CFLAGS"
384 DISABLE_OUTLINER="-Wl,-plugin-opt=-enable-machine-outliner=never"
385 _SAVE_LDFLAGS=$LDFLAGS
386 LDFLAGS="$LDFLAGS $MOZ_LTO_LDFLAGS $DISABLE_OUTLINER"
387 AC_TRY_LINK(,,[MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS $DISABLE_OUTLINER"])
388 LDFLAGS="$_SAVE_LDFLAGS"
393 if test "$GNU_CC" -o "$GNU_CXX"; then
394 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
395 if test -n "$MOZ_DEBUG"; then
396 MOZ_OPTIMIZE_FLAGS="-Os"
398 MOZ_OPTIMIZE_FLAGS="-O2"
400 if test -z "$CLANG_CC"; then
401 MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
405 case "${target_cpu}" in
407 CFLAGS="$CFLAGS -mieee"
408 CXXFLAGS="$CXXFLAGS -mieee"
414 # certain versions of cygwin's makedepend barf on the
415 # #include <string> vs -I./dist/include/string issue so don't use it
416 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
417 # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
418 if test -z "$CLANG_CC"; then
419 AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
425 MOZ_OPTIMIZE_FLAGS="-O2"
427 WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
428 WIN32_GUI_EXE_LDFLAGS=-mwindows
430 # Silence problematic clang warnings
431 CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
432 LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
434 TARGET_COMPILER_ABI=msvc
435 WIN32_SUBSYSTEM_VERSION=10.0
436 WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
437 WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
438 DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
439 _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
440 _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
441 CFLAGS="$CFLAGS -Gy -Zc:inline"
442 CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
443 if test "$CPU_ARCH" = "x86"; then
444 dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
445 dnl more recent, so set that explicitly here unless another
446 dnl target arch has already been set.
448 if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
449 CFLAGS="$CFLAGS -arch:SSE2"
451 if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
452 CXXFLAGS="$CXXFLAGS -arch:SSE2"
456 dnl VS2013+ supports -Gw for better linker optimizations.
457 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
458 dnl Disabled on ASan because it causes false-positive ODR violations.
459 if test -z "$MOZ_ASAN"; then
461 CXXFLAGS="$CXXFLAGS -Gw"
463 # String tail merging doesn't play nice with ASan's ODR checker.
464 LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
466 # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
467 CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
468 MOZ_DEBUG_LDFLAGS='-DEBUG'
469 if test "$HOST_OS_ARCH" != "WINNT"; then
470 # %_PDB% is a special signal to emit only the PDB basename. This
471 # avoids problems in Windows tools that don't like forward-slashes.
472 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -PDBALTPATH:%_PDB%"
474 MOZ_OPTIMIZE_FLAGS='-O2'
476 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
478 AC_DEFINE(WIN32_LEAN_AND_MEAN)
479 dnl See http://support.microsoft.com/kb/143208 to use STL
485 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.])
491 if test -n "$GNU_CC"; then
492 CFLAGS="$CFLAGS -mstackrealign"
493 CXXFLAGS="$CXXFLAGS -mstackrealign"
494 LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
496 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
497 LDFLAGS="$LDFLAGS -SAFESEH"
503 if test -n "$_WIN32_MSVC"; then
504 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
509 if test -n "$_WIN32_MSVC"; then
510 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
515 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
521 CFLAGS="$CFLAGS -Dunix"
522 CXXFLAGS="$CXXFLAGS -Dunix"
523 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
524 DSO_PIC_CFLAGS='-fPIC -DPIC'
526 MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
528 DSO_PIC_CFLAGS='-fPIC -DPIC'
531 # This will fail on a.out systems prior to 1.5.1_ALPHA.
532 if test "$LIBRUNPATH"; then
533 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
538 if test -z "$X11BASE"; then
541 MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
542 DSO_PIC_CFLAGS='-fPIC'
543 DSO_LDOPTS='-shared -fPIC'
544 if test "$LIBRUNPATH"; then
545 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
550 MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
555 CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
556 CXXFLAGS="$CXXFLAGS $DSO_PIC_CFLAGS"
558 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
559 MOZ_OPTIMIZE_FLAGS="-O"
563 if test -z "$COMPILE_ENVIRONMENT"; then
564 SKIP_COMPILER_CHECKS=1
565 SKIP_LIBRARY_CHECKS=1
569 fi # COMPILE_ENVIRONMENT
571 if test -z "$SKIP_COMPILER_CHECKS"; then
572 dnl Checks for typedefs, structures, and compiler characteristics.
573 dnl ========================================================
588 dnl Checks for header files.
589 dnl ========================================================
592 dnl Checks for libraries.
593 dnl ========================================================
594 AC_CHECK_LIB(c_r, gethostbyname_r)
596 dnl We don't want to link with libdl even if it's present on OS X, since
597 dnl it's not used and not part of the default installation. OS/2 has dlfcn
599 dnl We don't want to link against libm or libpthread on Darwin since
600 dnl they both are just symlinks to libSystem and explicitly linking
601 dnl against libSystem causes issues when debugging (see bug 299601).
606 AC_SEARCH_LIBS(dlopen, dl,
607 MOZ_CHECK_HEADER(dlfcn.h,
608 AC_DEFINE(HAVE_DLOPEN)))
612 _SAVE_CFLAGS="$CFLAGS"
613 CFLAGS="$CFLAGS -D_GNU_SOURCE"
614 AC_CHECK_FUNCS(dladdr)
615 CFLAGS="$_SAVE_CFLAGS"
617 if test ! "$GNU_CXX"; then
618 AC_CHECK_LIB(C, demangle)
621 AC_CHECK_LIB(socket, socket)
623 dnl ========================================================
624 dnl = pthread support
625 dnl = Start by checking whether the system support pthreads
626 dnl ========================================================
632 AC_CHECK_LIB(pthreads, pthread_create,
633 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
634 AC_CHECK_LIB(pthread, pthread_create,
635 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
636 AC_CHECK_LIB(c_r, pthread_create,
637 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
638 AC_CHECK_LIB(c, pthread_create,
647 dnl ========================================================
648 dnl Do the platform specific pthread hackery
649 dnl ========================================================
650 if test "$MOZ_USE_PTHREADS"x != x
653 dnl See if -pthread is supported.
656 ac_cv_have_dash_pthread=no
657 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
658 echo 'int main() { return 0; }' | cat > conftest.c
659 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
660 if test $? -eq 0; then
661 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
662 ac_cv_have_dash_pthread=yes
665 # Freebsd doesn't use -pthread for compiles, it uses them for linking
668 CFLAGS="$CFLAGS -pthread"
669 CXXFLAGS="$CXXFLAGS -pthread"
675 AC_MSG_RESULT($ac_cv_have_dash_pthread)
678 dnl See if -pthreads is supported.
680 ac_cv_have_dash_pthreads=no
681 if test "$ac_cv_have_dash_pthread" = "no"; then
682 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
683 echo 'int main() { return 0; }' | cat > conftest.c
684 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
685 if test $? -eq 0; then
686 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
687 ac_cv_have_dash_pthreads=yes
688 CFLAGS="$CFLAGS -pthreads"
689 CXXFLAGS="$CXXFLAGS -pthreads"
693 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
698 AC_DEFINE(_REENTRANT)
699 AC_DEFINE(_THREAD_SAFE)
700 dnl -pthread links in -lpthread, so don't specify it explicitly.
701 if test "$ac_cv_have_dash_pthread" = "yes"; then
702 _PTHREAD_LDFLAGS="-pthread"
706 *-*-openbsd*|*-*-bsdi*)
707 AC_DEFINE(_REENTRANT)
708 AC_DEFINE(_THREAD_SAFE)
709 dnl -pthread links in -lc_r, so don't specify it explicitly.
710 if test "$ac_cv_have_dash_pthread" = "yes"; then
711 _PTHREAD_LDFLAGS="-pthread"
715 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
716 AC_DEFINE(_REENTRANT)
720 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
721 AC_SUBST(MOZ_USE_PTHREADS)
722 MOZ_CHECK_HEADERS(pthread.h)
726 dnl Checks for library functions.
727 dnl ========================================================
729 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
730 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
731 ac_cv_clock_monotonic,
732 [for libs in "" -lrt; do
735 dnl clock_gettime is available on OSX since 10.12, so depending on MACOSX_DEPLOYMENT_TARGET,
736 dnl we should or not be able to use it. To detect if we can, we need to make the
737 dnl availability attribute strict, so that compilation fails when the target is < 10.12.
738 AC_TRY_LINK([#define availability(os, ...) availability(os, strict, __VA_ARGS)
740 [ struct timespec ts;
741 clock_gettime(CLOCK_MONOTONIC, &ts); ],
742 ac_cv_clock_monotonic=$libs
745 ac_cv_clock_monotonic=no)
748 if test "$ac_cv_clock_monotonic" != "no"; then
749 HAVE_CLOCK_MONOTONIC=1
750 REALTIME_LIBS=$ac_cv_clock_monotonic
751 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
752 AC_SUBST(HAVE_CLOCK_MONOTONIC)
753 AC_SUBST_LIST(REALTIME_LIBS)
758 ac_cv_func_res_ninit,
759 [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
760 dnl no need for res_ninit() on NetBSD and OpenBSD
761 ac_cv_func_res_ninit=no
765 #define _BSD_SOURCE 1
767 #include <sys/types.h>
768 #include <netinet/in.h>
769 #include <arpa/nameser.h>
772 [int foo = res_ninit(&_res);],
773 [ac_cv_func_res_ninit=yes],
774 [ac_cv_func_res_ninit=no])
778 if test "$ac_cv_func_res_ninit" = "yes"; then
779 AC_DEFINE(HAVE_RES_NINIT)
780 dnl must add the link line we do something as foolish as this... dougt
782 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
783 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
788 dnl ===================================================================
789 dnl ========================================================
790 dnl Put your C++ language/feature checks below
791 dnl ========================================================
795 if test "$GNU_CC"; then
796 if test "$CPU_ARCH" = "arm" ; then
797 AC_CACHE_CHECK(for ARM EABI,
801 #if defined(__ARM_EABI__)
807 ac_cv_gcc_arm_eabi="yes",
808 ac_cv_gcc_arm_eabi="no")])
809 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
817 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
820 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
821 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
822 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
824 _SAVE_LDFLAGS=$LDFLAGS
825 LDFLAGS="$LDFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
826 AC_CACHE_CHECK(for __thread keyword for TLS variables,
827 ac_cv_thread_keyword,
828 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
829 [return tlsIsMainThread;],
830 ac_cv_thread_keyword=yes,
831 ac_cv_thread_keyword=no)])
832 LDFLAGS=$_SAVE_LDFLAGS
833 # The custom dynamic linker doesn't support TLS variables
834 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
835 # mips builds fail with TLS variables because of a binutils bug.
837 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
842 *-android*|*-linuxandroid*)
849 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
854 if test -n "$MOZ_LINKER"; then
855 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
856 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
857 dnl Since the linker only understands the sysv ones, no need to build the
858 dnl gnu style tables anyways.
859 LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
862 dnl End of C++ language/feature checks
865 fi # ! SKIP_COMPILER_CHECKS
867 if test -n "${COMPILE_ENVIRONMENT}"; then
872 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
873 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
874 AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
877 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
878 dnl features that Windows actually does support.
880 if test -n "$SKIP_COMPILER_CHECKS"; then
881 dnl Windows has malloc.h
882 AC_DEFINE(MALLOC_H, [<malloc.h>])
883 AC_DEFINE(HAVE_FORCEINLINE)
884 fi # SKIP_COMPILER_CHECKS
886 dnl Mozilla specific options
887 dnl ========================================================
888 dnl The macros used for command line options
889 dnl are defined in build/autoconf/altoptions.m4.
891 dnl ========================================================
895 dnl ========================================================
897 MOZ_BRANDING_DIRECTORY=
898 MOZ_OFFICIAL_BRANDING=
900 MOZ_BINARY_EXTENSIONS=
903 dnl ========================================================
904 dnl = Trademarked Branding
905 dnl ========================================================
906 MOZ_ARG_ENABLE_BOOL(official-branding,
907 [ --enable-official-branding
908 Enable Official mozilla.org Branding
909 Do not distribute builds with
910 --enable-official-branding unless you have
911 permission to use trademarks per
912 http://www.mozilla.org/foundation/trademarks/ .],
913 MOZ_OFFICIAL_BRANDING=1,
914 MOZ_OFFICIAL_BRANDING=)
916 # Allow the application to influence configure with a confvars.sh script.
917 AC_MSG_CHECKING([if app-specific confvars.sh exists])
918 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
919 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
920 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
925 AC_SUBST(MOZ_OFFICIAL_BRANDING)
926 if test -n "$MOZ_OFFICIAL_BRANDING"; then
927 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
928 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
930 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
931 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
935 MOZ_ARG_WITH_STRING(branding,
936 [ --with-branding=dir Use branding from the specified directory.],
937 MOZ_BRANDING_DIRECTORY=$withval)
939 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
940 if test -z "$REAL_BRANDING_DIRECTORY"; then
941 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
944 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
945 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
948 AC_SUBST(MOZ_BRANDING_DIRECTORY)
950 dnl ========================================================
951 dnl = Distribution ID
952 dnl ========================================================
953 MOZ_ARG_WITH_STRING(distribution-id,
954 [ --with-distribution-id=ID
955 Set distribution-specific id (default=org.mozilla)],
956 [ val=`echo $withval`
957 MOZ_DISTRIBUTION_ID="$val"])
959 if test -z "$MOZ_DISTRIBUTION_ID"; then
960 MOZ_DISTRIBUTION_ID="org.mozilla"
963 AC_SUBST(MOZ_DISTRIBUTION_ID)
965 dnl ========================================================
966 dnl = Enable code optimization. ON by default.
967 dnl ========================================================
969 # Use value from moz.configure if one is defined. Else use our computed
971 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
972 MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
975 if test "$COMPILE_ENVIRONMENT"; then
976 if test -n "$MOZ_OPTIMIZE"; then
977 AC_MSG_CHECKING([for valid C compiler optimization flags])
979 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
980 AC_TRY_COMPILE([#include <stdio.h>],
981 [printf("Hello World\n");],
984 AC_MSG_RESULT([$_results])
985 if test "$_results" = "no"; then
986 AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
989 if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
990 # When using llvm-based LTO, non numeric optimization levels are
991 # not supported by the linker, so force the linker to use -O2 (
992 # which doesn't influence the level compilation units are actually
994 case " $MOZ_OPTIMIZE_FLAGS " in
996 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
1001 fi # COMPILE_ENVIRONMENT
1003 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
1004 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
1005 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
1007 case "${OS_TARGET}" in
1008 Android|WINNT|Darwin)
1009 MOZ_GLUE_IN_PROGRAM=
1012 dnl On !Android !Windows !OSX, we only want to link executables against mozglue
1013 MOZ_GLUE_IN_PROGRAM=1
1014 AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
1018 dnl ========================================================
1019 dnl = Jemalloc build setup
1020 dnl ========================================================
1021 if test -z "$MOZ_MEMORY"; then
1024 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
1025 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.])
1030 dnl The generic feature tests that determine how to compute ncpus are long and
1031 dnl complicated. Therefore, simply define special cpp variables for the
1032 dnl platforms we have special knowledge of.
1035 export MOZ_NO_DEBUG_RTL=1
1039 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
1041 dnl ========================================================
1042 dnl = Enable using the clang plugin to build
1043 dnl ========================================================
1045 if test -n "$COMPILE_ENVIRONMENT"; then
1046 MOZ_CONFIG_CLANG_PLUGIN
1047 fi # COMPILE_ENVIRONMENT
1049 if test -z "$SKIP_COMPILER_CHECKS"; then
1050 dnl ========================================================
1051 dnl Check for gcc -pipe support
1052 dnl ========================================================
1053 AC_MSG_CHECKING([for -pipe support])
1054 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
1055 dnl Any gcc that supports firefox supports -pipe.
1056 CFLAGS="$CFLAGS -pipe"
1057 CXXFLAGS="$CXXFLAGS -pipe"
1058 AC_MSG_RESULT([yes])
1063 fi # ! SKIP_COMPILER_CHECKS
1067 if test "$COMPILE_ENVIRONMENT"; then
1069 fi # COMPILE_ENVIRONMENT
1071 dnl ========================================================
1072 dnl Check if we need the 32-bit Linux SSE2 error dialog
1073 dnl ========================================================
1075 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
1077 dnl ========================================================
1079 dnl ========================================================
1081 if test "$OS_ARCH" = "WINNT"; then
1082 # For now we assume that we will have a uint64_t available through
1083 # one of the above headers or mozstdint.h.
1084 AC_DEFINE(HAVE_UINT64_T)
1087 case "$MOZ_WIDGET_TOOLKIT" in
1089 if test "$COMPILE_ENVIRONMENT"; then
1090 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
1094 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
1096 dnl ========================================================
1098 dnl = Maintainer debug option (no --enable equivalent)
1100 dnl ========================================================
1102 AC_SUBST_LIST(ASFLAGS)
1103 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
1105 AC_SUBST(MOZ_STUB_INSTALLER)
1107 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
1109 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
1111 if test -n "$MOZ_BINARY_EXTENSIONS"; then
1112 AC_DEFINE(MOZ_BINARY_EXTENSIONS)
1115 dnl ========================================================
1116 dnl = Mac bundle name prefix
1117 dnl ========================================================
1118 MOZ_ARG_WITH_STRING(macbundlename-prefix,
1119 [ --with-macbundlename-prefix=prefix
1120 Prefix for MOZ_MACBUNDLE_NAME],
1121 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
1123 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
1124 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
1125 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
1128 if test "$MOZ_DEBUG"; then
1129 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
1131 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
1133 AC_SUBST(MOZ_MACBUNDLE_NAME)
1135 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
1136 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
1137 # Otherwise, use MOZ_APP_DISPLAYNAME
1138 if test -z "$MOZ_MACBUNDLE_ID"; then
1139 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
1141 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
1142 if test "$MOZ_DEBUG"; then
1143 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
1146 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
1147 AC_SUBST(MOZ_MACBUNDLE_ID)
1149 dnl ========================================================
1150 dnl = Child Process Name for IPC
1151 dnl ========================================================
1152 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
1153 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
1155 # We want to let Android unpack the file at install time, but it only does
1156 # so if the file is named libsomething.so. The lib/ path is also required
1157 # because the unpacked file will be under the lib/ subdirectory and will
1158 # need to be executed from that path.
1159 MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
1161 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
1162 MOZ_CHILD_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.plugincontainer
1163 MOZ_CHILD_PROCESS_BUNDLENAME="plugin-container.app"
1164 MOZ_CHILD_PROCESS_APPNAME="${MOZ_APP_DISPLAYNAME}CP"
1166 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
1167 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
1168 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLEID)
1169 AC_SUBST(MOZ_CHILD_PROCESS_APPNAME)
1170 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
1172 dnl ==========================================================
1173 dnl = Mac Media Plugin Helper (GMP Child) Process Name for IPC
1174 dnl ==========================================================
1175 MOZ_EME_PROCESS_NAME="media-plugin-helper"
1176 MOZ_EME_PROCESS_NAME_BRANDED="$MOZ_APP_DISPLAYNAME Media Plugin Helper"
1177 MOZ_EME_PROCESS_BUNDLENAME="${MOZ_EME_PROCESS_NAME}.app"
1178 # Generate a lower case string with no spaces to be used as the bundle ID
1179 # for the EME helper .app of the form org.mozilla.<executable-name>.
1180 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_APP_DISPLAYNAME" | tr ' ' '-'`
1181 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_EME_PROCESS_BUNDLEID" | tr 'A-Z' 'a-z'`
1182 MOZ_EME_PROCESS_BUNDLEID=${MOZ_EME_PROCESS_BUNDLEID}-${MOZ_EME_PROCESS_NAME}
1183 MOZ_EME_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.${MOZ_EME_PROCESS_BUNDLEID}
1185 AC_SUBST(MOZ_EME_PROCESS_NAME)
1186 AC_SUBST(MOZ_EME_PROCESS_NAME_BRANDED)
1187 AC_SUBST(MOZ_EME_PROCESS_BUNDLENAME)
1188 AC_SUBST(MOZ_EME_PROCESS_BUNDLEID)
1190 # The following variables are available to branding and application
1191 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
1192 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
1193 # impacts profile location and user-visible fields.
1194 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
1195 # Mac Bundle name, Updater, Installer), it is typically used for nightly
1196 # builds (e.g. Aurora for Firefox).
1197 # - MOZ_APP_PROFILE: When set, used for application.ini's
1198 # "Profile" field, which controls profile location.
1199 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
1200 # crash reporter server url.
1201 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
1203 # The following environment variables used to have an effect, but don't anymore:
1204 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
1205 # the contents from the version.txt file in the application directory, or
1206 # browser/config/version.txt if there isn't one.
1207 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
1208 # in the "About" window. This was replaced with the contents from the
1209 # version_display.txt or version.txt in the application directory, or
1210 # browser/config/version_display.txt.
1212 # For extensions and langpacks, we require a max version that is compatible
1213 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
1214 # 24.0a1 and 24.0a2 aren't affected
1216 # 24.1.1 becomes 24.*
1217 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
1218 if test -z "$IS_ALPHA"; then
1220 if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
1221 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
1223 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
1227 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
1230 AC_SUBST(MOZ_APP_DISPLAYNAME)
1231 AC_SUBST(MOZ_APP_VENDOR)
1232 AC_SUBST(MOZ_APP_PROFILE)
1233 AC_SUBST(MOZ_APP_ID)
1234 AC_SUBST(MAR_CHANNEL_ID)
1235 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
1236 AC_SUBST(MOZ_PROFILE_MIGRATOR)
1237 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
1238 AC_SUBST(MOZ_APP_UA_NAME)
1239 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
1240 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
1241 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
1243 AC_SUBST(MOZ_APP_MAXVERSION)
1244 AC_SUBST(MOZ_PKG_SPECIAL)
1245 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
1247 if test "$MOZILLA_OFFICIAL"; then
1248 # Build revisions should always be present in official builds
1249 MOZ_INCLUDE_SOURCE_INFO=1
1252 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
1253 # explicitly set the repository and changeset information in.
1254 AC_SUBST(MOZ_SOURCE_REPO)
1255 AC_SUBST(MOZ_SOURCE_CHANGESET)
1256 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
1259 AC_SUBST(WIN32_REDIST_DIR)
1261 dnl Echo the CFLAGS to remove extra whitespace.
1263 $_COMPILATION_CFLAGS \
1267 $_COMPILATION_CXXFLAGS \
1270 COMPILE_CFLAGS=`echo \
1274 COMPILE_CXXFLAGS=`echo \
1275 $_DEFINES_CXXFLAGS \
1279 $_COMPILATION_HOST_CFLAGS \
1282 HOST_CXXFLAGS=`echo \
1283 $_COMPILATION_HOST_CXXFLAGS \
1286 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
1287 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1288 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
1289 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1290 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
1291 OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1292 OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1294 AC_SUBST(HOST_CMFLAGS)
1295 AC_SUBST(HOST_CMMFLAGS)
1296 AC_SUBST(OS_COMPILE_CMFLAGS)
1297 AC_SUBST(OS_COMPILE_CMMFLAGS)
1300 OS_CXXFLAGS="$CXXFLAGS"
1301 OS_CPPFLAGS="$CPPFLAGS"
1302 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
1303 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
1304 OS_LDFLAGS="$LDFLAGS"
1306 AC_SUBST_LIST(OS_CFLAGS)
1307 AC_SUBST_LIST(OS_CXXFLAGS)
1308 AC_SUBST_LIST(OS_CPPFLAGS)
1309 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
1310 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
1311 AC_SUBST_LIST(OS_LDFLAGS)
1316 AC_SUBST_LIST(HOST_CFLAGS)
1317 AC_SUBST_LIST(HOST_CPPFLAGS)
1318 AC_SUBST_LIST(HOST_CXXFLAGS)
1319 AC_SUBST(HOST_LDFLAGS)
1320 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
1321 AC_SUBST(HOST_BIN_SUFFIX)
1323 AC_SUBST(TARGET_XPCOM_ABI)
1325 AC_SUBST(DSO_LDOPTS)
1326 AC_SUBST(BIN_SUFFIX)
1328 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
1329 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
1331 AC_SUBST(MOZ_DEVTOOLS)
1333 AC_SUBST(MOZ_PACKAGE_JSSHELL)
1337 dnl Host JavaScript runtime, if any, to use during cross compiles.
1340 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
1342 dnl Set various defines and substitutions
1343 dnl ========================================================
1345 AC_SUBST(MOZ_DEV_EDITION)
1346 if test -n "$MOZ_DEV_EDITION"; then
1347 AC_DEFINE(MOZ_DEV_EDITION)
1350 dnl Spit out some output
1351 dnl ========================================================
1353 # Avoid using obsolete NSPR features
1354 AC_DEFINE(NO_NSPR_10_SUPPORT)
1356 MOZ_CREATE_CONFIG_STATUS()
1358 rm -fr confdefs* $ac_clean_files