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(js/src/jsapi.h)
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 Initialize the Pthread test variables early so they can be
34 dnl overridden by each platform.
35 dnl ========================================================
39 LDFLAGS="$LDFLAGS $LINKER_LDFLAGS $PACK_REL_RELOC_FLAGS"
40 HOST_LDFLAGS="$HOST_LDFLAGS $HOST_LINKER_LDFLAGS"
42 if test -z "$JS_STANDALONE"; then
43 autoconfmk=autoconf-js.mk
47 jsconfdefs=$_objdir/js/src/js-confdefs.h
51 dnl ========================================================
52 dnl Checks for compilers.
53 dnl ========================================================
55 if test "$COMPILE_ENVIRONMENT"; then
57 # This prevents mingw from adding .exe when generating executable. Internal use
62 # In Mozilla, we use the names $target, $host and $build incorrectly, but are
63 # too far gone to back out now. See Bug 475488:
64 # - When we say $target, we mean $host, that is, the system on which
65 # Mozilla will be run.
66 # - When we say $host, we mean $build, that is, the system on which Mozilla
68 # - $target (in its correct usage) is for compilers who generate code for a
69 # different platform than $host, so it would not be used by Mozilla.
70 if test "$target" != "$host"; then
79 dnl Special win32 checks
80 dnl ========================================================
86 if test "$GCC" != "yes"; then
87 # Check to see if we are really running in a msvc environemnt
90 # Make sure compilers are valid
91 CXXFLAGS="$CXXFLAGS -TP"
92 # _CRT_SECURE_NO_WARNINGS disables warnings about using MSVC-specific
93 # secure CRT functions.
94 CXXFLAGS="$CXXFLAGS -D_CRT_SECURE_NO_WARNINGS"
97 AC_TRY_COMPILE([#include <stdio.h>],
98 [ printf("Hello World\n"); ],,
99 AC_MSG_ERROR([\$(CC) test failed. You must have MS VC++ in your path to build.]) )
102 AC_TRY_COMPILE([#include <new.h>],
103 [ unsigned *test = new unsigned(42); ],,
104 AC_MSG_ERROR([\$(CXX) test failed. You must have MS VC++ in your path to build.]) )
107 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
108 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
110 MSVC_C_RUNTIME_DLL=vcruntime140.dll
111 if test "$TARGET_CPU" != "x86"; then
112 MSVC_C_RUNTIME_1_DLL=vcruntime140_1.dll
114 MSVC_CXX_RUNTIME_DLL=msvcp140.dll
116 # -Zc:sizedDealloc- disables C++14 global sized deallocation (see bug 1160146)
117 CXXFLAGS="$CXXFLAGS -Zc:sizedDealloc-"
119 AC_SUBST(MSVC_C_RUNTIME_DLL)
120 AC_SUBST(MSVC_C_RUNTIME_1_DLL)
121 AC_SUBST(MSVC_CXX_RUNTIME_DLL)
123 CFLAGS="$CFLAGS -D_HAS_EXCEPTIONS=0"
124 CXXFLAGS="$CXXFLAGS -D_HAS_EXCEPTIONS=0"
126 # Check w32api version
127 _W32API_MAJOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $1 }'`
128 _W32API_MINOR_VERSION=`echo $W32API_VERSION | $AWK -F\. '{ print $2 }'`
129 AC_MSG_CHECKING([for w32api version >= $W32API_VERSION])
130 AC_TRY_COMPILE([#include <w32api.h>],
131 #if (__W32API_MAJOR_VERSION < $_W32API_MAJOR_VERSION) || \
132 (__W32API_MAJOR_VERSION == $_W32API_MAJOR_VERSION && \
133 __W32API_MINOR_VERSION < $_W32API_MINOR_VERSION)
134 #error "test failed."
136 , [ res=yes ], [ res=no ])
137 AC_MSG_RESULT([$res])
138 if test "$res" != "yes"; then
139 AC_MSG_ERROR([w32api version $W32API_VERSION or higher required.])
143 AC_DEFINE(_USE_MATH_DEFINES) # Otherwise Windows' math.h doesn't #define M_PI.
145 AC_DEFINE_UNQUOTED(WINVER,0x$WINVER)
146 AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x$WINVER)
147 AC_DEFINE_UNQUOTED(_WIN32_IE,0x0A00)
152 if test -n "$_WIN32_MSVC"; then
154 SKIP_COMPILER_CHECKS=1
155 SKIP_LIBRARY_CHECKS=1
158 fi # COMPILE_ENVIRONMENT
163 dnl ========================================================
164 dnl set the defaults first
165 dnl ========================================================
166 MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
168 dnl Configure platform-specific CPU architecture compiler options.
169 dnl ==============================================================
174 dnl ========================================================
175 dnl GNU specific defaults
176 dnl ========================================================
177 if test "$GNU_CC"; then
179 if test "$GCC_USE_GNU_LD"; then
180 # Some tools like ASan use a runtime library that is only
181 # linked against executables, so we must allow undefined
182 # symbols for shared objects in some cases.
183 if test -z "$MOZ_ASAN$MOZ_MSAN$MOZ_UBSAN$MOZ_TSAN$FUZZING_INTERFACES"; then
184 # Don't allow undefined symbols in libraries
185 DSO_LDOPTS="$DSO_LDOPTS -Wl,-z,defs"
189 if test "$OS_ARCH" != "WINNT"; then
190 DSO_PIC_CFLAGS='-fPIC'
191 ASFLAGS="$ASFLAGS -fPIC"
194 _DEFINES_CFLAGS="-include $jsconfdefs -DMOZILLA_CLIENT"
197 if test "$GNU_CXX"; then
198 _DEFINES_CXXFLAGS="-DMOZILLA_CLIENT -include $jsconfdefs"
201 dnl ========================================================
202 dnl System overrides of the defaults for host
203 dnl ========================================================
206 if test -n "$_WIN32_MSVC"; then
207 HOST_CFLAGS="$HOST_CFLAGS"
209 HOST_CFLAGS="$HOST_CFLAGS -mwindows"
211 HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN -DWIN32 -D_WIN32 -D_CRT_SECURE_NO_WARNINGS"
212 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
215 case "${host_cpu}" in
217 if test -n "$_WIN32_MSVC"; then
218 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X86"
222 if test -n "$_WIN32_MSVC"; then
223 HOST_LDFLAGS="$HOST_LDFLAGS -MACHINE:X64"
225 HOST_CFLAGS="$HOST_CFLAGS -D_AMD64_"
231 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX"
232 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
235 *-linux*|*-kfreebsd*-gnu|*-gnu*)
236 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
237 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
241 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
242 HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
246 dnl ========================================================
247 dnl System overrides of the defaults for target
248 dnl ========================================================
250 MOZ_OPTIMIZE_LDFLAGS="${_COMPILATION_OPTIMIZE_LDFLAGS} ${MOZ_OPTIMIZE_FLAGS}"
254 MOZ_OPTIMIZE_FLAGS="-O3"
259 *-android*|*-linuxandroid*)
260 MOZ_OPTIMIZE_FLAGS="-O3"
261 if test -z "$CLANG_CC"; then
262 MOZ_OPTIMIZE_FLAGS="-fno-reorder-functions $MOZ_OPTIMIZE_FLAGS"
267 if test "$GNU_CC" -o "$GNU_CXX"; then
268 MOZ_PGO_OPTIMIZE_FLAGS="-O3"
269 MOZ_OPTIMIZE_FLAGS="-O3"
272 case "${target_cpu}" in
274 CFLAGS="$CFLAGS -mieee"
275 CXXFLAGS="$CXXFLAGS -mieee"
282 if test -n "$GNU_CC" -o -n "$CLANG_CC"; then
283 # $GNU_CC will match gcc and clang; while $CLANG_CC will match only clang
284 if test -z "$CLANG_CC"; then
285 AC_MSG_ERROR(Firefox cannot be built with mingw-gcc and requires a mingw-clang toolchain to work)
291 # Silence problematic clang warnings
292 CXXFLAGS="$CXXFLAGS -Wno-incompatible-ms-struct"
293 LDFLAGS="$LDFLAGS -Wl,--no-insert-timestamp"
295 MOZ_OPTIMIZE_FLAGS="-O2"
297 WIN32_CONSOLE_EXE_LDFLAGS=-mconsole
298 WIN32_GUI_EXE_LDFLAGS=-mwindows
300 TARGET_COMPILER_ABI=msvc
301 WIN32_SUBSYSTEM_VERSION=10.0
302 WIN32_CONSOLE_EXE_LDFLAGS=-SUBSYSTEM:CONSOLE,$WIN32_SUBSYSTEM_VERSION
303 WIN32_GUI_EXE_LDFLAGS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
304 DSO_LDOPTS=-SUBSYSTEM:WINDOWS,$WIN32_SUBSYSTEM_VERSION
305 _DEFINES_CFLAGS="-FI $jsconfdefs -DMOZILLA_CLIENT"
306 _DEFINES_CXXFLAGS="-FI $jsconfdefs -DMOZILLA_CLIENT"
307 CFLAGS="$CFLAGS -Gy -Zc:inline"
308 CXXFLAGS="$CXXFLAGS -Gy -Zc:inline"
309 if test "$TARGET_CPU" = "x86";then
310 dnl VS2012+ defaults to -arch:SSE2. We want to target nothing
311 dnl more recent, so set that explicitly here unless another
312 dnl target arch has already been set.
314 if test -z `echo $CFLAGS | grep -i [-/]arch:` ; then
315 CFLAGS="$CFLAGS -arch:SSE2"
317 if test -z `echo $CXXFLAGS | grep -i [-/]arch:` ; then
318 CXXFLAGS="$CXXFLAGS -arch:SSE2"
322 dnl VS2013+ supports -Gw for better linker optimizations.
323 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
324 dnl Disabled on ASan because it causes false-positive ODR violations.
325 if test -z "$MOZ_ASAN"; then
327 CXXFLAGS="$CXXFLAGS -Gw"
329 # String tail merging doesn't play nice with ASan's ODR checker.
330 LDFLAGS="$LDFLAGS -opt:nolldtailmerge"
332 MOZ_DEBUG_LDFLAGS='-DEBUG'
333 if test "$HOST_OS_ARCH" != "WINNT"; then
334 # %_PDB% is a special signal to emit only the PDB basename. This
335 # avoids problems in Windows tools that don't like forward-slashes.
336 MOZ_DEBUG_LDFLAGS="$MOZ_DEBUG_LDFLAGS -PDBALTPATH:%_PDB%"
338 MOZ_OPTIMIZE_FLAGS="-O2"
340 LDFLAGS="$LDFLAGS -LARGEADDRESSAWARE"
342 AC_DEFINE(HAVE__MSIZE)
343 AC_DEFINE(WIN32_LEAN_AND_MEAN)
344 dnl See http://support.microsoft.com/kb/143208 to use STL
350 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.])
356 if test -n "$GNU_CC"; then
357 CFLAGS="$CFLAGS -mstackrealign"
358 CXXFLAGS="$CXXFLAGS -mstackrealign"
359 LDFLAGS="$LDFLAGS -Wl,--large-address-aware"
361 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X86"
362 LDFLAGS="$LDFLAGS -SAFESEH"
368 if test -n "$_WIN32_MSVC"; then
369 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:X64"
374 if test -n "$_WIN32_MSVC"; then
375 DSO_LDOPTS="$DSO_LDOPTS -MACHINE:ARM64"
380 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
386 CFLAGS="$CFLAGS -Dunix"
387 CXXFLAGS="$CXXFLAGS -Dunix"
388 if $CC -E - -dM </dev/null | grep __ELF__ >/dev/null; then
389 DSO_PIC_CFLAGS='-fPIC -DPIC'
391 MOZ_PROGRAM_LDFLAGS="$MOZ_PROGRAM_LDFLAGS -Wl,--export-dynamic"
393 DSO_PIC_CFLAGS='-fPIC -DPIC'
396 # This will fail on a.out systems prior to 1.5.1_ALPHA.
397 if test "$LIBRUNPATH"; then
398 DSO_LDOPTS="-Wl,-R$LIBRUNPATH $DSO_LDOPTS"
403 DSO_PIC_CFLAGS='-fPIC'
404 DSO_LDOPTS='-shared -fPIC'
405 if test "$LIBRUNPATH"; then
406 DSO_LDOPTS="-R$LIBRUNPATH $DSO_LDOPTS"
411 MOZ_FIX_LINK_PATHS="-L${DIST}/bin"
415 CXXFLAGS="$CXXFLAGS -mthread-model single"
421 CFLAGS="$CFLAGS $DSO_PIC_CFLAGS"
422 CXXFLAGS="$CXXFLAGS $DSO_PIC_CFLAGS"
424 if test -z "$MOZ_OPTIMIZE_FLAGS"; then
425 MOZ_OPTIMIZE_FLAGS="-O"
428 if test -z "$COMPILE_ENVIRONMENT"; then
429 SKIP_COMPILER_CHECKS=1
430 SKIP_LIBRARY_CHECKS=1
433 if test -n "$COMPILE_ENVIRONMENT"; then
437 if test -z "$SKIP_COMPILER_CHECKS"; then
438 dnl Checks for typedefs, structures, and compiler characteristics.
439 dnl ========================================================
445 dnl Checks for libraries.
446 dnl ========================================================
447 AC_CHECK_LIB(c_r, gethostbyname_r)
449 dnl We don't want to link with libdl even if it's present on OS X, since
450 dnl it's not used and not part of the default installation. OS/2 has dlfcn
452 dnl We don't want to link against libm or libpthread on Darwin since
453 dnl they both are just symlinks to libSystem and explicitly linking
454 dnl against libSystem causes issues when debugging (see bug 299601).
459 AC_SEARCH_LIBS(dlopen, dl,
460 MOZ_CHECK_HEADER(dlfcn.h,
461 AC_DEFINE(HAVE_DLOPEN)))
465 _SAVE_CFLAGS="$CFLAGS"
466 CFLAGS="$CFLAGS -D_GNU_SOURCE"
467 AC_CHECK_FUNCS(dladdr)
468 CFLAGS="$_SAVE_CFLAGS"
470 if test ! "$GNU_CXX"; then
471 AC_CHECK_LIB(C, demangle)
474 AC_CHECK_LIB(socket, socket)
476 dnl ========================================================
477 dnl = pthread support
478 dnl = Start by checking whether the system support pthreads
479 dnl ========================================================
485 AC_CHECK_LIB(pthreads, pthread_create,
486 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
487 AC_CHECK_LIB(pthread, pthread_create,
488 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
489 AC_CHECK_LIB(c_r, pthread_create,
490 USE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
491 AC_CHECK_LIB(c, pthread_create,
500 dnl ========================================================
501 dnl Do the platform specific pthread hackery
502 dnl ========================================================
503 if test "$USE_PTHREADS"x != x
506 dnl See if -pthread is supported.
509 ac_cv_have_dash_pthread=no
510 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
511 echo 'int main() { return 0; }' | cat > conftest.c
512 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
513 if test $? -eq 0; then
514 if test -z "`grep -E -i '(unrecognize|unknown)' conftest.out | grep pthread`" -a -z "`grep -E -i '(error|incorrect)' conftest.out`" ; then
515 ac_cv_have_dash_pthread=yes
518 # Freebsd doesn't use -pthread for compiles, it uses them for linking
521 CFLAGS="$CFLAGS -pthread"
522 CXXFLAGS="$CXXFLAGS -pthread"
528 AC_MSG_RESULT($ac_cv_have_dash_pthread)
531 dnl See if -pthreads is supported.
533 ac_cv_have_dash_pthreads=no
534 if test "$ac_cv_have_dash_pthread" = "no"; then
535 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
536 echo 'int main() { return 0; }' | cat > conftest.c
537 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
538 if test $? -eq 0; then
539 if test -z "`grep -E -i '(unrecognize|unknown)' conftest.out | grep pthreads`" -a -z "`grep -E -i '(error|incorrect)' conftest.out`" ; then
540 ac_cv_have_dash_pthreads=yes
541 CFLAGS="$CFLAGS -pthreads"
542 CXXFLAGS="$CXXFLAGS -pthreads"
546 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
551 AC_DEFINE(_REENTRANT)
552 AC_DEFINE(_THREAD_SAFE)
553 dnl -pthread links in -lpthread, so don't specify it explicitly.
554 if test "$ac_cv_have_dash_pthread" = "yes"; then
555 _PTHREAD_LDFLAGS="-pthread"
559 *-*-openbsd*|*-*-bsdi*)
560 AC_DEFINE(_REENTRANT)
561 AC_DEFINE(_THREAD_SAFE)
562 dnl -pthread links in -lc_r, so don't specify it explicitly.
563 if test "$ac_cv_have_dash_pthread" = "yes"; then
564 _PTHREAD_LDFLAGS="-pthread"
568 *-*-linux*|*-*-kfreebsd*-gnu|*-*-gnu*)
569 AC_DEFINE(_REENTRANT)
573 LDFLAGS="${_PTHREAD_LDFLAGS} ${LDFLAGS}"
577 dnl ========================================================
578 dnl Put your C++ language/feature checks below
579 dnl ========================================================
583 if test "$GNU_CC"; then
584 if test "$TARGET_CPU" = "arm" ; then
585 AC_CACHE_CHECK(for ARM EABI,
589 #if defined(__ARM_EABI__)
595 ac_cv_gcc_arm_eabi="yes",
596 ac_cv_gcc_arm_eabi="no")])
597 if test "$ac_cv_gcc_arm_eabi" = "yes"; then
605 TARGET_COMPILER_ABI="${TARGET_COMPILER_ABI-${ARM_ABI_PREFIX}gcc3}"
608 dnl End of C++ language/feature checks
611 fi # ! SKIP_COMPILER_CHECKS
614 if test -n "${TARGET_CPU}" -a -n "${TARGET_COMPILER_ABI}"; then
615 TARGET_XPCOM_ABI="${TARGET_CPU}-${TARGET_COMPILER_ABI}"
618 dnl We can't run TRY_COMPILE tests on Windows, so hard-code some
619 dnl features that Windows actually does support.
621 if test -n "$SKIP_COMPILER_CHECKS"; then
622 dnl Windows has malloc.h
623 AC_DEFINE(MALLOC_H, [<malloc.h>])
624 AC_DEFINE(HAVE_FORCEINLINE)
625 fi # SKIP_COMPILER_CHECKS
627 dnl Mozilla specific options
628 dnl ========================================================
629 dnl The macros used for command line options
630 dnl are defined in build/autoconf/altoptions.m4.
632 dnl ========================================================
633 dnl = Enable code optimization. ON by default.
634 dnl ========================================================
636 # Use value from moz.configure if one is defined. Else use our computed
638 if test -n "${MOZ_CONFIGURE_OPTIMIZE_FLAGS}"; then
639 MOZ_OPTIMIZE_FLAGS=${MOZ_CONFIGURE_OPTIMIZE_FLAGS}
642 if test "$COMPILE_ENVIRONMENT"; then
643 if test -n "$MOZ_OPTIMIZE"; then
644 AC_MSG_CHECKING([for valid optimization flags])
646 CFLAGS="$CFLAGS $MOZ_OPTIMIZE_FLAGS"
647 AC_TRY_COMPILE([#include <stdio.h>],
648 [printf("Hello World\n");],
651 AC_MSG_RESULT([$_results])
652 if test "$_results" = "no"; then
653 AC_MSG_ERROR([These compiler flags are invalid: $MOZ_OPTIMIZE_FLAGS])
656 if test -n "$MOZ_LTO" -a -n "$CLANG_CC"; then
657 # When using llvm-based LTO, non numeric optimization levels are
658 # not supported by the linker, so force the linker to use -O2 (
659 # which doesn't influence the level compilation units are actually
661 case " $MOZ_OPTIMIZE_FLAGS " in
663 MOZ_OPTIMIZE_LDFLAGS="$MOZ_OPTIMIZE_LDFLAGS -O2"
668 fi # COMPILE_ENVIRONMENT
670 AC_SUBST_LIST(MOZ_OPTIMIZE_FLAGS)
671 AC_SUBST_LIST(MOZ_OPTIMIZE_LDFLAGS)
672 AC_SUBST_LIST(MOZ_PGO_OPTIMIZE_FLAGS)
674 dnl ========================================================
675 dnl = Enable jemalloc
676 dnl ========================================================
678 if test "$JS_STANDALONE" -a -z "$MOZ_MEMORY"; then
681 case "${OS_TARGET}" in
682 Android|WINNT|Darwin)
686 dnl On !Android !Windows !OSX, we only want to link executables against mozglue
687 MOZ_GLUE_IN_PROGRAM=1
688 AC_DEFINE(MOZ_GLUE_IN_PROGRAM)
693 if test "$MOZ_MEMORY"; then
696 export MOZ_NO_DEBUG_RTL=1
700 AC_SUBST(MOZ_GLUE_IN_PROGRAM)
702 dnl ========================================================
704 dnl ========================================================
705 if test -n "$MOZ_INSTRUMENTS"; then
706 LIBS="$LIBS -framework CoreFoundation"
709 dnl ========================================================
710 dnl = Enable using the clang plugin to build
711 dnl ========================================================
713 if test -n "$COMPILE_ENVIRONMENT"; then
714 MOZ_CONFIG_CLANG_PLUGIN
715 fi # COMPILE_ENVIRONMENT
719 dnl ========================================================
721 dnl = Maintainer debug option (no --enable equivalent)
723 dnl ========================================================
725 AC_SUBST_LIST(ASFLAGS)
726 AC_SUBST_LIST(MOZ_DEBUG_LDFLAGS)
728 AC_SUBST_LIST(MOZ_FIX_LINK_PATHS)
730 AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
732 AC_SUBST(MOZ_APP_DISPLAYNAME)
734 AC_SUBST(MOZ_PKG_SPECIAL)
736 dnl Echo the CFLAGS to remove extra whitespace.
738 $_COMPILATION_CFLAGS \
742 $_COMPILATION_CXXFLAGS \
746 $_COMPILATION_ASFLAGS \
749 COMPILE_CFLAGS=`echo \
753 COMPILE_CXXFLAGS=`echo \
758 $_COMPILATION_HOST_CFLAGS \
761 HOST_CXXFLAGS=`echo \
762 $_COMPILATION_HOST_CXXFLAGS \
767 $_COMPILATION_LDFLAGS`
771 $_COMPILATION_HOST_LDFLAGS`
774 OS_CXXFLAGS="$CXXFLAGS"
775 OS_CPPFLAGS="$CPPFLAGS"
776 OS_COMPILE_CFLAGS="$COMPILE_CFLAGS"
777 OS_COMPILE_CXXFLAGS="$COMPILE_CXXFLAGS"
778 OS_LDFLAGS="$LDFLAGS"
780 AC_SUBST_LIST(OS_CFLAGS)
781 AC_SUBST_LIST(OS_CXXFLAGS)
782 AC_SUBST_LIST(OS_CPPFLAGS)
783 AC_SUBST_LIST(OS_COMPILE_CFLAGS)
784 AC_SUBST_LIST(OS_COMPILE_CXXFLAGS)
785 AC_SUBST_LIST(OS_LDFLAGS)
790 AC_SUBST_LIST(HOST_CFLAGS)
791 AC_SUBST_LIST(HOST_CPPFLAGS)
792 AC_SUBST_LIST(HOST_CXXFLAGS)
793 AC_SUBST(HOST_LDFLAGS)
794 AC_SUBST_LIST(HOST_OPTIMIZE_FLAGS)
795 AC_SUBST(HOST_BIN_SUFFIX)
797 AC_SUBST(TARGET_XPCOM_ABI)
802 AC_SUBST(WIN32_CONSOLE_EXE_LDFLAGS)
803 AC_SUBST(WIN32_GUI_EXE_LDFLAGS)
805 dnl Set various defines and substitutions
806 dnl ========================================================
808 AC_SUBST(MOZ_DEV_EDITION)
809 if test -n "$MOZ_DEV_EDITION"; then
810 AC_DEFINE(MOZ_DEV_EDITION)
813 dnl ========================================================
815 dnl ========================================================
819 if test -n "$JS_STANDALONE"; then
820 JS_LIBRARY_NAME="mozjs-$MOZILLA_SYMBOLVERSION"
822 JS_LIBRARY_NAME="mozjs"
824 JS_CONFIG_LIBS="$NSPR_LIBS $LIBS"
825 if test -n "$GNU_CC"; then
826 JS_CONFIG_MOZ_JS_LIBS='-L${libdir} -l${JS_LIBRARY_NAME}'
828 JS_CONFIG_MOZ_JS_LIBS='${libdir}/${JS_LIBRARY_NAME}.lib'
830 AC_SUBST(JS_LIBRARY_NAME)
831 AC_SUBST(JS_CONFIG_MOZ_JS_LIBS)
832 AC_SUBST(JS_CONFIG_LIBS)
834 # Avoid using obsolete NSPR features
835 AC_DEFINE(NO_NSPR_10_SUPPORT)
837 dnl Spit out some output
838 dnl ========================================================
839 MOZ_CREATE_CONFIG_STATUS()
841 rm -fr confdefs* $ac_clean_files