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 ========================================================
34 LDFLAGS="$LDFLAGS $LINKER_LDFLAGS $PACK_REL_RELOC_FLAGS"
35 HOST_LDFLAGS="$HOST_LDFLAGS $HOST_LINKER_LDFLAGS"
37 if test "$COMPILE_ENVIRONMENT"; then
39 fi # COMPILE_ENVIRONMENT
41 dnl ========================================================
42 dnl Checks for compilers.
43 dnl ========================================================
45 if test "$COMPILE_ENVIRONMENT"; then
47 # This prevents mingw from adding .exe when generating executable. Internal use
51 if test "$target" != "$host"; then
57 # Work around the conftest.exe access problem on Windows
65 dnl ========================================================
66 dnl Special win32 checks
67 dnl ========================================================
73 if test "$GCC" != "yes"; then
74 # Check to see if we are really running in a msvc environemnt
77 # Make sure compilers are valid
78 CXXFLAGS="$CXXFLAGS -TP"
81 AC_TRY_COMPILE([#include <stdio.h>],
82 [ printf("Hello World\n"); ],,
83 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
86 AC_TRY_COMPILE([#include <new.h>],
87 [ unsigned *test = new unsigned(42); ],,
88 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
91 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
92 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
94 MSVC_C_RUNTIME_DLL=vcruntime140.dll
95 if test "$TARGET_CPU" != "x86"; then
96 MSVC_C_RUNTIME_1_DLL=vcruntime140_1.dll
98 MSVC_CXX_RUNTIME_DLL=msvcp140.dll
100 # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
101 CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
103 AC_SUBST(MSVC_C_RUNTIME_DLL)
104 AC_SUBST(MSVC_C_RUNTIME_1_DLL)
105 AC_SUBST(MSVC_CXX_RUNTIME_DLL)
107 AC_DEFINE(HAVE_SEH_EXCEPTIONS)
109 # Check w32api version
110 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
111 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
112 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
113 AC_TRY_COMPILE([#include <w32api.h>],
114 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
115 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
116 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
117 #error "test failed."
119 , [ res=yes ], [ res=no ])
120 AC_MSG_RESULT([$res])
121 if test "$res" != "yes"; then
122 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
124 # strsafe.h on mingw uses macros for function deprecation that pollutes namespace
125 # causing problems with local implementations with the same name.
126 AC_DEFINE(STRSAFE_NO_DEPRECATE)
129 AC_DEFINE(_USE_MATH_DEFINES) # Otherwise Windows' math.h doesn't #define M_PI.
131 CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
132 CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
134 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
135 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
136 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0A00)
141 if test -n "$_WIN32_MSVC"; then
143 SKIP_COMPILER_CHECKS=1
144 SKIP_LIBRARY_CHECKS=1
146 # Since we're skipping compiler and library checks, hard-code
149 AC_DEFINE(HAVE_ISATTY)
152 fi # COMPILE_ENVIRONMENT
157 dnl ========================================================
158 dnl set the defaults first
159 dnl ========================================================
160 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
162 dnl Configure platform-specific CPU architecture compiler options.
163 dnl ==============================================================
164 if test "$COMPILE_ENVIRONMENT"; then
166 fi # COMPILE_ENVIRONMENT
168 if test -n "$COMPILE_ENVIRONMENT"; then
172 dnl ========================================================
173 dnl GNU specific defaults
174 dnl ========================================================
175 if test "$GNU_CC"; then
176 if test "$OS_ARCH" != "WINNT" -o -z "$CLANG_CC"; then
177 DSO_PIC_CFLAGS='-fPIC'
178 ASFLAGS="$ASFLAGS -fPIC"
182 if test "$GCC_USE_GNU_LD"; then
183 # Some tools like ASan use a runtime library that is only
184 # linked against executables, so we must allow undefined
185 # symbols for shared objects in some cases.
186 if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
187 # Don't allow undefined symbols in libraries
188 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
190 # BSDs need `environ' exposed for posix_spawn (bug 753046)
192 DragonFly|FreeBSD|NetBSD|OpenBSD)
193 if test "$HAVE_LINKER_SUPPORT_IGNORE_UNRESOLVED" = 1; then
194 DSO_LDOPTS="$DSO_LDOPTS -Wl,--ignore-unresolved-symbol,environ"
196 DSO_LDOPTS="$DSO_LDOPTS -Wl,--warn-unresolved-symbols"
203 _DEFINES_CFLAGS="-include $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
205 ASFLAGS="$ASFLAGS $_DEFINES_CFLAGS"
208 if test "$GNU_CXX"; then
209 CXXFLAGS="$CXXFLAGS -fno-exceptions"
211 _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $_objdir/mozilla-config.h"
214 dnl ========================================================
215 dnl System overrides of the defaults for host
216 dnl ========================================================
219 if test "$HOST_CC_TYPE" = clang-cl; then
220 HOST_CFLAGS="$HOST_CFLAGS"
222 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
224 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
225 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
228 case "${host_cpu}" in
230 if test "$HOST_CC_TYPE" = clang-cl; then
231 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
235 if test "$HOST_CC_TYPE" = clang-cl; then
236 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
238 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
244 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
245 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
248 *-linux*|*-kfreebsd*-gnu|*-gnu*)
249 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
250 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
254 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
255 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
259 dnl ========================================================
260 dnl System overrides of the defaults for target
261 dnl ========================================================
263 MOZ_OPTIMIZE_LDFLAGS="${_COMPILATION_OPTIMIZE_LDFLAGS} ${MOZ_OPTIMIZE_FLAGS}"
267 MOZ_OPTIMIZE_FLAGS="-O3"
272 *-android*|*-linuxandroid*)
273 MOZ_OPTIMIZE_FLAGS="-O2"
277 if test "$GNU_CC" -o "$GNU_CXX"; then
278 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
279 MOZ_OPTIMIZE_FLAGS="-O2"
282 case "${target_cpu}" in
284 CFLAGS="$CFLAGS -mieee"
285 CXXFLAGS="$CXXFLAGS -mieee"
291 # certain versions of cygwin's makedepend barf on the
292 # #include <string> vs -I./dist/include/string issue so don't use it
293 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
294 # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
295 if test -z "$CLANG_CC"; then
296 AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
302 MOZ_OPTIMIZE_FLAGS="-O2"
304 WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
305 WIN32_GUI_EXE_LDFLAGS=-mwindows
307 # Silence problematic clang warnings
308 CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
309 LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
311 TARGET_COMPILER_ABI=msvc
312 WIN32_SUBSYSTEM_VERSION=10.0
313 WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
314 WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
315 DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
316 _DEFINES_CFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
317 _DEFINES_CXXFLAGS="-FI $_objdir/mozilla-config.h -DMOZILLA_CLIENT"
318 CFLAGS="$CFLAGS -Gy -Zc:inline"
319 CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
320 if test "$TARGET_CPU" = "x86"; then
321 dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
322 dnl more recent, so set that explicitly here unless another
323 dnl target arch has already been set.
325 if test -z `echo $CFLAGS | grep -i [-/]arch:`; then
326 CFLAGS="$CFLAGS -arch:SSE2"
328 if test -z `echo $CXXFLAGS | grep -i [-/]arch:`; then
329 CXXFLAGS="$CXXFLAGS -arch:SSE2"
333 dnl VS2013+ supports -Gw for better linker optimizations.
334 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
335 dnl Disabled on ASan because it causes false-positive ODR violations.
336 if test -z "$MOZ_ASAN"; then
338 CXXFLAGS="$CXXFLAGS -Gw"
340 # String tail merging doesn't play nice with ASan's ODR checker.
341 LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
343 # Silence VS2017 15.5+ TR1 deprecation warnings hit by older gtest versions
344 CXXFLAGS="$CXXFLAGS -D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING"
345 MOZ_DEBUG_LDFLAGS='-DEBUG'
346 if test "$HOST_OS_ARCH" != "WINNT"; then
347 # %_PDB% is a special signal to emit only the PDB basename. This
348 # avoids problems in Windows tools that don't like forward-slashes.
349 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -PDBALTPATH:%_PDB%"
351 MOZ_OPTIMIZE_FLAGS='-O2'
353 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
355 AC_DEFINE(WIN32_LEAN_AND_MEAN)
356 dnl See http://support.microsoft.com/kb/143208 to use STL
362 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.])
368 if test -n "$GNU_CC"; then
369 CFLAGS="$CFLAGS -mstackrealign"
370 CXXFLAGS="$CXXFLAGS -mstackrealign"
371 LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
373 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
374 LDFLAGS="$LDFLAGS -SAFESEH"
380 if test -n "$_WIN32_MSVC"; then
381 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
386 if test -n "$_WIN32_MSVC"; then
387 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
392 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
398 CFLAGS="$CFLAGS -Dunix"
399 CXXFLAGS="$CXXFLAGS -Dunix"
400 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
401 DSO_PIC_CFLAGS='-fPIC -DPIC'
403 MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
405 DSO_PIC_CFLAGS='-fPIC -DPIC'
408 # This will fail on a.out systems prior to 1.5.1_ALPHA.
409 if test "$LIBRUNPATH"; then
410 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
415 if test -z "$X11BASE"; then
418 MOZ_FIX_LINK_PATHS="$MOZ_FIX_LINK_PATHS -Wl,-rpath-link,${X11BASE}/lib"
419 DSO_PIC_CFLAGS='-fPIC'
420 DSO_LDOPTS='-shared -fPIC'
421 if test "$LIBRUNPATH"; then
422 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
427 MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
432 CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
433 CXXFLAGS="$CXXFLAGS $DSO_PIC_CFLAGS"
435 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
436 MOZ_OPTIMIZE_FLAGS="-O"
440 if test -z "$COMPILE_ENVIRONMENT"; then
441 SKIP_COMPILER_CHECKS=1
442 SKIP_LIBRARY_CHECKS=1
445 fi # COMPILE_ENVIRONMENT
447 if test -z "$SKIP_COMPILER_CHECKS"; then
449 dnl ========================================================
450 dnl Put your C++ language/feature checks below
451 dnl ========================================================
455 if test "$GNU_CC"; then
456 if test "$TARGET_CPU" = "arm" ; then
457 AC_CACHE_CHECK(for ARM EABI,
461 #if defined(__ARM_EABI__)
467 ac_cv_gcc_arm_eabi="yes",
468 ac_cv_gcc_arm_eabi="no")])
469 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
477 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
480 if test -n "$MOZ_LINKER"; then
481 dnl gold emits wrong sysv-style elf hash tables when building both sysv and
482 dnl style tables. https://sourceware.org/bugzilla/show_bug.cgi?id=13597
483 dnl Since the linker only understands the sysv ones, no need to build the
484 dnl gnu style tables anyways.
485 LDFLAGS="$LDFLAGS -Wl,--hash-style=sysv"
488 dnl End of C++ language/feature checks
491 fi # ! SKIP_COMPILER_CHECKS
494 if test -n "${TARGET_CPU}" -a -n "${TARGET_COMPILER_ABI}"; then
495 TARGET_XPCOM_ABI="${TARGET_CPU}-${TARGET_COMPILER_ABI}"
496 AC_DEFINE_UNQUOTED(TARGET_XPCOM_ABI, ["${TARGET_XPCOM_ABI}"])
499 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
500 dnl features that Windows actually does support.
502 if test -n "$SKIP_COMPILER_CHECKS"; then
503 AC_DEFINE(HAVE_FORCEINLINE)
504 fi # SKIP_COMPILER_CHECKS
506 dnl Mozilla specific options
507 dnl ========================================================
508 dnl The macros used for command line options
509 dnl are defined in build/autoconf/altoptions.m4.
511 dnl ========================================================
515 dnl ========================================================
517 MOZ_BRANDING_DIRECTORY=
518 MOZ_OFFICIAL_BRANDING=
520 MOZ_BINARY_EXTENSIONS=
523 dnl ========================================================
524 dnl = Trademarked Branding
525 dnl ========================================================
526 MOZ_ARG_ENABLE_BOOL(official-branding,
527 [ --enable-official-branding
528 Enable Official mozilla.org Branding
529 Do not distribute builds with
530 --enable-official-branding unless you have
531 permission to use trademarks per
532 http://www.mozilla.org/foundation/trademarks/ .],
533 MOZ_OFFICIAL_BRANDING=1,
534 MOZ_OFFICIAL_BRANDING=)
536 # Allow the application to influence configure with a confvars.sh script.
537 AC_MSG_CHECKING([if app-specific confvars.sh exists])
538 if test -f "${srcdir}/${MOZ_BUILD_APP}/confvars.sh" ; then
539 AC_MSG_RESULT([${srcdir}/${MOZ_BUILD_APP}/confvars.sh])
540 . "${srcdir}/${MOZ_BUILD_APP}/confvars.sh"
545 AC_SUBST(MOZ_OFFICIAL_BRANDING)
546 if test -n "$MOZ_OFFICIAL_BRANDING"; then
547 if test -z "$MOZ_OFFICIAL_BRANDING_DIRECTORY"; then
548 AC_MSG_ERROR([You must specify MOZ_OFFICIAL_BRANDING_DIRECTORY to use --enable-official-branding.])
550 MOZ_BRANDING_DIRECTORY=${MOZ_OFFICIAL_BRANDING_DIRECTORY}
551 AC_DEFINE(MOZ_OFFICIAL_BRANDING)
555 MOZ_ARG_WITH_STRING(branding,
556 [ --with-branding=dir Use branding from the specified directory.],
557 MOZ_BRANDING_DIRECTORY=$withval)
559 REAL_BRANDING_DIRECTORY="${MOZ_BRANDING_DIRECTORY}"
560 if test -z "$REAL_BRANDING_DIRECTORY"; then
561 REAL_BRANDING_DIRECTORY=${MOZ_BUILD_APP}/branding/nightly
564 if test -f "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"; then
565 . "${_topsrcdir}/$REAL_BRANDING_DIRECTORY/configure.sh"
568 AC_SUBST(MOZ_BRANDING_DIRECTORY)
570 dnl ========================================================
571 dnl = Distribution ID
572 dnl ========================================================
573 MOZ_ARG_WITH_STRING(distribution-id,
574 [ --with-distribution-id=ID
575 Set distribution-specific id (default=org.mozilla)],
576 [ val=`echo $withval`
577 MOZ_DISTRIBUTION_ID="$val"])
579 if test -z "$MOZ_DISTRIBUTION_ID"; then
580 MOZ_DISTRIBUTION_ID="org.mozilla"
583 AC_SUBST(MOZ_DISTRIBUTION_ID)
585 dnl ========================================================
586 dnl = Enable code optimization. ON by default.
587 dnl ========================================================
589 # Use value from moz.configure if one is defined. Else use our computed
591 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
592 MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
595 if test "$COMPILE_ENVIRONMENT"; then
596 if test -n "$MOZ_OPTIMIZE"; then
597 AC_MSG_CHECKING([for valid C compiler optimization flags])
599 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
600 AC_TRY_COMPILE([#include <stdio.h>],
601 [printf("Hello World\n");],
604 AC_MSG_RESULT([$_results])
605 if test "$_results" = "no"; then
606 AC_MSG_ERROR([These compiler flags for C are invalid: $MOZ_OPTIMIZE_FLAGS])
609 if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
610 # When using llvm-based LTO, non numeric optimization levels are
611 # not supported by the linker, so force the linker to use -O2 (
612 # which doesn't influence the level compilation units are actually
614 case " $MOZ_OPTIMIZE_FLAGS " in
616 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
621 fi # COMPILE_ENVIRONMENT
623 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
624 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
625 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
627 case "${OS_TARGET}" in
628 Android|WINNT|Darwin)
632 dnl On !Android !Windows !OSX, we only want to link executables against mozglue
633 MOZ_GLUE_IN_PROGRAM=1
634 AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
637 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
639 dnl ========================================================
640 dnl = Enable using the clang plugin to build
641 dnl ========================================================
643 if test -n "$COMPILE_ENVIRONMENT"; then
644 MOZ_CONFIG_CLANG_PLUGIN
645 fi # COMPILE_ENVIRONMENT
649 dnl ========================================================
651 dnl = Maintainer debug option (no --enable equivalent)
653 dnl ========================================================
655 AC_SUBST_LIST(ASFLAGS)
656 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
658 AC_SUBST(MOZ_STUB_INSTALLER)
660 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
662 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
664 if test -n "$MOZ_BINARY_EXTENSIONS"; then
665 AC_DEFINE(MOZ_BINARY_EXTENSIONS)
668 dnl ========================================================
669 dnl = Mac bundle name prefix
670 dnl ========================================================
671 MOZ_ARG_WITH_STRING(macbundlename-prefix,
672 [ --with-macbundlename-prefix=prefix
673 Prefix for MOZ_MACBUNDLE_NAME],
674 [ MOZ_MACBUNDLE_NAME_PREFIX="$withval"])
676 MOZ_MACBUNDLE_NAME=$MOZ_APP_DISPLAYNAME
677 if test "$MOZ_MACBUNDLE_NAME_PREFIX"; then
678 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME_PREFIX}${MOZ_MACBUNDLE_NAME}"
681 if test "$MOZ_DEBUG"; then
682 MOZ_MACBUNDLE_NAME="${MOZ_MACBUNDLE_NAME}Debug.app"
684 MOZ_MACBUNDLE_NAME=${MOZ_MACBUNDLE_NAME}.app
686 AC_SUBST(MOZ_MACBUNDLE_NAME)
688 dnl Mac bundle identifier (based on MOZ_APP_DISPLAYNAME)
689 # If the MOZ_MACBUNDLE_ID is defined in the configure.sh, use it
690 # Otherwise, use MOZ_APP_DISPLAYNAME
691 if test -z "$MOZ_MACBUNDLE_ID"; then
692 MOZ_MACBUNDLE_ID=`echo $MOZ_APP_DISPLAYNAME | tr 'A-Z' 'a-z' | tr -dc 'a-z-'`
694 MOZ_MACBUNDLE_ID=${MOZ_DISTRIBUTION_ID}.${MOZ_MACBUNDLE_ID}
695 if test "$MOZ_DEBUG"; then
696 MOZ_MACBUNDLE_ID=${MOZ_MACBUNDLE_ID}debug
699 AC_DEFINE_UNQUOTED(MOZ_MACBUNDLE_ID,$MOZ_MACBUNDLE_ID)
700 AC_SUBST(MOZ_MACBUNDLE_ID)
702 dnl ========================================================
703 dnl = Child Process Name for IPC
704 dnl ========================================================
705 if test "$MOZ_WIDGET_TOOLKIT" != "android"; then
706 MOZ_CHILD_PROCESS_NAME="plugin-container${BIN_SUFFIX}"
708 # We want to let Android unpack the file at install time, but it only does
709 # so if the file is named libsomething.so. The lib/ path is also required
710 # because the unpacked file will be under the lib/ subdirectory and will
711 # need to be executed from that path.
712 MOZ_CHILD_PROCESS_NAME="libplugin-container.so"
714 MOZ_CHILD_PROCESS_BUNDLE="plugin-container.app/Contents/MacOS/"
715 MOZ_CHILD_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.plugincontainer
716 MOZ_CHILD_PROCESS_BUNDLENAME="plugin-container.app"
717 MOZ_CHILD_PROCESS_APPNAME="${MOZ_APP_DISPLAYNAME}CP"
719 AC_SUBST(MOZ_CHILD_PROCESS_NAME)
720 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLE)
721 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLEID)
722 AC_SUBST(MOZ_CHILD_PROCESS_APPNAME)
723 AC_SUBST(MOZ_CHILD_PROCESS_BUNDLENAME)
725 dnl ==========================================================
726 dnl = Mac Media Plugin Helper (GMP Child) Process Name for IPC
727 dnl ==========================================================
728 MOZ_EME_PROCESS_NAME="media-plugin-helper"
729 MOZ_EME_PROCESS_NAME_BRANDED="$MOZ_APP_DISPLAYNAME Media Plugin Helper"
730 MOZ_EME_PROCESS_BUNDLENAME="${MOZ_EME_PROCESS_NAME}.app"
731 # Generate a lower case string with no spaces to be used as the bundle ID
732 # for the EME helper .app of the form org.mozilla.<executable-name>.
733 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_APP_DISPLAYNAME" | tr ' ' '-'`
734 MOZ_EME_PROCESS_BUNDLEID=`echo "$MOZ_EME_PROCESS_BUNDLEID" | tr 'A-Z' 'a-z'`
735 MOZ_EME_PROCESS_BUNDLEID=${MOZ_EME_PROCESS_BUNDLEID}-${MOZ_EME_PROCESS_NAME}
736 MOZ_EME_PROCESS_BUNDLEID=${MOZ_DISTRIBUTION_ID}.${MOZ_EME_PROCESS_BUNDLEID}
738 AC_SUBST(MOZ_EME_PROCESS_NAME)
739 AC_SUBST(MOZ_EME_PROCESS_NAME_BRANDED)
740 AC_SUBST(MOZ_EME_PROCESS_BUNDLENAME)
741 AC_SUBST(MOZ_EME_PROCESS_BUNDLEID)
743 # The following variables are available to branding and application
744 # configuration ($BRANDING/configure.sh and $APPLICATION/confvars.sh):
745 # - MOZ_APP_VENDOR: Used for application.ini's "Vendor" field, which also
746 # impacts profile location and user-visible fields.
747 # - MOZ_APP_DISPLAYNAME: Used in user-visible fields (DLL properties,
748 # Mac Bundle name, Updater, Installer), it is typically used for nightly
749 # builds (e.g. Aurora for Firefox).
750 # - MOZ_APP_PROFILE: When set, used for application.ini's
751 # "Profile" field, which controls profile location.
752 # - MOZ_APP_ID: When set, used for application.ini's "ID" field, and
753 # crash reporter server url.
754 # - MOZ_PROFILE_MIGRATOR: When set, enables profile migrator.
756 # The following environment variables used to have an effect, but don't anymore:
757 # - MOZ_APP_VERSION: Defines the application version number. This was replaced with
758 # the contents from the version.txt file in the application directory, or
759 # browser/config/version.txt if there isn't one.
760 # - MOZ_APP_VERSION_DISPLAY: Defines the application version number. Used
761 # in the "About" window. This was replaced with the contents from the
762 # version_display.txt or version.txt in the application directory, or
763 # browser/config/version_display.txt.
765 # For extensions and langpacks, we require a max version that is compatible
766 # across security releases. MOZ_APP_MAXVERSION is our method for doing that.
767 # 24.0a1 and 24.0a2 aren't affected
769 # 24.1.1 becomes 24.*
770 IS_ALPHA=`echo $MOZ_APP_VERSION | grep a`
771 if test -z "$IS_ALPHA"; then
773 if test "$(basename $MOZ_BUILD_APP)" = "suite"; then
774 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\.[0-9]*\).*|\1|"`.*
776 MOZ_APP_MAXVERSION=`echo $MOZ_APP_VERSION | sed "s|\(^[0-9]*\).*|\1|"`.*
780 MOZ_APP_MAXVERSION=$MOZ_APP_VERSION
783 AC_SUBST(MOZ_APP_DISPLAYNAME)
784 AC_SUBST(MOZ_APP_VENDOR)
785 AC_SUBST(MOZ_APP_PROFILE)
787 AC_SUBST(MAR_CHANNEL_ID)
788 AC_SUBST(ACCEPTED_MAR_CHANNEL_IDS)
789 AC_SUBST(MOZ_PROFILE_MIGRATOR)
790 AC_DEFINE_UNQUOTED(MOZ_APP_UA_NAME, "$MOZ_APP_UA_NAME")
791 AC_SUBST(MOZ_APP_UA_NAME)
792 AC_DEFINE_UNQUOTED(MOZ_APP_UA_VERSION, "$MOZ_APP_VERSION")
793 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL, $BROWSER_CHROME_URL)
794 AC_DEFINE_UNQUOTED(BROWSER_CHROME_URL_QUOTED, "$BROWSER_CHROME_URL")
796 AC_SUBST(MOZ_APP_MAXVERSION)
797 AC_SUBST(MOZ_PKG_SPECIAL)
798 AC_SUBST(MOZ_SIMPLE_PACKAGE_NAME)
800 if test "$MOZILLA_OFFICIAL"; then
801 # Build revisions should always be present in official builds
802 MOZ_INCLUDE_SOURCE_INFO=1
805 # External builds (specifically Ubuntu) may drop the hg repo information, so we allow to
806 # explicitly set the repository and changeset information in.
807 AC_SUBST(MOZ_SOURCE_REPO)
808 AC_SUBST(MOZ_SOURCE_CHANGESET)
809 AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
811 dnl Echo the CFLAGS to remove extra whitespace.
813 $_COMPILATION_CFLAGS \
817 $_COMPILATION_CXXFLAGS \
821 $_COMPILATION_ASFLAGS \
824 COMPILE_CFLAGS=`echo \
828 COMPILE_CXXFLAGS=`echo \
833 $_COMPILATION_HOST_CFLAGS \
836 HOST_CXXFLAGS=`echo \
837 $_COMPILATION_HOST_CXXFLAGS \
842 $_COMPILATION_LDFLAGS`
846 $_COMPILATION_HOST_LDFLAGS`
848 HOST_CMFLAGS="-x objective-c -fobjc-exceptions"
849 HOST_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
850 OS_COMPILE_CMFLAGS="-x objective-c -fobjc-exceptions"
851 OS_COMPILE_CMMFLAGS="-x objective-c++ -fobjc-exceptions"
852 if test "$MOZ_WIDGET_TOOLKIT" = uikit; then
853 OS_COMPILE_CMFLAGS="$OS_COMPILE_CMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
854 OS_COMPILE_CMMFLAGS="$OS_COMPILE_CMMFLAGS -fobjc-abi-version=2 -fobjc-legacy-dispatch"
856 AC_SUBST(HOST_CMFLAGS)
857 AC_SUBST(HOST_CMMFLAGS)
858 AC_SUBST(OS_COMPILE_CMFLAGS)
859 AC_SUBST(OS_COMPILE_CMMFLAGS)
862 OS_CXXFLAGS="$CXXFLAGS"
863 OS_CPPFLAGS="$CPPFLAGS"
864 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
865 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
866 OS_LDFLAGS="$LDFLAGS"
868 AC_SUBST_LIST(OS_CFLAGS)
869 AC_SUBST_LIST(OS_CXXFLAGS)
870 AC_SUBST_LIST(OS_CPPFLAGS)
871 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
872 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
873 AC_SUBST_LIST(OS_LDFLAGS)
878 AC_SUBST_LIST(HOST_CFLAGS)
879 AC_SUBST_LIST(HOST_CPPFLAGS)
880 AC_SUBST_LIST(HOST_CXXFLAGS)
881 AC_SUBST(HOST_LDFLAGS)
882 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
883 AC_SUBST(HOST_BIN_SUFFIX)
885 AC_SUBST(TARGET_XPCOM_ABI)
890 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
891 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
893 AC_SUBST(MOZ_DEVTOOLS)
895 AC_SUBST(MOZ_PACKAGE_JSSHELL)
899 dnl Host JavaScript runtime, if any, to use during cross compiles.
902 AC_SUBST(NSS_EXTRA_SYMBOLS_FILE)
904 dnl Set various defines and substitutions
905 dnl ========================================================
907 AC_SUBST(MOZ_DEV_EDITION)
908 if test -n "$MOZ_DEV_EDITION"; then
909 AC_DEFINE(MOZ_DEV_EDITION)
912 dnl Spit out some output
913 dnl ========================================================
915 # Avoid using obsolete NSPR features
916 AC_DEFINE(NO_NSPR_10_SUPPORT)
918 MOZ_CREATE_CONFIG_STATUS()
920 rm -fr confdefs* $ac_clean_files