1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
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/.
8 AC_INIT(config/libc_r.h)
10 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
13 dnl ========================================================
15 dnl ========================================================
29 _MACOSX_DEPLOYMENT_TARGET=
34 OBJDIR='$(OBJDIR_NAME)'
37 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
38 NOSUCHFILE=/no-such-file
39 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
40 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
51 dnl Link in libraries necessary to resolve all symbols for shared libs
54 dnl ========================================================
56 dnl = Dont change the following lines. Doing so breaks:
58 dnl = CFLAGS="-foo" ./configure
60 dnl ========================================================
62 CXXFLAGS="${CXXFLAGS=}"
64 DLLFLAGS="${DLLFLAGS=}"
65 HOST_CFLAGS="${HOST_CFLAGS=}"
66 HOST_LDFLAGS="${HOST_LDFLAGS=}"
70 # Check to see if we are really running in a msvc environemnt
72 AC_CHECK_PROGS(CC, cl)
73 if test "$CC" = "cl"; then
74 echo 'main() { return 0; }' > dummy.c
75 ${CC} -o dummy dummy.c >/dev/null 2>&1
80 AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
82 rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
93 if test -n "$_WIN32_MSVC"; then
95 SKIP_COMPILER_CHECKS=1
99 dnl ========================================================
100 dnl = Android uses a very custom (hacky) toolchain; we need to do this
101 dnl = here, so that the compiler checks can succeed
102 dnl ========================================================
104 AC_ARG_WITH(android-ndk,
105 [ --with-android-ndk=DIR
106 location where the Android NDK can be found],
107 android_ndk=$withval)
109 AC_ARG_WITH(android-toolchain,
110 [ --with-android-toolchain=DIR
111 location of the Android toolchain],
112 android_toolchain=$withval)
114 dnl The default android_version is different for each target cpu.
115 case "$target_cpu" in
124 AC_ARG_WITH(android-version,
125 [ --with-android-version=VER
126 Android platform version, default 5 for arm, 9 for x86/mips],
127 android_version=$withval)
129 AC_ARG_WITH(android-platform,
130 [ --with-android-platform=DIR
131 location of platform dir],
132 android_platform=$withval)
135 arm-linux*-android*|*-linuxandroid*)
136 android_tool_prefix="arm-linux-androideabi"
139 android_tool_prefix="i686-linux-android"
142 android_tool_prefix="mipsel-linux-android"
145 android_tool_prefix="$target_os"
149 dnl ========================================================
150 dnl = Gonk is a fork of Android used for Mozilla's B2G project.
151 dnl = Configuration is done largely by the top level config
152 dnl = and the specified gonk directory doesn't matter here.
153 dnl ========================================================
156 [ --with-gonk=DIR location of gonk dir],
159 if test -n "$gonkdir" ; then
160 dnl Most things are directly configured by env vars when building for gonk
162 dnl prevent cross compile section from using these flags as host flags
163 if test -z "$HOST_CPPFLAGS" ; then
166 if test -z "$HOST_CFLAGS" ; then
169 if test -z "$HOST_CXXFLAGS" ; then
172 if test -z "$HOST_LDFLAGS" ; then
179 *-android*|*-linuxandroid*)
180 if test -z "$android_ndk" ; then
181 AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
184 if test -z "$android_toolchain" ; then
185 AC_MSG_CHECKING([for android toolchain directory])
187 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
189 case "$target_cpu" in
191 target_name=arm-linux-androideabi-4.4.3
194 target_name=x86-4.4.3
197 target_name=mipsel-linux-android-4.4.3
200 android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
202 if test -d "$android_toolchain" ; then
203 AC_MSG_RESULT([$android_toolchain])
205 AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
209 if test -z "$android_platform" ; then
210 AC_MSG_CHECKING([for android platform directory])
212 case "$target_cpu" in
224 android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name"
226 if test -d "$android_platform" ; then
227 AC_MSG_RESULT([$android_platform])
229 AC_MSG_ERROR([not found. You have to specify --with-android-platform=/path/to/ndk/platform.])
233 dnl Old NDK support. If minimum requirement is changed to NDK r8b,
234 dnl please remove this.
235 case "$target_cpu" in
237 if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
238 dnl Old NDK toolchain name
239 android_tool_prefix="i686-android-linux"
245 AS="$android_toolchain"/bin/"$android_tool_prefix"-as
246 CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
247 CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
248 CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
249 LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
250 AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
251 RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
252 STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
254 CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
255 CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
256 CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
257 LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
259 dnl prevent cross compile section from using these flags as host flags
260 if test -z "$HOST_CPPFLAGS" ; then
263 if test -z "$HOST_CFLAGS" ; then
266 if test -z "$HOST_CXXFLAGS" ; then
269 if test -z "$HOST_LDFLAGS" ; then
278 dnl ========================================================
280 dnl = Check options that may affect the compiler
282 dnl ========================================================
283 dist_prefix='${MOD_DEPTH}/dist'
284 dist_bindir='${dist_prefix}/bin'
285 dist_includedir='${dist_prefix}/include/nspr'
286 dist_libdir='${dist_prefix}/lib'
287 dnl If the --includedir option was not specified, add '/nspr' to autoconf's
288 dnl default value of includedir.
289 if test "${includedir}" = '${prefix}/include'; then
290 includedir='${prefix}/include/nspr'
293 AC_ARG_WITH(dist-prefix,
294 [ --with-dist-prefix=DIST_PREFIX
295 place build files in DIST_PREFIX [dist]],
296 dist_prefix=$withval)
298 AC_ARG_WITH(dist-bindir,
299 [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
300 dist_bindir=$withval)
302 AC_ARG_WITH(dist-includedir,
303 [ --with-dist-includedir=DIR
304 build include files in DIR [DIST_PREFIX/include/nspr]],
305 dist_includedir=$withval)
307 AC_ARG_WITH(dist-libdir,
308 [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
309 dist_libdir=$withval)
311 AC_SUBST(dist_prefix)
312 AC_SUBST(dist_bindir)
313 AC_SUBST(dist_includedir)
314 AC_SUBST(dist_libdir)
316 dnl Check if NSPR is being compiled for Mozilla
317 dnl Let --with-arg override environment setting
320 [ --with-mozilla Compile NSPR with Mozilla support],
321 [ if test "$withval" = "yes"; then
322 AC_DEFINE(MOZILLA_CLIENT)
327 [ if test -n "$MOZILLA_CLIENT"; then
328 AC_DEFINE(MOZILLA_CLIENT)
331 AC_ARG_ENABLE(optimize,
332 [ --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ],
333 [ if test "$enableval" != "no"; then
335 if test -n "$enableval" -a "$enableval" != "yes"; then
336 _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
337 _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
344 [ --enable-debug[=DBG] Enable debugging (using compiler flags DBG)],
345 [ if test "$enableval" != "no"; then
348 if test -n "$enableval" -a "$enableval" != "yes"; then
349 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
350 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
357 AC_ARG_ENABLE(debug-symbols,
358 [ --enable-debug-symbols[=DBG] Enable debugging symbols
359 (using compiler flags DBG)],
360 [ if test "$enableval" != "no"; then
362 if test -n "$enableval" -a "$enableval" != "yes"; then
363 if test -z "$_SAVE_DEBUG_FLAGS"; then
364 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
365 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
367 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
374 AC_ARG_ENABLE(win32-target,
375 [ --enable-win32-target=\$t
376 Specify win32 flavor. (WIN95 or WINNT)],
377 OS_TARGET=`echo $enableval | tr a-z A-Z`)
379 AC_ARG_ENABLE(symbian-target,
380 [ --enable-symbian-target=\$t
381 Specify symbian flavor. (WINSCW or GCCE)],
382 OS_TARGET=`echo $enableval | tr a-z A-Z`)
384 AC_ARG_ENABLE(debug-rtl,
385 [ --enable-debug-rtl Use the MSVC debug runtime library],
386 [ if test "$enableval" = "yes"; then
391 [ --enable-n32 Enable n32 ABI support (IRIX only)],
392 [ if test "$enableval" = "yes"; then
394 else if test "$enableval" = "no"; then
400 [ --enable-64bit Enable 64-bit support (on certain platforms)],
401 [ if test "$enableval" = "yes"; then
405 AC_ARG_ENABLE(mdupdate,
406 [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
407 [ if test "$enableval" = "yes"; then
412 [ --enable-cplus Enable some c++ api routines],
413 [ if test "$enableval" = "yes"; then
417 AC_ARG_WITH(arm-kuser,
418 [ --with-arm-kuser Use kuser helpers (Linux/ARM only)
419 (Requires kernel 2.6.13 or later)],
420 [ if test "$withval" = "yes"; then
421 AC_DEFINE(_PR_ARM_KUSER)
424 dnl ========================================================
425 dnl = Mac OS X SDK support
426 dnl ========================================================
427 AC_ARG_WITH(macos-sdk,
428 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
429 MACOS_SDK_DIR=$withval)
431 AC_ARG_ENABLE(macos-target,
432 [ --enable-macos-target=VER
433 Set the minimum MacOS version needed at runtime
434 [10.2 for ppc, 10.4 for x86]],
435 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
437 dnl ========================================================
439 dnl = Set the threading model
441 dnl ========================================================
445 case "${target_os}" in
457 dnl ========================================================
459 dnl = Set the default C compiler
461 dnl ========================================================
462 if test -z "$CC"; then
466 if test -z "$USE_NSPR_THREADS"; then
492 dnl ========================================================
494 dnl = Set the default C++ compiler
496 dnl ========================================================
497 if test -z "$CXX"; then
501 if test -z "$USE_NSPR_THREADS"; then
509 case "${target_os}" in
537 if test -z "$SKIP_PATH_CHECKS"; then
538 AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
541 if test -n "$MOZ_DEBUG"; then
543 DEFINES="$DEFINES -UNDEBUG"
545 case "${target_os}" in
547 DEFINES="$DEFINES -DDEBUG_${USER}"
549 msvc*|mks*|cygwin*|mingw*|wince*|winmo*|os2*)
550 DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
553 DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
558 DEFINES="$DEFINES -UDEBUG"
561 if test -z "$SKIP_COMPILER_CHECKS"; then
562 dnl ========================================================
563 dnl Checks for compilers.
564 dnl ========================================================
566 dnl Explicitly honor $CROSS_COMPILE to allow cross-compiling
567 dnl between toolkits on the same architecture, as when
568 dnl targeting the iOS Simulator from OS X.
569 if test "$target" != "$host" -o -n "$CROSS_COMPILE"; then
570 echo "cross compiling from $host to $target"
574 _SAVE_CFLAGS="$CFLAGS"
575 _SAVE_LDFLAGS="$LDFLAGS"
577 AC_MSG_CHECKING([for $host compiler])
578 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
579 if test -z "$HOST_CC"; then
580 AC_MSG_ERROR([no acceptable cc found in \$PATH])
582 AC_MSG_RESULT([$HOST_CC])
583 if test -z "$HOST_CFLAGS"; then
584 HOST_CFLAGS="$CFLAGS"
586 if test -z "$HOST_LDFLAGS"; then
587 HOST_LDFLAGS="$LDFLAGS"
591 CFLAGS="$HOST_CFLAGS"
592 LDFLAGS="$HOST_LDFLAGS"
594 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
595 AC_TRY_COMPILE([], [return 0;],
596 [AC_MSG_RESULT([yes])],
597 [AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.])] )
601 LDFLAGS=$_SAVE_LDFLAGS
603 case "$build:$target" in
604 powerpc-apple-darwin8*:i?86-apple-darwin*)
605 dnl The Darwin cross compiler doesn't necessarily point itself at a
606 dnl root that has libraries for the proper architecture, it defaults
607 dnl to the system root. The libraries in the system root on current
608 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
609 dnl checks will fail. Fake a working SDK in that case.
611 _SAVE_CXXFLAGS=$CXXFLAGS
612 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
613 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
615 *:arm*-apple-darwin*)
616 dnl The arm compiler doesn't appear to know about its root by default,
617 dnl so explicitly pass it one here. Later on we'll put this in CFLAGS
620 _SAVE_CXXFLAGS=$CXXFLAGS
621 CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS"
622 CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS"
626 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
629 if test -n "$USE_CPLUS"; then
630 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
635 case "$build:$target" in
636 powerpc-apple-darwin8*:i?86-apple-darwin*|*:arm*-apple-darwin*)
637 dnl Revert the changes made above. From this point on, the target
638 dnl compiler will never be used without applying the SDK to CFLAGS
639 dnl (see --with-macos-sdk below).
641 CXXFLAGS=$_SAVE_CXXFLAGS
645 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
646 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
647 AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
648 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
649 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
650 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
654 if test -n "$USE_CPLUS"; then
655 if test "$CC" = "cl" -a -z "$CXX"; then
663 AC_PATH_PROGS(AS, as, $CC)
664 AC_PATH_PROGS(AR, ar, echo not_ar)
665 AC_PATH_PROGS(LD, ld link, echo not_ld)
666 AC_PATH_PROGS(STRIP, strip, echo not_strip)
667 AC_PATH_PROGS(WINDRES, windres, echo not_windres)
668 if test -z "$HOST_CC"; then
671 if test -z "$HOST_CFLAGS"; then
672 HOST_CFLAGS="$CFLAGS"
676 if test "$GCC" = "yes"; then
679 if test "$GXX" = "yes"; then
682 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
687 case "$build:$target" in
688 i?86-apple-darwin*:powerpc-apple-darwin*)
689 dnl cross_compiling will have erroneously been set to "no" in this
690 dnl case, because the x86 build host is able to run ppc code in a
691 dnl translated environment, making a cross compiler appear native.
696 if test "$cross_compiling" = "yes"; then
702 dnl ========================================================
703 dnl Check for gcc -pipe support
704 dnl ========================================================
705 AC_MSG_CHECKING([for gcc -pipe support])
706 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
707 echo '#include <stdio.h>' > dummy-hello.c
708 echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
709 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
710 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
716 if test "$_res_as_stdin" = "yes"; then
718 CFLAGS="$CFLAGS -pipe"
719 AC_TRY_COMPILE( [ #include <stdio.h> ],
720 [printf("Hello World\n");],
721 [_res_gcc_pipe="yes"],
722 [_res_gcc_pipe="no"] )
725 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
727 CFLAGS="$CFLAGS -pipe"
728 CXXFLAGS="$CXXFLAGS -pipe"
732 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
733 AC_MSG_RESULT([$_res])
738 dnl ========================================================
739 dnl Profile guided optimization
740 dnl ========================================================
741 dnl Test for profiling options
742 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
744 _SAVE_CFLAGS="$CFLAGS"
745 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
747 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
748 AC_TRY_COMPILE([], [return 0;],
749 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
750 result="yes" ], result="no")
751 AC_MSG_RESULT([$result])
753 if test $result = "yes"; then
754 PROFILE_GEN_LDFLAGS="-fprofile-generate"
755 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
756 PROFILE_USE_LDFLAGS="-fprofile-use"
759 CFLAGS="$_SAVE_CFLAGS"
761 dnl ===============================================================
762 dnl Check for .hidden assembler directive and visibility attribute.
763 dnl Borrowed from glibc configure.in
764 dnl ===============================================================
765 if test "$GNU_CC"; then
766 AC_CACHE_CHECK(for visibility(hidden) attribute,
767 ac_cv_visibility_hidden,
768 [cat > conftest.c <<EOF
769 int foo __attribute__ ((visibility ("hidden"))) = 1;
771 ac_cv_visibility_hidden=no
772 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
773 if grep '\.hidden.*foo' conftest.s >/dev/null; then
774 ac_cv_visibility_hidden=yes
779 if test "$ac_cv_visibility_hidden" = "yes"; then
780 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
781 AC_CACHE_CHECK(for visibility pragma support,
782 ac_cv_visibility_pragma,
783 [cat > conftest.c <<EOF
784 #pragma GCC visibility push(hidden)
786 #pragma GCC visibility push(default)
789 ac_cv_visibility_pragma=no
790 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
791 if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
792 if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
793 ac_cv_visibility_pragma=yes
799 if test "$ac_cv_visibility_pragma" = "yes"; then
800 AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
801 # To work around a build problem on Linux x86-64 (Bugzilla bug
802 # 293438), we use the -fvisibility=hidden flag. This flag is less
803 # optimal than #pragma GCC visibility push(hidden) because the flag
804 # assumes that symbols defined outside the current source file have
805 # the default visibility. This has the advantage that we don't need
806 # to wrap system header files, but has the disadvantage that calls
807 # to hidden symbols defined in other source files cannot be
808 # optimized by the compiler. The -fvisibility=hidden flag does
809 # hide and export symbols correctly.
810 #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
811 #WRAP_SYSTEM_INCLUDES=1
812 VISIBILITY_FLAGS="-fvisibility=hidden"
813 WRAP_SYSTEM_INCLUDES=
818 fi # SKIP_COMPILER_CHECKS
820 dnl ========================================================
821 dnl Checks for programs.
822 dnl ========================================================
823 if test -z "$SKIP_PATH_CHECKS"; then
824 AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
825 elif test -z "$PERL"; then
829 dnl ========================================================
830 dnl Default platform specific options
831 dnl ========================================================
836 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
844 if test -n "$CROSS_COMPILE"; then
845 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
847 OS_TEST="${target_cpu}"
848 case "${target_os}" in
849 linux*) OS_ARCH=Linux ;;
850 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
851 mingw*) OS_ARCH=WINNT ;;
852 wince*) OS_ARCH=WINCE ;;
853 winmo*) OS_ARCH=WINCE ;;
854 darwin*) OS_ARCH=Darwin ;;
855 riscos*) OS_ARCH=RISCOS ;;
858 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
859 OS_RELEASE=`uname -r`
863 if test "$OS_ARCH" = "IRIX64"; then
867 if test "$OS_ARCH" = "AIX"; then
868 OS_RELEASE=`uname -v`.`uname -r`
871 if test "$OS_ARCH" = "FreeBSD"; then
872 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
875 if test "$OS_ARCH" = "Linux"; then
876 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
877 OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
880 #######################################################################
881 # Master "Core Components" macros for getting the OS target #
882 #######################################################################
885 # Note: OS_TARGET should be specified on the command line for gmake.
886 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
887 # The difference between the Win95 target and the WinNT target is that
888 # the WinNT target uses Windows NT specific features not available
889 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
890 # at lesser performance (the Win95 target uses threads; the WinNT target
893 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
898 # The following hack allows one to build on a WIN95 machine (as if
899 # s/he were cross-compiling on a WINNT host for a WIN95 target).
900 # It also accomodates for MKS's uname.exe. If you never intend
901 # to do development on a WIN95 machine, you don't need this hack.
916 CYGWIN_9*|CYGWIN_ME*)
917 OS_ARCH='CYGWIN_NT-4.0'
927 # On WIN32, we also define the variable CPU_ARCH.
933 if test "$CPU_ARCH" = "I386"; then
939 # If uname -s returns "Windows_NT", we assume that we are using
940 # the uname.exe in MKS toolkit.
942 # The -r option of MKS uname only returns the major version number.
943 # So we need to use its -v option to get the minor version number.
944 # Moreover, it doesn't have the -p option, so we need to use uname -m.
947 OS_MINOR_RELEASE=`uname -v`
948 if test "$OS_MINOR_RELEASE" = "00"; then
951 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
954 # MKS's uname -m returns "586" on a Pentium machine.
956 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
960 CYGWIN_NT*|MINGW*_NT*)
962 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
963 # the uname.exe in the Cygwin tools.
964 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
965 # the uname.exe in the MSYS tools.
967 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
971 # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
973 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
979 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
981 if test -n "$MOZ_DEBUG"; then
985 if test -z "$OS_TARGET"; then
988 if test "$OS_TARGET" = "WIN95"; then
991 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
993 dnl ========================================================
994 dnl Enable high-memory support on OS/2 by default.
995 dnl ========================================================
996 AC_ARG_ENABLE(os2-high-mem,
997 [ --disable-os2-high-mem Disable high-memory support on OS/2],
998 [ if test "$enableval" = "no"; then
1001 MOZ_OS2_HIGH_MEMORY=1
1004 dnl ========================================================
1005 dnl = ARM toolchain tweaks
1006 dnl ========================================================
1009 MOZ_ALIGN=toolchain-default
1012 arm*-android*|arm*-linuxandroid*)
1016 MOZ_FLOAT_ABI=softfp
1021 if test -n "$MOZ_PLATFORM_MAEMO"; then
1024 MOZ_FLOAT_ABI=softfp
1026 if test "$MOZ_PLATFORM_MAEMO" = 6; then
1032 dnl Kept for compatibility with some buildbot mozconfig
1033 AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval)
1036 [ --with-thumb[[=yes|no|toolchain-default]]]
1037 [ Use Thumb instruction set (-mthumb)],
1038 if test -z "$GNU_CC"; then
1039 AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults])
1043 AC_ARG_WITH(thumb-interwork,
1044 [ --with-thumb-interwork[[=yes|no|toolchain-default]]
1045 Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
1046 if test -z "$GNU_CC"; then
1047 AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults])
1049 MOZ_THUMB_INTERWORK=$withval)
1052 [ --with-arch=[[type|toolchain-default]]
1053 Use specific CPU features (-march=type)],
1054 if test -z "$GNU_CC"; then
1055 AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults])
1060 [ --with-fpu=[[type|toolchain-default]]
1061 Use specific FPU type (-mfpu=type)],
1062 if test -z "$GNU_CC"; then
1063 AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults])
1067 AC_ARG_WITH(float-abi,
1068 [ --with-float-abi=[[type|toolchain-default]]
1069 Use specific arm float ABI (-mfloat-abi=type)],
1070 if test -z "$GNU_CC"; then
1071 AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults])
1073 MOZ_FLOAT_ABI=$withval)
1075 AC_ARG_WITH(soft-float,
1076 [ --with-soft-float[[=yes|no|toolchain-default]]
1077 Use soft float library (-msoft-float)],
1078 if test -z "$GNU_CC"; then
1079 AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults])
1081 MOZ_SOFT_FLOAT=$withval)
1084 toolchain-default|"")
1088 arch_flag="-march=$MOZ_ARCH"
1092 case "$MOZ_THUMB" in
1095 thumb_flag="-mthumb"
1102 _SAVE_CFLAGS="$CFLAGS"
1104 AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
1107 CFLAGS="$_SAVE_CFLAGS"
1112 case "$MOZ_THUMB_INTERWORK" in
1114 thumb_interwork_flag="-mthumb-interwork"
1117 thumb_interwork_flag="-mno-thumb-interwork"
1119 *) # toolchain-default
1120 thumb_interwork_flag=""
1125 toolchain-default|"")
1129 fpu_flag="-mfpu=$MOZ_FPU"
1133 case "$MOZ_FLOAT_ABI" in
1134 toolchain-default|"")
1138 float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
1142 case "$MOZ_SOFT_FLOAT" in
1144 soft_float_flag="-msoft-float"
1147 soft_float_flag="-mno-soft-float"
1149 *) # toolchain-default
1154 case "$MOZ_ALIGN" in
1155 toolchain-default|"")
1159 align_flag="-mno-unaligned-access"
1162 align_flag="-munaligned-access"
1169 if test -n "$align_flag"; then
1170 _SAVE_CFLAGS="$CFLAGS"
1171 CFLAGS="$CFLAGS $align_flag"
1172 AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported)
1173 AC_TRY_COMPILE([],[],,align_flag="")
1174 CFLAGS="$_SAVE_CFLAGS"
1177 dnl Use echo to avoid accumulating space characters
1178 all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag`
1179 if test -n "$all_flags"; then
1180 _SAVE_CFLAGS="$CFLAGS"
1182 AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
1183 AC_TRY_COMPILE([],[return 0;],
1184 AC_MSG_RESULT([yes]),
1187 CFLAGS="$_SAVE_CFLAGS $all_flags"
1188 CXXFLAGS="$CXXFLAGS $all_flags"
1189 ASFLAGS="$ASFLAGS $all_flags"
1190 if test -n "$thumb_flag"; then
1191 LDFLAGS="$LDFLAGS $thumb_flag"
1195 dnl ========================================================
1196 dnl Override of system specific host options
1197 dnl ========================================================
1202 *-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*)
1203 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
1204 if test `echo "${PATH}" | grep -c \;` = 0; then
1205 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
1209 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
1214 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1218 dnl ========================================================
1219 dnl Override of system specific target options
1220 dnl ========================================================
1227 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
1228 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
1229 case "${target_os}" in
1231 AC_DEFINE(AIX_RENAME_SELECT)
1232 AC_DEFINE(_PR_NO_LARGE_FILES)
1233 AIX_LINK_OPTS='-bnso -berok'
1234 PR_MD_ASFILES=os_AIX.s
1237 AC_DEFINE(AIX_TIMERS)
1238 AC_DEFINE(_PR_NO_LARGE_FILES)
1242 AIX_LINK_OPTS='-bnso -berok'
1243 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
1244 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
1247 AC_DEFINE(AIX_TIMERS)
1248 AC_DEFINE(_PR_HAVE_OFF64_T)
1249 AIX_LINK_OPTS='-brtl -bnso -berok'
1252 AC_DEFINE(AIX_TIMERS)
1253 AC_DEFINE(_PR_HAVE_OFF64_T)
1254 AC_DEFINE(AIX4_3_PLUS)
1255 AC_DEFINE(HAVE_SOCKLEN_T)
1256 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1258 AIX_LINK_OPTS='-brtl -bnso -berok'
1261 AC_DEFINE(AIX_TIMERS)
1262 AC_DEFINE(_PR_HAVE_OFF64_T)
1263 AC_DEFINE(AIX4_3_PLUS)
1264 AC_DEFINE(HAVE_SOCKLEN_T)
1265 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1267 AIX_LINK_OPTS='-brtl -bnso -berok'
1270 CFLAGS="$CFLAGS -qro -qroconst"
1271 AIX_WRAP='$(DIST)/lib/aixwrap.o'
1272 AIX_TMP='./_aix_tmp.o'
1273 if test -n "$USE_64"; then
1274 MDCPUCFG_H=_aix64.cfg
1277 MDCPUCFG_H=_aix32.cfg
1280 RESOLVE_LINK_SYMBOLS=1
1287 AC_DEFINE(_POSIX_SOURCE)
1289 MDCPUCFG_H=_beos.cfg
1292 RESOLVE_LINK_SYMBOLS=1
1293 case "${target_cpu}" in
1296 _DEBUG_FLAGS='-gdwarf-2 -O0'
1297 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1298 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1304 DSO_LDOPTS='-xms -export pragma -init _init_routine_ -term _term_routine_ -lroot -lnet /boot/develop/lib/ppc/glue-noinit.a /boot/develop/lib/ppc/init_term_dyn.o /boot/develop/lib/ppc/start_dyn.o'
1306 _DEBUG_FLAGS='-g -O0'
1314 AC_DEFINE(NEED_BSDREGEX)
1316 CFLAGS="$CFLAGS -Wall -Wno-format"
1317 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1319 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1321 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1325 MDCPUCFG_H=_bsdi.cfg
1330 case "$target_os" in
1332 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1333 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1334 AC_DEFINE(_PR_NEED_H_ERRNO)
1341 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1342 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1344 AC_DEFINE(USE_DLFCN)
1345 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1346 PR_MD_ASFILES=os_BSD_OS_386_2.s
1350 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1351 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1353 AC_DEFINE(USE_DLFCN)
1354 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1355 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1357 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1359 case "$target_os" in
1360 bsdi4.2* | bsdi4.3* | bsdi5.*)
1361 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1362 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1367 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1368 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1370 AC_DEFINE(USE_DLFCN)
1371 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1380 AC_DEFINE(HAVE_BSD_FLOCK)
1381 AC_DEFINE(HAVE_SOCKLEN_T)
1382 AS='$(CC) -x assembler-with-cpp'
1383 CFLAGS="$CFLAGS -Wall -fno-common"
1384 case "${target_cpu}" in
1389 if test -n "$USE_64"; then
1402 if test "`echo $CC | grep -c '\-arch '`" = "0"; then
1403 CC="$CC -arch $CPU_ARCH"
1405 AC_CHECK_HEADER(crt_externs.h)
1407 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1409 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1410 STRIP="$STRIP -x -S"
1413 MDCPUCFG_H=_darwin.cfg
1414 PR_MD_CSRCS=darwin.c
1415 PR_MD_ASFILES=os_Darwin.s
1417 # Add Mac OS X support for loading CFM & CFBundle plugins
1418 if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1419 AC_DEFINE(XP_MACOSX)
1422 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1423 dnl Use the specified value
1424 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1425 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1426 dnl No value specified on the command line or in the environment,
1427 dnl use the lesser of the library's minimum or the architecture's
1429 case "${target_cpu}" in
1431 dnl Architecture minimum 10.2
1432 export MACOSX_DEPLOYMENT_TARGET=10.2
1435 dnl Architecture minimum 10.4
1436 export MACOSX_DEPLOYMENT_TARGET=10.4
1441 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1442 dnl in use. NEXT_ROOT will be set and exported if it's needed for
1445 if test "$MACOS_SDK_DIR"; then
1446 dnl Sync this section with the one in Mozilla's top level.
1448 if test ! -d "$MACOS_SDK_DIR"; then
1449 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1450 specify a valid SDK. SDKs are installed when the optional cross-development
1451 tools are selected during the Xcode/Developer Tools installation.])
1455 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1456 GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1457 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1459 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1460 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1461 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1462 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1463 SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1466 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1468 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1470 dnl CPP needs to be set for AC_CHECK_HEADER.
1471 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1474 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1476 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1477 dnl The build host is running Tiger (10.4) or earlier.
1478 dnl ld support for -syslibroot is compiler-agnostic, but
1479 dnl only available on Tiger and later. On Tiger and
1480 dnl earlier build hosts, just rely on NEXT_ROOT, because
1481 dnl it's not been shown to cause any problems.
1482 MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}"
1484 dnl The build host is running Leopard (10.5) or later.
1485 dnl With NEXT_ROOT set, the linker will still not apply
1486 dnl it when resolving dependencies. This causes problems
1487 dnl on Leopard, where an SDK depends on frameworks which
1488 dnl were present in earlier OS releases (and the associated
1489 dnl SDK) but not in Leopard. -syslibroot does not have
1490 dnl this problem, but it results in harmless warnings when
1491 dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1492 dnl on Leopard because the compiler uses it too.
1493 MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1496 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1497 export NEXT_ROOT=$MACOS_SDK_DIR
1499 if test -n "$CROSS_COMPILE" ; then
1500 dnl NEXT_ROOT will be in the environment, but it
1501 dnl shouldn't be set for the build host. HOST_CXX is
1502 dnl presently unused.
1503 HOST_CC="NEXT_ROOT= $HOST_CC"
1504 HOST_CXX="NEXT_ROOT= $HOST_CXX"
1507 dnl gcc >= 4.0 uses different paths than above, but knows
1508 dnl how to find them itself.
1509 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1511 dnl CPP needs to be set for AC_CHECK_HEADER.
1512 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1514 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1515 dnl has an ld that supports -syslibroot. Don't set
1516 dnl NEXT_ROOT because it will be ignored and cause
1517 dnl warnings when -syslibroot is specified.
1518 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1519 dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1520 dnl based on the -isysroot it receives.
1521 LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1523 dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1525 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1534 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1538 AC_DEFINE(_DGUX_SOURCE)
1539 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1543 MDCPUCFG_H=_dgux.cfg
1548 if test -z "$USE_NSPR_THREADS"; then
1553 AC_DEFINE(HAVE_BSD_FLOCK)
1554 AC_DEFINE(HAVE_SOCKLEN_T)
1555 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1556 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1557 if test "$MOZ_OBJFORMAT" = "elf"; then
1562 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1564 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1565 MDCPUCFG_H=_freebsd.cfg
1566 PR_MD_CSRCS=freebsd.c
1572 AC_DEFINE(_HPUX_SOURCE)
1573 # OSF1 and HPUX report the POLLHUP event for a socket when the
1574 # shutdown(SHUT_WR) operation is called for the remote end, even though
1575 # the socket is still writeable. Use select(), instead of poll(), to
1576 # workaround this problem.
1577 AC_DEFINE(_PR_POLL_WITH_SELECT)
1578 AC_DEFINE(_USE_BIG_FDS)
1579 DSO_LDOPTS='-b +h $(notdir $@)'
1581 if test "$OS_TEST" = "ia64"; then
1583 DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1584 CPU_ARCH_TAG=_$OS_TEST
1585 if test -z "$USE_64"; then
1588 PR_MD_ASFILES=os_HPUX_ia64.s
1592 PR_MD_ASFILES=os_HPUX.s
1594 if test -n "$USE_64"; then
1595 MDCPUCFG_H=_hpux64.cfg
1597 MDCPUCFG_H=_hpux32.cfg
1599 if test -z "$GNU_CC"; then
1605 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1608 if test -n "$MOZILLA_CLIENT"; then
1609 DEFAULT_IMPL_STRATEGY=_EMU
1612 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1613 AC_DEFINE(_PR_NEED_H_ERRNO)
1615 DEFAULT_IMPL_STRATEGY=_EMU
1619 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1620 AC_DEFINE(_PR_NO_LARGE_FILES)
1623 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1624 AC_DEFINE(_PR_NEED_H_ERRNO)
1627 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1628 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1631 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1632 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1635 # HP-UX 11i v2 (B.11.23) or higher
1637 case "$OS_RELEASE" in
1638 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1644 if test "$OS_RELEASE" = "B.10.01"; then
1646 DEFAULT_IMPL_STRATEGY=_EMU
1649 if test "$OS_RELEASE" = "B.10.10"; then
1651 AC_DEFINE(HPUX10_10)
1652 DEFAULT_IMPL_STRATEGY=_PTH
1655 if test "$OS_RELEASE" = "B.10.20"; then
1657 AC_DEFINE(HPUX10_20)
1658 if test -z "$GNU_CC"; then
1659 CFLAGS="$CFLAGS +DAportable +DS1.1"
1660 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1662 DEFAULT_IMPL_STRATEGY=_PTH
1665 if test "$OS_RELEASE" = "B.10.30"; then
1667 AC_DEFINE(HPUX10_30)
1668 if test -z "$GNU_CC"; then
1669 CFLAGS="$CFLAGS +DAportable +DS1.1"
1670 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1672 DEFAULT_IMPL_STRATEGY=_PTH
1675 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1678 AC_DEFINE(_LARGEFILE64_SOURCE)
1679 AC_DEFINE(_PR_HAVE_OFF64_T)
1680 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1681 if test -z "$GNU_CC"; then
1682 if test -z "$USE_64"; then
1683 if test "$OS_TEST" = "ia64"; then
1684 CFLAGS="$CFLAGS +DD32"
1685 CXXFLAGS="$CXXFLAGS +DD32"
1687 CFLAGS="$CFLAGS +DAportable +DS2.0"
1688 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1691 if test "$OS_TEST" = "ia64"; then
1692 CFLAGS="$CFLAGS +DD64"
1693 CXXFLAGS="$CXXFLAGS +DD64"
1695 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1696 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1700 DEFAULT_IMPL_STRATEGY=_PTH
1703 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1707 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1709 if test "$USE_NSPR_THREADS"; then
1712 if test "$USE_USER_PTHREADS"; then
1722 AC_DEFINE(_SGI_MP_SOURCE)
1723 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1725 PR_MD_ASFILES=os_Irix.s
1726 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1728 RESOLVE_LINK_SYMBOLS=1
1729 if test -n "$USE_64"; then
1730 MDCPUCFG_H=_irix64.cfg
1732 MDCPUCFG_H=_irix32.cfg
1734 case "${target_os}" in
1751 if test "$GNU_CC"; then
1753 dnl If we are using gcc with native binutils, we need to
1755 dnl #lineno "filename" num num
1756 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1757 dnl gcc command line, which passes -P to the preprocessor.
1759 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1760 CFLAGS="$CFLAGS -Wall -Wno-format"
1761 _OPTIMIZE_FLAGS="-O6"
1763 if test -n "$USE_N32"; then
1764 AS='as -D_ASM $(INCLUDES) -n32'
1766 AS='as -D_ASM $(INCLUDES)'
1768 CFLAGS="$CFLAGS -fullwarn -xansi"
1769 if test "$USE_N32"; then
1770 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1772 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1774 if test "$USE_MDUPDATE"; then
1775 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1779 CFLAGS="$CFLAGS -multigot"
1780 DSO_LDOPTS="-no_unresolved"
1781 if test "$USE_N32"; then
1782 CFLAGS="$CFLAGS -n32 -woff 1209"
1783 DSO_LDOPTS="$DSO_LDOPTS -n32"
1785 if test "$USE_64"; then
1786 CFLAGS="$CFLAGS -64"
1788 CFLAGS="$CFLAGS -32"
1793 CFLAGS="$CFLAGS -xgot"
1797 if test "${target_os}" = "irix5.3"; then
1800 case "${target_os}" in
1802 if test -z "$GNU_CC"; then
1803 CFLAGS="$CFLAGS -mips3"
1805 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1806 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1807 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1812 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1817 *-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
1818 if test -z "$USE_NSPR_THREADS"; then
1823 AC_DEFINE(_GNU_SOURCE)
1824 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1826 *-android*|*-linuxandroid*)
1834 CFLAGS="$CFLAGS -Wall"
1835 CXXFLAGS="$CXXFLAGS -Wall"
1836 MDCPUCFG_H=_linux.cfg
1838 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1840 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1842 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1843 # combo is not yet good at debugging inlined
1844 # functions (even when using DWARF2 as the
1847 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1852 CPU_ARCH_TAG=_${CPU_ARCH}
1853 case "${target_cpu}" in
1857 CFLAGS="$CFLAGS -mieee"
1858 CXXFLAGS="$CXXFLAGS -mieee"
1862 PR_MD_ASFILES=os_Linux_x86.s
1865 PR_MD_ASFILES=os_Linux_ia64.s
1868 if test -n "$USE_64"; then
1869 PR_MD_ASFILES=os_Linux_x86_64.s
1872 PR_MD_ASFILES=os_Linux_x86.s
1878 PR_MD_ASFILES=os_Linux_ppc.s
1881 if test -n "$USE_64"; then
1885 PR_MD_ASFILES=os_Linux_ppc.s
1889 CFLAGS="$CFLAGS -m68020-60"
1890 CXXFLAGS="$CXXFLAGS -m68020-60"
1895 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1898 PR_MD_ARCH_DIR=windows
1899 RESOLVE_LINK_SYMBOLS=1
1901 if test -n "$GNU_CC"; then
1903 CXX="$CXX -mwindows"
1905 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1907 # Use temp file for windres (bug 213281)
1908 RCFLAGS='-O coff --use-temp-file'
1913 AR='lib -NOLOGO -OUT:"$@"'
1915 RANLIB='echo not_ranlib'
1916 STRIP='echo not_strip'
1918 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1923 # Determine compiler version
1925 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1927 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1928 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1929 _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1930 _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1931 _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1932 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1934 if test "$_CC_MAJOR_VERSION" -eq "14"; then
1935 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1936 dnl so be very specific here!
1937 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1938 if test $_CC_RELEASE -gt 50727; then
1940 elif test $_CC_BUILD -ge 762; then
1943 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
1944 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
1945 elif test $_CC_MAJOR_VERSION -ge 15; then
1947 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
1948 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
1951 if test -n "$_USE_DYNAMICBASE"; then
1952 DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1955 # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1956 # tape manipulation utility (or something else)
1957 if test "$MSC_VER" -ge "1400"; then
1959 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1962 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1963 if test -n "$MSMT_TOOL"; then
1964 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1965 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1966 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1971 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1975 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1976 DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1980 PROFILE_GEN_CFLAGS="-GL"
1981 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1982 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1983 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1985 if test "$MSC_VER" -ge "1800"; then
1986 dnl Visual C++ 2013 requires -FS when parallel building with
1987 dnl make -jN. If not specified, compiler sometimes emits C1041
1989 CFLAGS="$CFLAGS -FS"
1990 dnl -Gw can benefit when using linker optimization on PGO.
1991 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
1992 PROFILE_GEN_CFLAGS="$PROFILE_GEN_CFLAGS -Gw"
1993 PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -Gw"
1996 if test -z "$MOZ_OPTIMIZE"; then
1997 CFLAGS="$CFLAGS -Od"
2000 if test -n "$USE_DEBUG_RTL"; then
2001 CFLAGS="$CFLAGS -MDd"
2003 CFLAGS="$CFLAGS -MD"
2006 if test -n "$MOZ_DEBUG"; then
2009 DEFINES="$DEFINES -U_DEBUG"
2012 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2013 if test -n "$MOZ_OPTIMIZE"; then
2014 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
2015 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
2017 DLLFLAGS="$DLLFLAGS -DEBUG"
2018 LDFLAGS="$LDFLAGS -DEBUG"
2022 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
2023 if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
2024 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
2027 if test "$OS_TARGET" = "WINNT"; then
2028 CFLAGS="$CFLAGS -GT"
2029 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2030 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2032 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2033 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2037 if test -n "$USE_STATIC_TLS"; then
2038 AC_DEFINE(_PR_USE_STATIC_TLS)
2041 if test "$OS_TARGET" = "WINNT"; then
2045 # undefine WINNT as some versions of mingw gcc define it by default
2046 DEFINES="$DEFINES -UWINNT"
2047 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2050 if test "$CPU_ARCH" = "x86"; then
2053 CPU_ARCH_TAG=$CPU_ARCH
2056 if test -n "$USE_DEBUG_RTL"; then
2060 case "$OS_TARGET" in
2062 MDCPUCFG_H=_winnt.cfg
2065 MDCPUCFG_H=_win95.cfg
2068 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
2072 case "$target_cpu" in
2074 if test -n "$USE_64"; then
2089 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2098 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2100 AR_FLAGS='-NOLOGO -OUT:"$@"'
2105 MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
2107 PR_MD_ARCH_DIR=windows
2108 RESOLVE_LINK_SYMBOLS=1
2110 MDCPUCFG_H=_win95.cfg
2111 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2112 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2114 DLLFLAGS='-OUT:"$@"'
2115 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2116 OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2117 OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
2118 DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
2127 AC_DEFINE(HAVE_BSD_FLOCK)
2128 if test -z "$USE_NSPR_THREADS"; then
2131 MDCPUCFG_H=_netbsd.cfg
2132 PR_MD_CSRCS=netbsd.c
2134 DSO_CFLAGS='-fPIC -DPIC'
2135 CFLAGS="$CFLAGS -ansi -Wall"
2136 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2137 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
2139 if test -z "$OBJECT_FMT"; then
2140 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
2143 DSO_LDOPTS='-shared'
2147 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
2151 if test "$LIBRUNPATH"; then
2152 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
2159 AC_DEFINE(_QNX_SOURCE)
2160 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2163 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
2166 OS_LIBS="$OS_LIBS -lsocket"
2167 _OPTIMIZE_FLAGS="-O1"
2168 _DEBUG_FLAGS="-gstabs"
2174 AC_DEFINE(HAVE_BSD_FLOCK)
2175 AC_DEFINE(HAVE_SOCKLEN_T)
2176 CFLAGS="$CFLAGS -ansi -Wall"
2177 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2180 MDCPUCFG_H=_openbsd.cfg
2181 PR_MD_CSRCS=openbsd.c
2183 if test -z "$USE_NSPR_THREADS"; then
2186 DSO_LDOPTS='-shared -fPIC'
2187 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2191 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2194 AC_DEFINE(_REENTRANT)
2195 # OSF1 and HPUX report the POLLHUP event for a socket when the
2196 # shutdown(SHUT_WR) operation is called for the remote end, even though
2197 # the socket is still writeable. Use select(), instead of poll(), to
2198 # workaround this problem.
2199 AC_DEFINE(_PR_POLL_WITH_SELECT)
2201 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2205 if test -z "$GNU_CC"; then
2206 CC="$CC -std1 -ieee_with_inexact"
2207 if test "$OS_RELEASE" != "V2.0"; then
2208 CC="$CC -readonly_strings"
2210 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2211 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2213 CFLAGS="$CFLAGS -mieee"
2214 CXXFLAGS="$CXXFLAGS -mieee"
2217 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2218 AC_DEFINE(HAVE_INT_LOCALTIME_R)
2220 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2221 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2223 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2224 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2226 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2227 MDCPUCFG_H=_osf1.cfg
2234 AC_DEFINE(_PR_NEED_H_ERRNO)
2243 AC_DEFINE(_PR_NEED_H_ERRNO)
2245 MDCPUCFG_H=_riscos.cfg
2246 PR_MD_CSRCS=riscos.c
2248 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2249 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2258 AC_DEFINE(_PR_NEED_H_ERRNO)
2259 CC='cc -b elf -KPIC'
2260 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2263 DSO_LDOPTS='-b elf -G'
2264 MDCPUCFG_H=_scoos.cfg
2269 if test -z "$USE_NSPR_THREADS"; then
2278 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2280 MDCPUCFG_H=_solaris.cfg
2281 PR_MD_CSRCS=solaris.c
2283 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2284 RESOLVE_LINK_SYMBOLS=1
2285 case "${OS_RELEASE}" in
2289 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2293 if test -n "$GNU_CC"; then
2295 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2298 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2299 if test -n "$USE_B_DIRECT"; then
2300 DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2304 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2305 if test -n "$USE_B_DIRECT"; then
2306 DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2309 if test -n "$GNU_CC"; then
2310 CFLAGS="$CFLAGS -Wall"
2311 CXXFLAGS="$CXXFLAGS -Wall"
2312 if test -n "$USE_MDUPDATE"; then
2313 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2314 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2316 GCC_AS=`$CC -print-prog-name=as`
2317 if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2321 CFLAGS="$CFLAGS -xstrconst"
2322 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2323 if test -z "$MOZ_OPTIMIZE"; then
2324 CFLAGS="$CFLAGS -xs"
2325 CXXFLAGS="$CXXFLAGS -xs"
2327 _OPTIMIZE_FLAGS=-xO4
2329 if test -z "$GNU_AS"; then
2330 ASFLAGS="$ASFLAGS -Wa,-P"
2332 if test -n "$USE_64"; then
2333 if test -n "$GNU_CC"; then
2337 if test "$OS_TEST" = "i86pc"; then
2338 CC="$CC -xarch=amd64"
2339 CXX="$CXX -xarch=amd64"
2342 CXX="$CXX -xarch=v9"
2346 if test "$OS_TEST" = "i86pc"; then
2347 if test -z "$USE_64"; then
2350 CPU_ARCH_TAG=_$OS_TEST
2351 # The default debug format, DWARF (-g), is not supported by gcc
2352 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
2353 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2354 # If your gcc uses GNU as, you do not need the -Wa,-s option.
2355 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2356 _DEBUG_FLAGS=-gstabs
2357 if test -z "$GNU_AS"; then
2358 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2362 case "${target_os}" in
2364 AC_DEFINE(_PR_NO_LARGE_FILES)
2367 AC_DEFINE(_PR_NO_LARGE_FILES)
2370 AC_DEFINE(SOLARIS2_5)
2373 AC_DEFINE(_PR_HAVE_OFF64_T)
2374 # The lfcompile64(5) man page on Solaris 2.6 says:
2375 # For applications that do not wish to conform to the POSIX or
2376 # X/Open specifications, the 64-bit transitional interfaces
2377 # are available by default. No compile-time flags need to be
2379 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2380 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2381 if test -n "$GNU_CC"; then
2382 AC_DEFINE(_LARGEFILE64_SOURCE)
2386 case "${target_os}" in
2398 # Solaris 8 or higher has IPv6.
2399 AC_DEFINE(_PR_INET6)
2402 if test "$CPU_ARCH" = "sparc"; then
2403 # 64-bit Solaris SPARC requires V9 architecture, so the following
2405 if test -z "$USE_64"; then
2406 ULTRASPARC_LIBRARY=nspr_flt
2409 # Purify requires that binaries linked against nspr also
2410 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2412 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2413 OS_LIBS="$OS_LIBS $_librt"
2422 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2423 AC_DEFINE(_PR_NO_LARGE_FILES)
2424 CC='$(NSDEPTH)/build/hcc cc'
2425 CXX='$(NSDEPTH)/build/hcpp CC'
2426 MDCPUCFG_H=_unixware.cfg
2428 AC_DEFINE(_LARGEFILE64_SOURCE)
2429 AC_DEFINE(_PR_HAVE_OFF64_T)
2430 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2431 MDCPUCFG_H=_unixware7.cfg
2433 PR_MD_CSRCS=unixware.c
2439 AC_ARG_WITH(symbian-sdk,
2440 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
2441 The path to the Symbian SDK],
2442 SYMBIAN_SDK_DIR=$withval)
2444 echo -----------------------------------------------------------------------------
2445 echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2446 echo -----------------------------------------------------------------------------
2451 AC_DEFINE(__SYMBIAN32__)
2454 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2455 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2456 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2457 AC_DEFINE(HAVE_SOCKLEN_T)
2465 MDCPUCFG_H=_symbian.cfg
2466 PR_MD_CSRCS=symbian.c
2468 RANLIB='echo no ranlib '
2471 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2472 CFLAGS="$CFLAGS -MD -nostdinc"
2473 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2474 echo -------------------------------------------------------
2475 echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2476 echo -------------------------------------------------------
2477 case "$OS_TARGET" in
2483 WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2484 CFLAGS="$CFLAGS -O0 -inline off -wchar_t off -align 4 -warnings on -w nohidevirtual,nounusedexpr -msgstyle gcc -enum int -str pool -exc ms -trigraphs on -nostderr -gccdep -cwd source -i- -I\$(VPATH)"
2485 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2486 AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2490 AC_DEFINE(__WINSCW__)
2491 DEFINES="$DEFINES -U_WIN32"
2494 CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2495 CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2496 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2499 DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2502 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2505 CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2511 AC_DEFINE(BSD_SELECT)
2512 AC_DEFINE(TCPV40HDRS)
2520 RESOLVE_LINK_SYMBOLS=1
2525 CFLAGS="$CFLAGS -Wall -Zomf"
2526 CXXFLAGS="$CFLAGS -Wall -Zomf"
2527 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2529 DSO_LDOPTS='-Zomf -Zdll'
2531 _OPTIMIZE_FLAGS="-O2 -s"
2532 _DEBUG_FLAGS="-g -fno-inline"
2533 if test -n "$MOZ_OPTIMIZE"; then
2534 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2538 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2539 LDFLAGS="$LDFLAGS -Zhigh-mem"
2540 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2543 # GCC for OS/2 currently predefines these, but we don't want them
2544 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2553 if test -z "$SKIP_LIBRARY_CHECKS"; then
2554 dnl ========================================================
2555 dnl Check for system libraries
2556 dnl ========================================================
2557 dnl AC_CHECK_LIB(C, main)
2558 dnl AC_CHECK_LIB(C_r, main)
2559 dnl AC_CHECK_LIB(c, main)
2560 dnl AC_CHECK_LIB(c_r, main)
2561 dnl AC_CHECK_LIB(dce, main)
2562 dnl AC_CHECK_LIB(dl, main)
2563 dnl AC_CHECK_LIB(dld, main)
2564 dnl AC_CHECK_LIB(gen, main)
2565 dnl AC_CHECK_LIB(ip6, main)
2566 dnl AC_CHECK_LIB(l, main)
2567 dnl AC_CHECK_LIB(m, main)
2568 dnl AC_CHECK_LIB(nsl, main)
2569 dnl AC_CHECK_LIB(posix4, main)
2570 dnl AC_CHECK_LIB(prstrms, main)
2571 dnl AC_CHECK_LIB(prstrms_shr, main)
2572 dnl AC_CHECK_LIB(pthread, main)
2573 dnl AC_CHECK_LIB(pthreads, main)
2574 dnl AC_CHECK_LIB(resolv, main)
2575 dnl AC_CHECK_LIB(rt, main)
2576 dnl AC_CHECK_LIB(socket, main)
2577 dnl AC_CHECK_LIB(svld, main)
2578 dnl AC_CHECK_LIB(thread, main)
2579 dnl AC_CHECK_LIB(vms_jackets, main)
2582 dnl We don't want anything to link with libdl even if it's present on OS X,
2583 dnl since it's not used and not part of the default installation.
2584 dnl The same goes for BeOS.
2585 dnl OS/2 has dlfcn in libc.
2588 *-darwin*|*-beos*|*-os2*)
2591 AC_CHECK_LIB(dl, dlopen,
2592 [AC_CHECK_HEADER(dlfcn.h,
2593 OS_LIBS="-ldl $OS_LIBS")])
2598 dnl ========================================================
2599 dnl Check for system header files.
2600 dnl ========================================================
2601 dnl AC_HEADER_DIRENT
2603 dnl AC_HEADER_SYS_WAIT
2604 dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2606 dnl ========================================================
2607 dnl Check for typedefs and structs
2608 dnl ========================================================
2615 dnl AC_STRUCT_ST_BLKSIZE
2616 dnl AC_STRUCT_ST_BLOCKS
2617 dnl AC_STRUCT_ST_RDEV
2621 dnl ========================================================
2622 dnl Checks for library functions.
2623 dnl ========================================================
2624 AC_PROG_GCC_TRADITIONAL
2626 LIBS="$LIBS $OS_LIBS"
2627 AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
2632 dnl AC_FUNC_SETVBUF_REVERSED
2634 dnl AC_FUNC_STRFTIME
2635 dnl AC_FUNC_UTIME_NULL
2637 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2639 dnl ========================================================
2641 dnl ========================================================
2643 dnl ======================================================
2644 dnl = Enable compiling with ccache
2645 dnl ======================================================
2647 [ --with-ccache[=path/to/ccache]
2648 Enable compiling with ccache],
2649 CCACHE=$withval, CCACHE="no")
2651 if test "$CCACHE" != "no"; then
2652 if test -n "$CCACHE"; then
2653 if test "$CCACHE" = "yes"; then
2656 if test ! -e "$CCACHE"; then
2657 AC_MSG_ERROR([$CCACHE not found])
2661 AC_PATH_PROGS(CCACHE, $CCACHE ccache)
2662 if test -z "$CCACHE" -o "$CCACHE" = ":"; then
2663 AC_MSG_ERROR([ccache not found])
2664 elif test -x "$CCACHE"; then
2668 AC_MSG_ERROR([$CCACHE is not executable])
2672 dnl ========================================================
2674 dnl = --enable-strip
2676 dnl = Enable stripping of libs and executables
2678 dnl ========================================================
2679 AC_ARG_ENABLE(strip,
2680 [ --enable-strip Enable stripping of shared libs and programs],
2681 [ if test "$enableval" = "yes"; then
2685 dnl Check for hpux options
2686 case "${target_os}" in
2688 if test -z "$GNU_CC"; then
2690 AC_CACHE_CHECK(for +Olit support,
2691 ac_cv_hpux_usable_olit_option,
2692 dnl since aCC doesn't throw an error on invalid options,
2693 dnl we have to test this the hard way
2694 [ac_cv_hpux_usable_olit_option=no
2696 echo 'int main() { return 0; }' | cat > conftest.c
2697 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2698 if test $? -eq 0; then
2699 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2700 ac_cv_hpux_usable_olit_option=yes
2706 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2707 CFLAGS="$CFLAGS +Olit=all"
2708 CXXFLAGS="$CXXFLAGS +Olit=all"
2710 CFLAGS="$CFLAGS +ESlit"
2711 CXXFLAGS="$CXXFLAGS +ESlit"
2718 dnl Apparently, some systems cannot properly check for the pthread
2719 dnl library unless <pthread.h> is included so we need to test
2722 dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2723 AC_DEFUN(MOZ_CHECK_PTHREADS,
2725 AC_MSG_CHECKING([for pthread_create in -l$1])
2727 #include <pthread.h>
2728 void *foo(void *v) { return v; }
2731 if (!pthread_create(&t, 0, &foo, 0)) {
2736 echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2737 ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2739 rm -f dummy.c dummy${ac_exeext} ;
2740 if test "$_res" = "0"; then
2741 AC_MSG_RESULT([yes])
2749 case "$target_os" in
2757 MOZ_CHECK_PTHREADS(pthreads,
2758 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2759 MOZ_CHECK_PTHREADS(pthread,
2760 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2761 MOZ_CHECK_PTHREADS(c_r,
2762 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2763 MOZ_CHECK_PTHREADS(c,
2772 AC_ARG_WITH(pthreads,
2773 [ --with-pthreads Use system pthreads library as thread subsystem],
2774 [ if test "$withval" = "yes"; then
2775 if test -n "$_HAVE_PTHREADS"; then
2780 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2786 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2792 AC_ARG_ENABLE(user-pthreads,
2793 [ --enable-user-pthreads Build using userland pthreads],
2794 [ if test "$enableval" = "yes"; then
2795 if test -n "$_HAVE_PTHREADS"; then
2800 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2804 AC_ARG_ENABLE(nspr-threads,
2805 [ --enable-nspr-threads Build using classic nspr threads],
2806 [ if test "$enableval" = "yes"; then
2814 AC_ARG_WITH(bthreads,
2815 [ --with-bthreads Use system bthreads library as thread subsystem
2817 [ if test "$withval" = "yes"; then
2825 fi # SKIP_LIBRARY_CHECKS
2828 [ --enable-ipv6 Compile ipv6 support],
2829 [ if test "$enableval" = "yes"; then
2835 if test -n "$USE_PTHREADS"; then
2836 dnl See if -pthread is supported.
2838 ac_cv_have_dash_pthread=no
2839 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2840 echo 'int main() { return 0; }' | cat > conftest.c
2841 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2842 if test $? -eq 0; then
2843 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2844 ac_cv_have_dash_pthread=yes
2845 case "$target_os" in
2847 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2850 CFLAGS="$CFLAGS -pthread"
2851 CXXFLAGS="$CXXFLAGS -pthread"
2857 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2860 dnl See if -pthreads is supported.
2862 ac_cv_have_dash_pthreads=no
2863 if test "$ac_cv_have_dash_pthread" = "no"; then
2864 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2865 echo 'int main() { return 0; }' | cat > conftest.c
2866 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2867 if test $? -eq 0; then
2868 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2869 ac_cv_have_dash_pthreads=yes
2870 CFLAGS="$CFLAGS -pthreads"
2871 CXXFLAGS="$CXXFLAGS -pthreads"
2875 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2880 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2885 AC_DEFINE(_REENTRANT)
2886 AC_DEFINE(_THREAD_SAFE)
2887 dnl -pthread links in -lc_r, so don't specify it explicitly.
2888 if test "$ac_cv_have_dash_pthread" = "yes"; then
2889 _PTHREAD_LDFLAGS="-pthread"
2891 _PTHREAD_LDFLAGS="-lc_r"
2895 if test "$ac_cv_have_dash_pthread" = "yes"; then
2896 _PTHREAD_LDFLAGS="-pthread"
2900 AC_DEFINE(_THREAD_SAFE)
2901 dnl -pthread links in -lc_r, so don't specify it explicitly.
2902 if test "$ac_cv_have_dash_pthread" = "yes"; then
2907 if test "$ac_cv_have_dash_pthread" = "yes"; then
2908 _PTHREAD_LDFLAGS=-pthread
2911 *-linux*|*-gnu*|*-k*bsd*-gnu)
2912 AC_DEFINE(_REENTRANT)
2917 if test -n "$USE_USER_PTHREADS"; then
2924 dnl Special thread exceptions
2928 if test -n "$USE_NSPR_THREADS"; then
2929 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2931 case "$target_os" in
2933 if test -z "$USE_PTHREADS"; then
2934 AC_DEFINE(AIX_RENAME_SELECT)
2938 if test -z "$USE_NSPR_THREADS"; then
2939 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2943 if test -z "$USE_NSPR_THREADS"; then
2944 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2946 if test -n "$USE_PTHREADS"; then
2947 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2951 if test -z "$USE_NSPR_THREADS"; then
2952 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2954 if test -n "$USE_PTHREADS"; then
2955 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2961 if test -n "$USE_PTHREADS"; then
2962 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2966 if test -n "$USE_NSPR_THREADS"; then
2967 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2971 if test -n "$USE_NSPR_THREADS"; then
2972 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2974 if test "$USE_PTHREADS"; then
2975 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2976 AC_DEFINE(_REENTRANT)
2977 AC_DEFINE(_PR_DCETHREADS)
2979 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2980 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2983 if test "$USE_USER_PTHREADS"; then
2984 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2988 if test "${target_os}" = "irix6.5"; then
2989 if test -n "$USE_PTHREADS"; then
2990 AC_DEFINE(_PR_HAVE_GETHOST_R)
2991 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2995 *-linux*|*-gnu*|*-k*bsd*-gnu)
2996 if test -n "$USE_NSPR_THREADS"; then
2997 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3000 *-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*|*-os2*|*-beos*)
3001 dnl win32, wince, os2 & beos cannot use pthreads
3006 *-netbsd*|*-openbsd*)
3007 if test -n "$USE_NSPR_THREADS"; then
3008 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3012 if test -n "$USE_NSPR_THREADS"; then
3013 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3015 if test -n "$USE_PTHREADS"; then
3016 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
3019 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
3024 if test -n "$USE_NSPR_THREADS"; then
3025 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3027 if test -n "$USE_PTHREADS"; then
3028 AC_DEFINE(_REENTRANT)
3029 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
3030 if test "$OS_TEST" = "i86pc"; then
3031 if test -n "$USE_64"; then
3032 PR_MD_ASFILES=os_SunOS_x86_64.s
3034 PR_MD_ASFILES=os_SunOS_x86.s
3037 if test -n "$USE_64"; then
3038 PR_MD_ASFILES=os_SunOS_sparcv9.s
3044 if test -n "$USE_PTHREADS"; then
3045 AC_DEFINE(_PR_HAVE_GETHOST_R)
3046 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
3051 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
3053 dnl If the user passed in arg to --enable-optimize or --enable-debug,
3054 dnl make sure that we use it.
3055 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
3056 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
3059 if test -n "$_SAVE_DEBUG_FLAGS"; then
3060 _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
3063 if test -n "$MOZ_OPTIMIZE"; then
3064 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
3065 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
3068 if test -n "$MOZ_DEBUG_SYMBOLS"; then
3069 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
3070 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
3073 if test -n "$MOZ_OPTIMIZE"; then
3079 if test -n "$USE_64"; then
3083 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
3085 dnl ========================================================
3086 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
3087 dnl ========================================================
3088 case "$target_os" in
3090 CC="\$(CYGWIN_WRAPPER) $CC"
3091 CXX="\$(CYGWIN_WRAPPER) $CXX"
3092 RC="\$(CYGWIN_WRAPPER) $RC"
3096 dnl ========================================================
3097 dnl = Use malloc wrapper lib
3098 dnl ========================================================
3099 AC_ARG_ENABLE(wrap-malloc,
3100 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
3101 [ if test "$enableval" = "yes"; then
3105 if test -n "$_WRAP_MALLOC"; then
3106 if test -n "$GNU_CC"; then
3107 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
3108 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
3109 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
3110 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
3112 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
3116 dnl ========================================================
3117 dnl = Location of malloc wrapper lib
3118 dnl ========================================================
3119 AC_ARG_WITH(wrap-malloc,
3120 [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
3121 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
3123 dnl ========================================================
3124 dnl Substitution of found variables.
3125 dnl ========================================================
3126 AC_SUBST(SHELL_OVERRIDE)
3128 AC_SUBST(MOZILLA_CLIENT)
3135 AC_SUBST(HOST_CFLAGS)
3137 AC_SUBST(HOST_LDFLAGS)
3139 AC_SUBST(GCC_USE_GNU_LD)
3141 AC_SUBST(CROSS_COMPILE)
3143 AC_SUBST(MOZ_OPTIMIZE)
3145 AC_SUBST(MOZ_DEBUG_SYMBOLS)
3151 AC_SUBST(OBJECT_MODE)
3152 AC_SUBST(ENABLE_STRIP)
3154 AC_SUBST(USE_PTHREADS)
3155 AC_SUBST(USE_BTHREADS)
3156 AC_SUBST(USE_USER_PTHREADS)
3157 AC_SUBST(USE_NSPR_THREADS)
3162 AC_SUBST(MOD_MAJOR_VERSION)
3163 AC_SUBST(MOD_MINOR_VERSION)
3164 AC_SUBST(MOD_PATCH_VERSION)
3165 AC_SUBST(NSPR_MODNAME)
3166 AC_SUBST(MDCPUCFG_H)
3167 AC_SUBST(PR_MD_CSRCS)
3168 AC_SUBST(PR_MD_ASFILES)
3169 AC_SUBST(PR_MD_ARCH_DIR)
3172 AC_SUBST(OBJ_SUFFIX)
3173 AC_SUBST(LIB_SUFFIX)
3174 AC_SUBST(DLL_SUFFIX)
3175 AC_SUBST(ASM_SUFFIX)
3176 AC_SUBST(WRAP_LDFLAGS)
3178 AC_SUBST(DSO_CFLAGS)
3179 AC_SUBST(DSO_LDOPTS)
3183 AC_SUBST(OS_RELEASE)
3185 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3200 AC_SUBST(PROFILE_GEN_CFLAGS)
3201 AC_SUBST(PROFILE_GEN_LDFLAGS)
3202 AC_SUBST(PROFILE_USE_CFLAGS)
3203 AC_SUBST(PROFILE_USE_LDFLAGS)
3206 AC_SUBST(RESOLVE_LINK_SYMBOLS)
3207 AC_SUBST(AIX_LINK_OPTS)
3208 AC_SUBST(NOSUCHFILE)
3209 AC_SUBST(MOZ_OBJFORMAT)
3210 AC_SUBST(ULTRASPARC_LIBRARY)
3213 AC_SUBST(OBJDIR_NAME)
3214 AC_SUBST(RELEASE_OBJDIR_NAME)
3221 AC_SUBST(OS_DLLFLAGS)
3222 AC_SUBST(CYGWIN_WRAPPER)
3223 AC_SUBST(VISIBILITY_FLAGS)
3224 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3225 AC_SUBST(MACOS_SDK_DIR)
3226 AC_SUBST(SYMBIAN_SDK_DIR)
3230 dnl ========================================================
3231 dnl Generate output files.
3232 dnl ========================================================
3244 lib/libc/include/Makefile
3245 lib/libc/src/Makefile
3250 pr/include/md/Makefile
3251 pr/include/obsolete/Makefile
3252 pr/include/private/Makefile
3255 pr/src/linking/Makefile
3256 pr/src/malloc/Makefile
3258 pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3259 pr/src/memory/Makefile
3260 pr/src/misc/Makefile
3261 pr/src/threads/Makefile
3263 pr/tests/dll/Makefile
3266 if test "$OS_TARGET" = "Linux"; then
3267 MAKEFILES="$MAKEFILES
3270 elif test "$OS_TARGET" = "SunOS"; then
3271 MAKEFILES="$MAKEFILES
3272 pkg/solaris/Makefile
3273 pkg/solaris/SUNWpr/Makefile
3274 pkg/solaris/SUNWprd/Makefile
3278 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3279 MAKEFILES="$MAKEFILES
3280 pr/src/threads/combined/Makefile
3282 elif test -n "$USE_PTHREADS"; then
3283 MAKEFILES="$MAKEFILES
3284 pr/src/pthreads/Makefile
3286 elif test -n "$USE_BTHREADS"; then
3287 MAKEFILES="$MAKEFILES
3288 pr/src/bthreads/Makefile
3292 if test -n "$USE_CPLUS"; then
3293 MAKEFILES="$MAKEFILES
3294 pr/src/cplus/Makefile
3295 pr/src/cplus/tests/Makefile
3299 echo $MAKEFILES > unallmakefiles
3301 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])