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/.
9 AC_CONFIG_SRCDIR([pr/include/nspr.h])
11 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
14 dnl ========================================================
16 dnl ========================================================
31 _MACOSX_DEPLOYMENT_TARGET=
36 OBJDIR='$(OBJDIR_NAME)'
39 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
40 NOSUCHFILE=/no-such-file
41 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
42 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
53 dnl Link in libraries necessary to resolve all symbols for shared libs
56 dnl ========================================================
58 dnl = Dont change the following lines. Doing so breaks:
60 dnl = CFLAGS="-foo" ./configure
62 dnl ========================================================
64 CXXFLAGS="${CXXFLAGS=}"
66 DLLFLAGS="${DLLFLAGS=}"
67 HOST_CFLAGS="${HOST_CFLAGS=}"
68 HOST_LDFLAGS="${HOST_LDFLAGS=}"
71 *-cygwin*|*-mingw*|*-msys*)
72 # Check to see if we are really running in a msvc environemnt
74 AC_CHECK_PROGS(CC, cl)
75 cat > conftest.c <<EOF
81 $($CC -E conftest.c 2>/dev/null | grep COMPILER)
83 if test -n "$dummy"; then
94 if test -n "$_WIN32_MSVC"; then
96 SKIP_COMPILER_CHECKS=1
100 dnl ========================================================
101 dnl = Android uses a very custom (hacky) toolchain; we need to do this
102 dnl = here, so that the compiler checks can succeed
103 dnl ========================================================
105 AC_ARG_WITH(android-ndk,
106 [ --with-android-ndk=DIR
107 location where the Android NDK can be found],
108 android_ndk=$withval)
110 AC_ARG_WITH(android-toolchain,
111 [ --with-android-toolchain=DIR
112 location of the Android toolchain],
113 android_toolchain=$withval)
115 dnl The default android_version is different for each target cpu.
116 case "$target_cpu" in
125 AC_ARG_WITH(android-version,
126 [ --with-android-version=VER
127 Android platform version, default 5 for arm, 9 for x86/mips],
128 android_version=$withval)
130 AC_ARG_WITH(android-platform,
131 [ --with-android-platform=DIR
132 location of platform dir],
133 android_platform=$withval)
136 arm-linux*-android*|*-linuxandroid*)
137 android_tool_prefix="arm-linux-androideabi"
140 android_tool_prefix="i686-linux-android"
143 android_tool_prefix="mipsel-linux-android"
146 android_tool_prefix="$target_os"
150 dnl ========================================================
151 dnl = Gonk is a fork of Android used for Mozilla's B2G project.
152 dnl = Configuration is done largely by the top level config
153 dnl = and the specified gonk directory doesn't matter here.
154 dnl ========================================================
157 [ --with-gonk=DIR location of gonk dir],
160 if test -n "$gonkdir" ; then
161 dnl Most things are directly configured by env vars when building for gonk
166 *-android*|*-linuxandroid*)
167 if test -z "$android_ndk" ; then
168 AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
171 if test -z "$android_toolchain" ; then
172 AC_MSG_CHECKING([for android toolchain directory])
174 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
176 case "$target_cpu" in
178 target_name=arm-linux-androideabi-4.4.3
181 target_name=x86-4.4.3
184 target_name=mipsel-linux-android-4.4.3
187 android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
189 if test -d "$android_toolchain" ; then
190 AC_MSG_RESULT([$android_toolchain])
192 AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
196 if test -z "$android_platform" ; then
197 AC_MSG_CHECKING([for android platform directory])
199 case "$target_cpu" in
211 android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name"
213 if test -d "$android_platform" ; then
214 AC_MSG_RESULT([$android_platform])
216 AC_MSG_ERROR([not found. You have to specify --with-android-platform=/path/to/ndk/platform.])
220 dnl Old NDK support. If minimum requirement is changed to NDK r8b,
221 dnl please remove this.
222 case "$target_cpu" in
224 if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
225 dnl Old NDK toolchain name
226 android_tool_prefix="i686-android-linux"
232 AS="$android_toolchain"/bin/"$android_tool_prefix"-as
233 CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
234 CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
235 CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
236 LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
237 AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
238 RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
239 STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
241 CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
242 CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
243 CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
244 LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
251 dnl ========================================================
253 dnl = Check options that may affect the compiler
255 dnl ========================================================
256 dist_prefix='${MOD_DEPTH}/dist'
257 dist_bindir='${dist_prefix}/bin'
258 dist_includedir='${dist_prefix}/include/nspr'
259 dist_libdir='${dist_prefix}/lib'
260 dnl If the --includedir option was not specified, add '/nspr' to autoconf's
261 dnl default value of includedir.
262 if test "${includedir}" = '${prefix}/include'; then
263 includedir='${prefix}/include/nspr'
266 AC_ARG_WITH(dist-prefix,
267 [ --with-dist-prefix=DIST_PREFIX
268 place build files in DIST_PREFIX [dist]],
269 dist_prefix=$withval)
271 AC_ARG_WITH(dist-bindir,
272 [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
273 dist_bindir=$withval)
275 AC_ARG_WITH(dist-includedir,
276 [ --with-dist-includedir=DIR
277 build include files in DIR [DIST_PREFIX/include/nspr]],
278 dist_includedir=$withval)
280 AC_ARG_WITH(dist-libdir,
281 [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
282 dist_libdir=$withval)
284 AC_SUBST(dist_prefix)
285 AC_SUBST(dist_bindir)
286 AC_SUBST(dist_includedir)
287 AC_SUBST(dist_libdir)
289 dnl Check if NSPR is being compiled for Mozilla
290 dnl Let --with-arg override environment setting
293 [ --with-mozilla Compile NSPR with Mozilla support],
294 [ if test "$withval" = "yes"; then
295 AC_DEFINE(MOZILLA_CLIENT)
300 [ if test -n "$MOZILLA_CLIENT"; then
301 AC_DEFINE(MOZILLA_CLIENT)
304 AC_ARG_ENABLE(optimize,
305 [ --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ],
306 [ if test "$enableval" != "no"; then
308 if test -n "$enableval" -a "$enableval" != "yes"; then
309 _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
310 _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
317 [ --enable-debug[=DBG] Enable debugging (using compiler flags DBG)],
318 [ if test "$enableval" != "no"; then
321 if test -n "$enableval" -a "$enableval" != "yes"; then
322 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
323 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
330 AC_ARG_ENABLE(debug-symbols,
331 [ --enable-debug-symbols[=DBG] Enable debugging symbols
332 (using compiler flags DBG)],
333 [ if test "$enableval" != "no"; then
335 if test -n "$enableval" -a "$enableval" != "yes"; then
336 if test -z "$_SAVE_DEBUG_FLAGS"; then
337 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
338 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
340 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
347 AC_ARG_ENABLE(win32-target,
348 [ --enable-win32-target=\$t
349 Specify win32 flavor. (WIN95 or WINNT)],
350 OS_TARGET=`echo $enableval | tr a-z A-Z`)
352 AC_ARG_ENABLE(symbian-target,
353 [ --enable-symbian-target=\$t
354 Specify symbian flavor. (WINSCW or GCCE)],
355 OS_TARGET=`echo $enableval | tr a-z A-Z`)
357 AC_ARG_ENABLE(debug-rtl,
358 [ --enable-debug-rtl Use the MSVC debug runtime library],
359 [ if test "$enableval" = "yes"; then
365 AC_ARG_ENABLE(static-rtl,
366 [ --enable-static-rtl Use the MSVC static runtime library],
367 [ if test "$enableval" = "yes"; then
372 [ --enable-n32 Enable n32 ABI support (IRIX only)],
373 [ if test "$enableval" = "yes"; then
375 else if test "$enableval" = "no"; then
381 [ --enable-x32 Enable x32 ABI support (x86_64 only)],
382 [ if test "$enableval" = "yes"; then
384 else if test "$enableval" = "no"; then
390 [ --enable-64bit Enable 64-bit support (on certain platforms)],
391 [ if test "$enableval" = "yes"; then
395 AC_ARG_ENABLE(mdupdate,
396 [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
397 [ if test "$enableval" = "yes"; then
402 [ --enable-cplus Enable some c++ api routines],
403 [ if test "$enableval" = "yes"; then
407 AC_ARG_WITH(arm-kuser,
408 [ --with-arm-kuser Use kuser helpers (Linux/ARM only)
409 (Requires kernel 2.6.13 or later)],
410 [ if test "$withval" = "yes"; then
411 AC_DEFINE(_PR_ARM_KUSER)
414 dnl ========================================================
415 dnl = Mac OS X SDK support
416 dnl ========================================================
417 AC_ARG_WITH(macos-sdk,
418 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
419 MACOS_SDK_DIR=$withval)
421 AC_ARG_ENABLE(macos-target,
422 [ --enable-macos-target=VER
423 Set the minimum MacOS version needed at runtime
424 [10.2 for ppc, 10.4 for x86]],
425 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
427 dnl ========================================================
429 dnl = Set the threading model
431 dnl ========================================================
435 case "${target_os}" in
447 dnl ========================================================
449 dnl = Set the default C compiler
451 dnl ========================================================
452 if test -z "$CC"; then
456 if test -z "$USE_NSPR_THREADS"; then
482 dnl ========================================================
484 dnl = Set the default C++ compiler
486 dnl ========================================================
487 if test -z "$CXX"; then
491 if test -z "$USE_NSPR_THREADS"; then
499 case "${target_os}" in
527 if test -z "$SKIP_PATH_CHECKS"; then
528 AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
531 if test -n "$MOZ_DEBUG"; then
533 DEFINES="$DEFINES -UNDEBUG"
535 case "${target_os}" in
537 DEFINES="$DEFINES -DDEBUG_${USER}"
539 mks*|cygwin*|mingw*|msys*|os2*)
540 DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
543 DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
548 DEFINES="$DEFINES -UDEBUG"
551 if test -z "$SKIP_COMPILER_CHECKS"; then
552 dnl ========================================================
553 dnl Checks for compilers.
554 dnl ========================================================
555 if test "$target" != "$host"; then
556 echo "cross compiling from $host to $target"
559 case "$build:$target" in
560 powerpc-apple-darwin8*:i?86-apple-darwin*)
561 dnl The Darwin cross compiler doesn't necessarily point itself at a
562 dnl root that has libraries for the proper architecture, it defaults
563 dnl to the system root. The libraries in the system root on current
564 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
565 dnl checks will fail. Fake a working SDK in that case.
567 _SAVE_CXXFLAGS=$CXXFLAGS
568 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
569 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
573 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
575 dnl Now exit the conditional block to invoke AC_PROG_CC.
578 dnl In the latest versions of autoconf, AC_PROG_CC is a one-shot macro,
579 dnl declared with AC_DEFUN_ONCE. So it must not be expanded inside a
580 dnl conditional block. Invoke AC_PROG_CC outside any conditional block
581 dnl and before invoking AC_TRY_COMPILE (which requires AC_PROG_CC).
584 dnl Reenter the conditional blocks after invoking AC_PROG_CC.
585 if test "$target" != "$host"; then
586 if test -n "$USE_CPLUS"; then
587 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
592 case "$build:$target" in
593 powerpc-apple-darwin8*:i?86-apple-darwin*|*:arm*-apple-darwin*)
594 dnl Revert the changes made above. From this point on, the target
595 dnl compiler will never be used without applying the SDK to CFLAGS
596 dnl (see --with-macos-sdk below).
598 CXXFLAGS=$_SAVE_CXXFLAGS
602 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
603 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
604 AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
605 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
606 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
607 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
610 _SAVE_CFLAGS="$CFLAGS"
611 _SAVE_LDFLAGS="$LDFLAGS"
613 AC_MSG_CHECKING([for $host compiler])
614 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
615 if test -z "$HOST_CC"; then
616 AC_MSG_ERROR([no acceptable cc found in \$PATH])
618 AC_MSG_RESULT([$HOST_CC])
621 CFLAGS="$HOST_CFLAGS"
622 LDFLAGS="$HOST_LDFLAGS"
624 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
625 AC_TRY_COMPILE([], [return 0;],
626 [AC_MSG_RESULT([yes])],
627 [AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.])] )
631 LDFLAGS=$_SAVE_LDFLAGS
633 if test -n "$USE_CPLUS"; then
634 if test "$CC" = "cl" -a -z "$CXX"; then
641 AC_PATH_PROGS(AS, as, $CC)
642 AC_PATH_PROGS(AR, ar, echo not_ar)
643 AC_PATH_PROGS(LD, ld link, echo not_ld)
644 AC_PATH_PROGS(STRIP, strip, echo not_strip)
645 AC_PATH_PROGS(WINDRES, windres, echo not_windres)
646 if test -z "$HOST_CC"; then
649 if test -z "$HOST_CFLAGS"; then
650 HOST_CFLAGS="$CFLAGS"
656 if test "$GCC" = "yes"; then
659 if test "$GXX" = "yes"; then
662 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
667 case "$build:$target" in
668 i?86-apple-darwin*:powerpc-apple-darwin*)
669 dnl cross_compiling will have erroneously been set to "no" in this
670 dnl case, because the x86 build host is able to run ppc code in a
671 dnl translated environment, making a cross compiler appear native.
676 if test "$cross_compiling" = "yes"; then
682 dnl ========================================================
683 dnl Check for gcc -pipe support
684 dnl ========================================================
685 AC_MSG_CHECKING([for gcc -pipe support])
686 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
687 echo '#include <stdio.h>' > dummy-hello.c
688 echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
689 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
690 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
696 if test "$_res_as_stdin" = "yes"; then
698 CFLAGS="$CFLAGS -pipe"
699 AC_TRY_COMPILE( [ #include <stdio.h> ],
700 [printf("Hello World\n");],
701 [_res_gcc_pipe="yes"],
702 [_res_gcc_pipe="no"] )
705 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
707 CFLAGS="$CFLAGS -pipe"
708 CXXFLAGS="$CXXFLAGS -pipe"
712 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
713 AC_MSG_RESULT([$_res])
718 dnl ========================================================
719 dnl Profile guided optimization
720 dnl ========================================================
721 dnl Test for profiling options
722 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
724 _SAVE_CFLAGS="$CFLAGS"
725 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
727 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
728 AC_TRY_COMPILE([], [return 0;],
729 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
730 result="yes" ], result="no")
731 AC_MSG_RESULT([$result])
733 if test $result = "yes"; then
734 PROFILE_GEN_LDFLAGS="-fprofile-generate"
735 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
736 PROFILE_USE_LDFLAGS="-fprofile-use"
739 CFLAGS="$_SAVE_CFLAGS"
741 dnl ===============================================================
742 dnl Check for .hidden assembler directive and visibility attribute.
743 dnl Borrowed from glibc configure.in
744 dnl ===============================================================
745 if test "$GNU_CC"; then
746 AC_CACHE_CHECK(for visibility(hidden) attribute,
747 ac_cv_visibility_hidden,
748 [cat > conftest.c <<EOF
749 int foo __attribute__ ((visibility ("hidden"))) = 1;
751 ac_cv_visibility_hidden=no
752 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
753 if grep '\.hidden.*foo' conftest.s >/dev/null; then
754 ac_cv_visibility_hidden=yes
759 if test "$ac_cv_visibility_hidden" = "yes"; then
760 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
761 AC_CACHE_CHECK(for visibility pragma support,
762 ac_cv_visibility_pragma,
763 [cat > conftest.c <<EOF
764 #pragma GCC visibility push(hidden)
766 #pragma GCC visibility push(default)
769 ac_cv_visibility_pragma=no
770 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
771 if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
772 if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
773 ac_cv_visibility_pragma=yes
779 if test "$ac_cv_visibility_pragma" = "yes"; then
780 AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
781 # To work around a build problem on Linux x86-64 (Bugzilla bug
782 # 293438), we use the -fvisibility=hidden flag. This flag is less
783 # optimal than #pragma GCC visibility push(hidden) because the flag
784 # assumes that symbols defined outside the current source file have
785 # the default visibility. This has the advantage that we don't need
786 # to wrap system header files, but has the disadvantage that calls
787 # to hidden symbols defined in other source files cannot be
788 # optimized by the compiler. The -fvisibility=hidden flag does
789 # hide and export symbols correctly.
790 #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
791 #WRAP_SYSTEM_INCLUDES=1
792 VISIBILITY_FLAGS="-fvisibility=hidden"
793 WRAP_SYSTEM_INCLUDES=
798 fi # SKIP_COMPILER_CHECKS
800 dnl ========================================================
801 dnl Checks for programs.
802 dnl ========================================================
803 if test -z "$SKIP_PATH_CHECKS"; then
804 AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
805 elif test -z "$PERL"; then
809 dnl ========================================================
810 dnl Default platform specific options
811 dnl ========================================================
816 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
824 if test -n "$CROSS_COMPILE"; then
825 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
827 OS_TEST="${target_cpu}"
828 case "${target_os}" in
829 linux*) OS_ARCH=Linux ;;
830 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
831 mingw*) OS_ARCH=WINNT CPU_ARCH=x86 ;;
832 darwin*) OS_ARCH=Darwin ;;
833 riscos*) OS_ARCH=RISCOS ;;
836 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
837 OS_RELEASE=`uname -r`
841 if test "$OS_ARCH" = "IRIX64"; then
845 if test "$OS_ARCH" = "AIX"; then
846 OS_RELEASE=`uname -v`.`uname -r`
849 if test "$OS_ARCH" = "FreeBSD"; then
850 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
853 if test "$OS_ARCH" = "Linux"; then
854 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
855 OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
858 #######################################################################
859 # Master "Core Components" macros for getting the OS target #
860 #######################################################################
863 # Note: OS_TARGET should be specified on the command line for gmake.
864 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
865 # The difference between the Win95 target and the WinNT target is that
866 # the WinNT target uses Windows NT specific features not available
867 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
868 # at lesser performance (the Win95 target uses threads; the WinNT target
871 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
876 # The following hack allows one to build on a WIN95 machine (as if
877 # s/he were cross-compiling on a WINNT host for a WIN95 target).
878 # It also accomodates for MKS's uname.exe. If you never intend
879 # to do development on a WIN95 machine, you don't need this hack.
890 CYGWIN_9*|CYGWIN_ME*)
891 OS_ARCH='CYGWIN_NT-4.0'
901 # On WIN32, we also define the variable CPU_ARCH.
907 # If uname -s returns "Windows_NT", we assume that we are using
908 # the uname.exe in MKS toolkit.
910 # The -r option of MKS uname only returns the major version number.
911 # So we need to use its -v option to get the minor version number.
912 # Moreover, it doesn't have the -p option, so we need to use uname -m.
915 OS_MINOR_RELEASE=`uname -v`
916 if test "$OS_MINOR_RELEASE" = "00"; then
919 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
922 # MKS's uname -m returns "586" on a Pentium machine.
924 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
928 CYGWIN_NT*|MINGW*_NT*|MSYS_NT*)
930 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
931 # the uname.exe in the Cygwin tools.
932 # If uname -s returns "MINGW32_NT-5.1", we assume that we are using
933 # the uname.exe in the MSYS tools.
934 # If uname -s returns "MSYS_NT-6.3", we assume that we are using
935 # the uname.exe in the MSYS2 tools.
937 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
941 # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
943 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
949 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
951 if test -n "$MOZ_DEBUG" -a -z "$USE_DEBUG_RTL"; then
955 if test -z "$OS_TARGET"; then
958 if test "$OS_TARGET" = "WIN95"; then
961 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
963 dnl ========================================================
964 dnl Enable high-memory support on OS/2 by default.
965 dnl ========================================================
966 AC_ARG_ENABLE(os2-high-mem,
967 [ --disable-os2-high-mem Disable high-memory support on OS/2],
968 [ if test "$enableval" = "no"; then
971 MOZ_OS2_HIGH_MEMORY=1
974 dnl ========================================================
975 dnl = ARM toolchain tweaks
976 dnl ========================================================
979 MOZ_ALIGN=toolchain-default
982 arm*-android*|arm*-linuxandroid*)
991 if test -n "$MOZ_PLATFORM_MAEMO"; then
996 if test "$MOZ_PLATFORM_MAEMO" = 6; then
1002 dnl Kept for compatibility with some buildbot mozconfig
1003 AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval)
1006 [ --with-thumb[[=yes|no|toolchain-default]]]
1007 [ Use Thumb instruction set (-mthumb)],
1008 if test -z "$GNU_CC"; then
1009 AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults])
1013 AC_ARG_WITH(thumb-interwork,
1014 [ --with-thumb-interwork[[=yes|no|toolchain-default]]
1015 Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
1016 if test -z "$GNU_CC"; then
1017 AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults])
1019 MOZ_THUMB_INTERWORK=$withval)
1022 [ --with-arch=[[type|toolchain-default]]
1023 Use specific CPU features (-march=type)],
1024 if test -z "$GNU_CC"; then
1025 AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults])
1030 [ --with-fpu=[[type|toolchain-default]]
1031 Use specific FPU type (-mfpu=type)],
1032 if test -z "$GNU_CC"; then
1033 AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults])
1037 AC_ARG_WITH(float-abi,
1038 [ --with-float-abi=[[type|toolchain-default]]
1039 Use specific arm float ABI (-mfloat-abi=type)],
1040 if test -z "$GNU_CC"; then
1041 AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults])
1043 MOZ_FLOAT_ABI=$withval)
1045 AC_ARG_WITH(soft-float,
1046 [ --with-soft-float[[=yes|no|toolchain-default]]
1047 Use soft float library (-msoft-float)],
1048 if test -z "$GNU_CC"; then
1049 AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults])
1051 MOZ_SOFT_FLOAT=$withval)
1054 toolchain-default|"")
1058 arch_flag="-march=$MOZ_ARCH"
1062 case "$MOZ_THUMB" in
1065 thumb_flag="-mthumb"
1072 _SAVE_CFLAGS="$CFLAGS"
1074 AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
1077 CFLAGS="$_SAVE_CFLAGS"
1082 case "$MOZ_THUMB_INTERWORK" in
1084 thumb_interwork_flag="-mthumb-interwork"
1087 thumb_interwork_flag="-mno-thumb-interwork"
1089 *) # toolchain-default
1090 thumb_interwork_flag=""
1095 toolchain-default|"")
1099 fpu_flag="-mfpu=$MOZ_FPU"
1103 case "$MOZ_FLOAT_ABI" in
1104 toolchain-default|"")
1108 float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
1112 case "$MOZ_SOFT_FLOAT" in
1114 soft_float_flag="-msoft-float"
1117 soft_float_flag="-mno-soft-float"
1119 *) # toolchain-default
1124 case "$MOZ_ALIGN" in
1125 toolchain-default|"")
1129 align_flag="-mno-unaligned-access"
1132 align_flag="-munaligned-access"
1139 if test -n "$align_flag"; then
1140 _SAVE_CFLAGS="$CFLAGS"
1141 CFLAGS="$CFLAGS $align_flag"
1142 AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported)
1143 AC_TRY_COMPILE([],[],,align_flag="")
1144 CFLAGS="$_SAVE_CFLAGS"
1147 dnl Use echo to avoid accumulating space characters
1148 all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag`
1149 if test -n "$all_flags"; then
1150 _SAVE_CFLAGS="$CFLAGS"
1152 AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
1153 AC_TRY_COMPILE([],[return 0;],
1154 AC_MSG_RESULT([yes]),
1157 CFLAGS="$_SAVE_CFLAGS $all_flags"
1158 CXXFLAGS="$CXXFLAGS $all_flags"
1159 ASFLAGS="$ASFLAGS $all_flags"
1160 if test -n "$thumb_flag"; then
1161 LDFLAGS="$LDFLAGS $thumb_flag"
1165 dnl ========================================================
1166 dnl Override of system specific host options
1167 dnl ========================================================
1173 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
1174 if test `echo "${PATH}" | grep -c \;` = 0; then
1175 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
1179 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
1184 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1188 dnl ========================================================
1189 dnl Override of system specific target options
1190 dnl ========================================================
1197 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
1198 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
1199 case "${target_os}" in
1201 AC_DEFINE(AIX_RENAME_SELECT)
1202 AC_DEFINE(_PR_NO_LARGE_FILES)
1203 AIX_LINK_OPTS='-bnso -berok'
1204 PR_MD_ASFILES=os_AIX.s
1207 AC_DEFINE(AIX_TIMERS)
1208 AC_DEFINE(_PR_NO_LARGE_FILES)
1212 AIX_LINK_OPTS='-bnso -berok'
1213 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
1214 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
1217 AC_DEFINE(AIX_TIMERS)
1218 AC_DEFINE(_PR_HAVE_OFF64_T)
1219 AIX_LINK_OPTS='-brtl -bnso -berok'
1222 AC_DEFINE(AIX_TIMERS)
1223 AC_DEFINE(_PR_HAVE_OFF64_T)
1224 AC_DEFINE(AIX4_3_PLUS)
1225 AC_DEFINE(HAVE_SOCKLEN_T)
1226 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1228 AIX_LINK_OPTS='-brtl -bnso -berok'
1231 AC_DEFINE(AIX_TIMERS)
1232 AC_DEFINE(_PR_HAVE_OFF64_T)
1233 AC_DEFINE(AIX4_3_PLUS)
1234 AC_DEFINE(HAVE_SOCKLEN_T)
1235 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1237 AIX_LINK_OPTS='-brtl -bnso -berok'
1240 CFLAGS="$CFLAGS -qro -qroconst"
1241 AIX_WRAP='$(DIST)/lib/aixwrap.o'
1242 AIX_TMP='./_aix_tmp.o'
1243 if test -n "$USE_64"; then
1244 MDCPUCFG_H=_aix64.cfg
1247 MDCPUCFG_H=_aix32.cfg
1250 RESOLVE_LINK_SYMBOLS=1
1257 AC_DEFINE(_POSIX_SOURCE)
1259 MDCPUCFG_H=_beos.cfg
1262 RESOLVE_LINK_SYMBOLS=1
1263 case "${target_cpu}" in
1266 _DEBUG_FLAGS='-gdwarf-2 -O0'
1267 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1268 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1274 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'
1276 _DEBUG_FLAGS='-g -O0'
1284 AC_DEFINE(NEED_BSDREGEX)
1286 CFLAGS="$CFLAGS -Wall -Wno-format"
1287 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1289 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1291 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1295 MDCPUCFG_H=_bsdi.cfg
1300 case "$target_os" in
1302 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1303 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1304 AC_DEFINE(_PR_NEED_H_ERRNO)
1311 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1312 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1314 AC_DEFINE(USE_DLFCN)
1315 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1316 PR_MD_ASFILES=os_BSD_OS_386_2.s
1320 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1321 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1323 AC_DEFINE(USE_DLFCN)
1324 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1325 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1327 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1329 case "$target_os" in
1330 bsdi4.2* | bsdi4.3* | bsdi5.*)
1331 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1332 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1337 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1338 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1340 AC_DEFINE(USE_DLFCN)
1341 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1350 AC_DEFINE(HAVE_BSD_FLOCK)
1351 AC_DEFINE(HAVE_SOCKLEN_T)
1352 AS='$(CC) -x assembler-with-cpp'
1353 CFLAGS="$CFLAGS -Wall -fno-common"
1354 case "${target_cpu}" in
1359 if test -n "$USE_64"; then
1369 if test "`echo $CC | grep -c '\-arch '`" = "0"; then
1370 CC="$CC -arch $CPU_ARCH"
1372 AC_CHECK_HEADER(crt_externs.h, AC_DEFINE(HAVE_CRT_EXTERNS_H))
1374 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1376 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1377 STRIP="$STRIP -x -S"
1380 MDCPUCFG_H=_darwin.cfg
1381 PR_MD_CSRCS=darwin.c
1382 PR_MD_ASFILES=os_Darwin.s
1384 # Add Mac OS X support for loading CFM & CFBundle plugins
1385 if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1386 AC_DEFINE(XP_MACOSX)
1389 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1390 dnl Use the specified value
1391 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1392 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1393 dnl No value specified on the command line or in the environment,
1394 dnl use the lesser of the library's minimum or the architecture's
1396 case "${target_cpu}" in
1398 dnl Architecture minimum 10.2
1399 export MACOSX_DEPLOYMENT_TARGET=10.2
1402 dnl Architecture minimum 10.4
1403 export MACOSX_DEPLOYMENT_TARGET=10.4
1408 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1409 dnl in use. NEXT_ROOT will be set and exported if it's needed for
1412 if test "$MACOS_SDK_DIR"; then
1413 dnl Sync this section with the one in Mozilla's top level.
1415 if test ! -d "$MACOS_SDK_DIR"; then
1416 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1417 specify a valid SDK. SDKs are installed when the optional cross-development
1418 tools are selected during the Xcode/Developer Tools installation.])
1422 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1423 GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1424 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1426 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1427 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1428 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1429 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1430 SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1433 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1435 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1437 dnl CPP needs to be set for AC_CHECK_HEADER.
1438 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1441 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1443 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1444 dnl The build host is running Tiger (10.4) or earlier.
1445 dnl ld support for -syslibroot is compiler-agnostic, but
1446 dnl only available on Tiger and later. On Tiger and
1447 dnl earlier build hosts, just rely on NEXT_ROOT, because
1448 dnl it's not been shown to cause any problems.
1449 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}"
1451 dnl The build host is running Leopard (10.5) or later.
1452 dnl With NEXT_ROOT set, the linker will still not apply
1453 dnl it when resolving dependencies. This causes problems
1454 dnl on Leopard, where an SDK depends on frameworks which
1455 dnl were present in earlier OS releases (and the associated
1456 dnl SDK) but not in Leopard. -syslibroot does not have
1457 dnl this problem, but it results in harmless warnings when
1458 dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1459 dnl on Leopard because the compiler uses it too.
1460 MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1463 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1464 export NEXT_ROOT=$MACOS_SDK_DIR
1466 if test -n "$CROSS_COMPILE" ; then
1467 dnl NEXT_ROOT will be in the environment, but it
1468 dnl shouldn't be set for the build host. HOST_CXX is
1469 dnl presently unused.
1470 HOST_CC="NEXT_ROOT= $HOST_CC"
1471 HOST_CXX="NEXT_ROOT= $HOST_CXX"
1474 dnl gcc >= 4.0 uses different paths than above, but knows
1475 dnl how to find them itself.
1476 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1478 dnl CPP needs to be set for AC_CHECK_HEADER.
1479 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1481 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1482 dnl has an ld that supports -syslibroot. Don't set
1483 dnl NEXT_ROOT because it will be ignored and cause
1484 dnl warnings when -syslibroot is specified.
1485 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1486 dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1487 dnl based on the -isysroot it receives.
1488 LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1490 dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1492 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1501 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1505 AC_DEFINE(_DGUX_SOURCE)
1506 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1510 MDCPUCFG_H=_dgux.cfg
1515 if test -z "$USE_NSPR_THREADS"; then
1520 AC_DEFINE(HAVE_BSD_FLOCK)
1521 AC_DEFINE(HAVE_SOCKLEN_T)
1522 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1523 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1524 if test "$MOZ_OBJFORMAT" = "elf"; then
1529 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1531 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1532 MDCPUCFG_H=_freebsd.cfg
1533 PR_MD_CSRCS=freebsd.c
1539 AC_DEFINE(_HPUX_SOURCE)
1540 # OSF1 and HPUX report the POLLHUP event for a socket when the
1541 # shutdown(SHUT_WR) operation is called for the remote end, even though
1542 # the socket is still writeable. Use select(), instead of poll(), to
1543 # workaround this problem.
1544 AC_DEFINE(_PR_POLL_WITH_SELECT)
1545 AC_DEFINE(_USE_BIG_FDS)
1546 DSO_LDOPTS='-b +h $(notdir $@)'
1548 if test "$OS_TEST" = "ia64"; then
1550 DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1551 CPU_ARCH_TAG=_$OS_TEST
1552 if test -z "$USE_64"; then
1555 PR_MD_ASFILES=os_HPUX_ia64.s
1559 PR_MD_ASFILES=os_HPUX.s
1561 if test -n "$USE_64"; then
1562 MDCPUCFG_H=_hpux64.cfg
1564 MDCPUCFG_H=_hpux32.cfg
1566 if test -z "$GNU_CC"; then
1572 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1575 if test -n "$MOZILLA_CLIENT"; then
1576 DEFAULT_IMPL_STRATEGY=_EMU
1579 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1580 AC_DEFINE(_PR_NEED_H_ERRNO)
1582 DEFAULT_IMPL_STRATEGY=_EMU
1586 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1587 AC_DEFINE(_PR_NO_LARGE_FILES)
1590 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1591 AC_DEFINE(_PR_NEED_H_ERRNO)
1594 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1595 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1598 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1599 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1602 # HP-UX 11i v2 (B.11.23) or higher
1604 case "$OS_RELEASE" in
1605 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1611 if test "$OS_RELEASE" = "B.10.01"; then
1613 DEFAULT_IMPL_STRATEGY=_EMU
1616 if test "$OS_RELEASE" = "B.10.10"; then
1618 AC_DEFINE(HPUX10_10)
1619 DEFAULT_IMPL_STRATEGY=_PTH
1622 if test "$OS_RELEASE" = "B.10.20"; then
1624 AC_DEFINE(HPUX10_20)
1625 if test -z "$GNU_CC"; then
1626 CFLAGS="$CFLAGS +DAportable +DS1.1"
1627 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1629 DEFAULT_IMPL_STRATEGY=_PTH
1632 if test "$OS_RELEASE" = "B.10.30"; then
1634 AC_DEFINE(HPUX10_30)
1635 if test -z "$GNU_CC"; then
1636 CFLAGS="$CFLAGS +DAportable +DS1.1"
1637 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1639 DEFAULT_IMPL_STRATEGY=_PTH
1642 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1645 AC_DEFINE(_LARGEFILE64_SOURCE)
1646 AC_DEFINE(_PR_HAVE_OFF64_T)
1647 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1648 if test -z "$GNU_CC"; then
1649 if test -z "$USE_64"; then
1650 if test "$OS_TEST" = "ia64"; then
1651 CFLAGS="$CFLAGS +DD32"
1652 CXXFLAGS="$CXXFLAGS +DD32"
1654 CFLAGS="$CFLAGS +DAportable +DS2.0"
1655 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1658 if test "$OS_TEST" = "ia64"; then
1659 CFLAGS="$CFLAGS +DD64"
1660 CXXFLAGS="$CXXFLAGS +DD64"
1662 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1663 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1667 DEFAULT_IMPL_STRATEGY=_PTH
1670 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1674 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1676 if test "$USE_NSPR_THREADS"; then
1679 if test "$USE_USER_PTHREADS"; then
1689 AC_DEFINE(_SGI_MP_SOURCE)
1690 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1692 PR_MD_ASFILES=os_Irix.s
1693 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1695 RESOLVE_LINK_SYMBOLS=1
1696 if test -n "$USE_64"; then
1697 MDCPUCFG_H=_irix64.cfg
1699 MDCPUCFG_H=_irix32.cfg
1701 case "${target_os}" in
1718 if test "$GNU_CC"; then
1720 dnl If we are using gcc with native binutils, we need to
1722 dnl #lineno "filename" num num
1723 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1724 dnl gcc command line, which passes -P to the preprocessor.
1726 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1727 CFLAGS="$CFLAGS -Wall -Wno-format"
1728 _OPTIMIZE_FLAGS="-O6"
1730 if test -n "$USE_N32"; then
1731 AS='as -D_ASM $(INCLUDES) -n32'
1733 AS='as -D_ASM $(INCLUDES)'
1735 CFLAGS="$CFLAGS -fullwarn -xansi"
1736 if test "$USE_N32"; then
1737 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1739 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1741 if test "$USE_MDUPDATE"; then
1742 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1746 CFLAGS="$CFLAGS -multigot"
1747 DSO_LDOPTS="-no_unresolved"
1748 if test "$USE_N32"; then
1749 CFLAGS="$CFLAGS -n32 -woff 1209"
1750 DSO_LDOPTS="$DSO_LDOPTS -n32"
1752 if test "$USE_64"; then
1753 CFLAGS="$CFLAGS -64"
1755 CFLAGS="$CFLAGS -32"
1760 CFLAGS="$CFLAGS -xgot"
1764 if test "${target_os}" = "irix5.3"; then
1767 case "${target_os}" in
1769 if test -z "$GNU_CC"; then
1770 CFLAGS="$CFLAGS -mips3"
1772 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1773 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1774 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1779 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1784 *-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
1785 if test -z "$USE_NSPR_THREADS"; then
1790 AC_DEFINE(_GNU_SOURCE)
1791 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1793 *-android*|*-linuxandroid*)
1801 CFLAGS="$CFLAGS -Wall"
1802 CXXFLAGS="$CXXFLAGS -Wall"
1803 MDCPUCFG_H=_linux.cfg
1805 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1807 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1809 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1810 # combo is not yet good at debugging inlined
1811 # functions (even when using DWARF2 as the
1814 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1819 CPU_ARCH_TAG=_${CPU_ARCH}
1820 case "${target_cpu}" in
1824 CFLAGS="$CFLAGS -mieee"
1825 CXXFLAGS="$CXXFLAGS -mieee"
1829 PR_MD_ASFILES=os_Linux_x86.s
1832 PR_MD_ASFILES=os_Linux_ia64.s
1835 if test -n "$USE_64"; then
1836 PR_MD_ASFILES=os_Linux_x86_64.s
1837 elif test -n "$USE_X32"; then
1838 PR_MD_ASFILES=os_Linux_x86_64.s
1843 PR_MD_ASFILES=os_Linux_x86.s
1849 PR_MD_ASFILES=os_Linux_ppc.s
1852 if test -n "$USE_64"; then
1856 PR_MD_ASFILES=os_Linux_ppc.s
1860 CFLAGS="$CFLAGS -m68020-60"
1861 CXXFLAGS="$CXXFLAGS -m68020-60"
1866 *-mingw*|*-msys*|*-cygwin*|*-mks*)
1869 PR_MD_ARCH_DIR=windows
1870 RESOLVE_LINK_SYMBOLS=1
1872 if test -n "$GNU_CC"; then
1874 CXX="$CXX -mwindows"
1876 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1878 # Use temp file for windres (bug 213281)
1879 RCFLAGS='-O coff --use-temp-file'
1882 AR='lib -NOLOGO -OUT:"$@"'
1884 RANLIB='echo not_ranlib'
1885 STRIP='echo not_strip'
1887 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1892 # Determine compiler version
1894 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1896 CC_VERSION=`${CC} -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1897 if test -z "$CC_VERSION"; then
1898 AC_MSG_ERROR([Could not determine MSC version.])
1901 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1902 _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1903 _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1904 _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1905 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1907 if test "$_CC_MAJOR_VERSION" -eq "14"; then
1908 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1909 dnl so be very specific here!
1910 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1911 if test $_CC_RELEASE -gt 50727; then
1913 elif test $_CC_BUILD -ge 762; then
1916 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
1917 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
1918 elif test $_CC_MAJOR_VERSION -ge 15; then
1920 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
1921 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
1924 if test -n "$_USE_DYNAMICBASE"; then
1925 DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1928 # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1929 # tape manipulation utility (or something else)
1930 if test "$MSC_VER" -ge "1400"; then
1932 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1935 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1936 if test -n "$MSMT_TOOL"; then
1937 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1938 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1939 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1944 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1948 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1949 DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1953 PROFILE_GEN_CFLAGS="-GL"
1954 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1955 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1956 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1958 if test "$MSC_VER" -ge "1800"; then
1959 dnl Visual C++ 2013 requires -FS when parallel building with
1960 dnl make -jN. If not specified, compiler sometimes emits C1041
1962 CFLAGS="$CFLAGS -FS"
1963 dnl -Gw can benefit when using linker optimization on PGO.
1964 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
1965 PROFILE_GEN_CFLAGS="$PROFILE_GEN_CFLAGS -Gw"
1966 PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -Gw"
1969 if test -z "$MOZ_OPTIMIZE"; then
1970 CFLAGS="$CFLAGS -Od"
1973 if test "$USE_DEBUG_RTL" = 1; then
1974 if test -n "$USE_STATIC_RTL"; then
1975 CFLAGS="$CFLAGS -MTd"
1977 CFLAGS="$CFLAGS -MDd"
1980 if test -n "$USE_STATIC_RTL"; then
1981 CFLAGS="$CFLAGS -MT"
1983 CFLAGS="$CFLAGS -MD"
1987 if test -n "$MOZ_DEBUG"; then
1990 DEFINES="$DEFINES -U_DEBUG"
1993 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1994 if test -n "$MOZ_OPTIMIZE"; then
1995 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1996 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1998 DLLFLAGS="$DLLFLAGS -DEBUG"
1999 LDFLAGS="$LDFLAGS -DEBUG"
2003 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
2004 if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
2005 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
2008 if test "$OS_TARGET" = "WINNT"; then
2009 CFLAGS="$CFLAGS -GT"
2010 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2011 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2013 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2014 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2018 if test -n "$USE_STATIC_TLS"; then
2019 AC_DEFINE(_PR_USE_STATIC_TLS)
2022 if test "$OS_TARGET" = "WINNT"; then
2026 # undefine WINNT as some versions of mingw gcc define it by default
2027 DEFINES="$DEFINES -UWINNT"
2028 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2031 if test "$CPU_ARCH" = "x86"; then
2034 CPU_ARCH_TAG=$CPU_ARCH
2037 if test "$USE_DEBUG_RTL" = 1; then
2041 case "$OS_TARGET" in
2043 MDCPUCFG_H=_winnt.cfg
2046 MDCPUCFG_H=_win95.cfg
2049 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
2053 case "$target_cpu" in
2055 if test -n "$USE_64"; then
2059 if test -z "$GNU_CC" -a "$MSC_VER" -ge "1700"; then
2060 dnl Visual C++ 2012 defaults to -arch:SSE2. Use -arch:IA32
2061 dnl to avoid requiring SSE2.
2062 CFLAGS="$CFLAGS -arch:IA32"
2075 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2083 AC_DEFINE(HAVE_BSD_FLOCK)
2084 AC_DEFINE(HAVE_SOCKLEN_T)
2085 if test -z "$USE_NSPR_THREADS"; then
2088 MDCPUCFG_H=_netbsd.cfg
2089 PR_MD_CSRCS=netbsd.c
2091 DSO_CFLAGS='-fPIC -DPIC'
2092 CFLAGS="$CFLAGS -ansi -Wall"
2093 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2094 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
2096 if test -z "$OBJECT_FMT"; then
2097 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
2100 DSO_LDOPTS='-shared'
2104 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
2108 if test "$LIBRUNPATH"; then
2109 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
2116 AC_DEFINE(_QNX_SOURCE)
2117 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2120 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
2123 OS_LIBS="$OS_LIBS -lsocket"
2124 _OPTIMIZE_FLAGS="-O1"
2125 _DEBUG_FLAGS="-gstabs"
2131 AC_DEFINE(HAVE_BSD_FLOCK)
2132 AC_DEFINE(HAVE_SOCKLEN_T)
2133 CFLAGS="$CFLAGS -ansi -Wall"
2134 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2137 MDCPUCFG_H=_openbsd.cfg
2138 PR_MD_CSRCS=openbsd.c
2140 if test -z "$USE_NSPR_THREADS"; then
2143 DSO_LDOPTS='-shared -fPIC -Wl,-soname,$(notdir $@)'
2144 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2148 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2151 AC_DEFINE(_REENTRANT)
2152 # OSF1 and HPUX report the POLLHUP event for a socket when the
2153 # shutdown(SHUT_WR) operation is called for the remote end, even though
2154 # the socket is still writeable. Use select(), instead of poll(), to
2155 # workaround this problem.
2156 AC_DEFINE(_PR_POLL_WITH_SELECT)
2158 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2162 if test -z "$GNU_CC"; then
2163 CC="$CC -std1 -ieee_with_inexact"
2164 if test "$OS_RELEASE" != "V2.0"; then
2165 CC="$CC -readonly_strings"
2167 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2168 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2170 CFLAGS="$CFLAGS -mieee"
2171 CXXFLAGS="$CXXFLAGS -mieee"
2174 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2175 AC_DEFINE(HAVE_INT_LOCALTIME_R)
2177 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2178 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2180 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2181 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2183 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2184 MDCPUCFG_H=_osf1.cfg
2191 AC_DEFINE(_PR_NEED_H_ERRNO)
2200 AC_DEFINE(_PR_NEED_H_ERRNO)
2202 MDCPUCFG_H=_riscos.cfg
2203 PR_MD_CSRCS=riscos.c
2205 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2206 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2215 AC_DEFINE(_PR_NEED_H_ERRNO)
2216 CC='cc -b elf -KPIC'
2217 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2220 DSO_LDOPTS='-b elf -G'
2221 MDCPUCFG_H=_scoos.cfg
2226 if test -z "$USE_NSPR_THREADS"; then
2235 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2237 MDCPUCFG_H=_solaris.cfg
2238 PR_MD_CSRCS=solaris.c
2240 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2241 RESOLVE_LINK_SYMBOLS=1
2242 case "${OS_RELEASE}" in
2246 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2250 if test -n "$GNU_CC"; then
2252 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2255 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2256 if test -n "$USE_B_DIRECT"; then
2257 DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2261 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2262 if test -n "$USE_B_DIRECT"; then
2263 DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2266 if test -n "$GNU_CC"; then
2267 CFLAGS="$CFLAGS -Wall"
2268 CXXFLAGS="$CXXFLAGS -Wall"
2269 if test -n "$USE_MDUPDATE"; then
2270 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2271 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2273 GCC_AS=`$CC -print-prog-name=as`
2274 if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2278 CFLAGS="$CFLAGS -xstrconst"
2279 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2280 if test -z "$MOZ_OPTIMIZE"; then
2281 CFLAGS="$CFLAGS -xs"
2282 CXXFLAGS="$CXXFLAGS -xs"
2284 _OPTIMIZE_FLAGS=-xO4
2286 if test -z "$GNU_AS"; then
2287 ASFLAGS="$ASFLAGS -Wa,-P"
2289 if test -n "$USE_64"; then
2290 if test -n "$GNU_CC"; then
2294 if test "$OS_TEST" = "i86pc"; then
2295 CC="$CC -xarch=amd64"
2296 CXX="$CXX -xarch=amd64"
2299 CXX="$CXX -xarch=v9"
2303 if test "$OS_TEST" = "i86pc"; then
2304 if test -z "$USE_64"; then
2307 CPU_ARCH_TAG=_$OS_TEST
2308 # The default debug format, DWARF (-g), is not supported by gcc
2309 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
2310 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2311 # If your gcc uses GNU as, you do not need the -Wa,-s option.
2312 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2313 _DEBUG_FLAGS=-gstabs
2314 if test -z "$GNU_AS"; then
2315 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2319 case "${target_os}" in
2321 AC_DEFINE(_PR_NO_LARGE_FILES)
2324 AC_DEFINE(_PR_NO_LARGE_FILES)
2327 AC_DEFINE(SOLARIS2_5)
2330 AC_DEFINE(_PR_HAVE_OFF64_T)
2331 # The lfcompile64(5) man page on Solaris 2.6 says:
2332 # For applications that do not wish to conform to the POSIX or
2333 # X/Open specifications, the 64-bit transitional interfaces
2334 # are available by default. No compile-time flags need to be
2336 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2337 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2338 if test -n "$GNU_CC"; then
2339 AC_DEFINE(_LARGEFILE64_SOURCE)
2343 case "${target_os}" in
2355 # Solaris 8 or higher has IPv6.
2356 AC_DEFINE(_PR_INET6)
2359 if test "$CPU_ARCH" = "sparc"; then
2360 # 64-bit Solaris SPARC requires V9 architecture, so the following
2362 if test -z "$USE_64"; then
2363 ULTRASPARC_LIBRARY=nspr_flt
2366 # Purify requires that binaries linked against nspr also
2367 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2369 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2370 OS_LIBS="$OS_LIBS $_librt"
2379 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2380 AC_DEFINE(_PR_NO_LARGE_FILES)
2381 CC='$(NSDEPTH)/build/hcc cc'
2382 CXX='$(NSDEPTH)/build/hcpp CC'
2383 MDCPUCFG_H=_unixware.cfg
2385 AC_DEFINE(_LARGEFILE64_SOURCE)
2386 AC_DEFINE(_PR_HAVE_OFF64_T)
2387 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2388 MDCPUCFG_H=_unixware7.cfg
2390 PR_MD_CSRCS=unixware.c
2396 AC_ARG_WITH(symbian-sdk,
2397 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
2398 The path to the Symbian SDK],
2399 SYMBIAN_SDK_DIR=$withval)
2401 echo -----------------------------------------------------------------------------
2402 echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2403 echo -----------------------------------------------------------------------------
2408 AC_DEFINE(__SYMBIAN32__)
2411 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2412 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2413 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2414 AC_DEFINE(HAVE_SOCKLEN_T)
2422 MDCPUCFG_H=_symbian.cfg
2423 PR_MD_CSRCS=symbian.c
2425 RANLIB='echo no ranlib '
2428 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2429 CFLAGS="$CFLAGS -MD -nostdinc"
2430 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2431 echo -------------------------------------------------------
2432 echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2433 echo -------------------------------------------------------
2434 case "$OS_TARGET" in
2440 WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2441 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)"
2442 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2443 AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2447 AC_DEFINE(__WINSCW__)
2448 DEFINES="$DEFINES -U_WIN32"
2451 CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2452 CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2453 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2456 DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2459 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2462 CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2468 AC_DEFINE(BSD_SELECT)
2469 AC_DEFINE(TCPV40HDRS)
2477 RESOLVE_LINK_SYMBOLS=1
2482 CFLAGS="$CFLAGS -Wall -Zomf"
2483 CXXFLAGS="$CFLAGS -Wall -Zomf"
2484 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2486 DSO_LDOPTS='-Zomf -Zdll'
2488 _OPTIMIZE_FLAGS="-O2 -s"
2489 _DEBUG_FLAGS="-g -fno-inline"
2490 if test -n "$MOZ_OPTIMIZE"; then
2491 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2495 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2496 LDFLAGS="$LDFLAGS -Zhigh-mem"
2497 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2500 # GCC for OS/2 currently predefines these, but we don't want them
2501 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2510 if test -z "$SKIP_LIBRARY_CHECKS"; then
2511 dnl ========================================================
2512 dnl Check for system libraries
2513 dnl ========================================================
2516 dnl We don't want anything to link with libdl even if it's present on OS X,
2517 dnl since it's not used and not part of the default installation.
2518 dnl The same goes for BeOS.
2519 dnl OS/2 has dlfcn in libc.
2522 *-darwin*|*-beos*|*-os2*)
2525 AC_CHECK_LIB(dl, dlopen,
2526 [AC_CHECK_HEADER(dlfcn.h,
2527 OS_LIBS="-ldl $OS_LIBS")])
2532 dnl ========================================================
2533 dnl Check for system header files.
2534 dnl ========================================================
2536 dnl ========================================================
2537 dnl Check for typedefs and structs
2538 dnl ========================================================
2540 dnl ========================================================
2541 dnl Checks for library functions.
2542 dnl ========================================================
2543 AC_PROG_GCC_TRADITIONAL
2545 LIBS="$LIBS $OS_LIBS"
2546 AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
2549 dnl ========================================================
2551 dnl ========================================================
2553 dnl ======================================================
2554 dnl = Enable compiling with ccache
2555 dnl ======================================================
2557 [ --with-ccache[=path/to/ccache]
2558 Enable compiling with ccache],
2559 CCACHE=$withval, CCACHE="no")
2561 if test "$CCACHE" != "no"; then
2562 if test -n "$CCACHE"; then
2563 if test "$CCACHE" = "yes"; then
2566 if test ! -e "$CCACHE"; then
2567 AC_MSG_ERROR([$CCACHE not found])
2571 AC_PATH_PROGS(CCACHE, $CCACHE ccache)
2572 if test -z "$CCACHE" -o "$CCACHE" = ":"; then
2573 AC_MSG_ERROR([ccache not found])
2574 elif test -x "$CCACHE"; then
2578 AC_MSG_ERROR([$CCACHE is not executable])
2582 dnl ========================================================
2584 dnl = --enable-strip
2586 dnl = Enable stripping of libs and executables
2588 dnl ========================================================
2589 AC_ARG_ENABLE(strip,
2590 [ --enable-strip Enable stripping of shared libs and programs],
2591 [ if test "$enableval" = "yes"; then
2595 dnl Check for hpux options
2596 case "${target_os}" in
2598 if test -z "$GNU_CC"; then
2600 AC_CACHE_CHECK(for +Olit support,
2601 ac_cv_hpux_usable_olit_option,
2602 dnl since aCC doesn't throw an error on invalid options,
2603 dnl we have to test this the hard way
2604 [ac_cv_hpux_usable_olit_option=no
2606 echo 'int main() { return 0; }' | cat > conftest.c
2607 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2608 if test $? -eq 0; then
2609 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2610 ac_cv_hpux_usable_olit_option=yes
2616 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2617 CFLAGS="$CFLAGS +Olit=all"
2618 CXXFLAGS="$CXXFLAGS +Olit=all"
2620 CFLAGS="$CFLAGS +ESlit"
2621 CXXFLAGS="$CXXFLAGS +ESlit"
2627 case "$target_os" in
2632 AC_CHECK_LIB(pthreads, pthread_create,
2633 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2634 AC_CHECK_LIB(pthread, pthread_create,
2635 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2636 AC_CHECK_LIB(c_r, pthread_create,
2637 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2638 AC_CHECK_LIB(c, pthread_create,
2647 AC_ARG_WITH(pthreads,
2648 [ --with-pthreads Use system pthreads library as thread subsystem],
2649 [ if test "$withval" = "yes"; then
2650 if test -n "$_HAVE_PTHREADS"; then
2655 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2661 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2667 AC_ARG_ENABLE(user-pthreads,
2668 [ --enable-user-pthreads Build using userland pthreads],
2669 [ if test "$enableval" = "yes"; then
2670 if test -n "$_HAVE_PTHREADS"; then
2675 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2679 AC_ARG_ENABLE(nspr-threads,
2680 [ --enable-nspr-threads Build using classic nspr threads],
2681 [ if test "$enableval" = "yes"; then
2689 AC_ARG_WITH(bthreads,
2690 [ --with-bthreads Use system bthreads library as thread subsystem
2692 [ if test "$withval" = "yes"; then
2700 fi # SKIP_LIBRARY_CHECKS
2703 [ --enable-ipv6 Compile ipv6 support],
2704 [ if test "$enableval" = "yes"; then
2710 if test -n "$USE_PTHREADS"; then
2711 dnl See if -pthread is supported.
2713 ac_cv_have_dash_pthread=no
2714 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2715 echo 'int main() { return 0; }' | cat > conftest.c
2716 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2717 if test $? -eq 0; then
2718 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2719 ac_cv_have_dash_pthread=yes
2720 case "$target_os" in
2722 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2725 CFLAGS="$CFLAGS -pthread"
2726 CXXFLAGS="$CXXFLAGS -pthread"
2732 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2735 dnl See if -pthreads is supported.
2737 ac_cv_have_dash_pthreads=no
2738 if test "$ac_cv_have_dash_pthread" = "no"; then
2739 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2740 echo 'int main() { return 0; }' | cat > conftest.c
2741 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2742 if test $? -eq 0; then
2743 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2744 ac_cv_have_dash_pthreads=yes
2745 CFLAGS="$CFLAGS -pthreads"
2746 CXXFLAGS="$CXXFLAGS -pthreads"
2750 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2755 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2760 AC_DEFINE(_REENTRANT)
2761 AC_DEFINE(_THREAD_SAFE)
2762 dnl -pthread links in -lc_r, so don't specify it explicitly.
2763 if test "$ac_cv_have_dash_pthread" = "yes"; then
2764 _PTHREAD_LDFLAGS="-pthread"
2766 _PTHREAD_LDFLAGS="-lc_r"
2770 if test "$ac_cv_have_dash_pthread" = "yes"; then
2771 _PTHREAD_LDFLAGS="-pthread"
2775 AC_DEFINE(_THREAD_SAFE)
2776 dnl -pthread links in -lc_r, so don't specify it explicitly.
2777 if test "$ac_cv_have_dash_pthread" = "yes"; then
2782 if test "$ac_cv_have_dash_pthread" = "yes"; then
2783 _PTHREAD_LDFLAGS=-pthread
2786 *-linux*|*-gnu*|*-k*bsd*-gnu)
2787 AC_DEFINE(_REENTRANT)
2792 if test -n "$USE_USER_PTHREADS"; then
2799 dnl Special thread exceptions
2803 if test -n "$USE_NSPR_THREADS"; then
2804 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2806 case "$target_os" in
2808 if test -z "$USE_PTHREADS"; then
2809 AC_DEFINE(AIX_RENAME_SELECT)
2813 if test -z "$USE_NSPR_THREADS"; then
2814 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2818 if test -z "$USE_NSPR_THREADS"; then
2819 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2821 if test -n "$USE_PTHREADS"; then
2822 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2826 if test -z "$USE_NSPR_THREADS"; then
2827 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2829 if test -n "$USE_PTHREADS"; then
2830 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2836 if test -n "$USE_PTHREADS"; then
2837 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2841 if test -n "$USE_NSPR_THREADS"; then
2842 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2846 if test -n "$USE_NSPR_THREADS"; then
2847 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2849 if test "$USE_PTHREADS"; then
2850 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2851 AC_DEFINE(_REENTRANT)
2852 AC_DEFINE(_PR_DCETHREADS)
2854 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2855 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2858 if test "$USE_USER_PTHREADS"; then
2859 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2863 if test "${target_os}" = "irix6.5"; then
2864 if test -n "$USE_PTHREADS"; then
2865 AC_DEFINE(_PR_HAVE_GETHOST_R)
2866 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2870 *-linux*|*-gnu*|*-k*bsd*-gnu)
2871 if test -n "$USE_NSPR_THREADS"; then
2872 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2875 *-mingw*|*-msys*|*-cygwin*|*-mks*|*-os2*|*-beos*)
2876 dnl win32, os2 & beos cannot use pthreads
2881 *-netbsd*|*-openbsd*)
2882 if test -n "$USE_NSPR_THREADS"; then
2883 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2887 if test -n "$USE_NSPR_THREADS"; then
2888 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2890 if test -n "$USE_PTHREADS"; then
2891 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2894 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2899 if test -n "$USE_NSPR_THREADS"; then
2900 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2902 if test -n "$USE_PTHREADS"; then
2903 AC_DEFINE(_REENTRANT)
2904 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2905 if test "$OS_TEST" = "i86pc"; then
2906 if test -n "$USE_64"; then
2907 PR_MD_ASFILES=os_SunOS_x86_64.s
2909 PR_MD_ASFILES=os_SunOS_x86.s
2912 if test -n "$USE_64"; then
2913 PR_MD_ASFILES=os_SunOS_sparcv9.s
2919 if test -n "$USE_PTHREADS"; then
2920 AC_DEFINE(_PR_HAVE_GETHOST_R)
2921 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2926 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
2928 dnl If the user passed in arg to --enable-optimize or --enable-debug,
2929 dnl make sure that we use it.
2930 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
2931 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
2934 if test -n "$_SAVE_DEBUG_FLAGS"; then
2935 _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
2938 if test -n "$MOZ_OPTIMIZE"; then
2939 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
2940 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
2943 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2944 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
2945 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
2948 if test -n "$MOZ_OPTIMIZE"; then
2954 if test -n "$USE_64"; then
2958 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
2960 dnl ========================================================
2961 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
2962 dnl ========================================================
2963 case "$target_os" in
2965 CC="\$(CYGWIN_WRAPPER) $CC"
2966 CXX="\$(CYGWIN_WRAPPER) $CXX"
2967 RC="\$(CYGWIN_WRAPPER) $RC"
2971 dnl ========================================================
2972 dnl = Use malloc wrapper lib
2973 dnl ========================================================
2974 AC_ARG_ENABLE(wrap-malloc,
2975 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
2976 [ if test "$enableval" = "yes"; then
2980 if test -n "$_WRAP_MALLOC"; then
2981 if test -n "$GNU_CC"; then
2982 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
2983 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
2984 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
2985 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
2987 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
2991 dnl ========================================================
2992 dnl = Location of malloc wrapper lib
2993 dnl ========================================================
2994 AC_ARG_WITH(wrap-malloc,
2995 [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
2996 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
2998 dnl ========================================================
2999 dnl Substitution of found variables.
3000 dnl ========================================================
3001 AC_SUBST(SHELL_OVERRIDE)
3003 AC_SUBST(MOZILLA_CLIENT)
3010 AC_SUBST(HOST_CFLAGS)
3012 AC_SUBST(HOST_LDFLAGS)
3014 AC_SUBST(GCC_USE_GNU_LD)
3016 AC_SUBST(CROSS_COMPILE)
3018 AC_SUBST(MOZ_OPTIMIZE)
3020 AC_SUBST(MOZ_DEBUG_SYMBOLS)
3027 AC_SUBST(OBJECT_MODE)
3028 AC_SUBST(ENABLE_STRIP)
3030 AC_SUBST(USE_PTHREADS)
3031 AC_SUBST(USE_BTHREADS)
3032 AC_SUBST(USE_USER_PTHREADS)
3033 AC_SUBST(USE_NSPR_THREADS)
3038 AC_SUBST(MOD_MAJOR_VERSION)
3039 AC_SUBST(MOD_MINOR_VERSION)
3040 AC_SUBST(MOD_PATCH_VERSION)
3041 AC_SUBST(NSPR_MODNAME)
3042 AC_SUBST(MDCPUCFG_H)
3043 AC_SUBST(PR_MD_CSRCS)
3044 AC_SUBST(PR_MD_ASFILES)
3045 AC_SUBST(PR_MD_ARCH_DIR)
3048 AC_SUBST(OBJ_SUFFIX)
3049 AC_SUBST(LIB_SUFFIX)
3050 AC_SUBST(DLL_SUFFIX)
3051 AC_SUBST(ASM_SUFFIX)
3052 AC_SUBST(WRAP_LDFLAGS)
3054 AC_SUBST(DSO_CFLAGS)
3055 AC_SUBST(DSO_LDOPTS)
3059 AC_SUBST(OS_RELEASE)
3061 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3076 AC_SUBST(PROFILE_GEN_CFLAGS)
3077 AC_SUBST(PROFILE_GEN_LDFLAGS)
3078 AC_SUBST(PROFILE_USE_CFLAGS)
3079 AC_SUBST(PROFILE_USE_LDFLAGS)
3082 AC_SUBST(RESOLVE_LINK_SYMBOLS)
3083 AC_SUBST(AIX_LINK_OPTS)
3084 AC_SUBST(NOSUCHFILE)
3085 AC_SUBST(MOZ_OBJFORMAT)
3086 AC_SUBST(ULTRASPARC_LIBRARY)
3089 AC_SUBST(OBJDIR_NAME)
3090 AC_SUBST(RELEASE_OBJDIR_NAME)
3097 AC_SUBST(OS_DLLFLAGS)
3098 AC_SUBST(CYGWIN_WRAPPER)
3099 AC_SUBST(VISIBILITY_FLAGS)
3100 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3101 AC_SUBST(MACOS_SDK_DIR)
3102 AC_SUBST(SYMBIAN_SDK_DIR)
3106 dnl ========================================================
3107 dnl Generate output files.
3108 dnl ========================================================
3120 lib/libc/include/Makefile
3121 lib/libc/src/Makefile
3126 pr/include/md/Makefile
3127 pr/include/obsolete/Makefile
3128 pr/include/private/Makefile
3131 pr/src/linking/Makefile
3132 pr/src/malloc/Makefile
3134 pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3135 pr/src/memory/Makefile
3136 pr/src/misc/Makefile
3137 pr/src/threads/Makefile
3139 pr/tests/dll/Makefile
3142 if test "$OS_TARGET" = "Linux"; then
3143 MAKEFILES="$MAKEFILES
3146 elif test "$OS_TARGET" = "SunOS"; then
3147 MAKEFILES="$MAKEFILES
3148 pkg/solaris/Makefile
3149 pkg/solaris/SUNWpr/Makefile
3150 pkg/solaris/SUNWprd/Makefile
3154 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3155 MAKEFILES="$MAKEFILES
3156 pr/src/threads/combined/Makefile
3158 elif test -n "$USE_PTHREADS"; then
3159 MAKEFILES="$MAKEFILES
3160 pr/src/pthreads/Makefile
3162 elif test -n "$USE_BTHREADS"; then
3163 MAKEFILES="$MAKEFILES
3164 pr/src/bthreads/Makefile
3168 if test -n "$USE_CPLUS"; then
3169 MAKEFILES="$MAKEFILES
3170 pr/src/cplus/Makefile
3171 pr/src/cplus/tests/Makefile
3175 echo $MAKEFILES > unallmakefiles
3177 AC_CONFIG_FILES([$MAKEFILES])
3178 AC_CONFIG_COMMANDS([default], [chmod +x config/nspr-config])