1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
3 dnl ***** BEGIN LICENSE BLOCK *****
4 dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 dnl The contents of this file are subject to the Mozilla Public License Version
7 dnl 1.1 (the "License"); you may not use this file except in compliance with
8 dnl the License. You may obtain a copy of the License at
9 dnl http://www.mozilla.org/MPL/
11 dnl Software distributed under the License is distributed on an "AS IS" basis,
12 dnl WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 dnl for the specific language governing rights and limitations under the
16 dnl The Original Code is the Netscape Portable Runtime (NSPR).
18 dnl The Initial Developer of the Original Code is
19 dnl Netscape Communications Corporation.
20 dnl Portions created by the Initial Developer are Copyright (C) 1998
21 dnl the Initial Developer. All Rights Reserved.
24 dnl Christopher Seawood <cls@seawood.org>
25 dnl Howard Chu <hyc@symas.com>
26 dnl Mark Mentovai <mark@moxienet.com>
28 dnl Alternatively, the contents of this file may be used under the terms of
29 dnl either the GNU General Public License Version 2 or later (the "GPL"), or
30 dnl the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 dnl in which case the provisions of the GPL or the LGPL are applicable instead
32 dnl of those above. If you wish to allow use of your version of this file only
33 dnl under the terms of either the GPL or the LGPL, and not to allow others to
34 dnl use your version of this file under the terms of the MPL, indicate your
35 dnl decision by deleting the provisions above and replace them with the notice
36 dnl and other provisions required by the GPL or the LGPL. If you do not delete
37 dnl the provisions above, a recipient may use your version of this file under
38 dnl the terms of any one of the MPL, the GPL or the LGPL.
40 dnl ***** END LICENSE BLOCK *****
43 AC_INIT(config/libc_r.h)
45 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
48 dnl ========================================================
50 dnl ========================================================
64 _MACOSX_DEPLOYMENT_TARGET=
69 OBJDIR='$(OBJDIR_NAME)'
72 NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
73 NOSUCHFILE=/no-such-file
74 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
75 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
87 dnl Link in libraries necessary to resolve all symbols for shared libs
90 dnl ========================================================
92 dnl = Dont change the following lines. Doing so breaks:
94 dnl = CFLAGS="-foo" ./configure
96 dnl ========================================================
98 CXXFLAGS="${CXXFLAGS=}"
100 DLLFLAGS="${DLLFLAGS=}"
101 HOST_CFLAGS="${HOST_CFLAGS=}"
102 HOST_LDFLAGS="${HOST_LDFLAGS=}"
106 # Check to see if we are really running in a msvc environemnt
108 AC_CHECK_PROGS(CC, cl)
109 if test "$CC" = "cl"; then
110 echo 'main() { return 0; }' > dummy.c
111 ${CC} -o dummy dummy.c >/dev/null 2>&1
116 AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
118 rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
129 if test -n "$_WIN32_MSVC"; then
131 SKIP_COMPILER_CHECKS=1
132 SKIP_LIBRARY_CHECKS=1
135 dnl ========================================================
136 dnl = Android uses a very custom (hacky) toolchain; we need to do this
137 dnl = here, so that the compiler checks can succeed
138 dnl ========================================================
140 AC_ARG_WITH(android-ndk,
141 [ --with-android-ndk=DIR
142 location where the Android NDK can be found],
143 android_ndk=$withval)
145 AC_ARG_WITH(android-toolchain,
146 [ --with-android-toolchain=DIR
147 location of the android toolchain, default NDK/build/prebuilt/HOST/arm-eabi-4.4.0],
148 android_toolchain=$withval)
150 AC_ARG_WITH(android-platform,
151 [ --with-android-platform=DIR
152 location of platform dir, default NDK/build/platforms/android-5/arch-arm],
153 android_platform=$withval)
155 if test "$target" = "arm-android-eabi" ; then
156 if test -z "$android_ndk" ; then
157 AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
160 if test -z "$android_toolchain" ; then
161 android_toolchain="$android_ndk"/build/prebuilt/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/arm-eabi-4.4.0
164 if test -z "$android_platform" ; then
165 android_platform="$android_ndk"/build/platforms/android-5/arch-arm
169 AS="$android_toolchain"/bin/arm-eabi-as
170 CC="$android_toolchain"/bin/arm-eabi-gcc
171 CXX="$android_toolchain"/bin/arm-eabi-g++
172 CPP="$android_toolchain"/bin/arm-eabi-cpp
173 LD="$android_toolchain"/bin/arm-eabi-ld
174 AR="$android_toolchain"/bin/arm-eabi-ar
175 RANLIB="$android_toolchain"/bin/arm-eabi-ranlib
176 STRIP="$android_toolchain"/bin/arm-eabi-strip
178 CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
179 CFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions $CFLAGS"
180 CXXFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
181 LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
183 dnl prevent cross compile section from using these flags as host flags
184 if test -z "$HOST_CPPFLAGS" ; then
187 if test -z "$HOST_CFLAGS" ; then
190 if test -z "$HOST_CXXFLAGS" ; then
193 if test -z "$HOST_LDFLAGS" ; then
200 dnl ========================================================
202 dnl = Check options that may affect the compiler
204 dnl ========================================================
205 dist_prefix='${MOD_DEPTH}/dist'
206 dist_bindir='${dist_prefix}/bin'
207 dist_includedir='${dist_prefix}/include/nspr'
208 dist_libdir='${dist_prefix}/lib'
209 dnl If the --includedir option was not specified, add '/nspr' to autoconf's
210 dnl default value of includedir.
211 if test "${includedir}" = '${prefix}/include'; then
212 includedir='${prefix}/include/nspr'
215 AC_ARG_WITH(dist-prefix,
216 [ --with-dist-prefix=DIST_PREFIX
217 place build files in DIST_PREFIX [dist]],
218 dist_prefix=$withval)
220 AC_ARG_WITH(dist-bindir,
221 [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
222 dist_bindir=$withval)
224 AC_ARG_WITH(dist-includedir,
225 [ --with-dist-includedir=DIR
226 build include files in DIR [DIST_PREFIX/include/nspr]],
227 dist_includedir=$withval)
229 AC_ARG_WITH(dist-libdir,
230 [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
231 dist_libdir=$withval)
233 AC_SUBST(dist_prefix)
234 AC_SUBST(dist_bindir)
235 AC_SUBST(dist_includedir)
236 AC_SUBST(dist_libdir)
238 dnl Check if NSPR is being compiled for Mozilla
239 dnl Let --with-arg override environment setting
242 [ --with-mozilla Compile NSPR with Mozilla support],
243 [ if test "$withval" = "yes"; then
244 AC_DEFINE(MOZILLA_CLIENT)
249 [ if test -n "$MOZILLA_CLIENT"; then
250 AC_DEFINE(MOZILLA_CLIENT)
253 AC_ARG_ENABLE(optimize,
254 [ --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ],
255 [ if test "$enableval" != "no"; then
257 if test -n "$enableval" -a "$enableval" != "yes"; then
258 _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
259 _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
266 [ --enable-debug[=DBG] Enable debugging (using compiler flags DBG)],
267 [ if test "$enableval" != "no"; then
270 if test -n "$enableval" -a "$enableval" != "yes"; then
271 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
272 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
279 AC_ARG_ENABLE(debug-symbols,
280 [ --enable-debug-symbols[=DBG] Enable debugging symbols
281 (using compiler flags DBG)],
282 [ if test "$enableval" != "no"; then
284 if test -n "$enableval" -a "$enableval" != "yes"; then
285 if test -z "$_SAVE_DEBUG_FLAGS"; then
286 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
287 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
289 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
296 AC_ARG_ENABLE(win32-target,
297 [ --enable-win32-target=\$t
298 Specify win32 flavor. (WIN95 or WINNT)],
299 OS_TARGET=`echo $enableval | tr a-z A-Z`)
301 AC_ARG_ENABLE(symbian-target,
302 [ --enable-symbian-target=\$t
303 Specify symbian flavor. (WINSCW or GCCE)],
304 OS_TARGET=`echo $enableval | tr a-z A-Z`)
306 AC_ARG_ENABLE(debug-rtl,
307 [ --enable-debug-rtl Use the MSVC debug runtime library],
308 [ if test "$enableval" = "yes"; then
313 [ --enable-n32 Enable n32 ABI support (IRIX only)],
314 [ if test "$enableval" = "yes"; then
316 else if test "$enableval" = "no"; then
322 [ --enable-64bit Enable 64-bit support (on certain platforms)],
323 [ if test "$enableval" = "yes"; then
327 AC_ARG_ENABLE(mdupdate,
328 [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
329 [ if test "$enableval" = "yes"; then
334 [ --enable-cplus Enable some c++ api routines],
335 [ if test "$enableval" = "yes"; then
339 AC_ARG_WITH(arm-kuser,
340 [ --with-arm-kuser Use kuser helpers (Linux/ARM only)
341 (Requires kernel 2.6.13 or later)],
342 [ if test "$withval" = "yes"; then
343 AC_DEFINE(_PR_ARM_KUSER)
346 dnl ========================================================
347 dnl = Mac OS X SDK support
348 dnl ========================================================
349 AC_ARG_WITH(macos-sdk,
350 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
351 MACOS_SDK_DIR=$withval)
353 AC_ARG_ENABLE(macos-target,
354 [ --enable-macos-target=VER
355 Set the minimum MacOS version needed at runtime
356 [10.2 for ppc, 10.4 for x86]],
357 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
359 dnl ========================================================
361 dnl = Set the threading model
363 dnl ========================================================
367 case "${target_os}" in
379 dnl ========================================================
381 dnl = Set the default C compiler
383 dnl ========================================================
384 if test -z "$CC"; then
388 if test -z "$USE_NSPR_THREADS"; then
414 dnl ========================================================
416 dnl = Set the default C++ compiler
418 dnl ========================================================
419 if test -z "$CXX"; then
423 if test -z "$USE_NSPR_THREADS"; then
431 case "${target_os}" in
459 if test -z "$SKIP_PATH_CHECKS"; then
460 AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
463 if test -n "$MOZ_DEBUG"; then
465 DEFINES="$DEFINES -UNDEBUG"
467 case "${target_os}" in
469 DEFINES="$DEFINES -DDEBUG_${USER}"
471 msvc*|mks*|cygwin*|mingw*|wince*|winmo*|os2*)
472 DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
475 DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
480 DEFINES="$DEFINES -UDEBUG"
483 if test -z "$SKIP_COMPILER_CHECKS"; then
484 dnl ========================================================
485 dnl Checks for compilers.
486 dnl ========================================================
487 if test "$target" != "$host"; then
488 echo "cross compiling from $host to $target"
492 _SAVE_CFLAGS="$CFLAGS"
493 _SAVE_LDFLAGS="$LDFLAGS"
495 AC_MSG_CHECKING([for $host compiler])
496 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
497 if test -z "$HOST_CC"; then
498 AC_MSG_ERROR([no acceptable cc found in \$PATH])
500 AC_MSG_RESULT([$HOST_CC])
501 if test -z "$HOST_CFLAGS"; then
502 HOST_CFLAGS="$CFLAGS"
504 if test -z "$HOST_LDFLAGS"; then
505 HOST_LDFLAGS="$LDFLAGS"
509 CFLAGS="$HOST_CFLAGS"
510 LDFLAGS="$HOST_LDFLAGS"
512 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
513 AC_TRY_COMPILE([], [return(0);],
514 [ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
515 AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
519 LDFLAGS=$_SAVE_LDFLAGS
521 case "$build:$target" in
522 powerpc-apple-darwin8*:i?86-apple-darwin*)
523 dnl The Darwin cross compiler doesn't necessarily point itself at a
524 dnl root that has libraries for the proper architecture, it defaults
525 dnl to the system root. The libraries in the system root on current
526 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
527 dnl checks will fail. Fake a working SDK in that case.
529 _SAVE_CXXFLAGS=$CXXLAGS
530 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
531 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
535 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
538 if test -n "$USE_CPLUS"; then
539 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
544 case "$build:$target" in
545 powerpc-apple-darwin8*:i?86-apple-darwin*)
546 dnl Revert the changes made above. From this point on, the target
547 dnl compiler will never be used without applying the SDK to CFLAGS
548 dnl (see --with-macos-sdk below).
550 CXXFLAGS=$_SAVE_CXXFLAGS
554 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
555 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
556 AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
557 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
558 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
559 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
563 if test -n "$USE_CPLUS"; then
564 if test "$CC" = "cl" -a -z "$CXX"; then
572 AC_PATH_PROGS(AS, as, $CC)
573 AC_PATH_PROGS(AR, ar, echo not_ar)
574 AC_PATH_PROGS(LD, ld link, echo not_ld)
575 AC_PATH_PROGS(STRIP, strip, echo not_strip)
576 AC_PATH_PROGS(WINDRES, windres, echo not_windres)
577 if test -z "$HOST_CC"; then
580 if test -z "$HOST_CFLAGS"; then
581 HOST_CFLAGS="$CFLAGS"
585 if test "$GCC" = "yes"; then
588 if test "$GXX" = "yes"; then
591 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
596 case "$build:$target" in
597 i?86-apple-darwin*:powerpc-apple-darwin*)
598 dnl cross_compiling will have erroneously been set to "no" in this
599 dnl case, because the x86 build host is able to run ppc code in a
600 dnl translated environment, making a cross compiler appear native.
605 if test "$cross_compiling" = "yes"; then
611 dnl ========================================================
612 dnl Check for gcc -pipe support
613 dnl ========================================================
614 AC_MSG_CHECKING([for gcc -pipe support])
615 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
616 echo '#include <stdio.h>' > dummy-hello.c
617 echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
618 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
619 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
625 if test "$_res_as_stdin" = "yes"; then
627 CFLAGS="$CFLAGS -pipe"
628 AC_TRY_COMPILE( [ #include <stdio.h> ],
629 [printf("Hello World\n");],
630 [_res_gcc_pipe="yes"],
631 [_res_gcc_pipe="no"] )
634 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
636 CFLAGS="$CFLAGS -pipe"
637 CXXFLAGS="$CXXFLAGS -pipe"
641 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
642 AC_MSG_RESULT([$_res])
647 dnl ========================================================
648 dnl Profile guided optimization
649 dnl ========================================================
650 dnl Test for profiling options
651 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
653 _SAVE_CFLAGS="$CFLAGS"
654 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
656 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
657 AC_TRY_COMPILE([], [return 0;],
658 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
659 result="yes" ], result="no")
660 AC_MSG_RESULT([$result])
662 if test $result = "yes"; then
663 PROFILE_GEN_LDFLAGS="-fprofile-generate"
664 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch -freorder-blocks-and-partition"
665 PROFILE_USE_LDFLAGS="-fprofile-use"
668 CFLAGS="$_SAVE_CFLAGS"
670 dnl ===============================================================
671 dnl Check for .hidden assembler directive and visibility attribute.
672 dnl Borrowed from glibc configure.in
673 dnl ===============================================================
674 if test "$GNU_CC"; then
675 AC_CACHE_CHECK(for visibility(hidden) attribute,
676 ac_cv_visibility_hidden,
677 [cat > conftest.c <<EOF
678 int foo __attribute__ ((visibility ("hidden"))) = 1;
680 ac_cv_visibility_hidden=no
681 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
682 if grep '\.hidden.*foo' conftest.s >/dev/null; then
683 ac_cv_visibility_hidden=yes
688 if test "$ac_cv_visibility_hidden" = "yes"; then
689 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
690 AC_CACHE_CHECK(for visibility pragma support,
691 ac_cv_visibility_pragma,
692 [cat > conftest.c <<EOF
693 #pragma GCC visibility push(hidden)
695 #pragma GCC visibility push(default)
698 ac_cv_visibility_pragma=no
699 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
700 if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
701 if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
702 ac_cv_visibility_pragma=yes
708 if test "$ac_cv_visibility_pragma" = "yes"; then
709 AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
710 # To work around a build problem on Linux x86-64 (Bugzilla bug
711 # 293438), we use the -fvisibility=hidden flag. This flag is less
712 # optimal than #pragma GCC visibility push(hidden) because the flag
713 # assumes that symbols defined outside the current source file have
714 # the default visibility. This has the advantage that we don't need
715 # to wrap system header files, but has the disadvantage that calls
716 # to hidden symbols defined in other source files cannot be
717 # optimized by the compiler. The -fvisibility=hidden flag does
718 # hide and export symbols correctly.
719 #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
720 #WRAP_SYSTEM_INCLUDES=1
721 VISIBILITY_FLAGS="-fvisibility=hidden"
722 WRAP_SYSTEM_INCLUDES=
727 fi # SKIP_COMPILER_CHECKS
729 dnl ========================================================
730 dnl Checks for programs.
731 dnl ========================================================
732 if test -z "$SKIP_PATH_CHECKS"; then
733 AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
734 elif test -z "$PERL"; then
738 dnl ========================================================
739 dnl Default platform specific options
740 dnl ========================================================
745 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
753 if test -n "$CROSS_COMPILE"; then
754 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
756 OS_TEST="${target_cpu}"
757 case "${target_os}" in
758 linux*) OS_ARCH=Linux ;;
759 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
760 mingw*) OS_ARCH=WINNT ;;
761 wince*) OS_ARCH=WINCE ;;
762 winmo*) OS_ARCH=WINCE ;;
763 darwin*) OS_ARCH=Darwin ;;
764 riscos*) OS_ARCH=RISCOS ;;
767 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
768 OS_RELEASE=`uname -r`
772 if test "$OS_ARCH" = "IRIX64"; then
776 if test "$OS_ARCH" = "AIX"; then
777 OS_RELEASE=`uname -v`.`uname -r`
780 if test "$OS_ARCH" = "FreeBSD"; then
781 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
784 if test "$OS_ARCH" = "Linux"; then
785 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
786 OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
789 #######################################################################
790 # Master "Core Components" macros for getting the OS target #
791 #######################################################################
794 # Note: OS_TARGET should be specified on the command line for gmake.
795 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
796 # The difference between the Win95 target and the WinNT target is that
797 # the WinNT target uses Windows NT specific features not available
798 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
799 # at lesser performance (the Win95 target uses threads; the WinNT target
802 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
807 # The following hack allows one to build on a WIN95 machine (as if
808 # s/he were cross-compiling on a WINNT host for a WIN95 target).
809 # It also accomodates for MKS's uname.exe. If you never intend
810 # to do development on a WIN95 machine, you don't need this hack.
825 CYGWIN_9*|CYGWIN_ME*)
826 OS_ARCH='CYGWIN_NT-4.0'
836 # On WIN32, we also define the variable CPU_ARCH.
842 if test "$CPU_ARCH" = "I386"; then
848 # If uname -s returns "Windows_NT", we assume that we are using
849 # the uname.exe in MKS toolkit.
851 # The -r option of MKS uname only returns the major version number.
852 # So we need to use its -v option to get the minor version number.
853 # Moreover, it doesn't have the -p option, so we need to use uname -m.
856 OS_MINOR_RELEASE=`uname -v`
857 if test "$OS_MINOR_RELEASE" = "00"; then
860 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
863 # MKS's uname -m returns "586" on a Pentium machine.
865 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
869 CYGWIN_NT*|MINGW*_NT*)
871 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
872 # the uname.exe in the Cygwin tools.
873 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
874 # the uname.exe in the MSYS tools.
876 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
880 # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
882 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
888 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
890 if test -n "$MOZ_DEBUG"; then
894 if test -z "$OS_TARGET"; then
897 if test "$OS_TARGET" = "WIN95"; then
900 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
902 dnl ========================================================
903 dnl Enable high-memory support on OS/2 by default.
904 dnl ========================================================
905 AC_ARG_ENABLE(os2-high-mem,
906 [ --disable-os2-high-mem Disable high-memory support on OS/2],
907 [ if test "$enableval" = "no"; then
910 MOZ_OS2_HIGH_MEMORY=1
913 dnl ========================================================
914 dnl = Enable building the Thumb2 instruction set
915 dnl ========================================================
916 AC_ARG_ENABLE(thumb2,
917 [ --enable-thumb2 Enable Thumb2 instruction set],
918 [ if test "$enableval" = "yes"; then
922 if test -n "$MOZ_THUMB2"; then
923 case "$target_cpu" in
925 if test "$GNU_CC"; then
926 CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
927 CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
928 ASFLAGS="$ASFLAGS -march=armv7-a -mthumb"
930 AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains])
934 AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures])
939 dnl ========================================================
940 dnl Override of system specific host options
941 dnl ========================================================
946 *-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*)
947 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
948 if test `echo "${PATH}" | grep -c \;` = 0; then
949 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
953 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
958 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
962 dnl ========================================================
963 dnl Override of system specific target options
964 dnl ========================================================
971 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
972 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
973 case "${target_os}" in
975 AC_DEFINE(AIX_RENAME_SELECT)
976 AC_DEFINE(_PR_NO_LARGE_FILES)
977 AIX_LINK_OPTS='-bnso -berok'
978 PR_MD_ASFILES=os_AIX.s
981 AC_DEFINE(AIX_TIMERS)
982 AC_DEFINE(_PR_NO_LARGE_FILES)
986 AIX_LINK_OPTS='-bnso -berok'
987 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
988 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
991 AC_DEFINE(AIX_TIMERS)
992 AC_DEFINE(_PR_HAVE_OFF64_T)
993 AIX_LINK_OPTS='-brtl -bnso -berok'
996 AC_DEFINE(AIX_TIMERS)
997 AC_DEFINE(_PR_HAVE_OFF64_T)
998 AC_DEFINE(AIX4_3_PLUS)
999 AC_DEFINE(HAVE_SOCKLEN_T)
1000 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1002 AIX_LINK_OPTS='-brtl -bnso -berok'
1005 AC_DEFINE(AIX_TIMERS)
1006 AC_DEFINE(_PR_HAVE_OFF64_T)
1007 AC_DEFINE(AIX4_3_PLUS)
1008 AC_DEFINE(HAVE_SOCKLEN_T)
1009 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1011 AIX_LINK_OPTS='-brtl -bnso -berok'
1014 CFLAGS="$CFLAGS -qro -qroconst"
1015 AIX_WRAP='$(DIST)/lib/aixwrap.o'
1016 AIX_TMP='./_aix_tmp.o'
1017 if test -n "$USE_64"; then
1018 MDCPUCFG_H=_aix64.cfg
1021 MDCPUCFG_H=_aix32.cfg
1024 RESOLVE_LINK_SYMBOLS=1
1031 AC_DEFINE(_POSIX_SOURCE)
1033 MDCPUCFG_H=_beos.cfg
1036 RESOLVE_LINK_SYMBOLS=1
1037 case "${target_cpu}" in
1040 _DEBUG_FLAGS='-gdwarf-2 -O0'
1041 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1042 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1048 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'
1050 _DEBUG_FLAGS='-g -O0'
1058 AC_DEFINE(NEED_BSDREGEX)
1060 CFLAGS="$CFLAGS -Wall -Wno-format"
1061 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1063 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1065 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1069 MDCPUCFG_H=_bsdi.cfg
1074 case "$target_os" in
1076 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1077 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1078 AC_DEFINE(_PR_NEED_H_ERRNO)
1085 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1086 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1088 AC_DEFINE(USE_DLFCN)
1089 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1090 PR_MD_ASFILES=os_BSD_OS_386_2.s
1094 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1095 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1097 AC_DEFINE(USE_DLFCN)
1098 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1099 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1101 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1103 case "$target_os" in
1104 bsdi4.2* | bsdi4.3* | bsdi5.*)
1105 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1106 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1111 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1112 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1114 AC_DEFINE(USE_DLFCN)
1115 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1124 AC_DEFINE(HAVE_BSD_FLOCK)
1125 AC_DEFINE(HAVE_SOCKLEN_T)
1126 AS='$(CC) -x assembler-with-cpp'
1127 CFLAGS="$CFLAGS -Wall -fno-common"
1128 case "${target_cpu}" in
1130 if test -n "$USE_64"; then
1132 CC="$CC -arch x86_64"
1142 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1144 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1145 STRIP="$STRIP -x -S"
1148 MDCPUCFG_H=_darwin.cfg
1149 PR_MD_CSRCS=darwin.c
1150 PR_MD_ASFILES=os_Darwin.s
1152 # Add Mac OS X support for loading CFM & CFBundle plugins
1153 if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1154 AC_DEFINE(XP_MACOSX)
1157 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1158 dnl Use the specified value
1159 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1160 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1161 dnl No value specified on the command line or in the environment,
1162 dnl use the lesser of the library's minimum or the architecture's
1164 case "${target_cpu}" in
1166 dnl Architecture minimum 10.2
1167 export MACOSX_DEPLOYMENT_TARGET=10.2
1170 dnl Architecture minimum 10.4
1171 export MACOSX_DEPLOYMENT_TARGET=10.4
1176 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1177 dnl in use. NEXT_ROOT will be set and exported if it's needed for
1180 if test "$MACOS_SDK_DIR"; then
1181 dnl Sync this section with the one in Mozilla's top level.
1183 if test ! -d "$MACOS_SDK_DIR"; then
1184 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1185 specify a valid SDK. SDKs are installed when the optional cross-development
1186 tools are selected during the Xcode/Developer Tools installation.])
1190 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1191 GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1192 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1194 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1195 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1196 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1197 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1198 SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1201 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1203 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1205 dnl CPP needs to be set for AC_CHECK_HEADER.
1206 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1209 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1211 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1212 dnl The build host is running Tiger (10.4) or earlier.
1213 dnl ld support for -syslibroot is compiler-agnostic, but
1214 dnl only available on Tiger and later. On Tiger and
1215 dnl earlier build hosts, just rely on NEXT_ROOT, because
1216 dnl it's not been shown to cause any problems.
1217 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}"
1219 dnl The build host is running Leopard (10.5) or later.
1220 dnl With NEXT_ROOT set, the linker will still not apply
1221 dnl it when resolving dependencies. This causes problems
1222 dnl on Leopard, where an SDK depends on frameworks which
1223 dnl were present in earlier OS releases (and the associated
1224 dnl SDK) but not in Leopard. -syslibroot does not have
1225 dnl this problem, but it results in harmless warnings when
1226 dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1227 dnl on Leopard because the compiler uses it too.
1228 MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1231 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1232 export NEXT_ROOT=$MACOS_SDK_DIR
1234 if test -n "$CROSS_COMPILE" ; then
1235 dnl NEXT_ROOT will be in the environment, but it
1236 dnl shouldn't be set for the build host. HOST_CXX is
1237 dnl presently unused.
1238 HOST_CC="NEXT_ROOT= $HOST_CC"
1239 HOST_CXX="NEXT_ROOT= $HOST_CXX"
1242 dnl gcc >= 4.0 uses different paths than above, but knows
1243 dnl how to find them itself.
1244 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1246 dnl CPP needs to be set for AC_CHECK_HEADER.
1247 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1249 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1250 dnl has an ld that supports -syslibroot. Don't set
1251 dnl NEXT_ROOT because it will be ignored and cause
1252 dnl warnings when -syslibroot is specified.
1253 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1254 dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1255 dnl based on the -isysroot it receives.
1256 LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1258 dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1260 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1269 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1273 AC_DEFINE(_DGUX_SOURCE)
1274 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1278 MDCPUCFG_H=_dgux.cfg
1283 if test -z "$USE_NSPR_THREADS"; then
1288 AC_DEFINE(HAVE_BSD_FLOCK)
1289 AC_DEFINE(HAVE_SOCKLEN_T)
1290 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1291 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1292 if test "$MOZ_OBJFORMAT" = "elf"; then
1297 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1299 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1300 MDCPUCFG_H=_freebsd.cfg
1301 PR_MD_CSRCS=freebsd.c
1307 AC_DEFINE(_HPUX_SOURCE)
1308 # OSF1 and HPUX report the POLLHUP event for a socket when the
1309 # shutdown(SHUT_WR) operation is called for the remote end, even though
1310 # the socket is still writeable. Use select(), instead of poll(), to
1311 # workaround this problem.
1312 AC_DEFINE(_PR_POLL_WITH_SELECT)
1313 AC_DEFINE(_USE_BIG_FDS)
1314 DSO_LDOPTS='-b +h $(notdir $@)'
1316 if test "$OS_TEST" = "ia64"; then
1318 DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1319 CPU_ARCH_TAG=_$OS_TEST
1320 if test -z "$USE_64"; then
1323 PR_MD_ASFILES=os_HPUX_ia64.s
1327 PR_MD_ASFILES=os_HPUX.s
1329 if test -n "$USE_64"; then
1330 MDCPUCFG_H=_hpux64.cfg
1332 MDCPUCFG_H=_hpux32.cfg
1334 if test -z "$GNU_CC"; then
1340 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1343 if test -n "$MOZILLA_CLIENT"; then
1344 DEFAULT_IMPL_STRATEGY=_EMU
1347 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1348 AC_DEFINE(_PR_NEED_H_ERRNO)
1350 DEFAULT_IMPL_STRATEGY=_EMU
1354 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1355 AC_DEFINE(_PR_NO_LARGE_FILES)
1358 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1359 AC_DEFINE(_PR_NEED_H_ERRNO)
1362 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1363 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1366 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1367 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1370 # HP-UX 11i v2 (B.11.23) or higher
1372 case "$OS_RELEASE" in
1373 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1379 if test "$OS_RELEASE" = "B.10.01"; then
1381 DEFAULT_IMPL_STRATEGY=_EMU
1384 if test "$OS_RELEASE" = "B.10.10"; then
1386 AC_DEFINE(HPUX10_10)
1387 DEFAULT_IMPL_STRATEGY=_PTH
1390 if test "$OS_RELEASE" = "B.10.20"; then
1392 AC_DEFINE(HPUX10_20)
1393 if test -z "$GNU_CC"; then
1394 CFLAGS="$CFLAGS +DAportable +DS1.1"
1395 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1397 DEFAULT_IMPL_STRATEGY=_PTH
1400 if test "$OS_RELEASE" = "B.10.30"; then
1402 AC_DEFINE(HPUX10_30)
1403 if test -z "$GNU_CC"; then
1404 CFLAGS="$CFLAGS +DAportable +DS1.1"
1405 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1407 DEFAULT_IMPL_STRATEGY=_PTH
1410 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1413 AC_DEFINE(_LARGEFILE64_SOURCE)
1414 AC_DEFINE(_PR_HAVE_OFF64_T)
1415 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1416 if test -z "$GNU_CC"; then
1417 if test -z "$USE_64"; then
1418 if test "$OS_TEST" = "ia64"; then
1419 CFLAGS="$CFLAGS +DD32"
1420 CXXFLAGS="$CXXFLAGS +DD32"
1422 CFLAGS="$CFLAGS +DAportable +DS2.0"
1423 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1426 if test "$OS_TEST" = "ia64"; then
1427 CFLAGS="$CFLAGS +DD64"
1428 CXXFLAGS="$CXXFLAGS +DD64"
1430 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1431 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1435 DEFAULT_IMPL_STRATEGY=_PTH
1438 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1442 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1444 if test "$USE_NSPR_THREADS"; then
1447 if test "$USE_USER_PTHREADS"; then
1457 AC_DEFINE(_SGI_MP_SOURCE)
1458 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1460 PR_MD_ASFILES=os_Irix.s
1461 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1463 RESOLVE_LINK_SYMBOLS=1
1464 if test -n "$USE_64"; then
1465 MDCPUCFG_H=_irix64.cfg
1467 MDCPUCFG_H=_irix32.cfg
1469 case "${target_os}" in
1486 if test "$GNU_CC"; then
1488 dnl If we are using gcc with native binutils, we need to
1490 dnl #lineno "filename" num num
1491 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1492 dnl gcc command line, which passes -P to the preprocessor.
1494 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1495 CFLAGS="$CFLAGS -Wall -Wno-format"
1496 _OPTIMIZE_FLAGS="-O6"
1498 if test -n "$USE_N32"; then
1499 AS='as -D_ASM $(INCLUDES) -n32'
1501 AS='as -D_ASM $(INCLUDES)'
1503 CFLAGS="$CFLAGS -fullwarn -xansi"
1504 if test "$USE_N32"; then
1505 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1507 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1509 if test "$USE_MDUPDATE"; then
1510 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1514 CFLAGS="$CFLAGS -multigot"
1515 DSO_LDOPTS="-no_unresolved"
1516 if test "$USE_N32"; then
1517 CFLAGS="$CFLAGS -n32 -woff 1209"
1518 DSO_LDOPTS="$DSO_LDOPTS -n32"
1520 if test "$USE_64"; then
1521 CFLAGS="$CFLAGS -64"
1523 CFLAGS="$CFLAGS -32"
1528 CFLAGS="$CFLAGS -xgot"
1532 if test "${target_os}" = "irix5.3"; then
1535 case "${target_os}" in
1537 if test -z "$GNU_CC"; then
1538 CFLAGS="$CFLAGS -mips3"
1540 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1541 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1542 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1547 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1553 if test -z "$USE_NSPR_THREADS"; then
1558 AC_DEFINE(_GNU_SOURCE)
1559 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1561 CFLAGS="$CFLAGS -Wall"
1562 CXXFLAGS="$CXXFLAGS -Wall"
1563 MDCPUCFG_H=_linux.cfg
1565 MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@'
1567 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1569 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1570 # combo is not yet good at debugging inlined
1571 # functions (even when using DWARF2 as the
1579 *-linux*|*-gnu*|*-k*bsd*-gnu)
1580 if test -z "$USE_NSPR_THREADS"; then
1585 AC_DEFINE(_GNU_SOURCE)
1586 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1587 case "${target_os}" in
1592 CFLAGS="$CFLAGS -Wall"
1593 CXXFLAGS="$CXXFLAGS -Wall"
1594 MDCPUCFG_H=_linux.cfg
1596 MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@'
1598 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1600 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1601 # combo is not yet good at debugging inlined
1602 # functions (even when using DWARF2 as the
1605 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1610 CPU_ARCH_TAG=_${CPU_ARCH}
1611 case "${target_cpu}" in
1615 CFLAGS="$CFLAGS -mieee"
1616 CXXFLAGS="$CXXFLAGS -mieee"
1620 PR_MD_ASFILES=os_Linux_x86.s
1623 PR_MD_ASFILES=os_Linux_ia64.s
1626 if test -n "$USE_64"; then
1627 PR_MD_ASFILES=os_Linux_x86_64.s
1630 PR_MD_ASFILES=os_Linux_x86.s
1636 PR_MD_ASFILES=os_Linux_ppc.s
1639 if test -n "$USE_64"; then
1643 PR_MD_ASFILES=os_Linux_ppc.s
1647 CFLAGS="$CFLAGS -m68020-60"
1648 CXXFLAGS="$CXXFLAGS -m68020-60"
1653 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1656 PR_MD_ARCH_DIR=windows
1657 RESOLVE_LINK_SYMBOLS=1
1659 if test -n "$GNU_CC"; then
1660 CC="$CC -mno-cygwin"
1661 CXX="$CXX -mno-cygwin"
1663 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1665 # Use temp file for windres (bug 213281)
1666 RCFLAGS='-O coff --use-temp-file'
1671 AR='lib -NOLOGO -OUT:"$@"'
1673 RANLIB='echo not_ranlib'
1674 STRIP='echo not_strip'
1676 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1681 # Determine compiler version
1683 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1685 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1686 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1687 _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1688 _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1689 _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1690 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1692 if test "$_CC_MAJOR_VERSION" -eq "14"; then
1693 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1694 dnl so be very specific here!
1695 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1696 if test $_CC_RELEASE -gt 50727; then
1698 elif test $_CC_BUILD -ge 762; then
1701 elif test $_CC_MAJOR_VERSION -ge 15; then
1705 if test -n "$_USE_DYNAMICBASE"; then
1706 DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1709 # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1710 # tape manipulation utility (or something else)
1711 if test "$MSC_VER" -ge "1400"; then
1713 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1716 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1717 if test -n "$MSMT_TOOL"; then
1718 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1719 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1720 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1725 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1729 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1730 DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1734 PROFILE_GEN_CFLAGS="-GL"
1735 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1736 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1737 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1739 if test -z "$MOZ_OPTIMIZE"; then
1740 CFLAGS="$CFLAGS -Od"
1743 if test -n "$USE_DEBUG_RTL"; then
1744 CFLAGS="$CFLAGS -MDd"
1746 CFLAGS="$CFLAGS -MD"
1749 if test -n "$MOZ_DEBUG"; then
1752 DEFINES="$DEFINES -U_DEBUG"
1755 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1756 if test -n "$MOZ_OPTIMIZE"; then
1757 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1758 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1760 DLLFLAGS="$DLLFLAGS -DEBUG"
1761 LDFLAGS="$LDFLAGS -DEBUG"
1765 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1766 if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1767 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
1770 if test "$OS_TARGET" = "WINNT"; then
1771 CFLAGS="$CFLAGS -GT"
1772 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1773 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1775 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1776 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1780 if test -n "$USE_STATIC_TLS"; then
1781 AC_DEFINE(_PR_USE_STATIC_TLS)
1784 if test "$OS_TARGET" = "WINNT"; then
1788 # undefine WINNT as some versions of mingw gcc define it by default
1789 DEFINES="$DEFINES -UWINNT"
1790 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1793 if test "$CPU_ARCH" = "x86"; then
1796 CPU_ARCH_TAG=$CPU_ARCH
1799 if test -n "$USE_DEBUG_RTL"; then
1803 case "$OS_TARGET" in
1805 MDCPUCFG_H=_winnt.cfg
1808 MDCPUCFG_H=_win95.cfg
1811 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
1815 case "$target_cpu" in
1817 if test -n "$USE_64"; then
1832 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
1841 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1843 AR_FLAGS='-NOLOGO -OUT:"$@"'
1848 MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
1850 PR_MD_ARCH_DIR=windows
1851 RESOLVE_LINK_SYMBOLS=1
1853 MDCPUCFG_H=_win95.cfg
1854 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1855 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1857 DLLFLAGS='-OUT:"$@"'
1858 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1859 OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1860 OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
1861 DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
1873 if test "$OS_RELEASE" = "2.03"; then
1874 AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
1876 AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
1879 if test -z "$GNU_CC"; then
1880 CFLAGS="$CFLAGS -Hnocopyr"
1881 CXXFLAGS="$CXXFLAGS -Hnocopyr"
1883 CFLAGS="$CFLAGS -fPIC -Wall"
1884 CXXFLAGS="$CXXFLAGS -fPIC -Wall"
1898 if test -z "$GNU_CC"; then
1899 CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
1902 OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
1911 AC_DEFINE(HAVE_BSD_FLOCK)
1912 if test -z "$USE_NSPR_THREADS"; then
1915 MDCPUCFG_H=_netbsd.cfg
1916 PR_MD_CSRCS=netbsd.c
1918 DSO_CFLAGS='-fPIC -DPIC'
1919 CFLAGS="$CFLAGS -ansi -Wall"
1920 CXXFLAGS="$CXXFLAGS -ansi -Wall"
1921 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1923 if test -z "$OBJECT_FMT"; then
1924 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
1927 DSO_LDOPTS='-shared'
1931 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
1935 if test "$LIBRUNPATH"; then
1936 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
1947 AC_DEFINE(HAVE_SVID_GETTOD)
1949 CFLAGS="$CFLAGS -Xa -fullwarn"
1950 CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
1952 MDCPUCFG_H=_sony.cfg
1956 *-nextstep*|*-openstep*)
1959 AC_DEFINE(HAVE_BSD_FLOCK)
1960 AC_DEFINE(_POSIX_SOURCE)
1961 CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
1962 CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
1965 MDCPUCFG_H=_nextstep.cfg
1966 PR_MD_CSRCS=nextstep.c
1973 AC_DEFINE(_QNX_SOURCE)
1974 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1977 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
1980 OS_LIBS="$OS_LIBS -lsocket"
1981 _OPTIMIZE_FLAGS="-O1"
1982 _DEBUG_FLAGS="-gstabs"
1988 AC_DEFINE(HAVE_BSD_FLOCK)
1989 AC_DEFINE(HAVE_SOCKLEN_T)
1990 CFLAGS="$CFLAGS -ansi -Wall"
1991 CXXFLAGS="$CXXFLAGS -ansi -Wall"
1994 MDCPUCFG_H=_openbsd.cfg
1995 PR_MD_CSRCS=openbsd.c
1997 if test -z "$USE_NSPR_THREADS"; then
2000 DSO_LDOPTS='-shared -fPIC'
2001 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2005 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2008 AC_DEFINE(_REENTRANT)
2009 # OSF1 and HPUX report the POLLHUP event for a socket when the
2010 # shutdown(SHUT_WR) operation is called for the remote end, even though
2011 # the socket is still writeable. Use select(), instead of poll(), to
2012 # workaround this problem.
2013 AC_DEFINE(_PR_POLL_WITH_SELECT)
2015 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2019 if test -z "$GNU_CC"; then
2020 CC="$CC -std1 -ieee_with_inexact"
2021 if test "$OS_RELEASE" != "V2.0"; then
2022 CC="$CC -readonly_strings"
2024 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2025 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2027 CFLAGS="$CFLAGS -mieee"
2028 CXXFLAGS="$CXXFLAGS -mieee"
2031 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2032 AC_DEFINE(HAVE_INT_LOCALTIME_R)
2034 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2035 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2037 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2038 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2040 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2041 MDCPUCFG_H=_osf1.cfg
2048 AC_DEFINE(_PR_NEED_H_ERRNO)
2057 AC_DEFINE(_PR_NEED_H_ERRNO)
2059 MDCPUCFG_H=_riscos.cfg
2060 PR_MD_CSRCS=riscos.c
2062 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2063 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2072 AC_DEFINE(_PR_NEED_H_ERRNO)
2073 CC='cc -b elf -KPIC'
2074 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2077 DSO_LDOPTS='-b elf -G'
2078 MDCPUCFG_H=_scoos.cfg
2086 AC_DEFINE(RELIANTUNIX)
2088 AC_DEFINE(HAVE_SVID_GETTOD)
2089 if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
2096 if test "$GNU_CC"; then
2097 AS='$(CC) -x assembler-with-cpp'
2098 if test "$CPU_ARCH" = "mips"; then
2101 CFLAGS="$CFLAGS -Wall -Wno-format"
2104 _OPTIMIZE_FLAGS='-O -F Olimit,4000'
2107 DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
2109 if test "$OS_RELEASE" = "5.43"; then
2110 AC_DEFINE(IP_MULTICAST)
2113 OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
2115 MDCPUCFG_H=_reliantunix.cfg
2116 PR_MD_CSRCS=reliantunix.c
2117 if test "${OS_ARCH}" = "mips"; then
2118 PR_MD_ASFILES=os_ReliantUNIX.s
2125 CFLAGS="$CFLAGS -Wall -Wno-format"
2126 if test "$USE_MDUPDATE"; then
2127 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2134 if test "$OS_RELEASE" = "4.1.3_U1"; then
2136 OS_LIBS="$OS_LIBS -lm"
2138 MDCPUCFG_H=_sunos4.cfg
2139 PR_MD_CSRCS=sunos4.c
2143 if test -z "$USE_NSPR_THREADS"; then
2152 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2154 MDCPUCFG_H=_solaris.cfg
2155 PR_MD_CSRCS=solaris.c
2157 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2158 RESOLVE_LINK_SYMBOLS=1
2159 case "${OS_RELEASE}" in
2163 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2167 if test -n "$GNU_CC"; then
2169 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2172 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2173 if test -n "$USE_B_DIRECT"; then
2174 DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2178 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2179 if test -n "$USE_B_DIRECT"; then
2180 DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2183 if test -n "$GNU_CC"; then
2184 CFLAGS="$CFLAGS -Wall"
2185 CXXFLAGS="$CXXFLAGS -Wall"
2186 if test -n "$USE_MDUPDATE"; then
2187 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2188 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2190 GCC_AS=`$CC -print-prog-name=as`
2191 if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2195 CFLAGS="$CFLAGS -xstrconst"
2196 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2197 if test -z "$MOZ_OPTIMIZE"; then
2198 CFLAGS="$CFLAGS -xs"
2199 CXXFLAGS="$CXXFLAGS -xs"
2201 _OPTIMIZE_FLAGS=-xO4
2203 if test -z "$GNU_AS"; then
2204 ASFLAGS="$ASFLAGS -Wa,-P"
2206 if test -n "$USE_64"; then
2207 if test -n "$GNU_CC"; then
2211 if test "$OS_TEST" = "i86pc"; then
2212 CC="$CC -xarch=amd64"
2213 CXX="$CXX -xarch=amd64"
2216 CXX="$CXX -xarch=v9"
2220 if test "$OS_TEST" = "i86pc"; then
2221 if test -z "$USE_64"; then
2224 CPU_ARCH_TAG=_$OS_TEST
2225 # The default debug format, DWARF (-g), is not supported by gcc
2226 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
2227 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2228 # If your gcc uses GNU as, you do not need the -Wa,-s option.
2229 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2230 _DEBUG_FLAGS=-gstabs
2231 if test -z "$GNU_AS"; then
2232 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2236 case "${target_os}" in
2238 AC_DEFINE(_PR_NO_LARGE_FILES)
2241 AC_DEFINE(_PR_NO_LARGE_FILES)
2244 AC_DEFINE(SOLARIS2_5)
2247 AC_DEFINE(_PR_HAVE_OFF64_T)
2248 # The lfcompile64(5) man page on Solaris 2.6 says:
2249 # For applications that do not wish to conform to the POSIX or
2250 # X/Open specifications, the 64-bit transitional interfaces
2251 # are available by default. No compile-time flags need to be
2253 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2254 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2255 if test -n "$GNU_CC"; then
2256 AC_DEFINE(_LARGEFILE64_SOURCE)
2260 case "${target_os}" in
2272 # Solaris 8 or higher has IPv6.
2273 AC_DEFINE(_PR_INET6)
2276 if test "$CPU_ARCH" = "sparc"; then
2277 # 64-bit Solaris SPARC requires V9 architecture, so the following
2279 if test -z "$USE_64"; then
2280 ULTRASPARC_LIBRARY=nspr_flt
2283 # Purify requires that binaries linked against nspr also
2284 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2286 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2287 OS_LIBS="$OS_LIBS $_librt"
2296 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2297 AC_DEFINE(_PR_NO_LARGE_FILES)
2298 CC='$(NSDEPTH)/build/hcc cc'
2299 CXX='$(NSDEPTH)/build/hcpp CC'
2300 MDCPUCFG_H=_unixware.cfg
2302 AC_DEFINE(_LARGEFILE64_SOURCE)
2303 AC_DEFINE(_PR_HAVE_OFF64_T)
2304 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2305 MDCPUCFG_H=_unixware7.cfg
2307 PR_MD_CSRCS=unixware.c
2313 AC_ARG_WITH(symbian-sdk,
2314 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
2315 The path to the Symbian SDK],
2316 SYMBIAN_SDK_DIR=$withval)
2318 echo -----------------------------------------------------------------------------
2319 echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2320 echo -----------------------------------------------------------------------------
2325 AC_DEFINE(__SYMBIAN32__)
2328 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2329 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2330 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2331 AC_DEFINE(HAVE_SOCKLEN_T)
2339 MDCPUCFG_H=_symbian.cfg
2340 PR_MD_CSRCS=symbian.c
2342 RANLIB='echo no ranlib '
2345 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2346 CFLAGS="$CFLAGS -MD -nostdinc"
2347 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2348 echo -------------------------------------------------------
2349 echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2350 echo -------------------------------------------------------
2351 case "$OS_TARGET" in
2357 WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2358 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)"
2359 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2360 AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2364 AC_DEFINE(__WINSCW__)
2365 DEFINES="$DEFINES -U_WIN32"
2368 CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2369 CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2370 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2373 DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2376 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2379 CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2385 AC_DEFINE(BSD_SELECT)
2386 AC_DEFINE(TCPV40HDRS)
2394 RESOLVE_LINK_SYMBOLS=1
2399 CFLAGS="$CFLAGS -Wall -Zomf"
2400 CXXFLAGS="$CFLAGS -Wall -Zomf"
2401 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2403 DSO_LDOPTS='-Zomf -Zdll'
2405 _OPTIMIZE_FLAGS="-O2 -s"
2406 _DEBUG_FLAGS="-g -fno-inline"
2407 if test -n "$MOZ_OPTIMIZE"; then
2408 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2412 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2413 LDFLAGS="$LDFLAGS -Zhigh-mem"
2414 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2417 # GCC for OS/2 currently predefines these, but we don't want them
2418 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2427 if test -z "$SKIP_LIBRARY_CHECKS"; then
2428 dnl ========================================================
2429 dnl Check for system libraries
2430 dnl ========================================================
2431 dnl AC_CHECK_LIB(C, main)
2432 dnl AC_CHECK_LIB(C_r, main)
2433 dnl AC_CHECK_LIB(c, main)
2434 dnl AC_CHECK_LIB(c_r, main)
2435 dnl AC_CHECK_LIB(dce, main)
2436 dnl AC_CHECK_LIB(dl, main)
2437 dnl AC_CHECK_LIB(dld, main)
2438 dnl AC_CHECK_LIB(gen, main)
2439 dnl AC_CHECK_LIB(ip6, main)
2440 dnl AC_CHECK_LIB(l, main)
2441 dnl AC_CHECK_LIB(m, main)
2442 dnl AC_CHECK_LIB(nsl, main)
2443 dnl AC_CHECK_LIB(posix4, main)
2444 dnl AC_CHECK_LIB(prstrms, main)
2445 dnl AC_CHECK_LIB(prstrms_shr, main)
2446 dnl AC_CHECK_LIB(pthread, main)
2447 dnl AC_CHECK_LIB(pthreads, main)
2448 dnl AC_CHECK_LIB(resolv, main)
2449 dnl AC_CHECK_LIB(rt, main)
2450 dnl AC_CHECK_LIB(socket, main)
2451 dnl AC_CHECK_LIB(svld, main)
2452 dnl AC_CHECK_LIB(thread, main)
2453 dnl AC_CHECK_LIB(vms_jackets, main)
2456 dnl We don't want anything to link with libdl even if it's present on OS X,
2457 dnl since it's not used and not part of the default installation.
2458 dnl The same goes for BeOS.
2459 dnl OS/2 has dlfcn in libc.
2462 *-darwin*|*-beos*|*-os2*)
2465 AC_CHECK_LIB(dl, dlopen,
2466 AC_CHECK_HEADER(dlfcn.h,
2467 OS_LIBS="-ldl $OS_LIBS"))
2472 dnl ========================================================
2473 dnl Check for system header files.
2474 dnl ========================================================
2475 dnl AC_HEADER_DIRENT
2477 dnl AC_HEADER_SYS_WAIT
2478 dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2480 dnl ========================================================
2481 dnl Check for typedefs and structs
2482 dnl ========================================================
2489 dnl AC_STRUCT_ST_BLKSIZE
2490 dnl AC_STRUCT_ST_BLOCKS
2491 dnl AC_STRUCT_ST_RDEV
2495 dnl ========================================================
2496 dnl Checks for library functions.
2497 dnl ========================================================
2498 AC_PROG_GCC_TRADITIONAL
2499 AC_CHECK_FUNCS(lchown strerror)
2503 dnl AC_FUNC_SETVBUF_REVERSED
2505 dnl AC_FUNC_STRFTIME
2506 dnl AC_FUNC_UTIME_NULL
2508 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2510 dnl ========================================================
2512 dnl ========================================================
2514 dnl ========================================================
2516 dnl = --enable-strip
2518 dnl = Enable stripping of libs and executables
2520 dnl ========================================================
2521 AC_ARG_ENABLE(strip,
2522 [ --enable-strip Enable stripping of shared libs and programs],
2523 [ if test "$enableval" = "yes"; then
2527 dnl Check for hpux options
2528 case "${target_os}" in
2530 if test -z "$GNU_CC"; then
2532 AC_CACHE_CHECK(for +Olit support,
2533 ac_cv_hpux_usable_olit_option,
2534 dnl since aCC doesn't throw an error on invalid options,
2535 dnl we have to test this the hard way
2536 [ac_cv_hpux_usable_olit_option=no
2538 echo 'int main() { return 0; }' | cat > conftest.c
2539 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2540 if test $? -eq 0; then
2541 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2542 ac_cv_hpux_usable_olit_option=yes
2548 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2549 CFLAGS="$CFLAGS +Olit=all"
2550 CXXFLAGS="$CXXFLAGS +Olit=all"
2552 CFLAGS="$CFLAGS +ESlit"
2553 CXXFLAGS="$CXXFLAGS +ESlit"
2560 dnl Apparently, some systems cannot properly check for the pthread
2561 dnl library unless <pthread.h> is included so we need to test
2564 dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2565 AC_DEFUN(MOZ_CHECK_PTHREADS,
2567 AC_MSG_CHECKING([for pthread_create in -l$1])
2569 #include <pthread.h>
2570 void *foo(void *v) { return v; }
2573 if (!pthread_create(&t, 0, &foo, 0)) {
2578 echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2579 ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2581 rm -f dummy.c dummy${ac_exeext} ;
2582 if test "$_res" = "0"; then
2583 AC_MSG_RESULT([yes])
2591 case "$target_os" in
2599 MOZ_CHECK_PTHREADS(pthreads,
2600 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2601 MOZ_CHECK_PTHREADS(pthread,
2602 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2603 MOZ_CHECK_PTHREADS(c_r,
2604 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2605 MOZ_CHECK_PTHREADS(c,
2614 AC_ARG_WITH(pthreads,
2615 [ --with-pthreads Use system pthreads library as thread subsystem],
2616 [ if test "$withval" = "yes"; then
2617 if test -n "$_HAVE_PTHREADS"; then
2622 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2628 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2634 AC_ARG_ENABLE(user-pthreads,
2635 [ --enable-user-pthreads Build using userland pthreads],
2636 [ if test "$enableval" = "yes"; then
2637 if test -n "$_HAVE_PTHREADS"; then
2642 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2646 AC_ARG_ENABLE(nspr-threads,
2647 [ --enable-nspr-threads Build using classic nspr threads],
2648 [ if test "$enableval" = "yes"; then
2656 AC_ARG_WITH(bthreads,
2657 [ --with-bthreads Use system bthreads library as thread subsystem
2659 [ if test "$withval" = "yes"; then
2667 fi # SKIP_LIBRARY_CHECKS
2670 [ --enable-ipv6 Compile ipv6 support],
2671 [ if test "$enableval" = "yes"; then
2678 AC_ARG_ENABLE(boehm,
2679 [ --enable-boehm Enable the Boehm Garbage Collector],
2680 [ if test "$enableval" = "yes"; then
2681 AC_DEFINE(GC_LEAK_DETECTOR)
2685 if test -n "$USE_PTHREADS"; then
2686 dnl See if -pthread is supported.
2688 ac_cv_have_dash_pthread=no
2689 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2690 echo 'int main() { return 0; }' | cat > conftest.c
2691 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2692 if test $? -eq 0; then
2693 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2694 ac_cv_have_dash_pthread=yes
2695 case "$target_os" in
2697 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2700 CFLAGS="$CFLAGS -pthread"
2701 CXXFLAGS="$CXXFLAGS -pthread"
2707 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2710 dnl See if -pthreads is supported.
2712 ac_cv_have_dash_pthreads=no
2713 if test "$ac_cv_have_dash_pthread" = "no"; then
2714 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2715 echo 'int main() { return 0; }' | cat > conftest.c
2716 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2717 if test $? -eq 0; then
2718 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2719 ac_cv_have_dash_pthreads=yes
2720 CFLAGS="$CFLAGS -pthreads"
2721 CXXFLAGS="$CXXFLAGS -pthreads"
2725 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2730 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2735 AC_DEFINE(_REENTRANT)
2736 AC_DEFINE(_THREAD_SAFE)
2737 dnl -pthread links in -lc_r, so don't specify it explicitly.
2738 if test "$ac_cv_have_dash_pthread" = "yes"; then
2739 _PTHREAD_LDFLAGS="-pthread"
2741 _PTHREAD_LDFLAGS="-lc_r"
2745 if test "$ac_cv_have_dash_pthread" = "yes"; then
2746 _PTHREAD_LDFLAGS="-pthread"
2750 AC_DEFINE(_THREAD_SAFE)
2751 dnl -pthread links in -lc_r, so don't specify it explicitly.
2752 if test "$ac_cv_have_dash_pthread" = "yes"; then
2757 if test "$ac_cv_have_dash_pthread" = "yes"; then
2758 _PTHREAD_LDFLAGS=-pthread
2761 *-linux*|*-gnu*|*-k*bsd*-gnu)
2762 AC_DEFINE(_REENTRANT)
2767 if test -n "$USE_USER_PTHREADS"; then
2774 dnl Special thread exceptions
2778 if test -n "$USE_NSPR_THREADS"; then
2779 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2781 case "$target_os" in
2783 if test -z "$USE_PTHREADS"; then
2784 AC_DEFINE(AIX_RENAME_SELECT)
2788 if test -z "$USE_NSPR_THREADS"; then
2789 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2793 if test -z "$USE_NSPR_THREADS"; then
2794 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2796 if test -n "$USE_PTHREADS"; then
2797 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2801 if test -z "$USE_NSPR_THREADS"; then
2802 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2804 if test -n "$USE_PTHREADS"; then
2805 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2811 if test -n "$USE_PTHREADS"; then
2812 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2816 if test -n "$USE_NSPR_THREADS"; then
2817 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2821 if test -n "$USE_NSPR_THREADS"; then
2822 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2824 if test "$USE_PTHREADS"; then
2825 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2826 AC_DEFINE(_REENTRANT)
2827 AC_DEFINE(_PR_DCETHREADS)
2829 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2830 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2833 if test "$USE_USER_PTHREADS"; then
2834 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2838 if test "${target_os}" = "irix6.5"; then
2839 if test -n "$USE_PTHREADS"; then
2840 AC_DEFINE(_PR_HAVE_GETHOST_R)
2841 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2845 *-linux*|*-gnu*|*-k*bsd*-gnu)
2846 if test -n "$USE_NSPR_THREADS"; then
2847 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2850 *-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*|*-os2*|*-beos*)
2851 dnl win32, wince, os2 & beos cannot use pthreads
2856 *-netbsd*|*-openbsd*)
2857 if test -n "$USE_NSPR_THREADS"; then
2858 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2862 if test -n "$USE_NSPR_THREADS"; then
2863 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2865 if test -n "$USE_PTHREADS"; then
2866 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2869 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2874 if test -n "$USE_NSPR_THREADS"; then
2875 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2877 if test -n "$USE_PTHREADS"; then
2878 AC_DEFINE(_REENTRANT)
2879 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2880 if test "$OS_TEST" = "i86pc"; then
2881 if test -n "$USE_64"; then
2882 PR_MD_ASFILES=os_SunOS_x86_64.s
2884 PR_MD_ASFILES=os_SunOS_x86.s
2887 if test -n "$USE_64"; then
2888 PR_MD_ASFILES=os_SunOS_sparcv9.s
2894 if test -n "$USE_PTHREADS"; then
2895 AC_DEFINE(_PR_HAVE_GETHOST_R)
2896 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2901 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
2903 dnl If the user passed in arg to --enable-optimize or --enable-debug,
2904 dnl make sure that we use it.
2905 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
2906 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
2909 if test -n "$_SAVE_DEBUG_FLAGS"; then
2910 _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
2913 if test -n "$MOZ_OPTIMIZE"; then
2914 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
2915 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
2918 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2919 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
2920 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
2923 if test -n "$MOZ_OPTIMIZE"; then
2929 if test -n "$USE_64"; then
2933 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
2935 dnl ========================================================
2936 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
2937 dnl ========================================================
2938 case "$target_os" in
2940 CC="\$(CYGWIN_WRAPPER) $CC"
2941 CXX="\$(CYGWIN_WRAPPER) $CXX"
2942 RC="\$(CYGWIN_WRAPPER) $RC"
2946 dnl ========================================================
2947 dnl = Use malloc wrapper lib
2948 dnl ========================================================
2949 AC_ARG_ENABLE(wrap-malloc,
2950 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
2951 [ if test "$enableval" = "yes"; then
2955 if test -n "$_WRAP_MALLOC"; then
2956 if test "$GNU_CC"; then
2957 WRAP_MALLOC_CFLAGS="${LDFLAGS} -Wl,--wrap -Wl,malloc -Wl,--wrap -Wl,calloc -Wl,--wrap -Wl,valloc -Wl,--wrap -Wl,free -Wl,--wrap -Wl,realloc -Wl,--wrap -Wl,memalign -Wl,--wrap -Wl,__builtin_new -Wl,--wrap -Wl,__builtin_vec_new -Wl,--wrap -Wl,__builtin_delete -Wl,--wrap -Wl,__builtin_vec_delete -Wl,--wrap -Wl,PR_Free -Wl,--wrap -Wl,PR_Malloc -Wl,--wrap -Wl,PR_Calloc -Wl,--wrap -Wl,PR_Realloc -Wl,--wrap -Wl,strdup -Wl,--wrap -Wl,strndup -Wl,--wrap -Wl,posix_memalign"
2958 DSO_LDOPTS="$DSO_LDOPTS $WRAP_MALLOC_CFLAGS"
2960 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
2964 dnl ========================================================
2965 dnl = Location of malloc wrapper lib
2966 dnl ========================================================
2967 AC_ARG_WITH(wrap-malloc,
2968 [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
2969 WRAP_MALLOC_LIB=$withval)
2971 dnl ========================================================
2972 dnl Substitution of found variables.
2973 dnl ========================================================
2974 AC_SUBST(SHELL_OVERRIDE)
2976 AC_SUBST(MOZILLA_CLIENT)
2983 AC_SUBST(HOST_CFLAGS)
2985 AC_SUBST(HOST_LDFLAGS)
2987 AC_SUBST(GCC_USE_GNU_LD)
2989 AC_SUBST(CROSS_COMPILE)
2991 AC_SUBST(MOZ_OPTIMIZE)
2993 AC_SUBST(MOZ_DEBUG_SYMBOLS)
2999 AC_SUBST(OBJECT_MODE)
3000 AC_SUBST(GC_LEAK_DETECTOR)
3001 AC_SUBST(ENABLE_STRIP)
3003 AC_SUBST(USE_PTHREADS)
3004 AC_SUBST(USE_BTHREADS)
3005 AC_SUBST(USE_USER_PTHREADS)
3006 AC_SUBST(USE_NSPR_THREADS)
3011 AC_SUBST(MOD_MAJOR_VERSION)
3012 AC_SUBST(MOD_MINOR_VERSION)
3013 AC_SUBST(MOD_PATCH_VERSION)
3014 AC_SUBST(NSPR_MODNAME)
3015 AC_SUBST(MDCPUCFG_H)
3016 AC_SUBST(PR_MD_CSRCS)
3017 AC_SUBST(PR_MD_ASFILES)
3018 AC_SUBST(PR_MD_ARCH_DIR)
3021 AC_SUBST(OBJ_SUFFIX)
3022 AC_SUBST(LIB_SUFFIX)
3023 AC_SUBST(DLL_SUFFIX)
3024 AC_SUBST(ASM_SUFFIX)
3025 AC_SUBST(WRAP_MALLOC_CFLAGS)
3026 AC_SUBST(WRAP_MALLOC_LIB)
3028 AC_SUBST(DSO_CFLAGS)
3029 AC_SUBST(DSO_LDOPTS)
3033 AC_SUBST(OS_RELEASE)
3035 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3050 AC_SUBST(PROFILE_GEN_CFLAGS)
3051 AC_SUBST(PROFILE_GEN_LDFLAGS)
3052 AC_SUBST(PROFILE_USE_CFLAGS)
3053 AC_SUBST(PROFILE_USE_LDFLAGS)
3056 AC_SUBST(RESOLVE_LINK_SYMBOLS)
3057 AC_SUBST(AIX_LINK_OPTS)
3058 AC_SUBST(NOSUCHFILE)
3059 AC_SUBST(MOZ_OBJFORMAT)
3060 AC_SUBST(ULTRASPARC_LIBRARY)
3063 AC_SUBST(OBJDIR_NAME)
3064 AC_SUBST(RELEASE_OBJDIR_NAME)
3071 AC_SUBST(OS_DLLFLAGS)
3072 AC_SUBST(CYGWIN_WRAPPER)
3073 AC_SUBST(VISIBILITY_FLAGS)
3074 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3075 AC_SUBST(MACOS_SDK_DIR)
3076 AC_SUBST(SYMBIAN_SDK_DIR)
3080 dnl ========================================================
3081 dnl Generate output files.
3082 dnl ========================================================
3093 lib/libc/include/Makefile
3094 lib/libc/src/Makefile
3098 pkg/solaris/Makefile
3099 pkg/solaris/SUNWpr/Makefile
3100 pkg/solaris/SUNWprd/Makefile
3103 pr/include/md/Makefile
3104 pr/include/obsolete/Makefile
3105 pr/include/private/Makefile
3108 pr/src/linking/Makefile
3109 pr/src/malloc/Makefile
3111 pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3112 pr/src/memory/Makefile
3113 pr/src/misc/Makefile
3114 pr/src/threads/Makefile
3116 pr/tests/dll/Makefile
3119 dnl lib/tests/Makefile
3120 dnl pr/tests/w16gui/Makefile
3123 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3124 MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
3125 elif test -n "$USE_PTHREADS"; then
3126 MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"
3127 elif test -n "$USE_BTHREADS"; then
3128 MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
3131 if test -n "$USE_CPLUS"; then
3132 MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
3135 echo $MAKEFILES > unallmakefiles
3137 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])