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
197 WRAP_MALLOC_CFLAGS="-Wl,--wrap=dlopen -Wl,--wrap=dlclose -Wl,--wrap=dlerror -Wl,--wrap=dlsym -Wl,--wrap=dladdr"
202 dnl ========================================================
204 dnl = Check options that may affect the compiler
206 dnl ========================================================
207 dist_prefix='${MOD_DEPTH}/dist'
208 dist_bindir='${dist_prefix}/bin'
209 dist_includedir='${dist_prefix}/include/nspr'
210 dist_libdir='${dist_prefix}/lib'
211 dnl If the --includedir option was not specified, add '/nspr' to autoconf's
212 dnl default value of includedir.
213 if test "${includedir}" = '${prefix}/include'; then
214 includedir='${prefix}/include/nspr'
217 AC_ARG_WITH(dist-prefix,
218 [ --with-dist-prefix=DIST_PREFIX
219 place build files in DIST_PREFIX [dist]],
220 dist_prefix=$withval)
222 AC_ARG_WITH(dist-bindir,
223 [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
224 dist_bindir=$withval)
226 AC_ARG_WITH(dist-includedir,
227 [ --with-dist-includedir=DIR
228 build include files in DIR [DIST_PREFIX/include/nspr]],
229 dist_includedir=$withval)
231 AC_ARG_WITH(dist-libdir,
232 [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
233 dist_libdir=$withval)
235 AC_SUBST(dist_prefix)
236 AC_SUBST(dist_bindir)
237 AC_SUBST(dist_includedir)
238 AC_SUBST(dist_libdir)
240 dnl Check if NSPR is being compiled for Mozilla
241 dnl Let --with-arg override environment setting
244 [ --with-mozilla Compile NSPR with Mozilla support],
245 [ if test "$withval" = "yes"; then
246 AC_DEFINE(MOZILLA_CLIENT)
251 [ if test -n "$MOZILLA_CLIENT"; then
252 AC_DEFINE(MOZILLA_CLIENT)
255 AC_ARG_ENABLE(optimize,
256 [ --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ],
257 [ if test "$enableval" != "no"; then
259 if test -n "$enableval" -a "$enableval" != "yes"; then
260 _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
261 _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
268 [ --enable-debug[=DBG] Enable debugging (using compiler flags DBG)],
269 [ if test "$enableval" != "no"; then
272 if test -n "$enableval" -a "$enableval" != "yes"; then
273 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
274 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
281 AC_ARG_ENABLE(debug-symbols,
282 [ --enable-debug-symbols[=DBG] Enable debugging symbols
283 (using compiler flags DBG)],
284 [ if test "$enableval" != "no"; then
286 if test -n "$enableval" -a "$enableval" != "yes"; then
287 if test -z "$_SAVE_DEBUG_FLAGS"; then
288 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
289 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
291 AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
298 AC_ARG_ENABLE(win32-target,
299 [ --enable-win32-target=\$t
300 Specify win32 flavor. (WIN95 or WINNT)],
301 OS_TARGET=`echo $enableval | tr a-z A-Z`)
303 AC_ARG_ENABLE(symbian-target,
304 [ --enable-symbian-target=\$t
305 Specify symbian flavor. (WINSCW or GCCE)],
306 OS_TARGET=`echo $enableval | tr a-z A-Z`)
308 AC_ARG_ENABLE(debug-rtl,
309 [ --enable-debug-rtl Use the MSVC debug runtime library],
310 [ if test "$enableval" = "yes"; then
315 [ --enable-n32 Enable n32 ABI support (IRIX only)],
316 [ if test "$enableval" = "yes"; then
318 else if test "$enableval" = "no"; then
324 [ --enable-64bit Enable 64-bit support (on certain platforms)],
325 [ if test "$enableval" = "yes"; then
329 AC_ARG_ENABLE(mdupdate,
330 [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
331 [ if test "$enableval" = "yes"; then
336 [ --enable-cplus Enable some c++ api routines],
337 [ if test "$enableval" = "yes"; then
341 AC_ARG_WITH(arm-kuser,
342 [ --with-arm-kuser Use kuser helpers (Linux/ARM only)
343 (Requires kernel 2.6.13 or later)],
344 [ if test "$withval" = "yes"; then
345 AC_DEFINE(_PR_ARM_KUSER)
348 dnl ========================================================
349 dnl = Mac OS X SDK support
350 dnl ========================================================
351 AC_ARG_WITH(macos-sdk,
352 [ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
353 MACOS_SDK_DIR=$withval)
355 AC_ARG_ENABLE(macos-target,
356 [ --enable-macos-target=VER
357 Set the minimum MacOS version needed at runtime
358 [10.2 for ppc, 10.4 for x86]],
359 [_MACOSX_DEPLOYMENT_TARGET=$enableval])
361 dnl ========================================================
363 dnl = Set the threading model
365 dnl ========================================================
369 case "${target_os}" in
381 dnl ========================================================
383 dnl = Set the default C compiler
385 dnl ========================================================
386 if test -z "$CC"; then
390 if test -z "$USE_NSPR_THREADS"; then
416 dnl ========================================================
418 dnl = Set the default C++ compiler
420 dnl ========================================================
421 if test -z "$CXX"; then
425 if test -z "$USE_NSPR_THREADS"; then
433 case "${target_os}" in
461 if test -z "$SKIP_PATH_CHECKS"; then
462 AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
465 if test -n "$MOZ_DEBUG"; then
467 DEFINES="$DEFINES -UNDEBUG"
469 case "${target_os}" in
471 DEFINES="$DEFINES -DDEBUG_${USER}"
473 msvc*|mks*|cygwin*|mingw*|wince*|winmo*|os2*)
474 DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
477 DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
482 DEFINES="$DEFINES -UDEBUG"
485 if test -z "$SKIP_COMPILER_CHECKS"; then
486 dnl ========================================================
487 dnl Checks for compilers.
488 dnl ========================================================
489 if test "$target" != "$host"; then
490 echo "cross compiling from $host to $target"
494 _SAVE_CFLAGS="$CFLAGS"
495 _SAVE_LDFLAGS="$LDFLAGS"
497 AC_MSG_CHECKING([for $host compiler])
498 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
499 if test -z "$HOST_CC"; then
500 AC_MSG_ERROR([no acceptable cc found in \$PATH])
502 AC_MSG_RESULT([$HOST_CC])
503 if test -z "$HOST_CFLAGS"; then
504 HOST_CFLAGS="$CFLAGS"
506 if test -z "$HOST_LDFLAGS"; then
507 HOST_LDFLAGS="$LDFLAGS"
511 CFLAGS="$HOST_CFLAGS"
512 LDFLAGS="$HOST_LDFLAGS"
514 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
515 AC_TRY_COMPILE([], [return(0);],
516 [ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
517 AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
521 LDFLAGS=$_SAVE_LDFLAGS
523 case "$build:$target" in
524 powerpc-apple-darwin8*:i?86-apple-darwin*)
525 dnl The Darwin cross compiler doesn't necessarily point itself at a
526 dnl root that has libraries for the proper architecture, it defaults
527 dnl to the system root. The libraries in the system root on current
528 dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
529 dnl checks will fail. Fake a working SDK in that case.
531 _SAVE_CXXFLAGS=$CXXLAGS
532 CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
533 CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
537 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
540 if test -n "$USE_CPLUS"; then
541 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
546 case "$build:$target" in
547 powerpc-apple-darwin8*:i?86-apple-darwin*)
548 dnl Revert the changes made above. From this point on, the target
549 dnl compiler will never be used without applying the SDK to CFLAGS
550 dnl (see --with-macos-sdk below).
552 CXXFLAGS=$_SAVE_CXXFLAGS
556 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
557 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
558 AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
559 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
560 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
561 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
565 if test -n "$USE_CPLUS"; then
566 if test "$CC" = "cl" -a -z "$CXX"; then
574 AC_PATH_PROGS(AS, as, $CC)
575 AC_PATH_PROGS(AR, ar, echo not_ar)
576 AC_PATH_PROGS(LD, ld link, echo not_ld)
577 AC_PATH_PROGS(STRIP, strip, echo not_strip)
578 AC_PATH_PROGS(WINDRES, windres, echo not_windres)
579 if test -z "$HOST_CC"; then
582 if test -z "$HOST_CFLAGS"; then
583 HOST_CFLAGS="$CFLAGS"
587 if test "$GCC" = "yes"; then
590 if test "$GXX" = "yes"; then
593 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
598 case "$build:$target" in
599 i?86-apple-darwin*:powerpc-apple-darwin*)
600 dnl cross_compiling will have erroneously been set to "no" in this
601 dnl case, because the x86 build host is able to run ppc code in a
602 dnl translated environment, making a cross compiler appear native.
607 if test "$cross_compiling" = "yes"; then
613 dnl ========================================================
614 dnl Check for gcc -pipe support
615 dnl ========================================================
616 AC_MSG_CHECKING([for gcc -pipe support])
617 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
618 echo '#include <stdio.h>' > dummy-hello.c
619 echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
620 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
621 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
627 if test "$_res_as_stdin" = "yes"; then
629 CFLAGS="$CFLAGS -pipe"
630 AC_TRY_COMPILE( [ #include <stdio.h> ],
631 [printf("Hello World\n");],
632 [_res_gcc_pipe="yes"],
633 [_res_gcc_pipe="no"] )
636 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
638 CFLAGS="$CFLAGS -pipe"
639 CXXFLAGS="$CXXFLAGS -pipe"
643 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
644 AC_MSG_RESULT([$_res])
649 dnl ========================================================
650 dnl Profile guided optimization
651 dnl ========================================================
652 dnl Test for profiling options
653 dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
655 _SAVE_CFLAGS="$CFLAGS"
656 CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
658 AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
659 AC_TRY_COMPILE([], [return 0;],
660 [ PROFILE_GEN_CFLAGS="-fprofile-generate"
661 result="yes" ], result="no")
662 AC_MSG_RESULT([$result])
664 if test $result = "yes"; then
665 PROFILE_GEN_LDFLAGS="-fprofile-generate"
666 PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch -freorder-blocks-and-partition"
667 PROFILE_USE_LDFLAGS="-fprofile-use"
670 CFLAGS="$_SAVE_CFLAGS"
672 dnl ===============================================================
673 dnl Check for .hidden assembler directive and visibility attribute.
674 dnl Borrowed from glibc configure.in
675 dnl ===============================================================
676 if test "$GNU_CC"; then
677 AC_CACHE_CHECK(for visibility(hidden) attribute,
678 ac_cv_visibility_hidden,
679 [cat > conftest.c <<EOF
680 int foo __attribute__ ((visibility ("hidden"))) = 1;
682 ac_cv_visibility_hidden=no
683 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
684 if grep '\.hidden.*foo' conftest.s >/dev/null; then
685 ac_cv_visibility_hidden=yes
690 if test "$ac_cv_visibility_hidden" = "yes"; then
691 AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
692 AC_CACHE_CHECK(for visibility pragma support,
693 ac_cv_visibility_pragma,
694 [cat > conftest.c <<EOF
695 #pragma GCC visibility push(hidden)
697 #pragma GCC visibility push(default)
700 ac_cv_visibility_pragma=no
701 if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
702 if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
703 if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
704 ac_cv_visibility_pragma=yes
710 if test "$ac_cv_visibility_pragma" = "yes"; then
711 AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
712 # To work around a build problem on Linux x86-64 (Bugzilla bug
713 # 293438), we use the -fvisibility=hidden flag. This flag is less
714 # optimal than #pragma GCC visibility push(hidden) because the flag
715 # assumes that symbols defined outside the current source file have
716 # the default visibility. This has the advantage that we don't need
717 # to wrap system header files, but has the disadvantage that calls
718 # to hidden symbols defined in other source files cannot be
719 # optimized by the compiler. The -fvisibility=hidden flag does
720 # hide and export symbols correctly.
721 #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
722 #WRAP_SYSTEM_INCLUDES=1
723 VISIBILITY_FLAGS="-fvisibility=hidden"
724 WRAP_SYSTEM_INCLUDES=
729 fi # SKIP_COMPILER_CHECKS
731 dnl ========================================================
732 dnl Checks for programs.
733 dnl ========================================================
734 if test -z "$SKIP_PATH_CHECKS"; then
735 AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
736 elif test -z "$PERL"; then
740 dnl ========================================================
741 dnl Default platform specific options
742 dnl ========================================================
747 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
755 if test -n "$CROSS_COMPILE"; then
756 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
758 OS_TEST="${target_cpu}"
759 case "${target_os}" in
760 linux*) OS_ARCH=Linux ;;
761 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
762 mingw*) OS_ARCH=WINNT ;;
763 wince*) OS_ARCH=WINCE ;;
764 winmo*) OS_ARCH=WINCE ;;
765 darwin*) OS_ARCH=Darwin ;;
766 riscos*) OS_ARCH=RISCOS ;;
769 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
770 OS_RELEASE=`uname -r`
774 if test "$OS_ARCH" = "IRIX64"; then
778 if test "$OS_ARCH" = "AIX"; then
779 OS_RELEASE=`uname -v`.`uname -r`
782 if test "$OS_ARCH" = "FreeBSD"; then
783 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
786 if test "$OS_ARCH" = "Linux"; then
787 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
788 OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
791 #######################################################################
792 # Master "Core Components" macros for getting the OS target #
793 #######################################################################
796 # Note: OS_TARGET should be specified on the command line for gmake.
797 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
798 # The difference between the Win95 target and the WinNT target is that
799 # the WinNT target uses Windows NT specific features not available
800 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
801 # at lesser performance (the Win95 target uses threads; the WinNT target
804 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
809 # The following hack allows one to build on a WIN95 machine (as if
810 # s/he were cross-compiling on a WINNT host for a WIN95 target).
811 # It also accomodates for MKS's uname.exe. If you never intend
812 # to do development on a WIN95 machine, you don't need this hack.
827 CYGWIN_9*|CYGWIN_ME*)
828 OS_ARCH='CYGWIN_NT-4.0'
838 # On WIN32, we also define the variable CPU_ARCH.
844 if test "$CPU_ARCH" = "I386"; then
850 # If uname -s returns "Windows_NT", we assume that we are using
851 # the uname.exe in MKS toolkit.
853 # The -r option of MKS uname only returns the major version number.
854 # So we need to use its -v option to get the minor version number.
855 # Moreover, it doesn't have the -p option, so we need to use uname -m.
858 OS_MINOR_RELEASE=`uname -v`
859 if test "$OS_MINOR_RELEASE" = "00"; then
862 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
865 # MKS's uname -m returns "586" on a Pentium machine.
867 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
871 CYGWIN_NT*|MINGW*_NT*)
873 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
874 # the uname.exe in the Cygwin tools.
875 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
876 # the uname.exe in the MSYS tools.
878 OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
882 # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
884 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
890 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
892 if test -n "$MOZ_DEBUG"; then
896 if test -z "$OS_TARGET"; then
899 if test "$OS_TARGET" = "WIN95"; then
902 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
904 dnl ========================================================
905 dnl Enable high-memory support on OS/2 by default.
906 dnl ========================================================
907 AC_ARG_ENABLE(os2-high-mem,
908 [ --disable-os2-high-mem Disable high-memory support on OS/2],
909 [ if test "$enableval" = "no"; then
912 MOZ_OS2_HIGH_MEMORY=1
915 dnl ========================================================
916 dnl = Enable building the Thumb2 instruction set
917 dnl ========================================================
918 AC_ARG_ENABLE(thumb2,
919 [ --enable-thumb2 Enable Thumb2 instruction set],
920 [ if test "$enableval" = "yes"; then
924 if test -n "$MOZ_THUMB2"; then
925 case "$target_cpu" in
927 if test "$GNU_CC"; then
928 CFLAGS="$CFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
929 CXXFLAGS="$CXXFLAGS -march=armv7-a -mthumb -Wa, -march=armv7-a -Wa, -mthumb"
930 ASFLAGS="$ASFLAGS -march=armv7-a -mthumb"
932 AC_MSG_ERROR([--enable-thumb2 is not supported for non-GNU toolchains])
936 AC_MSG_ERROR([--enable-thumb2 is not supported for non-ARM CPU architectures])
940 case "$target_cpu" in
942 if test "$GNU_CC"; then
943 CFLAGS="$CFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
944 CXXFLAGS="$CXXFLAGS -march=armv5te -mthumb-interwork -Wa, -march=armv5te -Wa, -mthumb-interwork"
945 ASFLAGS="$ASFLAGS -march=armv5te -mthumb-interwork"
951 dnl ========================================================
952 dnl Override of system specific host options
953 dnl ========================================================
958 *-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*)
959 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
960 if test `echo "${PATH}" | grep -c \;` = 0; then
961 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
965 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
970 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
974 dnl ========================================================
975 dnl Override of system specific target options
976 dnl ========================================================
983 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
984 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
985 case "${target_os}" in
987 AC_DEFINE(AIX_RENAME_SELECT)
988 AC_DEFINE(_PR_NO_LARGE_FILES)
989 AIX_LINK_OPTS='-bnso -berok'
990 PR_MD_ASFILES=os_AIX.s
993 AC_DEFINE(AIX_TIMERS)
994 AC_DEFINE(_PR_NO_LARGE_FILES)
998 AIX_LINK_OPTS='-bnso -berok'
999 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
1000 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
1003 AC_DEFINE(AIX_TIMERS)
1004 AC_DEFINE(_PR_HAVE_OFF64_T)
1005 AIX_LINK_OPTS='-brtl -bnso -berok'
1008 AC_DEFINE(AIX_TIMERS)
1009 AC_DEFINE(_PR_HAVE_OFF64_T)
1010 AC_DEFINE(AIX4_3_PLUS)
1011 AC_DEFINE(HAVE_SOCKLEN_T)
1012 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1014 AIX_LINK_OPTS='-brtl -bnso -berok'
1017 AC_DEFINE(AIX_TIMERS)
1018 AC_DEFINE(_PR_HAVE_OFF64_T)
1019 AC_DEFINE(AIX4_3_PLUS)
1020 AC_DEFINE(HAVE_SOCKLEN_T)
1021 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1023 AIX_LINK_OPTS='-brtl -bnso -berok'
1026 CFLAGS="$CFLAGS -qro -qroconst"
1027 AIX_WRAP='$(DIST)/lib/aixwrap.o'
1028 AIX_TMP='./_aix_tmp.o'
1029 if test -n "$USE_64"; then
1030 MDCPUCFG_H=_aix64.cfg
1033 MDCPUCFG_H=_aix32.cfg
1036 RESOLVE_LINK_SYMBOLS=1
1043 AC_DEFINE(_POSIX_SOURCE)
1045 MDCPUCFG_H=_beos.cfg
1048 RESOLVE_LINK_SYMBOLS=1
1049 case "${target_cpu}" in
1052 _DEBUG_FLAGS='-gdwarf-2 -O0'
1053 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1054 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1060 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'
1062 _DEBUG_FLAGS='-g -O0'
1070 AC_DEFINE(NEED_BSDREGEX)
1072 CFLAGS="$CFLAGS -Wall -Wno-format"
1073 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1075 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1077 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1081 MDCPUCFG_H=_bsdi.cfg
1086 case "$target_os" in
1088 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1089 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1090 AC_DEFINE(_PR_NEED_H_ERRNO)
1097 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1098 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1100 AC_DEFINE(USE_DLFCN)
1101 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1102 PR_MD_ASFILES=os_BSD_OS_386_2.s
1106 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1107 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1109 AC_DEFINE(USE_DLFCN)
1110 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1111 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1113 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1115 case "$target_os" in
1116 bsdi4.2* | bsdi4.3* | bsdi5.*)
1117 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1118 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1123 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1124 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1126 AC_DEFINE(USE_DLFCN)
1127 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1136 AC_DEFINE(HAVE_BSD_FLOCK)
1137 AC_DEFINE(HAVE_SOCKLEN_T)
1138 AS='$(CC) -x assembler-with-cpp'
1139 CFLAGS="$CFLAGS -Wall -fno-common"
1140 case "${target_cpu}" in
1142 if test -n "$USE_64"; then
1144 CC="$CC -arch x86_64"
1154 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1156 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1157 STRIP="$STRIP -x -S"
1160 MDCPUCFG_H=_darwin.cfg
1161 PR_MD_CSRCS=darwin.c
1162 PR_MD_ASFILES=os_Darwin.s
1164 # Add Mac OS X support for loading CFM & CFBundle plugins
1165 if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1166 AC_DEFINE(XP_MACOSX)
1169 if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1170 dnl Use the specified value
1171 export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1172 elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1173 dnl No value specified on the command line or in the environment,
1174 dnl use the lesser of the library's minimum or the architecture's
1176 case "${target_cpu}" in
1178 dnl Architecture minimum 10.2
1179 export MACOSX_DEPLOYMENT_TARGET=10.2
1182 dnl Architecture minimum 10.4
1183 export MACOSX_DEPLOYMENT_TARGET=10.4
1188 dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1189 dnl in use. NEXT_ROOT will be set and exported if it's needed for
1192 if test "$MACOS_SDK_DIR"; then
1193 dnl Sync this section with the one in Mozilla's top level.
1195 if test ! -d "$MACOS_SDK_DIR"; then
1196 AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1197 specify a valid SDK. SDKs are installed when the optional cross-development
1198 tools are selected during the Xcode/Developer Tools installation.])
1202 CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1203 GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1204 GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1206 GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1207 if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1208 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1209 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1210 SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1213 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1215 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1217 dnl CPP needs to be set for AC_CHECK_HEADER.
1218 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1221 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1223 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1224 dnl The build host is running Tiger (10.4) or earlier.
1225 dnl ld support for -syslibroot is compiler-agnostic, but
1226 dnl only available on Tiger and later. On Tiger and
1227 dnl earlier build hosts, just rely on NEXT_ROOT, because
1228 dnl it's not been shown to cause any problems.
1229 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}"
1231 dnl The build host is running Leopard (10.5) or later.
1232 dnl With NEXT_ROOT set, the linker will still not apply
1233 dnl it when resolving dependencies. This causes problems
1234 dnl on Leopard, where an SDK depends on frameworks which
1235 dnl were present in earlier OS releases (and the associated
1236 dnl SDK) but not in Leopard. -syslibroot does not have
1237 dnl this problem, but it results in harmless warnings when
1238 dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1239 dnl on Leopard because the compiler uses it too.
1240 MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1243 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1244 export NEXT_ROOT=$MACOS_SDK_DIR
1246 if test -n "$CROSS_COMPILE" ; then
1247 dnl NEXT_ROOT will be in the environment, but it
1248 dnl shouldn't be set for the build host. HOST_CXX is
1249 dnl presently unused.
1250 HOST_CC="NEXT_ROOT= $HOST_CC"
1251 HOST_CXX="NEXT_ROOT= $HOST_CXX"
1254 dnl gcc >= 4.0 uses different paths than above, but knows
1255 dnl how to find them itself.
1256 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1258 dnl CPP needs to be set for AC_CHECK_HEADER.
1259 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1261 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1262 dnl has an ld that supports -syslibroot. Don't set
1263 dnl NEXT_ROOT because it will be ignored and cause
1264 dnl warnings when -syslibroot is specified.
1265 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1266 dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1267 dnl based on the -isysroot it receives.
1268 LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1270 dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1272 LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1281 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1285 AC_DEFINE(_DGUX_SOURCE)
1286 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1290 MDCPUCFG_H=_dgux.cfg
1295 if test -z "$USE_NSPR_THREADS"; then
1300 AC_DEFINE(HAVE_BSD_FLOCK)
1301 AC_DEFINE(HAVE_SOCKLEN_T)
1302 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1303 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1304 if test "$MOZ_OBJFORMAT" = "elf"; then
1309 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1311 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1312 MDCPUCFG_H=_freebsd.cfg
1313 PR_MD_CSRCS=freebsd.c
1319 AC_DEFINE(_HPUX_SOURCE)
1320 # OSF1 and HPUX report the POLLHUP event for a socket when the
1321 # shutdown(SHUT_WR) operation is called for the remote end, even though
1322 # the socket is still writeable. Use select(), instead of poll(), to
1323 # workaround this problem.
1324 AC_DEFINE(_PR_POLL_WITH_SELECT)
1325 AC_DEFINE(_USE_BIG_FDS)
1326 DSO_LDOPTS='-b +h $(notdir $@)'
1328 if test "$OS_TEST" = "ia64"; then
1330 DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1331 CPU_ARCH_TAG=_$OS_TEST
1332 if test -z "$USE_64"; then
1335 PR_MD_ASFILES=os_HPUX_ia64.s
1339 PR_MD_ASFILES=os_HPUX.s
1341 if test -n "$USE_64"; then
1342 MDCPUCFG_H=_hpux64.cfg
1344 MDCPUCFG_H=_hpux32.cfg
1346 if test -z "$GNU_CC"; then
1352 ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1355 if test -n "$MOZILLA_CLIENT"; then
1356 DEFAULT_IMPL_STRATEGY=_EMU
1359 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1360 AC_DEFINE(_PR_NEED_H_ERRNO)
1362 DEFAULT_IMPL_STRATEGY=_EMU
1366 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1367 AC_DEFINE(_PR_NO_LARGE_FILES)
1370 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1371 AC_DEFINE(_PR_NEED_H_ERRNO)
1374 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1375 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1378 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1379 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1382 # HP-UX 11i v2 (B.11.23) or higher
1384 case "$OS_RELEASE" in
1385 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1391 if test "$OS_RELEASE" = "B.10.01"; then
1393 DEFAULT_IMPL_STRATEGY=_EMU
1396 if test "$OS_RELEASE" = "B.10.10"; then
1398 AC_DEFINE(HPUX10_10)
1399 DEFAULT_IMPL_STRATEGY=_PTH
1402 if test "$OS_RELEASE" = "B.10.20"; then
1404 AC_DEFINE(HPUX10_20)
1405 if test -z "$GNU_CC"; then
1406 CFLAGS="$CFLAGS +DAportable +DS1.1"
1407 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1409 DEFAULT_IMPL_STRATEGY=_PTH
1412 if test "$OS_RELEASE" = "B.10.30"; then
1414 AC_DEFINE(HPUX10_30)
1415 if test -z "$GNU_CC"; then
1416 CFLAGS="$CFLAGS +DAportable +DS1.1"
1417 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1419 DEFAULT_IMPL_STRATEGY=_PTH
1422 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1425 AC_DEFINE(_LARGEFILE64_SOURCE)
1426 AC_DEFINE(_PR_HAVE_OFF64_T)
1427 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1428 if test -z "$GNU_CC"; then
1429 if test -z "$USE_64"; then
1430 if test "$OS_TEST" = "ia64"; then
1431 CFLAGS="$CFLAGS +DD32"
1432 CXXFLAGS="$CXXFLAGS +DD32"
1434 CFLAGS="$CFLAGS +DAportable +DS2.0"
1435 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1438 if test "$OS_TEST" = "ia64"; then
1439 CFLAGS="$CFLAGS +DD64"
1440 CXXFLAGS="$CXXFLAGS +DD64"
1442 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1443 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1447 DEFAULT_IMPL_STRATEGY=_PTH
1450 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1454 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1456 if test "$USE_NSPR_THREADS"; then
1459 if test "$USE_USER_PTHREADS"; then
1469 AC_DEFINE(_SGI_MP_SOURCE)
1470 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1472 PR_MD_ASFILES=os_Irix.s
1473 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1475 RESOLVE_LINK_SYMBOLS=1
1476 if test -n "$USE_64"; then
1477 MDCPUCFG_H=_irix64.cfg
1479 MDCPUCFG_H=_irix32.cfg
1481 case "${target_os}" in
1498 if test "$GNU_CC"; then
1500 dnl If we are using gcc with native binutils, we need to
1502 dnl #lineno "filename" num num
1503 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1504 dnl gcc command line, which passes -P to the preprocessor.
1506 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1507 CFLAGS="$CFLAGS -Wall -Wno-format"
1508 _OPTIMIZE_FLAGS="-O6"
1510 if test -n "$USE_N32"; then
1511 AS='as -D_ASM $(INCLUDES) -n32'
1513 AS='as -D_ASM $(INCLUDES)'
1515 CFLAGS="$CFLAGS -fullwarn -xansi"
1516 if test "$USE_N32"; then
1517 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1519 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1521 if test "$USE_MDUPDATE"; then
1522 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1526 CFLAGS="$CFLAGS -multigot"
1527 DSO_LDOPTS="-no_unresolved"
1528 if test "$USE_N32"; then
1529 CFLAGS="$CFLAGS -n32 -woff 1209"
1530 DSO_LDOPTS="$DSO_LDOPTS -n32"
1532 if test "$USE_64"; then
1533 CFLAGS="$CFLAGS -64"
1535 CFLAGS="$CFLAGS -32"
1540 CFLAGS="$CFLAGS -xgot"
1544 if test "${target_os}" = "irix5.3"; then
1547 case "${target_os}" in
1549 if test -z "$GNU_CC"; then
1550 CFLAGS="$CFLAGS -mips3"
1552 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1553 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1554 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1559 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1565 if test -z "$USE_NSPR_THREADS"; then
1570 AC_DEFINE(_GNU_SOURCE)
1571 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1573 CFLAGS="$CFLAGS -Wall"
1574 CXXFLAGS="$CXXFLAGS -Wall"
1575 MDCPUCFG_H=_linux.cfg
1577 MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@'
1579 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1581 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1582 # combo is not yet good at debugging inlined
1583 # functions (even when using DWARF2 as the
1591 *-linux*|*-gnu*|*-k*bsd*-gnu)
1592 if test -z "$USE_NSPR_THREADS"; then
1597 AC_DEFINE(_GNU_SOURCE)
1598 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1599 case "${target_os}" in
1604 CFLAGS="$CFLAGS -Wall"
1605 CXXFLAGS="$CXXFLAGS -Wall"
1606 MDCPUCFG_H=_linux.cfg
1608 MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@'
1610 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1612 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1613 # combo is not yet good at debugging inlined
1614 # functions (even when using DWARF2 as the
1617 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1622 CPU_ARCH_TAG=_${CPU_ARCH}
1623 case "${target_cpu}" in
1627 CFLAGS="$CFLAGS -mieee"
1628 CXXFLAGS="$CXXFLAGS -mieee"
1632 PR_MD_ASFILES=os_Linux_x86.s
1635 PR_MD_ASFILES=os_Linux_ia64.s
1638 if test -n "$USE_64"; then
1639 PR_MD_ASFILES=os_Linux_x86_64.s
1642 PR_MD_ASFILES=os_Linux_x86.s
1648 PR_MD_ASFILES=os_Linux_ppc.s
1651 if test -n "$USE_64"; then
1655 PR_MD_ASFILES=os_Linux_ppc.s
1659 CFLAGS="$CFLAGS -m68020-60"
1660 CXXFLAGS="$CXXFLAGS -m68020-60"
1665 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1668 PR_MD_ARCH_DIR=windows
1669 RESOLVE_LINK_SYMBOLS=1
1671 if test -n "$GNU_CC"; then
1672 CC="$CC -mno-cygwin"
1673 CXX="$CXX -mno-cygwin"
1675 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1677 # Use temp file for windres (bug 213281)
1678 RCFLAGS='-O coff --use-temp-file'
1683 AR='lib -NOLOGO -OUT:"$@"'
1685 RANLIB='echo not_ranlib'
1686 STRIP='echo not_strip'
1688 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1693 # Determine compiler version
1695 _MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1697 CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1698 _CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1699 _CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1700 _CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1701 _CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1702 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1704 if test "$_CC_MAJOR_VERSION" -eq "14"; then
1705 dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1706 dnl so be very specific here!
1707 dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1708 if test $_CC_RELEASE -gt 50727; then
1710 elif test $_CC_BUILD -ge 762; then
1713 AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
1714 AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
1715 elif test $_CC_MAJOR_VERSION -ge 15; then
1717 AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
1718 AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
1721 if test -n "$_USE_DYNAMICBASE"; then
1722 DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1725 # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1726 # tape manipulation utility (or something else)
1727 if test "$MSC_VER" -ge "1400"; then
1729 _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1732 MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1733 if test -n "$MSMT_TOOL"; then
1734 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1735 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1736 AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1741 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1745 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1746 DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1750 PROFILE_GEN_CFLAGS="-GL"
1751 PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1752 PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1753 PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1755 if test -z "$MOZ_OPTIMIZE"; then
1756 CFLAGS="$CFLAGS -Od"
1759 if test -n "$USE_DEBUG_RTL"; then
1760 CFLAGS="$CFLAGS -MDd"
1762 CFLAGS="$CFLAGS -MD"
1765 if test -n "$MOZ_DEBUG"; then
1768 DEFINES="$DEFINES -U_DEBUG"
1771 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1772 if test -n "$MOZ_OPTIMIZE"; then
1773 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1774 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1776 DLLFLAGS="$DLLFLAGS -DEBUG"
1777 LDFLAGS="$LDFLAGS -DEBUG"
1781 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1782 if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1783 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
1786 if test "$OS_TARGET" = "WINNT"; then
1787 CFLAGS="$CFLAGS -GT"
1788 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1789 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1791 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1792 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1796 if test -n "$USE_STATIC_TLS"; then
1797 AC_DEFINE(_PR_USE_STATIC_TLS)
1800 if test "$OS_TARGET" = "WINNT"; then
1804 # undefine WINNT as some versions of mingw gcc define it by default
1805 DEFINES="$DEFINES -UWINNT"
1806 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1809 if test "$CPU_ARCH" = "x86"; then
1812 CPU_ARCH_TAG=$CPU_ARCH
1815 if test -n "$USE_DEBUG_RTL"; then
1819 case "$OS_TARGET" in
1821 MDCPUCFG_H=_winnt.cfg
1824 MDCPUCFG_H=_win95.cfg
1827 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
1831 case "$target_cpu" in
1833 if test -n "$USE_64"; then
1848 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
1857 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1859 AR_FLAGS='-NOLOGO -OUT:"$@"'
1864 MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
1866 PR_MD_ARCH_DIR=windows
1867 RESOLVE_LINK_SYMBOLS=1
1869 MDCPUCFG_H=_win95.cfg
1870 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1871 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1873 DLLFLAGS='-OUT:"$@"'
1874 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1875 OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1876 OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
1877 DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
1889 if test "$OS_RELEASE" = "2.03"; then
1890 AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
1892 AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
1895 if test -z "$GNU_CC"; then
1896 CFLAGS="$CFLAGS -Hnocopyr"
1897 CXXFLAGS="$CXXFLAGS -Hnocopyr"
1899 CFLAGS="$CFLAGS -fPIC -Wall"
1900 CXXFLAGS="$CXXFLAGS -fPIC -Wall"
1914 if test -z "$GNU_CC"; then
1915 CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
1918 OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
1927 AC_DEFINE(HAVE_BSD_FLOCK)
1928 if test -z "$USE_NSPR_THREADS"; then
1931 MDCPUCFG_H=_netbsd.cfg
1932 PR_MD_CSRCS=netbsd.c
1934 DSO_CFLAGS='-fPIC -DPIC'
1935 CFLAGS="$CFLAGS -ansi -Wall"
1936 CXXFLAGS="$CXXFLAGS -ansi -Wall"
1937 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1939 if test -z "$OBJECT_FMT"; then
1940 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
1943 DSO_LDOPTS='-shared'
1947 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
1951 if test "$LIBRUNPATH"; then
1952 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
1963 AC_DEFINE(HAVE_SVID_GETTOD)
1965 CFLAGS="$CFLAGS -Xa -fullwarn"
1966 CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
1968 MDCPUCFG_H=_sony.cfg
1972 *-nextstep*|*-openstep*)
1975 AC_DEFINE(HAVE_BSD_FLOCK)
1976 AC_DEFINE(_POSIX_SOURCE)
1977 CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
1978 CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
1981 MDCPUCFG_H=_nextstep.cfg
1982 PR_MD_CSRCS=nextstep.c
1989 AC_DEFINE(_QNX_SOURCE)
1990 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1993 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
1996 OS_LIBS="$OS_LIBS -lsocket"
1997 _OPTIMIZE_FLAGS="-O1"
1998 _DEBUG_FLAGS="-gstabs"
2004 AC_DEFINE(HAVE_BSD_FLOCK)
2005 AC_DEFINE(HAVE_SOCKLEN_T)
2006 CFLAGS="$CFLAGS -ansi -Wall"
2007 CXXFLAGS="$CXXFLAGS -ansi -Wall"
2010 MDCPUCFG_H=_openbsd.cfg
2011 PR_MD_CSRCS=openbsd.c
2013 if test -z "$USE_NSPR_THREADS"; then
2016 DSO_LDOPTS='-shared -fPIC'
2017 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2021 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2024 AC_DEFINE(_REENTRANT)
2025 # OSF1 and HPUX report the POLLHUP event for a socket when the
2026 # shutdown(SHUT_WR) operation is called for the remote end, even though
2027 # the socket is still writeable. Use select(), instead of poll(), to
2028 # workaround this problem.
2029 AC_DEFINE(_PR_POLL_WITH_SELECT)
2031 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2035 if test -z "$GNU_CC"; then
2036 CC="$CC -std1 -ieee_with_inexact"
2037 if test "$OS_RELEASE" != "V2.0"; then
2038 CC="$CC -readonly_strings"
2040 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2041 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2043 CFLAGS="$CFLAGS -mieee"
2044 CXXFLAGS="$CXXFLAGS -mieee"
2047 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2048 AC_DEFINE(HAVE_INT_LOCALTIME_R)
2050 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2051 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2053 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2054 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2056 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2057 MDCPUCFG_H=_osf1.cfg
2064 AC_DEFINE(_PR_NEED_H_ERRNO)
2073 AC_DEFINE(_PR_NEED_H_ERRNO)
2075 MDCPUCFG_H=_riscos.cfg
2076 PR_MD_CSRCS=riscos.c
2078 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2079 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2088 AC_DEFINE(_PR_NEED_H_ERRNO)
2089 CC='cc -b elf -KPIC'
2090 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2093 DSO_LDOPTS='-b elf -G'
2094 MDCPUCFG_H=_scoos.cfg
2102 AC_DEFINE(RELIANTUNIX)
2104 AC_DEFINE(HAVE_SVID_GETTOD)
2105 if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
2112 if test "$GNU_CC"; then
2113 AS='$(CC) -x assembler-with-cpp'
2114 if test "$CPU_ARCH" = "mips"; then
2117 CFLAGS="$CFLAGS -Wall -Wno-format"
2120 _OPTIMIZE_FLAGS='-O -F Olimit,4000'
2123 DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
2125 if test "$OS_RELEASE" = "5.43"; then
2126 AC_DEFINE(IP_MULTICAST)
2129 OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
2131 MDCPUCFG_H=_reliantunix.cfg
2132 PR_MD_CSRCS=reliantunix.c
2133 if test "${OS_ARCH}" = "mips"; then
2134 PR_MD_ASFILES=os_ReliantUNIX.s
2141 CFLAGS="$CFLAGS -Wall -Wno-format"
2142 if test "$USE_MDUPDATE"; then
2143 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2150 if test "$OS_RELEASE" = "4.1.3_U1"; then
2152 OS_LIBS="$OS_LIBS -lm"
2154 MDCPUCFG_H=_sunos4.cfg
2155 PR_MD_CSRCS=sunos4.c
2159 if test -z "$USE_NSPR_THREADS"; then
2168 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2170 MDCPUCFG_H=_solaris.cfg
2171 PR_MD_CSRCS=solaris.c
2173 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2174 RESOLVE_LINK_SYMBOLS=1
2175 case "${OS_RELEASE}" in
2179 # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2183 if test -n "$GNU_CC"; then
2185 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2188 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2189 if test -n "$USE_B_DIRECT"; then
2190 DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2194 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2195 if test -n "$USE_B_DIRECT"; then
2196 DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2199 if test -n "$GNU_CC"; then
2200 CFLAGS="$CFLAGS -Wall"
2201 CXXFLAGS="$CXXFLAGS -Wall"
2202 if test -n "$USE_MDUPDATE"; then
2203 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2204 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2206 GCC_AS=`$CC -print-prog-name=as`
2207 if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2211 CFLAGS="$CFLAGS -xstrconst"
2212 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2213 if test -z "$MOZ_OPTIMIZE"; then
2214 CFLAGS="$CFLAGS -xs"
2215 CXXFLAGS="$CXXFLAGS -xs"
2217 _OPTIMIZE_FLAGS=-xO4
2219 if test -z "$GNU_AS"; then
2220 ASFLAGS="$ASFLAGS -Wa,-P"
2222 if test -n "$USE_64"; then
2223 if test -n "$GNU_CC"; then
2227 if test "$OS_TEST" = "i86pc"; then
2228 CC="$CC -xarch=amd64"
2229 CXX="$CXX -xarch=amd64"
2232 CXX="$CXX -xarch=v9"
2236 if test "$OS_TEST" = "i86pc"; then
2237 if test -z "$USE_64"; then
2240 CPU_ARCH_TAG=_$OS_TEST
2241 # The default debug format, DWARF (-g), is not supported by gcc
2242 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
2243 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2244 # If your gcc uses GNU as, you do not need the -Wa,-s option.
2245 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2246 _DEBUG_FLAGS=-gstabs
2247 if test -z "$GNU_AS"; then
2248 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2252 case "${target_os}" in
2254 AC_DEFINE(_PR_NO_LARGE_FILES)
2257 AC_DEFINE(_PR_NO_LARGE_FILES)
2260 AC_DEFINE(SOLARIS2_5)
2263 AC_DEFINE(_PR_HAVE_OFF64_T)
2264 # The lfcompile64(5) man page on Solaris 2.6 says:
2265 # For applications that do not wish to conform to the POSIX or
2266 # X/Open specifications, the 64-bit transitional interfaces
2267 # are available by default. No compile-time flags need to be
2269 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2270 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2271 if test -n "$GNU_CC"; then
2272 AC_DEFINE(_LARGEFILE64_SOURCE)
2276 case "${target_os}" in
2288 # Solaris 8 or higher has IPv6.
2289 AC_DEFINE(_PR_INET6)
2292 if test "$CPU_ARCH" = "sparc"; then
2293 # 64-bit Solaris SPARC requires V9 architecture, so the following
2295 if test -z "$USE_64"; then
2296 ULTRASPARC_LIBRARY=nspr_flt
2299 # Purify requires that binaries linked against nspr also
2300 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2302 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2303 OS_LIBS="$OS_LIBS $_librt"
2312 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2313 AC_DEFINE(_PR_NO_LARGE_FILES)
2314 CC='$(NSDEPTH)/build/hcc cc'
2315 CXX='$(NSDEPTH)/build/hcpp CC'
2316 MDCPUCFG_H=_unixware.cfg
2318 AC_DEFINE(_LARGEFILE64_SOURCE)
2319 AC_DEFINE(_PR_HAVE_OFF64_T)
2320 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2321 MDCPUCFG_H=_unixware7.cfg
2323 PR_MD_CSRCS=unixware.c
2329 AC_ARG_WITH(symbian-sdk,
2330 [ --with-symbian-sdk=SYMBIAN_SDK_DIR
2331 The path to the Symbian SDK],
2332 SYMBIAN_SDK_DIR=$withval)
2334 echo -----------------------------------------------------------------------------
2335 echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2336 echo -----------------------------------------------------------------------------
2341 AC_DEFINE(__SYMBIAN32__)
2344 AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2345 AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2346 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2347 AC_DEFINE(HAVE_SOCKLEN_T)
2355 MDCPUCFG_H=_symbian.cfg
2356 PR_MD_CSRCS=symbian.c
2358 RANLIB='echo no ranlib '
2361 OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2362 CFLAGS="$CFLAGS -MD -nostdinc"
2363 SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2364 echo -------------------------------------------------------
2365 echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2366 echo -------------------------------------------------------
2367 case "$OS_TARGET" in
2373 WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2374 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)"
2375 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2376 AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2380 AC_DEFINE(__WINSCW__)
2381 DEFINES="$DEFINES -U_WIN32"
2384 CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2385 CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2386 SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2389 DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2392 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2395 CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2401 AC_DEFINE(BSD_SELECT)
2402 AC_DEFINE(TCPV40HDRS)
2410 RESOLVE_LINK_SYMBOLS=1
2415 CFLAGS="$CFLAGS -Wall -Zomf"
2416 CXXFLAGS="$CFLAGS -Wall -Zomf"
2417 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2419 DSO_LDOPTS='-Zomf -Zdll'
2421 _OPTIMIZE_FLAGS="-O2 -s"
2422 _DEBUG_FLAGS="-g -fno-inline"
2423 if test -n "$MOZ_OPTIMIZE"; then
2424 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2428 if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2429 LDFLAGS="$LDFLAGS -Zhigh-mem"
2430 AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2433 # GCC for OS/2 currently predefines these, but we don't want them
2434 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2443 if test -z "$SKIP_LIBRARY_CHECKS"; then
2444 dnl ========================================================
2445 dnl Check for system libraries
2446 dnl ========================================================
2447 dnl AC_CHECK_LIB(C, main)
2448 dnl AC_CHECK_LIB(C_r, main)
2449 dnl AC_CHECK_LIB(c, main)
2450 dnl AC_CHECK_LIB(c_r, main)
2451 dnl AC_CHECK_LIB(dce, main)
2452 dnl AC_CHECK_LIB(dl, main)
2453 dnl AC_CHECK_LIB(dld, main)
2454 dnl AC_CHECK_LIB(gen, main)
2455 dnl AC_CHECK_LIB(ip6, main)
2456 dnl AC_CHECK_LIB(l, main)
2457 dnl AC_CHECK_LIB(m, main)
2458 dnl AC_CHECK_LIB(nsl, main)
2459 dnl AC_CHECK_LIB(posix4, main)
2460 dnl AC_CHECK_LIB(prstrms, main)
2461 dnl AC_CHECK_LIB(prstrms_shr, main)
2462 dnl AC_CHECK_LIB(pthread, main)
2463 dnl AC_CHECK_LIB(pthreads, main)
2464 dnl AC_CHECK_LIB(resolv, main)
2465 dnl AC_CHECK_LIB(rt, main)
2466 dnl AC_CHECK_LIB(socket, main)
2467 dnl AC_CHECK_LIB(svld, main)
2468 dnl AC_CHECK_LIB(thread, main)
2469 dnl AC_CHECK_LIB(vms_jackets, main)
2472 dnl We don't want anything to link with libdl even if it's present on OS X,
2473 dnl since it's not used and not part of the default installation.
2474 dnl The same goes for BeOS.
2475 dnl OS/2 has dlfcn in libc.
2478 *-darwin*|*-beos*|*-os2*)
2481 AC_CHECK_LIB(dl, dlopen,
2482 AC_CHECK_HEADER(dlfcn.h,
2483 OS_LIBS="-ldl $OS_LIBS"))
2488 dnl ========================================================
2489 dnl Check for system header files.
2490 dnl ========================================================
2491 dnl AC_HEADER_DIRENT
2493 dnl AC_HEADER_SYS_WAIT
2494 dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2496 dnl ========================================================
2497 dnl Check for typedefs and structs
2498 dnl ========================================================
2505 dnl AC_STRUCT_ST_BLKSIZE
2506 dnl AC_STRUCT_ST_BLOCKS
2507 dnl AC_STRUCT_ST_RDEV
2511 dnl ========================================================
2512 dnl Checks for library functions.
2513 dnl ========================================================
2514 AC_PROG_GCC_TRADITIONAL
2515 AC_CHECK_FUNCS(lchown strerror)
2519 dnl AC_FUNC_SETVBUF_REVERSED
2521 dnl AC_FUNC_STRFTIME
2522 dnl AC_FUNC_UTIME_NULL
2524 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2526 dnl ========================================================
2528 dnl ========================================================
2530 dnl ======================================================
2531 dnl = Enable compiling with ccache
2532 dnl ======================================================
2534 [ --with-ccache[=path/to/ccache]
2535 Enable compiling with ccache],
2536 CCACHE=$withval, CCACHE="no")
2538 if test "$CCACHE" != "no"; then
2539 if test -n "$CCACHE"; then
2540 if test "$CCACHE" = "yes"; then
2543 if test ! -e "$CCACHE"; then
2544 AC_MSG_ERROR([$CCACHE not found])
2548 AC_PATH_PROGS(CCACHE, $CCACHE ccache)
2549 if test -z "$CCACHE" -o "$CCACHE" = ":"; then
2550 AC_MSG_ERROR([ccache not found])
2551 elif test -x "$CCACHE"; then
2555 AC_MSG_ERROR([$CCACHE is not executable])
2559 dnl ========================================================
2561 dnl = --enable-strip
2563 dnl = Enable stripping of libs and executables
2565 dnl ========================================================
2566 AC_ARG_ENABLE(strip,
2567 [ --enable-strip Enable stripping of shared libs and programs],
2568 [ if test "$enableval" = "yes"; then
2572 dnl Check for hpux options
2573 case "${target_os}" in
2575 if test -z "$GNU_CC"; then
2577 AC_CACHE_CHECK(for +Olit support,
2578 ac_cv_hpux_usable_olit_option,
2579 dnl since aCC doesn't throw an error on invalid options,
2580 dnl we have to test this the hard way
2581 [ac_cv_hpux_usable_olit_option=no
2583 echo 'int main() { return 0; }' | cat > conftest.c
2584 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2585 if test $? -eq 0; then
2586 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2587 ac_cv_hpux_usable_olit_option=yes
2593 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2594 CFLAGS="$CFLAGS +Olit=all"
2595 CXXFLAGS="$CXXFLAGS +Olit=all"
2597 CFLAGS="$CFLAGS +ESlit"
2598 CXXFLAGS="$CXXFLAGS +ESlit"
2605 dnl Apparently, some systems cannot properly check for the pthread
2606 dnl library unless <pthread.h> is included so we need to test
2609 dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2610 AC_DEFUN(MOZ_CHECK_PTHREADS,
2612 AC_MSG_CHECKING([for pthread_create in -l$1])
2614 #include <pthread.h>
2615 void *foo(void *v) { return v; }
2618 if (!pthread_create(&t, 0, &foo, 0)) {
2623 echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2624 ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2626 rm -f dummy.c dummy${ac_exeext} ;
2627 if test "$_res" = "0"; then
2628 AC_MSG_RESULT([yes])
2636 case "$target_os" in
2644 MOZ_CHECK_PTHREADS(pthreads,
2645 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2646 MOZ_CHECK_PTHREADS(pthread,
2647 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2648 MOZ_CHECK_PTHREADS(c_r,
2649 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2650 MOZ_CHECK_PTHREADS(c,
2659 AC_ARG_WITH(pthreads,
2660 [ --with-pthreads Use system pthreads library as thread subsystem],
2661 [ if test "$withval" = "yes"; then
2662 if test -n "$_HAVE_PTHREADS"; then
2667 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2673 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2679 AC_ARG_ENABLE(user-pthreads,
2680 [ --enable-user-pthreads Build using userland pthreads],
2681 [ if test "$enableval" = "yes"; then
2682 if test -n "$_HAVE_PTHREADS"; then
2687 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2691 AC_ARG_ENABLE(nspr-threads,
2692 [ --enable-nspr-threads Build using classic nspr threads],
2693 [ if test "$enableval" = "yes"; then
2701 AC_ARG_WITH(bthreads,
2702 [ --with-bthreads Use system bthreads library as thread subsystem
2704 [ if test "$withval" = "yes"; then
2712 fi # SKIP_LIBRARY_CHECKS
2715 [ --enable-ipv6 Compile ipv6 support],
2716 [ if test "$enableval" = "yes"; then
2722 if test -n "$USE_PTHREADS"; then
2723 dnl See if -pthread is supported.
2725 ac_cv_have_dash_pthread=no
2726 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2727 echo 'int main() { return 0; }' | cat > conftest.c
2728 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2729 if test $? -eq 0; then
2730 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2731 ac_cv_have_dash_pthread=yes
2732 case "$target_os" in
2734 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2737 CFLAGS="$CFLAGS -pthread"
2738 CXXFLAGS="$CXXFLAGS -pthread"
2744 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2747 dnl See if -pthreads is supported.
2749 ac_cv_have_dash_pthreads=no
2750 if test "$ac_cv_have_dash_pthread" = "no"; then
2751 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2752 echo 'int main() { return 0; }' | cat > conftest.c
2753 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2754 if test $? -eq 0; then
2755 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2756 ac_cv_have_dash_pthreads=yes
2757 CFLAGS="$CFLAGS -pthreads"
2758 CXXFLAGS="$CXXFLAGS -pthreads"
2762 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2767 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2772 AC_DEFINE(_REENTRANT)
2773 AC_DEFINE(_THREAD_SAFE)
2774 dnl -pthread links in -lc_r, so don't specify it explicitly.
2775 if test "$ac_cv_have_dash_pthread" = "yes"; then
2776 _PTHREAD_LDFLAGS="-pthread"
2778 _PTHREAD_LDFLAGS="-lc_r"
2782 if test "$ac_cv_have_dash_pthread" = "yes"; then
2783 _PTHREAD_LDFLAGS="-pthread"
2787 AC_DEFINE(_THREAD_SAFE)
2788 dnl -pthread links in -lc_r, so don't specify it explicitly.
2789 if test "$ac_cv_have_dash_pthread" = "yes"; then
2794 if test "$ac_cv_have_dash_pthread" = "yes"; then
2795 _PTHREAD_LDFLAGS=-pthread
2798 *-linux*|*-gnu*|*-k*bsd*-gnu)
2799 AC_DEFINE(_REENTRANT)
2804 if test -n "$USE_USER_PTHREADS"; then
2811 dnl Special thread exceptions
2815 if test -n "$USE_NSPR_THREADS"; then
2816 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2818 case "$target_os" in
2820 if test -z "$USE_PTHREADS"; then
2821 AC_DEFINE(AIX_RENAME_SELECT)
2825 if test -z "$USE_NSPR_THREADS"; then
2826 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2830 if test -z "$USE_NSPR_THREADS"; then
2831 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2833 if test -n "$USE_PTHREADS"; then
2834 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2838 if test -z "$USE_NSPR_THREADS"; then
2839 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2841 if test -n "$USE_PTHREADS"; then
2842 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2848 if test -n "$USE_PTHREADS"; then
2849 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2853 if test -n "$USE_NSPR_THREADS"; then
2854 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2858 if test -n "$USE_NSPR_THREADS"; then
2859 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2861 if test "$USE_PTHREADS"; then
2862 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2863 AC_DEFINE(_REENTRANT)
2864 AC_DEFINE(_PR_DCETHREADS)
2866 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2867 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2870 if test "$USE_USER_PTHREADS"; then
2871 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2875 if test "${target_os}" = "irix6.5"; then
2876 if test -n "$USE_PTHREADS"; then
2877 AC_DEFINE(_PR_HAVE_GETHOST_R)
2878 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2882 *-linux*|*-gnu*|*-k*bsd*-gnu)
2883 if test -n "$USE_NSPR_THREADS"; then
2884 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2887 *-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*|*-os2*|*-beos*)
2888 dnl win32, wince, os2 & beos cannot use pthreads
2893 *-netbsd*|*-openbsd*)
2894 if test -n "$USE_NSPR_THREADS"; then
2895 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2899 if test -n "$USE_NSPR_THREADS"; then
2900 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2902 if test -n "$USE_PTHREADS"; then
2903 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2906 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2911 if test -n "$USE_NSPR_THREADS"; then
2912 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2914 if test -n "$USE_PTHREADS"; then
2915 AC_DEFINE(_REENTRANT)
2916 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2917 if test "$OS_TEST" = "i86pc"; then
2918 if test -n "$USE_64"; then
2919 PR_MD_ASFILES=os_SunOS_x86_64.s
2921 PR_MD_ASFILES=os_SunOS_x86.s
2924 if test -n "$USE_64"; then
2925 PR_MD_ASFILES=os_SunOS_sparcv9.s
2931 if test -n "$USE_PTHREADS"; then
2932 AC_DEFINE(_PR_HAVE_GETHOST_R)
2933 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2938 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
2940 dnl If the user passed in arg to --enable-optimize or --enable-debug,
2941 dnl make sure that we use it.
2942 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
2943 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
2946 if test -n "$_SAVE_DEBUG_FLAGS"; then
2947 _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
2950 if test -n "$MOZ_OPTIMIZE"; then
2951 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
2952 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
2955 if test -n "$MOZ_DEBUG_SYMBOLS"; then
2956 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
2957 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
2960 if test -n "$MOZ_OPTIMIZE"; then
2966 if test -n "$USE_64"; then
2970 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
2972 dnl ========================================================
2973 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
2974 dnl ========================================================
2975 case "$target_os" in
2977 CC="\$(CYGWIN_WRAPPER) $CC"
2978 CXX="\$(CYGWIN_WRAPPER) $CXX"
2979 RC="\$(CYGWIN_WRAPPER) $RC"
2983 dnl ========================================================
2984 dnl = Use malloc wrapper lib
2985 dnl ========================================================
2986 AC_ARG_ENABLE(wrap-malloc,
2987 [ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
2988 [ if test "$enableval" = "yes"; then
2992 if test -n "$_WRAP_MALLOC"; then
2993 if test "$GNU_CC"; then
2994 WRAP_MALLOC_CFLAGS="${LDFLAGS} ${WRAP_MALLOC_CFLAGS} -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"
2995 DSO_LDOPTS="$DSO_LDOPTS $WRAP_MALLOC_CFLAGS"
2997 AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
3001 dnl ========================================================
3002 dnl = Location of malloc wrapper lib
3003 dnl ========================================================
3004 AC_ARG_WITH(wrap-malloc,
3005 [ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
3006 WRAP_MALLOC_LIB=$withval)
3008 dnl ========================================================
3009 dnl Substitution of found variables.
3010 dnl ========================================================
3011 AC_SUBST(SHELL_OVERRIDE)
3013 AC_SUBST(MOZILLA_CLIENT)
3020 AC_SUBST(HOST_CFLAGS)
3022 AC_SUBST(HOST_LDFLAGS)
3024 AC_SUBST(GCC_USE_GNU_LD)
3026 AC_SUBST(CROSS_COMPILE)
3028 AC_SUBST(MOZ_OPTIMIZE)
3030 AC_SUBST(MOZ_DEBUG_SYMBOLS)
3036 AC_SUBST(OBJECT_MODE)
3037 AC_SUBST(ENABLE_STRIP)
3039 AC_SUBST(USE_PTHREADS)
3040 AC_SUBST(USE_BTHREADS)
3041 AC_SUBST(USE_USER_PTHREADS)
3042 AC_SUBST(USE_NSPR_THREADS)
3047 AC_SUBST(MOD_MAJOR_VERSION)
3048 AC_SUBST(MOD_MINOR_VERSION)
3049 AC_SUBST(MOD_PATCH_VERSION)
3050 AC_SUBST(NSPR_MODNAME)
3051 AC_SUBST(MDCPUCFG_H)
3052 AC_SUBST(PR_MD_CSRCS)
3053 AC_SUBST(PR_MD_ASFILES)
3054 AC_SUBST(PR_MD_ARCH_DIR)
3057 AC_SUBST(OBJ_SUFFIX)
3058 AC_SUBST(LIB_SUFFIX)
3059 AC_SUBST(DLL_SUFFIX)
3060 AC_SUBST(ASM_SUFFIX)
3061 AC_SUBST(WRAP_MALLOC_CFLAGS)
3062 AC_SUBST(WRAP_MALLOC_LIB)
3064 AC_SUBST(DSO_CFLAGS)
3065 AC_SUBST(DSO_LDOPTS)
3069 AC_SUBST(OS_RELEASE)
3071 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3086 AC_SUBST(PROFILE_GEN_CFLAGS)
3087 AC_SUBST(PROFILE_GEN_LDFLAGS)
3088 AC_SUBST(PROFILE_USE_CFLAGS)
3089 AC_SUBST(PROFILE_USE_LDFLAGS)
3092 AC_SUBST(RESOLVE_LINK_SYMBOLS)
3093 AC_SUBST(AIX_LINK_OPTS)
3094 AC_SUBST(NOSUCHFILE)
3095 AC_SUBST(MOZ_OBJFORMAT)
3096 AC_SUBST(ULTRASPARC_LIBRARY)
3099 AC_SUBST(OBJDIR_NAME)
3100 AC_SUBST(RELEASE_OBJDIR_NAME)
3107 AC_SUBST(OS_DLLFLAGS)
3108 AC_SUBST(CYGWIN_WRAPPER)
3109 AC_SUBST(VISIBILITY_FLAGS)
3110 AC_SUBST(WRAP_SYSTEM_INCLUDES)
3111 AC_SUBST(MACOS_SDK_DIR)
3112 AC_SUBST(SYMBIAN_SDK_DIR)
3116 dnl ========================================================
3117 dnl Generate output files.
3118 dnl ========================================================
3129 lib/libc/include/Makefile
3130 lib/libc/src/Makefile
3134 pkg/solaris/Makefile
3135 pkg/solaris/SUNWpr/Makefile
3136 pkg/solaris/SUNWprd/Makefile
3139 pr/include/md/Makefile
3140 pr/include/obsolete/Makefile
3141 pr/include/private/Makefile
3144 pr/src/linking/Makefile
3145 pr/src/malloc/Makefile
3147 pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3148 pr/src/memory/Makefile
3149 pr/src/misc/Makefile
3150 pr/src/threads/Makefile
3152 pr/tests/dll/Makefile
3155 dnl lib/tests/Makefile
3156 dnl pr/tests/w16gui/Makefile
3159 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3160 MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
3161 elif test -n "$USE_PTHREADS"; then
3162 MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"
3163 elif test -n "$USE_BTHREADS"; then
3164 MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
3167 if test -n "$USE_CPLUS"; then
3168 MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
3171 echo $MAKEFILES > unallmakefiles
3173 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])