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 ========================================================
1010 arm*-android*|arm*-linuxandroid*)
1014 MOZ_FLOAT_ABI=softfp
1018 if test -n "$MOZ_PLATFORM_MAEMO"; then
1021 MOZ_FLOAT_ABI=softfp
1023 if test "$MOZ_PLATFORM_MAEMO" = 6; then
1029 dnl Kept for compatibility with some buildbot mozconfig
1030 AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval)
1033 [ --with-thumb[[=yes|no|toolchain-default]]]
1034 [ Use Thumb instruction set (-mthumb)],
1035 if test -z "$GNU_CC"; then
1036 AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults])
1040 AC_ARG_WITH(thumb-interwork,
1041 [ --with-thumb-interwork[[=yes|no|toolchain-default]]
1042 Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
1043 if test -z "$GNU_CC"; then
1044 AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults])
1046 MOZ_THUMB_INTERWORK=$withval)
1049 [ --with-arch=[[type|toolchain-default]]
1050 Use specific CPU features (-march=type)],
1051 if test -z "$GNU_CC"; then
1052 AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults])
1057 [ --with-fpu=[[type|toolchain-default]]
1058 Use specific FPU type (-mfpu=type)],
1059 if test -z "$GNU_CC"; then
1060 AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults])
1064 AC_ARG_WITH(float-abi,
1065 [ --with-float-abi=[[type|toolchain-default]]
1066 Use specific arm float ABI (-mfloat-abi=type)],
1067 if test -z "$GNU_CC"; then
1068 AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults])
1070 MOZ_FLOAT_ABI=$withval)
1072 AC_ARG_WITH(soft-float,
1073 [ --with-soft-float[[=yes|no|toolchain-default]]
1074 Use soft float library (-msoft-float)],
1075 if test -z "$GNU_CC"; then
1076 AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults])
1078 MOZ_SOFT_FLOAT=$withval)
1081 toolchain-default|"")
1085 arch_flag="-march=$MOZ_ARCH"
1089 case "$MOZ_THUMB" in
1092 thumb_flag="-mthumb"
1099 _SAVE_CFLAGS="$CFLAGS"
1101 AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
1104 CFLAGS="$_SAVE_CFLAGS"
1109 case "$MOZ_THUMB_INTERWORK" in
1111 thumb_interwork_flag="-mthumb-interwork"
1114 thumb_interwork_flag="-mno-thumb-interwork"
1116 *) # toolchain-default
1117 thumb_interwork_flag=""
1122 toolchain-default|"")
1126 fpu_flag="-mfpu=$MOZ_FPU"
1130 case "$MOZ_FLOAT_ABI" in
1131 toolchain-default|"")
1135 float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
1139 case "$MOZ_SOFT_FLOAT" in
1141 soft_float_flag="-msoft-float"
1144 soft_float_flag="-mno-soft-float"
1146 *) # toolchain-default
1151 dnl Use echo to avoid accumulating space characters
1152 all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
1153 if test -n "$all_flags"; then
1154 _SAVE_CFLAGS="$CFLAGS"
1156 AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
1157 AC_TRY_COMPILE([],[return 0;],
1158 AC_MSG_RESULT([yes]),
1161 CFLAGS="$_SAVE_CFLAGS $all_flags"
1162 CXXFLAGS="$CXXFLAGS $all_flags"
1163 ASFLAGS="$ASFLAGS $all_flags"
1164 if test -n "$thumb_flag"; then
1165 LDFLAGS="$LDFLAGS $thumb_flag"
1169 dnl ========================================================
1170 dnl Override of system specific host options
1171 dnl ========================================================
1176 *-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*)
1177 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
1178 if test `echo "${PATH}" | grep -c \;` = 0; then
1179 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
1183 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
1188 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1192 dnl ========================================================
1193 dnl Override of system specific target options
1194 dnl ========================================================
1201 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
1202 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
1203 case "${target_os}" in
1205 AC_DEFINE(AIX_RENAME_SELECT)
1206 AC_DEFINE(_PR_NO_LARGE_FILES)
1207 AIX_LINK_OPTS='-bnso -berok'
1208 PR_MD_ASFILES=os_AIX.s
1211 AC_DEFINE(AIX_TIMERS)
1212 AC_DEFINE(_PR_NO_LARGE_FILES)
1216 AIX_LINK_OPTS='-bnso -berok'
1217 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
1218 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
1221 AC_DEFINE(AIX_TIMERS)
1222 AC_DEFINE(_PR_HAVE_OFF64_T)
1223 AIX_LINK_OPTS='-brtl -bnso -berok'
1226 AC_DEFINE(AIX_TIMERS)
1227 AC_DEFINE(_PR_HAVE_OFF64_T)
1228 AC_DEFINE(AIX4_3_PLUS)
1229 AC_DEFINE(HAVE_SOCKLEN_T)
1230 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1232 AIX_LINK_OPTS='-brtl -bnso -berok'
1235 AC_DEFINE(AIX_TIMERS)
1236 AC_DEFINE(_PR_HAVE_OFF64_T)
1237 AC_DEFINE(AIX4_3_PLUS)
1238 AC_DEFINE(HAVE_SOCKLEN_T)
1239 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1241 AIX_LINK_OPTS='-brtl -bnso -berok'
1244 CFLAGS="$CFLAGS -qro -qroconst"
1245 AIX_WRAP='$(DIST)/lib/aixwrap.o'
1246 AIX_TMP='./_aix_tmp.o'
1247 if test -n "$USE_64"; then
1248 MDCPUCFG_H=_aix64.cfg
1251 MDCPUCFG_H=_aix32.cfg
1254 RESOLVE_LINK_SYMBOLS=1
1261 AC_DEFINE(_POSIX_SOURCE)
1263 MDCPUCFG_H=_beos.cfg
1266 RESOLVE_LINK_SYMBOLS=1
1267 case "${target_cpu}" in
1270 _DEBUG_FLAGS='-gdwarf-2 -O0'
1271 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1272 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1278 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'
1280 _DEBUG_FLAGS='-g -O0'
1288 AC_DEFINE(NEED_BSDREGEX)
1290 CFLAGS="$CFLAGS -Wall -Wno-format"
1291 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1293 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1295 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1299 MDCPUCFG_H=_bsdi.cfg
1304 case "$target_os" in
1306 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1307 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1308 AC_DEFINE(_PR_NEED_H_ERRNO)
1315 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1316 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1318 AC_DEFINE(USE_DLFCN)
1319 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1320 PR_MD_ASFILES=os_BSD_OS_386_2.s
1324 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1325 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1327 AC_DEFINE(USE_DLFCN)
1328 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1329 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1331 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1333 case "$target_os" in
1334 bsdi4.2* | bsdi4.3* | bsdi5.*)
1335 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1336 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1341 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1342 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1344 AC_DEFINE(USE_DLFCN)
1345 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1354 AC_DEFINE(HAVE_BSD_FLOCK)
1355 AC_DEFINE(HAVE_SOCKLEN_T)
1356 AS='$(CC) -x assembler-with-cpp'
1357 CFLAGS="$CFLAGS -Wall -fno-common"
1358 case "${target_cpu}" in
1363 if test -n "$USE_64"; then
1376 if test "`echo $CC | grep -c '\-arch '`" = "0"; then
1377 CC="$CC -arch $CPU_ARCH"
1379 AC_CHECK_HEADER(crt_externs.h)
1381 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1383 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1384 STRIP="$STRIP -x -S"
1387 MDCPUCFG_H=_darwin.cfg
1388 PR_MD_CSRCS=darwin.c
1389 PR_MD_ASFILES=os_Darwin.s
1391 # Add Mac OS X support for loading CFM & CFBundle plugins
1392 if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1393 AC_DEFINE(XP_MACOSX)
1396 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1397 dnl Use the specified value
1398 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1399 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1400 dnl No value specified on the command line or in the environment,
1401 dnl use the lesser of the library's minimum or the architecture's
1403 case "${target_cpu}" in
1405 dnl Architecture minimum 10.2
1406 export MACOSX_DEPLOYMENT_TARGET=10.2
1409 dnl Architecture minimum 10.4
1410 export MACOSX_DEPLOYMENT_TARGET=10.4
1415 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1416 dnl in use. NEXT_ROOT will be set and exported if it's needed for
1419 if test "$MACOS_SDK_DIR"; then
1420 dnl Sync this section with the one in Mozilla's top level.
1422 if test ! -d "$MACOS_SDK_DIR"; then
1423 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1424 specify a valid SDK. SDKs are installed when the optional cross-development
1425 tools are selected during the Xcode/Developer Tools installation.])
1429 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1430 GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1431 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1433 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1434 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1435 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1436 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1437 SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1440 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1442 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1444 dnl CPP needs to be set for AC_CHECK_HEADER.
1445 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1448 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1450 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1451 dnl The build host is running Tiger (10.4) or earlier.
1452 dnl ld support for -syslibroot is compiler-agnostic, but
1453 dnl only available on Tiger and later. On Tiger and
1454 dnl earlier build hosts, just rely on NEXT_ROOT, because
1455 dnl it's not been shown to cause any problems.
1456 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}"
1458 dnl The build host is running Leopard (10.5) or later.
1459 dnl With NEXT_ROOT set, the linker will still not apply
1460 dnl it when resolving dependencies. This causes problems
1461 dnl on Leopard, where an SDK depends on frameworks which
1462 dnl were present in earlier OS releases (and the associated
1463 dnl SDK) but not in Leopard. -syslibroot does not have
1464 dnl this problem, but it results in harmless warnings when
1465 dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1466 dnl on Leopard because the compiler uses it too.
1467 MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1470 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1471 export NEXT_ROOT=$MACOS_SDK_DIR
1473 if test -n "$CROSS_COMPILE" ; then
1474 dnl NEXT_ROOT will be in the environment, but it
1475 dnl shouldn't be set for the build host. HOST_CXX is
1476 dnl presently unused.
1477 HOST_CC="NEXT_ROOT= $HOST_CC"
1478 HOST_CXX="NEXT_ROOT= $HOST_CXX"
1481 dnl gcc >= 4.0 uses different paths than above, but knows
1482 dnl how to find them itself.
1483 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1485 dnl CPP needs to be set for AC_CHECK_HEADER.
1486 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1488 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1489 dnl has an ld that supports -syslibroot. Don't set
1490 dnl NEXT_ROOT because it will be ignored and cause
1491 dnl warnings when -syslibroot is specified.
1492 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1493 dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1494 dnl based on the -isysroot it receives.
1495 LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1497 dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1499 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1508 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1512 AC_DEFINE(_DGUX_SOURCE)
1513 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1517 MDCPUCFG_H=_dgux.cfg
1522 if test -z "$USE_NSPR_THREADS"; then
1527 AC_DEFINE(HAVE_BSD_FLOCK)
1528 AC_DEFINE(HAVE_SOCKLEN_T)
1529 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1530 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1531 if test "$MOZ_OBJFORMAT" = "elf"; then
1536 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1538 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1539 MDCPUCFG_H=_freebsd.cfg
1540 PR_MD_CSRCS=freebsd.c
1546 AC_DEFINE(_HPUX_SOURCE)
1547 # OSF1 and HPUX report the POLLHUP event for a socket when the
1548 # shutdown(SHUT_WR) operation is called for the remote end, even though
1549 # the socket is still writeable. Use select(), instead of poll(), to
1550 # workaround this problem.
1551 AC_DEFINE(_PR_POLL_WITH_SELECT)
1552 AC_DEFINE(_USE_BIG_FDS)
1553 DSO_LDOPTS='-b +h $(notdir $@)'
1555 if test "$OS_TEST" = "ia64"; then
1557 DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1558 CPU_ARCH_TAG=_$OS_TEST
1559 if test -z "$USE_64"; then
1562 PR_MD_ASFILES=os_HPUX_ia64.s
1566 PR_MD_ASFILES=os_HPUX.s
1568 if test -n "$USE_64"; then
1569 MDCPUCFG_H=_hpux64.cfg
1571 MDCPUCFG_H=_hpux32.cfg
1573 if test -z "$GNU_CC"; then
1579 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1582 if test -n "$MOZILLA_CLIENT"; then
1583 DEFAULT_IMPL_STRATEGY=_EMU
1586 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1587 AC_DEFINE(_PR_NEED_H_ERRNO)
1589 DEFAULT_IMPL_STRATEGY=_EMU
1593 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1594 AC_DEFINE(_PR_NO_LARGE_FILES)
1597 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1598 AC_DEFINE(_PR_NEED_H_ERRNO)
1601 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1602 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1605 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1606 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1609 # HP-UX 11i v2 (B.11.23) or higher
1611 case "$OS_RELEASE" in
1612 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1618 if test "$OS_RELEASE" = "B.10.01"; then
1620 DEFAULT_IMPL_STRATEGY=_EMU
1623 if test "$OS_RELEASE" = "B.10.10"; then
1625 AC_DEFINE(HPUX10_10)
1626 DEFAULT_IMPL_STRATEGY=_PTH
1629 if test "$OS_RELEASE" = "B.10.20"; then
1631 AC_DEFINE(HPUX10_20)
1632 if test -z "$GNU_CC"; then
1633 CFLAGS="$CFLAGS +DAportable +DS1.1"
1634 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1636 DEFAULT_IMPL_STRATEGY=_PTH
1639 if test "$OS_RELEASE" = "B.10.30"; then
1641 AC_DEFINE(HPUX10_30)
1642 if test -z "$GNU_CC"; then
1643 CFLAGS="$CFLAGS +DAportable +DS1.1"
1644 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1646 DEFAULT_IMPL_STRATEGY=_PTH
1649 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1652 AC_DEFINE(_LARGEFILE64_SOURCE)
1653 AC_DEFINE(_PR_HAVE_OFF64_T)
1654 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1655 if test -z "$GNU_CC"; then
1656 if test -z "$USE_64"; then
1657 if test "$OS_TEST" = "ia64"; then
1658 CFLAGS="$CFLAGS +DD32"
1659 CXXFLAGS="$CXXFLAGS +DD32"
1661 CFLAGS="$CFLAGS +DAportable +DS2.0"
1662 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1665 if test "$OS_TEST" = "ia64"; then
1666 CFLAGS="$CFLAGS +DD64"
1667 CXXFLAGS="$CXXFLAGS +DD64"
1669 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1670 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1674 DEFAULT_IMPL_STRATEGY=_PTH
1677 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1681 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1683 if test "$USE_NSPR_THREADS"; then
1686 if test "$USE_USER_PTHREADS"; then
1696 AC_DEFINE(_SGI_MP_SOURCE)
1697 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1699 PR_MD_ASFILES=os_Irix.s
1700 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1702 RESOLVE_LINK_SYMBOLS=1
1703 if test -n "$USE_64"; then
1704 MDCPUCFG_H=_irix64.cfg
1706 MDCPUCFG_H=_irix32.cfg
1708 case "${target_os}" in
1725 if test "$GNU_CC"; then
1727 dnl If we are using gcc with native binutils, we need to
1729 dnl #lineno "filename" num num
1730 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1731 dnl gcc command line, which passes -P to the preprocessor.
1733 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1734 CFLAGS="$CFLAGS -Wall -Wno-format"
1735 _OPTIMIZE_FLAGS="-O6"
1737 if test -n "$USE_N32"; then
1738 AS='as -D_ASM $(INCLUDES) -n32'
1740 AS='as -D_ASM $(INCLUDES)'
1742 CFLAGS="$CFLAGS -fullwarn -xansi"
1743 if test "$USE_N32"; then
1744 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1746 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1748 if test "$USE_MDUPDATE"; then
1749 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1753 CFLAGS="$CFLAGS -multigot"
1754 DSO_LDOPTS="-no_unresolved"
1755 if test "$USE_N32"; then
1756 CFLAGS="$CFLAGS -n32 -woff 1209"
1757 DSO_LDOPTS="$DSO_LDOPTS -n32"
1759 if test "$USE_64"; then
1760 CFLAGS="$CFLAGS -64"
1762 CFLAGS="$CFLAGS -32"
1767 CFLAGS="$CFLAGS -xgot"
1771 if test "${target_os}" = "irix5.3"; then
1774 case "${target_os}" in
1776 if test -z "$GNU_CC"; then
1777 CFLAGS="$CFLAGS -mips3"
1779 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1780 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1781 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1786 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1791 *-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
1792 if test -z "$USE_NSPR_THREADS"; then
1797 AC_DEFINE(_GNU_SOURCE)
1798 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1800 *-android*|*-linuxandroid*)
1808 CFLAGS="$CFLAGS -Wall"
1809 CXXFLAGS="$CXXFLAGS -Wall"
1810 MDCPUCFG_H=_linux.cfg
1812 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1814 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1816 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1817 # combo is not yet good at debugging inlined
1818 # functions (even when using DWARF2 as the
1821 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1826 CPU_ARCH_TAG=_${CPU_ARCH}
1827 case "${target_cpu}" in
1831 CFLAGS="$CFLAGS -mieee"
1832 CXXFLAGS="$CXXFLAGS -mieee"
1836 PR_MD_ASFILES=os_Linux_x86.s
1839 PR_MD_ASFILES=os_Linux_ia64.s
1842 if test -n "$USE_64"; then
1843 PR_MD_ASFILES=os_Linux_x86_64.s
1846 PR_MD_ASFILES=os_Linux_x86.s
1852 PR_MD_ASFILES=os_Linux_ppc.s
1855 if test -n "$USE_64"; then
1859 PR_MD_ASFILES=os_Linux_ppc.s
1863 CFLAGS="$CFLAGS -m68020-60"
1864 CXXFLAGS="$CXXFLAGS -m68020-60"
1869 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1872 PR_MD_ARCH_DIR=windows
1873 RESOLVE_LINK_SYMBOLS=1
1875 if test -n "$GNU_CC"; then
1877 CXX="$CXX -mwindows"
1879 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1881 # Use temp file for windres (bug 213281)
1882 RCFLAGS='-O coff --use-temp-file'
1887 AR='lib -NOLOGO -OUT:"$@"'
1889 RANLIB='echo not_ranlib'
1890 STRIP='echo not_strip'
1892 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1897 # Determine compiler version
1899 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1901 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1902 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1903 _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1904 _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1905 _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1906 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1908 if test "$_CC_MAJOR_VERSION" -eq "14"; then
1909 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1910 dnl so be very specific here!
1911 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1912 if test $_CC_RELEASE -gt 50727; then
1914 elif test $_CC_BUILD -ge 762; then
1917 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
1918 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
1919 elif test $_CC_MAJOR_VERSION -ge 15; then
1921 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
1922 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
1925 if test -n "$_USE_DYNAMICBASE"; then
1926 DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1929 # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1930 # tape manipulation utility (or something else)
1931 if test "$MSC_VER" -ge "1400"; then
1933 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1936 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1937 if test -n "$MSMT_TOOL"; then
1938 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1939 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1940 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1945 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1949 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1950 DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1954 PROFILE_GEN_CFLAGS="-GL"
1955 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1956 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1957 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1959 if test "$MSC_VER" -ge "1800"; then
1960 dnl Visual C++ 2013 requires -FS when parallel building with
1961 dnl make -jN. If not specified, compiler sometimes emits C1041
1963 CFLAGS="$CFLAGS -FS"
1964 dnl -Gw can benefit when using linker optimization on PGO.
1965 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
1966 PROFILE_GEN_CFLAGS="$PROFILE_GEN_CFLAGS -Gw"
1967 PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -Gw"
1970 if test -z "$MOZ_OPTIMIZE"; then
1971 CFLAGS="$CFLAGS -Od"
1974 if test -n "$USE_DEBUG_RTL"; then
1975 CFLAGS="$CFLAGS -MDd"
1977 CFLAGS="$CFLAGS -MD"
1980 if test -n "$MOZ_DEBUG"; then
1983 DEFINES="$DEFINES -U_DEBUG"
1986 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1987 if test -n "$MOZ_OPTIMIZE"; then
1988 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1989 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1991 DLLFLAGS="$DLLFLAGS -DEBUG"
1992 LDFLAGS="$LDFLAGS -DEBUG"
1996 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1997 if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1998 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
2001 if test "$OS_TARGET" = "WINNT"; then
2002 CFLAGS="$CFLAGS -GT"
2003 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2004 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2006 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2007 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2011 if test -n "$USE_STATIC_TLS"; then
2012 AC_DEFINE(_PR_USE_STATIC_TLS)
2015 if test "$OS_TARGET" = "WINNT"; then
2019 # undefine WINNT as some versions of mingw gcc define it by default
2020 DEFINES="$DEFINES -UWINNT"
2021 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2024 if test "$CPU_ARCH" = "x86"; then
2027 CPU_ARCH_TAG=$CPU_ARCH
2030 if test -n "$USE_DEBUG_RTL"; then
2034 case "$OS_TARGET" in
2036 MDCPUCFG_H=_winnt.cfg
2039 MDCPUCFG_H=_win95.cfg
2042 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
2046 case "$target_cpu" in
2048 if test -n "$USE_64"; then
2063 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2072 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2074 AR_FLAGS='-NOLOGO -OUT:"$@"'
2079 MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
2081 PR_MD_ARCH_DIR=windows
2082 RESOLVE_LINK_SYMBOLS=1
2084 MDCPUCFG_H=_win95.cfg
2085 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2086 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2088 DLLFLAGS='-OUT:"$@"'
2089 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2090 OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2091 OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
2092 DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
2101 AC_DEFINE(HAVE_BSD_FLOCK)
2102 if test -z "$USE_NSPR_THREADS"; then
2105 MDCPUCFG_H=_netbsd.cfg
2106 PR_MD_CSRCS=netbsd.c
2108 DSO_CFLAGS='-fPIC -DPIC'
2109 CFLAGS="$CFLAGS -ansi -Wall"
2110 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2111 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
2113 if test -z "$OBJECT_FMT"; then
2114 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
2117 DSO_LDOPTS='-shared'
2121 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
2125 if test "$LIBRUNPATH"; then
2126 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
2133 AC_DEFINE(_QNX_SOURCE)
2134 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2137 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
2140 OS_LIBS="$OS_LIBS -lsocket"
2141 _OPTIMIZE_FLAGS="-O1"
2142 _DEBUG_FLAGS="-gstabs"
2148 AC_DEFINE(HAVE_BSD_FLOCK)
2149 AC_DEFINE(HAVE_SOCKLEN_T)
2150 CFLAGS="$CFLAGS -ansi -Wall"
2151 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2154 MDCPUCFG_H=_openbsd.cfg
2155 PR_MD_CSRCS=openbsd.c
2157 if test -z "$USE_NSPR_THREADS"; then
2160 DSO_LDOPTS='-shared -fPIC'
2161 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2165 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2168 AC_DEFINE(_REENTRANT)
2169 # OSF1 and HPUX report the POLLHUP event for a socket when the
2170 # shutdown(SHUT_WR) operation is called for the remote end, even though
2171 # the socket is still writeable. Use select(), instead of poll(), to
2172 # workaround this problem.
2173 AC_DEFINE(_PR_POLL_WITH_SELECT)
2175 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2179 if test -z "$GNU_CC"; then
2180 CC="$CC -std1 -ieee_with_inexact"
2181 if test "$OS_RELEASE" != "V2.0"; then
2182 CC="$CC -readonly_strings"
2184 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2185 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2187 CFLAGS="$CFLAGS -mieee"
2188 CXXFLAGS="$CXXFLAGS -mieee"
2191 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2192 AC_DEFINE(HAVE_INT_LOCALTIME_R)
2194 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2195 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2197 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2198 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2200 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2201 MDCPUCFG_H=_osf1.cfg
2208 AC_DEFINE(_PR_NEED_H_ERRNO)
2217 AC_DEFINE(_PR_NEED_H_ERRNO)
2219 MDCPUCFG_H=_riscos.cfg
2220 PR_MD_CSRCS=riscos.c
2222 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2223 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2232 AC_DEFINE(_PR_NEED_H_ERRNO)
2233 CC='cc -b elf -KPIC'
2234 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2237 DSO_LDOPTS='-b elf -G'
2238 MDCPUCFG_H=_scoos.cfg
2243 if test -z "$USE_NSPR_THREADS"; then
2252 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2254 MDCPUCFG_H=_solaris.cfg
2255 PR_MD_CSRCS=solaris.c
2257 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2258 RESOLVE_LINK_SYMBOLS=1
2259 case "${OS_RELEASE}" in
2263 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2267 if test -n "$GNU_CC"; then
2269 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2272 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2273 if test -n "$USE_B_DIRECT"; then
2274 DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2278 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2279 if test -n "$USE_B_DIRECT"; then
2280 DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2283 if test -n "$GNU_CC"; then
2284 CFLAGS="$CFLAGS -Wall"
2285 CXXFLAGS="$CXXFLAGS -Wall"
2286 if test -n "$USE_MDUPDATE"; then
2287 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2288 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2290 GCC_AS=`$CC -print-prog-name=as`
2291 if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2295 CFLAGS="$CFLAGS -xstrconst"
2296 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2297 if test -z "$MOZ_OPTIMIZE"; then
2298 CFLAGS="$CFLAGS -xs"
2299 CXXFLAGS="$CXXFLAGS -xs"
2301 _OPTIMIZE_FLAGS=-xO4
2303 if test -z "$GNU_AS"; then
2304 ASFLAGS="$ASFLAGS -Wa,-P"
2306 if test -n "$USE_64"; then
2307 if test -n "$GNU_CC"; then
2311 if test "$OS_TEST" = "i86pc"; then
2312 CC="$CC -xarch=amd64"
2313 CXX="$CXX -xarch=amd64"
2316 CXX="$CXX -xarch=v9"
2320 if test "$OS_TEST" = "i86pc"; then
2321 if test -z "$USE_64"; then
2324 CPU_ARCH_TAG=_$OS_TEST
2325 # The default debug format, DWARF (-g), is not supported by gcc
2326 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
2327 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2328 # If your gcc uses GNU as, you do not need the -Wa,-s option.
2329 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2330 _DEBUG_FLAGS=-gstabs
2331 if test -z "$GNU_AS"; then
2332 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2336 case "${target_os}" in
2338 AC_DEFINE(_PR_NO_LARGE_FILES)
2341 AC_DEFINE(_PR_NO_LARGE_FILES)
2344 AC_DEFINE(SOLARIS2_5)
2347 AC_DEFINE(_PR_HAVE_OFF64_T)
2348 # The lfcompile64(5) man page on Solaris 2.6 says:
2349 # For applications that do not wish to conform to the POSIX or
2350 # X/Open specifications, the 64-bit transitional interfaces
2351 # are available by default. No compile-time flags need to be
2353 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2354 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2355 if test -n "$GNU_CC"; then
2356 AC_DEFINE(_LARGEFILE64_SOURCE)
2360 case "${target_os}" in
2372 # Solaris 8 or higher has IPv6.
2373 AC_DEFINE(_PR_INET6)
2376 if test "$CPU_ARCH" = "sparc"; then
2377 # 64-bit Solaris SPARC requires V9 architecture, so the following
2379 if test -z "$USE_64"; then
2380 ULTRASPARC_LIBRARY=nspr_flt
2383 # Purify requires that binaries linked against nspr also
2384 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2386 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2387 OS_LIBS="$OS_LIBS $_librt"
2396 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2397 AC_DEFINE(_PR_NO_LARGE_FILES)
2398 CC='$(NSDEPTH)/build/hcc cc'
2399 CXX='$(NSDEPTH)/build/hcpp CC'
2400 MDCPUCFG_H=_unixware.cfg
2402 AC_DEFINE(_LARGEFILE64_SOURCE)
2403 AC_DEFINE(_PR_HAVE_OFF64_T)
2404 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2405 MDCPUCFG_H=_unixware7.cfg
2407 PR_MD_CSRCS=unixware.c
2413 AC_ARG_WITH(symbian-sdk,
2414 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
2415 The path to the Symbian SDK],
2416 SYMBIAN_SDK_DIR=$withval)
2418 echo -----------------------------------------------------------------------------
2419 echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2420 echo -----------------------------------------------------------------------------
2425 AC_DEFINE(__SYMBIAN32__)
2428 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2429 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2430 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2431 AC_DEFINE(HAVE_SOCKLEN_T)
2439 MDCPUCFG_H=_symbian.cfg
2440 PR_MD_CSRCS=symbian.c
2442 RANLIB='echo no ranlib '
2445 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2446 CFLAGS="$CFLAGS -MD -nostdinc"
2447 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2448 echo -------------------------------------------------------
2449 echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2450 echo -------------------------------------------------------
2451 case "$OS_TARGET" in
2457 WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2458 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)"
2459 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2460 AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2464 AC_DEFINE(__WINSCW__)
2465 DEFINES="$DEFINES -U_WIN32"
2468 CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2469 CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2470 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2473 DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2476 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2479 CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2485 AC_DEFINE(BSD_SELECT)
2486 AC_DEFINE(TCPV40HDRS)
2494 RESOLVE_LINK_SYMBOLS=1
2499 CFLAGS="$CFLAGS -Wall -Zomf"
2500 CXXFLAGS="$CFLAGS -Wall -Zomf"
2501 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2503 DSO_LDOPTS='-Zomf -Zdll'
2505 _OPTIMIZE_FLAGS="-O2 -s"
2506 _DEBUG_FLAGS="-g -fno-inline"
2507 if test -n "$MOZ_OPTIMIZE"; then
2508 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2512 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2513 LDFLAGS="$LDFLAGS -Zhigh-mem"
2514 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2517 # GCC for OS/2 currently predefines these, but we don't want them
2518 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2527 if test -z "$SKIP_LIBRARY_CHECKS"; then
2528 dnl ========================================================
2529 dnl Check for system libraries
2530 dnl ========================================================
2531 dnl AC_CHECK_LIB(C, main)
2532 dnl AC_CHECK_LIB(C_r, main)
2533 dnl AC_CHECK_LIB(c, main)
2534 dnl AC_CHECK_LIB(c_r, main)
2535 dnl AC_CHECK_LIB(dce, main)
2536 dnl AC_CHECK_LIB(dl, main)
2537 dnl AC_CHECK_LIB(dld, main)
2538 dnl AC_CHECK_LIB(gen, main)
2539 dnl AC_CHECK_LIB(ip6, main)
2540 dnl AC_CHECK_LIB(l, main)
2541 dnl AC_CHECK_LIB(m, main)
2542 dnl AC_CHECK_LIB(nsl, main)
2543 dnl AC_CHECK_LIB(posix4, main)
2544 dnl AC_CHECK_LIB(prstrms, main)
2545 dnl AC_CHECK_LIB(prstrms_shr, main)
2546 dnl AC_CHECK_LIB(pthread, main)
2547 dnl AC_CHECK_LIB(pthreads, main)
2548 dnl AC_CHECK_LIB(resolv, main)
2549 dnl AC_CHECK_LIB(rt, main)
2550 dnl AC_CHECK_LIB(socket, main)
2551 dnl AC_CHECK_LIB(svld, main)
2552 dnl AC_CHECK_LIB(thread, main)
2553 dnl AC_CHECK_LIB(vms_jackets, main)
2556 dnl We don't want anything to link with libdl even if it's present on OS X,
2557 dnl since it's not used and not part of the default installation.
2558 dnl The same goes for BeOS.
2559 dnl OS/2 has dlfcn in libc.
2562 *-darwin*|*-beos*|*-os2*)
2565 AC_CHECK_LIB(dl, dlopen,
2566 [AC_CHECK_HEADER(dlfcn.h,
2567 OS_LIBS="-ldl $OS_LIBS")])
2572 dnl ========================================================
2573 dnl Check for system header files.
2574 dnl ========================================================
2575 dnl AC_HEADER_DIRENT
2577 dnl AC_HEADER_SYS_WAIT
2578 dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2580 dnl ========================================================
2581 dnl Check for typedefs and structs
2582 dnl ========================================================
2589 dnl AC_STRUCT_ST_BLKSIZE
2590 dnl AC_STRUCT_ST_BLOCKS
2591 dnl AC_STRUCT_ST_RDEV
2595 dnl ========================================================
2596 dnl Checks for library functions.
2597 dnl ========================================================
2598 AC_PROG_GCC_TRADITIONAL
2600 LIBS="$LIBS $OS_LIBS"
2601 AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
2606 dnl AC_FUNC_SETVBUF_REVERSED
2608 dnl AC_FUNC_STRFTIME
2609 dnl AC_FUNC_UTIME_NULL
2611 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2613 dnl ========================================================
2615 dnl ========================================================
2617 dnl ======================================================
2618 dnl = Enable compiling with ccache
2619 dnl ======================================================
2621 [ --with-ccache[=path/to/ccache]
2622 Enable compiling with ccache],
2623 CCACHE=$withval, CCACHE="no")
2625 if test "$CCACHE" != "no"; then
2626 if test -n "$CCACHE"; then
2627 if test "$CCACHE" = "yes"; then
2630 if test ! -e "$CCACHE"; then
2631 AC_MSG_ERROR([$CCACHE not found])
2635 AC_PATH_PROGS(CCACHE, $CCACHE ccache)
2636 if test -z "$CCACHE" -o "$CCACHE" = ":"; then
2637 AC_MSG_ERROR([ccache not found])
2638 elif test -x "$CCACHE"; then
2642 AC_MSG_ERROR([$CCACHE is not executable])
2646 dnl ========================================================
2648 dnl = --enable-strip
2650 dnl = Enable stripping of libs and executables
2652 dnl ========================================================
2653 AC_ARG_ENABLE(strip,
2654 [ --enable-strip Enable stripping of shared libs and programs],
2655 [ if test "$enableval" = "yes"; then
2659 dnl Check for hpux options
2660 case "${target_os}" in
2662 if test -z "$GNU_CC"; then
2664 AC_CACHE_CHECK(for +Olit support,
2665 ac_cv_hpux_usable_olit_option,
2666 dnl since aCC doesn't throw an error on invalid options,
2667 dnl we have to test this the hard way
2668 [ac_cv_hpux_usable_olit_option=no
2670 echo 'int main() { return 0; }' | cat > conftest.c
2671 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2672 if test $? -eq 0; then
2673 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2674 ac_cv_hpux_usable_olit_option=yes
2680 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2681 CFLAGS="$CFLAGS +Olit=all"
2682 CXXFLAGS="$CXXFLAGS +Olit=all"
2684 CFLAGS="$CFLAGS +ESlit"
2685 CXXFLAGS="$CXXFLAGS +ESlit"
2692 dnl Apparently, some systems cannot properly check for the pthread
2693 dnl library unless <pthread.h> is included so we need to test
2696 dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2697 AC_DEFUN(MOZ_CHECK_PTHREADS,
2699 AC_MSG_CHECKING([for pthread_create in -l$1])
2701 #include <pthread.h>
2702 void *foo(void *v) { return v; }
2705 if (!pthread_create(&t, 0, &foo, 0)) {
2710 echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2711 ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2713 rm -f dummy.c dummy${ac_exeext} ;
2714 if test "$_res" = "0"; then
2715 AC_MSG_RESULT([yes])
2723 case "$target_os" in
2731 MOZ_CHECK_PTHREADS(pthreads,
2732 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2733 MOZ_CHECK_PTHREADS(pthread,
2734 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2735 MOZ_CHECK_PTHREADS(c_r,
2736 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2737 MOZ_CHECK_PTHREADS(c,
2746 AC_ARG_WITH(pthreads,
2747 [ --with-pthreads Use system pthreads library as thread subsystem],
2748 [ if test "$withval" = "yes"; then
2749 if test -n "$_HAVE_PTHREADS"; then
2754 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2760 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2766 AC_ARG_ENABLE(user-pthreads,
2767 [ --enable-user-pthreads Build using userland pthreads],
2768 [ if test "$enableval" = "yes"; then
2769 if test -n "$_HAVE_PTHREADS"; then
2774 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2778 AC_ARG_ENABLE(nspr-threads,
2779 [ --enable-nspr-threads Build using classic nspr threads],
2780 [ if test "$enableval" = "yes"; then
2788 AC_ARG_WITH(bthreads,
2789 [ --with-bthreads Use system bthreads library as thread subsystem
2791 [ if test "$withval" = "yes"; then
2799 fi # SKIP_LIBRARY_CHECKS
2802 [ --enable-ipv6 Compile ipv6 support],
2803 [ if test "$enableval" = "yes"; then
2809 if test -n "$USE_PTHREADS"; then
2810 dnl See if -pthread is supported.
2812 ac_cv_have_dash_pthread=no
2813 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2814 echo 'int main() { return 0; }' | cat > conftest.c
2815 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2816 if test $? -eq 0; then
2817 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2818 ac_cv_have_dash_pthread=yes
2819 case "$target_os" in
2821 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2824 CFLAGS="$CFLAGS -pthread"
2825 CXXFLAGS="$CXXFLAGS -pthread"
2831 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2834 dnl See if -pthreads is supported.
2836 ac_cv_have_dash_pthreads=no
2837 if test "$ac_cv_have_dash_pthread" = "no"; then
2838 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2839 echo 'int main() { return 0; }' | cat > conftest.c
2840 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2841 if test $? -eq 0; then
2842 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2843 ac_cv_have_dash_pthreads=yes
2844 CFLAGS="$CFLAGS -pthreads"
2845 CXXFLAGS="$CXXFLAGS -pthreads"
2849 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2854 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2859 AC_DEFINE(_REENTRANT)
2860 AC_DEFINE(_THREAD_SAFE)
2861 dnl -pthread links in -lc_r, so don't specify it explicitly.
2862 if test "$ac_cv_have_dash_pthread" = "yes"; then
2863 _PTHREAD_LDFLAGS="-pthread"
2865 _PTHREAD_LDFLAGS="-lc_r"
2869 if test "$ac_cv_have_dash_pthread" = "yes"; then
2870 _PTHREAD_LDFLAGS="-pthread"
2874 AC_DEFINE(_THREAD_SAFE)
2875 dnl -pthread links in -lc_r, so don't specify it explicitly.
2876 if test "$ac_cv_have_dash_pthread" = "yes"; then
2881 if test "$ac_cv_have_dash_pthread" = "yes"; then
2882 _PTHREAD_LDFLAGS=-pthread
2885 *-linux*|*-gnu*|*-k*bsd*-gnu)
2886 AC_DEFINE(_REENTRANT)
2891 if test -n "$USE_USER_PTHREADS"; then
2898 dnl Special thread exceptions
2902 if test -n "$USE_NSPR_THREADS"; then
2903 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2905 case "$target_os" in
2907 if test -z "$USE_PTHREADS"; then
2908 AC_DEFINE(AIX_RENAME_SELECT)
2912 if test -z "$USE_NSPR_THREADS"; then
2913 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2917 if test -z "$USE_NSPR_THREADS"; then
2918 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2920 if test -n "$USE_PTHREADS"; then
2921 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2925 if test -z "$USE_NSPR_THREADS"; then
2926 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2928 if test -n "$USE_PTHREADS"; then
2929 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2935 if test -n "$USE_PTHREADS"; then
2936 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2940 if test -n "$USE_NSPR_THREADS"; then
2941 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2945 if test -n "$USE_NSPR_THREADS"; then
2946 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2948 if test "$USE_PTHREADS"; then
2949 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2950 AC_DEFINE(_REENTRANT)
2951 AC_DEFINE(_PR_DCETHREADS)
2953 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2954 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2957 if test "$USE_USER_PTHREADS"; then
2958 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2962 if test "${target_os}" = "irix6.5"; then
2963 if test -n "$USE_PTHREADS"; then
2964 AC_DEFINE(_PR_HAVE_GETHOST_R)
2965 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2969 *-linux*|*-gnu*|*-k*bsd*-gnu)
2970 if test -n "$USE_NSPR_THREADS"; then
2971 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2974 *-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*|*-os2*|*-beos*)
2975 dnl win32, wince, os2 & beos cannot use pthreads
2980 *-netbsd*|*-openbsd*)
2981 if test -n "$USE_NSPR_THREADS"; then
2982 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2986 if test -n "$USE_NSPR_THREADS"; then
2987 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2989 if test -n "$USE_PTHREADS"; then
2990 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2993 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2998 if test -n "$USE_NSPR_THREADS"; then
2999 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3001 if test -n "$USE_PTHREADS"; then
3002 AC_DEFINE(_REENTRANT)
3003 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
3004 if test "$OS_TEST" = "i86pc"; then
3005 if test -n "$USE_64"; then
3006 PR_MD_ASFILES=os_SunOS_x86_64.s
3008 PR_MD_ASFILES=os_SunOS_x86.s
3011 if test -n "$USE_64"; then
3012 PR_MD_ASFILES=os_SunOS_sparcv9.s
3018 if test -n "$USE_PTHREADS"; then
3019 AC_DEFINE(_PR_HAVE_GETHOST_R)
3020 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
3025 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
3027 dnl If the user passed in arg to --enable-optimize or --enable-debug,
3028 dnl make sure that we use it.
3029 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
3030 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
3033 if test -n "$_SAVE_DEBUG_FLAGS"; then
3034 _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
3037 if test -n "$MOZ_OPTIMIZE"; then
3038 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
3039 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
3042 if test -n "$MOZ_DEBUG_SYMBOLS"; then
3043 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
3044 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
3047 if test -n "$MOZ_OPTIMIZE"; then
3053 if test -n "$USE_64"; then
3057 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
3059 dnl ========================================================
3060 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
3061 dnl ========================================================
3062 case "$target_os" in
3064 CC="\$(CYGWIN_WRAPPER) $CC"
3065 CXX="\$(CYGWIN_WRAPPER) $CXX"
3066 RC="\$(CYGWIN_WRAPPER) $RC"
3070 dnl ========================================================
3071 dnl = Use malloc wrapper lib
3072 dnl ========================================================
3073 AC_ARG_ENABLE(wrap-malloc,
3074 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
3075 [ if test "$enableval" = "yes"; then
3079 if test -n "$_WRAP_MALLOC"; then
3080 if test -n "$GNU_CC"; then
3081 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
3082 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
3083 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
3084 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
3086 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
3090 dnl ========================================================
3091 dnl = Location of malloc wrapper lib
3092 dnl ========================================================
3093 AC_ARG_WITH(wrap-malloc,
3094 [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
3095 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
3097 dnl ========================================================
3098 dnl Substitution of found variables.
3099 dnl ========================================================
3100 AC_SUBST(SHELL_OVERRIDE)
3102 AC_SUBST(MOZILLA_CLIENT)
3109 AC_SUBST(HOST_CFLAGS)
3111 AC_SUBST(HOST_LDFLAGS)
3113 AC_SUBST(GCC_USE_GNU_LD)
3115 AC_SUBST(CROSS_COMPILE)
3117 AC_SUBST(MOZ_OPTIMIZE)
3119 AC_SUBST(MOZ_DEBUG_SYMBOLS)
3125 AC_SUBST(OBJECT_MODE)
3126 AC_SUBST(ENABLE_STRIP)
3128 AC_SUBST(USE_PTHREADS)
3129 AC_SUBST(USE_BTHREADS)
3130 AC_SUBST(USE_USER_PTHREADS)
3131 AC_SUBST(USE_NSPR_THREADS)
3136 AC_SUBST(MOD_MAJOR_VERSION)
3137 AC_SUBST(MOD_MINOR_VERSION)
3138 AC_SUBST(MOD_PATCH_VERSION)
3139 AC_SUBST(NSPR_MODNAME)
3140 AC_SUBST(MDCPUCFG_H)
3141 AC_SUBST(PR_MD_CSRCS)
3142 AC_SUBST(PR_MD_ASFILES)
3143 AC_SUBST(PR_MD_ARCH_DIR)
3146 AC_SUBST(OBJ_SUFFIX)
3147 AC_SUBST(LIB_SUFFIX)
3148 AC_SUBST(DLL_SUFFIX)
3149 AC_SUBST(ASM_SUFFIX)
3150 AC_SUBST(WRAP_LDFLAGS)
3152 AC_SUBST(DSO_CFLAGS)
3153 AC_SUBST(DSO_LDOPTS)
3157 AC_SUBST(OS_RELEASE)
3159 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3174 AC_SUBST(PROFILE_GEN_CFLAGS)
3175 AC_SUBST(PROFILE_GEN_LDFLAGS)
3176 AC_SUBST(PROFILE_USE_CFLAGS)
3177 AC_SUBST(PROFILE_USE_LDFLAGS)
3180 AC_SUBST(RESOLVE_LINK_SYMBOLS)
3181 AC_SUBST(AIX_LINK_OPTS)
3182 AC_SUBST(NOSUCHFILE)
3183 AC_SUBST(MOZ_OBJFORMAT)
3184 AC_SUBST(ULTRASPARC_LIBRARY)
3187 AC_SUBST(OBJDIR_NAME)
3188 AC_SUBST(RELEASE_OBJDIR_NAME)
3195 AC_SUBST(OS_DLLFLAGS)
3196 AC_SUBST(CYGWIN_WRAPPER)
3197 AC_SUBST(VISIBILITY_FLAGS)
3198 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3199 AC_SUBST(MACOS_SDK_DIR)
3200 AC_SUBST(SYMBIAN_SDK_DIR)
3204 dnl ========================================================
3205 dnl Generate output files.
3206 dnl ========================================================
3218 lib/libc/include/Makefile
3219 lib/libc/src/Makefile
3224 pr/include/md/Makefile
3225 pr/include/obsolete/Makefile
3226 pr/include/private/Makefile
3229 pr/src/linking/Makefile
3230 pr/src/malloc/Makefile
3232 pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3233 pr/src/memory/Makefile
3234 pr/src/misc/Makefile
3235 pr/src/threads/Makefile
3237 pr/tests/dll/Makefile
3240 if test "$OS_TARGET" = "Linux"; then
3241 MAKEFILES="$MAKEFILES
3244 elif test "$OS_TARGET" = "SunOS"; then
3245 MAKEFILES="$MAKEFILES
3246 pkg/solaris/Makefile
3247 pkg/solaris/SUNWpr/Makefile
3248 pkg/solaris/SUNWprd/Makefile
3252 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3253 MAKEFILES="$MAKEFILES
3254 pr/src/threads/combined/Makefile
3256 elif test -n "$USE_PTHREADS"; then
3257 MAKEFILES="$MAKEFILES
3258 pr/src/pthreads/Makefile
3260 elif test -n "$USE_BTHREADS"; then
3261 MAKEFILES="$MAKEFILES
3262 pr/src/bthreads/Makefile
3266 if test -n "$USE_CPLUS"; then
3267 MAKEFILES="$MAKEFILES
3268 pr/src/cplus/Makefile
3269 pr/src/cplus/tests/Makefile
3273 echo $MAKEFILES > unallmakefiles
3275 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])