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)'
86
dnl Link in libraries necessary to resolve all symbols for shared libs
89
dnl ========================================================
91
dnl = Dont change the following lines. Doing so breaks:
93
dnl = CFLAGS="-foo" ./configure
95
dnl ========================================================
97
CXXFLAGS="${CXXFLAGS=}"
99
DLLFLAGS="${DLLFLAGS=}"
100
HOST_CFLAGS="${HOST_CFLAGS=}"
101
HOST_LDFLAGS="${HOST_LDFLAGS=}"
105
# Check to see if we are really running in a msvc environemnt
107
AC_CHECK_PROGS(CC, cl)
108
if test "$CC" = "cl"; then
109
echo 'main() { return 0; }' > dummy.c
110
${CC} -o dummy dummy.c >/dev/null 2>&1
115
AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
117
rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
128
if test -n "$_WIN32_MSVC"; then
130
SKIP_COMPILER_CHECKS=1
131
SKIP_LIBRARY_CHECKS=1
134
dnl ========================================================
135
dnl = Android uses a very custom (hacky) toolchain; we need to do this
136
dnl = here, so that the compiler checks can succeed
137
dnl ========================================================
139
AC_ARG_WITH(android-ndk,
140
[ --with-android-ndk=DIR
141
location where the Android NDK can be found],
142
android_ndk=$withval)
144
AC_ARG_WITH(android-toolchain,
145
[ --with-android-toolchain=DIR
146
location of the android toolchain, default NDK/build/prebuilt/HOST/arm-eabi-4.4.0],
147
android_toolchain=$withval)
149
AC_ARG_WITH(android-platform,
150
[ --with-android-platform=DIR
151
location of platform dir, default NDK/build/platforms/android-5/arch-arm],
152
android_platform=$withval)
155
arm-linux*-android*|*-linuxandroid*)
156
android_tool_prefix="arm-linux-androideabi"
159
android_tool_prefix="arm-eabi"
162
android_tool_prefix="$target_os"
167
*-android*|*-linuxandroid*)
168
if test -z "$android_ndk" ; then
169
AC_MSG_ERROR([You must specify --with-android-ndk=/path/to/ndk when targeting Android.])
172
if test -z "$android_toolchain" ; then
173
android_toolchain="$android_ndk"/build/prebuilt/`uname -s | tr "[[:upper:]]" "[[:lower:]]"`-x86/arm-eabi-4.4.0
176
if test -z "$android_platform" ; then
177
android_platform="$android_ndk"/build/platforms/android-5/arch-arm
181
AS="$android_toolchain"/bin/"$android_tool_prefix"-as
182
CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
183
CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
184
CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
185
LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
186
AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
187
RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
188
STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
190
CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
191
CFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fno-short-enums -fno-exceptions $CFLAGS"
192
CXXFLAGS="-mandroid -I$android_platform/usr/include -msoft-float -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
193
LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
195
dnl prevent cross compile section from using these flags as host flags
196
if test -z "$HOST_CPPFLAGS" ; then
199
if test -z "$HOST_CFLAGS" ; then
202
if test -z "$HOST_CXXFLAGS" ; then
205
if test -z "$HOST_LDFLAGS" ; then
209
WRAP_MALLOC_CFLAGS="-Wl,--wrap=dlopen -Wl,--wrap=dlclose -Wl,--wrap=dlerror -Wl,--wrap=dlsym -Wl,--wrap=dladdr"
215
dnl ========================================================
217
dnl = Check options that may affect the compiler
219
dnl ========================================================
220
dist_prefix='${MOD_DEPTH}/dist'
221
dist_bindir='${dist_prefix}/bin'
222
dist_includedir='${dist_prefix}/include/nspr'
223
dist_libdir='${dist_prefix}/lib'
224
dnl If the --includedir option was not specified, add '/nspr' to autoconf's
225
dnl default value of includedir.
226
if test "${includedir}" = '${prefix}/include'; then
227
includedir='${prefix}/include/nspr'
230
AC_ARG_WITH(dist-prefix,
231
[ --with-dist-prefix=DIST_PREFIX
232
place build files in DIST_PREFIX [dist]],
233
dist_prefix=$withval)
235
AC_ARG_WITH(dist-bindir,
236
[ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
237
dist_bindir=$withval)
239
AC_ARG_WITH(dist-includedir,
240
[ --with-dist-includedir=DIR
241
build include files in DIR [DIST_PREFIX/include/nspr]],
242
dist_includedir=$withval)
244
AC_ARG_WITH(dist-libdir,
245
[ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
246
dist_libdir=$withval)
248
AC_SUBST(dist_prefix)
249
AC_SUBST(dist_bindir)
250
AC_SUBST(dist_includedir)
251
AC_SUBST(dist_libdir)
253
dnl Check if NSPR is being compiled for Mozilla
254
dnl Let --with-arg override environment setting
257
[ --with-mozilla Compile NSPR with Mozilla support],
258
[ if test "$withval" = "yes"; then
259
AC_DEFINE(MOZILLA_CLIENT)
264
[ if test -n "$MOZILLA_CLIENT"; then
265
AC_DEFINE(MOZILLA_CLIENT)
268
AC_ARG_ENABLE(optimize,
269
[ --enable-optimize[=OPT] Enable code optimizations (ie. -O2) ],
270
[ if test "$enableval" != "no"; then
272
if test -n "$enableval" -a "$enableval" != "yes"; then
273
_OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
274
_SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
281
[ --enable-debug[=DBG] Enable debugging (using compiler flags DBG)],
282
[ if test "$enableval" != "no"; then
285
if test -n "$enableval" -a "$enableval" != "yes"; then
286
_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
287
_SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
294
AC_ARG_ENABLE(debug-symbols,
295
[ --enable-debug-symbols[=DBG] Enable debugging symbols
296
(using compiler flags DBG)],
297
[ if test "$enableval" != "no"; then
299
if test -n "$enableval" -a "$enableval" != "yes"; then
300
if test -z "$_SAVE_DEBUG_FLAGS"; then
301
_DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
302
_SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
304
AC_MSG_ERROR([--enable-debug-symbols flags cannot be used with --enable-debug flags])
311
AC_ARG_ENABLE(win32-target,
312
[ --enable-win32-target=\$t
313
Specify win32 flavor. (WIN95 or WINNT)],
314
OS_TARGET=`echo $enableval | tr a-z A-Z`)
316
AC_ARG_ENABLE(symbian-target,
317
[ --enable-symbian-target=\$t
318
Specify symbian flavor. (WINSCW or GCCE)],
319
OS_TARGET=`echo $enableval | tr a-z A-Z`)
321
AC_ARG_ENABLE(debug-rtl,
322
[ --enable-debug-rtl Use the MSVC debug runtime library],
323
[ if test "$enableval" = "yes"; then
328
[ --enable-n32 Enable n32 ABI support (IRIX only)],
329
[ if test "$enableval" = "yes"; then
331
else if test "$enableval" = "no"; then
337
[ --enable-64bit Enable 64-bit support (on certain platforms)],
338
[ if test "$enableval" = "yes"; then
342
AC_ARG_ENABLE(mdupdate,
343
[ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
344
[ if test "$enableval" = "yes"; then
349
[ --enable-cplus Enable some c++ api routines],
350
[ if test "$enableval" = "yes"; then
354
AC_ARG_WITH(arm-kuser,
355
[ --with-arm-kuser Use kuser helpers (Linux/ARM only)
356
(Requires kernel 2.6.13 or later)],
357
[ if test "$withval" = "yes"; then
358
AC_DEFINE(_PR_ARM_KUSER)
361
dnl ========================================================
362
dnl = Mac OS X SDK support
363
dnl ========================================================
364
AC_ARG_WITH(macos-sdk,
365
[ --with-macos-sdk=dir Location of platform SDK to use (Mac OS X only)],
366
MACOS_SDK_DIR=$withval)
368
AC_ARG_ENABLE(macos-target,
369
[ --enable-macos-target=VER
370
Set the minimum MacOS version needed at runtime
371
[10.2 for ppc, 10.4 for x86]],
372
[_MACOSX_DEPLOYMENT_TARGET=$enableval])
374
dnl ========================================================
376
dnl = Set the threading model
378
dnl ========================================================
382
case "${target_os}" in
394
dnl ========================================================
396
dnl = Set the default C compiler
398
dnl ========================================================
399
if test -z "$CC"; then
403
if test -z "$USE_NSPR_THREADS"; then
429
dnl ========================================================
431
dnl = Set the default C++ compiler
433
dnl ========================================================
434
if test -z "$CXX"; then
438
if test -z "$USE_NSPR_THREADS"; then
446
case "${target_os}" in
474
if test -z "$SKIP_PATH_CHECKS"; then
475
AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
478
if test -n "$MOZ_DEBUG"; then
480
DEFINES="$DEFINES -UNDEBUG"
482
case "${target_os}" in
484
DEFINES="$DEFINES -DDEBUG_${USER}"
486
msvc*|mks*|cygwin*|mingw*|wince*|winmo*|os2*)
487
DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
490
DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
495
DEFINES="$DEFINES -UDEBUG"
498
if test -z "$SKIP_COMPILER_CHECKS"; then
499
dnl ========================================================
500
dnl Checks for compilers.
501
dnl ========================================================
502
if test "$target" != "$host"; then
503
echo "cross compiling from $host to $target"
507
_SAVE_CFLAGS="$CFLAGS"
508
_SAVE_LDFLAGS="$LDFLAGS"
510
AC_MSG_CHECKING([for $host compiler])
511
AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
512
if test -z "$HOST_CC"; then
513
AC_MSG_ERROR([no acceptable cc found in \$PATH])
515
AC_MSG_RESULT([$HOST_CC])
516
if test -z "$HOST_CFLAGS"; then
517
HOST_CFLAGS="$CFLAGS"
519
if test -z "$HOST_LDFLAGS"; then
520
HOST_LDFLAGS="$LDFLAGS"
524
CFLAGS="$HOST_CFLAGS"
525
LDFLAGS="$HOST_LDFLAGS"
527
AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
528
AC_TRY_COMPILE([], [return(0);],
529
[ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
530
AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
534
LDFLAGS=$_SAVE_LDFLAGS
536
case "$build:$target" in
537
powerpc-apple-darwin8*:i?86-apple-darwin*)
538
dnl The Darwin cross compiler doesn't necessarily point itself at a
539
dnl root that has libraries for the proper architecture, it defaults
540
dnl to the system root. The libraries in the system root on current
541
dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
542
dnl checks will fail. Fake a working SDK in that case.
544
_SAVE_CXXFLAGS=$CXXLAGS
545
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
546
CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
550
AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
553
if test -n "$USE_CPLUS"; then
554
AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
559
case "$build:$target" in
560
powerpc-apple-darwin8*:i?86-apple-darwin*)
561
dnl Revert the changes made above. From this point on, the target
562
dnl compiler will never be used without applying the SDK to CFLAGS
563
dnl (see --with-macos-sdk below).
565
CXXFLAGS=$_SAVE_CXXFLAGS
569
AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
570
AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
571
AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
572
AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
573
AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
574
AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
578
if test -n "$USE_CPLUS"; then
579
if test "$CC" = "cl" -a -z "$CXX"; then
587
AC_PATH_PROGS(AS, as, $CC)
588
AC_PATH_PROGS(AR, ar, echo not_ar)
589
AC_PATH_PROGS(LD, ld link, echo not_ld)
590
AC_PATH_PROGS(STRIP, strip, echo not_strip)
591
AC_PATH_PROGS(WINDRES, windres, echo not_windres)
592
if test -z "$HOST_CC"; then
595
if test -z "$HOST_CFLAGS"; then
596
HOST_CFLAGS="$CFLAGS"
600
if test "$GCC" = "yes"; then
603
if test "$GXX" = "yes"; then
606
if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
611
case "$build:$target" in
612
i?86-apple-darwin*:powerpc-apple-darwin*)
613
dnl cross_compiling will have erroneously been set to "no" in this
614
dnl case, because the x86 build host is able to run ppc code in a
615
dnl translated environment, making a cross compiler appear native.
620
if test "$cross_compiling" = "yes"; then
626
dnl ========================================================
627
dnl Check for gcc -pipe support
628
dnl ========================================================
629
AC_MSG_CHECKING([for gcc -pipe support])
630
if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
631
echo '#include <stdio.h>' > dummy-hello.c
632
echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
633
${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
634
cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
640
if test "$_res_as_stdin" = "yes"; then
642
CFLAGS="$CFLAGS -pipe"
643
AC_TRY_COMPILE( [ #include <stdio.h> ],
644
[printf("Hello World\n");],
645
[_res_gcc_pipe="yes"],
646
[_res_gcc_pipe="no"] )
649
if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
651
CFLAGS="$CFLAGS -pipe"
652
CXXFLAGS="$CXXFLAGS -pipe"
656
rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
657
AC_MSG_RESULT([$_res])
662
dnl ========================================================
663
dnl Profile guided optimization
664
dnl ========================================================
665
dnl Test for profiling options
666
dnl Under gcc 3.4+, use -fprofile-generate/-fprofile-use
668
_SAVE_CFLAGS="$CFLAGS"
669
CFLAGS="$CFLAGS -fprofile-generate -fprofile-correction"
671
AC_MSG_CHECKING([whether C compiler supports -fprofile-generate])
672
AC_TRY_COMPILE([], [return 0;],
673
[ PROFILE_GEN_CFLAGS="-fprofile-generate"
674
result="yes" ], result="no")
675
AC_MSG_RESULT([$result])
677
if test $result = "yes"; then
678
PROFILE_GEN_LDFLAGS="-fprofile-generate"
679
PROFILE_USE_CFLAGS="-fprofile-use -fprofile-correction -Wcoverage-mismatch"
680
PROFILE_USE_LDFLAGS="-fprofile-use"
683
CFLAGS="$_SAVE_CFLAGS"
685
dnl ===============================================================
686
dnl Check for .hidden assembler directive and visibility attribute.
687
dnl Borrowed from glibc configure.in
688
dnl ===============================================================
689
if test "$GNU_CC"; then
690
AC_CACHE_CHECK(for visibility(hidden) attribute,
691
ac_cv_visibility_hidden,
692
[cat > conftest.c <<EOF
693
int foo __attribute__ ((visibility ("hidden"))) = 1;
695
ac_cv_visibility_hidden=no
696
if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
697
if grep '\.hidden.*foo' conftest.s >/dev/null; then
698
ac_cv_visibility_hidden=yes
703
if test "$ac_cv_visibility_hidden" = "yes"; then
704
AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
705
AC_CACHE_CHECK(for visibility pragma support,
706
ac_cv_visibility_pragma,
707
[cat > conftest.c <<EOF
708
#pragma GCC visibility push(hidden)
710
#pragma GCC visibility push(default)
713
ac_cv_visibility_pragma=no
714
if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
715
if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
716
if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
717
ac_cv_visibility_pragma=yes
723
if test "$ac_cv_visibility_pragma" = "yes"; then
724
AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
725
# To work around a build problem on Linux x86-64 (Bugzilla bug
726
# 293438), we use the -fvisibility=hidden flag. This flag is less
727
# optimal than #pragma GCC visibility push(hidden) because the flag
728
# assumes that symbols defined outside the current source file have
729
# the default visibility. This has the advantage that we don't need
730
# to wrap system header files, but has the disadvantage that calls
731
# to hidden symbols defined in other source files cannot be
732
# optimized by the compiler. The -fvisibility=hidden flag does
733
# hide and export symbols correctly.
734
#VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
735
#WRAP_SYSTEM_INCLUDES=1
736
VISIBILITY_FLAGS="-fvisibility=hidden"
737
WRAP_SYSTEM_INCLUDES=
742
fi # SKIP_COMPILER_CHECKS
744
dnl ========================================================
745
dnl Checks for programs.
746
dnl ========================================================
747
if test -z "$SKIP_PATH_CHECKS"; then
748
AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
749
elif test -z "$PERL"; then
753
dnl ========================================================
754
dnl Default platform specific options
755
dnl ========================================================
760
MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
768
if test -n "$CROSS_COMPILE"; then
769
OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
771
OS_TEST="${target_cpu}"
772
case "${target_os}" in
773
linux*) OS_ARCH=Linux ;;
774
solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
775
mingw*) OS_ARCH=WINNT ;;
776
wince*) OS_ARCH=WINCE ;;
777
winmo*) OS_ARCH=WINCE ;;
778
darwin*) OS_ARCH=Darwin ;;
779
riscos*) OS_ARCH=RISCOS ;;
782
OS_ARCH=`uname -s | sed -e 's|/|_|g'`
783
OS_RELEASE=`uname -r`
787
if test "$OS_ARCH" = "IRIX64"; then
791
if test "$OS_ARCH" = "AIX"; then
792
OS_RELEASE=`uname -v`.`uname -r`
795
if test "$OS_ARCH" = "FreeBSD"; then
796
OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
799
if test "$OS_ARCH" = "Linux"; then
800
OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
801
OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
804
#######################################################################
805
# Master "Core Components" macros for getting the OS target #
806
#######################################################################
809
# Note: OS_TARGET should be specified on the command line for gmake.
810
# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
811
# The difference between the Win95 target and the WinNT target is that
812
# the WinNT target uses Windows NT specific features not available
813
# in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
814
# at lesser performance (the Win95 target uses threads; the WinNT target
817
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
822
# The following hack allows one to build on a WIN95 machine (as if
823
# s/he were cross-compiling on a WINNT host for a WIN95 target).
824
# It also accomodates for MKS's uname.exe. If you never intend
825
# to do development on a WIN95 machine, you don't need this hack.
840
CYGWIN_9*|CYGWIN_ME*)
841
OS_ARCH='CYGWIN_NT-4.0'
851
# On WIN32, we also define the variable CPU_ARCH.
857
if test "$CPU_ARCH" = "I386"; then
863
# If uname -s returns "Windows_NT", we assume that we are using
864
# the uname.exe in MKS toolkit.
866
# The -r option of MKS uname only returns the major version number.
867
# So we need to use its -v option to get the minor version number.
868
# Moreover, it doesn't have the -p option, so we need to use uname -m.
871
OS_MINOR_RELEASE=`uname -v`
872
if test "$OS_MINOR_RELEASE" = "00"; then
875
OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
878
# MKS's uname -m returns "586" on a Pentium machine.
880
if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
884
CYGWIN_NT*|MINGW*_NT*)
886
# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
887
# the uname.exe in the Cygwin tools.
888
# If uname -s returns MINGW32_NT-5.1, we assume that we are using
889
# the uname.exe in the MSYS tools.
891
OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
895
# Cygwin's uname -m returns "i686" on a Pentium Pro machine.
897
if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
903
if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
905
if test -n "$MOZ_DEBUG"; then
909
if test -z "$OS_TARGET"; then
912
if test "$OS_TARGET" = "WIN95"; then
915
OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
917
dnl ========================================================
918
dnl Enable high-memory support on OS/2 by default.
919
dnl ========================================================
920
AC_ARG_ENABLE(os2-high-mem,
921
[ --disable-os2-high-mem Disable high-memory support on OS/2],
922
[ if test "$enableval" = "no"; then
925
MOZ_OS2_HIGH_MEMORY=1
928
dnl ========================================================
929
dnl = ARM toolchain tweaks
930
dnl ========================================================
933
case "${CPU_ARCH}-${OS_TARGET}" in
941
if test -n "$MOZ_PLATFORM_MAEMO"; then
946
if test "$MOZ_PLATFORM_MAEMO" = 6; then
952
dnl Kept for compatibility with some buildbot mozconfig
953
AC_ARG_ENABLE(thumb2, [], MOZ_THUMB=$enableval)
956
[ --with-thumb[[=yes|no|toolchain-default]]]
957
[ Use Thumb instruction set (-mthumb)],
958
if test -z "$GNU_CC"; then
959
AC_MSG_ERROR([--with-thumb is not supported on non-GNU toolchain-defaults])
963
AC_ARG_WITH(thumb-interwork,
964
[ --with-thumb-interwork[[=yes|no|toolchain-default]]
965
Use Thumb/ARM instuctions interwork (-mthumb-interwork)],
966
if test -z "$GNU_CC"; then
967
AC_MSG_ERROR([--with-thumb-interwork is not supported on non-GNU toolchain-defaults])
969
MOZ_THUMB_INTERWORK=$withval)
972
[ --with-arch=[[type|toolchain-default]]
973
Use specific CPU features (-march=type)],
974
if test -z "$GNU_CC"; then
975
AC_MSG_ERROR([--with-arch is not supported on non-GNU toolchain-defaults])
980
[ --with-fpu=[[type|toolchain-default]]
981
Use specific FPU type (-mfpu=type)],
982
if test -z "$GNU_CC"; then
983
AC_MSG_ERROR([--with-fpu is not supported on non-GNU toolchain-defaults])
987
AC_ARG_WITH(float-abi,
988
[ --with-float-abi=[[type|toolchain-default]]
989
Use specific arm float ABI (-mfloat-abi=type)],
990
if test -z "$GNU_CC"; then
991
AC_MSG_ERROR([--with-float-abi is not supported on non-GNU toolchain-defaults])
993
MOZ_FLOAT_ABI=$withval)
995
AC_ARG_WITH(soft-float,
996
[ --with-soft-float[[=yes|no|toolchain-default]]
997
Use soft float library (-msoft-float)],
998
if test -z "$GNU_CC"; then
999
AC_MSG_ERROR([--with-soft-float is not supported on non-GNU toolchain-defaults])
1001
MOZ_SOFT_FLOAT=$withval)
1004
toolchain-default|"")
1008
arch_flag="-march=$MOZ_ARCH"
1012
case "$MOZ_THUMB" in
1015
thumb_flag="-mthumb"
1022
_SAVE_CFLAGS="$CFLAGS"
1024
AC_TRY_COMPILE([],[return sizeof(__thumb2__);],
1027
CFLAGS="$_SAVE_CFLAGS"
1032
case "$MOZ_THUMB_INTERWORK" in
1034
thumb_interwork_flag="-mthumb-interwork"
1037
thumb_interwork_flag="-mno-thumb-interwork"
1039
*) # toolchain-default
1040
thumb_interwork_flag=""
1045
toolchain-default|"")
1049
fpu_flag="-mfpu=$MOZ_FPU"
1053
case "$MOZ_FLOAT_ABI" in
1054
toolchain-default|"")
1058
float_abi_flag="-mfloat-abi=$MOZ_FLOAT_ABI"
1062
case "$MOZ_SOFT_FLOAT" in
1064
soft_float_flag="-msoft-float"
1067
soft_float_flag="-mno-soft-float"
1069
*) # toolchain-default
1074
dnl Use echo to avoid accumulating space characters
1075
all_flags=`echo $arch_flag $thumb_flag $thumb_interwork_flag $fpu_flag $float_abi_flag $soft_float_flag`
1076
if test -n "$all_flags"; then
1077
_SAVE_CFLAGS="$CFLAGS"
1079
AC_MSG_CHECKING(whether the chosen combination of compiler flags ($all_flags) works)
1080
AC_TRY_COMPILE([],[return 0;],
1081
AC_MSG_RESULT([yes]),
1084
CFLAGS="$_SAVE_CFLAGS $all_flags"
1085
CXXFLAGS="$CXXFLAGS $all_flags"
1086
ASFLAGS="$ASFLAGS $all_flags"
1087
if test -n "$thumb_flag"; then
1088
LDFLAGS="$LDFLAGS $thumb_flag"
1092
dnl ========================================================
1093
dnl Override of system specific host options
1094
dnl ========================================================
1099
*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*)
1100
NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
1101
if test `echo "${PATH}" | grep -c \;` = 0; then
1102
CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
1106
HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
1111
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
1115
dnl ========================================================
1116
dnl Override of system specific target options
1117
dnl ========================================================
1124
DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
1125
AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
1126
case "${target_os}" in
1128
AC_DEFINE(AIX_RENAME_SELECT)
1129
AC_DEFINE(_PR_NO_LARGE_FILES)
1130
AIX_LINK_OPTS='-bnso -berok'
1131
PR_MD_ASFILES=os_AIX.s
1134
AC_DEFINE(AIX_TIMERS)
1135
AC_DEFINE(_PR_NO_LARGE_FILES)
1139
AIX_LINK_OPTS='-bnso -berok'
1140
LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
1141
LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
1144
AC_DEFINE(AIX_TIMERS)
1145
AC_DEFINE(_PR_HAVE_OFF64_T)
1146
AIX_LINK_OPTS='-brtl -bnso -berok'
1149
AC_DEFINE(AIX_TIMERS)
1150
AC_DEFINE(_PR_HAVE_OFF64_T)
1151
AC_DEFINE(AIX4_3_PLUS)
1152
AC_DEFINE(HAVE_SOCKLEN_T)
1153
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1155
AIX_LINK_OPTS='-brtl -bnso -berok'
1158
AC_DEFINE(AIX_TIMERS)
1159
AC_DEFINE(_PR_HAVE_OFF64_T)
1160
AC_DEFINE(AIX4_3_PLUS)
1161
AC_DEFINE(HAVE_SOCKLEN_T)
1162
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1164
AIX_LINK_OPTS='-brtl -bnso -berok'
1167
CFLAGS="$CFLAGS -qro -qroconst"
1168
AIX_WRAP='$(DIST)/lib/aixwrap.o'
1169
AIX_TMP='./_aix_tmp.o'
1170
if test -n "$USE_64"; then
1171
MDCPUCFG_H=_aix64.cfg
1174
MDCPUCFG_H=_aix32.cfg
1177
RESOLVE_LINK_SYMBOLS=1
1180
*-android*|*-linuxandroid*)
1181
if test -z "$USE_NSPR_THREADS"; then
1186
AC_DEFINE(_GNU_SOURCE)
1187
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1189
CFLAGS="$CFLAGS -Wall"
1190
CXXFLAGS="$CXXFLAGS -Wall"
1191
MDCPUCFG_H=_linux.cfg
1193
MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@'
1195
DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1197
_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1198
# combo is not yet good at debugging inlined
1199
# functions (even when using DWARF2 as the
1211
AC_DEFINE(_POSIX_SOURCE)
1213
MDCPUCFG_H=_beos.cfg
1216
RESOLVE_LINK_SYMBOLS=1
1217
case "${target_cpu}" in
1220
_DEBUG_FLAGS='-gdwarf-2 -O0'
1221
MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
1222
AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
1228
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'
1230
_DEBUG_FLAGS='-g -O0'
1238
AC_DEFINE(NEED_BSDREGEX)
1240
CFLAGS="$CFLAGS -Wall -Wno-format"
1241
CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
1243
if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1245
elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
1249
MDCPUCFG_H=_bsdi.cfg
1254
case "$target_os" in
1256
AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1257
AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
1258
AC_DEFINE(_PR_NEED_H_ERRNO)
1265
AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
1266
AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
1268
AC_DEFINE(USE_DLFCN)
1269
AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1270
PR_MD_ASFILES=os_BSD_OS_386_2.s
1274
AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1275
AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1277
AC_DEFINE(USE_DLFCN)
1278
AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1279
MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1281
DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
1283
case "$target_os" in
1284
bsdi4.2* | bsdi4.3* | bsdi5.*)
1285
AC_DEFINE(_PR_HAVE_GETPROTO_R)
1286
AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1291
AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
1292
AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
1294
AC_DEFINE(USE_DLFCN)
1295
AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
1304
AC_DEFINE(HAVE_BSD_FLOCK)
1305
AC_DEFINE(HAVE_SOCKLEN_T)
1306
AS='$(CC) -x assembler-with-cpp'
1307
CFLAGS="$CFLAGS -Wall -fno-common"
1308
case "${target_cpu}" in
1310
if test -n "$USE_64"; then
1320
if test "`echo $CC | grep -c '\-arch '`" = "0"; then
1321
CC="$CC -arch $CPU_ARCH"
1324
DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1326
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1327
STRIP="$STRIP -x -S"
1330
MDCPUCFG_H=_darwin.cfg
1331
PR_MD_CSRCS=darwin.c
1332
PR_MD_ASFILES=os_Darwin.s
1334
# Add Mac OS X support for loading CFM & CFBundle plugins
1335
if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1336
AC_DEFINE(XP_MACOSX)
1339
if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1340
dnl Use the specified value
1341
export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1342
elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1343
dnl No value specified on the command line or in the environment,
1344
dnl use the lesser of the library's minimum or the architecture's
1346
case "${target_cpu}" in
1348
dnl Architecture minimum 10.2
1349
export MACOSX_DEPLOYMENT_TARGET=10.2
1352
dnl Architecture minimum 10.4
1353
export MACOSX_DEPLOYMENT_TARGET=10.4
1358
dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1359
dnl in use. NEXT_ROOT will be set and exported if it's needed for
1362
if test "$MACOS_SDK_DIR"; then
1363
dnl Sync this section with the one in Mozilla's top level.
1365
if test ! -d "$MACOS_SDK_DIR"; then
1366
AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
1367
specify a valid SDK. SDKs are installed when the optional cross-development
1368
tools are selected during the Xcode/Developer Tools installation.])
1372
CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1373
GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1374
GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1376
GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1377
if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1378
SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1379
if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1380
SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1383
SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1385
CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1387
dnl CPP needs to be set for AC_CHECK_HEADER.
1388
CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1391
HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1393
if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1394
dnl The build host is running Tiger (10.4) or earlier.
1395
dnl ld support for -syslibroot is compiler-agnostic, but
1396
dnl only available on Tiger and later. On Tiger and
1397
dnl earlier build hosts, just rely on NEXT_ROOT, because
1398
dnl it's not been shown to cause any problems.
1399
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}"
1401
dnl The build host is running Leopard (10.5) or later.
1402
dnl With NEXT_ROOT set, the linker will still not apply
1403
dnl it when resolving dependencies. This causes problems
1404
dnl on Leopard, where an SDK depends on frameworks which
1405
dnl were present in earlier OS releases (and the associated
1406
dnl SDK) but not in Leopard. -syslibroot does not have
1407
dnl this problem, but it results in harmless warnings when
1408
dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
1409
dnl on Leopard because the compiler uses it too.
1410
MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1413
LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1414
export NEXT_ROOT=$MACOS_SDK_DIR
1416
if test -n "$CROSS_COMPILE" ; then
1417
dnl NEXT_ROOT will be in the environment, but it
1418
dnl shouldn't be set for the build host. HOST_CXX is
1419
dnl presently unused.
1420
HOST_CC="NEXT_ROOT= $HOST_CC"
1421
HOST_CXX="NEXT_ROOT= $HOST_CXX"
1424
dnl gcc >= 4.0 uses different paths than above, but knows
1425
dnl how to find them itself.
1426
CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1428
dnl CPP needs to be set for AC_CHECK_HEADER.
1429
CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1431
dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1432
dnl has an ld that supports -syslibroot. Don't set
1433
dnl NEXT_ROOT because it will be ignored and cause
1434
dnl warnings when -syslibroot is specified.
1435
if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1436
dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1437
dnl based on the -isysroot it receives.
1438
LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1440
dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1442
LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1451
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1455
AC_DEFINE(_DGUX_SOURCE)
1456
AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1460
MDCPUCFG_H=_dgux.cfg
1465
if test -z "$USE_NSPR_THREADS"; then
1470
AC_DEFINE(HAVE_BSD_FLOCK)
1471
AC_DEFINE(HAVE_SOCKLEN_T)
1472
CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1473
MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1474
if test "$MOZ_OBJFORMAT" = "elf"; then
1479
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1481
DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1482
MDCPUCFG_H=_freebsd.cfg
1483
PR_MD_CSRCS=freebsd.c
1489
AC_DEFINE(_HPUX_SOURCE)
1490
# OSF1 and HPUX report the POLLHUP event for a socket when the
1491
# shutdown(SHUT_WR) operation is called for the remote end, even though
1492
# the socket is still writeable. Use select(), instead of poll(), to
1493
# workaround this problem.
1494
AC_DEFINE(_PR_POLL_WITH_SELECT)
1495
AC_DEFINE(_USE_BIG_FDS)
1496
DSO_LDOPTS='-b +h $(notdir $@)'
1498
if test "$OS_TEST" = "ia64"; then
1500
DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1501
CPU_ARCH_TAG=_$OS_TEST
1502
if test -z "$USE_64"; then
1505
PR_MD_ASFILES=os_HPUX_ia64.s
1509
PR_MD_ASFILES=os_HPUX.s
1511
if test -n "$USE_64"; then
1512
MDCPUCFG_H=_hpux64.cfg
1514
MDCPUCFG_H=_hpux32.cfg
1516
if test -z "$GNU_CC"; then
1522
ASFLAGS="$ASFLAGS -x assembler-with-cpp"
1525
if test -n "$MOZILLA_CLIENT"; then
1526
DEFAULT_IMPL_STRATEGY=_EMU
1529
if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1530
AC_DEFINE(_PR_NEED_H_ERRNO)
1532
DEFAULT_IMPL_STRATEGY=_EMU
1536
if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1537
AC_DEFINE(_PR_NO_LARGE_FILES)
1540
if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1541
AC_DEFINE(_PR_NEED_H_ERRNO)
1544
if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1545
AC_DEFINE(HAVE_INT_LOCALTIME_R)
1548
if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1549
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1552
# HP-UX 11i v2 (B.11.23) or higher
1554
case "$OS_RELEASE" in
1555
[C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1561
if test "$OS_RELEASE" = "B.10.01"; then
1563
DEFAULT_IMPL_STRATEGY=_EMU
1566
if test "$OS_RELEASE" = "B.10.10"; then
1568
AC_DEFINE(HPUX10_10)
1569
DEFAULT_IMPL_STRATEGY=_PTH
1572
if test "$OS_RELEASE" = "B.10.20"; then
1574
AC_DEFINE(HPUX10_20)
1575
if test -z "$GNU_CC"; then
1576
CFLAGS="$CFLAGS +DAportable +DS1.1"
1577
CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1579
DEFAULT_IMPL_STRATEGY=_PTH
1582
if test "$OS_RELEASE" = "B.10.30"; then
1584
AC_DEFINE(HPUX10_30)
1585
if test -z "$GNU_CC"; then
1586
CFLAGS="$CFLAGS +DAportable +DS1.1"
1587
CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1589
DEFAULT_IMPL_STRATEGY=_PTH
1592
if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1595
AC_DEFINE(_LARGEFILE64_SOURCE)
1596
AC_DEFINE(_PR_HAVE_OFF64_T)
1597
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1598
if test -z "$GNU_CC"; then
1599
if test -z "$USE_64"; then
1600
if test "$OS_TEST" = "ia64"; then
1601
CFLAGS="$CFLAGS +DD32"
1602
CXXFLAGS="$CXXFLAGS +DD32"
1604
CFLAGS="$CFLAGS +DAportable +DS2.0"
1605
CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1608
if test "$OS_TEST" = "ia64"; then
1609
CFLAGS="$CFLAGS +DD64"
1610
CXXFLAGS="$CXXFLAGS +DD64"
1612
CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1613
CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1617
DEFAULT_IMPL_STRATEGY=_PTH
1620
if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1624
elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1626
if test "$USE_NSPR_THREADS"; then
1629
if test "$USE_USER_PTHREADS"; then
1639
AC_DEFINE(_SGI_MP_SOURCE)
1640
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1642
PR_MD_ASFILES=os_Irix.s
1643
MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1645
RESOLVE_LINK_SYMBOLS=1
1646
if test -n "$USE_64"; then
1647
MDCPUCFG_H=_irix64.cfg
1649
MDCPUCFG_H=_irix32.cfg
1651
case "${target_os}" in
1668
if test "$GNU_CC"; then
1670
dnl If we are using gcc with native binutils, we need to
1672
dnl #lineno "filename" num num
1673
dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1674
dnl gcc command line, which passes -P to the preprocessor.
1676
AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1677
CFLAGS="$CFLAGS -Wall -Wno-format"
1678
_OPTIMIZE_FLAGS="-O6"
1680
if test -n "$USE_N32"; then
1681
AS='as -D_ASM $(INCLUDES) -n32'
1683
AS='as -D_ASM $(INCLUDES)'
1685
CFLAGS="$CFLAGS -fullwarn -xansi"
1686
if test "$USE_N32"; then
1687
_OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1689
_OPTIMIZE_FLAGS="-O -Olimit 4000"
1691
if test "$USE_MDUPDATE"; then
1692
CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1696
CFLAGS="$CFLAGS -multigot"
1697
DSO_LDOPTS="-no_unresolved"
1698
if test "$USE_N32"; then
1699
CFLAGS="$CFLAGS -n32 -woff 1209"
1700
DSO_LDOPTS="$DSO_LDOPTS -n32"
1702
if test "$USE_64"; then
1703
CFLAGS="$CFLAGS -64"
1705
CFLAGS="$CFLAGS -32"
1710
CFLAGS="$CFLAGS -xgot"
1714
if test "${target_os}" = "irix5.3"; then
1717
case "${target_os}" in
1719
if test -z "$GNU_CC"; then
1720
CFLAGS="$CFLAGS -mips3"
1722
AC_DEFINE(_PR_HAVE_GETPROTO_R)
1723
AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1724
AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1729
AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1734
*-linux*|*-gnu*|*-k*bsd*-gnu)
1735
if test -z "$USE_NSPR_THREADS"; then
1740
AC_DEFINE(_GNU_SOURCE)
1741
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1742
case "${target_os}" in
1747
CFLAGS="$CFLAGS -Wall"
1748
CXXFLAGS="$CXXFLAGS -Wall"
1749
MDCPUCFG_H=_linux.cfg
1751
MKSHLIB='$(CC) $(DSO_LDOPTS) $(WRAP_MALLOC_LIB) -o $@'
1753
DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1755
_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1756
# combo is not yet good at debugging inlined
1757
# functions (even when using DWARF2 as the
1760
if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1765
CPU_ARCH_TAG=_${CPU_ARCH}
1766
case "${target_cpu}" in
1770
CFLAGS="$CFLAGS -mieee"
1771
CXXFLAGS="$CXXFLAGS -mieee"
1775
PR_MD_ASFILES=os_Linux_x86.s
1778
PR_MD_ASFILES=os_Linux_ia64.s
1781
if test -n "$USE_64"; then
1782
PR_MD_ASFILES=os_Linux_x86_64.s
1785
PR_MD_ASFILES=os_Linux_x86.s
1791
PR_MD_ASFILES=os_Linux_ppc.s
1794
if test -n "$USE_64"; then
1798
PR_MD_ASFILES=os_Linux_ppc.s
1802
CFLAGS="$CFLAGS -m68020-60"
1803
CXXFLAGS="$CXXFLAGS -m68020-60"
1808
*-mingw*|*-cygwin*|*-msvc*|*-mks*)
1811
PR_MD_ARCH_DIR=windows
1812
RESOLVE_LINK_SYMBOLS=1
1814
if test -n "$GNU_CC"; then
1816
CXX="$CXX -mwindows"
1818
MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1820
# Use temp file for windres (bug 213281)
1821
RCFLAGS='-O coff --use-temp-file'
1826
AR='lib -NOLOGO -OUT:"$@"'
1828
RANLIB='echo not_ranlib'
1829
STRIP='echo not_strip'
1831
GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1836
# Determine compiler version
1838
_MSVC_VER_FILTER='s|.* \([0-9]\+\.[0-9]\+\.[0-9]\+\(\.[0-9]\+\)\?\).*|\1|p'
1840
CC_VERSION=`"${CC}" -v 2>&1 | sed -ne "$_MSVC_VER_FILTER"`
1841
_CC_MAJOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $1 }'`
1842
_CC_MINOR_VERSION=`echo ${CC_VERSION} | awk -F\. '{ print $2 }'`
1843
_CC_RELEASE=`echo ${CC_VERSION} | awk -F\. '{ print $3 }'`
1844
_CC_BUILD=`echo ${CC_VERSION} | awk -F\. '{ print $4 }'`
1845
MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1847
if test "$_CC_MAJOR_VERSION" -eq "14"; then
1848
dnl -DYNAMICBASE is only supported on VC8SP1 or newer,
1849
dnl so be very specific here!
1850
dnl VC8 is 14.00.50727.42, VC8SP1 is 14.00.50727.762
1851
if test $_CC_RELEASE -gt 50727; then
1853
elif test $_CC_BUILD -ge 762; then
1856
AC_DEFINE(_CRT_SECURE_NO_DEPRECATE)
1857
AC_DEFINE(_CRT_NONSTDC_NO_DEPRECATE)
1858
elif test $_CC_MAJOR_VERSION -ge 15; then
1860
AC_DEFINE(_CRT_SECURE_NO_WARNINGS)
1861
AC_DEFINE(_CRT_NONSTDC_NO_WARNINGS)
1864
if test -n "$_USE_DYNAMICBASE"; then
1865
DLLFLAGS="$DLLFLAGS -DYNAMICBASE"
1868
# Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1869
# tape manipulation utility (or something else)
1870
if test "$MSC_VER" -ge "1400"; then
1872
_MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1875
MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1876
if test -n "$MSMT_TOOL"; then
1877
MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1878
if test -z "$MSMANIFEST_TOOL_VERSION"; then
1879
AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1884
AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1888
CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1889
DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1893
PROFILE_GEN_CFLAGS="-GL"
1894
PROFILE_GEN_LDFLAGS="-LTCG:PGINSTRUMENT"
1895
PROFILE_USE_CFLAGS="-GL -wd4624 -wd4952"
1896
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
1898
if test -z "$MOZ_OPTIMIZE"; then
1899
CFLAGS="$CFLAGS -Od"
1902
if test -n "$USE_DEBUG_RTL"; then
1903
CFLAGS="$CFLAGS -MDd"
1905
CFLAGS="$CFLAGS -MD"
1908
if test -n "$MOZ_DEBUG"; then
1911
DEFINES="$DEFINES -U_DEBUG"
1914
if test -n "$MOZ_DEBUG_SYMBOLS"; then
1915
if test -n "$MOZ_OPTIMIZE"; then
1916
DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1917
LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1919
DLLFLAGS="$DLLFLAGS -DEBUG"
1920
LDFLAGS="$LDFLAGS -DEBUG"
1924
OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1925
if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1926
OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
1929
if test "$OS_TARGET" = "WINNT"; then
1930
CFLAGS="$CFLAGS -GT"
1931
LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1932
LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1934
LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1935
LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1939
if test -n "$USE_STATIC_TLS"; then
1940
AC_DEFINE(_PR_USE_STATIC_TLS)
1943
if test "$OS_TARGET" = "WINNT"; then
1947
# undefine WINNT as some versions of mingw gcc define it by default
1948
DEFINES="$DEFINES -UWINNT"
1949
AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1952
if test "$CPU_ARCH" = "x86"; then
1955
CPU_ARCH_TAG=$CPU_ARCH
1958
if test -n "$USE_DEBUG_RTL"; then
1962
case "$OS_TARGET" in
1964
MDCPUCFG_H=_winnt.cfg
1967
MDCPUCFG_H=_win95.cfg
1970
AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
1974
case "$target_cpu" in
1976
if test -n "$USE_64"; then
1991
AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
2000
AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2002
AR_FLAGS='-NOLOGO -OUT:"$@"'
2007
MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
2009
PR_MD_ARCH_DIR=windows
2010
RESOLVE_LINK_SYMBOLS=1
2012
MDCPUCFG_H=_win95.cfg
2013
LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2014
LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
2016
DLLFLAGS='-OUT:"$@"'
2017
if test -n "$MOZ_DEBUG_SYMBOLS"; then
2018
OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
2019
OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
2020
DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
2032
if test "$OS_RELEASE" = "2.03"; then
2033
AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
2035
AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
2038
if test -z "$GNU_CC"; then
2039
CFLAGS="$CFLAGS -Hnocopyr"
2040
CXXFLAGS="$CXXFLAGS -Hnocopyr"
2042
CFLAGS="$CFLAGS -fPIC -Wall"
2043
CXXFLAGS="$CXXFLAGS -fPIC -Wall"
2057
if test -z "$GNU_CC"; then
2058
CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
2061
OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
2070
AC_DEFINE(HAVE_BSD_FLOCK)
2071
if test -z "$USE_NSPR_THREADS"; then
2074
MDCPUCFG_H=_netbsd.cfg
2075
PR_MD_CSRCS=netbsd.c
2077
DSO_CFLAGS='-fPIC -DPIC'
2078
CFLAGS="$CFLAGS -ansi -Wall"
2079
CXXFLAGS="$CXXFLAGS -ansi -Wall"
2080
MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
2082
if test -z "$OBJECT_FMT"; then
2083
if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
2086
DSO_LDOPTS='-shared'
2090
DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
2094
if test "$LIBRUNPATH"; then
2095
DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
2106
AC_DEFINE(HAVE_SVID_GETTOD)
2108
CFLAGS="$CFLAGS -Xa -fullwarn"
2109
CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
2111
MDCPUCFG_H=_sony.cfg
2115
*-nextstep*|*-openstep*)
2118
AC_DEFINE(HAVE_BSD_FLOCK)
2119
AC_DEFINE(_POSIX_SOURCE)
2120
CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
2121
CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
2124
MDCPUCFG_H=_nextstep.cfg
2125
PR_MD_CSRCS=nextstep.c
2132
AC_DEFINE(_QNX_SOURCE)
2133
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2136
MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
2139
OS_LIBS="$OS_LIBS -lsocket"
2140
_OPTIMIZE_FLAGS="-O1"
2141
_DEBUG_FLAGS="-gstabs"
2147
AC_DEFINE(HAVE_BSD_FLOCK)
2148
AC_DEFINE(HAVE_SOCKLEN_T)
2149
CFLAGS="$CFLAGS -ansi -Wall"
2150
CXXFLAGS="$CXXFLAGS -ansi -Wall"
2153
MDCPUCFG_H=_openbsd.cfg
2154
PR_MD_CSRCS=openbsd.c
2156
if test -z "$USE_NSPR_THREADS"; then
2159
DSO_LDOPTS='-shared -fPIC'
2160
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2164
SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
2167
AC_DEFINE(_REENTRANT)
2168
# OSF1 and HPUX report the POLLHUP event for a socket when the
2169
# shutdown(SHUT_WR) operation is called for the remote end, even though
2170
# the socket is still writeable. Use select(), instead of poll(), to
2171
# workaround this problem.
2172
AC_DEFINE(_PR_POLL_WITH_SELECT)
2174
if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
2178
if test -z "$GNU_CC"; then
2179
CC="$CC -std1 -ieee_with_inexact"
2180
if test "$OS_RELEASE" != "V2.0"; then
2181
CC="$CC -readonly_strings"
2183
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
2184
AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
2186
CFLAGS="$CFLAGS -mieee"
2187
CXXFLAGS="$CXXFLAGS -mieee"
2190
if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2191
AC_DEFINE(HAVE_INT_LOCALTIME_R)
2193
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2194
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2196
if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
2197
AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
2199
DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
2200
MDCPUCFG_H=_osf1.cfg
2207
AC_DEFINE(_PR_NEED_H_ERRNO)
2216
AC_DEFINE(_PR_NEED_H_ERRNO)
2218
MDCPUCFG_H=_riscos.cfg
2219
PR_MD_CSRCS=riscos.c
2221
DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
2222
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2231
AC_DEFINE(_PR_NEED_H_ERRNO)
2232
CC='cc -b elf -KPIC'
2233
CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
2236
DSO_LDOPTS='-b elf -G'
2237
MDCPUCFG_H=_scoos.cfg
2245
AC_DEFINE(RELIANTUNIX)
2247
AC_DEFINE(HAVE_SVID_GETTOD)
2248
if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
2255
if test "$GNU_CC"; then
2256
AS='$(CC) -x assembler-with-cpp'
2257
if test "$CPU_ARCH" = "mips"; then
2260
CFLAGS="$CFLAGS -Wall -Wno-format"
2263
_OPTIMIZE_FLAGS='-O -F Olimit,4000'
2266
DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
2268
if test "$OS_RELEASE" = "5.43"; then
2269
AC_DEFINE(IP_MULTICAST)
2272
OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
2274
MDCPUCFG_H=_reliantunix.cfg
2275
PR_MD_CSRCS=reliantunix.c
2276
if test "${OS_ARCH}" = "mips"; then
2277
PR_MD_ASFILES=os_ReliantUNIX.s
2284
CFLAGS="$CFLAGS -Wall -Wno-format"
2285
if test "$USE_MDUPDATE"; then
2286
CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2293
if test "$OS_RELEASE" = "4.1.3_U1"; then
2295
OS_LIBS="$OS_LIBS -lm"
2297
MDCPUCFG_H=_sunos4.cfg
2298
PR_MD_CSRCS=sunos4.c
2302
if test -z "$USE_NSPR_THREADS"; then
2311
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2313
MDCPUCFG_H=_solaris.cfg
2314
PR_MD_CSRCS=solaris.c
2316
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2317
RESOLVE_LINK_SYMBOLS=1
2318
case "${OS_RELEASE}" in
2322
# It is safe to use the -Bdirect linker flag on Solaris 10 or later.
2326
if test -n "$GNU_CC"; then
2328
if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
2331
DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore'
2332
if test -n "$USE_B_DIRECT"; then
2333
DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
2337
DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2338
if test -n "$USE_B_DIRECT"; then
2339
DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2342
if test -n "$GNU_CC"; then
2343
CFLAGS="$CFLAGS -Wall"
2344
CXXFLAGS="$CXXFLAGS -Wall"
2345
if test -n "$USE_MDUPDATE"; then
2346
CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2347
CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2349
GCC_AS=`$CC -print-prog-name=as`
2350
if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2354
CFLAGS="$CFLAGS -xstrconst"
2355
CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2356
if test -z "$MOZ_OPTIMIZE"; then
2357
CFLAGS="$CFLAGS -xs"
2358
CXXFLAGS="$CXXFLAGS -xs"
2360
_OPTIMIZE_FLAGS=-xO4
2362
if test -z "$GNU_AS"; then
2363
ASFLAGS="$ASFLAGS -Wa,-P"
2365
if test -n "$USE_64"; then
2366
if test -n "$GNU_CC"; then
2370
if test "$OS_TEST" = "i86pc"; then
2371
CC="$CC -xarch=amd64"
2372
CXX="$CXX -xarch=amd64"
2375
CXX="$CXX -xarch=v9"
2379
if test "$OS_TEST" = "i86pc"; then
2380
if test -z "$USE_64"; then
2383
CPU_ARCH_TAG=_$OS_TEST
2384
# The default debug format, DWARF (-g), is not supported by gcc
2385
# on i386-ANY-sysv4/solaris, but the stabs format is. It is
2386
# assumed that the Solaris assembler /usr/ccs/bin/as is used.
2387
# If your gcc uses GNU as, you do not need the -Wa,-s option.
2388
if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2389
_DEBUG_FLAGS=-gstabs
2390
if test -z "$GNU_AS"; then
2391
_DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2395
case "${target_os}" in
2397
AC_DEFINE(_PR_NO_LARGE_FILES)
2400
AC_DEFINE(_PR_NO_LARGE_FILES)
2403
AC_DEFINE(SOLARIS2_5)
2406
AC_DEFINE(_PR_HAVE_OFF64_T)
2407
# The lfcompile64(5) man page on Solaris 2.6 says:
2408
# For applications that do not wish to conform to the POSIX or
2409
# X/Open specifications, the 64-bit transitional interfaces
2410
# are available by default. No compile-time flags need to be
2412
# But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2413
# The native compiler, gcc 2.8.x, and egcs don't have this problem.
2414
if test -n "$GNU_CC"; then
2415
AC_DEFINE(_LARGEFILE64_SOURCE)
2419
case "${target_os}" in
2431
# Solaris 8 or higher has IPv6.
2432
AC_DEFINE(_PR_INET6)
2435
if test "$CPU_ARCH" = "sparc"; then
2436
# 64-bit Solaris SPARC requires V9 architecture, so the following
2438
if test -z "$USE_64"; then
2439
ULTRASPARC_LIBRARY=nspr_flt
2442
# Purify requires that binaries linked against nspr also
2443
# be linked against -lrt (or -lposix4) so add it to OS_LIBS
2445
_librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2446
OS_LIBS="$OS_LIBS $_librt"
2455
if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2456
AC_DEFINE(_PR_NO_LARGE_FILES)
2457
CC='$(NSDEPTH)/build/hcc cc'
2458
CXX='$(NSDEPTH)/build/hcpp CC'
2459
MDCPUCFG_H=_unixware.cfg
2461
AC_DEFINE(_LARGEFILE64_SOURCE)
2462
AC_DEFINE(_PR_HAVE_OFF64_T)
2463
AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2464
MDCPUCFG_H=_unixware7.cfg
2466
PR_MD_CSRCS=unixware.c
2472
AC_ARG_WITH(symbian-sdk,
2473
[ --with-symbian-sdk=SYMBIAN_SDK_DIR
2474
The path to the Symbian SDK],
2475
SYMBIAN_SDK_DIR=$withval)
2477
echo -----------------------------------------------------------------------------
2478
echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2479
echo -----------------------------------------------------------------------------
2484
AC_DEFINE(__SYMBIAN32__)
2487
AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2488
AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2489
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2490
AC_DEFINE(HAVE_SOCKLEN_T)
2498
MDCPUCFG_H=_symbian.cfg
2499
PR_MD_CSRCS=symbian.c
2501
RANLIB='echo no ranlib '
2504
OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2505
CFLAGS="$CFLAGS -MD -nostdinc"
2506
SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2507
echo -------------------------------------------------------
2508
echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2509
echo -------------------------------------------------------
2510
case "$OS_TARGET" in
2516
WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2517
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)"
2518
SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2519
AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2523
AC_DEFINE(__WINSCW__)
2524
DEFINES="$DEFINES -U_WIN32"
2527
CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2528
CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2529
SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2532
DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2535
AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2538
CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2544
AC_DEFINE(BSD_SELECT)
2545
AC_DEFINE(TCPV40HDRS)
2553
RESOLVE_LINK_SYMBOLS=1
2558
CFLAGS="$CFLAGS -Wall -Zomf"
2559
CXXFLAGS="$CFLAGS -Wall -Zomf"
2560
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2562
DSO_LDOPTS='-Zomf -Zdll'
2564
_OPTIMIZE_FLAGS="-O2 -s"
2565
_DEBUG_FLAGS="-g -fno-inline"
2566
if test -n "$MOZ_OPTIMIZE"; then
2567
DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2571
if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2572
LDFLAGS="$LDFLAGS -Zhigh-mem"
2573
AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2576
# GCC for OS/2 currently predefines these, but we don't want them
2577
DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2586
if test -z "$SKIP_LIBRARY_CHECKS"; then
2587
dnl ========================================================
2588
dnl Check for system libraries
2589
dnl ========================================================
2590
dnl AC_CHECK_LIB(C, main)
2591
dnl AC_CHECK_LIB(C_r, main)
2592
dnl AC_CHECK_LIB(c, main)
2593
dnl AC_CHECK_LIB(c_r, main)
2594
dnl AC_CHECK_LIB(dce, main)
2595
dnl AC_CHECK_LIB(dl, main)
2596
dnl AC_CHECK_LIB(dld, main)
2597
dnl AC_CHECK_LIB(gen, main)
2598
dnl AC_CHECK_LIB(ip6, main)
2599
dnl AC_CHECK_LIB(l, main)
2600
dnl AC_CHECK_LIB(m, main)
2601
dnl AC_CHECK_LIB(nsl, main)
2602
dnl AC_CHECK_LIB(posix4, main)
2603
dnl AC_CHECK_LIB(prstrms, main)
2604
dnl AC_CHECK_LIB(prstrms_shr, main)
2605
dnl AC_CHECK_LIB(pthread, main)
2606
dnl AC_CHECK_LIB(pthreads, main)
2607
dnl AC_CHECK_LIB(resolv, main)
2608
dnl AC_CHECK_LIB(rt, main)
2609
dnl AC_CHECK_LIB(socket, main)
2610
dnl AC_CHECK_LIB(svld, main)
2611
dnl AC_CHECK_LIB(thread, main)
2612
dnl AC_CHECK_LIB(vms_jackets, main)
2615
dnl We don't want anything to link with libdl even if it's present on OS X,
2616
dnl since it's not used and not part of the default installation.
2617
dnl The same goes for BeOS.
2618
dnl OS/2 has dlfcn in libc.
2621
*-darwin*|*-beos*|*-os2*)
2624
AC_CHECK_LIB(dl, dlopen,
2625
AC_CHECK_HEADER(dlfcn.h,
2626
OS_LIBS="-ldl $OS_LIBS"))
2631
dnl ========================================================
2632
dnl Check for system header files.
2633
dnl ========================================================
2634
dnl AC_HEADER_DIRENT
2636
dnl AC_HEADER_SYS_WAIT
2637
dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2639
dnl ========================================================
2640
dnl Check for typedefs and structs
2641
dnl ========================================================
2648
dnl AC_STRUCT_ST_BLKSIZE
2649
dnl AC_STRUCT_ST_BLOCKS
2650
dnl AC_STRUCT_ST_RDEV
2654
dnl ========================================================
2655
dnl Checks for library functions.
2656
dnl ========================================================
2657
AC_PROG_GCC_TRADITIONAL
2658
AC_CHECK_FUNCS(lchown strerror)
2662
dnl AC_FUNC_SETVBUF_REVERSED
2664
dnl AC_FUNC_STRFTIME
2665
dnl AC_FUNC_UTIME_NULL
2667
dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2669
dnl ========================================================
2671
dnl ========================================================
2673
dnl ======================================================
2674
dnl = Enable compiling with ccache
2675
dnl ======================================================
2677
[ --with-ccache[=path/to/ccache]
2678
Enable compiling with ccache],
2679
CCACHE=$withval, CCACHE="no")
2681
if test "$CCACHE" != "no"; then
2682
if test -n "$CCACHE"; then
2683
if test "$CCACHE" = "yes"; then
2686
if test ! -e "$CCACHE"; then
2687
AC_MSG_ERROR([$CCACHE not found])
2691
AC_PATH_PROGS(CCACHE, $CCACHE ccache)
2692
if test -z "$CCACHE" -o "$CCACHE" = ":"; then
2693
AC_MSG_ERROR([ccache not found])
2694
elif test -x "$CCACHE"; then
2698
AC_MSG_ERROR([$CCACHE is not executable])
2702
dnl ========================================================
2704
dnl = --enable-strip
2706
dnl = Enable stripping of libs and executables
2708
dnl ========================================================
2709
AC_ARG_ENABLE(strip,
2710
[ --enable-strip Enable stripping of shared libs and programs],
2711
[ if test "$enableval" = "yes"; then
2715
dnl Check for hpux options
2716
case "${target_os}" in
2718
if test -z "$GNU_CC"; then
2720
AC_CACHE_CHECK(for +Olit support,
2721
ac_cv_hpux_usable_olit_option,
2722
dnl since aCC doesn't throw an error on invalid options,
2723
dnl we have to test this the hard way
2724
[ac_cv_hpux_usable_olit_option=no
2726
echo 'int main() { return 0; }' | cat > conftest.c
2727
${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2728
if test $? -eq 0; then
2729
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2730
ac_cv_hpux_usable_olit_option=yes
2736
if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2737
CFLAGS="$CFLAGS +Olit=all"
2738
CXXFLAGS="$CXXFLAGS +Olit=all"
2740
CFLAGS="$CFLAGS +ESlit"
2741
CXXFLAGS="$CXXFLAGS +ESlit"
2748
dnl Apparently, some systems cannot properly check for the pthread
2749
dnl library unless <pthread.h> is included so we need to test
2752
dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2753
AC_DEFUN(MOZ_CHECK_PTHREADS,
2755
AC_MSG_CHECKING([for pthread_create in -l$1])
2757
#include <pthread.h>
2758
void *foo(void *v) { return v; }
2761
if (!pthread_create(&t, 0, &foo, 0)) {
2766
echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2767
${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2769
rm -f dummy.c dummy${ac_exeext} ;
2770
if test "$_res" = "0"; then
2771
AC_MSG_RESULT([yes])
2779
case "$target_os" in
2787
MOZ_CHECK_PTHREADS(pthreads,
2788
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2789
MOZ_CHECK_PTHREADS(pthread,
2790
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2791
MOZ_CHECK_PTHREADS(c_r,
2792
_HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2793
MOZ_CHECK_PTHREADS(c,
2802
AC_ARG_WITH(pthreads,
2803
[ --with-pthreads Use system pthreads library as thread subsystem],
2804
[ if test "$withval" = "yes"; then
2805
if test -n "$_HAVE_PTHREADS"; then
2810
AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2816
[ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2822
AC_ARG_ENABLE(user-pthreads,
2823
[ --enable-user-pthreads Build using userland pthreads],
2824
[ if test "$enableval" = "yes"; then
2825
if test -n "$_HAVE_PTHREADS"; then
2830
AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2834
AC_ARG_ENABLE(nspr-threads,
2835
[ --enable-nspr-threads Build using classic nspr threads],
2836
[ if test "$enableval" = "yes"; then
2844
AC_ARG_WITH(bthreads,
2845
[ --with-bthreads Use system bthreads library as thread subsystem
2847
[ if test "$withval" = "yes"; then
2855
fi # SKIP_LIBRARY_CHECKS
2858
[ --enable-ipv6 Compile ipv6 support],
2859
[ if test "$enableval" = "yes"; then
2865
if test -n "$USE_PTHREADS"; then
2866
dnl See if -pthread is supported.
2868
ac_cv_have_dash_pthread=no
2869
AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2870
echo 'int main() { return 0; }' | cat > conftest.c
2871
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2872
if test $? -eq 0; then
2873
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2874
ac_cv_have_dash_pthread=yes
2875
case "$target_os" in
2877
# Freebsd doesn't use -pthread for compiles, it uses them for linking
2880
CFLAGS="$CFLAGS -pthread"
2881
CXXFLAGS="$CXXFLAGS -pthread"
2887
AC_MSG_RESULT($ac_cv_have_dash_pthread)
2890
dnl See if -pthreads is supported.
2892
ac_cv_have_dash_pthreads=no
2893
if test "$ac_cv_have_dash_pthread" = "no"; then
2894
AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2895
echo 'int main() { return 0; }' | cat > conftest.c
2896
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2897
if test $? -eq 0; then
2898
if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2899
ac_cv_have_dash_pthreads=yes
2900
CFLAGS="$CFLAGS -pthreads"
2901
CXXFLAGS="$CXXFLAGS -pthreads"
2905
AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2910
if test "$ac_cv_have_dash_pthreads" = "yes"; then
2915
AC_DEFINE(_REENTRANT)
2916
AC_DEFINE(_THREAD_SAFE)
2917
dnl -pthread links in -lc_r, so don't specify it explicitly.
2918
if test "$ac_cv_have_dash_pthread" = "yes"; then
2919
_PTHREAD_LDFLAGS="-pthread"
2921
_PTHREAD_LDFLAGS="-lc_r"
2925
if test "$ac_cv_have_dash_pthread" = "yes"; then
2926
_PTHREAD_LDFLAGS="-pthread"
2930
AC_DEFINE(_THREAD_SAFE)
2931
dnl -pthread links in -lc_r, so don't specify it explicitly.
2932
if test "$ac_cv_have_dash_pthread" = "yes"; then
2937
if test "$ac_cv_have_dash_pthread" = "yes"; then
2938
_PTHREAD_LDFLAGS=-pthread
2941
*-linux*|*-gnu*|*-k*bsd*-gnu)
2942
AC_DEFINE(_REENTRANT)
2947
if test -n "$USE_USER_PTHREADS"; then
2954
dnl Special thread exceptions
2958
if test -n "$USE_NSPR_THREADS"; then
2959
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2961
case "$target_os" in
2963
if test -z "$USE_PTHREADS"; then
2964
AC_DEFINE(AIX_RENAME_SELECT)
2968
if test -z "$USE_NSPR_THREADS"; then
2969
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2973
if test -z "$USE_NSPR_THREADS"; then
2974
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2976
if test -n "$USE_PTHREADS"; then
2977
AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2981
if test -z "$USE_NSPR_THREADS"; then
2982
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2984
if test -n "$USE_PTHREADS"; then
2985
AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2991
if test -n "$USE_PTHREADS"; then
2992
AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2996
if test -n "$USE_NSPR_THREADS"; then
2997
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3001
if test -n "$USE_NSPR_THREADS"; then
3002
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3004
if test "$USE_PTHREADS"; then
3005
if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
3006
AC_DEFINE(_REENTRANT)
3007
AC_DEFINE(_PR_DCETHREADS)
3009
AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
3010
AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
3013
if test "$USE_USER_PTHREADS"; then
3014
AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
3018
if test "${target_os}" = "irix6.5"; then
3019
if test -n "$USE_PTHREADS"; then
3020
AC_DEFINE(_PR_HAVE_GETHOST_R)
3021
AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
3025
*-linux*|*-gnu*|*-k*bsd*-gnu)
3026
if test -n "$USE_NSPR_THREADS"; then
3027
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3030
*-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*|*-os2*|*-beos*)
3031
dnl win32, wince, os2 & beos cannot use pthreads
3036
*-netbsd*|*-openbsd*)
3037
if test -n "$USE_NSPR_THREADS"; then
3038
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3042
if test -n "$USE_NSPR_THREADS"; then
3043
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3045
if test -n "$USE_PTHREADS"; then
3046
if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
3049
AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
3054
if test -n "$USE_NSPR_THREADS"; then
3055
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
3057
if test -n "$USE_PTHREADS"; then
3058
AC_DEFINE(_REENTRANT)
3059
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
3060
if test "$OS_TEST" = "i86pc"; then
3061
if test -n "$USE_64"; then
3062
PR_MD_ASFILES=os_SunOS_x86_64.s
3064
PR_MD_ASFILES=os_SunOS_x86.s
3067
if test -n "$USE_64"; then
3068
PR_MD_ASFILES=os_SunOS_sparcv9.s
3074
if test -n "$USE_PTHREADS"; then
3075
AC_DEFINE(_PR_HAVE_GETHOST_R)
3076
AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
3081
OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
3083
dnl If the user passed in arg to --enable-optimize or --enable-debug,
3084
dnl make sure that we use it.
3085
if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
3086
_OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
3089
if test -n "$_SAVE_DEBUG_FLAGS"; then
3090
_DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
3093
if test -n "$MOZ_OPTIMIZE"; then
3094
CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
3095
CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
3098
if test -n "$MOZ_DEBUG_SYMBOLS"; then
3099
CFLAGS="$CFLAGS $_DEBUG_FLAGS"
3100
CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
3103
if test -n "$MOZ_OPTIMIZE"; then
3109
if test -n "$USE_64"; then
3113
RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
3115
dnl ========================================================
3116
dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
3117
dnl ========================================================
3118
case "$target_os" in
3120
CC="\$(CYGWIN_WRAPPER) $CC"
3121
CXX="\$(CYGWIN_WRAPPER) $CXX"
3122
RC="\$(CYGWIN_WRAPPER) $RC"
3126
dnl ========================================================
3127
dnl = Use malloc wrapper lib
3128
dnl ========================================================
3129
AC_ARG_ENABLE(wrap-malloc,
3130
[ --enable-wrap-malloc Wrap malloc calls (gnu linker only)],
3131
[ if test "$enableval" = "yes"; then
3135
if test -n "$_WRAP_MALLOC"; then
3136
if test "$GNU_CC"; then
3137
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"
3138
DSO_LDOPTS="$DSO_LDOPTS $WRAP_MALLOC_CFLAGS"
3140
AC_MSG_ERROR([--enable-wrap-malloc is not supported for non-GNU toolchains])
3144
dnl ========================================================
3145
dnl = Location of malloc wrapper lib
3146
dnl ========================================================
3147
AC_ARG_WITH(wrap-malloc,
3148
[ --with-wrap-malloc=SHAREDLIB Location of malloc wrapper library],
3149
WRAP_MALLOC_LIB=$withval)
3151
dnl ========================================================
3152
dnl Substitution of found variables.
3153
dnl ========================================================
3154
AC_SUBST(SHELL_OVERRIDE)
3156
AC_SUBST(MOZILLA_CLIENT)
3163
AC_SUBST(HOST_CFLAGS)
3165
AC_SUBST(HOST_LDFLAGS)
3167
AC_SUBST(GCC_USE_GNU_LD)
3169
AC_SUBST(CROSS_COMPILE)
3171
AC_SUBST(MOZ_OPTIMIZE)
3173
AC_SUBST(MOZ_DEBUG_SYMBOLS)
3179
AC_SUBST(OBJECT_MODE)
3180
AC_SUBST(ENABLE_STRIP)
3182
AC_SUBST(USE_PTHREADS)
3183
AC_SUBST(USE_BTHREADS)
3184
AC_SUBST(USE_USER_PTHREADS)
3185
AC_SUBST(USE_NSPR_THREADS)
3190
AC_SUBST(MOD_MAJOR_VERSION)
3191
AC_SUBST(MOD_MINOR_VERSION)
3192
AC_SUBST(MOD_PATCH_VERSION)
3193
AC_SUBST(NSPR_MODNAME)
3194
AC_SUBST(MDCPUCFG_H)
3195
AC_SUBST(PR_MD_CSRCS)
3196
AC_SUBST(PR_MD_ASFILES)
3197
AC_SUBST(PR_MD_ARCH_DIR)
3200
AC_SUBST(OBJ_SUFFIX)
3201
AC_SUBST(LIB_SUFFIX)
3202
AC_SUBST(DLL_SUFFIX)
3203
AC_SUBST(ASM_SUFFIX)
3204
AC_SUBST(WRAP_MALLOC_CFLAGS)
3205
AC_SUBST(WRAP_MALLOC_LIB)
3207
AC_SUBST(DSO_CFLAGS)
3208
AC_SUBST(DSO_LDOPTS)
3212
AC_SUBST(OS_RELEASE)
3214
AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
3229
AC_SUBST(PROFILE_GEN_CFLAGS)
3230
AC_SUBST(PROFILE_GEN_LDFLAGS)
3231
AC_SUBST(PROFILE_USE_CFLAGS)
3232
AC_SUBST(PROFILE_USE_LDFLAGS)
3235
AC_SUBST(RESOLVE_LINK_SYMBOLS)
3236
AC_SUBST(AIX_LINK_OPTS)
3237
AC_SUBST(NOSUCHFILE)
3238
AC_SUBST(MOZ_OBJFORMAT)
3239
AC_SUBST(ULTRASPARC_LIBRARY)
3242
AC_SUBST(OBJDIR_NAME)
3243
AC_SUBST(RELEASE_OBJDIR_NAME)
3250
AC_SUBST(OS_DLLFLAGS)
3251
AC_SUBST(CYGWIN_WRAPPER)
3252
AC_SUBST(VISIBILITY_FLAGS)
3253
AC_SUBST(WRAP_SYSTEM_INCLUDES)
3254
AC_SUBST(MACOS_SDK_DIR)
3255
AC_SUBST(SYMBIAN_SDK_DIR)
3259
dnl ========================================================
3260
dnl Generate output files.
3261
dnl ========================================================
3273
lib/libc/include/Makefile
3274
lib/libc/src/Makefile
3278
pkg/solaris/Makefile
3279
pkg/solaris/SUNWpr/Makefile
3280
pkg/solaris/SUNWprd/Makefile
3283
pr/include/md/Makefile
3284
pr/include/obsolete/Makefile
3285
pr/include/private/Makefile
3288
pr/src/linking/Makefile
3289
pr/src/malloc/Makefile
3291
pr/src/md/${PR_MD_ARCH_DIR}/Makefile
3292
pr/src/memory/Makefile
3293
pr/src/misc/Makefile
3294
pr/src/threads/Makefile
3296
pr/tests/dll/Makefile
3299
dnl lib/tests/Makefile
3300
dnl pr/tests/w16gui/Makefile
3303
if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
3304
MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
3305
elif test -n "$USE_PTHREADS"; then
3306
MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"
3307
elif test -n "$USE_BTHREADS"; then
3308
MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
3311
if test -n "$USE_CPLUS"; then
3312
MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
3315
echo $MAKEFILES > unallmakefiles
3317
AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])