Bug 502696 - js_CompareAndSwap on sparc should not use PRLock(); (Cv1) Clean up misse...
[mozilla-central.git] / nsprpub / configure.in
blob81a215a0c9e4704adc7622391b701f1b8252e5a5
1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2 dnl 
3 dnl ***** BEGIN LICENSE BLOCK *****
4 dnl Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 dnl
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/
10 dnl
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
14 dnl License.
15 dnl
16 dnl The Original Code is the Netscape Portable Runtime (NSPR).
17 dnl
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.
22 dnl
23 dnl Contributor(s):
24 dnl   Christopher Seawood <cls@seawood.org>
25 dnl   Howard Chu <hyc@symas.com>
26 dnl   Mark Mentovai <mark@moxienet.com>
27 dnl
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.
39 dnl
40 dnl ***** END LICENSE BLOCK *****
42 AC_PREREQ(2.12)
43 AC_INIT(config/libc_r.h)
45 AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
46 AC_CANONICAL_SYSTEM
48 dnl ========================================================
49 dnl = Defaults
50 dnl ========================================================
51 MOD_MAJOR_VERSION=4
52 MOD_MINOR_VERSION=8
53 MOD_PATCH_VERSION=4
54 NSPR_MODNAME=nspr20
55 _HAVE_PTHREADS=
56 USE_PTHREADS=
57 USE_USER_PTHREADS=
58 USE_NSPR_THREADS=
59 USE_N32=
60 USE_64=
61 USE_CPLUS=
62 USE_IPV6=
63 USE_MDUPDATE=
64 _MACOSX_DEPLOYMENT_TARGET=
65 _OPTIMIZE_FLAGS=-O
66 _DEBUG_FLAGS=-g
67 MOZ_DEBUG=1
68 MOZ_OPTIMIZE=
69 OBJDIR='$(OBJDIR_NAME)'
70 OBJDIR_NAME=.
71 OBJDIR_SUFFIX=OBJ
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)'
76 CYGWIN_WRAPPER=
77 MACOS_SDK_DIR=
78 NEXT_ROOT=
79 MT=
80 MOZ_OS2_HIGH_MEMORY=1
82 dnl Link in libraries necessary to resolve all symbols for shared libs
83 RESOLVE_LINK_SYMBOLS=
85 dnl ========================================================
86 dnl =
87 dnl = Dont change the following lines.  Doing so breaks:
88 dnl =
89 dnl = CFLAGS="-foo" ./configure
90 dnl =
91 dnl ========================================================
92 CFLAGS="${CFLAGS=}"
93 CXXFLAGS="${CXXFLAGS=}"
94 LDFLAGS="${LDFLAGS=}"
95 DLLFLAGS="${DLLFLAGS=}"
96 HOST_CFLAGS="${HOST_CFLAGS=}"
97 HOST_LDFLAGS="${HOST_LDFLAGS=}"
99 case "$target" in
100 *-cygwin*|*-mingw*)
101     # Check to see if we are really running in a msvc environemnt
102     _WIN32_MSVC=
103     AC_CHECK_PROGS(CC, cl)
104     if test "$CC" = "cl"; then
105         echo 'main() { return 0; }' > dummy.c
106         ${CC} -o dummy dummy.c >/dev/null 2>&1
107         if test $? = 0; then
108             _WIN32_MSVC=1
109             CXX=$CC
110         else
111             AC_MSG_WARN([$(CC) test failed.  Using normal feature tests])
112         fi
113         rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
114     fi
115     ;;
116 *-msvc*)
117     _WIN32_MSVC=1
118     ;;
119 *-mks*)
120     _WIN32_MSVC=1
121     ;;
122 esac
124 if test -n "$_WIN32_MSVC"; then
125     SKIP_PATH_CHECKS=1
126     SKIP_COMPILER_CHECKS=1
127     SKIP_LIBRARY_CHECKS=1
130 dnl ========================================================
131 dnl =
132 dnl = Check options that may affect the compiler
133 dnl =
134 dnl ========================================================
135 dist_prefix='${MOD_DEPTH}/dist'
136 dist_bindir='${dist_prefix}/bin'
137 dist_includedir='${dist_prefix}/include/nspr'
138 dist_libdir='${dist_prefix}/lib'
139 dnl If the --includedir option was not specified, add '/nspr' to autoconf's
140 dnl default value of includedir.
141 if test "${includedir}" = '${prefix}/include'; then
142     includedir='${prefix}/include/nspr'
145 AC_ARG_WITH(dist-prefix,
146     [  --with-dist-prefix=DIST_PREFIX
147                           place build files in DIST_PREFIX [dist]],
148     dist_prefix=$withval)
150 AC_ARG_WITH(dist-bindir,
151     [  --with-dist-bindir=DIR  build execuatables in DIR [DIST_PREFIX/bin]],
152     dist_bindir=$withval)
154 AC_ARG_WITH(dist-includedir,
155     [  --with-dist-includedir=DIR
156                           build include files in DIR [DIST_PREFIX/include/nspr]],
157     dist_includedir=$withval)
159 AC_ARG_WITH(dist-libdir,
160     [  --with-dist-libdir=DIR  build library files in DIR [DIST_PREFIX/lib]],
161     dist_libdir=$withval)
163 AC_SUBST(dist_prefix)
164 AC_SUBST(dist_bindir)
165 AC_SUBST(dist_includedir)
166 AC_SUBST(dist_libdir)
168 dnl Check if NSPR is being compiled for Mozilla
169 dnl Let --with-arg override environment setting
171 AC_ARG_WITH(mozilla,
172     [  --with-mozilla          Compile NSPR with Mozilla support],
173     [   if test "$withval" = "yes"; then
174             AC_DEFINE(MOZILLA_CLIENT)
175             MOZILLA_CLIENT=1
176             else
177                 MOZILLA_CLIENT=
178             fi],
179     [   if test -n "$MOZILLA_CLIENT"; then
180                 AC_DEFINE(MOZILLA_CLIENT)
181             fi])
183 AC_ARG_ENABLE(optimize,
184     [  --enable-optimize(=val) Enable code optimizations (val, ie. -O2) ],
185     [ if test "$enableval" != "no"; then
186         MOZ_OPTIMIZE=1
187         if test -n "$enableval" && test "$enableval" != "yes"; then
188             _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
189             _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
190         fi
191       else
192         MOZ_OPTIMIZE=
193     fi ])
195 AC_ARG_ENABLE(debug,
196     [  --disable-debug         Do not compile in debugging symbols
197   --enable-debug(=val)    Enable debugging (debug flags val)],
198     [   if test "$enableval" = "no"; then
199             MOZ_DEBUG=
200         else
201             MOZ_DEBUG=1
202             if test -n "$enableval" && test "$enableval" != "yes"; then
203                 _DEBUG_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
204                 _SAVE_DEBUG_FLAGS=$_DEBUG_FLAGS
205             fi
206         fi])
208 AC_ARG_ENABLE(win32-target,
209     [  --enable-win32-target=\$t
210                           Specify win32 flavor. (WIN95 or WINNT)],
211     OS_TARGET=`echo $enableval | tr a-z A-Z`)
213 AC_ARG_ENABLE(symbian-target,
214     [  --enable-symbian-target=\$t
215                           Specify symbian flavor. (WINSCW or GCCE)],
216     OS_TARGET=`echo $enableval | tr a-z A-Z`)
218 AC_ARG_ENABLE(debug-rtl,
219     [  --enable-debug-rtl      Use the MSVC debug runtime library],
220     [ if test "$enableval" = "yes"; then
221             USE_DEBUG_RTL=1
222       fi ])
224 AC_ARG_ENABLE(n32,
225     [  --enable-n32            Enable n32 ABI support (IRIX only)],
226     [ if test "$enableval" = "yes"; then
227         USE_N32=1
228       else if test "$enableval" = "no"; then
229         USE_N32=
230       fi
231     fi ])
233 AC_ARG_ENABLE(64bit,
234     [  --enable-64bit          Enable 64-bit support (on certain platforms)],
235     [ if test "$enableval" = "yes"; then
236             USE_64=1
237       fi ])
239 AC_ARG_ENABLE(mdupdate,
240     [  --enable-mdupdate       Enable use of certain compilers' mdupdate feature],
241     [ if test "$enableval" = "yes"; then
242             USE_MDUPDATE=1
243       fi ])
245 AC_ARG_ENABLE(cplus,
246     [  --enable-cplus          Enable some c++ api routines],
247     [ if test "$enableval" = "yes"; then
248             USE_CPLUS=1
249       fi]) 
251 AC_ARG_WITH(arm-kuser,
252     [  --with-arm-kuser        Use kuser helpers (Linux/ARM only)
253                           (Requires kernel 2.6.13 or later)],
254     [ if test "$withval" = "yes"; then
255             AC_DEFINE(_PR_ARM_KUSER)
256       fi ])
258 dnl ========================================================
259 dnl = Mac OS X SDK support
260 dnl ========================================================
261 AC_ARG_WITH(macos-sdk,
262     [  --with-macos-sdk=dir    Location of platform SDK to use (Mac OS X only)],
263     MACOS_SDK_DIR=$withval)
265 AC_ARG_ENABLE(macos-target,
266              [  --enable-macos-target=VER
267                           Set the minimum MacOS version needed at runtime
268                           [10.2 for ppc, 10.4 for x86]],
269              [_MACOSX_DEPLOYMENT_TARGET=$enableval])
271 dnl ========================================================
272 dnl =
273 dnl = Set the threading model
274 dnl =
275 dnl ========================================================
276 case "$target" in
278 *-aix*)
279     case "${target_os}" in
280     aix3.2*)
281         USE_NSPR_THREADS=1
282         ;;
283     *)
284         USE_PTHREADS=1
285         ;;
286     esac
287     ;;
289 esac
291 dnl ========================================================
292 dnl =
293 dnl = Set the default C compiler
294 dnl =
295 dnl ========================================================
296 if test -z "$CC"; then
297     case "$target" in
299     *-aix*)
300         if test -z "$USE_NSPR_THREADS"; then
301             CC=xlc_r
302         else
303             CC=xlc
304         fi
305     ;;
307     *-hpux*)
308         CC=cc
309     ;;
311     *-irix*)
312         CC=cc
313     ;;
315     *-osf*)
316         CC=cc
317     ;;
319     *-solaris*)
320         CC=cc
321     ;;
323     esac
326 dnl ========================================================
327 dnl =
328 dnl = Set the default C++ compiler
329 dnl =
330 dnl ========================================================
331 if test -z "$CXX"; then
332     case "$target" in
334     *-aix*)
335         if test -z "$USE_NSPR_THREADS"; then
336             CXX=xlC_r
337         else
338             CXX=xlC
339         fi
340     ;;
342     *-hpux*)
343         case "${target_os}" in
344         hpux10.30)
345             CXX=aCC
346             ;;
347         hpux11.*)
348             CXX=aCC
349             ;;
350         *)
351             CXX=CC
352             ;;
353         esac
354     ;;
356     *-irix*)
357         CXX=CC
358     ;;
360     *-osf*)
361         CXX=cxx
362     ;;
364     *-solaris*)
365         CXX=CC
366     ;;
368     esac
371 if test -z "$SKIP_PATH_CHECKS"; then
372     AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
375 if test -n "$MOZ_DEBUG"; then
376     AC_DEFINE(DEBUG)
377     DEFINES="$DEFINES -UNDEBUG"
379     case "${target_os}" in
380     beos*)
381         DEFINES="$DEFINES -DDEBUG_${USER}"
382         ;;
383     msvc*|mks*|cygwin*|mingw*|wince*|winmo*|os2*)
384         DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
385         ;;
386     *) 
387         DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
388         ;;
389     esac
390 else
391     AC_DEFINE(NDEBUG)
392     DEFINES="$DEFINES -UDEBUG"
395 if test -z "$SKIP_COMPILER_CHECKS"; then
396 dnl ========================================================
397 dnl Checks for compilers.
398 dnl ========================================================
399 if test "$target" != "$host"; then
400     echo "cross compiling from $host to $target"
401     cross_compiling=yes
403     _SAVE_CC="$CC"
404     _SAVE_CFLAGS="$CFLAGS"
405     _SAVE_LDFLAGS="$LDFLAGS"
407     AC_MSG_CHECKING([for $host compiler])
408     AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
409     if test -z "$HOST_CC"; then
410         AC_MSG_ERROR([no acceptable cc found in \$PATH])
411     fi
412     AC_MSG_RESULT([$HOST_CC])
413     if test -z "$HOST_CFLAGS"; then
414         HOST_CFLAGS="$CFLAGS"
415     fi
416     if test -z "$HOST_LDFLAGS"; then
417         HOST_LDFLAGS="$LDFLAGS"
418     fi
420     CC="$HOST_CC"
421     CFLAGS="$HOST_CFLAGS"
422     LDFLAGS="$HOST_LDFLAGS"
424     AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
425     AC_TRY_COMPILE([], [return(0);], 
426         [ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
427         AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
429     CC=$_SAVE_CC
430     CFLAGS=$_SAVE_CFLAGS
431     LDFLAGS=$_SAVE_LDFLAGS
433     case "$build:$target" in 
434       powerpc-apple-darwin8*:i?86-apple-darwin*)
435         dnl The Darwin cross compiler doesn't necessarily point itself at a
436         dnl root that has libraries for the proper architecture, it defaults
437         dnl to the system root.  The libraries in the system root on current
438         dnl versions of PPC OS X 10.4 aren't fat, so these target compiler
439         dnl checks will fail.  Fake a working SDK in that case.
440         _SAVE_CFLAGS=$CFLAGS 
441         _SAVE_CXXFLAGS=$CXXLAGS
442         CFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CFLAGS"
443         CXXFLAGS="-isysroot /Developer/SDKs/MacOSX10.4u.sdk $CXXFLAGS"
444         ;;        
445     esac            
447     AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
448     unset ac_cv_prog_CC
449     AC_PROG_CC
450     if test -n "$USE_CPLUS"; then
451         AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
452         unset ac_cv_prog_CXX
453         AC_PROG_CXX
454     fi
456     case "$build:$target" in
457       powerpc-apple-darwin8*:i?86-apple-darwin*)
458         dnl Revert the changes made above.  From this point on, the target
459         dnl compiler will never be used without applying the SDK to CFLAGS
460         dnl (see --with-macos-sdk below).
461         CFLAGS=$_SAVE_CFLAGS
462         CXXFLAGS=$_SAVE_CXXFLAGS
463         ;;
464     esac
466     AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
467     AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
468     AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
469     AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
470     AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
471     AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
473 else
474     AC_PROG_CC
475     if test -n "$USE_CPLUS"; then
476         if test "$CC" = "cl" -a -z "$CXX"; then
477             CXX=$CC
478         else        
479             AC_PROG_CXX
480         fi
481     fi
482     AC_PROG_CPP
483     AC_PROG_RANLIB
484     AC_PATH_PROGS(AS, as, $CC)
485     AC_PATH_PROGS(AR, ar, echo not_ar)
486     AC_PATH_PROGS(LD, ld link, echo not_ld)
487     AC_PATH_PROGS(STRIP, strip, echo not_strip)
488     AC_PATH_PROGS(WINDRES, windres, echo not_windres)
489     if test -z "$HOST_CC"; then
490         HOST_CC="$CC"
491     fi
492     if test -z "$HOST_CFLAGS"; then
493         HOST_CFLAGS="$CFLAGS"
494     fi
497 if test "$GCC" = "yes"; then
498     GNU_CC=1
500 if test "$GXX" = "yes"; then
501     GNU_CXX=1
503 if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
504     GNU_AS=1
506 rm -f a.out
508 case "$build:$target" in
509     i?86-apple-darwin*:powerpc-apple-darwin*)
510         dnl cross_compiling will have erroneously been set to "no" in this
511         dnl case, because the x86 build host is able to run ppc code in a
512         dnl translated environment, making a cross compiler appear native.
513         cross_compiling=yes
514         ;;
515 esac
517 if test "$cross_compiling"  = "yes"; then
518     CROSS_COMPILE=1
519 else
520     CROSS_COMPILE=
523 dnl ========================================================
524 dnl Check for gcc -pipe support
525 dnl ========================================================
526 AC_MSG_CHECKING([for gcc -pipe support])
527 if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
528     echo '#include <stdio.h>' > dummy-hello.c
529     echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
530     ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
531     cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
532     if test $? = 0; then
533         _res_as_stdin="yes"
534     else
535         _res_as_stdin="no"
536     fi
537     if test "$_res_as_stdin" = "yes"; then
538         _SAVE_CFLAGS=$CFLAGS
539         CFLAGS="$CFLAGS -pipe"
540         AC_TRY_COMPILE( [ #include <stdio.h> ],
541             [printf("Hello World\n");],
542             [_res_gcc_pipe="yes"],
543             [_res_gcc_pipe="no"] )
544         CFLAGS=$_SAVE_CFLAGS
545     fi
546     if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
547         _res="yes";
548         CFLAGS="$CFLAGS -pipe"
549         CXXFLAGS="$CXXFLAGS -pipe"
550     else
551         _res="no"
552     fi
553     rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
554     AC_MSG_RESULT([$_res])
555 else
556     AC_MSG_RESULT([no])
559 dnl ===============================================================
560 dnl Check for .hidden assembler directive and visibility attribute.
561 dnl Borrowed from glibc configure.in
562 dnl ===============================================================
563 if test "$GNU_CC"; then
564     AC_CACHE_CHECK(for visibility(hidden) attribute,
565         ac_cv_visibility_hidden,
566         [cat > conftest.c <<EOF
567         int foo __attribute__ ((visibility ("hidden"))) = 1;
569         ac_cv_visibility_hidden=no
570         if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
571             if grep '\.hidden.*foo' conftest.s >/dev/null; then
572                 ac_cv_visibility_hidden=yes
573             fi
574         fi
575         rm -f conftest.[cs]
576         ])
577     if test "$ac_cv_visibility_hidden" = "yes"; then
578         AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
579         AC_CACHE_CHECK(for visibility pragma support,
580             ac_cv_visibility_pragma,
581             [cat > conftest.c <<EOF
582 #pragma GCC visibility push(hidden)
583             int foo_hidden = 1;
584 #pragma GCC visibility push(default)
585             int foo_default = 1;
587             ac_cv_visibility_pragma=no
588             if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
589                 if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
590                     if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
591                         ac_cv_visibility_pragma=yes
592                     fi
593                 fi
594             fi
595             rm -f conftest.[cs]
596             ])
597         if test "$ac_cv_visibility_pragma" = "yes"; then
598             AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
599             # To work around a build problem on Linux x86-64 (Bugzilla bug
600             # 293438), we use the -fvisibility=hidden flag.  This flag is less
601             # optimal than #pragma GCC visibility push(hidden) because the flag
602             # assumes that symbols defined outside the current source file have
603             # the default visibility.  This has the advantage that we don't need
604             # to wrap system header files, but has the disadvantage that calls
605             # to hidden symbols defined in other source files cannot be
606             # optimized by the compiler.  The -fvisibility=hidden flag does
607             # hide and export symbols correctly.
608             #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
609             #WRAP_SYSTEM_INCLUDES=1
610             VISIBILITY_FLAGS="-fvisibility=hidden"
611             WRAP_SYSTEM_INCLUDES=
612         fi
613     fi
614 fi # GNU_CC
616 fi # SKIP_COMPILER_CHECKS
618 dnl ========================================================
619 dnl Checks for programs.
620 dnl ========================================================
621 if test -z "$SKIP_PATH_CHECKS"; then
622     AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
623 elif test -z "$PERL"; then
624     PERL=perl
627 dnl ========================================================
628 dnl Default platform specific options
629 dnl ========================================================
630 OBJ_SUFFIX=o
631 LIB_SUFFIX=a
632 DLL_SUFFIX=so
633 ASM_SUFFIX=s
634 MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
635 PR_MD_ASFILES=
636 PR_MD_CSRCS=
637 PR_MD_ARCH_DIR=unix
638 AR_FLAGS='cr $@'
639 AS='$(CC)'
640 ASFLAGS='$(CFLAGS)'
642 if test -n "$CROSS_COMPILE"; then
643     OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
644     OS_RELEASE=
645     OS_TEST="${target_cpu}"
646     case "${target_os}" in
647         linux*)       OS_ARCH=Linux ;;
648         solaris*)     OS_ARCH=SunOS OS_RELEASE=5 ;;
649         mingw*)       OS_ARCH=WINNT ;;
650         wince*)       OS_ARCH=WINCE ;;
651         winmo*)       OS_ARCH=WINCE ;;
652         darwin*)      OS_ARCH=Darwin ;;
653         riscos*)      OS_ARCH=RISCOS ;;
654     esac
655 else
656     OS_ARCH=`uname -s | sed -e 's|/|_|g'`
657     OS_RELEASE=`uname -r`
658     OS_TEST=`uname -m`
661 if test "$OS_ARCH" = "IRIX64"; then
662     OS_ARCH=IRIX
665 if test "$OS_ARCH" = "AIX"; then
666     OS_RELEASE=`uname -v`.`uname -r`
669 if test "$OS_ARCH" = "FreeBSD"; then
670     OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
673 if test "$OS_ARCH" = "Linux"; then
674     OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
675     OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
678 #######################################################################
679 # Master "Core Components" macros for getting the OS target           #
680 #######################################################################
683 # Note: OS_TARGET should be specified on the command line for gmake.
684 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
685 # The difference between the Win95 target and the WinNT target is that
686 # the WinNT target uses Windows NT specific features not available
687 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
688 # at lesser performance (the Win95 target uses threads; the WinNT target
689 # uses fibers).
691 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
692 # cross-compilation.
696 # The following hack allows one to build on a WIN95 machine (as if
697 # s/he were cross-compiling on a WINNT host for a WIN95 target).
698 # It also accomodates for MKS's uname.exe.  If you never intend
699 # to do development on a WIN95 machine, you don't need this hack.
701 case "$OS_ARCH" in
702 WIN95)
703     OS_ARCH=WINNT
704     OS_TARGET=WIN95
705     ;;
706 Windows_95)
707     OS_ARCH=Windows_NT
708     OS_TARGET=WIN95
709     ;;
710 Windows_98)
711     OS_ARCH=Windows_NT
712     OS_TARGET=WIN95
713     ;;
714 CYGWIN_9*|CYGWIN_ME*)
715     OS_ARCH='CYGWIN_NT-4.0'
716     OS_TARGET=WIN95
717     ;;
718 OS_2)
719     OS_ARCH=OS2
720     OS_TARGET=OS2
721     ;;
722 esac
725 # On WIN32, we also define the variable CPU_ARCH.
728 case "$OS_ARCH" in
729 WINNT)
730     CPU_ARCH=`uname -p`
731     if test "$CPU_ARCH" = "I386"; then
732         CPU_ARCH=x86
733     fi
734     ;;
735 Windows_NT)
737 # If uname -s returns "Windows_NT", we assume that we are using
738 # the uname.exe in MKS toolkit.
740 # The -r option of MKS uname only returns the major version number.
741 # So we need to use its -v option to get the minor version number.
742 # Moreover, it doesn't have the -p option, so we need to use uname -m.
744     OS_ARCH=WINNT
745     OS_MINOR_RELEASE=`uname -v`
746     if test "$OS_MINOR_RELEASE" = "00"; then
747         OS_MINOR_RELEASE=0
748     fi
749     OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
750     CPU_ARCH=`uname -m`
751     #
752     # MKS's uname -m returns "586" on a Pentium machine.
753     #
754     if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
755         CPU_ARCH=x86
756     fi
757     ;;
758 CYGWIN_NT*|MINGW*_NT*)
760 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
761 # the uname.exe in the Cygwin tools.
762 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
763 # the uname.exe in the MSYS tools.
765     OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
766     OS_ARCH=WINNT
767     CPU_ARCH=`uname -m`
768     #
769     # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
770     #
771     if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
772         CPU_ARCH=x86
773     fi
774     ;;
775 esac
777 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
778     OS_TARGET=WIN95
779     if test -n "$MOZ_DEBUG"; then
780         USE_DEBUG_RTL=1
781     fi
783 if test -z "$OS_TARGET"; then
784     OS_TARGET=$OS_ARCH
786 if test "$OS_TARGET" = "WIN95"; then
787     OS_RELEASE="4.0"
789 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
791 dnl ========================================================
792 dnl Enable high-memory support on OS/2 by default.
793 dnl ========================================================
794 AC_ARG_ENABLE(os2-high-mem,
795     [  --disable-os2-high-mem  Disable high-memory support on OS/2],
796     [ if test "$enableval" = "no"; then
797         MOZ_OS2_HIGH_MEMORY=
798       else
799         MOZ_OS2_HIGH_MEMORY=1
800       fi ])
802 dnl ========================================================
803 dnl Override of system specific host options
804 dnl ========================================================
805 case "$host" in
806 *-mingw*)
807     NSINSTALL=nsinstall
808     ;;
809 *-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*)
810     NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
811     if test `echo "${PATH}" | grep -c \;` = 0; then
812         CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
813     fi
814     ;;
815 *-beos*)
816     HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
817     ;;
818 *os2*)
819     ;;
821     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
822     ;;
823 esac
825 dnl ========================================================
826 dnl Override of system specific target options
827 dnl ========================================================
828 case "$target" in
830 *-aix*)
831     AC_DEFINE(XP_UNIX)
832     AC_DEFINE(AIX)
833     AC_DEFINE(SYSV)
834     DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
835     AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
836     case "${target_os}" in
837     aix3.2*)
838         AC_DEFINE(AIX_RENAME_SELECT)
839         AC_DEFINE(_PR_NO_LARGE_FILES)
840         AIX_LINK_OPTS='-bnso -berok'
841         PR_MD_ASFILES=os_AIX.s
842         ;;
843     aix4.1*)
844         AC_DEFINE(AIX_TIMERS)
845         AC_DEFINE(_PR_NO_LARGE_FILES)
846         AC_DEFINE(AIX4_1)
847         MKSHLIB=
848         DSO_LDOPTS=
849         AIX_LINK_OPTS='-bnso -berok'
850         LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
851         LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
852         ;;
853     aix4.2*)
854         AC_DEFINE(AIX_TIMERS)
855         AC_DEFINE(_PR_HAVE_OFF64_T)
856         AIX_LINK_OPTS='-brtl -bnso -berok'
857         ;;
858     aix4.3*)
859         AC_DEFINE(AIX_TIMERS)
860         AC_DEFINE(_PR_HAVE_OFF64_T)
861         AC_DEFINE(AIX4_3_PLUS)
862         AC_DEFINE(HAVE_SOCKLEN_T)
863         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
864         USE_IPV6=1
865         AIX_LINK_OPTS='-brtl -bnso -berok'
866         ;;
867     *)
868         AC_DEFINE(AIX_TIMERS)
869         AC_DEFINE(_PR_HAVE_OFF64_T)
870         AC_DEFINE(AIX4_3_PLUS)
871         AC_DEFINE(HAVE_SOCKLEN_T)
872         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
873         USE_IPV6=1
874         AIX_LINK_OPTS='-brtl -bnso -berok'
875         ;;
876     esac
877     CFLAGS="$CFLAGS -qro -qroconst"
878     AIX_WRAP='$(DIST)/lib/aixwrap.o'
879     AIX_TMP='./_aix_tmp.o'
880     if test -n "$USE_64"; then
881         MDCPUCFG_H=_aix64.cfg
882         OBJECT_MODE=64
883     else
884         MDCPUCFG_H=_aix32.cfg
885     fi
886     PR_MD_CSRCS=aix.c
887     RESOLVE_LINK_SYMBOLS=1
888     ;;
889         
890 *-beos*)
891     AC_DEFINE(XP_BEOS)
892     AC_DEFINE(BeOS)
893     AC_DEFINE(BEOS)
894     AC_DEFINE(_POSIX_SOURCE)
895     DSO_LDOPTS=-nostart
896     MDCPUCFG_H=_beos.cfg
897     USE_BTHREADS=1
898     PR_MD_ARCH_DIR=beos
899     RESOLVE_LINK_SYMBOLS=1
900     case "${target_cpu}" in
901     i*86)
902         _OPTIMIZE_FLAGS=-O2
903         _DEBUG_FLAGS='-gdwarf-2 -O0'
904         MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
905         AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
906         ;;
907     powerpc)
908         CC=mwcc
909         CCC=mwcc
910         LD=mwld
911         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'
912         _OPTIMIZE_FLAGS=-O2    
913         _DEBUG_FLAGS='-g -O0'
914         ;;
915     esac
916     ;;
918 *-bsdi*)
919     AC_DEFINE(XP_UNIX)
920     AC_DEFINE(BSDI)
921     AC_DEFINE(NEED_BSDREGEX)
923     CFLAGS="$CFLAGS -Wall -Wno-format"
924     CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
926     if echo "$OS_TEST" | grep -c 86 >/dev/null; then
927         CPU_ARCH=x86
928     elif echo "$OS_TEST" | grep -c sparc >/dev/null; then 
929         CPU_ARCH=sparc
930     fi
932     MDCPUCFG_H=_bsdi.cfg
933     PR_MD_CSRCS=bsdi.c
935     DSO_LDOPTS=-r
937     case "$target_os" in
938     bsdi1.1*)
939         AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
940         AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
941         AC_DEFINE(_PR_NEED_H_ERRNO)
942         MKSHLIB=
943         DSO_CFLAGS=
944         DSO_LDOPTS=
945         ;;
947     bsdi2.1*)
948         AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
949         AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
950         AC_DEFINE(HAVE_DLL)
951         AC_DEFINE(USE_DLFCN)
952         AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
953         PR_MD_ASFILES=os_BSD_OS_386_2.s
954         ;;
956     bsdi4.* | bsdi5.*)
957         AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
958         AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
959         AC_DEFINE(HAVE_DLL)
960         AC_DEFINE(USE_DLFCN)
961         AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
962         MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
963         DSO_CFLAGS=-fPIC
964         DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
965         STRIP="$STRIP -d"
966         case "$target_os" in
967         bsdi4.2* | bsdi4.3* | bsdi5.*)
968             AC_DEFINE(_PR_HAVE_GETPROTO_R)
969             AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
970             ;;
971         esac
972         ;;
973     *)
974         AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
975         AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
976         AC_DEFINE(HAVE_DLL)
977         AC_DEFINE(USE_DLFCN)
978         AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
979         ;;
980     esac
982     ;;
984 *-darwin*)
985     AC_DEFINE(XP_UNIX)
986     AC_DEFINE(DARWIN)
987     AC_DEFINE(HAVE_BSD_FLOCK)
988     AC_DEFINE(HAVE_SOCKLEN_T)
989     AS='$(CC) -x assembler-with-cpp'
990     CFLAGS="$CFLAGS -Wall -fno-common"
991     case "${target_cpu}" in
992         i*86*)
993             if test -n "$USE_64"; then
994                 CPU_ARCH=x86_64
995                 CC="$CC -arch x86_64"
996             else        
997                 CPU_ARCH=i386
998             fi
999             ;;
1000         *)
1001             CPU_ARCH=ppc
1002             ;;
1003     esac
1004     DSO_CFLAGS=-fPIC
1005     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1006     _OPTIMIZE_FLAGS=-O2
1007     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1008     STRIP="$STRIP -x -S"
1009     DLL_SUFFIX=dylib
1010     USE_PTHREADS=1
1011     MDCPUCFG_H=_darwin.cfg
1012     PR_MD_CSRCS=darwin.c
1013     PR_MD_ASFILES=os_Darwin.s
1015     # Add Mac OS X support for loading CFM & CFBundle plugins
1016     if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
1017         AC_DEFINE(XP_MACOSX)
1018         OS_TARGET=MacOSX
1020         if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1021             dnl Use the specified value
1022             export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1023         elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1024             dnl No value specified on the command line or in the environment,
1025             dnl use the lesser of the library's minimum or the architecture's
1026             dnl minimum.
1027             case "${target_cpu}" in
1028                 powerpc*)
1029                     dnl Architecture minimum 10.2
1030                     export MACOSX_DEPLOYMENT_TARGET=10.2
1031                     ;;
1032                 i*86*)
1033                     dnl Architecture minimum 10.4
1034                     export MACOSX_DEPLOYMENT_TARGET=10.4
1035                     ;;
1036             esac
1037         fi
1039         dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1040         dnl in use.  NEXT_ROOT will be set and exported if it's needed for
1041         dnl ld.
1043         if test "$MACOS_SDK_DIR"; then
1044             dnl Sync this section with the one in Mozilla's top level.
1046             if test ! -d "$MACOS_SDK_DIR"; then
1047                 AC_MSG_ERROR([SDK not found.  When using --with-macos-sdk, you must
1048 specify a valid SDK.  SDKs are installed when the optional cross-development
1049 tools are selected during the Xcode/Developer Tools installation.])
1050             fi
1052             changequote(,)
1053             CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1054             GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1055             GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1056             changequote([,])
1057             GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1058             if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1059                 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1060                 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1061                     SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1062                 fi
1064                 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1066                 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1068                 dnl CPP needs to be set for AC_CHECK_HEADER.
1069                 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1071                 changequote(,)
1072                 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1073                 changequote([,])
1074                 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1075                     dnl The build host is running Tiger (10.4) or earlier.
1076                     dnl ld support for -syslibroot is compiler-agnostic, but
1077                     dnl only available on Tiger and later.  On Tiger and
1078                     dnl earlier build hosts, just rely on NEXT_ROOT, because
1079                     dnl it's not been shown to cause any problems.
1080                     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}"
1081                 else
1082                     dnl The build host is running Leopard (10.5) or later.
1083                     dnl With NEXT_ROOT set, the linker will still not apply
1084                     dnl it when resolving dependencies.  This causes problems
1085                     dnl on Leopard, where an SDK depends on frameworks which
1086                     dnl were present in earlier OS releases (and the associated
1087                     dnl SDK) but not in Leopard.  -syslibroot does not have
1088                     dnl this problem, but it results in harmless warnings when
1089                     dnl NEXT_ROOT is set.  NEXT_ROOT needs to remain set even
1090                     dnl on Leopard because the compiler uses it too.
1091                     MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1092                 fi
1094                 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1095                 export NEXT_ROOT=$MACOS_SDK_DIR
1097                 if test -n "$CROSS_COMPILE" ; then
1098                     dnl NEXT_ROOT will be in the environment, but it
1099                     dnl shouldn't be set for the build host.  HOST_CXX is
1100                     dnl presently unused.
1101                     HOST_CC="NEXT_ROOT= $HOST_CC"
1102                     HOST_CXX="NEXT_ROOT= $HOST_CXX"
1103                 fi
1104             else
1105                 dnl gcc >= 4.0 uses different paths than above, but knows
1106                 dnl how to find them itself.
1107                 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1109                 dnl CPP needs to be set for AC_CHECK_HEADER.
1110                 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1112                 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1113                 dnl has an ld that supports -syslibroot.  Don't set
1114                 dnl NEXT_ROOT because it will be ignored and cause
1115                 dnl warnings when -syslibroot is specified.
1116                 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1117                     dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1118                     dnl based on the -isysroot it receives.
1119                     LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1120                 else
1121                     dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1122                     dnl to be explicit.
1123                     LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1124                 fi
1125             fi
1126         fi
1127     fi
1128     ;;
1130 *-dgux*)
1131     AC_DEFINE(XP_UNIX)
1132     AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1133     AC_DEFINE(SVR4)
1134     AC_DEFINE(SYSV)
1135     AC_DEFINE(DGUX)
1136     AC_DEFINE(_DGUX_SOURCE)
1137     AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1138     DSO_LDOPTS=-G
1139     _OPTIMIZE_FLAGS=-O2
1140     _DEBUG_FLAGS=
1141     MDCPUCFG_H=_dgux.cfg
1142     PR_MD_CSRCS=dgux.c
1143     ;;
1145 *-freebsd*)
1146     if test -z "$USE_NSPR_THREADS"; then
1147         USE_PTHREADS=1
1148     fi
1149     AC_DEFINE(XP_UNIX)
1150     AC_DEFINE(FREEBSD)
1151     AC_DEFINE(HAVE_BSD_FLOCK)
1152     AC_DEFINE(HAVE_SOCKLEN_T)
1153     CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1154     MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1155     if test "$MOZ_OBJFORMAT" = "elf"; then
1156         DLL_SUFFIX=so
1157     else
1158         DLL_SUFFIX=so.1.0
1159     fi
1160     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1161     DSO_CFLAGS=-fPIC
1162     DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1163     MDCPUCFG_H=_freebsd.cfg
1164     PR_MD_CSRCS=freebsd.c
1165     ;;
1167 *-hpux*)
1168     AC_DEFINE(XP_UNIX)
1169     AC_DEFINE(HPUX)
1170     AC_DEFINE(_HPUX_SOURCE)
1171     # OSF1 and HPUX report the POLLHUP event for a socket when the
1172     # shutdown(SHUT_WR) operation is called for the remote end, even though
1173     # the socket is still writeable. Use select(), instead of poll(), to
1174     # workaround this problem.
1175     AC_DEFINE(_PR_POLL_WITH_SELECT)
1176     AC_DEFINE(_USE_BIG_FDS)
1177     DSO_LDOPTS='-b +h $(notdir $@)'
1178     PR_MD_CSRCS=hpux.c
1179     if test "$OS_TEST" = "ia64"; then
1180         DLL_SUFFIX=so
1181         DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1182         CPU_ARCH_TAG=_$OS_TEST 
1183         if test -z "$USE_64"; then
1184             COMPILER_TAG=_32
1185         fi
1186         PR_MD_ASFILES=os_HPUX_ia64.s
1187     else
1188         AC_DEFINE(hppa)
1189         DLL_SUFFIX=sl
1190         PR_MD_ASFILES=os_HPUX.s
1191     fi
1192     if test -n "$USE_64"; then
1193         MDCPUCFG_H=_hpux64.cfg
1194     else
1195         MDCPUCFG_H=_hpux32.cfg
1196     fi
1197     if test -z "$GNU_CC"; then
1198         CC="$CC -Ae"
1199         CXX="$CXX -ext"
1200         DSO_CFLAGS=+Z
1201     else
1202         DSO_CFLAGS=-fPIC
1203     fi
1205     if test -n "$MOZILLA_CLIENT"; then
1206         DEFAULT_IMPL_STRATEGY=_EMU
1207     fi
1209     if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1210         AC_DEFINE(_PR_NEED_H_ERRNO)
1211         AC_DEFINE(HPUX9)
1212         DEFAULT_IMPL_STRATEGY=_EMU
1213         USE_NSPR_THREADS=1
1214     fi
1216     if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1217         AC_DEFINE(_PR_NO_LARGE_FILES)
1218     fi
1220     if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1221         AC_DEFINE(_PR_NEED_H_ERRNO)
1222     fi
1224     if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1225         AC_DEFINE(HAVE_INT_LOCALTIME_R)
1226     fi
1228     if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1229         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1230     fi
1232     # HP-UX 11i v2 (B.11.23) or higher
1233     changequote(<<,>>)
1234     case "$OS_RELEASE" in
1235     [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1236         USE_IPV6=1
1237         ;;
1238     esac
1239     changequote([,])
1241     if test "$OS_RELEASE" = "B.10.01"; then
1242         AC_DEFINE(HPUX10)
1243         DEFAULT_IMPL_STRATEGY=_EMU
1244     fi
1246     if test "$OS_RELEASE" = "B.10.10"; then
1247         AC_DEFINE(HPUX10)
1248         AC_DEFINE(HPUX10_10)
1249         DEFAULT_IMPL_STRATEGY=_PTH
1250     fi
1252     if test "$OS_RELEASE" = "B.10.20"; then
1253         AC_DEFINE(HPUX10)
1254         AC_DEFINE(HPUX10_20)
1255         if test -z "$GNU_CC"; then
1256             CFLAGS="$CFLAGS +DAportable +DS1.1"
1257             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1258         fi
1259         DEFAULT_IMPL_STRATEGY=_PTH
1260     fi
1262     if test "$OS_RELEASE" = "B.10.30"; then
1263         AC_DEFINE(HPUX10)
1264         AC_DEFINE(HPUX10_30)
1265         if test -z "$GNU_CC"; then
1266             CFLAGS="$CFLAGS +DAportable +DS1.1"
1267             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1268         fi
1269         DEFAULT_IMPL_STRATEGY=_PTH
1270     fi
1272     if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1273         AC_DEFINE(HPUX10)
1274         AC_DEFINE(HPUX11)
1275         AC_DEFINE(_LARGEFILE64_SOURCE)
1276         AC_DEFINE(_PR_HAVE_OFF64_T)
1277         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1278         if test -z "$GNU_CC"; then
1279             if test -z "$USE_64"; then
1280                 if test "$OS_TEST" = "ia64"; then
1281                     CFLAGS="$CFLAGS +DD32"
1282                     CXXFLAGS="$CXXFLAGS +DD32"
1283                 else
1284                     CFLAGS="$CFLAGS +DAportable +DS2.0"
1285                     CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1286                 fi
1287             else
1288                 if test "$OS_TEST" = "ia64"; then
1289                     CFLAGS="$CFLAGS +DD64"
1290                     CXXFLAGS="$CXXFLAGS +DD64"
1291                 else
1292                     CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1293                     CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1294                 fi
1295             fi
1296         fi
1297         DEFAULT_IMPL_STRATEGY=_PTH
1298     fi
1300     if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1301         USE_NSPR_THREADS=1
1302         USE_PTHREADS=
1303         USE_USER_PTHREADS=
1304     elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1305         USE_PTHREADS=1
1306         if test "$USE_NSPR_THREADS"; then
1307             USE_PTHREADS=
1308         fi
1309         if test "$USE_USER_PTHREADS"; then
1310             USE_PTHREADS=
1311         fi
1312     fi
1313     ;;
1315 *-irix*)
1316     AC_DEFINE(XP_UNIX)
1317     AC_DEFINE(IRIX)
1318     AC_DEFINE(SVR4)
1319     AC_DEFINE(_SGI_MP_SOURCE)
1320     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1321     PR_MD_CSRCS=irix.c
1322     PR_MD_ASFILES=os_Irix.s
1323     MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1324     STRIP="$STRIP -f"
1325     RESOLVE_LINK_SYMBOLS=1
1326     if test -n "$USE_64"; then
1327         MDCPUCFG_H=_irix64.cfg
1328     else
1329         MDCPUCFG_H=_irix32.cfg
1330     fi
1331     case "${target_os}" in
1332     irix6*)
1333         AC_DEFINE(IRIX6)
1334         USE_PTHREADS=1
1335         USE_N32=1
1336         COMPILER_TAG=_n32
1337         IMPL_STRATEGY=_PTH
1338         ;;
1339     irix5*)
1340         AC_DEFINE(IRIX5)
1341         USE_NSPR_THREADS=1
1342         ;;
1343     *)
1344         USE_PTHREADS=1
1345         USE_N32=1
1346         ;;
1347     esac
1348     if test "$GNU_CC"; then
1349         dnl
1350         dnl If we are using gcc with native binutils, we need to
1351         dnl suppress the
1352         dnl #lineno "filename" num num
1353         dnl lines, which confuse IRIX native as.  Add -Wp,-P to the
1354         dnl gcc command line, which passes -P to the preprocessor.
1355         dnl
1356             AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1357             CFLAGS="$CFLAGS -Wall -Wno-format"
1358             _OPTIMIZE_FLAGS="-O6"
1359     else
1360             if test -n "$USE_N32"; then
1361                 AS='as -D_ASM $(INCLUDES) -n32'
1362             else
1363                 AS='as -D_ASM $(INCLUDES)'
1364             fi
1365             CFLAGS="$CFLAGS -fullwarn -xansi"
1366             if test "$USE_N32"; then
1367                 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1368             else
1369                 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1370             fi
1371             if test "$USE_MDUPDATE"; then
1372                 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1373             fi
1374             case "${target}" in
1375             *-irix6.*)
1376                 CFLAGS="$CFLAGS -multigot"
1377                 DSO_LDOPTS="-no_unresolved"
1378                 if test "$USE_N32"; then
1379                         CFLAGS="$CFLAGS -n32 -woff 1209"
1380                         DSO_LDOPTS="$DSO_LDOPTS -n32"
1381                 else
1382                         if test "$USE_64"; then
1383                             CFLAGS="$CFLAGS -64"
1384                         else
1385                             CFLAGS="$CFLAGS -32"
1386                         fi
1387                 fi
1388                 ;;
1389             *)
1390                 CFLAGS="$CFLAGS -xgot"
1391                 ;;
1392             esac
1393     fi
1394     if test "${target_os}" = "irix5.3"; then
1395             AC_DEFINE(IRIX5_3)
1396     fi
1397     case "${target_os}" in
1398         irix6.5)
1399             if test -z "$GNU_CC"; then
1400                     CFLAGS="$CFLAGS -mips3"
1401             fi
1402             AC_DEFINE(_PR_HAVE_GETPROTO_R)
1403             AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1404             AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1405             ;;
1406         irix5*)
1407             ;;
1408         *)
1409             AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1410             ;;
1411         esac
1412     ;;
1414 *-linux*|*-gnu*|*-k*bsd*-gnu)
1415     if test -z "$USE_NSPR_THREADS"; then
1416         USE_PTHREADS=1
1417         IMPL_STRATEGY=_PTH
1418     fi
1419     AC_DEFINE(XP_UNIX)
1420     AC_DEFINE(_GNU_SOURCE)
1421     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1422     case "${target_os}" in
1423     linux*)
1424         AC_DEFINE(LINUX)
1425         ;;
1426     esac
1427     CFLAGS="$CFLAGS -Wall"
1428     CXXFLAGS="$CXXFLAGS -Wall"
1429     MDCPUCFG_H=_linux.cfg
1430     PR_MD_CSRCS=linux.c
1431     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1432     DSO_CFLAGS=-fPIC
1433     DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1434     _OPTIMIZE_FLAGS=-O2
1435     _DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb, and that
1436                                    # combo is not yet good at debugging inlined
1437                                    # functions (even when using DWARF2 as the
1438                                    # debugging format)
1439     COMPILER_TAG=_glibc
1440     if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1441         CPU_ARCH=x86
1442     else
1443         CPU_ARCH=$OS_TEST
1444     fi
1445     CPU_ARCH_TAG=_${CPU_ARCH}
1446     case "${target_cpu}" in
1447     alpha)
1448         AC_DEFINE(_ALPHA_)
1449         AC_DEFINE(__alpha)
1450         CFLAGS="$CFLAGS -mieee"
1451         CXXFLAGS="$CXXFLAGS -mieee"
1452         ;;
1453     i*86)
1454         AC_DEFINE(i386)
1455         PR_MD_ASFILES=os_Linux_x86.s
1456         ;;
1457     ia64)
1458         PR_MD_ASFILES=os_Linux_ia64.s
1459         ;;
1460     x86_64)
1461         if test -n "$USE_64"; then
1462             PR_MD_ASFILES=os_Linux_x86_64.s
1463         else
1464             AC_DEFINE(i386)
1465             PR_MD_ASFILES=os_Linux_x86.s
1466             CC="$CC -m32"
1467             CXX="$CXX -m32"
1468         fi
1469         ;;
1470     ppc|powerpc)
1471         PR_MD_ASFILES=os_Linux_ppc.s
1472         ;;
1473     powerpc64)
1474         if test -n "$USE_64"; then
1475             CC="$CC -m64"
1476             CXX="$CXX -m64"
1477         else
1478             PR_MD_ASFILES=os_Linux_ppc.s
1479         fi
1480         ;;
1481     m68k)
1482         CFLAGS="$CFLAGS -m68020-60"
1483         CXXFLAGS="$CXXFLAGS -m68020-60"
1484         ;;
1485     esac    
1486     ;;
1488 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1489     AC_DEFINE(XP_PC)
1490     AC_DEFINE(WIN32)
1491     PR_MD_ARCH_DIR=windows
1492     RESOLVE_LINK_SYMBOLS=1
1494     if test -n "$GNU_CC"; then
1495         CC="$CC -mno-cygwin"
1496         CXX="$CXX -mno-cygwin"
1497         DLL_SUFFIX=dll
1498         MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1499         RC=$WINDRES
1500         # Use temp file for windres (bug 213281)
1501         RCFLAGS='-O coff --use-temp-file'
1502     else
1503         CC=cl
1504         CXX=cl
1505         LD=link
1506         AR='lib -NOLOGO -OUT:"$@"'
1507         AR_FLAGS=
1508         RANLIB='echo not_ranlib'
1509         STRIP='echo not_strip'
1510         RC=rc.exe
1511         GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1512         OBJ_SUFFIX=obj
1513         LIB_SUFFIX=lib
1514         DLL_SUFFIX=dll
1516         # Determine compiler version
1517         CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'`
1518         _CC_MAJOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $1 }'`
1519         _CC_MINOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $2 }'`
1520         MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1522         # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1523         # tape manipulation utility (or something else)
1524         if test "$MSC_VER" -ge "1400"; then
1525             changequote(,)
1526             _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1527             changequote([,])
1529             MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1530             if test -n "$MSMT_TOOL"; then
1531                 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1532                 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1533                     AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1534                 fi
1535                 MT=mt
1536                 unset MSMT_TOOL
1537             else
1538                 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1539             fi
1540         fi
1541         
1542         CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1543         DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1544         _DEBUG_FLAGS=-Z7
1545         _OPTIMIZE_FLAGS=-O2
1546         if test -z "$MOZ_OPTIMIZE"; then
1547             CFLAGS="$CFLAGS -Od"
1548         fi
1550         if test -n "$USE_DEBUG_RTL"; then
1551             CFLAGS="$CFLAGS -MDd"
1552         else
1553             CFLAGS="$CFLAGS -MD"
1554         fi
1556         if test -n "$MOZ_DEBUG"; then
1557             AC_DEFINE(_DEBUG)
1558         else
1559             DEFINES="$DEFINES -U_DEBUG"
1560         fi
1562         if test -n "$MOZ_OPTIMIZE"; then
1563             if test -n "$MOZ_DEBUG_SYMBOLS"; then
1564                 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Zi"
1565                 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1566                 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1567             fi
1568         fi
1570         if test -n "$MOZ_DEBUG"; then
1571             DLLFLAGS="$DLLFLAGS -DEBUG"
1572             LDFLAGS="$LDFLAGS -DEBUG"
1573         fi
1575         OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1576         if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1577             OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
1578         fi
1579         
1580         if test "$OS_TARGET" = "WINNT"; then
1581             CFLAGS="$CFLAGS -GT"
1582             LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1583             LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1584         else
1585             LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1586             LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1587         fi
1588     fi # GNU_CC
1590     if test -n "$USE_STATIC_TLS"; then
1591         AC_DEFINE(_PR_USE_STATIC_TLS)
1592     fi
1594     if test "$OS_TARGET" = "WINNT"; then
1595         AC_DEFINE(WINNT)
1596     else
1597         AC_DEFINE(WIN95)
1598         # undefine WINNT as some versions of mingw gcc define it by default
1599         DEFINES="$DEFINES -UWINNT"
1600         AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1601     fi
1603     if test "$CPU_ARCH" = "x86"; then
1604         CPU_ARCH_TAG=
1605     else
1606         CPU_ARCH_TAG=$CPU_ARCH
1607     fi
1609     if test -n "$USE_DEBUG_RTL"; then
1610         OBJDIR_SUFFIX=OBJD
1611     fi
1613     case "$OS_TARGET" in
1614     WINNT)
1615             MDCPUCFG_H=_winnt.cfg
1616             ;;
1617     WIN95)
1618             MDCPUCFG_H=_win95.cfg
1619             ;;
1620     *)
1621             AC_MSG_ERROR([Missing OS_TARGET for ${target}.  Use --enable-win32-target to set.])
1622         ;;
1623     esac
1625     case "$target_cpu" in
1626     i*86)
1627         if test -n "$USE_64"; then
1628             AC_DEFINE(_AMD64_)
1629         else            
1630             AC_DEFINE(_X86_)
1631         fi
1632         ;;
1633     x86_64)
1634             AC_DEFINE(_AMD64_)
1635             USE_64=1
1636             ;;
1637     ia64)
1638             AC_DEFINE(_IA64_)
1639             USE_64=1
1640             ;;
1641     *)
1642             AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
1643             ;;
1644     esac
1645     ;;
1647 *-wince*|*-winmo*)
1648     AC_DEFINE(XP_PC)
1649     AC_DEFINE(WIN32)
1650     AC_DEFINE(WINCE)
1651     AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1653     AR='lib -NOLOGO -OUT:"$@"'
1654     AR_FLAGS=
1656     OBJ_SUFFIX=obj
1657     LIB_SUFFIX=lib
1658     DLL_SUFFIX=dll
1659     MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
1661     PR_MD_ARCH_DIR=windows
1662     RESOLVE_LINK_SYMBOLS=1
1664     MDCPUCFG_H=_win95.cfg
1665     LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1666     LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1668     DLLFLAGS='-OUT:"$@"'
1669     if test -n "$MOZ_DEBUG_SYMBOLS"; then
1670         OS_LDFLAGS='-DEBUG -DEBUGTYPE:CV'
1671         OS_DLLFLAGS='-DEBUG -DEBUGTYPE:CV'
1672         DSO_LDOPTS='-DEBUG -DEBUGTYPE:CV'
1673     fi
1674     _DEBUG_FLAGS=-Zi
1675     _OPTIMIZE_FLAGS=-O2
1676     ;;
1678 *-ncr-sysv*)
1679     AC_DEFINE(XP_UNIX)
1680     AC_DEFINE(SVR4)
1681     AC_DEFINE(SYSV)
1682     AC_DEFINE(NCR)
1683     USE_NSPR_THREADS=1
1684     if test "$OS_RELEASE" = "2.03"; then
1685         AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
1686     else
1687         AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
1688     fi
1690     if test -z "$GNU_CC"; then
1691         CFLAGS="$CFLAGS -Hnocopyr"
1692         CXXFLAGS="$CXXFLAGS -Hnocopyr"
1693     else
1694         CFLAGS="$CFLAGS -fPIC -Wall"
1695         CXXFLAGS="$CXXFLAGS -fPIC -Wall"
1696         DSO_LDOPTS=-G
1697     fi
1698     MDCPUCFG_H=_ncr.cfg
1699     PR_MD_CSRCS=ncr.c
1700     ;;
1702 mips-nec-sysv*)
1703     AC_DEFINE(XP_UNIX)
1704     AC_DEFINE(SVR4)
1705     AC_DEFINE(__SVR4)
1706     AC_DEFINE(NEC)
1707     AC_DEFINE(nec_ews)
1708     USE_NSPR_THREADS=1
1709     if test -z "$GNU_CC"; then
1710         CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
1711         CXX=g++
1712     fi
1713     OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
1714     DSO_LDOPTS=-G
1715     MDCPUCFG_H=_nec.cfg
1716     PR_MD_CSRCS=nec.c
1717     ;;
1719 *-netbsd*)
1720     AC_DEFINE(XP_UNIX)
1721     AC_DEFINE(NETBSD)
1722     AC_DEFINE(HAVE_BSD_FLOCK)
1723     if test -z "$USE_NSPR_THREADS"; then
1724         USE_PTHREADS=1
1725     fi
1726     MDCPUCFG_H=_netbsd.cfg
1727     PR_MD_CSRCS=netbsd.c
1729     DSO_CFLAGS='-fPIC -DPIC'
1730     CFLAGS="$CFLAGS -ansi -Wall"
1731     CXXFLAGS="$CXXFLAGS -ansi -Wall"
1732     MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1734     if test -z "$OBJECT_FMT"; then
1735         if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
1736             OBJECT_FMT=a.out
1737             DLL_SUFFIX=so.1.0
1738             DSO_LDOPTS='-shared'
1739         else
1740             OBJECT_FMT=ELF
1741             DLL_SUFFIX=so
1742             DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
1743         fi
1744     fi
1746     if test "$LIBRUNPATH"; then
1747         DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
1748     fi
1749     ;;
1751 mips-sony-newsos*)
1752     AC_DEFINE(XP_UNIX)
1753     AC_DEFINE(SONY)
1754     AC_DEFINE(SYSV)
1755     AC_DEFINE(SVR4)
1756     AC_DEFINE(__svr4)
1757     AC_DEFINE(__svr4__)
1758     AC_DEFINE(HAVE_SVID_GETTOD)
1759     USE_NSPR_THREADS=1
1760     CFLAGS="$CFLAGS -Xa -fullwarn"
1761     CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
1762     DSO_LDOPTS=-G
1763     MDCPUCFG_H=_sony.cfg
1764     PR_MD_CSRCS=sony.c
1765     ;;
1767 *-nextstep*|*-openstep*)
1768     AC_DEFINE(XP_UNIX)
1769     AC_DEFINE(NEXTSTEP)
1770     AC_DEFINE(HAVE_BSD_FLOCK)
1771     AC_DEFINE(_POSIX_SOURCE)
1772     CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
1773     CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
1774     USE_NSPR_THREADS=1
1775     DLL_SUFFIX=dylib
1776     MDCPUCFG_H=_nextstep.cfg
1777     PR_MD_CSRCS=nextstep.c
1778     ;;
1781 *-nto*)
1782     AC_DEFINE(XP_UNIX)
1783     AC_DEFINE(NTO)
1784     AC_DEFINE(_QNX_SOURCE)
1785     AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1786     MDCPUCFG_H=_nto.cfg
1787     PR_MD_CSRCS=nto.c
1788     MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
1789     DSO_CFLAGS=-fPIC
1790     DSO_LDOPTS=-shared
1791     OS_LIBS="$OS_LIBS -lsocket"
1792     _OPTIMIZE_FLAGS="-O1"
1793     _DEBUG_FLAGS="-gstabs"
1794         ;;
1796 *-openbsd*)
1797     AC_DEFINE(XP_UNIX)
1798     AC_DEFINE(OPENBSD)
1799     AC_DEFINE(HAVE_BSD_FLOCK)
1800     AC_DEFINE(HAVE_SOCKLEN_T)
1801     CFLAGS="$CFLAGS -ansi -Wall"
1802     CXXFLAGS="$CXXFLAGS -ansi -Wall"
1803     DLL_SUFFIX=so.1.0
1804     DSO_CFLAGS=-fPIC
1805     MDCPUCFG_H=_openbsd.cfg
1806     PR_MD_CSRCS=openbsd.c
1807     OS_LIBS="-lc"
1808     if test -z "$USE_NSPR_THREADS"; then
1809         USE_PTHREADS=1
1810     fi
1811     DSO_LDOPTS='-shared -fPIC'
1812     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1813     ;;
1815 *-osf*)
1816     SHELL_OVERRIDE="SHELL               = /usr/bin/ksh"
1817     AC_DEFINE(XP_UNIX)
1818     AC_DEFINE(OSF1)
1819     AC_DEFINE(_REENTRANT)
1820     # OSF1 and HPUX report the POLLHUP event for a socket when the
1821     # shutdown(SHUT_WR) operation is called for the remote end, even though
1822     # the socket is still writeable. Use select(), instead of poll(), to
1823     # workaround this problem.
1824     AC_DEFINE(_PR_POLL_WITH_SELECT)
1826     if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
1827         USE_NSPR_THREADS=1
1828     fi
1830     if test -z "$GNU_CC"; then
1831         CC="$CC -std1 -ieee_with_inexact"
1832         if test "$OS_RELEASE" != "V2.0"; then
1833             CC="$CC -readonly_strings"
1834         fi
1835         _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
1836         AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
1837     else
1838         CFLAGS="$CFLAGS -mieee"
1839         CXXFLAGS="$CXXFLAGS -mieee"
1840     fi
1842     if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
1843         AC_DEFINE(HAVE_INT_LOCALTIME_R)
1844     else
1845         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1846         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1847     fi
1848     if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
1849         AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
1850     fi
1851     DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
1852     MDCPUCFG_H=_osf1.cfg
1853     PR_MD_CSRCS=osf1.c
1854     ;;
1856 *-qnx*)
1857     AC_DEFINE(XP_UNIX)
1858     AC_DEFINE(QNX)
1859     AC_DEFINE(_PR_NEED_H_ERRNO)
1860     USE_NSPR_THREADS=1
1861     MDCPUCFG_H=_qnx.cfg
1862     PR_MD_CSRCS=qnx.c
1863     ;;
1865 *-riscos*)
1866     AC_DEFINE(XP_UNIX)
1867     AC_DEFINE(RISCOS)
1868     AC_DEFINE(_PR_NEED_H_ERRNO)
1869     USE_PTHREADS=1
1870     MDCPUCFG_H=_riscos.cfg
1871     PR_MD_CSRCS=riscos.c
1872     DSO_CFLAGS=-fPIC
1873     DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1874     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1875     ;;
1877 *-*-sco*)
1878     AC_DEFINE(XP_UNIX)
1879     AC_DEFINE(SCO)
1880     AC_DEFINE(sco)
1881     AC_DEFINE(SYSV)
1882     AC_DEFINE(_SVID3)
1883     AC_DEFINE(_PR_NEED_H_ERRNO)
1884     CC='cc -b elf -KPIC'
1885     CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
1886     USE_NSPR_THREADS=1
1887     CPU_ARCH=x86
1888     DSO_LDOPTS='-b elf -G'
1889     MDCPUCFG_H=_scoos.cfg
1890     PR_MD_SRCS=scoos.c
1891     ;;
1893 *-sinix*)
1894     AC_DEFINE(XP_UNIX)
1895     AC_DEFINE(SVR4)
1896     AC_DEFINE(SNI)
1897     AC_DEFINE(RELIANTUNIX)
1898     AC_DEFINE(sinix)
1899     AC_DEFINE(HAVE_SVID_GETTOD)
1900     if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
1901         AC_DEFINE(i386)
1902         CPU_ARCH=x86
1903     else
1904         CPU_ARCH=mips
1905     fi
1907     if test "$GNU_CC"; then
1908         AS='$(CC) -x assembler-with-cpp'
1909         if test "$CPU_ARCH" = "mips"; then
1910             LD=gld
1911         fi
1912         CFLAGS="$CFLAGS -Wall -Wno-format"
1913     else
1914         AS='/usr/bin/cc'
1915         _OPTIMIZE_FLAGS='-O -F Olimit,4000'
1916     fi
1918     DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
1920     if test "$OS_RELEASE" = "5.43"; then
1921         AC_DEFINE(IP_MULTICAST)
1922     fi
1924     OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
1925     USE_NSPR_THREADS=1
1926     MDCPUCFG_H=_reliantunix.cfg
1927     PR_MD_CSRCS=reliantunix.c
1928     if test "${OS_ARCH}" = "mips"; then
1929         PR_MD_ASFILES=os_ReliantUNIX.s
1930     fi
1931     ;;
1933 *-sunos*)
1934     AC_DEFINE(XP_UNIX)
1935     AC_DEFINE(SUNOS4)
1936     CFLAGS="$CFLAGS -Wall -Wno-format"
1937     if test "$USE_MDUPDATE"; then
1938         CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1939     fi
1940     CPU_ARCH=sparc
1941     DLL_SUFFIX=so.1.0
1942     DSO_LDOPTS=
1943     DSO_CFLAGS=-fPIC
1944     USE_NSPR_THREADS=1
1945     if test "$OS_RELEASE" = "4.1.3_U1"; then
1946         _OPTIMIZE_FLAGS=
1947         OS_LIBS="$OS_LIBS -lm"
1948     fi
1949     MDCPUCFG_H=_sunos4.cfg
1950     PR_MD_CSRCS=sunos4.c
1951     ;;
1953 *-solaris*)
1954     if test -z "$USE_NSPR_THREADS"; then
1955         USE_PTHREADS=1
1956     fi
1957     AC_DEFINE(XP_UNIX)
1958     AC_DEFINE(SVR4)
1959     AC_DEFINE(SYSV)
1960     AC_DEFINE(__svr4)
1961     AC_DEFINE(__svr4__)
1962     AC_DEFINE(SOLARIS)
1963     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1964     CPU_ARCH=`uname -p`
1965     MDCPUCFG_H=_solaris.cfg
1966     PR_MD_CSRCS=solaris.c
1967     LD=/usr/ccs/bin/ld
1968     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1969     RESOLVE_LINK_SYMBOLS=1
1970     case "${OS_RELEASE}" in
1971     5.8|5.9)
1972         ;;
1973     *)
1974         # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
1975         USE_B_DIRECT=1
1976         ;;
1977     esac
1978     if test -n "$GNU_CC"; then
1979         DSO_CFLAGS=-fPIC
1980         if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
1981             GCC_USE_GNU_LD=1
1982         fi
1983         DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore' 
1984         if test -n "$USE_B_DIRECT"; then
1985             DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
1986         fi
1987     else
1988         DSO_CFLAGS=-KPIC
1989         DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
1990         if test -n "$USE_B_DIRECT"; then
1991             DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
1992         fi
1993     fi
1994     if test -n "$GNU_CC"; then
1995         CFLAGS="$CFLAGS -Wall"
1996         CXXFLAGS="$CXXFLAGS -Wall"
1997         if test -n "$USE_MDUPDATE"; then
1998             CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1999             CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2000         fi
2001         GCC_AS=`$CC -print-prog-name=as`
2002         if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2003             GNU_AS=1
2004         fi
2005     else
2006         CFLAGS="$CFLAGS -xstrconst"
2007         CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2008         if test -z "$MOZ_OPTIMIZE"; then
2009             CFLAGS="$CFLAGS -xs"
2010             CXXFLAGS="$CXXFLAGS -xs"
2011         fi
2012         _OPTIMIZE_FLAGS=-xO4
2013     fi
2014     if test -z "$GNU_AS"; then
2015         ASFLAGS="$ASFLAGS -Wa,-P"
2016     fi
2017     if test -n "$USE_64"; then
2018         if test -n "$GNU_CC"; then
2019             CC="$CC -m64"
2020             CXX="$CXX -m64"
2021         else
2022             if test "$OS_TEST" = "i86pc"; then
2023                 CC="$CC -xarch=amd64"
2024                 CXX="$CXX -xarch=amd64"
2025             else
2026                 CC="$CC -xarch=v9"
2027                 CXX="$CXX -xarch=v9"
2028             fi
2029         fi
2030     fi
2031     if test "$OS_TEST" = "i86pc"; then
2032         if test -z "$USE_64"; then
2033             AC_DEFINE(i386)
2034         fi
2035         CPU_ARCH_TAG=_$OS_TEST
2036         # The default debug format, DWARF (-g), is not supported by gcc
2037         # on i386-ANY-sysv4/solaris, but the stabs format is.  It is
2038         # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2039         # If your gcc uses GNU as, you do not need the -Wa,-s option.
2040         if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2041             _DEBUG_FLAGS=-gstabs
2042             if test -z "$GNU_AS"; then
2043                 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2044             fi
2045         fi
2046     fi
2047     case "${target_os}" in
2048     solaris2.3*)
2049         AC_DEFINE(_PR_NO_LARGE_FILES)
2050         ;;
2051     solaris2.4*)
2052         AC_DEFINE(_PR_NO_LARGE_FILES)
2053         ;;
2054     solaris2.5*)
2055         AC_DEFINE(SOLARIS2_5)    
2056         ;;
2057     *)
2058         AC_DEFINE(_PR_HAVE_OFF64_T)
2059         # The lfcompile64(5) man page on Solaris 2.6 says:
2060         #     For applications that do not wish to conform to the POSIX or
2061         #     X/Open  specifications,  the  64-bit transitional interfaces
2062         #     are available by default.  No compile-time flags need to  be
2063         #     set.
2064         # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2065         # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2066         if test -n "$GNU_CC"; then
2067             AC_DEFINE(_LARGEFILE64_SOURCE)
2068         fi
2069         ;;
2070     esac
2071     case "${target_os}" in
2072     solaris2.3*)
2073         ;;
2074     solaris2.4*)
2075         ;;
2076     solaris2.5*)
2077         ;;
2078     solaris2.6*)
2079         ;;
2080     solaris2.7*)
2081         ;;
2082     *)
2083         # Solaris 8 or higher has IPv6.
2084         AC_DEFINE(_PR_INET6)
2085         ;;
2086     esac
2087     if test "$CPU_ARCH" = "sparc"; then
2088         # 64-bit Solaris SPARC requires V9 architecture, so the following
2089         # is not needed.
2090         if test -z "$USE_64"; then
2091             ULTRASPARC_LIBRARY=nspr_flt
2092         fi
2093     fi
2094     # Purify requires that binaries linked against nspr also
2095     # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2096     _rev=`uname -r`
2097     _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2098     OS_LIBS="$OS_LIBS $_librt"
2099     ;;
2101 *-sco-sysv5*)
2102     AC_DEFINE(XP_UNIX)
2103     AC_DEFINE(UNIXWARE)
2104     AC_DEFINE(SVR4)
2105     AC_DEFINE(SYSV)
2106     USE_NSPR_THREADS=1
2107     if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2108         AC_DEFINE(_PR_NO_LARGE_FILES)
2109         CC='$(NSDEPTH)/build/hcc cc'
2110         CXX='$(NSDEPTH)/build/hcpp CC'
2111         MDCPUCFG_H=_unixware.cfg
2112     else
2113         AC_DEFINE(_LARGEFILE64_SOURCE)
2114         AC_DEFINE(_PR_HAVE_OFF64_T)
2115         AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2116         MDCPUCFG_H=_unixware7.cfg
2117     fi
2118     PR_MD_CSRCS=unixware.c
2119     DSO_LDOPTS=-G
2120     CPU_ARCH=x86
2121     ;;
2123 *-symbian*)
2124     AC_ARG_WITH(symbian-sdk,
2125     [  --with-symbian-sdk=SYMBIAN_SDK_DIR
2126                           The path to the Symbian SDK],
2127     SYMBIAN_SDK_DIR=$withval)
2129     echo -----------------------------------------------------------------------------
2130     echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2131     echo -----------------------------------------------------------------------------
2133     AC_DEFINE(XP_UNIX)
2134     AC_DEFINE(SYMBIAN)
2135     AC_DEFINE(__arm__)
2136     AC_DEFINE(__SYMBIAN32__)
2137     AC_DEFINE(_UNICODE)
2138     AC_DEFINE(NDEBUG)
2139     AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2140     AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2141     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2142     AC_DEFINE(HAVE_SOCKLEN_T)
2143     USE_PTHREADS=1
2144     LIB_SUFFIX=lib
2145     DLL_SUFFIX=dll
2146     MKSHLIB=
2147     DSO_LDOPTS=
2148     DSO_CFLAGS=
2149     VISIBILITY_FLAGS=
2150     MDCPUCFG_H=_symbian.cfg
2151     PR_MD_CSRCS=symbian.c
2152     NSINSTALL=nsinstall
2153     RANLIB='echo no ranlib '
2154     CPU_ARCH=ARM
2155     OS_ARCH=SYMBIAN
2156     OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2157     CFLAGS="$CFLAGS -MD -nostdinc"
2158     SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2159     echo -------------------------------------------------------
2160     echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2161     echo -------------------------------------------------------
2162     case "$OS_TARGET" in
2163     WINSCW)
2164         CC=mwccsym2.exe
2165         CXX=mwccsym2.exe
2166         LD=mwldsym2.exe
2167         AR=mwldsym2.exe
2168         WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2169         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)"
2170         SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2171         AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2172         AC_DEFINE(_DEBUG)
2173         AC_DEFINE(__CW32__)
2174         AC_DEFINE(__WINS__)
2175         AC_DEFINE(__WINSCW__)
2176         DEFINES="$DEFINES -U_WIN32"
2177             ;;
2178     GCCE)
2179         CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2180         CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2181         SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2182         AC_DEFINE(__GCCE__)
2183         AC_DEFINE(__EABI__)
2184         DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2185             ;;
2186     *)
2187             AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2188         ;;
2189     esac
2190     CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2191     ;;
2193 *-os2*)
2194     AC_DEFINE(XP_OS2)
2195     AC_DEFINE(XP_PC)
2196     AC_DEFINE(BSD_SELECT)
2197     AC_DEFINE(TCPV40HDRS)
2198     LIB_SUFFIX=lib
2199     DLL_SUFFIX=dll
2200     RC=rc.exe
2201     PR_MD_ARCH_DIR=os2
2202     PROG_SUFFIX=.exe
2203     NSINSTALL=nsinstall
2204     MDCPUCFG_H=_os2.cfg
2205     RESOLVE_LINK_SYMBOLS=1
2207     AC_DEFINE(OS2)
2208     AR=emxomfar
2209     AR_FLAGS='r $@'
2210     CFLAGS="$CFLAGS -Wall -Zomf"
2211     CXXFLAGS="$CFLAGS -Wall -Zomf"
2212     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2213     DSO_CFLAGS=
2214     DSO_LDOPTS='-Zomf -Zdll'
2215     LDFLAGS='-Zmap'
2216     _OPTIMIZE_FLAGS="-O2 -s"
2217     _DEBUG_FLAGS="-g -fno-inline"
2218     if test -n "$MOZ_OPTIMIZE"; then
2219       DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2220     fi
2221     IMPLIB='emximp -o'
2222     FILTER='emxexp -o'
2223     if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2224       LDFLAGS="$LDFLAGS -Zhigh-mem"
2225       AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2226     fi
2228     # GCC for OS/2 currently predefines these, but we don't want them
2229     DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2230     ;;
2233     AC_DEFINE(XP_UNIX)
2234     ;;
2235    
2236 esac
2238 if test -z "$SKIP_LIBRARY_CHECKS"; then
2239 dnl ========================================================
2240 dnl Check for system libraries
2241 dnl ========================================================
2242 dnl AC_CHECK_LIB(C, main)
2243 dnl AC_CHECK_LIB(C_r, main)
2244 dnl AC_CHECK_LIB(c, main)
2245 dnl AC_CHECK_LIB(c_r, main)
2246 dnl AC_CHECK_LIB(dce, main)
2247 dnl AC_CHECK_LIB(dl, main)
2248 dnl AC_CHECK_LIB(dld, main)
2249 dnl AC_CHECK_LIB(gen, main)
2250 dnl AC_CHECK_LIB(ip6, main)
2251 dnl AC_CHECK_LIB(l, main)
2252 dnl AC_CHECK_LIB(m, main)
2253 dnl AC_CHECK_LIB(nsl, main)
2254 dnl AC_CHECK_LIB(posix4, main)
2255 dnl AC_CHECK_LIB(prstrms, main)
2256 dnl AC_CHECK_LIB(prstrms_shr, main)
2257 dnl AC_CHECK_LIB(pthread, main)
2258 dnl AC_CHECK_LIB(pthreads, main)
2259 dnl AC_CHECK_LIB(resolv, main)
2260 dnl AC_CHECK_LIB(rt, main)
2261 dnl AC_CHECK_LIB(socket, main)
2262 dnl AC_CHECK_LIB(svld, main)
2263 dnl AC_CHECK_LIB(thread, main)
2264 dnl AC_CHECK_LIB(vms_jackets, main)
2267 dnl We don't want anything to link with libdl even if it's present on OS X, 
2268 dnl since it's not used and not part of the default installation.
2269 dnl The same goes for BeOS.
2270 dnl OS/2 has dlfcn in libc.
2272 case $target in
2273 *-darwin*|*-beos*|*-os2*)
2274     ;;
2276     AC_CHECK_LIB(dl, dlopen,
2277         AC_CHECK_HEADER(dlfcn.h,
2278             OS_LIBS="-ldl $OS_LIBS"))
2279     ;;
2280 esac
2283 dnl ========================================================
2284 dnl Check for system header files.
2285 dnl ========================================================
2286 dnl AC_HEADER_DIRENT
2287 dnl AC_HEADER_STDC
2288 dnl AC_HEADER_SYS_WAIT
2289 dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2291 dnl ========================================================
2292 dnl Check for typedefs and structs
2293 dnl ========================================================
2294 dnl AC_C_CONST
2295 dnl AC_TYPE_UID_T
2296 dnl AC_TYPE_MODE_T
2297 dnl AC_TYPE_OFF_T
2298 dnl AC_TYPE_PID_T
2299 dnl AC_TYPE_SIZE_T
2300 dnl AC_STRUCT_ST_BLKSIZE
2301 dnl AC_STRUCT_ST_BLOCKS
2302 dnl AC_STRUCT_ST_RDEV
2303 dnl AC_HEADER_TIME
2304 dnl AC_STRUCT_TM
2306 dnl ========================================================
2307 dnl Checks for library functions.
2308 dnl ========================================================
2309 AC_PROG_GCC_TRADITIONAL
2310 AC_CHECK_FUNCS(lchown strerror)
2312 dnl AC_FUNC_MEMCMP
2313 dnl AC_FUNC_MMAP
2314 dnl AC_FUNC_SETVBUF_REVERSED
2315 dnl AC_FUNC_STRCOLL
2316 dnl AC_FUNC_STRFTIME
2317 dnl AC_FUNC_UTIME_NULL
2318 dnl AC_FUNC_VPRINTF
2319 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2321 dnl ========================================================
2322 dnl Check options
2323 dnl ========================================================
2325 dnl ========================================================
2326 dnl =
2327 dnl = --enable-strip
2328 dnl = 
2329 dnl = Enable stripping of libs and executables
2330 dnl = 
2331 dnl ========================================================
2332 AC_ARG_ENABLE(strip,
2333     [  --enable-strip          Enable stripping of shared libs and programs],
2334     [ if test "$enableval" = "yes"; then
2335             ENABLE_STRIP=1
2336       fi ])
2338 dnl Check for hpux options
2339 case "${target_os}" in
2340 hpux*)
2341 if test -z "$GNU_CC"; then
2343     AC_CACHE_CHECK(for +Olit support,
2344         ac_cv_hpux_usable_olit_option,
2345         dnl since aCC doesn't throw an error on invalid options,
2346         dnl we have to test this the hard way
2347         [ac_cv_hpux_usable_olit_option=no
2348         rm -f conftest*
2349         echo 'int main() { return 0; }' | cat > conftest.c
2350         ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2351         if test $? -eq 0; then
2352             if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2353                 ac_cv_hpux_usable_olit_option=yes
2354             fi
2355         fi
2356         rm -f conftest*
2357         ])
2359     if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2360         CFLAGS="$CFLAGS +Olit=all"
2361         CXXFLAGS="$CXXFLAGS +Olit=all"
2362     else
2363         CFLAGS="$CFLAGS +ESlit"
2364         CXXFLAGS="$CXXFLAGS +ESlit"
2365     fi
2368 esac
2371 dnl Apparently, some systems cannot properly check for the pthread
2372 dnl library unless <pthread.h> is included so we need to test
2373 dnl using it
2375 dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2376 AC_DEFUN(MOZ_CHECK_PTHREADS,
2378 AC_MSG_CHECKING([for pthread_create in -l$1])
2379 echo "
2380     #include <pthread.h> 
2381     void *foo(void *v) { return v; } 
2382     int main() { 
2383         pthread_t t;
2384         if (!pthread_create(&t, 0, &foo, 0)) {
2385             pthread_join(t, 0);
2386         }
2387         return 0;
2388     }" > dummy.c ;
2389     echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2390     ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2391     _res=$? ;
2392     rm -f dummy.c dummy${ac_exeext} ;
2393     if test "$_res" = "0"; then
2394         AC_MSG_RESULT([yes])
2395         [$2]
2396     else
2397         AC_MSG_RESULT([no])
2398         [$3]
2399     fi
2402 case "$target_os" in
2403 darwin*)
2404     _HAVE_PTHREADS=1
2405     ;;
2407     MOZ_CHECK_PTHREADS(pthreads,
2408         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2409         MOZ_CHECK_PTHREADS(pthread,
2410             _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2411             MOZ_CHECK_PTHREADS(c_r,
2412                 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2413                 MOZ_CHECK_PTHREADS(c,
2414                     _HAVE_PTHREADS=1
2415                 )
2416             )
2417         )
2418     )
2419     ;;
2420 esac
2422 AC_ARG_WITH(pthreads,
2423     [  --with-pthreads         Use system pthreads library as thread subsystem],
2424     [ if test "$withval" = "yes"; then
2425             if test -n "$_HAVE_PTHREADS"; then
2426                     USE_PTHREADS=1 
2427                     USE_USER_PTHREADS=
2428                     USE_NSPR_THREADS=
2429             else
2430                     AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2431             fi
2432           else
2433             USE_PTHREADS=
2434             _PTHREAD_LDFLAGS=
2435           fi],
2436         [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2437             USE_PTHREADS=1
2438             USE_USER_PTHREADS=
2439             USE_NSPR_THREADS=
2440           fi])
2442 AC_ARG_ENABLE(user-pthreads,
2443     [  --enable-user-pthreads  Build using userland pthreads],
2444     [ if test "$enableval" = "yes"; then
2445         if test -n "$_HAVE_PTHREADS"; then
2446                     USE_PTHREADS=
2447                     USE_USER_PTHREADS=1
2448                     USE_NSPR_THREADS=
2449             else
2450                     AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2451             fi
2452           fi])
2454 AC_ARG_ENABLE(nspr-threads,
2455     [  --enable-nspr-threads   Build using classic nspr threads],
2456     [ if test "$enableval" = "yes"; then
2457             USE_PTHREADS=
2458             USE_USER_PTHREADS=
2459             USE_NSPR_THREADS=1
2460           fi])
2462 case "$target" in
2463 *-beos*)
2464     AC_ARG_WITH(bthreads,
2465     [  --with-bthreads         Use system bthreads library as thread subsystem
2466                           (BeOS only)],
2467     [   if test "$withval" = "yes"; then
2468             USE_BTHREADS=1
2469                 USE_USER_PTHREADS=
2470                 USE_PTHREADS=
2471             fi])
2472     ;;
2473 esac
2475 fi # SKIP_LIBRARY_CHECKS
2477 AC_ARG_ENABLE(ipv6,
2478     [  --enable-ipv6           Compile ipv6 support],
2479     [ if test "$enableval" = "yes"; then
2480             USE_IPV6=1
2481       else
2482             USE_IPV6=
2483       fi])
2486 AC_ARG_ENABLE(boehm,
2487     [  --enable-boehm          Enable the Boehm Garbage Collector],
2488     [ if test "$enableval" = "yes"; then
2489         AC_DEFINE(GC_LEAK_DETECTOR)
2490         GC_LEAK_DETECTOR=1
2491     fi])
2493 if test -n "$USE_PTHREADS"; then
2494    dnl See if -pthread is supported.
2495    rm -f conftest*
2496    ac_cv_have_dash_pthread=no
2497    AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2498    echo 'int main() { return 0; }' | cat > conftest.c
2499    ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2500    if test $? -eq 0; then
2501         if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2502             ac_cv_have_dash_pthread=yes
2503                 case "$target_os" in
2504             freebsd*)
2505 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2506             ;;
2507             *)
2508             CFLAGS="$CFLAGS -pthread"
2509             CXXFLAGS="$CXXFLAGS -pthread"
2510             ;;
2511         esac
2512         fi
2513     fi
2514     rm -f conftest*
2515     AC_MSG_RESULT($ac_cv_have_dash_pthread)
2517         dnl
2518         dnl See if -pthreads is supported.
2519         dnl
2520     ac_cv_have_dash_pthreads=no
2521     if test "$ac_cv_have_dash_pthread" = "no"; then
2522             AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2523         echo 'int main() { return 0; }' | cat > conftest.c
2524             ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2525         if test $? -eq 0; then
2526                 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2527                             ac_cv_have_dash_pthreads=yes
2528                             CFLAGS="$CFLAGS -pthreads"
2529                             CXXFLAGS="$CXXFLAGS -pthreads"
2530                     fi
2531             fi
2532             rm -f conftest*
2533         AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2534     fi
2536     case "$target" in
2537     *-solaris*)
2538         if test "$ac_cv_have_dash_pthreads" = "yes"; then
2539             _PTHREAD_LDFLAGS=
2540         fi
2541             ;;
2542     *-freebsd*)
2543             AC_DEFINE(_REENTRANT)
2544             AC_DEFINE(_THREAD_SAFE)
2545             dnl -pthread links in -lc_r, so don't specify it explicitly.
2546             if test "$ac_cv_have_dash_pthread" = "yes"; then
2547                 _PTHREAD_LDFLAGS="-pthread"
2548             else
2549                 _PTHREAD_LDFLAGS="-lc_r"
2550             fi
2551             ;;
2552     *-netbsd*)
2553             if test "$ac_cv_have_dash_pthread" = "yes"; then
2554                 _PTHREAD_LDFLAGS="-pthread"
2555             fi
2556             ;;
2557     *-bsdi*)
2558             AC_DEFINE(_THREAD_SAFE)
2559             dnl -pthread links in -lc_r, so don't specify it explicitly.
2560             if test "$ac_cv_have_dash_pthread" = "yes"; then
2561                 _PTHREAD_LDFLAGS=
2562             fi
2563             ;;
2564     *-openbsd*)
2565         if test "$ac_cv_have_dash_pthread" = "yes"; then
2566             _PTHREAD_LDFLAGS=-pthread
2567         fi
2568         ;;
2569     *-linux*|*-gnu*|*-k*bsd*-gnu)
2570         AC_DEFINE(_REENTRANT)
2571         ;;
2572     esac
2574 else 
2575     if test -n "$USE_USER_PTHREADS"; then
2576             USE_PTHREADS=
2577             USE_NSPR_THREADS=
2578     else
2579         _PTHREAD_LDFLAGS=
2580     fi
2582 dnl Special thread exceptions
2584 case "$target" in
2585 *-aix*)
2586     if test -n "$USE_NSPR_THREADS"; then
2587         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2588     fi
2589     case "$target_os" in
2590     aix4.1*)
2591         if test -z "$USE_PTHREADS"; then
2592             AC_DEFINE(AIX_RENAME_SELECT)
2593         fi
2594         ;;
2595     aix4.2*)
2596         if test -z "$USE_NSPR_THREADS"; then
2597             AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2598         fi
2599         ;;
2600     aix4.3*)
2601         if test -z "$USE_NSPR_THREADS"; then
2602             AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2603         fi
2604         if test -n "$USE_PTHREADS"; then
2605             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2606         fi
2607         ;;
2608     *)
2609         if test -z "$USE_NSPR_THREADS"; then
2610             AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2611         fi
2612         if test -n "$USE_PTHREADS"; then
2613             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2614         fi
2615         ;;
2616     esac
2617     ;;
2618 *-bsdi*)
2619     if test -n "$USE_PTHREADS"; then
2620         AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2621     fi
2622     ;;
2623 *-freebsd*)
2624     if test -n "$USE_NSPR_THREADS"; then
2625         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2626     fi
2627     ;;
2628 *-hpux*)
2629     if test -n "$USE_NSPR_THREADS"; then
2630         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2631     fi 
2632     if test "$USE_PTHREADS"; then
2633         if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2634             AC_DEFINE(_REENTRANT)
2635             AC_DEFINE(_PR_DCETHREADS)
2636         else
2637             AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2638             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2639         fi
2640     fi
2641     if test "$USE_USER_PTHREADS"; then
2642         AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2643     fi
2644     ;;
2645 *-irix*)
2646     if test "${target_os}" = "irix6.5"; then
2647         if test -n "$USE_PTHREADS"; then
2648             AC_DEFINE(_PR_HAVE_GETHOST_R)
2649             AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2650         fi
2651     fi
2652     ;;
2653 *-linux*|*-gnu*|*-k*bsd*-gnu)
2654     if test -n "$USE_NSPR_THREADS"; then
2655         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2656     fi
2657     ;;
2658 *-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-winmo*|*-os2*|*-beos*)
2659     dnl win32, wince, os2 & beos cannot use pthreads
2660     USE_PTHREADS=
2661     _PTHREAD_LDFLAGS=
2662     USE_USER_PTHREADS=
2663     ;;
2664 *-netbsd*|*-openbsd*)
2665     if test -n "$USE_NSPR_THREADS"; then
2666         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2667     fi
2668     ;;
2669 *-osf*)
2670     if test -n "$USE_NSPR_THREADS"; then
2671         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2672     fi
2673     if test -n "$USE_PTHREADS"; then
2674         if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2675             :
2676         else
2677             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2678         fi
2679     fi
2680     ;;
2681 *-solaris*)
2682     if test -n "$USE_NSPR_THREADS"; then
2683         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2684     fi
2685     if test -n "$USE_PTHREADS"; then
2686         AC_DEFINE(_REENTRANT)
2687         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2688         if test "$OS_TEST" = "i86pc"; then
2689             if test -n "$USE_64"; then
2690                PR_MD_ASFILES=os_SunOS_x86_64.s
2691             else
2692                PR_MD_ASFILES=os_SunOS_x86.s
2693             fi
2694         else
2695             if test -n "$USE_64"; then
2696                 PR_MD_ASFILES=os_SunOS_sparcv9.s
2697             fi
2698         fi
2699     fi
2700     ;;
2701 *-nto*)
2702     if test -n "$USE_PTHREADS"; then
2703         AC_DEFINE(_PR_HAVE_GETHOST_R)
2704         AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2705     fi
2706     ;;
2707 esac
2709 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
2711 dnl If the user passed in arg to --enable-optimize or --enable-debug,
2712 dnl make sure that we use it.
2713 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
2714     _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
2717 if test -n "$_SAVE_DEBUG_FLAGS"; then
2718     _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
2721 if test -n "$MOZ_OPTIMIZE"; then
2722     CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
2723     CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
2726 if test -n "$MOZ_DEBUG"; then
2727     CFLAGS="$CFLAGS $_DEBUG_FLAGS"
2728     CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
2731 if test -n "$MOZ_OPTIMIZE"; then
2732     OBJDIR_TAG=_OPT
2733 else
2734     OBJDIR_TAG=_DBG
2737 if test -n "$USE_64"; then
2738     COMPILER_TAG=_64
2741 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
2743 dnl ========================================================
2744 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
2745 dnl ========================================================
2746 case "$target_os" in
2747 cygwin*|msvc*|mks*)
2748     CC="\$(CYGWIN_WRAPPER) $CC"
2749     CXX="\$(CYGWIN_WRAPPER) $CXX"
2750     RC="\$(CYGWIN_WRAPPER) $RC"
2751     ;;
2752 esac
2754 dnl ========================================================
2755 dnl Substitution of found variables.
2756 dnl ========================================================
2757 AC_SUBST(SHELL_OVERRIDE)
2759 AC_SUBST(MOZILLA_CLIENT)
2760 AC_SUBST(CC)
2761 AC_SUBST(CXX)
2762 AC_SUBST(CFLAGS)
2763 AC_SUBST(CXXFLAGS)
2764 AC_SUBST(CPPFLAGS)
2765 AC_SUBST(HOST_CC)
2766 AC_SUBST(HOST_CFLAGS)
2767 AC_SUBST(LDFLAGS)
2768 AC_SUBST(HOST_LDFLAGS)
2769 AC_SUBST(GNU_CC)
2770 AC_SUBST(GCC_USE_GNU_LD)
2771 AC_SUBST(MSC_VER)
2772 AC_SUBST(CROSS_COMPILE)
2774 AC_SUBST(MOZ_OPTIMIZE)
2776 AC_SUBST(USE_CPLUS)
2777 AC_SUBST(USE_IPV6)
2778 AC_SUBST(USE_N32)
2779 AC_SUBST(USE_64)
2780 AC_SUBST(OBJECT_MODE)
2781 AC_SUBST(GC_LEAK_DETECTOR)
2782 AC_SUBST(ENABLE_STRIP)
2784 AC_SUBST(USE_PTHREADS)
2785 AC_SUBST(USE_BTHREADS)
2786 AC_SUBST(USE_USER_PTHREADS)
2787 AC_SUBST(USE_NSPR_THREADS)
2789 AC_SUBST(LIBNSPR)
2790 AC_SUBST(LIBPLC)
2792 AC_SUBST(MOD_MAJOR_VERSION)
2793 AC_SUBST(MOD_MINOR_VERSION)
2794 AC_SUBST(MOD_PATCH_VERSION)
2795 AC_SUBST(NSPR_MODNAME)
2796 AC_SUBST(MDCPUCFG_H)
2797 AC_SUBST(PR_MD_CSRCS)
2798 AC_SUBST(PR_MD_ASFILES)
2799 AC_SUBST(PR_MD_ARCH_DIR)
2800 AC_SUBST(CPU_ARCH)
2802 AC_SUBST(OBJ_SUFFIX)
2803 AC_SUBST(LIB_SUFFIX)
2804 AC_SUBST(DLL_SUFFIX)
2805 AC_SUBST(ASM_SUFFIX)
2806 AC_SUBST(MKSHLIB)
2807 AC_SUBST(DSO_CFLAGS)
2808 AC_SUBST(DSO_LDOPTS)
2810 AC_SUBST(OS_TARGET)
2811 AC_SUBST(OS_ARCH)
2812 AC_SUBST(OS_RELEASE)
2813 AC_SUBST(OS_TEST)
2814 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2816 AC_SUBST(DEFINES)
2817 AC_SUBST(DEFS)
2818 AC_SUBST(AR)
2819 AC_SUBST(AR_FLAGS)
2820 AC_SUBST(AS)
2821 AC_SUBST(ASFLAGS)
2822 AC_SUBST(LD)
2823 AC_SUBST(RANLIB)
2824 AC_SUBST(PERL)
2825 AC_SUBST(STRIP)
2826 AC_SUBST(FILTER)
2827 AC_SUBST(IMPLIB)
2829 AC_SUBST(OS_LIBS)
2830 AC_SUBST(RESOLVE_LINK_SYMBOLS)
2831 AC_SUBST(AIX_LINK_OPTS)
2832 AC_SUBST(NOSUCHFILE)
2833 AC_SUBST(MOZ_OBJFORMAT)
2834 AC_SUBST(ULTRASPARC_LIBRARY)
2836 AC_SUBST(OBJDIR)
2837 AC_SUBST(OBJDIR_NAME)
2838 AC_SUBST(RELEASE_OBJDIR_NAME)
2839 AC_SUBST(NSINSTALL)
2840 AC_SUBST(OPTIMIZER)
2841 AC_SUBST(RC)
2842 AC_SUBST(RCFLAGS)
2843 AC_SUBST(DLLFLAGS)
2844 AC_SUBST(EXEFLAGS)
2845 AC_SUBST(OS_DLLFLAGS)
2846 AC_SUBST(CYGWIN_WRAPPER)
2847 AC_SUBST(VISIBILITY_FLAGS)
2848 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2849 AC_SUBST(MACOS_SDK_DIR)
2850 AC_SUBST(SYMBIAN_SDK_DIR)
2851 AC_SUBST(NEXT_ROOT)
2852 AC_SUBST(MT)
2854 dnl ========================================================
2855 dnl Generate output files.
2856 dnl ========================================================
2857 MAKEFILES="
2858 Makefile 
2859 config/Makefile
2860 config/autoconf.mk
2861 config/nsprincl.mk
2862 config/nsprincl.sh
2863 config/nspr-config
2864 lib/Makefile 
2865 lib/ds/Makefile 
2866 lib/libc/Makefile 
2867 lib/libc/include/Makefile 
2868 lib/libc/src/Makefile 
2869 lib/tests/Makefile
2870 pkg/Makefile
2871 pkg/linux/Makefile
2872 pkg/solaris/Makefile
2873 pkg/solaris/SUNWpr/Makefile
2874 pkg/solaris/SUNWprd/Makefile
2875 pr/Makefile 
2876 pr/include/Makefile 
2877 pr/include/md/Makefile 
2878 pr/include/obsolete/Makefile 
2879 pr/include/private/Makefile 
2880 pr/src/Makefile 
2881 pr/src/io/Makefile 
2882 pr/src/linking/Makefile 
2883 pr/src/malloc/Makefile 
2884 pr/src/md/Makefile 
2885 pr/src/md/${PR_MD_ARCH_DIR}/Makefile 
2886 pr/src/memory/Makefile 
2887 pr/src/misc/Makefile 
2888 pr/src/threads/Makefile 
2889 pr/tests/Makefile 
2890 pr/tests/dll/Makefile 
2893 dnl lib/tests/Makefile
2894 dnl pr/tests/w16gui/Makefile
2895 dnl tools/Makefile
2897 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
2898     MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
2899 elif test -n "$USE_PTHREADS"; then
2900     MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"
2901 elif test -n "$USE_BTHREADS"; then
2902     MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
2905 if test -n "$USE_CPLUS"; then
2906     MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
2909 echo $MAKEFILES > unallmakefiles
2911 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])