1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
3 dnl This Source Code Form is subject to the terms of the Mozilla Public
4 dnl License, v. 2.0. If a copy of the MPL was not distributed with this
5 dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 AC_INIT(config/libc_r.h)
10 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
13 dnl ========================================================
15 dnl ========================================================
29 _MACOSX_DEPLOYMENT_TARGET=
34 OBJDIR='$(OBJDIR_NAME)'
37 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
38 NOSUCHFILE=/no-such-file
39 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
40 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
51 dnl Link in libraries necessary to resolve all symbols for shared libs
54 dnl ========================================================
56 dnl = Dont change the following lines. Doing so breaks:
58 dnl = CFLAGS="-foo" ./configure
60 dnl ========================================================
62 CXXFLAGS="${CXXFLAGS=}"
64 DLLFLAGS="${DLLFLAGS=}"
65 HOST_CFLAGS="${HOST_CFLAGS=}"
66 HOST_LDFLAGS="${HOST_LDFLAGS=}"
70 # Check to see if we are really running in a msvc environemnt
72 AC_CHECK_PROGS(CC, cl)
73 if test "$CC" = "cl"; then
74 echo 'main() { return 0; }' > dummy.c
75 ${CC} -o dummy dummy.c >/dev/null 2>&1
80 AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
82 rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
93 if test -n "$_WIN32_MSVC"; then
95 SKIP_COMPILER_CHECKS=1
99 dnl ========================================================
100 dnl = Android uses a very custom (hacky) toolchain; we need to do this
101 dnl = here, so that the compiler checks can succeed
102 dnl ========================================================
104 AC_ARG_WITH(android-ndk,
105 [ --with-android-ndk=DIR
106 location where the Android NDK can be found],
107 android_ndk=$withval)
109 AC_ARG_WITH(android-toolchain,
110 [ --with-android-toolchain=DIR
111 location of the Android toolchain],
112 android_toolchain=$withval)
114 dnl The default android_version is different for each target cpu.
115 case "$target_cpu" in
124 AC_ARG_WITH(android-version,
125 [ --with-android-version=VER
126 Android platform version, default 5 for arm, 9 for x86/mips],
127 android_version=$withval)
129 AC_ARG_WITH(android-platform,
130 [ --with-android-platform=DIR
131 location of platform dir],
132 android_platform=$withval)
135 arm-linux*-android*|*-linuxandroid*)
136 android_tool_prefix="arm-linux-androideabi"
139 android_tool_prefix="i686-linux-android"
142 android_tool_prefix="mipsel-linux-android"
145 android_tool_prefix="$target_os"
149 dnl ========================================================
150 dnl = Gonk is a fork of Android used for Mozilla's B2G project.
151 dnl = Configuration is done largely by the top level config
152 dnl = and the specified gonk directory doesn't matter here.
153 dnl ========================================================
156 [ --with-gonk=DIR location of gonk dir],
159 if test -n "$gonkdir" ; then
160 dnl Most things are directly configured by env vars when building for gonk
162 dnl prevent cross compile section from using these flags as host flags
163 if test -z "$HOST_CPPFLAGS" ; then
166 if test -z "$HOST_CFLAGS" ; then
169 if test -z "$HOST_CXXFLAGS" ; then
172 if test -z "$HOST_LDFLAGS" ; then
179 *-android*|*-linuxandroid*)
180 if test -z "$android_ndk" ; then
181 AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
184 if test -z "$android_toolchain" ; then
185 AC_MSG_CHECKING([for android toolchain directory])
187 kernel_name=`uname -s | tr "[[:upper:]]" "[[:lower:]]"`
189 case "$target_cpu" in
191 target_name=arm-linux-androideabi-4.4.3
194 target_name=x86-4.4.3
197 target_name=mipsel-linux-android-4.4.3
200 android_toolchain="$android_ndk"/toolchains/$target_name/prebuilt/$kernel_name-x86
202 if test -d "$android_toolchain" ; then
203 AC_MSG_RESULT([$android_toolchain])
205 AC_MSG_ERROR([not found. You have to specify --with-android-toolchain=/path/to/ndk/toolchain.])
209 if test -z "$android_platform" ; then
210 AC_MSG_CHECKING([for android platform directory])
212 case "$target_cpu" in
224 android_platform="$android_ndk"/platforms/android-"$android_version"/arch-"$target_name"
226 if test -d "$android_platform" ; then
227 AC_MSG_RESULT([$android_platform])
229 AC_MSG_ERROR([not found. You have to specify --with-android-platform=/path/to/ndk/platform.])
233 dnl Old NDK support. If minimum requirement is changed to NDK r8b,
234 dnl please remove this.
235 case "$target_cpu" in
237 if ! test -e "$android_toolchain"/bin/"$android_tool_prefix"-gcc; then
238 dnl Old NDK toolchain name
239 android_tool_prefix="i686-android-linux"
245 AS="$android_toolchain"/bin/"$android_tool_prefix"-as
246 CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
247 CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
248 CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
249 LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
250 AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
251 RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
252 STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
254 CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
255 CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
256 CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
257 LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
259 dnl prevent cross compile section from using these flags as host flags
260 if test -z "$HOST_CPPFLAGS" ; then
263 if test -z "$HOST_CFLAGS" ; then
266 if test -z "$HOST_CXXFLAGS" ; then
269 if test -z "$HOST_LDFLAGS" ; then
278 dnl ========================================================
280 dnl = Check options that may affect the compiler
282 dnl ========================================================
283 dist_prefix='${MOD_DEPTH}/dist'
284 dist_bindir='${dist_prefix}/bin'
285 dist_includedir='${dist_prefix}/include/nspr'
286 dist_libdir='${dist_prefix}/lib'
287 dnl If the --includedir option was not specified, add '/nspr' to autoconf's
288 dnl default value of includedir.
289 if test "${includedir}" = '${prefix}/include'; then
290 includedir='${prefix}/include/nspr'
293 AC_ARG_WITH(dist-prefix,
294 [ --with-dist-prefix=DIST_PREFIX
295 place build files in DIST_PREFIX [dist]],
296 dist_prefix=$withval)
298 AC_ARG_WITH(dist-bindir,
299 [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
300 dist_bindir=$withval)
302 AC_ARG_WITH(dist-includedir,
303 [ --with-dist-includedir=DIR
304 build include files in DIR [DIST_PREFIX/include/nspr]],
305 dist_includedir=$withval)
307 AC_ARG_WITH(dist-libdir,
308 [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
309 dist_libdir=$withval)
311 AC_SUBST(dist_prefix)
312 AC_SUBST(dist_bindir)
313 AC_SUBST(dist_includedir)
314 AC_SUBST(dist_libdir)
316 dnl Check if NSPR is being compiled for Mozilla
317 dnl Let --with-arg override environment setting
320 [ --with-mozilla Compile NSPR with Mozilla support],
321 [ if test "$withval" = "yes"; then
322 AC_DEFINE(MOZILLA_CLIENT)
327 [ if test -n "$MOZILLA_CLIENT"; then
328 AC_DEFINE(MOZILLA_CLIENT)
331 AC_ARG_ENABLE(optimize,
332 [ --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ],
333 [ if test "$enableval" != "no"; then
335 if test -n "$enableval" -a "$enableval" != "yes"; then
336 _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
337 _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
344 [ --enable-debug[=DBG] Enable debugging (using compiler flags DBG)],
345 [ if test "$enableval" != "no"; then
348 if test -n "$enableval" -a "$enableval" != "yes"; then
349 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
350 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
357 AC_ARG_ENABLE(debug-symbols,
358 [ --enable-debug-symbols[=DBG] Enable debugging symbols
359 (using compiler flags DBG)],
360 [ if test "$enableval" != "no"; then
362 if test -n "$enableval" -a "$enableval" != "yes"; then
363 if test -z "$_SAVE_DEBUG_FLAGS"; then
364 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
365 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
367 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
374 AC_ARG_ENABLE(win32-target,
375 [ --enable-win32-target=\$t
376 Specify win32 flavor. (WIN95 or WINNT)],
377 OS_TARGET=`echo $enableval | tr a-z A-Z`)
379 AC_ARG_ENABLE(symbian-target,
380 [ --enable-symbian-target=\$t
381 Specify symbian flavor. (WINSCW or GCCE)],
382 OS_TARGET=`echo $enableval | tr a-z A-Z`)
384 AC_ARG_ENABLE(debug-rtl,
385 [ --enable-debug-rtl Use the MSVC debug runtime library],
386 [ if test "$enableval" = "yes"; then
391 [ --enable-n32 Enable n32 ABI support (IRIX only)],
392 [ if test "$enableval" = "yes"; then
394 else if test "$enableval" = "no"; then
400 [ --enable-64bit Enable 64-bit support (on certain platforms)],
401 [ if test "$enableval" = "yes"; then
405 AC_ARG_ENABLE(mdupdate,
406 [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
407 [ if test "$enableval" = "yes"; then
412 [ --enable-cplus Enable some c++ api routines],
413 [ if test "$enableval" = "yes"; then
417 AC_ARG_WITH(arm-kuser,
418 [ --with-arm-kuser Use kuser helpers (Linux/ARM only)
419 (Requires kernel 2.6.13 or later)],
420 [ if test "$withval" = "yes"; then
421 AC_DEFINE(_PR_ARM_KUSER)
424 dnl ========================================================
425 dnl = Mac OS X SDK support
426 dnl ========================================================
427 AC_ARG_WITH(macos-sdk,
428 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
429 MACOS_SDK_DIR=$withval)
431 AC_ARG_ENABLE(macos-target,
432 [ --enable-macos-target=VER
433 Set the minimum MacOS version needed at runtime
434 [10.2 for ppc, 10.4 for x86]],
435 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
437 dnl ========================================================
439 dnl = Set the threading model
441 dnl ========================================================
445 case "${target_os}" in
457 dnl ========================================================
459 dnl = Set the default C compiler
461 dnl ========================================================
462 if test -z "$CC"; then
466 if test -z "$USE_NSPR_THREADS"; then
492 dnl ========================================================
494 dnl = Set the default C++ compiler
496 dnl ========================================================
497 if test -z "$CXX"; then
501 if test -z "$USE_NSPR_THREADS"; then
509 case "${target_os}" in
537 if test -z "$SKIP_PATH_CHECKS"; then
538 AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
541 if test -n "$MOZ_DEBUG"; then
543 DEFINES="$DEFINES -UNDEBUG"
545 case "${target_os}" in
547 DEFINES="$DEFINES -DDEBUG_${USER}"
549 msvc*|mks*|cygwin*|mingw*|wince*|winmo*|os2*)
550 DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
553 DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
558 DEFINES="$DEFINES -UDEBUG"
561 if test -z "$SKIP_COMPILER_CHECKS"; then
562 dnl ========================================================
563 dnl Checks for compilers.
564 dnl ========================================================
566 dnl Explicitly honor $CROSS_COMPILE to allow cross-compiling
567 dnl between toolkits on the same architecture, as when
568 dnl targeting the iOS Simulator from OS X.
569 if test "$target" != "$host" -o -n "$CROSS_COMPILE"; then
570 echo "cross compiling from $host to $target"
574 _SAVE_CFLAGS="$CFLAGS"
575 _SAVE_LDFLAGS="$LDFLAGS"
577 AC_MSG_CHECKING([for $host compiler])
578 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
579 if test -z "$HOST_CC"; then
580 AC_MSG_ERROR([no acceptable cc found in \$PATH])
582 AC_MSG_RESULT([$HOST_CC])
583 if test -z "$HOST_CFLAGS"; then
584 HOST_CFLAGS="$CFLAGS"
586 if test -z "$HOST_LDFLAGS"; then
587 HOST_LDFLAGS="$LDFLAGS"
591 CFLAGS="$HOST_CFLAGS"
592 LDFLAGS="$HOST_LDFLAGS"
594 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
595 AC_TRY_COMPILE([], [return 0;],
596 [AC_MSG_RESULT([yes])],
597 [AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.])] )
601 LDFLAGS=$_SAVE_LDFLAGS
603 case "$build:$target" in
604 powerpc-apple-darwin8*:i?86-apple-darwin*)
605 dnl The Darwin cross compiler doesn't necessarily point itself at a
606 dnl root that has libraries for the proper architecture, it defaults
607 dnl to the system root. The libraries in the system root on current
608 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
609 dnl checks will fail. Fake a working SDK in that case.
611 _SAVE_CXXFLAGS=$CXXFLAGS
612 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
613 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
615 *:arm*-apple-darwin*)
616 dnl The arm compiler doesn't appear to know about its root by default,
617 dnl so explicitly pass it one here. Later on we'll put this in CFLAGS
620 _SAVE_CXXFLAGS=$CXXFLAGS
621 CFLAGS="-isysroot $MACOS_SDK_DIR $CFLAGS"
622 CXXFLAGS="-isysroot $MACOS_SDK_DIR $CXXFLAGS"
626 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
629 if test -n "$USE_CPLUS"; then
630 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
635 case "$build:$target" in
636 powerpc-apple-darwin8*:i?86-apple-darwin*|*:arm*-apple-darwin*)
637 dnl Revert the changes made above. From this point on, the target
638 dnl compiler will never be used without applying the SDK to CFLAGS
639 dnl (see --with-macos-sdk below).
641 CXXFLAGS=$_SAVE_CXXFLAGS
645 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
646 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
647 AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
648 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
649 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
650 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
654 if test -n "$USE_CPLUS"; then
655 if test "$CC" = "cl" -a -z "$CXX"; then
663 AC_PATH_PROGS(AS, as, $CC)
664 AC_PATH_PROGS(AR, ar, echo not_ar)
665 AC_PATH_PROGS(LD, ld link, echo not_ld)
666 AC_PATH_PROGS(STRIP, strip, echo not_strip)
667 AC_PATH_PROGS(WINDRES, windres, echo not_windres)
668 if test -z "$HOST_CC"; then
671 if test -z "$HOST_CFLAGS"; then
672 HOST_CFLAGS="$CFLAGS"
676 if test "$GCC" = "yes"; then
679 if test "$GXX" = "yes"; then
682 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
687 case "$build:$target" in
688 i?86-apple-darwin*:powerpc-apple-darwin*)
689 dnl cross_compiling will have erroneously been set to "no" in this
690 dnl case, because the x86 build host is able to run ppc code in a
691 dnl translated environment, making a cross compiler appear native.
696 if test "$cross_compiling" = "yes"; then
702 dnl ========================================================
703 dnl Check for gcc -pipe support
704 dnl ========================================================
705 AC_MSG_CHECKING([for gcc -pipe support])
706 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
707 echo '#include <stdio.h>' > dummy-hello.c
708 echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
709 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
710 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
716 if test "$_res_as_stdin" = "yes"; then
718 CFLAGS="$CFLAGS -pipe"
719 AC_TRY_COMPILE( [ #include <stdio.h> ],
720 [printf("Hello World\n");],
721 [_res_gcc_pipe="yes"],
722 [_res_gcc_pipe="no"] )
725 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
727 CFLAGS="$CFLAGS -pipe"
728 CXXFLAGS="$CXXFLAGS -pipe"
732 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
733 AC_MSG_RESULT([$_res])
738 dnl ========================================================
739 dnl Profile guided optimization
740 dnl ========================================================
741 dnl Test for profiling options
742 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
744 _SAVE_CFLAGS="$CFLAGS"
745 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
747 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
748 AC_TRY_COMPILE([], [return 0;],
749 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
750 result="yes" ], result="no")
751 AC_MSG_RESULT([$result])
753 if test $result = "yes"; then
754 PROFILE_GEN_LDFLAGS="-fprofile-generate"
755 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
756 PROFILE_USE_LDFLAGS="-fprofile-use"
759 CFLAGS="$_SAVE_CFLAGS"
761 dnl ===============================================================
762 dnl Check for .hidden assembler directive and visibility attribute.
763 dnl Borrowed from glibc configure.in
764 dnl ===============================================================
765 if test "$GNU_CC"; then
766 AC_CACHE_CHECK(for visibility(hidden) attribute,
767 ac_cv_visibility_hidden,
768 [cat > conftest.c <<EOF
769 int foo __attribute__ ((visibility ("hidden"))) = 1;
771 ac_cv_visibility_hidden=no
772 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
773 if grep '\.hidden.*foo' conftest.s >/dev/null; then
774 ac_cv_visibility_hidden=yes
779 if test "$ac_cv_visibility_hidden" = "yes"; then
780 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
781 AC_CACHE_CHECK(for visibility pragma support,
782 ac_cv_visibility_pragma,
783 [cat > conftest.c <<EOF
784 #pragma GCC visibility push(hidden)
786 #pragma GCC visibility push(default)
789 ac_cv_visibility_pragma=no
790 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
791 if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
792 if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
793 ac_cv_visibility_pragma=yes
799 if test "$ac_cv_visibility_pragma" = "yes"; then
800 AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
801 # To work around a build problem on Linux x86-64 (Bugzilla bug
802 # 293438), we use the -fvisibility=hidden flag. This flag is less
803 # optimal than #pragma GCC visibility push(hidden) because the flag
804 # assumes that symbols defined outside the current source file have
805 # the default visibility. This has the advantage that we don't need
806 # to wrap system header files, but has the disadvantage that calls
807 # to hidden symbols defined in other source files cannot be
808 # optimized by the compiler. The -fvisibility=hidden flag does
809 # hide and export symbols correctly.
810 #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
811 #WRAP_SYSTEM_INCLUDES=1
812 VISIBILITY_FLAGS="-fvisibility=hidden"
813 WRAP_SYSTEM_INCLUDES=
818 fi # SKIP_COMPILER_CHECKS
820 dnl ========================================================
821 dnl Checks for programs.
822 dnl ========================================================
823 if test -z "$SKIP_PATH_CHECKS"; then
824 AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
825 elif test -z "$PERL"; then
829 dnl ========================================================
830 dnl Default platform specific options
831 dnl ========================================================
836 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
844 if test -n "$CROSS_COMPILE"; then
845 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
847 OS_TEST="${target_cpu}"
848 case "${target_os}" in
849 linux*) OS_ARCH=Linux ;;
850 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
851 mingw*) OS_ARCH=WINNT ;;
852 wince*) OS_ARCH=WINCE ;;
853 winmo*) OS_ARCH=WINCE ;;
854 darwin*) OS_ARCH=Darwin ;;
855 riscos*) OS_ARCH=RISCOS ;;
858 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
859 OS_RELEASE=`uname -r`
863 if test "$OS_ARCH" = "IRIX64"; then
867 if test "$OS_ARCH" = "AIX"; then
868 OS_RELEASE=`uname -v`.`uname -r`
871 if test "$OS_ARCH" = "FreeBSD"; then
872 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
875 if test "$OS_ARCH" = "Linux"; then
876 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
877 OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
880 #######################################################################
881 # Master "Core Components" macros for getting the OS target #
882 #######################################################################
885 # Note: OS_TARGET should be specified on the command line for gmake.
886 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
887 # The difference between the Win95 target and the WinNT target is that
888 # the WinNT target uses Windows NT specific features not available
889 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
890 # at lesser performance (the Win95 target uses threads; the WinNT target
893 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
898 # The following hack allows one to build on a WIN95 machine (as if
899 # s/he were cross-compiling on a WINNT host for a WIN95 target).
900 # It also accomodates for MKS's uname.exe. If you never intend
901 # to do development on a WIN95 machine, you don't need this hack.
916 CYGWIN_9*|CYGWIN_ME*)
917 OS_ARCH='CYGWIN_NT-4.0'
927 # On WIN32, we also define the variable CPU_ARCH.
933 if test "$CPU_ARCH" = "I386"; then
939 # If uname -s returns "Windows_NT", we assume that we are using
940 # the uname.exe in MKS toolkit.
942 # The -r option of MKS uname only returns the major version number.
943 # So we need to use its -v option to get the minor version number.
944 # Moreover, it doesn't have the -p option, so we need to use uname -m.
947 OS_MINOR_RELEASE=`uname -v`
948 if test "$OS_MINOR_RELEASE" = "00"; then
951 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
954 # MKS's uname -m returns "586" on a Pentium machine.
956 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
960 CYGWIN_NT*|MINGW*_NT*)
962 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
963 # the uname.exe in the Cygwin tools.
964 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
965 # the uname.exe in the MSYS tools.
967 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
971 # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
973 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
979 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
981 if test -n "$MOZ_DEBUG"; then
985 if test -z "$OS_TARGET"; then
988 if test "$OS_TARGET" = "WIN95"; then
991 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
993 dnl ========================================================
994 dnl Enable high-memory support on OS/2 by default.
995 dnl ========================================================
996 AC_ARG_ENABLE(os2-high-mem,
997 [ --disable-os2-high-mem Disable high-memory support on OS/2],
998 [ if test "$enableval" = "no"; then
1001 MOZ_OS2_HIGH_MEMORY=1
1004 dnl ========================================================
1005 dnl = ARM toolchain tweaks
1006 dnl ========================================================
1010 arm*-android*|arm*-linuxandroid*)
1014 MOZ_FLOAT_ABI=softfp
1018 if test -n "$MOZ_PLATFORM_MAEMO"; then
1021 MOZ_FLOAT_ABI=softfp
1023 if test "$MOZ_PLATFORM_MAEMO" = 6; then
1029 dnl Kept for compatibility with some buildbot mozconfig
1030 AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval)
1033 [ --with-thumb[[=yes|no|toolchain-default]]]
1034 [ Use Thumb instruction set (-mthumb)],
1035 if test -z "$GNU_CC"; then
1036 AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults])
1040 AC_ARG_WITH(thumb-interwork,
1041 [ --with-thumb-interwork[[=yes|no|toolchain-default]]
1042 Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
1043 if test -z "$GNU_CC"; then
1044 AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults])
1046 MOZ_THUMB_INTERWORK=$withval)
1049 [ --with-arch=[[type|toolchain-default]]
1050 Use specific CPU features (-march=type)],
1051 if test -z "$GNU_CC"; then
1052 AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults])
1057 [ --with-fpu=[[type|toolchain-default]]
1058 Use specific FPU type (-mfpu=type)],
1059 if test -z "$GNU_CC"; then
1060 AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults])
1064 AC_ARG_WITH(float-abi,
1065 [ --with-float-abi=[[type|toolchain-default]]
1066 Use specific arm float ABI (-mfloat-abi=type)],
1067 if test -z "$GNU_CC"; then
1068 AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults])
1070 MOZ_FLOAT_ABI=$withval)
1072 AC_ARG_WITH(soft-float,
1073 [ --with-soft-float[[=yes|no|toolchain-default]]
1074 Use soft float library (-msoft-float)],
1075 if test -z "$GNU_CC"; then
1076 AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults])
1078 MOZ_SOFT_FLOAT=$withval)
1081 toolchain-default|"")
1085 arch_flag="-march=$MOZ_ARCH"
1089 case "$MOZ_THUMB" in
1092 thumb_flag="-mthumb"
1099 _SAVE_CFLAGS="$CFLAGS"
1101 AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
1104 CFLAGS="$_SAVE_CFLAGS"
1109 case "$MOZ_THUMB_INTERWORK" in
1111 thumb_interwork_flag="-mthumb-interwork"
1114 thumb_interwork_flag="-mno-thumb-interwork"
1116 *) # toolchain-default
1117 thumb_interwork_flag=""
1122 toolchain-default|"")
1126 fpu_flag="-mfpu=$MOZ_FPU"
1130 case "$MOZ_FLOAT_ABI" in
1131 toolchain-default|"")
1135 float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
1139 case "$MOZ_SOFT_FLOAT" in
1141 soft_float_flag="-msoft-float"
1144 soft_float_flag="-mno-soft-float"
1146 *) # toolchain-default
1151 dnl Use echo to avoid accumulating space characters
1152 all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
1153 if test -n "$all_flags"; then
1154 _SAVE_CFLAGS="$CFLAGS"
1156 AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
1157 AC_TRY_COMPILE([],[return 0;],
1158 AC_MSG_RESULT([yes]),
1161 CFLAGS="$_SAVE_CFLAGS $all_flags"
1162 CXXFLAGS="$CXXFLAGS $all_flags"
1163 ASFLAGS="$ASFLAGS $all_flags"
1164 if test -n "$thumb_flag"; then
1165 LDFLAGS="$LDFLAGS $thumb_flag"
1169 dnl ========================================================
1170 dnl Override of system specific host options
1171 dnl ========================================================
1176 *-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*)
1177 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
1178 if test `echo "${PATH}" | grep -c \;` = 0; then
1179 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
1183 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
1188 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1192 dnl ========================================================
1193 dnl Override of system specific target options
1194 dnl ========================================================
1201 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
1202 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
1203 case "${target_os}" in
1205 AC_DEFINE(AIX_RENAME_SELECT)
1206 AC_DEFINE(_PR_NO_LARGE_FILES)
1207 AIX_LINK_OPTS='-bnso -berok'
1208 PR_MD_ASFILES=os_AIX.s
1211 AC_DEFINE(AIX_TIMERS)
1212 AC_DEFINE(_PR_NO_LARGE_FILES)
1216 AIX_LINK_OPTS='-bnso -berok'
1217 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
1218 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
1221 AC_DEFINE(AIX_TIMERS)
1222 AC_DEFINE(_PR_HAVE_OFF64_T)
1223 AIX_LINK_OPTS='-brtl -bnso -berok'
1226 AC_DEFINE(AIX_TIMERS)
1227 AC_DEFINE(_PR_HAVE_OFF64_T)
1228 AC_DEFINE(AIX4_3_PLUS)
1229 AC_DEFINE(HAVE_SOCKLEN_T)
1230 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1232 AIX_LINK_OPTS='-brtl -bnso -berok'
1235 AC_DEFINE(AIX_TIMERS)
1236 AC_DEFINE(_PR_HAVE_OFF64_T)
1237 AC_DEFINE(AIX4_3_PLUS)
1238 AC_DEFINE(HAVE_SOCKLEN_T)
1239 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1241 AIX_LINK_OPTS='-brtl -bnso -berok'
1244 CFLAGS="$CFLAGS -qro -qroconst"
1245 AIX_WRAP='$(DIST)/lib/aixwrap.o'
1246 AIX_TMP='./_aix_tmp.o'
1247 if test -n "$USE_64"; then
1248 MDCPUCFG_H=_aix64.cfg
1251 MDCPUCFG_H=_aix32.cfg
1254 RESOLVE_LINK_SYMBOLS=1
1261 AC_DEFINE(_POSIX_SOURCE)
1263 MDCPUCFG_H=_beos.cfg
1266 RESOLVE_LINK_SYMBOLS=1
1267 case "${target_cpu}" in
1270 _DEBUG_FLAGS='-gdwarf-2 -O0'
1271 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1272 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1278 DSO_LDOPTS='-xms -export pragma -init _init_routine_ -term _term_routine_ -lroot -lnet /boot/develop/lib/ppc/glue-noinit.a /boot/develop/lib/ppc/init_term_dyn.o /boot/develop/lib/ppc/start_dyn.o'
1280 _DEBUG_FLAGS='-g -O0'
1288 AC_DEFINE(NEED_BSDREGEX)
1290 CFLAGS="$CFLAGS -Wall -Wno-format"
1291 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1293 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1295 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1299 MDCPUCFG_H=_bsdi.cfg
1304 case "$target_os" in
1306 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1307 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1308 AC_DEFINE(_PR_NEED_H_ERRNO)
1315 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1316 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1318 AC_DEFINE(USE_DLFCN)
1319 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1320 PR_MD_ASFILES=os_BSD_OS_386_2.s
1324 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1325 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1327 AC_DEFINE(USE_DLFCN)
1328 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1329 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1331 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1333 case "$target_os" in
1334 bsdi4.2* | bsdi4.3* | bsdi5.*)
1335 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1336 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1341 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1342 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1344 AC_DEFINE(USE_DLFCN)
1345 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1354 AC_DEFINE(HAVE_BSD_FLOCK)
1355 AC_DEFINE(HAVE_SOCKLEN_T)
1356 AS='$(CC) -x assembler-with-cpp'
1357 CFLAGS="$CFLAGS -Wall -fno-common"
1358 case "${target_cpu}" in
1363 if test -n "$USE_64"; then
1376 if test "`echo $CC | grep -c '\-arch '`" = "0"; then
1377 CC="$CC -arch $CPU_ARCH"
1379 AC_CHECK_HEADER(crt_externs.h)
1381 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1383 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1384 STRIP="$STRIP -x -S"
1387 MDCPUCFG_H=_darwin.cfg
1388 PR_MD_CSRCS=darwin.c
1389 PR_MD_ASFILES=os_Darwin.s
1391 # Add Mac OS X support for loading CFM & CFBundle plugins
1392 if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1393 AC_DEFINE(XP_MACOSX)
1396 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1397 dnl Use the specified value
1398 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1399 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1400 dnl No value specified on the command line or in the environment,
1401 dnl use the lesser of the library's minimum or the architecture's
1403 case "${target_cpu}" in
1405 dnl Architecture minimum 10.2
1406 export MACOSX_DEPLOYMENT_TARGET=10.2
1409 dnl Architecture minimum 10.4
1410 export MACOSX_DEPLOYMENT_TARGET=10.4
1415 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1416 dnl in use. NEXT_ROOT will be set and exported if it's needed for
1419 if test "$MACOS_SDK_DIR"; then
1420 dnl Sync this section with the one in Mozilla's top level.
1422 if test ! -d "$MACOS_SDK_DIR"; then
1423 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1424 specify a valid SDK. SDKs are installed when the optional cross-development
1425 tools are selected during the Xcode/Developer Tools installation.])
1429 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1430 GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1431 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1433 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1434 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1435 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1436 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1437 SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1440 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1442 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1444 dnl CPP needs to be set for AC_CHECK_HEADER.
1445 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1448 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1450 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1451 dnl The build host is running Tiger (10.4) or earlier.
1452 dnl ld support for -syslibroot is compiler-agnostic, but
1453 dnl only available on Tiger and later. On Tiger and
1454 dnl earlier build hosts, just rely on NEXT_ROOT, because
1455 dnl it's not been shown to cause any problems.
1456 MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}"
1458 dnl The build host is running Leopard (10.5) or later.
1459 dnl With NEXT_ROOT set, the linker will still not apply
1460 dnl it when resolving dependencies. This causes problems
1461 dnl on Leopard, where an SDK depends on frameworks which
1462 dnl were present in earlier OS releases (and the associated
1463 dnl SDK) but not in Leopard. -syslibroot does not have
1464 dnl this problem, but it results in harmless warnings when
1465 dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1466 dnl on Leopard because the compiler uses it too.
1467 MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1470 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1471 export NEXT_ROOT=$MACOS_SDK_DIR
1473 if test -n "$CROSS_COMPILE" ; then
1474 dnl NEXT_ROOT will be in the environment, but it
1475 dnl shouldn't be set for the build host. HOST_CXX is
1476 dnl presently unused.
1477 HOST_CC="NEXT_ROOT= $HOST_CC"
1478 HOST_CXX="NEXT_ROOT= $HOST_CXX"
1481 dnl gcc >= 4.0 uses different paths than above, but knows
1482 dnl how to find them itself.
1483 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1485 dnl CPP needs to be set for AC_CHECK_HEADER.
1486 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1488 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1489 dnl has an ld that supports -syslibroot. Don't set
1490 dnl NEXT_ROOT because it will be ignored and cause
1491 dnl warnings when -syslibroot is specified.
1492 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1493 dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1494 dnl based on the -isysroot it receives.
1495 LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1497 dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1499 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1508 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1512 AC_DEFINE(_DGUX_SOURCE)
1513 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1517 MDCPUCFG_H=_dgux.cfg
1522 if test -z "$USE_NSPR_THREADS"; then
1527 AC_DEFINE(HAVE_BSD_FLOCK)
1528 AC_DEFINE(HAVE_SOCKLEN_T)
1529 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1530 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1531 if test "$MOZ_OBJFORMAT" = "elf"; then
1536 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1538 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1539 MDCPUCFG_H=_freebsd.cfg
1540 PR_MD_CSRCS=freebsd.c
1546 AC_DEFINE(_HPUX_SOURCE)
1547 # OSF1 and HPUX report the POLLHUP event for a socket when the
1548 # shutdown(SHUT_WR) operation is called for the remote end, even though
1549 # the socket is still writeable. Use select(), instead of poll(), to
1550 # workaround this problem.
1551 AC_DEFINE(_PR_POLL_WITH_SELECT)
1552 AC_DEFINE(_USE_BIG_FDS)
1553 DSO_LDOPTS='-b +h $(notdir $@)'
1555 if test "$OS_TEST" = "ia64"; then
1557 DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1558 CPU_ARCH_TAG=_$OS_TEST
1559 if test -z "$USE_64"; then
1562 PR_MD_ASFILES=os_HPUX_ia64.s
1566 PR_MD_ASFILES=os_HPUX.s
1568 if test -n "$USE_64"; then
1569 MDCPUCFG_H=_hpux64.cfg
1571 MDCPUCFG_H=_hpux32.cfg
1573 if test -z "$GNU_CC"; then
1579 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1582 if test -n "$MOZILLA_CLIENT"; then
1583 DEFAULT_IMPL_STRATEGY=_EMU
1586 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1587 AC_DEFINE(_PR_NEED_H_ERRNO)
1589 DEFAULT_IMPL_STRATEGY=_EMU
1593 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1594 AC_DEFINE(_PR_NO_LARGE_FILES)
1597 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1598 AC_DEFINE(_PR_NEED_H_ERRNO)
1601 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1602 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1605 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1606 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1609 # HP-UX 11i v2 (B.11.23) or higher
1611 case "$OS_RELEASE" in
1612 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1618 if test "$OS_RELEASE" = "B.10.01"; then
1620 DEFAULT_IMPL_STRATEGY=_EMU
1623 if test "$OS_RELEASE" = "B.10.10"; then
1625 AC_DEFINE(HPUX10_10)
1626 DEFAULT_IMPL_STRATEGY=_PTH
1629 if test "$OS_RELEASE" = "B.10.20"; then
1631 AC_DEFINE(HPUX10_20)
1632 if test -z "$GNU_CC"; then
1633 CFLAGS="$CFLAGS +DAportable +DS1.1"
1634 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1636 DEFAULT_IMPL_STRATEGY=_PTH
1639 if test "$OS_RELEASE" = "B.10.30"; then
1641 AC_DEFINE(HPUX10_30)
1642 if test -z "$GNU_CC"; then
1643 CFLAGS="$CFLAGS +DAportable +DS1.1"
1644 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1646 DEFAULT_IMPL_STRATEGY=_PTH
1649 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1652 AC_DEFINE(_LARGEFILE64_SOURCE)
1653 AC_DEFINE(_PR_HAVE_OFF64_T)
1654 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1655 if test -z "$GNU_CC"; then
1656 if test -z "$USE_64"; then
1657 if test "$OS_TEST" = "ia64"; then
1658 CFLAGS="$CFLAGS +DD32"
1659 CXXFLAGS="$CXXFLAGS +DD32"
1661 CFLAGS="$CFLAGS +DAportable +DS2.0"
1662 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1665 if test "$OS_TEST" = "ia64"; then
1666 CFLAGS="$CFLAGS +DD64"
1667 CXXFLAGS="$CXXFLAGS +DD64"
1669 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1670 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1674 DEFAULT_IMPL_STRATEGY=_PTH
1677 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1681 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1683 if test "$USE_NSPR_THREADS"; then
1686 if test "$USE_USER_PTHREADS"; then
1696 AC_DEFINE(_SGI_MP_SOURCE)
1697 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1699 PR_MD_ASFILES=os_Irix.s
1700 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1702 RESOLVE_LINK_SYMBOLS=1
1703 if test -n "$USE_64"; then
1704 MDCPUCFG_H=_irix64.cfg
1706 MDCPUCFG_H=_irix32.cfg
1708 case "${target_os}" in
1725 if test "$GNU_CC"; then
1727 dnl If we are using gcc with native binutils, we need to
1729 dnl #lineno "filename" num num
1730 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1731 dnl gcc command line, which passes -P to the preprocessor.
1733 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1734 CFLAGS="$CFLAGS -Wall -Wno-format"
1735 _OPTIMIZE_FLAGS="-O6"
1737 if test -n "$USE_N32"; then
1738 AS='as -D_ASM $(INCLUDES) -n32'
1740 AS='as -D_ASM $(INCLUDES)'
1742 CFLAGS="$CFLAGS -fullwarn -xansi"
1743 if test "$USE_N32"; then
1744 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1746 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1748 if test "$USE_MDUPDATE"; then
1749 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1753 CFLAGS="$CFLAGS -multigot"
1754 DSO_LDOPTS="-no_unresolved"
1755 if test "$USE_N32"; then
1756 CFLAGS="$CFLAGS -n32 -woff 1209"
1757 DSO_LDOPTS="$DSO_LDOPTS -n32"
1759 if test "$USE_64"; then
1760 CFLAGS="$CFLAGS -64"
1762 CFLAGS="$CFLAGS -32"
1767 CFLAGS="$CFLAGS -xgot"
1771 if test "${target_os}" = "irix5.3"; then
1774 case "${target_os}" in
1776 if test -z "$GNU_CC"; then
1777 CFLAGS="$CFLAGS -mips3"
1779 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1780 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1781 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1786 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1791 *-linux*|*-gnu*|*-k*bsd*-gnu|*-android*|*-linuxandroid*)
1792 if test -z "$USE_NSPR_THREADS"; then
1797 AC_DEFINE(_GNU_SOURCE)
1798 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1800 *-android*|*-linuxandroid*)
1808 CFLAGS="$CFLAGS -Wall"
1809 CXXFLAGS="$CXXFLAGS -Wall"
1810 MDCPUCFG_H=_linux.cfg
1812 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1814 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1816 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1817 # combo is not yet good at debugging inlined
1818 # functions (even when using DWARF2 as the
1821 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1826 CPU_ARCH_TAG=_${CPU_ARCH}
1827 case "${target_cpu}" in
1831 CFLAGS="$CFLAGS -mieee"
1832 CXXFLAGS="$CXXFLAGS -mieee"
1836 PR_MD_ASFILES=os_Linux_x86.s
1839 PR_MD_ASFILES=os_Linux_ia64.s
1842 if test -n "$USE_64"; then
1843 PR_MD_ASFILES=os_Linux_x86_64.s
1846 PR_MD_ASFILES=os_Linux_x86.s
1852 PR_MD_ASFILES=os_Linux_ppc.s
1855 if test -n "$USE_64"; then
1859 PR_MD_ASFILES=os_Linux_ppc.s
1863 CFLAGS="$CFLAGS -m68020-60"
1864 CXXFLAGS="$CXXFLAGS -m68020-60"
1869 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1872 PR_MD_ARCH_DIR=windows
1873 RESOLVE_LINK_SYMBOLS=1
1875 if test -n "$GNU_CC"; then
1877 CXX="$CXX -mwindows"
1879 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1881 # Use temp file for windres (bug 213281)
1882 RCFLAGS='-O coff --use-temp-file'
1887 AR='lib -NOLOGO -OUT:"$@"'
1889 RANLIB='echo not_ranlib'
1890 STRIP='echo not_strip'
1892 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1897 # Determine compiler version
1899 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1901 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1902 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1903 _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1904 _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1905 _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1906 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1908 if test "$_CC_MAJOR_VERSION" -eq "14"; then
1909 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1910 dnl so be very specific here!
1911 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1912 if test $_CC_RELEASE -gt 50727; then
1914 elif test $_CC_BUILD -ge 762; then
1917 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
1918 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
1919 elif test $_CC_MAJOR_VERSION -ge 15; then
1921 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
1922 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
1925 if test -n "$_USE_DYNAMICBASE"; then
1926 DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1929 # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1930 # tape manipulation utility (or something else)
1931 if test "$MSC_VER" -ge "1400"; then
1933 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1936 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1937 if test -n "$MSMT_TOOL"; then
1938 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1939 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1940 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1945 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1949 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1950 DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1954 PROFILE_GEN_CFLAGS="-GL"
1955 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1956 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1957 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1959 if test -z "$MOZ_OPTIMIZE"; then
1960 CFLAGS="$CFLAGS -Od"
1963 if test -n "$USE_DEBUG_RTL"; then
1964 CFLAGS="$CFLAGS -MDd"
1966 CFLAGS="$CFLAGS -MD"
1969 if test -n "$MOZ_DEBUG"; then
1972 DEFINES="$DEFINES -U_DEBUG"
1975 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1976 if test -n "$MOZ_OPTIMIZE"; then
1977 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1978 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1980 DLLFLAGS="$DLLFLAGS -DEBUG"
1981 LDFLAGS="$LDFLAGS -DEBUG"
1985 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1986 if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1987 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
1990 if test "$OS_TARGET" = "WINNT"; then
1991 CFLAGS="$CFLAGS -GT"
1992 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1993 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1995 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1996 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2000 if test -n "$USE_STATIC_TLS"; then
2001 AC_DEFINE(_PR_USE_STATIC_TLS)
2004 if test "$OS_TARGET" = "WINNT"; then
2008 # undefine WINNT as some versions of mingw gcc define it by default
2009 DEFINES="$DEFINES -UWINNT"
2010 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2013 if test "$CPU_ARCH" = "x86"; then
2016 CPU_ARCH_TAG=$CPU_ARCH
2019 if test -n "$USE_DEBUG_RTL"; then
2023 case "$OS_TARGET" in
2025 MDCPUCFG_H=_winnt.cfg
2028 MDCPUCFG_H=_win95.cfg
2031 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
2035 case "$target_cpu" in
2037 if test -n "$USE_64"; then
2052 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2061 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2063 AR_FLAGS='-NOLOGO -OUT:"$@"'
2068 MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
2070 PR_MD_ARCH_DIR=windows
2071 RESOLVE_LINK_SYMBOLS=1
2073 MDCPUCFG_H=_win95.cfg
2074 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2075 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2077 DLLFLAGS='-OUT:"$@"'
2078 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2079 OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2080 OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
2081 DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
2090 AC_DEFINE(HAVE_BSD_FLOCK)
2091 if test -z "$USE_NSPR_THREADS"; then
2094 MDCPUCFG_H=_netbsd.cfg
2095 PR_MD_CSRCS=netbsd.c
2097 DSO_CFLAGS='-fPIC -DPIC'
2098 CFLAGS="$CFLAGS -ansi -Wall"
2099 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2100 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
2102 if test -z "$OBJECT_FMT"; then
2103 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
2106 DSO_LDOPTS='-shared'
2110 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
2114 if test "$LIBRUNPATH"; then
2115 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
2122 AC_DEFINE(_QNX_SOURCE)
2123 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2126 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
2129 OS_LIBS="$OS_LIBS -lsocket"
2130 _OPTIMIZE_FLAGS="-O1"
2131 _DEBUG_FLAGS="-gstabs"
2137 AC_DEFINE(HAVE_BSD_FLOCK)
2138 AC_DEFINE(HAVE_SOCKLEN_T)
2139 CFLAGS="$CFLAGS -ansi -Wall"
2140 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2143 MDCPUCFG_H=_openbsd.cfg
2144 PR_MD_CSRCS=openbsd.c
2146 if test -z "$USE_NSPR_THREADS"; then
2149 DSO_LDOPTS='-shared -fPIC'
2150 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2154 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2157 AC_DEFINE(_REENTRANT)
2158 # OSF1 and HPUX report the POLLHUP event for a socket when the
2159 # shutdown(SHUT_WR) operation is called for the remote end, even though
2160 # the socket is still writeable. Use select(), instead of poll(), to
2161 # workaround this problem.
2162 AC_DEFINE(_PR_POLL_WITH_SELECT)
2164 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2168 if test -z "$GNU_CC"; then
2169 CC="$CC -std1 -ieee_with_inexact"
2170 if test "$OS_RELEASE" != "V2.0"; then
2171 CC="$CC -readonly_strings"
2173 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2174 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2176 CFLAGS="$CFLAGS -mieee"
2177 CXXFLAGS="$CXXFLAGS -mieee"
2180 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2181 AC_DEFINE(HAVE_INT_LOCALTIME_R)
2183 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2184 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2186 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2187 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2189 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2190 MDCPUCFG_H=_osf1.cfg
2197 AC_DEFINE(_PR_NEED_H_ERRNO)
2206 AC_DEFINE(_PR_NEED_H_ERRNO)
2208 MDCPUCFG_H=_riscos.cfg
2209 PR_MD_CSRCS=riscos.c
2211 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2212 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2221 AC_DEFINE(_PR_NEED_H_ERRNO)
2222 CC='cc -b elf -KPIC'
2223 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2226 DSO_LDOPTS='-b elf -G'
2227 MDCPUCFG_H=_scoos.cfg
2232 if test -z "$USE_NSPR_THREADS"; then
2241 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2243 MDCPUCFG_H=_solaris.cfg
2244 PR_MD_CSRCS=solaris.c
2246 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2247 RESOLVE_LINK_SYMBOLS=1
2248 case "${OS_RELEASE}" in
2252 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2256 if test -n "$GNU_CC"; then
2258 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2261 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2262 if test -n "$USE_B_DIRECT"; then
2263 DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2267 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2268 if test -n "$USE_B_DIRECT"; then
2269 DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2272 if test -n "$GNU_CC"; then
2273 CFLAGS="$CFLAGS -Wall"
2274 CXXFLAGS="$CXXFLAGS -Wall"
2275 if test -n "$USE_MDUPDATE"; then
2276 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2277 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2279 GCC_AS=`$CC -print-prog-name=as`
2280 if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2284 CFLAGS="$CFLAGS -xstrconst"
2285 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2286 if test -z "$MOZ_OPTIMIZE"; then
2287 CFLAGS="$CFLAGS -xs"
2288 CXXFLAGS="$CXXFLAGS -xs"
2290 _OPTIMIZE_FLAGS=-xO4
2292 if test -z "$GNU_AS"; then
2293 ASFLAGS="$ASFLAGS -Wa,-P"
2295 if test -n "$USE_64"; then
2296 if test -n "$GNU_CC"; then
2300 if test "$OS_TEST" = "i86pc"; then
2301 CC="$CC -xarch=amd64"
2302 CXX="$CXX -xarch=amd64"
2305 CXX="$CXX -xarch=v9"
2309 if test "$OS_TEST" = "i86pc"; then
2310 if test -z "$USE_64"; then
2313 CPU_ARCH_TAG=_$OS_TEST
2314 # The default debug format, DWARF (-g), is not supported by gcc
2315 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
2316 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2317 # If your gcc uses GNU as, you do not need the -Wa,-s option.
2318 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2319 _DEBUG_FLAGS=-gstabs
2320 if test -z "$GNU_AS"; then
2321 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2325 case "${target_os}" in
2327 AC_DEFINE(_PR_NO_LARGE_FILES)
2330 AC_DEFINE(_PR_NO_LARGE_FILES)
2333 AC_DEFINE(SOLARIS2_5)
2336 AC_DEFINE(_PR_HAVE_OFF64_T)
2337 # The lfcompile64(5) man page on Solaris 2.6 says:
2338 # For applications that do not wish to conform to the POSIX or
2339 # X/Open specifications, the 64-bit transitional interfaces
2340 # are available by default. No compile-time flags need to be
2342 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2343 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2344 if test -n "$GNU_CC"; then
2345 AC_DEFINE(_LARGEFILE64_SOURCE)
2349 case "${target_os}" in
2361 # Solaris 8 or higher has IPv6.
2362 AC_DEFINE(_PR_INET6)
2365 if test "$CPU_ARCH" = "sparc"; then
2366 # 64-bit Solaris SPARC requires V9 architecture, so the following
2368 if test -z "$USE_64"; then
2369 ULTRASPARC_LIBRARY=nspr_flt
2372 # Purify requires that binaries linked against nspr also
2373 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2375 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2376 OS_LIBS="$OS_LIBS $_librt"
2385 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2386 AC_DEFINE(_PR_NO_LARGE_FILES)
2387 CC='$(NSDEPTH)/build/hcc cc'
2388 CXX='$(NSDEPTH)/build/hcpp CC'
2389 MDCPUCFG_H=_unixware.cfg
2391 AC_DEFINE(_LARGEFILE64_SOURCE)
2392 AC_DEFINE(_PR_HAVE_OFF64_T)
2393 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2394 MDCPUCFG_H=_unixware7.cfg
2396 PR_MD_CSRCS=unixware.c
2402 AC_ARG_WITH(symbian-sdk,
2403 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
2404 The path to the Symbian SDK],
2405 SYMBIAN_SDK_DIR=$withval)
2407 echo -----------------------------------------------------------------------------
2408 echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2409 echo -----------------------------------------------------------------------------
2414 AC_DEFINE(__SYMBIAN32__)
2417 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2418 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2419 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2420 AC_DEFINE(HAVE_SOCKLEN_T)
2428 MDCPUCFG_H=_symbian.cfg
2429 PR_MD_CSRCS=symbian.c
2431 RANLIB='echo no ranlib '
2434 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2435 CFLAGS="$CFLAGS -MD -nostdinc"
2436 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2437 echo -------------------------------------------------------
2438 echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2439 echo -------------------------------------------------------
2440 case "$OS_TARGET" in
2446 WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2447 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)"
2448 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2449 AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2453 AC_DEFINE(__WINSCW__)
2454 DEFINES="$DEFINES -U_WIN32"
2457 CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2458 CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2459 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2462 DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2465 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2468 CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2474 AC_DEFINE(BSD_SELECT)
2475 AC_DEFINE(TCPV40HDRS)
2483 RESOLVE_LINK_SYMBOLS=1
2488 CFLAGS="$CFLAGS -Wall -Zomf"
2489 CXXFLAGS="$CFLAGS -Wall -Zomf"
2490 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2492 DSO_LDOPTS='-Zomf -Zdll'
2494 _OPTIMIZE_FLAGS="-O2 -s"
2495 _DEBUG_FLAGS="-g -fno-inline"
2496 if test -n "$MOZ_OPTIMIZE"; then
2497 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2501 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2502 LDFLAGS="$LDFLAGS -Zhigh-mem"
2503 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2506 # GCC for OS/2 currently predefines these, but we don't want them
2507 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2516 if test -z "$SKIP_LIBRARY_CHECKS"; then
2517 dnl ========================================================
2518 dnl Check for system libraries
2519 dnl ========================================================
2520 dnl AC_CHECK_LIB(C, main)
2521 dnl AC_CHECK_LIB(C_r, main)
2522 dnl AC_CHECK_LIB(c, main)
2523 dnl AC_CHECK_LIB(c_r, main)
2524 dnl AC_CHECK_LIB(dce, main)
2525 dnl AC_CHECK_LIB(dl, main)
2526 dnl AC_CHECK_LIB(dld, main)
2527 dnl AC_CHECK_LIB(gen, main)
2528 dnl AC_CHECK_LIB(ip6, main)
2529 dnl AC_CHECK_LIB(l, main)
2530 dnl AC_CHECK_LIB(m, main)
2531 dnl AC_CHECK_LIB(nsl, main)
2532 dnl AC_CHECK_LIB(posix4, main)
2533 dnl AC_CHECK_LIB(prstrms, main)
2534 dnl AC_CHECK_LIB(prstrms_shr, main)
2535 dnl AC_CHECK_LIB(pthread, main)
2536 dnl AC_CHECK_LIB(pthreads, main)
2537 dnl AC_CHECK_LIB(resolv, main)
2538 dnl AC_CHECK_LIB(rt, main)
2539 dnl AC_CHECK_LIB(socket, main)
2540 dnl AC_CHECK_LIB(svld, main)
2541 dnl AC_CHECK_LIB(thread, main)
2542 dnl AC_CHECK_LIB(vms_jackets, main)
2545 dnl We don't want anything to link with libdl even if it's present on OS X,
2546 dnl since it's not used and not part of the default installation.
2547 dnl The same goes for BeOS.
2548 dnl OS/2 has dlfcn in libc.
2551 *-darwin*|*-beos*|*-os2*)
2554 AC_CHECK_LIB(dl, dlopen,
2555 [AC_CHECK_HEADER(dlfcn.h,
2556 OS_LIBS="-ldl $OS_LIBS")])
2561 dnl ========================================================
2562 dnl Check for system header files.
2563 dnl ========================================================
2564 dnl AC_HEADER_DIRENT
2566 dnl AC_HEADER_SYS_WAIT
2567 dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2569 dnl ========================================================
2570 dnl Check for typedefs and structs
2571 dnl ========================================================
2578 dnl AC_STRUCT_ST_BLKSIZE
2579 dnl AC_STRUCT_ST_BLOCKS
2580 dnl AC_STRUCT_ST_RDEV
2584 dnl ========================================================
2585 dnl Checks for library functions.
2586 dnl ========================================================
2587 AC_PROG_GCC_TRADITIONAL
2589 LIBS="$LIBS $OS_LIBS"
2590 AC_CHECK_FUNCS(dladdr gettid lchown setpriority strerror syscall)
2595 dnl AC_FUNC_SETVBUF_REVERSED
2597 dnl AC_FUNC_STRFTIME
2598 dnl AC_FUNC_UTIME_NULL
2600 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2602 dnl ========================================================
2604 dnl ========================================================
2606 dnl ======================================================
2607 dnl = Enable compiling with ccache
2608 dnl ======================================================
2610 [ --with-ccache[=path/to/ccache]
2611 Enable compiling with ccache],
2612 CCACHE=$withval, CCACHE="no")
2614 if test "$CCACHE" != "no"; then
2615 if test -n "$CCACHE"; then
2616 if test "$CCACHE" = "yes"; then
2619 if test ! -e "$CCACHE"; then
2620 AC_MSG_ERROR([$CCACHE not found])
2624 AC_PATH_PROGS(CCACHE, $CCACHE ccache)
2625 if test -z "$CCACHE" -o "$CCACHE" = ":"; then
2626 AC_MSG_ERROR([ccache not found])
2627 elif test -x "$CCACHE"; then
2631 AC_MSG_ERROR([$CCACHE is not executable])
2635 dnl ========================================================
2637 dnl = --enable-strip
2639 dnl = Enable stripping of libs and executables
2641 dnl ========================================================
2642 AC_ARG_ENABLE(strip,
2643 [ --enable-strip Enable stripping of shared libs and programs],
2644 [ if test "$enableval" = "yes"; then
2648 dnl Check for hpux options
2649 case "${target_os}" in
2651 if test -z "$GNU_CC"; then
2653 AC_CACHE_CHECK(for +Olit support,
2654 ac_cv_hpux_usable_olit_option,
2655 dnl since aCC doesn't throw an error on invalid options,
2656 dnl we have to test this the hard way
2657 [ac_cv_hpux_usable_olit_option=no
2659 echo 'int main() { return 0; }' | cat > conftest.c
2660 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2661 if test $? -eq 0; then
2662 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2663 ac_cv_hpux_usable_olit_option=yes
2669 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2670 CFLAGS="$CFLAGS +Olit=all"
2671 CXXFLAGS="$CXXFLAGS +Olit=all"
2673 CFLAGS="$CFLAGS +ESlit"
2674 CXXFLAGS="$CXXFLAGS +ESlit"
2681 dnl Apparently, some systems cannot properly check for the pthread
2682 dnl library unless <pthread.h> is included so we need to test
2685 dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2686 AC_DEFUN(MOZ_CHECK_PTHREADS,
2688 AC_MSG_CHECKING([for pthread_create in -l$1])
2690 #include <pthread.h>
2691 void *foo(void *v) { return v; }
2694 if (!pthread_create(&t, 0, &foo, 0)) {
2699 echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2700 ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2702 rm -f dummy.c dummy${ac_exeext} ;
2703 if test "$_res" = "0"; then
2704 AC_MSG_RESULT([yes])
2712 case "$target_os" in
2720 MOZ_CHECK_PTHREADS(pthreads,
2721 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2722 MOZ_CHECK_PTHREADS(pthread,
2723 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2724 MOZ_CHECK_PTHREADS(c_r,
2725 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2726 MOZ_CHECK_PTHREADS(c,
2735 AC_ARG_WITH(pthreads,
2736 [ --with-pthreads Use system pthreads library as thread subsystem],
2737 [ if test "$withval" = "yes"; then
2738 if test -n "$_HAVE_PTHREADS"; then
2743 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2749 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2755 AC_ARG_ENABLE(user-pthreads,
2756 [ --enable-user-pthreads Build using userland pthreads],
2757 [ if test "$enableval" = "yes"; then
2758 if test -n "$_HAVE_PTHREADS"; then
2763 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2767 AC_ARG_ENABLE(nspr-threads,
2768 [ --enable-nspr-threads Build using classic nspr threads],
2769 [ if test "$enableval" = "yes"; then
2777 AC_ARG_WITH(bthreads,
2778 [ --with-bthreads Use system bthreads library as thread subsystem
2780 [ if test "$withval" = "yes"; then
2788 fi # SKIP_LIBRARY_CHECKS
2791 [ --enable-ipv6 Compile ipv6 support],
2792 [ if test "$enableval" = "yes"; then
2798 if test -n "$USE_PTHREADS"; then
2799 dnl See if -pthread is supported.
2801 ac_cv_have_dash_pthread=no
2802 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2803 echo 'int main() { return 0; }' | cat > conftest.c
2804 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2805 if test $? -eq 0; then
2806 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2807 ac_cv_have_dash_pthread=yes
2808 case "$target_os" in
2810 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2813 CFLAGS="$CFLAGS -pthread"
2814 CXXFLAGS="$CXXFLAGS -pthread"
2820 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2823 dnl See if -pthreads is supported.
2825 ac_cv_have_dash_pthreads=no
2826 if test "$ac_cv_have_dash_pthread" = "no"; then
2827 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2828 echo 'int main() { return 0; }' | cat > conftest.c
2829 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2830 if test $? -eq 0; then
2831 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2832 ac_cv_have_dash_pthreads=yes
2833 CFLAGS="$CFLAGS -pthreads"
2834 CXXFLAGS="$CXXFLAGS -pthreads"
2838 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2843 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2848 AC_DEFINE(_REENTRANT)
2849 AC_DEFINE(_THREAD_SAFE)
2850 dnl -pthread links in -lc_r, so don't specify it explicitly.
2851 if test "$ac_cv_have_dash_pthread" = "yes"; then
2852 _PTHREAD_LDFLAGS="-pthread"
2854 _PTHREAD_LDFLAGS="-lc_r"
2858 if test "$ac_cv_have_dash_pthread" = "yes"; then
2859 _PTHREAD_LDFLAGS="-pthread"
2863 AC_DEFINE(_THREAD_SAFE)
2864 dnl -pthread links in -lc_r, so don't specify it explicitly.
2865 if test "$ac_cv_have_dash_pthread" = "yes"; then
2870 if test "$ac_cv_have_dash_pthread" = "yes"; then
2871 _PTHREAD_LDFLAGS=-pthread
2874 *-linux*|*-gnu*|*-k*bsd*-gnu)
2875 AC_DEFINE(_REENTRANT)
2880 if test -n "$USE_USER_PTHREADS"; then
2887 dnl Special thread exceptions
2891 if test -n "$USE_NSPR_THREADS"; then
2892 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2894 case "$target_os" in
2896 if test -z "$USE_PTHREADS"; then
2897 AC_DEFINE(AIX_RENAME_SELECT)
2901 if test -z "$USE_NSPR_THREADS"; then
2902 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2906 if test -z "$USE_NSPR_THREADS"; then
2907 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2909 if test -n "$USE_PTHREADS"; then
2910 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2914 if test -z "$USE_NSPR_THREADS"; then
2915 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2917 if test -n "$USE_PTHREADS"; then
2918 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2924 if test -n "$USE_PTHREADS"; then
2925 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2929 if test -n "$USE_NSPR_THREADS"; then
2930 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2934 if test -n "$USE_NSPR_THREADS"; then
2935 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2937 if test "$USE_PTHREADS"; then
2938 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2939 AC_DEFINE(_REENTRANT)
2940 AC_DEFINE(_PR_DCETHREADS)
2942 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2943 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2946 if test "$USE_USER_PTHREADS"; then
2947 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2951 if test "${target_os}" = "irix6.5"; then
2952 if test -n "$USE_PTHREADS"; then
2953 AC_DEFINE(_PR_HAVE_GETHOST_R)
2954 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2958 *-linux*|*-gnu*|*-k*bsd*-gnu)
2959 if test -n "$USE_NSPR_THREADS"; then
2960 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2963 *-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*|*-os2*|*-beos*)
2964 dnl win32, wince, os2 & beos cannot use pthreads
2969 *-netbsd*|*-openbsd*)
2970 if test -n "$USE_NSPR_THREADS"; then
2971 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2975 if test -n "$USE_NSPR_THREADS"; then
2976 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2978 if test -n "$USE_PTHREADS"; then
2979 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2982 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2987 if test -n "$USE_NSPR_THREADS"; then
2988 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2990 if test -n "$USE_PTHREADS"; then
2991 AC_DEFINE(_REENTRANT)
2992 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2993 if test "$OS_TEST" = "i86pc"; then
2994 if test -n "$USE_64"; then
2995 PR_MD_ASFILES=os_SunOS_x86_64.s
2997 PR_MD_ASFILES=os_SunOS_x86.s
3000 if test -n "$USE_64"; then
3001 PR_MD_ASFILES=os_SunOS_sparcv9.s
3007 if test -n "$USE_PTHREADS"; then
3008 AC_DEFINE(_PR_HAVE_GETHOST_R)
3009 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
3014 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
3016 dnl If the user passed in arg to --enable-optimize or --enable-debug,
3017 dnl make sure that we use it.
3018 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
3019 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
3022 if test -n "$_SAVE_DEBUG_FLAGS"; then
3023 _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
3026 if test -n "$MOZ_OPTIMIZE"; then
3027 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
3028 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
3031 if test -n "$MOZ_DEBUG_SYMBOLS"; then
3032 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
3033 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
3036 if test -n "$MOZ_OPTIMIZE"; then
3042 if test -n "$USE_64"; then
3046 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
3048 dnl ========================================================
3049 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
3050 dnl ========================================================
3051 case "$target_os" in
3053 CC="\$(CYGWIN_WRAPPER) $CC"
3054 CXX="\$(CYGWIN_WRAPPER) $CXX"
3055 RC="\$(CYGWIN_WRAPPER) $RC"
3059 dnl ========================================================
3060 dnl = Use malloc wrapper lib
3061 dnl ========================================================
3062 AC_ARG_ENABLE(wrap-malloc,
3063 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
3064 [ if test "$enableval" = "yes"; then
3068 if test -n "$_WRAP_MALLOC"; then
3069 if test -n "$GNU_CC"; then
3070 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=malloc,--wrap=calloc,--wrap=valloc,--wrap=free,--wrap=realloc,--wrap=memalign"
3071 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=__builtin_new,--wrap=__builtin_vec_new,--wrap=__builtin_delete,--wrap=__builtin_vec_delete"
3072 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=strdup,--wrap=strndup"
3073 WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=posix_memalign,--wrap=malloc_usable_size"
3075 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
3079 dnl ========================================================
3080 dnl = Location of malloc wrapper lib
3081 dnl ========================================================
3082 AC_ARG_WITH(wrap-malloc,
3083 [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
3084 WRAP_LDFLAGS="${WRAP_LDFLAGS} $withval")
3086 dnl ========================================================
3087 dnl Substitution of found variables.
3088 dnl ========================================================
3089 AC_SUBST(SHELL_OVERRIDE)
3091 AC_SUBST(MOZILLA_CLIENT)
3098 AC_SUBST(HOST_CFLAGS)
3100 AC_SUBST(HOST_LDFLAGS)
3102 AC_SUBST(GCC_USE_GNU_LD)
3104 AC_SUBST(CROSS_COMPILE)
3106 AC_SUBST(MOZ_OPTIMIZE)
3108 AC_SUBST(MOZ_DEBUG_SYMBOLS)
3114 AC_SUBST(OBJECT_MODE)
3115 AC_SUBST(ENABLE_STRIP)
3117 AC_SUBST(USE_PTHREADS)
3118 AC_SUBST(USE_BTHREADS)
3119 AC_SUBST(USE_USER_PTHREADS)
3120 AC_SUBST(USE_NSPR_THREADS)
3125 AC_SUBST(MOD_MAJOR_VERSION)
3126 AC_SUBST(MOD_MINOR_VERSION)
3127 AC_SUBST(MOD_PATCH_VERSION)
3128 AC_SUBST(NSPR_MODNAME)
3129 AC_SUBST(MDCPUCFG_H)
3130 AC_SUBST(PR_MD_CSRCS)
3131 AC_SUBST(PR_MD_ASFILES)
3132 AC_SUBST(PR_MD_ARCH_DIR)
3135 AC_SUBST(OBJ_SUFFIX)
3136 AC_SUBST(LIB_SUFFIX)
3137 AC_SUBST(DLL_SUFFIX)
3138 AC_SUBST(ASM_SUFFIX)
3139 AC_SUBST(WRAP_LDFLAGS)
3141 AC_SUBST(DSO_CFLAGS)
3142 AC_SUBST(DSO_LDOPTS)
3146 AC_SUBST(OS_RELEASE)
3148 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3163 AC_SUBST(PROFILE_GEN_CFLAGS)
3164 AC_SUBST(PROFILE_GEN_LDFLAGS)
3165 AC_SUBST(PROFILE_USE_CFLAGS)
3166 AC_SUBST(PROFILE_USE_LDFLAGS)
3169 AC_SUBST(RESOLVE_LINK_SYMBOLS)
3170 AC_SUBST(AIX_LINK_OPTS)
3171 AC_SUBST(NOSUCHFILE)
3172 AC_SUBST(MOZ_OBJFORMAT)
3173 AC_SUBST(ULTRASPARC_LIBRARY)
3176 AC_SUBST(OBJDIR_NAME)
3177 AC_SUBST(RELEASE_OBJDIR_NAME)
3184 AC_SUBST(OS_DLLFLAGS)
3185 AC_SUBST(CYGWIN_WRAPPER)
3186 AC_SUBST(VISIBILITY_FLAGS)
3187 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3188 AC_SUBST(MACOS_SDK_DIR)
3189 AC_SUBST(SYMBIAN_SDK_DIR)
3193 dnl ========================================================
3194 dnl Generate output files.
3195 dnl ========================================================
3207 lib/libc/include/Makefile
3208 lib/libc/src/Makefile
3213 pr/include/md/Makefile
3214 pr/include/obsolete/Makefile
3215 pr/include/private/Makefile
3218 pr/src/linking/Makefile
3219 pr/src/malloc/Makefile
3221 pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3222 pr/src/memory/Makefile
3223 pr/src/misc/Makefile
3224 pr/src/threads/Makefile
3226 pr/tests/dll/Makefile
3229 if test "$OS_TARGET" = "Linux"; then
3230 MAKEFILES="$MAKEFILES
3233 elif test "$OS_TARGET" = "SunOS"; then
3234 MAKEFILES="$MAKEFILES
3235 pkg/solaris/Makefile
3236 pkg/solaris/SUNWpr/Makefile
3237 pkg/solaris/SUNWprd/Makefile
3241 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3242 MAKEFILES="$MAKEFILES
3243 pr/src/threads/combined/Makefile
3245 elif test -n "$USE_PTHREADS"; then
3246 MAKEFILES="$MAKEFILES
3247 pr/src/pthreads/Makefile
3249 elif test -n "$USE_BTHREADS"; then
3250 MAKEFILES="$MAKEFILES
3251 pr/src/bthreads/Makefile
3255 if test -n "$USE_CPLUS"; then
3256 MAKEFILES="$MAKEFILES
3257 pr/src/cplus/Makefile
3258 pr/src/cplus/tests/Makefile
3262 echo $MAKEFILES > unallmakefiles
3264 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])