1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
3 dnl This Source Code Form is subject to the terms of the Mozilla Public
4 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
5 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 AC_INIT(config/libc_r.h)
10 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
13 dnl ========================================================
15 dnl ========================================================
29 _MACOSX_DEPLOYMENT_TARGET=
34 OBJDIR='$(OBJDIR_NAME)'
37 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
38 NOSUCHFILE=/no-such-file
39 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
40 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
51 dnl Link in libraries necessary to resolve all symbols for shared libs
54 dnl ========================================================
56 dnl = Dont change the following lines. Doing so breaks:
58 dnl = CFLAGS="-foo" ./configure
60 dnl ========================================================
62 CXXFLAGS="${CXXFLAGS=}"
64 DLLFLAGS="${DLLFLAGS=}"
65 HOST_CFLAGS="${HOST_CFLAGS=}"
66 HOST_LDFLAGS="${HOST_LDFLAGS=}"
70 # Check to see if we are really running in a msvc environemnt
72 AC_CHECK_PROGS(CC, cl)
73 if test "$CC" = "cl"; then
74 echo 'main() { return 0; }' > dummy.c
75 ${CC} -o dummy dummy.c >/dev/null 2>&1
80 AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
82 rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
93 if test -n "$_WIN32_MSVC"; then
95 SKIP_COMPILER_CHECKS=1
99 dnl ========================================================
100 dnl = Android uses a very custom (hacky) toolchain; we need to do this
101 dnl = here, so that the compiler checks can succeed
102 dnl ========================================================
104 AC_ARG_WITH(android-ndk,
105 [ --with-android-ndk=DIR
106 location where the Android NDK can be found],
107 android_ndk=$withval)
109 AC_ARG_WITH(android-toolchain,
110 [ --with-android-toolchain=DIR
111 location of the Android toolchain],
112 android_toolchain=$withval)
114 dnl The default android_version is different for each target cpu.
115 case "$target_cpu" in
124 AC_ARG_WITH(android-version,
125 [ --with-android-version=VER
126 Android platform version, default 5 for arm, 9 for x86/mips],
127 android_version=$withval)
129 AC_ARG_WITH(android-platform,
130 [ --with-android-platform=DIR
131 location of platform dir],
132 android_platform=$withval)
135 arm-linux*-android*|*-linuxandroid*)
136 android_tool_prefix="arm-linux-androideabi"
139 android_tool_prefix="i686-linux-android"
142 android_tool_prefix="mipsel-linux-android"
145 android_tool_prefix="$target_os"
149 dnl ========================================================
150 dnl = Gonk is a fork of Android used for Mozilla's B2G project.
151 dnl = Configuration is done largely by the top level config
152 dnl = and the specified gonk directory doesn't matter here.
153 dnl ========================================================
156 [ --with-gonk=DIR location of gonk dir],
159 if test -n "$gonkdir" ; then
160 dnl Most things are directly configured by env vars when building for gonk
162 dnl prevent cross compile section from using these flags as host flags
163 if test -z "$HOST_CPPFLAGS" ; then
166 if test -z "$HOST_CFLAGS" ; then
169 if test -z "$HOST_CXXFLAGS" ; then
172 if test -z "$HOST_LDFLAGS" ; then
179 *-android*|*-linuxandroid*)
180 if test -z "$android_ndk" ; then
181 AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
184 if test -z "$android_toolchain" ; then
185 AC_MSG_CHECKING([for android toolchain directory])
187 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
189 case "$target_cpu" in
191 target_name=arm-linux-androideabi-4.4.3
194 target_name=x86-4.4.3
197 target_name=mipsel-linux-android-4.4.3
200 android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
202 if test -d "$android_toolchain" ; then
203 AC_MSG_RESULT([$android_toolchain])
205 AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
209 if test -z "$android_platform" ; then
210 AC_MSG_CHECKING([for android platform directory])
212 case "$target_cpu" in
224 android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name"
226 if test -d "$android_platform" ; then
227 AC_MSG_RESULT([$android_platform])
229 AC_MSG_ERROR([not found. You have to specify --with-android-platform=/path/to/ndk/platform.])
233 dnl Old NDK support. If minimum requirement is changed to NDK r8b,
234 dnl please remove this.
235 case "$target_cpu" in
237 if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
238 dnl Old NDK toolchain name
239 android_tool_prefix="i686-android-linux"
245 AS="$android_toolchain"/bin/"$android_tool_prefix"-as
246 CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
247 CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
248 CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
249 LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
250 AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
251 RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
252 STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
254 CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
255 CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
256 CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
257 LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
259 dnl prevent cross compile section from using these flags as host flags
260 if test -z "$HOST_CPPFLAGS" ; then
263 if test -z "$HOST_CFLAGS" ; then
266 if test -z "$HOST_CXXFLAGS" ; then
269 if test -z "$HOST_LDFLAGS" ; then
274 AC_DEFINE_UNQUOTED(ANDROID_VERSION, $android_version)
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
392 [ --enable-n32 Enable n32 ABI support (IRIX only)],
393 [ if test "$enableval" = "yes"; then
395 else if test "$enableval" = "no"; then
401 [ --enable-64bit Enable 64-bit support (on certain platforms)],
402 [ if test "$enableval" = "yes"; then
406 AC_ARG_ENABLE(mdupdate,
407 [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
408 [ if test "$enableval" = "yes"; then
413 [ --enable-cplus Enable some c++ api routines],
414 [ if test "$enableval" = "yes"; then
418 AC_ARG_WITH(arm-kuser,
419 [ --with-arm-kuser Use kuser helpers (Linux/ARM only)
420 (Requires kernel 2.6.13 or later)],
421 [ if test "$withval" = "yes"; then
422 AC_DEFINE(_PR_ARM_KUSER)
425 dnl ========================================================
426 dnl = Mac OS X SDK support
427 dnl ========================================================
428 AC_ARG_WITH(macos-sdk,
429 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
430 MACOS_SDK_DIR=$withval)
432 AC_ARG_ENABLE(macos-target,
433 [ --enable-macos-target=VER
434 Set the minimum MacOS version needed at runtime
435 [10.2 for ppc, 10.4 for x86]],
436 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
438 dnl ========================================================
440 dnl = Set the threading model
442 dnl ========================================================
446 case "${target_os}" in
458 dnl ========================================================
460 dnl = Set the default C compiler
462 dnl ========================================================
463 if test -z "$CC"; then
467 if test -z "$USE_NSPR_THREADS"; then
493 dnl ========================================================
495 dnl = Set the default C++ compiler
497 dnl ========================================================
498 if test -z "$CXX"; then
502 if test -z "$USE_NSPR_THREADS"; then
510 case "${target_os}" in
538 if test -z "$SKIP_PATH_CHECKS"; then
539 AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
542 if test -n "$MOZ_DEBUG"; then
544 DEFINES="$DEFINES -UNDEBUG"
546 case "${target_os}" in
548 DEFINES="$DEFINES -DDEBUG_${USER}"
550 msvc*|mks*|cygwin*|mingw*|wince*|winmo*|os2*)
551 DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
554 DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
559 DEFINES="$DEFINES -UDEBUG"
562 if test -z "$SKIP_COMPILER_CHECKS"; then
563 dnl ========================================================
564 dnl Checks for compilers.
565 dnl ========================================================
567 dnl Explicitly honor $CROSS_COMPILE to allow cross-compiling
568 dnl between toolkits on the same architecture, as when
569 dnl targeting the iOS Simulator from OS X.
570 if test "$target" != "$host" -o -n "$CROSS_COMPILE"; then
571 echo "cross compiling from $host to $target"
575 _SAVE_CFLAGS="$CFLAGS"
576 _SAVE_LDFLAGS="$LDFLAGS"
578 AC_MSG_CHECKING([for $host compiler])
579 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
580 if test -z "$HOST_CC"; then
581 AC_MSG_ERROR([no acceptable cc found in \$PATH])
583 AC_MSG_RESULT([$HOST_CC])
584 if test -z "$HOST_CFLAGS"; then
585 HOST_CFLAGS="$CFLAGS"
587 if test -z "$HOST_LDFLAGS"; then
588 HOST_LDFLAGS="$LDFLAGS"
592 CFLAGS="$HOST_CFLAGS"
593 LDFLAGS="$HOST_LDFLAGS"
595 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
596 AC_TRY_COMPILE([], [return(0);],
597 [ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
598 AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
602 LDFLAGS=$_SAVE_LDFLAGS
604 case "$build:$target" in
605 powerpc-apple-darwin8*:i?86-apple-darwin*)
606 dnl The Darwin cross compiler doesn't necessarily point itself at a
607 dnl root that has libraries for the proper architecture, it defaults
608 dnl to the system root. The libraries in the system root on current
609 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
610 dnl checks will fail. Fake a working SDK in that case.
612 _SAVE_CXXFLAGS=$CXXFLAGS
613 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
614 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
616 *:arm*-apple-darwin*)
617 dnl The arm compiler doesn't appear to know about its root by default,
618 dnl so explicitly pass it one here. Later on we'll put this in CFLAGS
621 _SAVE_CXXFLAGS=$CXXFLAGS
622 CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS"
623 CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS"
627 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
630 if test -n "$USE_CPLUS"; then
631 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
636 case "$build:$target" in
637 powerpc-apple-darwin8*:i?86-apple-darwin*|*:arm*-apple-darwin*)
638 dnl Revert the changes made above. From this point on, the target
639 dnl compiler will never be used without applying the SDK to CFLAGS
640 dnl (see --with-macos-sdk below).
642 CXXFLAGS=$_SAVE_CXXFLAGS
646 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
647 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
648 AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
649 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
650 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
651 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
655 if test -n "$USE_CPLUS"; then
656 if test "$CC" = "cl" -a -z "$CXX"; then
664 AC_PATH_PROGS(AS, as, $CC)
665 AC_PATH_PROGS(AR, ar, echo not_ar)
666 AC_PATH_PROGS(LD, ld link, echo not_ld)
667 AC_PATH_PROGS(STRIP, strip, echo not_strip)
668 AC_PATH_PROGS(WINDRES, windres, echo not_windres)
669 if test -z "$HOST_CC"; then
672 if test -z "$HOST_CFLAGS"; then
673 HOST_CFLAGS="$CFLAGS"
677 if test "$GCC" = "yes"; then
680 if test "$GXX" = "yes"; then
683 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
688 case "$build:$target" in
689 i?86-apple-darwin*:powerpc-apple-darwin*)
690 dnl cross_compiling will have erroneously been set to "no" in this
691 dnl case, because the x86 build host is able to run ppc code in a
692 dnl translated environment, making a cross compiler appear native.
697 if test "$cross_compiling" = "yes"; then
703 dnl ========================================================
704 dnl Check for gcc -pipe support
705 dnl ========================================================
706 AC_MSG_CHECKING([for gcc -pipe support])
707 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
708 echo '#include <stdio.h>' > dummy-hello.c
709 echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
710 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
711 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
717 if test "$_res_as_stdin" = "yes"; then
719 CFLAGS="$CFLAGS -pipe"
720 AC_TRY_COMPILE( [ #include <stdio.h> ],
721 [printf("Hello World\n");],
722 [_res_gcc_pipe="yes"],
723 [_res_gcc_pipe="no"] )
726 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
728 CFLAGS="$CFLAGS -pipe"
729 CXXFLAGS="$CXXFLAGS -pipe"
733 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
734 AC_MSG_RESULT([$_res])
739 dnl ========================================================
740 dnl Profile guided optimization
741 dnl ========================================================
742 dnl Test for profiling options
743 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
745 _SAVE_CFLAGS="$CFLAGS"
746 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
748 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
749 AC_TRY_COMPILE([], [return 0;],
750 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
751 result="yes" ], result="no")
752 AC_MSG_RESULT([$result])
754 if test $result = "yes"; then
755 PROFILE_GEN_LDFLAGS="-fprofile-generate"
756 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
757 PROFILE_USE_LDFLAGS="-fprofile-use"
760 CFLAGS="$_SAVE_CFLAGS"
762 dnl ===============================================================
763 dnl Check for .hidden assembler directive and visibility attribute.
764 dnl Borrowed from glibc configure.in
765 dnl ===============================================================
766 if test "$GNU_CC"; then
767 AC_CACHE_CHECK(for visibility(hidden) attribute,
768 ac_cv_visibility_hidden,
769 [cat > conftest.c <<EOF
770 int foo __attribute__ ((visibility ("hidden"))) = 1;
772 ac_cv_visibility_hidden=no
773 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
774 if grep '\.hidden.*foo' conftest.s >/dev/null; then
775 ac_cv_visibility_hidden=yes
780 if test "$ac_cv_visibility_hidden" = "yes"; then
781 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
782 AC_CACHE_CHECK(for visibility pragma support,
783 ac_cv_visibility_pragma,
784 [cat > conftest.c <<EOF
785 #pragma GCC visibility push(hidden)
787 #pragma GCC visibility push(default)
790 ac_cv_visibility_pragma=no
791 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
792 if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
793 if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
794 ac_cv_visibility_pragma=yes
800 if test "$ac_cv_visibility_pragma" = "yes"; then
801 AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
802 # To work around a build problem on Linux x86-64 (Bugzilla bug
803 # 293438), we use the -fvisibility=hidden flag. This flag is less
804 # optimal than #pragma GCC visibility push(hidden) because the flag
805 # assumes that symbols defined outside the current source file have
806 # the default visibility. This has the advantage that we don't need
807 # to wrap system header files, but has the disadvantage that calls
808 # to hidden symbols defined in other source files cannot be
809 # optimized by the compiler. The -fvisibility=hidden flag does
810 # hide and export symbols correctly.
811 #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
812 #WRAP_SYSTEM_INCLUDES=1
813 VISIBILITY_FLAGS="-fvisibility=hidden"
814 WRAP_SYSTEM_INCLUDES=
819 fi # SKIP_COMPILER_CHECKS
821 dnl ========================================================
822 dnl Checks for programs.
823 dnl ========================================================
824 if test -z "$SKIP_PATH_CHECKS"; then
825 AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
826 elif test -z "$PERL"; then
830 dnl ========================================================
831 dnl Default platform specific options
832 dnl ========================================================
837 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
845 if test -n "$CROSS_COMPILE"; then
846 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
848 OS_TEST="${target_cpu}"
849 case "${target_os}" in
850 linux*) OS_ARCH=Linux ;;
851 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
852 mingw*) OS_ARCH=WINNT ;;
853 wince*) OS_ARCH=WINCE ;;
854 winmo*) OS_ARCH=WINCE ;;
855 darwin*) OS_ARCH=Darwin ;;
856 riscos*) OS_ARCH=RISCOS ;;
859 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
860 OS_RELEASE=`uname -r`
864 if test "$OS_ARCH" = "IRIX64"; then
868 if test "$OS_ARCH" = "AIX"; then
869 OS_RELEASE=`uname -v`.`uname -r`
872 if test "$OS_ARCH" = "FreeBSD"; then
873 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
876 if test "$OS_ARCH" = "Linux"; then
877 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
878 OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
881 #######################################################################
882 # Master "Core Components" macros for getting the OS target #
883 #######################################################################
886 # Note: OS_TARGET should be specified on the command line for gmake.
887 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
888 # The difference between the Win95 target and the WinNT target is that
889 # the WinNT target uses Windows NT specific features not available
890 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
891 # at lesser performance (the Win95 target uses threads; the WinNT target
894 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
899 # The following hack allows one to build on a WIN95 machine (as if
900 # s/he were cross-compiling on a WINNT host for a WIN95 target).
901 # It also accomodates for MKS's uname.exe. If you never intend
902 # to do development on a WIN95 machine, you don't need this hack.
917 CYGWIN_9*|CYGWIN_ME*)
918 OS_ARCH='CYGWIN_NT-4.0'
928 # On WIN32, we also define the variable CPU_ARCH.
934 if test "$CPU_ARCH" = "I386"; then
940 # If uname -s returns "Windows_NT", we assume that we are using
941 # the uname.exe in MKS toolkit.
943 # The -r option of MKS uname only returns the major version number.
944 # So we need to use its -v option to get the minor version number.
945 # Moreover, it doesn't have the -p option, so we need to use uname -m.
948 OS_MINOR_RELEASE=`uname -v`
949 if test "$OS_MINOR_RELEASE" = "00"; then
952 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
955 # MKS's uname -m returns "586" on a Pentium machine.
957 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
961 CYGWIN_NT*|MINGW*_NT*)
963 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
964 # the uname.exe in the Cygwin tools.
965 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
966 # the uname.exe in the MSYS tools.
968 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
972 # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
974 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
980 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
982 if test -n "$MOZ_DEBUG"; then
986 if test -z "$OS_TARGET"; then
989 if test "$OS_TARGET" = "WIN95"; then
992 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
994 dnl ========================================================
995 dnl Enable high-memory support on OS/2 by default.
996 dnl ========================================================
997 AC_ARG_ENABLE(os2-high-mem,
998 [ --disable-os2-high-mem Disable high-memory support on OS/2],
999 [ if test "$enableval" = "no"; then
1000 MOZ_OS2_HIGH_MEMORY=
1002 MOZ_OS2_HIGH_MEMORY=1
1005 dnl ========================================================
1006 dnl = ARM toolchain tweaks
1007 dnl ========================================================
1011 arm*-android*|arm*-linuxandroid*)
1015 MOZ_FLOAT_ABI=softfp
1019 if test -n "$MOZ_PLATFORM_MAEMO"; then
1022 MOZ_FLOAT_ABI=softfp
1024 if test "$MOZ_PLATFORM_MAEMO" = 6; then
1030 dnl Kept for compatibility with some buildbot mozconfig
1031 AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval)
1034 [ --with-thumb[[=yes|no|toolchain-default]]]
1035 [ Use Thumb instruction set (-mthumb)],
1036 if test -z "$GNU_CC"; then
1037 AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults])
1041 AC_ARG_WITH(thumb-interwork,
1042 [ --with-thumb-interwork[[=yes|no|toolchain-default]]
1043 Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
1044 if test -z "$GNU_CC"; then
1045 AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults])
1047 MOZ_THUMB_INTERWORK=$withval)
1050 [ --with-arch=[[type|toolchain-default]]
1051 Use specific CPU features (-march=type)],
1052 if test -z "$GNU_CC"; then
1053 AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults])
1058 [ --with-fpu=[[type|toolchain-default]]
1059 Use specific FPU type (-mfpu=type)],
1060 if test -z "$GNU_CC"; then
1061 AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults])
1065 AC_ARG_WITH(float-abi,
1066 [ --with-float-abi=[[type|toolchain-default]]
1067 Use specific arm float ABI (-mfloat-abi=type)],
1068 if test -z "$GNU_CC"; then
1069 AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults])
1071 MOZ_FLOAT_ABI=$withval)
1073 AC_ARG_WITH(soft-float,
1074 [ --with-soft-float[[=yes|no|toolchain-default]]
1075 Use soft float library (-msoft-float)],
1076 if test -z "$GNU_CC"; then
1077 AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults])
1079 MOZ_SOFT_FLOAT=$withval)
1082 toolchain-default|"")
1086 arch_flag="-march=$MOZ_ARCH"
1090 case "$MOZ_THUMB" in
1093 thumb_flag="-mthumb"
1100 _SAVE_CFLAGS="$CFLAGS"
1102 AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
1105 CFLAGS="$_SAVE_CFLAGS"
1110 case "$MOZ_THUMB_INTERWORK" in
1112 thumb_interwork_flag="-mthumb-interwork"
1115 thumb_interwork_flag="-mno-thumb-interwork"
1117 *) # toolchain-default
1118 thumb_interwork_flag=""
1123 toolchain-default|"")
1127 fpu_flag="-mfpu=$MOZ_FPU"
1131 case "$MOZ_FLOAT_ABI" in
1132 toolchain-default|"")
1136 float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
1140 case "$MOZ_SOFT_FLOAT" in
1142 soft_float_flag="-msoft-float"
1145 soft_float_flag="-mno-soft-float"
1147 *) # toolchain-default
1152 dnl Use echo to avoid accumulating space characters
1153 all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
1154 if test -n "$all_flags"; then
1155 _SAVE_CFLAGS="$CFLAGS"
1157 AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
1158 AC_TRY_COMPILE([],[return 0;],
1159 AC_MSG_RESULT([yes]),
1162 CFLAGS="$_SAVE_CFLAGS $all_flags"
1163 CXXFLAGS="$CXXFLAGS $all_flags"
1164 ASFLAGS="$ASFLAGS $all_flags"
1165 if test -n "$thumb_flag"; then
1166 LDFLAGS="$LDFLAGS $thumb_flag"
1170 dnl ========================================================
1171 dnl Override of system specific host options
1172 dnl ========================================================
1177 *-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*)
1178 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
1179 if test `echo "${PATH}" | grep -c \;` = 0; then
1180 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
1184 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
1189 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1193 dnl ========================================================
1194 dnl Override of system specific target options
1195 dnl ========================================================
1202 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
1203 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
1204 case "${target_os}" in
1206 AC_DEFINE(AIX_RENAME_SELECT)
1207 AC_DEFINE(_PR_NO_LARGE_FILES)
1208 AIX_LINK_OPTS='-bnso -berok'
1209 PR_MD_ASFILES=os_AIX.s
1212 AC_DEFINE(AIX_TIMERS)
1213 AC_DEFINE(_PR_NO_LARGE_FILES)
1217 AIX_LINK_OPTS='-bnso -berok'
1218 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
1219 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
1222 AC_DEFINE(AIX_TIMERS)
1223 AC_DEFINE(_PR_HAVE_OFF64_T)
1224 AIX_LINK_OPTS='-brtl -bnso -berok'
1227 AC_DEFINE(AIX_TIMERS)
1228 AC_DEFINE(_PR_HAVE_OFF64_T)
1229 AC_DEFINE(AIX4_3_PLUS)
1230 AC_DEFINE(HAVE_SOCKLEN_T)
1231 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1233 AIX_LINK_OPTS='-brtl -bnso -berok'
1236 AC_DEFINE(AIX_TIMERS)
1237 AC_DEFINE(_PR_HAVE_OFF64_T)
1238 AC_DEFINE(AIX4_3_PLUS)
1239 AC_DEFINE(HAVE_SOCKLEN_T)
1240 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1242 AIX_LINK_OPTS='-brtl -bnso -berok'
1245 CFLAGS="$CFLAGS -qro -qroconst"
1246 AIX_WRAP='$(DIST)/lib/aixwrap.o'
1247 AIX_TMP='./_aix_tmp.o'
1248 if test -n "$USE_64"; then
1249 MDCPUCFG_H=_aix64.cfg
1252 MDCPUCFG_H=_aix32.cfg
1255 RESOLVE_LINK_SYMBOLS=1
1262 AC_DEFINE(_POSIX_SOURCE)
1264 MDCPUCFG_H=_beos.cfg
1267 RESOLVE_LINK_SYMBOLS=1
1268 case "${target_cpu}" in
1271 _DEBUG_FLAGS='-gdwarf-2 -O0'
1272 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1273 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1279 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'
1281 _DEBUG_FLAGS='-g -O0'
1289 AC_DEFINE(NEED_BSDREGEX)
1291 CFLAGS="$CFLAGS -Wall -Wno-format"
1292 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1294 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1296 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1300 MDCPUCFG_H=_bsdi.cfg
1305 case "$target_os" in
1307 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1308 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1309 AC_DEFINE(_PR_NEED_H_ERRNO)
1316 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1317 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1319 AC_DEFINE(USE_DLFCN)
1320 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1321 PR_MD_ASFILES=os_BSD_OS_386_2.s
1325 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1326 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1328 AC_DEFINE(USE_DLFCN)
1329 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1330 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1332 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1334 case "$target_os" in
1335 bsdi4.2* | bsdi4.3* | bsdi5.*)
1336 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1337 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1342 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1343 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1345 AC_DEFINE(USE_DLFCN)
1346 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1355 AC_DEFINE(HAVE_BSD_FLOCK)
1356 AC_DEFINE(HAVE_SOCKLEN_T)
1357 AS='$(CC) -x assembler-with-cpp'
1358 CFLAGS="$CFLAGS -Wall -fno-common"
1359 case "${target_cpu}" in
1364 if test -n "$USE_64"; then
1377 if test "`echo $CC | grep -c '\-arch '`" = "0"; then
1378 CC="$CC -arch $CPU_ARCH"
1380 AC_CHECK_HEADER(crt_externs.h)
1382 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1384 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1385 STRIP="$STRIP -x -S"
1388 MDCPUCFG_H=_darwin.cfg
1389 PR_MD_CSRCS=darwin.c
1390 PR_MD_ASFILES=os_Darwin.s
1392 # Add Mac OS X support for loading CFM & CFBundle plugins
1393 if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1394 AC_DEFINE(XP_MACOSX)
1397 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1398 dnl Use the specified value
1399 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1400 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1401 dnl No value specified on the command line or in the environment,
1402 dnl use the lesser of the library's minimum or the architecture's
1404 case "${target_cpu}" in
1406 dnl Architecture minimum 10.2
1407 export MACOSX_DEPLOYMENT_TARGET=10.2
1410 dnl Architecture minimum 10.4
1411 export MACOSX_DEPLOYMENT_TARGET=10.4
1416 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1417 dnl in use. NEXT_ROOT will be set and exported if it's needed for
1420 if test "$MACOS_SDK_DIR"; then
1421 dnl Sync this section with the one in Mozilla's top level.
1423 if test ! -d "$MACOS_SDK_DIR"; then
1424 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1425 specify a valid SDK. SDKs are installed when the optional cross-development
1426 tools are selected during the Xcode/Developer Tools installation.])
1430 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1431 GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1432 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1434 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1435 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1436 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1437 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1438 SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1441 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1443 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1445 dnl CPP needs to be set for AC_CHECK_HEADER.
1446 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1449 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1451 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1452 dnl The build host is running Tiger (10.4) or earlier.
1453 dnl ld support for -syslibroot is compiler-agnostic, but
1454 dnl only available on Tiger and later. On Tiger and
1455 dnl earlier build hosts, just rely on NEXT_ROOT, because
1456 dnl it's not been shown to cause any problems.
1457 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}"
1459 dnl The build host is running Leopard (10.5) or later.
1460 dnl With NEXT_ROOT set, the linker will still not apply
1461 dnl it when resolving dependencies. This causes problems
1462 dnl on Leopard, where an SDK depends on frameworks which
1463 dnl were present in earlier OS releases (and the associated
1464 dnl SDK) but not in Leopard. -syslibroot does not have
1465 dnl this problem, but it results in harmless warnings when
1466 dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1467 dnl on Leopard because the compiler uses it too.
1468 MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1471 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1472 export NEXT_ROOT=$MACOS_SDK_DIR
1474 if test -n "$CROSS_COMPILE" ; then
1475 dnl NEXT_ROOT will be in the environment, but it
1476 dnl shouldn't be set for the build host. HOST_CXX is
1477 dnl presently unused.
1478 HOST_CC="NEXT_ROOT= $HOST_CC"
1479 HOST_CXX="NEXT_ROOT= $HOST_CXX"
1482 dnl gcc >= 4.0 uses different paths than above, but knows
1483 dnl how to find them itself.
1484 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1486 dnl CPP needs to be set for AC_CHECK_HEADER.
1487 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1489 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1490 dnl has an ld that supports -syslibroot. Don't set
1491 dnl NEXT_ROOT because it will be ignored and cause
1492 dnl warnings when -syslibroot is specified.
1493 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1494 dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1495 dnl based on the -isysroot it receives.
1496 LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1498 dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1500 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1509 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1513 AC_DEFINE(_DGUX_SOURCE)
1514 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1518 MDCPUCFG_H=_dgux.cfg
1523 if test -z "$USE_NSPR_THREADS"; then
1528 AC_DEFINE(HAVE_BSD_FLOCK)
1529 AC_DEFINE(HAVE_SOCKLEN_T)
1530 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1531 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1532 if test "$MOZ_OBJFORMAT" = "elf"; then
1537 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1539 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1540 MDCPUCFG_H=_freebsd.cfg
1541 PR_MD_CSRCS=freebsd.c
1547 AC_DEFINE(_HPUX_SOURCE)
1548 # OSF1 and HPUX report the POLLHUP event for a socket when the
1549 # shutdown(SHUT_WR) operation is called for the remote end, even though
1550 # the socket is still writeable. Use select(), instead of poll(), to
1551 # workaround this problem.
1552 AC_DEFINE(_PR_POLL_WITH_SELECT)
1553 AC_DEFINE(_USE_BIG_FDS)
1554 DSO_LDOPTS='-b +h $(notdir $@)'
1556 if test "$OS_TEST" = "ia64"; then
1558 DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1559 CPU_ARCH_TAG=_$OS_TEST
1560 if test -z "$USE_64"; then
1563 PR_MD_ASFILES=os_HPUX_ia64.s
1567 PR_MD_ASFILES=os_HPUX.s
1569 if test -n "$USE_64"; then
1570 MDCPUCFG_H=_hpux64.cfg
1572 MDCPUCFG_H=_hpux32.cfg
1574 if test -z "$GNU_CC"; then
1580 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1583 if test -n "$MOZILLA_CLIENT"; then
1584 DEFAULT_IMPL_STRATEGY=_EMU
1587 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1588 AC_DEFINE(_PR_NEED_H_ERRNO)
1590 DEFAULT_IMPL_STRATEGY=_EMU
1594 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1595 AC_DEFINE(_PR_NO_LARGE_FILES)
1598 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1599 AC_DEFINE(_PR_NEED_H_ERRNO)
1602 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1603 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1606 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1607 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1610 # HP-UX 11i v2 (B.11.23) or higher
1612 case "$OS_RELEASE" in
1613 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1619 if test "$OS_RELEASE" = "B.10.01"; then
1621 DEFAULT_IMPL_STRATEGY=_EMU
1624 if test "$OS_RELEASE" = "B.10.10"; then
1626 AC_DEFINE(HPUX10_10)
1627 DEFAULT_IMPL_STRATEGY=_PTH
1630 if test "$OS_RELEASE" = "B.10.20"; then
1632 AC_DEFINE(HPUX10_20)
1633 if test -z "$GNU_CC"; then
1634 CFLAGS="$CFLAGS +DAportable +DS1.1"
1635 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1637 DEFAULT_IMPL_STRATEGY=_PTH
1640 if test "$OS_RELEASE" = "B.10.30"; then
1642 AC_DEFINE(HPUX10_30)
1643 if test -z "$GNU_CC"; then
1644 CFLAGS="$CFLAGS +DAportable +DS1.1"
1645 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1647 DEFAULT_IMPL_STRATEGY=_PTH
1650 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1653 AC_DEFINE(_LARGEFILE64_SOURCE)
1654 AC_DEFINE(_PR_HAVE_OFF64_T)
1655 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1656 if test -z "$GNU_CC"; then
1657 if test -z "$USE_64"; then
1658 if test "$OS_TEST" = "ia64"; then
1659 CFLAGS="$CFLAGS +DD32"
1660 CXXFLAGS="$CXXFLAGS +DD32"
1662 CFLAGS="$CFLAGS +DAportable +DS2.0"
1663 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1666 if test "$OS_TEST" = "ia64"; then
1667 CFLAGS="$CFLAGS +DD64"
1668 CXXFLAGS="$CXXFLAGS +DD64"
1670 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1671 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1675 DEFAULT_IMPL_STRATEGY=_PTH
1678 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1682 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1684 if test "$USE_NSPR_THREADS"; then
1687 if test "$USE_USER_PTHREADS"; then
1697 AC_DEFINE(_SGI_MP_SOURCE)
1698 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1700 PR_MD_ASFILES=os_Irix.s
1701 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1703 RESOLVE_LINK_SYMBOLS=1
1704 if test -n "$USE_64"; then
1705 MDCPUCFG_H=_irix64.cfg
1707 MDCPUCFG_H=_irix32.cfg
1709 case "${target_os}" in
1726 if test "$GNU_CC"; then
1728 dnl If we are using gcc with native binutils, we need to
1730 dnl #lineno "filename" num num
1731 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1732 dnl gcc command line, which passes -P to the preprocessor.
1734 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1735 CFLAGS="$CFLAGS -Wall -Wno-format"
1736 _OPTIMIZE_FLAGS="-O6"
1738 if test -n "$USE_N32"; then
1739 AS='as -D_ASM $(INCLUDES) -n32'
1741 AS='as -D_ASM $(INCLUDES)'
1743 CFLAGS="$CFLAGS -fullwarn -xansi"
1744 if test "$USE_N32"; then
1745 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1747 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1749 if test "$USE_MDUPDATE"; then
1750 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1754 CFLAGS="$CFLAGS -multigot"
1755 DSO_LDOPTS="-no_unresolved"
1756 if test "$USE_N32"; then
1757 CFLAGS="$CFLAGS -n32 -woff 1209"
1758 DSO_LDOPTS="$DSO_LDOPTS -n32"
1760 if test "$USE_64"; then
1761 CFLAGS="$CFLAGS -64"
1763 CFLAGS="$CFLAGS -32"
1768 CFLAGS="$CFLAGS -xgot"
1772 if test "${target_os}" = "irix5.3"; then
1775 case "${target_os}" in
1777 if test -z "$GNU_CC"; then
1778 CFLAGS="$CFLAGS -mips3"
1780 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1781 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1782 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1787 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1792 *-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
1793 if test -z "$USE_NSPR_THREADS"; then
1798 AC_DEFINE(_GNU_SOURCE)
1799 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1801 *-android*|*-linuxandroid*)
1809 CFLAGS="$CFLAGS -Wall"
1810 CXXFLAGS="$CXXFLAGS -Wall"
1811 MDCPUCFG_H=_linux.cfg
1813 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1815 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1817 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1818 # combo is not yet good at debugging inlined
1819 # functions (even when using DWARF2 as the
1822 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1827 CPU_ARCH_TAG=_${CPU_ARCH}
1828 case "${target_cpu}" in
1832 CFLAGS="$CFLAGS -mieee"
1833 CXXFLAGS="$CXXFLAGS -mieee"
1837 PR_MD_ASFILES=os_Linux_x86.s
1840 PR_MD_ASFILES=os_Linux_ia64.s
1843 if test -n "$USE_64"; then
1844 PR_MD_ASFILES=os_Linux_x86_64.s
1847 PR_MD_ASFILES=os_Linux_x86.s
1853 PR_MD_ASFILES=os_Linux_ppc.s
1856 if test -n "$USE_64"; then
1860 PR_MD_ASFILES=os_Linux_ppc.s
1864 CFLAGS="$CFLAGS -m68020-60"
1865 CXXFLAGS="$CXXFLAGS -m68020-60"
1870 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1873 PR_MD_ARCH_DIR=windows
1874 RESOLVE_LINK_SYMBOLS=1
1876 if test -n "$GNU_CC"; then
1878 CXX="$CXX -mwindows"
1880 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1882 # Use temp file for windres (bug 213281)
1883 RCFLAGS='-O coff --use-temp-file'
1888 AR='lib -NOLOGO -OUT:"$@"'
1890 RANLIB='echo not_ranlib'
1891 STRIP='echo not_strip'
1893 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1898 # Determine compiler version
1900 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1902 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1903 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1904 _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1905 _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1906 _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1907 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1909 if test "$_CC_MAJOR_VERSION" -eq "14"; then
1910 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1911 dnl so be very specific here!
1912 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1913 if test $_CC_RELEASE -gt 50727; then
1915 elif test $_CC_BUILD -ge 762; then
1918 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
1919 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
1920 elif test $_CC_MAJOR_VERSION -ge 15; then
1922 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
1923 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
1926 if test -n "$_USE_DYNAMICBASE"; then
1927 DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1930 # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1931 # tape manipulation utility (or something else)
1932 if test "$MSC_VER" -ge "1400"; then
1934 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1937 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1938 if test -n "$MSMT_TOOL"; then
1939 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1940 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1941 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1946 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1950 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1951 DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1955 PROFILE_GEN_CFLAGS="-GL"
1956 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1957 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1958 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1960 if test -z "$MOZ_OPTIMIZE"; then
1961 CFLAGS="$CFLAGS -Od"
1964 if test -n "$USE_DEBUG_RTL"; then
1965 CFLAGS="$CFLAGS -MDd"
1967 CFLAGS="$CFLAGS -MD"
1970 if test -n "$MOZ_DEBUG"; then
1973 DEFINES="$DEFINES -U_DEBUG"
1976 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1977 if test -n "$MOZ_OPTIMIZE"; then
1978 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1979 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1981 DLLFLAGS="$DLLFLAGS -DEBUG"
1982 LDFLAGS="$LDFLAGS -DEBUG"
1986 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1987 if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1988 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
1991 if test "$OS_TARGET" = "WINNT"; then
1992 CFLAGS="$CFLAGS -GT"
1993 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1994 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1996 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1997 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2001 if test -n "$USE_STATIC_TLS"; then
2002 AC_DEFINE(_PR_USE_STATIC_TLS)
2005 if test "$OS_TARGET" = "WINNT"; then
2009 # undefine WINNT as some versions of mingw gcc define it by default
2010 DEFINES="$DEFINES -UWINNT"
2011 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2014 if test "$CPU_ARCH" = "x86"; then
2017 CPU_ARCH_TAG=$CPU_ARCH
2020 if test -n "$USE_DEBUG_RTL"; then
2024 case "$OS_TARGET" in
2026 MDCPUCFG_H=_winnt.cfg
2029 MDCPUCFG_H=_win95.cfg
2032 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
2036 case "$target_cpu" in
2038 if test -n "$USE_64"; then
2053 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2062 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2064 AR_FLAGS='-NOLOGO -OUT:"$@"'
2069 MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
2071 PR_MD_ARCH_DIR=windows
2072 RESOLVE_LINK_SYMBOLS=1
2074 MDCPUCFG_H=_win95.cfg
2075 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2076 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2078 DLLFLAGS='-OUT:"$@"'
2079 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2080 OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2081 OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
2082 DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
2091 AC_DEFINE(HAVE_BSD_FLOCK)
2092 if test -z "$USE_NSPR_THREADS"; then
2095 MDCPUCFG_H=_netbsd.cfg
2096 PR_MD_CSRCS=netbsd.c
2098 DSO_CFLAGS='-fPIC -DPIC'
2099 CFLAGS="$CFLAGS -ansi -Wall"
2100 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2101 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
2103 if test -z "$OBJECT_FMT"; then
2104 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
2107 DSO_LDOPTS='-shared'
2111 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
2115 if test "$LIBRUNPATH"; then
2116 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
2123 AC_DEFINE(_QNX_SOURCE)
2124 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2127 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
2130 OS_LIBS="$OS_LIBS -lsocket"
2131 _OPTIMIZE_FLAGS="-O1"
2132 _DEBUG_FLAGS="-gstabs"
2138 AC_DEFINE(HAVE_BSD_FLOCK)
2139 AC_DEFINE(HAVE_SOCKLEN_T)
2140 CFLAGS="$CFLAGS -ansi -Wall"
2141 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2144 MDCPUCFG_H=_openbsd.cfg
2145 PR_MD_CSRCS=openbsd.c
2147 if test -z "$USE_NSPR_THREADS"; then
2150 DSO_LDOPTS='-shared -fPIC'
2151 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2155 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2158 AC_DEFINE(_REENTRANT)
2159 # OSF1 and HPUX report the POLLHUP event for a socket when the
2160 # shutdown(SHUT_WR) operation is called for the remote end, even though
2161 # the socket is still writeable. Use select(), instead of poll(), to
2162 # workaround this problem.
2163 AC_DEFINE(_PR_POLL_WITH_SELECT)
2165 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2169 if test -z "$GNU_CC"; then
2170 CC="$CC -std1 -ieee_with_inexact"
2171 if test "$OS_RELEASE" != "V2.0"; then
2172 CC="$CC -readonly_strings"
2174 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2175 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2177 CFLAGS="$CFLAGS -mieee"
2178 CXXFLAGS="$CXXFLAGS -mieee"
2181 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2182 AC_DEFINE(HAVE_INT_LOCALTIME_R)
2184 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2185 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2187 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2188 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2190 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2191 MDCPUCFG_H=_osf1.cfg
2198 AC_DEFINE(_PR_NEED_H_ERRNO)
2207 AC_DEFINE(_PR_NEED_H_ERRNO)
2209 MDCPUCFG_H=_riscos.cfg
2210 PR_MD_CSRCS=riscos.c
2212 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2213 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2222 AC_DEFINE(_PR_NEED_H_ERRNO)
2223 CC='cc -b elf -KPIC'
2224 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2227 DSO_LDOPTS='-b elf -G'
2228 MDCPUCFG_H=_scoos.cfg
2233 if test -z "$USE_NSPR_THREADS"; then
2242 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2244 MDCPUCFG_H=_solaris.cfg
2245 PR_MD_CSRCS=solaris.c
2247 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2248 RESOLVE_LINK_SYMBOLS=1
2249 case "${OS_RELEASE}" in
2253 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2257 if test -n "$GNU_CC"; then
2259 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2262 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2263 if test -n "$USE_B_DIRECT"; then
2264 DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2268 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2269 if test -n "$USE_B_DIRECT"; then
2270 DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2273 if test -n "$GNU_CC"; then
2274 CFLAGS="$CFLAGS -Wall"
2275 CXXFLAGS="$CXXFLAGS -Wall"
2276 if test -n "$USE_MDUPDATE"; then
2277 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2278 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2280 GCC_AS=`$CC -print-prog-name=as`
2281 if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2285 CFLAGS="$CFLAGS -xstrconst"
2286 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2287 if test -z "$MOZ_OPTIMIZE"; then
2288 CFLAGS="$CFLAGS -xs"
2289 CXXFLAGS="$CXXFLAGS -xs"
2291 _OPTIMIZE_FLAGS=-xO4
2293 if test -z "$GNU_AS"; then
2294 ASFLAGS="$ASFLAGS -Wa,-P"
2296 if test -n "$USE_64"; then
2297 if test -n "$GNU_CC"; then
2301 if test "$OS_TEST" = "i86pc"; then
2302 CC="$CC -xarch=amd64"
2303 CXX="$CXX -xarch=amd64"
2306 CXX="$CXX -xarch=v9"
2310 if test "$OS_TEST" = "i86pc"; then
2311 if test -z "$USE_64"; then
2314 CPU_ARCH_TAG=_$OS_TEST
2315 # The default debug format, DWARF (-g), is not supported by gcc
2316 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
2317 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2318 # If your gcc uses GNU as, you do not need the -Wa,-s option.
2319 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2320 _DEBUG_FLAGS=-gstabs
2321 if test -z "$GNU_AS"; then
2322 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2326 case "${target_os}" in
2328 AC_DEFINE(_PR_NO_LARGE_FILES)
2331 AC_DEFINE(_PR_NO_LARGE_FILES)
2334 AC_DEFINE(SOLARIS2_5)
2337 AC_DEFINE(_PR_HAVE_OFF64_T)
2338 # The lfcompile64(5) man page on Solaris 2.6 says:
2339 # For applications that do not wish to conform to the POSIX or
2340 # X/Open specifications, the 64-bit transitional interfaces
2341 # are available by default. No compile-time flags need to be
2343 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2344 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2345 if test -n "$GNU_CC"; then
2346 AC_DEFINE(_LARGEFILE64_SOURCE)
2350 case "${target_os}" in
2362 # Solaris 8 or higher has IPv6.
2363 AC_DEFINE(_PR_INET6)
2366 if test "$CPU_ARCH" = "sparc"; then
2367 # 64-bit Solaris SPARC requires V9 architecture, so the following
2369 if test -z "$USE_64"; then
2370 ULTRASPARC_LIBRARY=nspr_flt
2373 # Purify requires that binaries linked against nspr also
2374 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2376 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2377 OS_LIBS="$OS_LIBS $_librt"
2386 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2387 AC_DEFINE(_PR_NO_LARGE_FILES)
2388 CC='$(NSDEPTH)/build/hcc cc'
2389 CXX='$(NSDEPTH)/build/hcpp CC'
2390 MDCPUCFG_H=_unixware.cfg
2392 AC_DEFINE(_LARGEFILE64_SOURCE)
2393 AC_DEFINE(_PR_HAVE_OFF64_T)
2394 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2395 MDCPUCFG_H=_unixware7.cfg
2397 PR_MD_CSRCS=unixware.c
2403 AC_ARG_WITH(symbian-sdk,
2404 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
2405 The path to the Symbian SDK],
2406 SYMBIAN_SDK_DIR=$withval)
2408 echo -----------------------------------------------------------------------------
2409 echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2410 echo -----------------------------------------------------------------------------
2415 AC_DEFINE(__SYMBIAN32__)
2418 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2419 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2420 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2421 AC_DEFINE(HAVE_SOCKLEN_T)
2429 MDCPUCFG_H=_symbian.cfg
2430 PR_MD_CSRCS=symbian.c
2432 RANLIB='echo no ranlib '
2435 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2436 CFLAGS="$CFLAGS -MD -nostdinc"
2437 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2438 echo -------------------------------------------------------
2439 echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2440 echo -------------------------------------------------------
2441 case "$OS_TARGET" in
2447 WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2448 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)"
2449 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2450 AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2454 AC_DEFINE(__WINSCW__)
2455 DEFINES="$DEFINES -U_WIN32"
2458 CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2459 CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2460 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2463 DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2466 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2469 CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2475 AC_DEFINE(BSD_SELECT)
2476 AC_DEFINE(TCPV40HDRS)
2484 RESOLVE_LINK_SYMBOLS=1
2489 CFLAGS="$CFLAGS -Wall -Zomf"
2490 CXXFLAGS="$CFLAGS -Wall -Zomf"
2491 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2493 DSO_LDOPTS='-Zomf -Zdll'
2495 _OPTIMIZE_FLAGS="-O2 -s"
2496 _DEBUG_FLAGS="-g -fno-inline"
2497 if test -n "$MOZ_OPTIMIZE"; then
2498 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2502 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2503 LDFLAGS="$LDFLAGS -Zhigh-mem"
2504 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2507 # GCC for OS/2 currently predefines these, but we don't want them
2508 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2517 if test -z "$SKIP_LIBRARY_CHECKS"; then
2518 dnl ========================================================
2519 dnl Check for system libraries
2520 dnl ========================================================
2521 dnl AC_CHECK_LIB(C, main)
2522 dnl AC_CHECK_LIB(C_r, main)
2523 dnl AC_CHECK_LIB(c, main)
2524 dnl AC_CHECK_LIB(c_r, main)
2525 dnl AC_CHECK_LIB(dce, main)
2526 dnl AC_CHECK_LIB(dl, main)
2527 dnl AC_CHECK_LIB(dld, main)
2528 dnl AC_CHECK_LIB(gen, main)
2529 dnl AC_CHECK_LIB(ip6, main)
2530 dnl AC_CHECK_LIB(l, main)
2531 dnl AC_CHECK_LIB(m, main)
2532 dnl AC_CHECK_LIB(nsl, main)
2533 dnl AC_CHECK_LIB(posix4, main)
2534 dnl AC_CHECK_LIB(prstrms, main)
2535 dnl AC_CHECK_LIB(prstrms_shr, main)
2536 dnl AC_CHECK_LIB(pthread, main)
2537 dnl AC_CHECK_LIB(pthreads, main)
2538 dnl AC_CHECK_LIB(resolv, main)
2539 dnl AC_CHECK_LIB(rt, main)
2540 dnl AC_CHECK_LIB(socket, main)
2541 dnl AC_CHECK_LIB(svld, main)
2542 dnl AC_CHECK_LIB(thread, main)
2543 dnl AC_CHECK_LIB(vms_jackets, main)
2546 dnl We don't want anything to link with libdl even if it's present on OS X,
2547 dnl since it's not used and not part of the default installation.
2548 dnl The same goes for BeOS.
2549 dnl OS/2 has dlfcn in libc.
2552 *-darwin*|*-beos*|*-os2*)
2555 AC_CHECK_LIB(dl, dlopen,
2556 AC_CHECK_HEADER(dlfcn.h,
2557 OS_LIBS="-ldl $OS_LIBS"))
2562 dnl ========================================================
2563 dnl Check for system header files.
2564 dnl ========================================================
2565 dnl AC_HEADER_DIRENT
2567 dnl AC_HEADER_SYS_WAIT
2568 dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2570 dnl ========================================================
2571 dnl Check for typedefs and structs
2572 dnl ========================================================
2579 dnl AC_STRUCT_ST_BLKSIZE
2580 dnl AC_STRUCT_ST_BLOCKS
2581 dnl AC_STRUCT_ST_RDEV
2585 dnl ========================================================
2586 dnl Checks for library functions.
2587 dnl ========================================================
2588 AC_PROG_GCC_TRADITIONAL
2590 LIBS="$LIBS $OS_LIBS"
2591 AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
2596 dnl AC_FUNC_SETVBUF_REVERSED
2598 dnl AC_FUNC_STRFTIME
2599 dnl AC_FUNC_UTIME_NULL
2601 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2603 dnl ========================================================
2605 dnl ========================================================
2607 dnl ======================================================
2608 dnl = Enable compiling with ccache
2609 dnl ======================================================
2611 [ --with-ccache[=path/to/ccache]
2612 Enable compiling with ccache],
2613 CCACHE=$withval, CCACHE="no")
2615 if test "$CCACHE" != "no"; then
2616 if test -n "$CCACHE"; then
2617 if test "$CCACHE" = "yes"; then
2620 if test ! -e "$CCACHE"; then
2621 AC_MSG_ERROR([$CCACHE not found])
2625 AC_PATH_PROGS(CCACHE, $CCACHE ccache)
2626 if test -z "$CCACHE" -o "$CCACHE" = ":"; then
2627 AC_MSG_ERROR([ccache not found])
2628 elif test -x "$CCACHE"; then
2632 AC_MSG_ERROR([$CCACHE is not executable])
2636 dnl ========================================================
2638 dnl = --enable-strip
2640 dnl = Enable stripping of libs and executables
2642 dnl ========================================================
2643 AC_ARG_ENABLE(strip,
2644 [ --enable-strip Enable stripping of shared libs and programs],
2645 [ if test "$enableval" = "yes"; then
2649 dnl Check for hpux options
2650 case "${target_os}" in
2652 if test -z "$GNU_CC"; then
2654 AC_CACHE_CHECK(for +Olit support,
2655 ac_cv_hpux_usable_olit_option,
2656 dnl since aCC doesn't throw an error on invalid options,
2657 dnl we have to test this the hard way
2658 [ac_cv_hpux_usable_olit_option=no
2660 echo 'int main() { return 0; }' | cat > conftest.c
2661 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2662 if test $? -eq 0; then
2663 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2664 ac_cv_hpux_usable_olit_option=yes
2670 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2671 CFLAGS="$CFLAGS +Olit=all"
2672 CXXFLAGS="$CXXFLAGS +Olit=all"
2674 CFLAGS="$CFLAGS +ESlit"
2675 CXXFLAGS="$CXXFLAGS +ESlit"
2682 dnl Apparently, some systems cannot properly check for the pthread
2683 dnl library unless <pthread.h> is included so we need to test
2686 dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2687 AC_DEFUN(MOZ_CHECK_PTHREADS,
2689 AC_MSG_CHECKING([for pthread_create in -l$1])
2691 #include <pthread.h>
2692 void *foo(void *v) { return v; }
2695 if (!pthread_create(&t, 0, &foo, 0)) {
2700 echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2701 ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2703 rm -f dummy.c dummy${ac_exeext} ;
2704 if test "$_res" = "0"; then
2705 AC_MSG_RESULT([yes])
2713 case "$target_os" in
2721 MOZ_CHECK_PTHREADS(pthreads,
2722 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2723 MOZ_CHECK_PTHREADS(pthread,
2724 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2725 MOZ_CHECK_PTHREADS(c_r,
2726 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2727 MOZ_CHECK_PTHREADS(c,
2736 AC_ARG_WITH(pthreads,
2737 [ --with-pthreads Use system pthreads library as thread subsystem],
2738 [ if test "$withval" = "yes"; then
2739 if test -n "$_HAVE_PTHREADS"; then
2744 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2750 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2756 AC_ARG_ENABLE(user-pthreads,
2757 [ --enable-user-pthreads Build using userland pthreads],
2758 [ if test "$enableval" = "yes"; then
2759 if test -n "$_HAVE_PTHREADS"; then
2764 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2768 AC_ARG_ENABLE(nspr-threads,
2769 [ --enable-nspr-threads Build using classic nspr threads],
2770 [ if test "$enableval" = "yes"; then
2778 AC_ARG_WITH(bthreads,
2779 [ --with-bthreads Use system bthreads library as thread subsystem
2781 [ if test "$withval" = "yes"; then
2789 fi # SKIP_LIBRARY_CHECKS
2792 [ --enable-ipv6 Compile ipv6 support],
2793 [ if test "$enableval" = "yes"; then
2799 if test -n "$USE_PTHREADS"; then
2800 dnl See if -pthread is supported.
2802 ac_cv_have_dash_pthread=no
2803 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2804 echo 'int main() { return 0; }' | cat > conftest.c
2805 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2806 if test $? -eq 0; then
2807 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2808 ac_cv_have_dash_pthread=yes
2809 case "$target_os" in
2811 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2814 CFLAGS="$CFLAGS -pthread"
2815 CXXFLAGS="$CXXFLAGS -pthread"
2821 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2824 dnl See if -pthreads is supported.
2826 ac_cv_have_dash_pthreads=no
2827 if test "$ac_cv_have_dash_pthread" = "no"; then
2828 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2829 echo 'int main() { return 0; }' | cat > conftest.c
2830 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2831 if test $? -eq 0; then
2832 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2833 ac_cv_have_dash_pthreads=yes
2834 CFLAGS="$CFLAGS -pthreads"
2835 CXXFLAGS="$CXXFLAGS -pthreads"
2839 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2844 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2849 AC_DEFINE(_REENTRANT)
2850 AC_DEFINE(_THREAD_SAFE)
2851 dnl -pthread links in -lc_r, so don't specify it explicitly.
2852 if test "$ac_cv_have_dash_pthread" = "yes"; then
2853 _PTHREAD_LDFLAGS="-pthread"
2855 _PTHREAD_LDFLAGS="-lc_r"
2859 if test "$ac_cv_have_dash_pthread" = "yes"; then
2860 _PTHREAD_LDFLAGS="-pthread"
2864 AC_DEFINE(_THREAD_SAFE)
2865 dnl -pthread links in -lc_r, so don't specify it explicitly.
2866 if test "$ac_cv_have_dash_pthread" = "yes"; then
2871 if test "$ac_cv_have_dash_pthread" = "yes"; then
2872 _PTHREAD_LDFLAGS=-pthread
2875 *-linux*|*-gnu*|*-k*bsd*-gnu)
2876 AC_DEFINE(_REENTRANT)
2881 if test -n "$USE_USER_PTHREADS"; then
2888 dnl Special thread exceptions
2892 if test -n "$USE_NSPR_THREADS"; then
2893 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2895 case "$target_os" in
2897 if test -z "$USE_PTHREADS"; then
2898 AC_DEFINE(AIX_RENAME_SELECT)
2902 if test -z "$USE_NSPR_THREADS"; then
2903 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2907 if test -z "$USE_NSPR_THREADS"; then
2908 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2910 if test -n "$USE_PTHREADS"; then
2911 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2915 if test -z "$USE_NSPR_THREADS"; then
2916 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2918 if test -n "$USE_PTHREADS"; then
2919 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2925 if test -n "$USE_PTHREADS"; then
2926 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2930 if test -n "$USE_NSPR_THREADS"; then
2931 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2935 if test -n "$USE_NSPR_THREADS"; then
2936 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2938 if test "$USE_PTHREADS"; then
2939 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2940 AC_DEFINE(_REENTRANT)
2941 AC_DEFINE(_PR_DCETHREADS)
2943 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2944 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2947 if test "$USE_USER_PTHREADS"; then
2948 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2952 if test "${target_os}" = "irix6.5"; then
2953 if test -n "$USE_PTHREADS"; then
2954 AC_DEFINE(_PR_HAVE_GETHOST_R)
2955 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2959 *-linux*|*-gnu*|*-k*bsd*-gnu)
2960 if test -n "$USE_NSPR_THREADS"; then
2961 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2964 *-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*|*-os2*|*-beos*)
2965 dnl win32, wince, os2 & beos cannot use pthreads
2970 *-netbsd*|*-openbsd*)
2971 if test -n "$USE_NSPR_THREADS"; then
2972 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2976 if test -n "$USE_NSPR_THREADS"; then
2977 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2979 if test -n "$USE_PTHREADS"; then
2980 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2983 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2988 if test -n "$USE_NSPR_THREADS"; then
2989 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2991 if test -n "$USE_PTHREADS"; then
2992 AC_DEFINE(_REENTRANT)
2993 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2994 if test "$OS_TEST" = "i86pc"; then
2995 if test -n "$USE_64"; then
2996 PR_MD_ASFILES=os_SunOS_x86_64.s
2998 PR_MD_ASFILES=os_SunOS_x86.s
3001 if test -n "$USE_64"; then
3002 PR_MD_ASFILES=os_SunOS_sparcv9.s
3008 if test -n "$USE_PTHREADS"; then
3009 AC_DEFINE(_PR_HAVE_GETHOST_R)
3010 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
3015 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
3017 dnl If the user passed in arg to --enable-optimize or --enable-debug,
3018 dnl make sure that we use it.
3019 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
3020 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
3023 if test -n "$_SAVE_DEBUG_FLAGS"; then
3024 _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
3027 if test -n "$MOZ_OPTIMIZE"; then
3028 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
3029 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
3032 if test -n "$MOZ_DEBUG_SYMBOLS"; then
3033 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
3034 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
3037 if test -n "$MOZ_OPTIMIZE"; then
3043 if test -n "$USE_64"; then
3047 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
3049 dnl ========================================================
3050 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
3051 dnl ========================================================
3052 case "$target_os" in
3054 CC="\$(CYGWIN_WRAPPER) $CC"
3055 CXX="\$(CYGWIN_WRAPPER) $CXX"
3056 RC="\$(CYGWIN_WRAPPER) $RC"
3060 dnl ========================================================
3061 dnl = Use malloc wrapper lib
3062 dnl ========================================================
3063 AC_ARG_ENABLE(wrap-malloc,
3064 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
3065 [ if test "$enableval" = "yes"; then
3069 if test -n "$_WRAP_MALLOC"; then
3070 if test -n "$GNU_CC"; then
3071 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
3072 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
3073 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
3074 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
3076 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
3080 dnl ========================================================
3081 dnl = Location of malloc wrapper lib
3082 dnl ========================================================
3083 AC_ARG_WITH(wrap-malloc,
3084 [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
3085 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
3087 dnl ========================================================
3088 dnl Substitution of found variables.
3089 dnl ========================================================
3090 AC_SUBST(SHELL_OVERRIDE)
3092 AC_SUBST(MOZILLA_CLIENT)
3099 AC_SUBST(HOST_CFLAGS)
3101 AC_SUBST(HOST_LDFLAGS)
3103 AC_SUBST(GCC_USE_GNU_LD)
3105 AC_SUBST(CROSS_COMPILE)
3107 AC_SUBST(MOZ_OPTIMIZE)
3109 AC_SUBST(MOZ_DEBUG_SYMBOLS)
3115 AC_SUBST(OBJECT_MODE)
3116 AC_SUBST(ENABLE_STRIP)
3118 AC_SUBST(USE_PTHREADS)
3119 AC_SUBST(USE_BTHREADS)
3120 AC_SUBST(USE_USER_PTHREADS)
3121 AC_SUBST(USE_NSPR_THREADS)
3126 AC_SUBST(MOD_MAJOR_VERSION)
3127 AC_SUBST(MOD_MINOR_VERSION)
3128 AC_SUBST(MOD_PATCH_VERSION)
3129 AC_SUBST(NSPR_MODNAME)
3130 AC_SUBST(MDCPUCFG_H)
3131 AC_SUBST(PR_MD_CSRCS)
3132 AC_SUBST(PR_MD_ASFILES)
3133 AC_SUBST(PR_MD_ARCH_DIR)
3136 AC_SUBST(OBJ_SUFFIX)
3137 AC_SUBST(LIB_SUFFIX)
3138 AC_SUBST(DLL_SUFFIX)
3139 AC_SUBST(ASM_SUFFIX)
3140 AC_SUBST(WRAP_LDFLAGS)
3142 AC_SUBST(DSO_CFLAGS)
3143 AC_SUBST(DSO_LDOPTS)
3147 AC_SUBST(OS_RELEASE)
3149 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3164 AC_SUBST(PROFILE_GEN_CFLAGS)
3165 AC_SUBST(PROFILE_GEN_LDFLAGS)
3166 AC_SUBST(PROFILE_USE_CFLAGS)
3167 AC_SUBST(PROFILE_USE_LDFLAGS)
3170 AC_SUBST(RESOLVE_LINK_SYMBOLS)
3171 AC_SUBST(AIX_LINK_OPTS)
3172 AC_SUBST(NOSUCHFILE)
3173 AC_SUBST(MOZ_OBJFORMAT)
3174 AC_SUBST(ULTRASPARC_LIBRARY)
3177 AC_SUBST(OBJDIR_NAME)
3178 AC_SUBST(RELEASE_OBJDIR_NAME)
3185 AC_SUBST(OS_DLLFLAGS)
3186 AC_SUBST(CYGWIN_WRAPPER)
3187 AC_SUBST(VISIBILITY_FLAGS)
3188 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3189 AC_SUBST(MACOS_SDK_DIR)
3190 AC_SUBST(SYMBIAN_SDK_DIR)
3194 dnl ========================================================
3195 dnl Generate output files.
3196 dnl ========================================================
3208 lib/libc/include/Makefile
3209 lib/libc/src/Makefile
3214 pr/include/md/Makefile
3215 pr/include/obsolete/Makefile
3216 pr/include/private/Makefile
3219 pr/src/linking/Makefile
3220 pr/src/malloc/Makefile
3222 pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3223 pr/src/memory/Makefile
3224 pr/src/misc/Makefile
3225 pr/src/threads/Makefile
3227 pr/tests/dll/Makefile
3230 if test "$OS_TARGET" = "Linux"; then
3231 MAKEFILES="$MAKEFILES
3234 elif test "$OS_TARGET" = "SunOS"; then
3235 MAKEFILES="$MAKEFILES
3236 pkg/solaris/Makefile
3237 pkg/solaris/SUNWpr/Makefile
3238 pkg/solaris/SUNWprd/Makefile
3242 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3243 MAKEFILES="$MAKEFILES
3244 pr/src/threads/combined/Makefile
3246 elif test -n "$USE_PTHREADS"; then
3247 MAKEFILES="$MAKEFILES
3248 pr/src/pthreads/Makefile
3250 elif test -n "$USE_BTHREADS"; then
3251 MAKEFILES="$MAKEFILES
3252 pr/src/bthreads/Makefile
3256 if test -n "$USE_CPLUS"; then
3257 MAKEFILES="$MAKEFILES
3258 pr/src/cplus/Makefile
3259 pr/src/cplus/tests/Makefile
3263 echo $MAKEFILES > unallmakefiles
3265 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])