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
163 dnl prevent cross compile section from using these flags as host flags
164 if test -z "$HOST_CPPFLAGS" ; then
167 if test -z "$HOST_CFLAGS" ; then
170 if test -z "$HOST_CXXFLAGS" ; then
173 if test -z "$HOST_LDFLAGS" ; then
180 *-android*|*-linuxandroid*)
181 if test -z "$android_ndk" ; then
182 AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
185 if test -z "$android_toolchain" ; then
186 AC_MSG_CHECKING([for android toolchain directory])
188 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
190 case "$target_cpu" in
192 target_name=arm-linux-androideabi-4.4.3
195 target_name=x86-4.4.3
198 target_name=mipsel-linux-android-4.4.3
201 android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
203 if test -d "$android_toolchain" ; then
204 AC_MSG_RESULT([$android_toolchain])
206 AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
210 if test -z "$android_platform" ; then
211 AC_MSG_CHECKING([for android platform directory])
213 case "$target_cpu" in
225 android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name"
227 if test -d "$android_platform" ; then
228 AC_MSG_RESULT([$android_platform])
230 AC_MSG_ERROR([not found. You have to specify --with-android-platform=/path/to/ndk/platform.])
234 dnl Old NDK support. If minimum requirement is changed to NDK r8b,
235 dnl please remove this.
236 case "$target_cpu" in
238 if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
239 dnl Old NDK toolchain name
240 android_tool_prefix="i686-android-linux"
246 AS="$android_toolchain"/bin/"$android_tool_prefix"-as
247 CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
248 CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
249 CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
250 LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
251 AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
252 RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
253 STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
255 CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
256 CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
257 CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
258 LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
260 dnl prevent cross compile section from using these flags as host flags
261 if test -z "$HOST_CPPFLAGS" ; then
264 if test -z "$HOST_CFLAGS" ; then
267 if test -z "$HOST_CXXFLAGS" ; then
270 if test -z "$HOST_LDFLAGS" ; then
279 dnl ========================================================
281 dnl = Check options that may affect the compiler
283 dnl ========================================================
284 dist_prefix='${MOD_DEPTH}/dist'
285 dist_bindir='${dist_prefix}/bin'
286 dist_includedir='${dist_prefix}/include/nspr'
287 dist_libdir='${dist_prefix}/lib'
288 dnl If the --includedir option was not specified, add '/nspr' to autoconf's
289 dnl default value of includedir.
290 if test "${includedir}" = '${prefix}/include'; then
291 includedir='${prefix}/include/nspr'
294 AC_ARG_WITH(dist-prefix,
295 [ --with-dist-prefix=DIST_PREFIX
296 place build files in DIST_PREFIX [dist]],
297 dist_prefix=$withval)
299 AC_ARG_WITH(dist-bindir,
300 [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
301 dist_bindir=$withval)
303 AC_ARG_WITH(dist-includedir,
304 [ --with-dist-includedir=DIR
305 build include files in DIR [DIST_PREFIX/include/nspr]],
306 dist_includedir=$withval)
308 AC_ARG_WITH(dist-libdir,
309 [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
310 dist_libdir=$withval)
312 AC_SUBST(dist_prefix)
313 AC_SUBST(dist_bindir)
314 AC_SUBST(dist_includedir)
315 AC_SUBST(dist_libdir)
317 dnl Check if NSPR is being compiled for Mozilla
318 dnl Let --with-arg override environment setting
321 [ --with-mozilla Compile NSPR with Mozilla support],
322 [ if test "$withval" = "yes"; then
323 AC_DEFINE(MOZILLA_CLIENT)
328 [ if test -n "$MOZILLA_CLIENT"; then
329 AC_DEFINE(MOZILLA_CLIENT)
332 AC_ARG_ENABLE(optimize,
333 [ --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ],
334 [ if test "$enableval" != "no"; then
336 if test -n "$enableval" -a "$enableval" != "yes"; then
337 _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
338 _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
345 [ --enable-debug[=DBG] Enable debugging (using compiler flags DBG)],
346 [ if test "$enableval" != "no"; then
349 if test -n "$enableval" -a "$enableval" != "yes"; then
350 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
351 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
358 AC_ARG_ENABLE(debug-symbols,
359 [ --enable-debug-symbols[=DBG] Enable debugging symbols
360 (using compiler flags DBG)],
361 [ if test "$enableval" != "no"; then
363 if test -n "$enableval" -a "$enableval" != "yes"; then
364 if test -z "$_SAVE_DEBUG_FLAGS"; then
365 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
366 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
368 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
375 AC_ARG_ENABLE(win32-target,
376 [ --enable-win32-target=\$t
377 Specify win32 flavor. (WIN95 or WINNT)],
378 OS_TARGET=`echo $enableval | tr a-z A-Z`)
380 AC_ARG_ENABLE(symbian-target,
381 [ --enable-symbian-target=\$t
382 Specify symbian flavor. (WINSCW or GCCE)],
383 OS_TARGET=`echo $enableval | tr a-z A-Z`)
385 AC_ARG_ENABLE(debug-rtl,
386 [ --enable-debug-rtl Use the MSVC debug runtime library],
387 [ if test "$enableval" = "yes"; then
393 AC_ARG_ENABLE(static-rtl,
394 [ --enable-static-rtl Use the MSVC static runtime library],
395 [ if test "$enableval" = "yes"; then
400 [ --enable-n32 Enable n32 ABI support (IRIX only)],
401 [ if test "$enableval" = "yes"; then
403 else if test "$enableval" = "no"; then
409 [ --enable-x32 Enable x32 ABI support (x86_64 only)],
410 [ if test "$enableval" = "yes"; then
412 else if test "$enableval" = "no"; then
418 [ --enable-64bit Enable 64-bit support (on certain platforms)],
419 [ if test "$enableval" = "yes"; then
423 AC_ARG_ENABLE(mdupdate,
424 [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
425 [ if test "$enableval" = "yes"; then
430 [ --enable-cplus Enable some c++ api routines],
431 [ if test "$enableval" = "yes"; then
435 AC_ARG_WITH(arm-kuser,
436 [ --with-arm-kuser Use kuser helpers (Linux/ARM only)
437 (Requires kernel 2.6.13 or later)],
438 [ if test "$withval" = "yes"; then
439 AC_DEFINE(_PR_ARM_KUSER)
442 dnl ========================================================
443 dnl = Mac OS X SDK support
444 dnl ========================================================
445 AC_ARG_WITH(macos-sdk,
446 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
447 MACOS_SDK_DIR=$withval)
449 AC_ARG_ENABLE(macos-target,
450 [ --enable-macos-target=VER
451 Set the minimum MacOS version needed at runtime
452 [10.2 for ppc, 10.4 for x86]],
453 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
455 dnl ========================================================
457 dnl = Set the threading model
459 dnl ========================================================
463 case "${target_os}" in
475 dnl ========================================================
477 dnl = Set the default C compiler
479 dnl ========================================================
480 if test -z "$CC"; then
484 if test -z "$USE_NSPR_THREADS"; then
510 dnl ========================================================
512 dnl = Set the default C++ compiler
514 dnl ========================================================
515 if test -z "$CXX"; then
519 if test -z "$USE_NSPR_THREADS"; then
527 case "${target_os}" in
555 if test -z "$SKIP_PATH_CHECKS"; then
556 AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
559 if test -n "$MOZ_DEBUG"; then
561 DEFINES="$DEFINES -UNDEBUG"
563 case "${target_os}" in
565 DEFINES="$DEFINES -DDEBUG_${USER}"
567 mks*|cygwin*|mingw*|msys*|os2*)
568 DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
571 DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
576 DEFINES="$DEFINES -UDEBUG"
579 if test -z "$SKIP_COMPILER_CHECKS"; then
580 dnl ========================================================
581 dnl Checks for compilers.
582 dnl ========================================================
583 if test "$target" != "$host"; then
584 echo "cross compiling from $host to $target"
587 case "$build:$target" in
588 powerpc-apple-darwin8*:i?86-apple-darwin*)
589 dnl The Darwin cross compiler doesn't necessarily point itself at a
590 dnl root that has libraries for the proper architecture, it defaults
591 dnl to the system root. The libraries in the system root on current
592 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
593 dnl checks will fail. Fake a working SDK in that case.
595 _SAVE_CXXFLAGS=$CXXFLAGS
596 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
597 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
599 *:arm*-apple-darwin*)
600 dnl The arm compiler doesn't appear to know about its root by default,
601 dnl so explicitly pass it one here. Later on we'll put this in CFLAGS
604 _SAVE_CXXFLAGS=$CXXFLAGS
605 CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS"
606 CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS"
610 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
612 dnl Now exit the conditional block to invoke AC_PROG_CC.
615 dnl In the latest versions of autoconf, AC_PROG_CC is a one-shot macro,
616 dnl declared with AC_DEFUN_ONCE. So it must not be expanded inside a
617 dnl conditional block. Invoke AC_PROG_CC outside any conditional block
618 dnl and before invoking AC_TRY_COMPILE (which requires AC_PROG_CC).
621 dnl Reenter the conditional blocks after invoking AC_PROG_CC.
622 if test "$target" != "$host"; then
623 if test -n "$USE_CPLUS"; then
624 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
629 case "$build:$target" in
630 powerpc-apple-darwin8*:i?86-apple-darwin*|*:arm*-apple-darwin*)
631 dnl Revert the changes made above. From this point on, the target
632 dnl compiler will never be used without applying the SDK to CFLAGS
633 dnl (see --with-macos-sdk below).
635 CXXFLAGS=$_SAVE_CXXFLAGS
639 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
640 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
641 AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
642 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
643 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
644 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
647 _SAVE_CFLAGS="$CFLAGS"
648 _SAVE_LDFLAGS="$LDFLAGS"
650 AC_MSG_CHECKING([for $host compiler])
651 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
652 if test -z "$HOST_CC"; then
653 AC_MSG_ERROR([no acceptable cc found in \$PATH])
655 AC_MSG_RESULT([$HOST_CC])
656 if test -z "$HOST_CFLAGS"; then
657 HOST_CFLAGS="$CFLAGS"
659 if test -z "$HOST_LDFLAGS"; then
660 HOST_LDFLAGS="$LDFLAGS"
664 CFLAGS="$HOST_CFLAGS"
665 LDFLAGS="$HOST_LDFLAGS"
667 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
668 AC_TRY_COMPILE([], [return 0;],
669 [AC_MSG_RESULT([yes])],
670 [AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.])] )
674 LDFLAGS=$_SAVE_LDFLAGS
676 if test -n "$USE_CPLUS"; then
677 if test "$CC" = "cl" -a -z "$CXX"; then
684 AC_PATH_PROGS(AS, as, $CC)
685 AC_PATH_PROGS(AR, ar, echo not_ar)
686 AC_PATH_PROGS(LD, ld link, echo not_ld)
687 AC_PATH_PROGS(STRIP, strip, echo not_strip)
688 AC_PATH_PROGS(WINDRES, windres, echo not_windres)
689 if test -z "$HOST_CC"; then
692 if test -z "$HOST_CFLAGS"; then
693 HOST_CFLAGS="$CFLAGS"
699 if test "$GCC" = "yes"; then
702 if test "$GXX" = "yes"; then
705 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
710 case "$build:$target" in
711 i?86-apple-darwin*:powerpc-apple-darwin*)
712 dnl cross_compiling will have erroneously been set to "no" in this
713 dnl case, because the x86 build host is able to run ppc code in a
714 dnl translated environment, making a cross compiler appear native.
719 if test "$cross_compiling" = "yes"; then
725 dnl ========================================================
726 dnl Check for gcc -pipe support
727 dnl ========================================================
728 AC_MSG_CHECKING([for gcc -pipe support])
729 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
730 echo '#include <stdio.h>' > dummy-hello.c
731 echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
732 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
733 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
739 if test "$_res_as_stdin" = "yes"; then
741 CFLAGS="$CFLAGS -pipe"
742 AC_TRY_COMPILE( [ #include <stdio.h> ],
743 [printf("Hello World\n");],
744 [_res_gcc_pipe="yes"],
745 [_res_gcc_pipe="no"] )
748 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
750 CFLAGS="$CFLAGS -pipe"
751 CXXFLAGS="$CXXFLAGS -pipe"
755 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
756 AC_MSG_RESULT([$_res])
761 dnl ========================================================
762 dnl Profile guided optimization
763 dnl ========================================================
764 dnl Test for profiling options
765 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
767 _SAVE_CFLAGS="$CFLAGS"
768 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
770 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
771 AC_TRY_COMPILE([], [return 0;],
772 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
773 result="yes" ], result="no")
774 AC_MSG_RESULT([$result])
776 if test $result = "yes"; then
777 PROFILE_GEN_LDFLAGS="-fprofile-generate"
778 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
779 PROFILE_USE_LDFLAGS="-fprofile-use"
782 CFLAGS="$_SAVE_CFLAGS"
784 dnl ===============================================================
785 dnl Check for .hidden assembler directive and visibility attribute.
786 dnl Borrowed from glibc configure.in
787 dnl ===============================================================
788 if test "$GNU_CC"; then
789 AC_CACHE_CHECK(for visibility(hidden) attribute,
790 ac_cv_visibility_hidden,
791 [cat > conftest.c <<EOF
792 int foo __attribute__ ((visibility ("hidden"))) = 1;
794 ac_cv_visibility_hidden=no
795 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
796 if grep '\.hidden.*foo' conftest.s >/dev/null; then
797 ac_cv_visibility_hidden=yes
802 if test "$ac_cv_visibility_hidden" = "yes"; then
803 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
804 AC_CACHE_CHECK(for visibility pragma support,
805 ac_cv_visibility_pragma,
806 [cat > conftest.c <<EOF
807 #pragma GCC visibility push(hidden)
809 #pragma GCC visibility push(default)
812 ac_cv_visibility_pragma=no
813 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
814 if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
815 if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
816 ac_cv_visibility_pragma=yes
822 if test "$ac_cv_visibility_pragma" = "yes"; then
823 AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
824 # To work around a build problem on Linux x86-64 (Bugzilla bug
825 # 293438), we use the -fvisibility=hidden flag. This flag is less
826 # optimal than #pragma GCC visibility push(hidden) because the flag
827 # assumes that symbols defined outside the current source file have
828 # the default visibility. This has the advantage that we don't need
829 # to wrap system header files, but has the disadvantage that calls
830 # to hidden symbols defined in other source files cannot be
831 # optimized by the compiler. The -fvisibility=hidden flag does
832 # hide and export symbols correctly.
833 #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
834 #WRAP_SYSTEM_INCLUDES=1
835 VISIBILITY_FLAGS="-fvisibility=hidden"
836 WRAP_SYSTEM_INCLUDES=
841 fi # SKIP_COMPILER_CHECKS
843 dnl ========================================================
844 dnl Checks for programs.
845 dnl ========================================================
846 if test -z "$SKIP_PATH_CHECKS"; then
847 AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
848 elif test -z "$PERL"; then
852 dnl ========================================================
853 dnl Default platform specific options
854 dnl ========================================================
859 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
867 if test -n "$CROSS_COMPILE"; then
868 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
870 OS_TEST="${target_cpu}"
871 case "${target_os}" in
872 linux*) OS_ARCH=Linux ;;
873 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
874 mingw*) OS_ARCH=WINNT CPU_ARCH=x86 ;;
875 darwin*) OS_ARCH=Darwin ;;
876 riscos*) OS_ARCH=RISCOS ;;
879 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
880 OS_RELEASE=`uname -r`
884 if test "$OS_ARCH" = "IRIX64"; then
888 if test "$OS_ARCH" = "AIX"; then
889 OS_RELEASE=`uname -v`.`uname -r`
892 if test "$OS_ARCH" = "FreeBSD"; then
893 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
896 if test "$OS_ARCH" = "Linux"; then
897 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
898 OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
901 #######################################################################
902 # Master "Core Components" macros for getting the OS target #
903 #######################################################################
906 # Note: OS_TARGET should be specified on the command line for gmake.
907 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
908 # The difference between the Win95 target and the WinNT target is that
909 # the WinNT target uses Windows NT specific features not available
910 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
911 # at lesser performance (the Win95 target uses threads; the WinNT target
914 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
919 # The following hack allows one to build on a WIN95 machine (as if
920 # s/he were cross-compiling on a WINNT host for a WIN95 target).
921 # It also accomodates for MKS's uname.exe. If you never intend
922 # to do development on a WIN95 machine, you don't need this hack.
933 CYGWIN_9*|CYGWIN_ME*)
934 OS_ARCH='CYGWIN_NT-4.0'
944 # On WIN32, we also define the variable CPU_ARCH.
950 # If uname -s returns "Windows_NT", we assume that we are using
951 # the uname.exe in MKS toolkit.
953 # The -r option of MKS uname only returns the major version number.
954 # So we need to use its -v option to get the minor version number.
955 # Moreover, it doesn't have the -p option, so we need to use uname -m.
958 OS_MINOR_RELEASE=`uname -v`
959 if test "$OS_MINOR_RELEASE" = "00"; then
962 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
965 # MKS's uname -m returns "586" on a Pentium machine.
967 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
971 CYGWIN_NT*|MINGW*_NT*|MSYS_NT*)
973 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
974 # the uname.exe in the Cygwin tools.
975 # If uname -s returns "MINGW32_NT-5.1", we assume that we are using
976 # the uname.exe in the MSYS tools.
977 # If uname -s returns "MSYS_NT-6.3", we assume that we are using
978 # the uname.exe in the MSYS2 tools.
980 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
984 # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
986 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
992 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
994 if test -n "$MOZ_DEBUG" -a -z "$USE_DEBUG_RTL"; then
998 if test -z "$OS_TARGET"; then
1001 if test "$OS_TARGET" = "WIN95"; then
1004 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
1006 dnl ========================================================
1007 dnl Enable high-memory support on OS/2 by default.
1008 dnl ========================================================
1009 AC_ARG_ENABLE(os2-high-mem,
1010 [ --disable-os2-high-mem Disable high-memory support on OS/2],
1011 [ if test "$enableval" = "no"; then
1012 MOZ_OS2_HIGH_MEMORY=
1014 MOZ_OS2_HIGH_MEMORY=1
1017 dnl ========================================================
1018 dnl = ARM toolchain tweaks
1019 dnl ========================================================
1022 MOZ_ALIGN=toolchain-default
1025 arm*-android*|arm*-linuxandroid*)
1029 MOZ_FLOAT_ABI=softfp
1034 if test -n "$MOZ_PLATFORM_MAEMO"; then
1037 MOZ_FLOAT_ABI=softfp
1039 if test "$MOZ_PLATFORM_MAEMO" = 6; then
1045 dnl Kept for compatibility with some buildbot mozconfig
1046 AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval)
1049 [ --with-thumb[[=yes|no|toolchain-default]]]
1050 [ Use Thumb instruction set (-mthumb)],
1051 if test -z "$GNU_CC"; then
1052 AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults])
1056 AC_ARG_WITH(thumb-interwork,
1057 [ --with-thumb-interwork[[=yes|no|toolchain-default]]
1058 Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
1059 if test -z "$GNU_CC"; then
1060 AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults])
1062 MOZ_THUMB_INTERWORK=$withval)
1065 [ --with-arch=[[type|toolchain-default]]
1066 Use specific CPU features (-march=type)],
1067 if test -z "$GNU_CC"; then
1068 AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults])
1073 [ --with-fpu=[[type|toolchain-default]]
1074 Use specific FPU type (-mfpu=type)],
1075 if test -z "$GNU_CC"; then
1076 AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults])
1080 AC_ARG_WITH(float-abi,
1081 [ --with-float-abi=[[type|toolchain-default]]
1082 Use specific arm float ABI (-mfloat-abi=type)],
1083 if test -z "$GNU_CC"; then
1084 AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults])
1086 MOZ_FLOAT_ABI=$withval)
1088 AC_ARG_WITH(soft-float,
1089 [ --with-soft-float[[=yes|no|toolchain-default]]
1090 Use soft float library (-msoft-float)],
1091 if test -z "$GNU_CC"; then
1092 AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults])
1094 MOZ_SOFT_FLOAT=$withval)
1097 toolchain-default|"")
1101 arch_flag="-march=$MOZ_ARCH"
1105 case "$MOZ_THUMB" in
1108 thumb_flag="-mthumb"
1115 _SAVE_CFLAGS="$CFLAGS"
1117 AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
1120 CFLAGS="$_SAVE_CFLAGS"
1125 case "$MOZ_THUMB_INTERWORK" in
1127 thumb_interwork_flag="-mthumb-interwork"
1130 thumb_interwork_flag="-mno-thumb-interwork"
1132 *) # toolchain-default
1133 thumb_interwork_flag=""
1138 toolchain-default|"")
1142 fpu_flag="-mfpu=$MOZ_FPU"
1146 case "$MOZ_FLOAT_ABI" in
1147 toolchain-default|"")
1151 float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
1155 case "$MOZ_SOFT_FLOAT" in
1157 soft_float_flag="-msoft-float"
1160 soft_float_flag="-mno-soft-float"
1162 *) # toolchain-default
1167 case "$MOZ_ALIGN" in
1168 toolchain-default|"")
1172 align_flag="-mno-unaligned-access"
1175 align_flag="-munaligned-access"
1182 if test -n "$align_flag"; then
1183 _SAVE_CFLAGS="$CFLAGS"
1184 CFLAGS="$CFLAGS $align_flag"
1185 AC_MSG_CHECKING(whether alignment flag ($align_flag) is supported)
1186 AC_TRY_COMPILE([],[],,align_flag="")
1187 CFLAGS="$_SAVE_CFLAGS"
1190 dnl Use echo to avoid accumulating space characters
1191 all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag $align_flag`
1192 if test -n "$all_flags"; then
1193 _SAVE_CFLAGS="$CFLAGS"
1195 AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
1196 AC_TRY_COMPILE([],[return 0;],
1197 AC_MSG_RESULT([yes]),
1200 CFLAGS="$_SAVE_CFLAGS $all_flags"
1201 CXXFLAGS="$CXXFLAGS $all_flags"
1202 ASFLAGS="$ASFLAGS $all_flags"
1203 if test -n "$thumb_flag"; then
1204 LDFLAGS="$LDFLAGS $thumb_flag"
1208 dnl ========================================================
1209 dnl Override of system specific host options
1210 dnl ========================================================
1216 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
1217 if test `echo "${PATH}" | grep -c \;` = 0; then
1218 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
1222 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
1227 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1231 dnl ========================================================
1232 dnl Override of system specific target options
1233 dnl ========================================================
1240 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
1241 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
1242 case "${target_os}" in
1244 AC_DEFINE(AIX_RENAME_SELECT)
1245 AC_DEFINE(_PR_NO_LARGE_FILES)
1246 AIX_LINK_OPTS='-bnso -berok'
1247 PR_MD_ASFILES=os_AIX.s
1250 AC_DEFINE(AIX_TIMERS)
1251 AC_DEFINE(_PR_NO_LARGE_FILES)
1255 AIX_LINK_OPTS='-bnso -berok'
1256 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
1257 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
1260 AC_DEFINE(AIX_TIMERS)
1261 AC_DEFINE(_PR_HAVE_OFF64_T)
1262 AIX_LINK_OPTS='-brtl -bnso -berok'
1265 AC_DEFINE(AIX_TIMERS)
1266 AC_DEFINE(_PR_HAVE_OFF64_T)
1267 AC_DEFINE(AIX4_3_PLUS)
1268 AC_DEFINE(HAVE_SOCKLEN_T)
1269 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1271 AIX_LINK_OPTS='-brtl -bnso -berok'
1274 AC_DEFINE(AIX_TIMERS)
1275 AC_DEFINE(_PR_HAVE_OFF64_T)
1276 AC_DEFINE(AIX4_3_PLUS)
1277 AC_DEFINE(HAVE_SOCKLEN_T)
1278 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1280 AIX_LINK_OPTS='-brtl -bnso -berok'
1283 CFLAGS="$CFLAGS -qro -qroconst"
1284 AIX_WRAP='$(DIST)/lib/aixwrap.o'
1285 AIX_TMP='./_aix_tmp.o'
1286 if test -n "$USE_64"; then
1287 MDCPUCFG_H=_aix64.cfg
1290 MDCPUCFG_H=_aix32.cfg
1293 RESOLVE_LINK_SYMBOLS=1
1300 AC_DEFINE(_POSIX_SOURCE)
1302 MDCPUCFG_H=_beos.cfg
1305 RESOLVE_LINK_SYMBOLS=1
1306 case "${target_cpu}" in
1309 _DEBUG_FLAGS='-gdwarf-2 -O0'
1310 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1311 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1317 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'
1319 _DEBUG_FLAGS='-g -O0'
1327 AC_DEFINE(NEED_BSDREGEX)
1329 CFLAGS="$CFLAGS -Wall -Wno-format"
1330 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1332 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1334 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1338 MDCPUCFG_H=_bsdi.cfg
1343 case "$target_os" in
1345 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1346 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1347 AC_DEFINE(_PR_NEED_H_ERRNO)
1354 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1355 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1357 AC_DEFINE(USE_DLFCN)
1358 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1359 PR_MD_ASFILES=os_BSD_OS_386_2.s
1363 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1364 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1366 AC_DEFINE(USE_DLFCN)
1367 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1368 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1370 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1372 case "$target_os" in
1373 bsdi4.2* | bsdi4.3* | bsdi5.*)
1374 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1375 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1380 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1381 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1383 AC_DEFINE(USE_DLFCN)
1384 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1393 AC_DEFINE(HAVE_BSD_FLOCK)
1394 AC_DEFINE(HAVE_SOCKLEN_T)
1395 AS='$(CC) -x assembler-with-cpp'
1396 CFLAGS="$CFLAGS -Wall -fno-common"
1397 case "${target_cpu}" in
1402 if test -n "$USE_64"; then
1412 if test "`echo $CC | grep -c '\-arch '`" = "0"; then
1413 CC="$CC -arch $CPU_ARCH"
1415 AC_CHECK_HEADER(crt_externs.h)
1417 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1419 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1420 STRIP="$STRIP -x -S"
1423 MDCPUCFG_H=_darwin.cfg
1424 PR_MD_CSRCS=darwin.c
1425 PR_MD_ASFILES=os_Darwin.s
1427 # Add Mac OS X support for loading CFM & CFBundle plugins
1428 if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1429 AC_DEFINE(XP_MACOSX)
1432 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1433 dnl Use the specified value
1434 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1435 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1436 dnl No value specified on the command line or in the environment,
1437 dnl use the lesser of the library's minimum or the architecture's
1439 case "${target_cpu}" in
1441 dnl Architecture minimum 10.2
1442 export MACOSX_DEPLOYMENT_TARGET=10.2
1445 dnl Architecture minimum 10.4
1446 export MACOSX_DEPLOYMENT_TARGET=10.4
1451 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1452 dnl in use. NEXT_ROOT will be set and exported if it's needed for
1455 if test "$MACOS_SDK_DIR"; then
1456 dnl Sync this section with the one in Mozilla's top level.
1458 if test ! -d "$MACOS_SDK_DIR"; then
1459 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1460 specify a valid SDK. SDKs are installed when the optional cross-development
1461 tools are selected during the Xcode/Developer Tools installation.])
1465 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1466 GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1467 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1469 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1470 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1471 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1472 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1473 SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1476 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1478 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1480 dnl CPP needs to be set for AC_CHECK_HEADER.
1481 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1484 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1486 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1487 dnl The build host is running Tiger (10.4) or earlier.
1488 dnl ld support for -syslibroot is compiler-agnostic, but
1489 dnl only available on Tiger and later. On Tiger and
1490 dnl earlier build hosts, just rely on NEXT_ROOT, because
1491 dnl it's not been shown to cause any problems.
1492 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}"
1494 dnl The build host is running Leopard (10.5) or later.
1495 dnl With NEXT_ROOT set, the linker will still not apply
1496 dnl it when resolving dependencies. This causes problems
1497 dnl on Leopard, where an SDK depends on frameworks which
1498 dnl were present in earlier OS releases (and the associated
1499 dnl SDK) but not in Leopard. -syslibroot does not have
1500 dnl this problem, but it results in harmless warnings when
1501 dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1502 dnl on Leopard because the compiler uses it too.
1503 MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1506 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1507 export NEXT_ROOT=$MACOS_SDK_DIR
1509 if test -n "$CROSS_COMPILE" ; then
1510 dnl NEXT_ROOT will be in the environment, but it
1511 dnl shouldn't be set for the build host. HOST_CXX is
1512 dnl presently unused.
1513 HOST_CC="NEXT_ROOT= $HOST_CC"
1514 HOST_CXX="NEXT_ROOT= $HOST_CXX"
1517 dnl gcc >= 4.0 uses different paths than above, but knows
1518 dnl how to find them itself.
1519 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1521 dnl CPP needs to be set for AC_CHECK_HEADER.
1522 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1524 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1525 dnl has an ld that supports -syslibroot. Don't set
1526 dnl NEXT_ROOT because it will be ignored and cause
1527 dnl warnings when -syslibroot is specified.
1528 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1529 dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1530 dnl based on the -isysroot it receives.
1531 LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1533 dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1535 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1544 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1548 AC_DEFINE(_DGUX_SOURCE)
1549 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1553 MDCPUCFG_H=_dgux.cfg
1558 if test -z "$USE_NSPR_THREADS"; then
1563 AC_DEFINE(HAVE_BSD_FLOCK)
1564 AC_DEFINE(HAVE_SOCKLEN_T)
1565 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1566 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1567 if test "$MOZ_OBJFORMAT" = "elf"; then
1572 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1574 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1575 MDCPUCFG_H=_freebsd.cfg
1576 PR_MD_CSRCS=freebsd.c
1582 AC_DEFINE(_HPUX_SOURCE)
1583 # OSF1 and HPUX report the POLLHUP event for a socket when the
1584 # shutdown(SHUT_WR) operation is called for the remote end, even though
1585 # the socket is still writeable. Use select(), instead of poll(), to
1586 # workaround this problem.
1587 AC_DEFINE(_PR_POLL_WITH_SELECT)
1588 AC_DEFINE(_USE_BIG_FDS)
1589 DSO_LDOPTS='-b +h $(notdir $@)'
1591 if test "$OS_TEST" = "ia64"; then
1593 DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1594 CPU_ARCH_TAG=_$OS_TEST
1595 if test -z "$USE_64"; then
1598 PR_MD_ASFILES=os_HPUX_ia64.s
1602 PR_MD_ASFILES=os_HPUX.s
1604 if test -n "$USE_64"; then
1605 MDCPUCFG_H=_hpux64.cfg
1607 MDCPUCFG_H=_hpux32.cfg
1609 if test -z "$GNU_CC"; then
1615 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1618 if test -n "$MOZILLA_CLIENT"; then
1619 DEFAULT_IMPL_STRATEGY=_EMU
1622 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1623 AC_DEFINE(_PR_NEED_H_ERRNO)
1625 DEFAULT_IMPL_STRATEGY=_EMU
1629 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1630 AC_DEFINE(_PR_NO_LARGE_FILES)
1633 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1634 AC_DEFINE(_PR_NEED_H_ERRNO)
1637 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1638 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1641 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1642 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1645 # HP-UX 11i v2 (B.11.23) or higher
1647 case "$OS_RELEASE" in
1648 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1654 if test "$OS_RELEASE" = "B.10.01"; then
1656 DEFAULT_IMPL_STRATEGY=_EMU
1659 if test "$OS_RELEASE" = "B.10.10"; then
1661 AC_DEFINE(HPUX10_10)
1662 DEFAULT_IMPL_STRATEGY=_PTH
1665 if test "$OS_RELEASE" = "B.10.20"; then
1667 AC_DEFINE(HPUX10_20)
1668 if test -z "$GNU_CC"; then
1669 CFLAGS="$CFLAGS +DAportable +DS1.1"
1670 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1672 DEFAULT_IMPL_STRATEGY=_PTH
1675 if test "$OS_RELEASE" = "B.10.30"; then
1677 AC_DEFINE(HPUX10_30)
1678 if test -z "$GNU_CC"; then
1679 CFLAGS="$CFLAGS +DAportable +DS1.1"
1680 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1682 DEFAULT_IMPL_STRATEGY=_PTH
1685 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1688 AC_DEFINE(_LARGEFILE64_SOURCE)
1689 AC_DEFINE(_PR_HAVE_OFF64_T)
1690 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1691 if test -z "$GNU_CC"; then
1692 if test -z "$USE_64"; then
1693 if test "$OS_TEST" = "ia64"; then
1694 CFLAGS="$CFLAGS +DD32"
1695 CXXFLAGS="$CXXFLAGS +DD32"
1697 CFLAGS="$CFLAGS +DAportable +DS2.0"
1698 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1701 if test "$OS_TEST" = "ia64"; then
1702 CFLAGS="$CFLAGS +DD64"
1703 CXXFLAGS="$CXXFLAGS +DD64"
1705 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1706 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1710 DEFAULT_IMPL_STRATEGY=_PTH
1713 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1717 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1719 if test "$USE_NSPR_THREADS"; then
1722 if test "$USE_USER_PTHREADS"; then
1732 AC_DEFINE(_SGI_MP_SOURCE)
1733 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1735 PR_MD_ASFILES=os_Irix.s
1736 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1738 RESOLVE_LINK_SYMBOLS=1
1739 if test -n "$USE_64"; then
1740 MDCPUCFG_H=_irix64.cfg
1742 MDCPUCFG_H=_irix32.cfg
1744 case "${target_os}" in
1761 if test "$GNU_CC"; then
1763 dnl If we are using gcc with native binutils, we need to
1765 dnl #lineno "filename" num num
1766 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1767 dnl gcc command line, which passes -P to the preprocessor.
1769 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1770 CFLAGS="$CFLAGS -Wall -Wno-format"
1771 _OPTIMIZE_FLAGS="-O6"
1773 if test -n "$USE_N32"; then
1774 AS='as -D_ASM $(INCLUDES) -n32'
1776 AS='as -D_ASM $(INCLUDES)'
1778 CFLAGS="$CFLAGS -fullwarn -xansi"
1779 if test "$USE_N32"; then
1780 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1782 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1784 if test "$USE_MDUPDATE"; then
1785 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1789 CFLAGS="$CFLAGS -multigot"
1790 DSO_LDOPTS="-no_unresolved"
1791 if test "$USE_N32"; then
1792 CFLAGS="$CFLAGS -n32 -woff 1209"
1793 DSO_LDOPTS="$DSO_LDOPTS -n32"
1795 if test "$USE_64"; then
1796 CFLAGS="$CFLAGS -64"
1798 CFLAGS="$CFLAGS -32"
1803 CFLAGS="$CFLAGS -xgot"
1807 if test "${target_os}" = "irix5.3"; then
1810 case "${target_os}" in
1812 if test -z "$GNU_CC"; then
1813 CFLAGS="$CFLAGS -mips3"
1815 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1816 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1817 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1822 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1827 *-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
1828 if test -z "$USE_NSPR_THREADS"; then
1833 AC_DEFINE(_GNU_SOURCE)
1834 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1836 *-android*|*-linuxandroid*)
1844 CFLAGS="$CFLAGS -Wall"
1845 CXXFLAGS="$CXXFLAGS -Wall"
1846 MDCPUCFG_H=_linux.cfg
1848 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1850 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1852 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1853 # combo is not yet good at debugging inlined
1854 # functions (even when using DWARF2 as the
1857 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1862 CPU_ARCH_TAG=_${CPU_ARCH}
1863 case "${target_cpu}" in
1867 CFLAGS="$CFLAGS -mieee"
1868 CXXFLAGS="$CXXFLAGS -mieee"
1872 PR_MD_ASFILES=os_Linux_x86.s
1875 PR_MD_ASFILES=os_Linux_ia64.s
1878 if test -n "$USE_64"; then
1879 PR_MD_ASFILES=os_Linux_x86_64.s
1880 elif test -n "$USE_X32"; then
1881 PR_MD_ASFILES=os_Linux_x86_64.s
1886 PR_MD_ASFILES=os_Linux_x86.s
1892 PR_MD_ASFILES=os_Linux_ppc.s
1895 if test -n "$USE_64"; then
1899 PR_MD_ASFILES=os_Linux_ppc.s
1903 CFLAGS="$CFLAGS -m68020-60"
1904 CXXFLAGS="$CXXFLAGS -m68020-60"
1909 *-mingw*|*-msys*|*-cygwin*|*-mks*)
1912 PR_MD_ARCH_DIR=windows
1913 RESOLVE_LINK_SYMBOLS=1
1915 if test -n "$GNU_CC"; then
1917 CXX="$CXX -mwindows"
1919 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1921 # Use temp file for windres (bug 213281)
1922 RCFLAGS='-O coff --use-temp-file'
1925 AR='lib -NOLOGO -OUT:"$@"'
1927 RANLIB='echo not_ranlib'
1928 STRIP='echo not_strip'
1930 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1935 # Determine compiler version
1937 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1939 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1940 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1941 _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1942 _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1943 _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1944 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1946 if test "$_CC_MAJOR_VERSION" -eq "14"; then
1947 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1948 dnl so be very specific here!
1949 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1950 if test $_CC_RELEASE -gt 50727; then
1952 elif test $_CC_BUILD -ge 762; then
1955 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
1956 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
1957 elif test $_CC_MAJOR_VERSION -ge 15; then
1959 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
1960 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
1963 if test -n "$_USE_DYNAMICBASE"; then
1964 DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1967 # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1968 # tape manipulation utility (or something else)
1969 if test "$MSC_VER" -ge "1400"; then
1971 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1974 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1975 if test -n "$MSMT_TOOL"; then
1976 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1977 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1978 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1983 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1987 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1988 DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1992 PROFILE_GEN_CFLAGS="-GL"
1993 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1994 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1995 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1997 if test "$MSC_VER" -ge "1800"; then
1998 dnl Visual C++ 2013 requires -FS when parallel building with
1999 dnl make -jN. If not specified, compiler sometimes emits C1041
2001 CFLAGS="$CFLAGS -FS"
2002 dnl -Gw can benefit when using linker optimization on PGO.
2003 dnl http://blogs.msdn.com/b/vcblog/archive/2013/09/11/introducing-gw-compiler-switch.aspx
2004 PROFILE_GEN_CFLAGS="$PROFILE_GEN_CFLAGS -Gw"
2005 PROFILE_USE_CFLAGS="$PROFILE_USE_CFLAGS -Gw"
2008 if test -z "$MOZ_OPTIMIZE"; then
2009 CFLAGS="$CFLAGS -Od"
2012 if test "$USE_DEBUG_RTL" = 1; then
2013 if test -n "$USE_STATIC_RTL"; then
2014 CFLAGS="$CFLAGS -MTd"
2016 CFLAGS="$CFLAGS -MDd"
2019 if test -n "$USE_STATIC_RTL"; then
2020 CFLAGS="$CFLAGS -MT"
2022 CFLAGS="$CFLAGS -MD"
2026 if test -n "$MOZ_DEBUG"; then
2029 DEFINES="$DEFINES -U_DEBUG"
2032 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2033 if test -n "$MOZ_OPTIMIZE"; then
2034 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
2035 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
2037 DLLFLAGS="$DLLFLAGS -DEBUG"
2038 LDFLAGS="$LDFLAGS -DEBUG"
2042 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
2043 if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
2044 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
2047 if test "$OS_TARGET" = "WINNT"; then
2048 CFLAGS="$CFLAGS -GT"
2049 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2050 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2052 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2053 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2057 if test -n "$USE_STATIC_TLS"; then
2058 AC_DEFINE(_PR_USE_STATIC_TLS)
2061 if test "$OS_TARGET" = "WINNT"; then
2065 # undefine WINNT as some versions of mingw gcc define it by default
2066 DEFINES="$DEFINES -UWINNT"
2067 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2070 if test "$CPU_ARCH" = "x86"; then
2073 CPU_ARCH_TAG=$CPU_ARCH
2076 if test "$USE_DEBUG_RTL" = 1; then
2080 case "$OS_TARGET" in
2082 MDCPUCFG_H=_winnt.cfg
2085 MDCPUCFG_H=_win95.cfg
2088 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
2092 case "$target_cpu" in
2094 if test -n "$USE_64"; then
2098 if test -z "$GNU_CC" -a "$MSC_VER" -ge "1700"; then
2099 dnl Visual C++ 2012 defaults to -arch:SSE2. Use -arch:IA32
2100 dnl to avoid requiring SSE2.
2101 CFLAGS="$CFLAGS -arch:IA32"
2114 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2122 AC_DEFINE(HAVE_BSD_FLOCK)
2123 if test -z "$USE_NSPR_THREADS"; then
2126 MDCPUCFG_H=_netbsd.cfg
2127 PR_MD_CSRCS=netbsd.c
2129 DSO_CFLAGS='-fPIC -DPIC'
2130 CFLAGS="$CFLAGS -ansi -Wall"
2131 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2132 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
2134 if test -z "$OBJECT_FMT"; then
2135 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
2138 DSO_LDOPTS='-shared'
2142 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
2146 if test "$LIBRUNPATH"; then
2147 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
2154 AC_DEFINE(_QNX_SOURCE)
2155 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2158 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
2161 OS_LIBS="$OS_LIBS -lsocket"
2162 _OPTIMIZE_FLAGS="-O1"
2163 _DEBUG_FLAGS="-gstabs"
2169 AC_DEFINE(HAVE_BSD_FLOCK)
2170 AC_DEFINE(HAVE_SOCKLEN_T)
2171 CFLAGS="$CFLAGS -ansi -Wall"
2172 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2175 MDCPUCFG_H=_openbsd.cfg
2176 PR_MD_CSRCS=openbsd.c
2178 if test -z "$USE_NSPR_THREADS"; then
2181 DSO_LDOPTS='-shared -fPIC'
2182 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2186 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2189 AC_DEFINE(_REENTRANT)
2190 # OSF1 and HPUX report the POLLHUP event for a socket when the
2191 # shutdown(SHUT_WR) operation is called for the remote end, even though
2192 # the socket is still writeable. Use select(), instead of poll(), to
2193 # workaround this problem.
2194 AC_DEFINE(_PR_POLL_WITH_SELECT)
2196 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2200 if test -z "$GNU_CC"; then
2201 CC="$CC -std1 -ieee_with_inexact"
2202 if test "$OS_RELEASE" != "V2.0"; then
2203 CC="$CC -readonly_strings"
2205 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2206 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2208 CFLAGS="$CFLAGS -mieee"
2209 CXXFLAGS="$CXXFLAGS -mieee"
2212 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2213 AC_DEFINE(HAVE_INT_LOCALTIME_R)
2215 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2216 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2218 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2219 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2221 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2222 MDCPUCFG_H=_osf1.cfg
2229 AC_DEFINE(_PR_NEED_H_ERRNO)
2238 AC_DEFINE(_PR_NEED_H_ERRNO)
2240 MDCPUCFG_H=_riscos.cfg
2241 PR_MD_CSRCS=riscos.c
2243 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2244 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2253 AC_DEFINE(_PR_NEED_H_ERRNO)
2254 CC='cc -b elf -KPIC'
2255 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2258 DSO_LDOPTS='-b elf -G'
2259 MDCPUCFG_H=_scoos.cfg
2264 if test -z "$USE_NSPR_THREADS"; then
2273 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2275 MDCPUCFG_H=_solaris.cfg
2276 PR_MD_CSRCS=solaris.c
2278 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2279 RESOLVE_LINK_SYMBOLS=1
2280 case "${OS_RELEASE}" in
2284 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2288 if test -n "$GNU_CC"; then
2290 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2293 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2294 if test -n "$USE_B_DIRECT"; then
2295 DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2299 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2300 if test -n "$USE_B_DIRECT"; then
2301 DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2304 if test -n "$GNU_CC"; then
2305 CFLAGS="$CFLAGS -Wall"
2306 CXXFLAGS="$CXXFLAGS -Wall"
2307 if test -n "$USE_MDUPDATE"; then
2308 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2309 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2311 GCC_AS=`$CC -print-prog-name=as`
2312 if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2316 CFLAGS="$CFLAGS -xstrconst"
2317 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2318 if test -z "$MOZ_OPTIMIZE"; then
2319 CFLAGS="$CFLAGS -xs"
2320 CXXFLAGS="$CXXFLAGS -xs"
2322 _OPTIMIZE_FLAGS=-xO4
2324 if test -z "$GNU_AS"; then
2325 ASFLAGS="$ASFLAGS -Wa,-P"
2327 if test -n "$USE_64"; then
2328 if test -n "$GNU_CC"; then
2332 if test "$OS_TEST" = "i86pc"; then
2333 CC="$CC -xarch=amd64"
2334 CXX="$CXX -xarch=amd64"
2337 CXX="$CXX -xarch=v9"
2341 if test "$OS_TEST" = "i86pc"; then
2342 if test -z "$USE_64"; then
2345 CPU_ARCH_TAG=_$OS_TEST
2346 # The default debug format, DWARF (-g), is not supported by gcc
2347 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
2348 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2349 # If your gcc uses GNU as, you do not need the -Wa,-s option.
2350 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2351 _DEBUG_FLAGS=-gstabs
2352 if test -z "$GNU_AS"; then
2353 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2357 case "${target_os}" in
2359 AC_DEFINE(_PR_NO_LARGE_FILES)
2362 AC_DEFINE(_PR_NO_LARGE_FILES)
2365 AC_DEFINE(SOLARIS2_5)
2368 AC_DEFINE(_PR_HAVE_OFF64_T)
2369 # The lfcompile64(5) man page on Solaris 2.6 says:
2370 # For applications that do not wish to conform to the POSIX or
2371 # X/Open specifications, the 64-bit transitional interfaces
2372 # are available by default. No compile-time flags need to be
2374 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2375 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2376 if test -n "$GNU_CC"; then
2377 AC_DEFINE(_LARGEFILE64_SOURCE)
2381 case "${target_os}" in
2393 # Solaris 8 or higher has IPv6.
2394 AC_DEFINE(_PR_INET6)
2397 if test "$CPU_ARCH" = "sparc"; then
2398 # 64-bit Solaris SPARC requires V9 architecture, so the following
2400 if test -z "$USE_64"; then
2401 ULTRASPARC_LIBRARY=nspr_flt
2404 # Purify requires that binaries linked against nspr also
2405 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2407 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2408 OS_LIBS="$OS_LIBS $_librt"
2417 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2418 AC_DEFINE(_PR_NO_LARGE_FILES)
2419 CC='$(NSDEPTH)/build/hcc cc'
2420 CXX='$(NSDEPTH)/build/hcpp CC'
2421 MDCPUCFG_H=_unixware.cfg
2423 AC_DEFINE(_LARGEFILE64_SOURCE)
2424 AC_DEFINE(_PR_HAVE_OFF64_T)
2425 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2426 MDCPUCFG_H=_unixware7.cfg
2428 PR_MD_CSRCS=unixware.c
2434 AC_ARG_WITH(symbian-sdk,
2435 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
2436 The path to the Symbian SDK],
2437 SYMBIAN_SDK_DIR=$withval)
2439 echo -----------------------------------------------------------------------------
2440 echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2441 echo -----------------------------------------------------------------------------
2446 AC_DEFINE(__SYMBIAN32__)
2449 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2450 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2451 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2452 AC_DEFINE(HAVE_SOCKLEN_T)
2460 MDCPUCFG_H=_symbian.cfg
2461 PR_MD_CSRCS=symbian.c
2463 RANLIB='echo no ranlib '
2466 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2467 CFLAGS="$CFLAGS -MD -nostdinc"
2468 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2469 echo -------------------------------------------------------
2470 echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2471 echo -------------------------------------------------------
2472 case "$OS_TARGET" in
2478 WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2479 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)"
2480 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2481 AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2485 AC_DEFINE(__WINSCW__)
2486 DEFINES="$DEFINES -U_WIN32"
2489 CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2490 CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2491 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2494 DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2497 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2500 CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2506 AC_DEFINE(BSD_SELECT)
2507 AC_DEFINE(TCPV40HDRS)
2515 RESOLVE_LINK_SYMBOLS=1
2520 CFLAGS="$CFLAGS -Wall -Zomf"
2521 CXXFLAGS="$CFLAGS -Wall -Zomf"
2522 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2524 DSO_LDOPTS='-Zomf -Zdll'
2526 _OPTIMIZE_FLAGS="-O2 -s"
2527 _DEBUG_FLAGS="-g -fno-inline"
2528 if test -n "$MOZ_OPTIMIZE"; then
2529 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2533 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2534 LDFLAGS="$LDFLAGS -Zhigh-mem"
2535 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2538 # GCC for OS/2 currently predefines these, but we don't want them
2539 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2548 if test -z "$SKIP_LIBRARY_CHECKS"; then
2549 dnl ========================================================
2550 dnl Check for system libraries
2551 dnl ========================================================
2554 dnl We don't want anything to link with libdl even if it's present on OS X,
2555 dnl since it's not used and not part of the default installation.
2556 dnl The same goes for BeOS.
2557 dnl OS/2 has dlfcn in libc.
2560 *-darwin*|*-beos*|*-os2*)
2563 AC_CHECK_LIB(dl, dlopen,
2564 [AC_CHECK_HEADER(dlfcn.h,
2565 OS_LIBS="-ldl $OS_LIBS")])
2570 dnl ========================================================
2571 dnl Check for system header files.
2572 dnl ========================================================
2574 dnl ========================================================
2575 dnl Check for typedefs and structs
2576 dnl ========================================================
2578 dnl ========================================================
2579 dnl Checks for library functions.
2580 dnl ========================================================
2581 AC_PROG_GCC_TRADITIONAL
2583 LIBS="$LIBS $OS_LIBS"
2584 AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
2587 dnl ========================================================
2589 dnl ========================================================
2591 dnl ======================================================
2592 dnl = Enable compiling with ccache
2593 dnl ======================================================
2595 [ --with-ccache[=path/to/ccache]
2596 Enable compiling with ccache],
2597 CCACHE=$withval, CCACHE="no")
2599 if test "$CCACHE" != "no"; then
2600 if test -n "$CCACHE"; then
2601 if test "$CCACHE" = "yes"; then
2604 if test ! -e "$CCACHE"; then
2605 AC_MSG_ERROR([$CCACHE not found])
2609 AC_PATH_PROGS(CCACHE, $CCACHE ccache)
2610 if test -z "$CCACHE" -o "$CCACHE" = ":"; then
2611 AC_MSG_ERROR([ccache not found])
2612 elif test -x "$CCACHE"; then
2616 AC_MSG_ERROR([$CCACHE is not executable])
2620 dnl ========================================================
2622 dnl = --enable-strip
2624 dnl = Enable stripping of libs and executables
2626 dnl ========================================================
2627 AC_ARG_ENABLE(strip,
2628 [ --enable-strip Enable stripping of shared libs and programs],
2629 [ if test "$enableval" = "yes"; then
2633 dnl Check for hpux options
2634 case "${target_os}" in
2636 if test -z "$GNU_CC"; then
2638 AC_CACHE_CHECK(for +Olit support,
2639 ac_cv_hpux_usable_olit_option,
2640 dnl since aCC doesn't throw an error on invalid options,
2641 dnl we have to test this the hard way
2642 [ac_cv_hpux_usable_olit_option=no
2644 echo 'int main() { return 0; }' | cat > conftest.c
2645 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2646 if test $? -eq 0; then
2647 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2648 ac_cv_hpux_usable_olit_option=yes
2654 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2655 CFLAGS="$CFLAGS +Olit=all"
2656 CXXFLAGS="$CXXFLAGS +Olit=all"
2658 CFLAGS="$CFLAGS +ESlit"
2659 CXXFLAGS="$CXXFLAGS +ESlit"
2665 case "$target_os" in
2670 AC_CHECK_LIB(pthreads, pthread_create,
2671 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2672 AC_CHECK_LIB(pthread, pthread_create,
2673 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2674 AC_CHECK_LIB(c_r, pthread_create,
2675 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2676 AC_CHECK_LIB(c, pthread_create,
2685 AC_ARG_WITH(pthreads,
2686 [ --with-pthreads Use system pthreads library as thread subsystem],
2687 [ if test "$withval" = "yes"; then
2688 if test -n "$_HAVE_PTHREADS"; then
2693 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2699 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2705 AC_ARG_ENABLE(user-pthreads,
2706 [ --enable-user-pthreads Build using userland pthreads],
2707 [ if test "$enableval" = "yes"; then
2708 if test -n "$_HAVE_PTHREADS"; then
2713 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2717 AC_ARG_ENABLE(nspr-threads,
2718 [ --enable-nspr-threads Build using classic nspr threads],
2719 [ if test "$enableval" = "yes"; then
2727 AC_ARG_WITH(bthreads,
2728 [ --with-bthreads Use system bthreads library as thread subsystem
2730 [ if test "$withval" = "yes"; then
2738 fi # SKIP_LIBRARY_CHECKS
2741 [ --enable-ipv6 Compile ipv6 support],
2742 [ if test "$enableval" = "yes"; then
2748 if test -n "$USE_PTHREADS"; then
2749 dnl See if -pthread is supported.
2751 ac_cv_have_dash_pthread=no
2752 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2753 echo 'int main() { return 0; }' | cat > conftest.c
2754 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2755 if test $? -eq 0; then
2756 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2757 ac_cv_have_dash_pthread=yes
2758 case "$target_os" in
2760 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2763 CFLAGS="$CFLAGS -pthread"
2764 CXXFLAGS="$CXXFLAGS -pthread"
2770 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2773 dnl See if -pthreads is supported.
2775 ac_cv_have_dash_pthreads=no
2776 if test "$ac_cv_have_dash_pthread" = "no"; then
2777 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2778 echo 'int main() { return 0; }' | cat > conftest.c
2779 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2780 if test $? -eq 0; then
2781 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2782 ac_cv_have_dash_pthreads=yes
2783 CFLAGS="$CFLAGS -pthreads"
2784 CXXFLAGS="$CXXFLAGS -pthreads"
2788 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2793 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2798 AC_DEFINE(_REENTRANT)
2799 AC_DEFINE(_THREAD_SAFE)
2800 dnl -pthread links in -lc_r, so don't specify it explicitly.
2801 if test "$ac_cv_have_dash_pthread" = "yes"; then
2802 _PTHREAD_LDFLAGS="-pthread"
2804 _PTHREAD_LDFLAGS="-lc_r"
2808 if test "$ac_cv_have_dash_pthread" = "yes"; then
2809 _PTHREAD_LDFLAGS="-pthread"
2813 AC_DEFINE(_THREAD_SAFE)
2814 dnl -pthread links in -lc_r, so don't specify it explicitly.
2815 if test "$ac_cv_have_dash_pthread" = "yes"; then
2820 if test "$ac_cv_have_dash_pthread" = "yes"; then
2821 _PTHREAD_LDFLAGS=-pthread
2824 *-linux*|*-gnu*|*-k*bsd*-gnu)
2825 AC_DEFINE(_REENTRANT)
2830 if test -n "$USE_USER_PTHREADS"; then
2837 dnl Special thread exceptions
2841 if test -n "$USE_NSPR_THREADS"; then
2842 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2844 case "$target_os" in
2846 if test -z "$USE_PTHREADS"; then
2847 AC_DEFINE(AIX_RENAME_SELECT)
2851 if test -z "$USE_NSPR_THREADS"; then
2852 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2856 if test -z "$USE_NSPR_THREADS"; then
2857 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2859 if test -n "$USE_PTHREADS"; then
2860 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2864 if test -z "$USE_NSPR_THREADS"; then
2865 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2867 if test -n "$USE_PTHREADS"; then
2868 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2874 if test -n "$USE_PTHREADS"; then
2875 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2879 if test -n "$USE_NSPR_THREADS"; then
2880 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2884 if test -n "$USE_NSPR_THREADS"; then
2885 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2887 if test "$USE_PTHREADS"; then
2888 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2889 AC_DEFINE(_REENTRANT)
2890 AC_DEFINE(_PR_DCETHREADS)
2892 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2893 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2896 if test "$USE_USER_PTHREADS"; then
2897 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2901 if test "${target_os}" = "irix6.5"; then
2902 if test -n "$USE_PTHREADS"; then
2903 AC_DEFINE(_PR_HAVE_GETHOST_R)
2904 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2908 *-linux*|*-gnu*|*-k*bsd*-gnu)
2909 if test -n "$USE_NSPR_THREADS"; then
2910 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2913 *-mingw*|*-msys*|*-cygwin*|*-mks*|*-os2*|*-beos*)
2914 dnl win32, os2 & beos cannot use pthreads
2919 *-netbsd*|*-openbsd*)
2920 if test -n "$USE_NSPR_THREADS"; then
2921 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2925 if test -n "$USE_NSPR_THREADS"; then
2926 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2928 if test -n "$USE_PTHREADS"; then
2929 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2932 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2937 if test -n "$USE_NSPR_THREADS"; then
2938 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2940 if test -n "$USE_PTHREADS"; then
2941 AC_DEFINE(_REENTRANT)
2942 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2943 if test "$OS_TEST" = "i86pc"; then
2944 if test -n "$USE_64"; then
2945 PR_MD_ASFILES=os_SunOS_x86_64.s
2947 PR_MD_ASFILES=os_SunOS_x86.s
2950 if test -n "$USE_64"; then
2951 PR_MD_ASFILES=os_SunOS_sparcv9.s
2957 if test -n "$USE_PTHREADS"; then
2958 AC_DEFINE(_PR_HAVE_GETHOST_R)
2959 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2964 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
2966 dnl If the user passed in arg to --enable-optimize or --enable-debug,
2967 dnl make sure that we use it.
2968 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
2969 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
2972 if test -n "$_SAVE_DEBUG_FLAGS"; then
2973 _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
2976 if test -n "$MOZ_OPTIMIZE"; then
2977 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
2978 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
2981 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2982 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
2983 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
2986 if test -n "$MOZ_OPTIMIZE"; then
2992 if test -n "$USE_64"; then
2996 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
2998 dnl ========================================================
2999 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
3000 dnl ========================================================
3001 case "$target_os" in
3003 CC="\$(CYGWIN_WRAPPER) $CC"
3004 CXX="\$(CYGWIN_WRAPPER) $CXX"
3005 RC="\$(CYGWIN_WRAPPER) $RC"
3009 dnl ========================================================
3010 dnl = Use malloc wrapper lib
3011 dnl ========================================================
3012 AC_ARG_ENABLE(wrap-malloc,
3013 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
3014 [ if test "$enableval" = "yes"; then
3018 if test -n "$_WRAP_MALLOC"; then
3019 if test -n "$GNU_CC"; then
3020 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
3021 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
3022 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
3023 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
3025 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
3029 dnl ========================================================
3030 dnl = Location of malloc wrapper lib
3031 dnl ========================================================
3032 AC_ARG_WITH(wrap-malloc,
3033 [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
3034 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
3036 dnl ========================================================
3037 dnl Substitution of found variables.
3038 dnl ========================================================
3039 AC_SUBST(SHELL_OVERRIDE)
3041 AC_SUBST(MOZILLA_CLIENT)
3048 AC_SUBST(HOST_CFLAGS)
3050 AC_SUBST(HOST_LDFLAGS)
3052 AC_SUBST(GCC_USE_GNU_LD)
3054 AC_SUBST(CROSS_COMPILE)
3056 AC_SUBST(MOZ_OPTIMIZE)
3058 AC_SUBST(MOZ_DEBUG_SYMBOLS)
3065 AC_SUBST(OBJECT_MODE)
3066 AC_SUBST(ENABLE_STRIP)
3068 AC_SUBST(USE_PTHREADS)
3069 AC_SUBST(USE_BTHREADS)
3070 AC_SUBST(USE_USER_PTHREADS)
3071 AC_SUBST(USE_NSPR_THREADS)
3076 AC_SUBST(MOD_MAJOR_VERSION)
3077 AC_SUBST(MOD_MINOR_VERSION)
3078 AC_SUBST(MOD_PATCH_VERSION)
3079 AC_SUBST(NSPR_MODNAME)
3080 AC_SUBST(MDCPUCFG_H)
3081 AC_SUBST(PR_MD_CSRCS)
3082 AC_SUBST(PR_MD_ASFILES)
3083 AC_SUBST(PR_MD_ARCH_DIR)
3086 AC_SUBST(OBJ_SUFFIX)
3087 AC_SUBST(LIB_SUFFIX)
3088 AC_SUBST(DLL_SUFFIX)
3089 AC_SUBST(ASM_SUFFIX)
3090 AC_SUBST(WRAP_LDFLAGS)
3092 AC_SUBST(DSO_CFLAGS)
3093 AC_SUBST(DSO_LDOPTS)
3097 AC_SUBST(OS_RELEASE)
3099 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3114 AC_SUBST(PROFILE_GEN_CFLAGS)
3115 AC_SUBST(PROFILE_GEN_LDFLAGS)
3116 AC_SUBST(PROFILE_USE_CFLAGS)
3117 AC_SUBST(PROFILE_USE_LDFLAGS)
3120 AC_SUBST(RESOLVE_LINK_SYMBOLS)
3121 AC_SUBST(AIX_LINK_OPTS)
3122 AC_SUBST(NOSUCHFILE)
3123 AC_SUBST(MOZ_OBJFORMAT)
3124 AC_SUBST(ULTRASPARC_LIBRARY)
3127 AC_SUBST(OBJDIR_NAME)
3128 AC_SUBST(RELEASE_OBJDIR_NAME)
3135 AC_SUBST(OS_DLLFLAGS)
3136 AC_SUBST(CYGWIN_WRAPPER)
3137 AC_SUBST(VISIBILITY_FLAGS)
3138 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3139 AC_SUBST(MACOS_SDK_DIR)
3140 AC_SUBST(SYMBIAN_SDK_DIR)
3144 dnl ========================================================
3145 dnl Generate output files.
3146 dnl ========================================================
3158 lib/libc/include/Makefile
3159 lib/libc/src/Makefile
3164 pr/include/md/Makefile
3165 pr/include/obsolete/Makefile
3166 pr/include/private/Makefile
3169 pr/src/linking/Makefile
3170 pr/src/malloc/Makefile
3172 pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3173 pr/src/memory/Makefile
3174 pr/src/misc/Makefile
3175 pr/src/threads/Makefile
3177 pr/tests/dll/Makefile
3180 if test "$OS_TARGET" = "Linux"; then
3181 MAKEFILES="$MAKEFILES
3184 elif test "$OS_TARGET" = "SunOS"; then
3185 MAKEFILES="$MAKEFILES
3186 pkg/solaris/Makefile
3187 pkg/solaris/SUNWpr/Makefile
3188 pkg/solaris/SUNWprd/Makefile
3192 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3193 MAKEFILES="$MAKEFILES
3194 pr/src/threads/combined/Makefile
3196 elif test -n "$USE_PTHREADS"; then
3197 MAKEFILES="$MAKEFILES
3198 pr/src/pthreads/Makefile
3200 elif test -n "$USE_BTHREADS"; then
3201 MAKEFILES="$MAKEFILES
3202 pr/src/bthreads/Makefile
3206 if test -n "$USE_CPLUS"; then
3207 MAKEFILES="$MAKEFILES
3208 pr/src/cplus/Makefile
3209 pr/src/cplus/tests/Makefile
3213 echo $MAKEFILES > unallmakefiles
3215 AC_CONFIG_FILES([$MAKEFILES])
3216 AC_CONFIG_COMMANDS([default], [chmod +x config/nspr-config])