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 MOZ_OPTIMIZE_FLAGS="-O2"
395 if test -z "$CLANG_CC"; then
396 MOZ_OPTIMIZE_FLAGS="-freorder-blocks $MOZ_OPTIMIZE_FLAGS"
400 case "${target_cpu}" in
402 CFLAGS="$CFLAGS -mieee"
403 CXXFLAGS="$CXXFLAGS -mieee"
409 # certain versions of cygwin's makedepend barf on the
410 # #include <string> vs -I./dist/include/string issue so don't use it
411 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
412 # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
413 if test -z "$CLANG_CC"; then
414 AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
420 MOZ_OPTIMIZE_FLAGS="-O2"
422 WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
423 WIN32_GUI_EXE_LDFLAGS=-mwindows
425 # Silence problematic clang warnings
426 CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
427 LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
429 TARGET_COMPILER_ABI=msvc
430 WIN32_SUBSYSTEM_VERSION=10.0
431 WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
432 WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
433 DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
434 _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
435 _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
436 CFLAGS="$CFLAGS -Gy -Zc:inline"
437 CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
438 if test "$CPU_ARCH" = "x86"; then
439 dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
440 dnl more recent, so set that explicitly here unless another
441 dnl target arch has already been set.
443 if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
444 CFLAGS="$CFLAGS -arch:SSE2"
446 if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
447 CXXFLAGS="$CXXFLAGS -arch:SSE2"
451 dnl VS2013+ supports -Gw for better linker optimizations.
452 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
453 dnl Disabled on ASan because it causes false-positive ODR violations.
454 if test -z "$MOZ_ASAN"; then
456 CXXFLAGS="$CXXFLAGS -Gw"
458 # String tail merging doesn't play nice with ASan's ODR checker.
459 LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
461 # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
462 CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
463 MOZ_DEBUG_LDFLAGS='-DEBUG'
464 if test "$HOST_OS_ARCH" != "WINNT"; then
465 # %_PDB% is a special signal to emit only the PDB basename. This
466 # avoids problems in Windows tools that don't like forward-slashes.
467 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -PDBALTPATH:%_PDB%"
469 MOZ_OPTIMIZE_FLAGS='-O2'
471 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
473 AC_DEFINE(WIN32_LEAN_AND_MEAN)
474 dnl See http://support.microsoft.com/kb/143208 to use STL
480 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.])
486 if test -n "$GNU_CC"; then
487 CFLAGS="$CFLAGS -mstackrealign"
488 CXXFLAGS="$CXXFLAGS -mstackrealign"
489 LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
491 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
492 LDFLAGS="$LDFLAGS -SAFESEH"
498 if test -n "$_WIN32_MSVC"; then
499 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
504 if test -n "$_WIN32_MSVC"; then
505 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
510 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
516 CFLAGS="$CFLAGS -Dunix"
517 CXXFLAGS="$CXXFLAGS -Dunix"
518 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
519 DSO_PIC_CFLAGS='-fPIC -DPIC'
521 MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
523 DSO_PIC_CFLAGS='-fPIC -DPIC'
526 # This will fail on a.out systems prior to 1.5.1_ALPHA.
527 if test "$LIBRUNPATH"; then
528 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
533 if test -z "$X11BASE"; then
536 MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
537 DSO_PIC_CFLAGS='-fPIC'
538 DSO_LDOPTS='-shared -fPIC'
539 if test "$LIBRUNPATH"; then
540 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
545 MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
550 CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
551 CXXFLAGS="$CXXFLAGS $DSO_PIC_CFLAGS"
553 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
554 MOZ_OPTIMIZE_FLAGS="-O"
558 if test -z "$COMPILE_ENVIRONMENT"; then
559 SKIP_COMPILER_CHECKS=1
560 SKIP_LIBRARY_CHECKS=1
564 fi # COMPILE_ENVIRONMENT
566 if test -z "$SKIP_COMPILER_CHECKS"; then
567 dnl Checks for typedefs, structures, and compiler characteristics.
568 dnl ========================================================
583 dnl Checks for header files.
584 dnl ========================================================
587 dnl Checks for libraries.
588 dnl ========================================================
589 AC_CHECK_LIB(c_r, gethostbyname_r)
591 dnl We don't want to link with libdl even if it's present on OS X, since
592 dnl it's not used and not part of the default installation. OS/2 has dlfcn
594 dnl We don't want to link against libm or libpthread on Darwin since
595 dnl they both are just symlinks to libSystem and explicitly linking
596 dnl against libSystem causes issues when debugging (see bug 299601).
601 AC_SEARCH_LIBS(dlopen, dl,
602 MOZ_CHECK_HEADER(dlfcn.h,
603 AC_DEFINE(HAVE_DLOPEN)))
607 _SAVE_CFLAGS="$CFLAGS"
608 CFLAGS="$CFLAGS -D_GNU_SOURCE"
609 AC_CHECK_FUNCS(dladdr)
610 CFLAGS="$_SAVE_CFLAGS"
612 if test ! "$GNU_CXX"; then
613 AC_CHECK_LIB(C, demangle)
616 AC_CHECK_LIB(socket, socket)
618 dnl ========================================================
619 dnl = pthread support
620 dnl = Start by checking whether the system support pthreads
621 dnl ========================================================
627 AC_CHECK_LIB(pthreads, pthread_create,
628 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
629 AC_CHECK_LIB(pthread, pthread_create,
630 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
631 AC_CHECK_LIB(c_r, pthread_create,
632 MOZ_USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
633 AC_CHECK_LIB(c, pthread_create,
642 dnl ========================================================
643 dnl Do the platform specific pthread hackery
644 dnl ========================================================
645 if test "$MOZ_USE_PTHREADS"x != x
648 dnl See if -pthread is supported.
651 ac_cv_have_dash_pthread=no
652 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
653 echo 'int main() { return 0; }' | cat > conftest.c
654 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
655 if test $? -eq 0; then
656 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
657 ac_cv_have_dash_pthread=yes
660 # Freebsd doesn't use -pthread for compiles, it uses them for linking
663 CFLAGS="$CFLAGS -pthread"
664 CXXFLAGS="$CXXFLAGS -pthread"
670 AC_MSG_RESULT($ac_cv_have_dash_pthread)
673 dnl See if -pthreads is supported.
675 ac_cv_have_dash_pthreads=no
676 if test "$ac_cv_have_dash_pthread" = "no"; then
677 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
678 echo 'int main() { return 0; }' | cat > conftest.c
679 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
680 if test $? -eq 0; then
681 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
682 ac_cv_have_dash_pthreads=yes
683 CFLAGS="$CFLAGS -pthreads"
684 CXXFLAGS="$CXXFLAGS -pthreads"
688 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
693 AC_DEFINE(_REENTRANT)
694 AC_DEFINE(_THREAD_SAFE)
695 dnl -pthread links in -lpthread, so don't specify it explicitly.
696 if test "$ac_cv_have_dash_pthread" = "yes"; then
697 _PTHREAD_LDFLAGS="-pthread"
701 *-*-openbsd*|*-*-bsdi*)
702 AC_DEFINE(_REENTRANT)
703 AC_DEFINE(_THREAD_SAFE)
704 dnl -pthread links in -lc_r, so don't specify it explicitly.
705 if test "$ac_cv_have_dash_pthread" = "yes"; then
706 _PTHREAD_LDFLAGS="-pthread"
710 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
711 AC_DEFINE(_REENTRANT)
715 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
716 AC_SUBST(MOZ_USE_PTHREADS)
717 MOZ_CHECK_HEADERS(pthread.h)
721 dnl Checks for library functions.
722 dnl ========================================================
724 dnl check for clock_gettime(), the CLOCK_MONOTONIC clock
725 AC_CACHE_CHECK(for clock_gettime(CLOCK_MONOTONIC),
726 ac_cv_clock_monotonic,
727 [for libs in "" -lrt; do
730 dnl clock_gettime is available on OSX since 10.12, so depending on MACOSX_DEPLOYMENT_TARGET,
731 dnl we should or not be able to use it. To detect if we can, we need to make the
732 dnl availability attribute strict, so that compilation fails when the target is < 10.12.
733 AC_TRY_LINK([#define availability(os, ...) availability(os, strict, __VA_ARGS)
735 [ struct timespec ts;
736 clock_gettime(CLOCK_MONOTONIC, &ts); ],
737 ac_cv_clock_monotonic=$libs
740 ac_cv_clock_monotonic=no)
743 if test "$ac_cv_clock_monotonic" != "no"; then
744 HAVE_CLOCK_MONOTONIC=1
745 REALTIME_LIBS=$ac_cv_clock_monotonic
746 AC_DEFINE(HAVE_CLOCK_MONOTONIC)
747 AC_SUBST(HAVE_CLOCK_MONOTONIC)
748 AC_SUBST_LIST(REALTIME_LIBS)
753 ac_cv_func_res_ninit,
754 [if test "$OS_TARGET" = NetBSD -o "$OS_TARGET" = OpenBSD; then
755 dnl no need for res_ninit() on NetBSD and OpenBSD
756 ac_cv_func_res_ninit=no
760 #define _BSD_SOURCE 1
762 #include <sys/types.h>
763 #include <netinet/in.h>
764 #include <arpa/nameser.h>
767 [int foo = res_ninit(&_res);],
768 [ac_cv_func_res_ninit=yes],
769 [ac_cv_func_res_ninit=no])
773 if test "$ac_cv_func_res_ninit" = "yes"; then
774 AC_DEFINE(HAVE_RES_NINIT)
775 dnl must add the link line we do something as foolish as this... dougt
777 dnl AC_CHECK_LIB(bind, res_ninit, AC_DEFINE(HAVE_RES_NINIT),
778 dnl AC_CHECK_LIB(resolv, res_ninit, AC_DEFINE(HAVE_RES_NINIT)))
783 dnl ===================================================================
784 dnl ========================================================
785 dnl Put your C++ language/feature checks below
786 dnl ========================================================
790 if test "$GNU_CC"; then
791 if test "$CPU_ARCH" = "arm" ; then
792 AC_CACHE_CHECK(for ARM EABI,
796 #if defined(__ARM_EABI__)
802 ac_cv_gcc_arm_eabi="yes",
803 ac_cv_gcc_arm_eabi="no")])
804 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
812 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
815 # try harder, when checking for __thread support, see bug 521750 comment #33 and below
816 # We pass MOZ_OPTIMIZE_LDFLAGS to the linker because if dead_strip is
817 # enabled, the linker in xcode 4.1 will crash. Without this it would crash when
819 _SAVE_LDFLAGS=$LDFLAGS
820 LDFLAGS="$LDFLAGS $DSO_LDOPTS $MOZ_OPTIMIZE_LDFLAGS"
821 AC_CACHE_CHECK(for __thread keyword for TLS variables,
822 ac_cv_thread_keyword,
823 [AC_TRY_LINK([__thread bool tlsIsMainThread = false;],
824 [return tlsIsMainThread;],
825 ac_cv_thread_keyword=yes,
826 ac_cv_thread_keyword=no)])
827 LDFLAGS=$_SAVE_LDFLAGS
828 # The custom dynamic linker doesn't support TLS variables
829 if test "$ac_cv_thread_keyword" = yes -a "$MOZ_LINKER" != 1; then
830 # mips builds fail with TLS variables because of a binutils bug.
832 # OpenBSD doesn't have TLS support, and the test succeeds with clang++
837 *-android*|*-linuxandroid*)
844 AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
849 if test -n "$MOZ_LINKER"; then
850 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
851 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
852 dnl Since the linker only understands the sysv ones, no need to build the
853 dnl gnu style tables anyways.
854 LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
857 dnl End of C++ language/feature checks
860 fi # ! SKIP_COMPILER_CHECKS
862 if test -n "${COMPILE_ENVIRONMENT}"; then
867 if test -n "${CPU_ARCH}" -a -n "${TARGET_COMPILER_ABI}"; then
868 TARGET_XPCOM_ABI="${CPU_ARCH}-${TARGET_COMPILER_ABI}"
869 AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
872 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
873 dnl features that Windows actually does support.
875 if test -n "$SKIP_COMPILER_CHECKS"; then
876 dnl Windows has malloc.h
877 AC_DEFINE(MALLOC_H, [<malloc.h>])
878 AC_DEFINE(HAVE_FORCEINLINE)
879 fi # SKIP_COMPILER_CHECKS
881 dnl Mozilla specific options
882 dnl ========================================================
883 dnl The macros used for command line options
884 dnl are defined in build/autoconf/altoptions.m4.
886 dnl ========================================================
890 dnl ========================================================
892 MOZ_BRANDING_DIRECTORY=
893 MOZ_OFFICIAL_BRANDING=
895 MOZ_BINARY_EXTENSIONS=
898 dnl ========================================================
899 dnl = Trademarked Branding
900 dnl ========================================================
901 MOZ_ARG_ENABLE_BOOL(official-branding,
902 [ --enable-official-branding
903 Enable Official mozilla.org Branding
904 Do not distribute builds with
905 --enable-official-branding unless you have
906 permission to use trademarks per
907 http://www.mozilla.org/foundation/trademarks/ .],
908 MOZ_OFFICIAL_BRANDING=1,
909 MOZ_OFFICIAL_BRANDING=)
911 # Allow the application to influence configure with a confvars.sh script.
912 AC_MSG_CHECKING([if app-specific confvars.sh exists])
913 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
914 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
915 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
920 AC_SUBST(MOZ_OFFICIAL_BRANDING)
921 if test -n "$MOZ_OFFICIAL_BRANDING"; then
922 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
923 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
925 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
926 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
930 MOZ_ARG_WITH_STRING(branding,
931 [ --with-branding=dir Use branding from the specified directory.],
932 MOZ_BRANDING_DIRECTORY=$withval)
934 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
935 if test -z "$REAL_BRANDING_DIRECTORY"; then
936 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
939 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
940 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
943 AC_SUBST(MOZ_BRANDING_DIRECTORY)
945 dnl ========================================================
946 dnl = Distribution ID
947 dnl ========================================================
948 MOZ_ARG_WITH_STRING(distribution-id,
949 [ --with-distribution-id=ID
950 Set distribution-specific id (default=org.mozilla)],
951 [ val=`echo $withval`
952 MOZ_DISTRIBUTION_ID="$val"])
954 if test -z "$MOZ_DISTRIBUTION_ID"; then
955 MOZ_DISTRIBUTION_ID="org.mozilla"
958 AC_SUBST(MOZ_DISTRIBUTION_ID)
960 dnl ========================================================
961 dnl = Enable code optimization. ON by default.
962 dnl ========================================================
964 # Use value from moz.configure if one is defined. Else use our computed
966 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
967 MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
970 if test "$COMPILE_ENVIRONMENT"; then
971 if test -n "$MOZ_OPTIMIZE"; then
972 AC_MSG_CHECKING([for valid C compiler optimization flags])
974 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
975 AC_TRY_COMPILE([#include <stdio.h>],
976 [printf("Hello World\n");],
979 AC_MSG_RESULT([$_results])
980 if test "$_results" = "no"; then
981 AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
984 if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
985 # When using llvm-based LTO, non numeric optimization levels are
986 # not supported by the linker, so force the linker to use -O2 (
987 # which doesn't influence the level compilation units are actually
989 case " $MOZ_OPTIMIZE_FLAGS " in
991 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
996 fi # COMPILE_ENVIRONMENT
998 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
999 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
1000 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
1002 case "${OS_TARGET}" in
1003 Android|WINNT|Darwin)
1004 MOZ_GLUE_IN_PROGRAM=
1007 dnl On !Android !Windows !OSX, we only want to link executables against mozglue
1008 MOZ_GLUE_IN_PROGRAM=1
1009 AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
1013 dnl ========================================================
1014 dnl = Jemalloc build setup
1015 dnl ========================================================
1016 if test -z "$MOZ_MEMORY"; then
1019 if test -z "$WIN32_REDIST_DIR" -a -z "$MOZ_DEBUG"; then
1020 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.])
1025 dnl The generic feature tests that determine how to compute ncpus are long and
1026 dnl complicated. Therefore, simply define special cpp variables for the
1027 dnl platforms we have special knowledge of.
1030 export MOZ_NO_DEBUG_RTL=1
1034 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
1036 dnl ========================================================
1037 dnl = Enable using the clang plugin to build
1038 dnl ========================================================
1040 if test -n "$COMPILE_ENVIRONMENT"; then
1041 MOZ_CONFIG_CLANG_PLUGIN
1042 fi # COMPILE_ENVIRONMENT
1044 if test -z "$SKIP_COMPILER_CHECKS"; then
1045 dnl ========================================================
1046 dnl Check for gcc -pipe support
1047 dnl ========================================================
1048 AC_MSG_CHECKING([for -pipe support])
1049 if test -n "$GNU_CC" -a -n "$GNU_CXX"; then
1050 dnl Any gcc that supports firefox supports -pipe.
1051 CFLAGS="$CFLAGS -pipe"
1052 CXXFLAGS="$CXXFLAGS -pipe"
1053 AC_MSG_RESULT([yes])
1058 fi # ! SKIP_COMPILER_CHECKS
1062 if test "$COMPILE_ENVIRONMENT"; then
1064 fi # COMPILE_ENVIRONMENT
1066 dnl ========================================================
1067 dnl Check if we need the 32-bit Linux SSE2 error dialog
1068 dnl ========================================================
1070 AC_SUBST(MOZ_LINUX_32_SSE2_STARTUP_ERROR)
1072 dnl ========================================================
1074 dnl ========================================================
1076 if test "$OS_ARCH" = "WINNT"; then
1077 # For now we assume that we will have a uint64_t available through
1078 # one of the above headers or mozstdint.h.
1079 AC_DEFINE(HAVE_UINT64_T)
1082 case "$MOZ_WIDGET_TOOLKIT" in
1084 if test "$COMPILE_ENVIRONMENT"; then
1085 MOZ_CHECK_HEADER(d3d10.h, MOZ_ENABLE_D3D10_LAYER=1)
1089 AC_SUBST(MOZ_ENABLE_D3D10_LAYER)
1091 dnl ========================================================
1093 dnl = Maintainer debug option (no --enable equivalent)
1095 dnl ========================================================
1097 AC_SUBST_LIST(ASFLAGS)
1098 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
1100 AC_SUBST(MOZ_STUB_INSTALLER)
1102 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
1104 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
1106 if test -n "$MOZ_BINARY_EXTENSIONS"; then
1107 AC_DEFINE(MOZ_BINARY_EXTENSIONS)
1110 dnl ========================================================
1111 dnl = Mac bundle name prefix
1112 dnl ========================================================
1113 MOZ_ARG_WITH_STRING(macbundlename-prefix,
1114 [ --with-macbundlename-prefix=prefix
1115 Prefix for MOZ_MACBUNDLE_NAME],
1116 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
1118 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
1119 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
1120 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
1123 if test "$MOZ_DEBUG"; then
1124 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
1126 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
1128 AC_SUBST(MOZ_MACBUNDLE_NAME)
1130 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
1131 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
1132 # Otherwise, use MOZ_APP_DISPLAYNAME
1133 if test -z "$MOZ_MACBUNDLE_ID"; then
1134 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
1136 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
1137 if test "$MOZ_DEBUG"; then
1138 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
1141 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
1142 AC_SUBST(MOZ_MACBUNDLE_ID)
1144 dnl ========================================================
1145 dnl = Child Process Name for IPC
1146 dnl ========================================================
1147 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
1148 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
1150 # We want to let Android unpack the file at install time, but it only does
1151 # so if the file is named libsomething.so. The lib/ path is also required
1152 # because the unpacked file will be under the lib/ subdirectory and will
1153 # need to be executed from that path.
1154 MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
1156 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
1157 MOZ_CHILD_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.plugincontainer
1158 MOZ_CHILD_PROCESS_BUNDLENAME="plugin-container.app"
1159 MOZ_CHILD_PROCESS_APPNAME="${MOZ_APP_DISPLAYNAME}CP"
1161 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
1162 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
1163 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLEID)
1164 AC_SUBST(MOZ_CHILD_PROCESS_APPNAME)
1165 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
1167 dnl ==========================================================
1168 dnl = Mac Media Plugin Helper (GMP Child) Process Name for IPC
1169 dnl ==========================================================
1170 MOZ_EME_PROCESS_NAME="media-plugin-helper"
1171 MOZ_EME_PROCESS_NAME_BRANDED="$MOZ_APP_DISPLAYNAME Media Plugin Helper"
1172 MOZ_EME_PROCESS_BUNDLENAME="${MOZ_EME_PROCESS_NAME}.app"
1173 # Generate a lower case string with no spaces to be used as the bundle ID
1174 # for the EME helper .app of the form org.mozilla.<executable-name>.
1175 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_APP_DISPLAYNAME" | tr ' ' '-'`
1176 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_EME_PROCESS_BUNDLEID" | tr 'A-Z' 'a-z'`
1177 MOZ_EME_PROCESS_BUNDLEID=${MOZ_EME_PROCESS_BUNDLEID}-${MOZ_EME_PROCESS_NAME}
1178 MOZ_EME_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.${MOZ_EME_PROCESS_BUNDLEID}
1180 AC_SUBST(MOZ_EME_PROCESS_NAME)
1181 AC_SUBST(MOZ_EME_PROCESS_NAME_BRANDED)
1182 AC_SUBST(MOZ_EME_PROCESS_BUNDLENAME)
1183 AC_SUBST(MOZ_EME_PROCESS_BUNDLEID)
1185 # The following variables are available to branding and application
1186 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
1187 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
1188 # impacts profile location and user-visible fields.
1189 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
1190 # Mac Bundle name, Updater, Installer), it is typically used for nightly
1191 # builds (e.g. Aurora for Firefox).
1192 # - MOZ_APP_PROFILE: When set, used for application.ini's
1193 # "Profile" field, which controls profile location.
1194 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
1195 # crash reporter server url.
1196 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
1198 # The following environment variables used to have an effect, but don't anymore:
1199 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
1200 # the contents from the version.txt file in the application directory, or
1201 # browser/config/version.txt if there isn't one.
1202 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
1203 # in the "About" window. This was replaced with the contents from the
1204 # version_display.txt or version.txt in the application directory, or
1205 # browser/config/version_display.txt.
1207 # For extensions and langpacks, we require a max version that is compatible
1208 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
1209 # 24.0a1 and 24.0a2 aren't affected
1211 # 24.1.1 becomes 24.*
1212 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
1213 if test -z "$IS_ALPHA"; then
1215 if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
1216 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
1218 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
1222 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
1225 AC_SUBST(MOZ_APP_DISPLAYNAME)
1226 AC_SUBST(MOZ_APP_VENDOR)
1227 AC_SUBST(MOZ_APP_PROFILE)
1228 AC_SUBST(MOZ_APP_ID)
1229 AC_SUBST(MAR_CHANNEL_ID)
1230 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
1231 AC_SUBST(MOZ_PROFILE_MIGRATOR)
1232 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
1233 AC_SUBST(MOZ_APP_UA_NAME)
1234 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
1235 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
1236 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
1238 AC_SUBST(MOZ_APP_MAXVERSION)
1239 AC_SUBST(MOZ_PKG_SPECIAL)
1240 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
1242 if test "$MOZILLA_OFFICIAL"; then
1243 # Build revisions should always be present in official builds
1244 MOZ_INCLUDE_SOURCE_INFO=1
1247 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
1248 # explicitly set the repository and changeset information in.
1249 AC_SUBST(MOZ_SOURCE_REPO)
1250 AC_SUBST(MOZ_SOURCE_CHANGESET)
1251 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
1254 AC_SUBST(WIN32_REDIST_DIR)
1256 dnl Echo the CFLAGS to remove extra whitespace.
1258 $_COMPILATION_CFLAGS \
1262 $_COMPILATION_CXXFLAGS \
1265 COMPILE_CFLAGS=`echo \
1269 COMPILE_CXXFLAGS=`echo \
1270 $_DEFINES_CXXFLAGS \
1274 $_COMPILATION_HOST_CFLAGS \
1277 HOST_CXXFLAGS=`echo \
1278 $_COMPILATION_HOST_CXXFLAGS \
1281 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
1282 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1283 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
1284 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
1285 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
1286 OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1287 OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
1289 AC_SUBST(HOST_CMFLAGS)
1290 AC_SUBST(HOST_CMMFLAGS)
1291 AC_SUBST(OS_COMPILE_CMFLAGS)
1292 AC_SUBST(OS_COMPILE_CMMFLAGS)
1295 OS_CXXFLAGS="$CXXFLAGS"
1296 OS_CPPFLAGS="$CPPFLAGS"
1297 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
1298 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
1299 OS_LDFLAGS="$LDFLAGS"
1301 AC_SUBST_LIST(OS_CFLAGS)
1302 AC_SUBST_LIST(OS_CXXFLAGS)
1303 AC_SUBST_LIST(OS_CPPFLAGS)
1304 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
1305 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
1306 AC_SUBST_LIST(OS_LDFLAGS)
1311 AC_SUBST_LIST(HOST_CFLAGS)
1312 AC_SUBST_LIST(HOST_CPPFLAGS)
1313 AC_SUBST_LIST(HOST_CXXFLAGS)
1314 AC_SUBST(HOST_LDFLAGS)
1315 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
1316 AC_SUBST(HOST_BIN_SUFFIX)
1318 AC_SUBST(TARGET_XPCOM_ABI)
1320 AC_SUBST(DSO_LDOPTS)
1321 AC_SUBST(BIN_SUFFIX)
1323 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
1324 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
1326 AC_SUBST(MOZ_DEVTOOLS)
1328 AC_SUBST(MOZ_PACKAGE_JSSHELL)
1332 dnl Host JavaScript runtime, if any, to use during cross compiles.
1335 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
1337 dnl Set various defines and substitutions
1338 dnl ========================================================
1340 AC_SUBST(MOZ_DEV_EDITION)
1341 if test -n "$MOZ_DEV_EDITION"; then
1342 AC_DEFINE(MOZ_DEV_EDITION)
1345 dnl Spit out some output
1346 dnl ========================================================
1348 # Avoid using obsolete NSPR features
1349 AC_DEFINE(NO_NSPR_10_SUPPORT)
1351 MOZ_CREATE_CONFIG_STATUS()
1353 rm -fr confdefs* $ac_clean_files