Bug 461269 - Remove TOK_RP nodes from the parse tree. r=brendan.
[mozilla-central.git] / nsprpub / configure.in
blob50cecd44a9ca7972a809451c522673a15cadfc3b
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=0
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*|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         darwin*)      OS_ARCH=Darwin ;;
652     esac
653 else
654     OS_ARCH=`uname -s | sed -e 's|/|_|g'`
655     OS_RELEASE=`uname -r`
656     OS_TEST=`uname -m`
659 if test "$OS_ARCH" = "IRIX64"; then
660     OS_ARCH=IRIX
663 if test "$OS_ARCH" = "AIX"; then
664     OS_RELEASE=`uname -v`.`uname -r`
667 if test "$OS_ARCH" = "FreeBSD"; then
668     OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
671 if test "$OS_ARCH" = "Linux"; then
672     OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
673     OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
676 #######################################################################
677 # Master "Core Components" macros for getting the OS target           #
678 #######################################################################
681 # Note: OS_TARGET should be specified on the command line for gmake.
682 # When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
683 # The difference between the Win95 target and the WinNT target is that
684 # the WinNT target uses Windows NT specific features not available
685 # in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
686 # at lesser performance (the Win95 target uses threads; the WinNT target
687 # uses fibers).
689 # If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
690 # cross-compilation.
694 # The following hack allows one to build on a WIN95 machine (as if
695 # s/he were cross-compiling on a WINNT host for a WIN95 target).
696 # It also accomodates for MKS's uname.exe.  If you never intend
697 # to do development on a WIN95 machine, you don't need this hack.
699 case "$OS_ARCH" in
700 WIN95)
701     OS_ARCH=WINNT
702     OS_TARGET=WIN95
703     ;;
704 Windows_95)
705     OS_ARCH=Windows_NT
706     OS_TARGET=WIN95
707     ;;
708 Windows_98)
709     OS_ARCH=Windows_NT
710     OS_TARGET=WIN95
711     ;;
712 CYGWIN_9*|CYGWIN_ME*)
713     OS_ARCH='CYGWIN_NT-4.0'
714     OS_TARGET=WIN95
715     ;;
716 OS_2)
717     OS_ARCH=OS2
718     OS_TARGET=OS2
719     ;;
720 esac
723 # On WIN32, we also define the variable CPU_ARCH.
726 case "$OS_ARCH" in
727 WINNT)
728     CPU_ARCH=`uname -p`
729     if test "$CPU_ARCH" = "I386"; then
730         CPU_ARCH=x86
731     fi
732     ;;
733 Windows_NT)
735 # If uname -s returns "Windows_NT", we assume that we are using
736 # the uname.exe in MKS toolkit.
738 # The -r option of MKS uname only returns the major version number.
739 # So we need to use its -v option to get the minor version number.
740 # Moreover, it doesn't have the -p option, so we need to use uname -m.
742     OS_ARCH=WINNT
743     OS_MINOR_RELEASE=`uname -v`
744     if test "$OS_MINOR_RELEASE" = "00"; then
745         OS_MINOR_RELEASE=0
746     fi
747     OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
748     CPU_ARCH=`uname -m`
749     #
750     # MKS's uname -m returns "586" on a Pentium machine.
751     #
752     if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
753         CPU_ARCH=x86
754     fi
755     ;;
756 CYGWIN_NT*|MINGW*_NT*)
758 # If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
759 # the uname.exe in the Cygwin tools.
760 # If uname -s returns MINGW32_NT-5.1, we assume that we are using
761 # the uname.exe in the MSYS tools.
763     OS_RELEASE=`expr $OS_ARCH : '.*NT-\(.*\)'`
764     OS_ARCH=WINNT
765     CPU_ARCH=`uname -m`
766     #
767     # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
768     #
769     if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
770         CPU_ARCH=x86
771     fi
772     ;;
773 esac
775 if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
776     OS_TARGET=WIN95
777     if test -n "$MOZ_DEBUG"; then
778         USE_DEBUG_RTL=1
779     fi
781 if test -z "$OS_TARGET"; then
782     OS_TARGET=$OS_ARCH
784 if test "$OS_TARGET" = "WIN95"; then
785     OS_RELEASE="4.0"
787 OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
789 dnl ========================================================
790 dnl Enable high-memory support on OS/2 by default.
791 dnl ========================================================
792 AC_ARG_ENABLE(os2-high-mem,
793     [  --disable-os2-high-mem  Disable high-memory support on OS/2],
794     [ if test "$enableval" = "no"; then
795         MOZ_OS2_HIGH_MEMORY=
796       else
797         MOZ_OS2_HIGH_MEMORY=1
798       fi ])
800 dnl ========================================================
801 dnl Override of system specific host options
802 dnl ========================================================
803 case "$host" in
804 *-mingw*)
805     NSINSTALL=nsinstall
806     ;;
807 *-cygwin*|*-msvc*|*-mks*|*-wince*)
808     NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
809     if test `echo "${PATH}" | grep -c \;` = 0; then
810         CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
811     fi
812     ;;
813 *-beos*)
814     HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
815     ;;
816 *os2*)
817     ;;
819     HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
820     ;;
821 esac
823 dnl ========================================================
824 dnl Override of system specific target options
825 dnl ========================================================
826 case "$target" in
828 *-aix*)
829     AC_DEFINE(XP_UNIX)
830     AC_DEFINE(AIX)
831     AC_DEFINE(SYSV)
832     DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
833     AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
834     case "${target_os}" in
835     aix3.2*)
836         AC_DEFINE(AIX_RENAME_SELECT)
837         AC_DEFINE(_PR_NO_LARGE_FILES)
838         AIX_LINK_OPTS='-bnso -berok'
839         PR_MD_ASFILES=os_AIX.s
840         ;;
841     aix4.1*)
842         AC_DEFINE(AIX_TIMERS)
843         AC_DEFINE(_PR_NO_LARGE_FILES)
844         AC_DEFINE(AIX4_1)
845         MKSHLIB=
846         DSO_LDOPTS=
847         AIX_LINK_OPTS='-bnso -berok'
848         LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
849         LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
850         ;;
851     aix4.2*)
852         AC_DEFINE(AIX_TIMERS)
853         AC_DEFINE(_PR_HAVE_OFF64_T)
854         AIX_LINK_OPTS='-brtl -bnso -berok'
855         ;;
856     aix4.3*)
857         AC_DEFINE(AIX_TIMERS)
858         AC_DEFINE(_PR_HAVE_OFF64_T)
859         AC_DEFINE(AIX4_3_PLUS)
860         AC_DEFINE(HAVE_SOCKLEN_T)
861         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
862         USE_IPV6=1
863         AIX_LINK_OPTS='-brtl -bnso -berok'
864         ;;
865     *)
866         AC_DEFINE(AIX_TIMERS)
867         AC_DEFINE(_PR_HAVE_OFF64_T)
868         AC_DEFINE(AIX4_3_PLUS)
869         AC_DEFINE(HAVE_SOCKLEN_T)
870         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
871         USE_IPV6=1
872         AIX_LINK_OPTS='-brtl -bnso -berok'
873         ;;
874     esac
875     CFLAGS="$CFLAGS -qro -qroconst"
876     AIX_WRAP='$(DIST)/lib/aixwrap.o'
877     AIX_TMP='./_aix_tmp.o'
878     if test -n "$USE_64"; then
879         MDCPUCFG_H=_aix64.cfg
880         OBJECT_MODE=64
881     else
882         MDCPUCFG_H=_aix32.cfg
883     fi
884     PR_MD_CSRCS=aix.c
885     RESOLVE_LINK_SYMBOLS=1
886     ;;
887         
888 *-beos*)
889     AC_DEFINE(XP_BEOS)
890     AC_DEFINE(BeOS)
891     AC_DEFINE(BEOS)
892     AC_DEFINE(_POSIX_SOURCE)
893     DSO_LDOPTS=-nostart
894     MDCPUCFG_H=_beos.cfg
895     USE_BTHREADS=1
896     PR_MD_ARCH_DIR=beos
897     RESOLVE_LINK_SYMBOLS=1
898     case "${target_cpu}" in
899     i*86)
900         _OPTIMIZE_FLAGS=-O2
901         _DEBUG_FLAGS='-gdwarf-2 -O0'
902         MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
903         AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
904         ;;
905     powerpc)
906         CC=mwcc
907         CCC=mwcc
908         LD=mwld
909         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'
910         _OPTIMIZE_FLAGS=-O2    
911         _DEBUG_FLAGS='-g -O0'
912         ;;
913     esac
914     ;;
916 *-bsdi*)
917     AC_DEFINE(XP_UNIX)
918     AC_DEFINE(BSDI)
919     AC_DEFINE(NEED_BSDREGEX)
921     CFLAGS="$CFLAGS -Wall -Wno-format"
922     CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
924     if echo "$OS_TEST" | grep -c 86 >/dev/null; then
925         CPU_ARCH=x86
926     elif echo "$OS_TEST" | grep -c sparc >/dev/null; then 
927         CPU_ARCH=sparc
928     fi
930     MDCPUCFG_H=_bsdi.cfg
931     PR_MD_CSRCS=bsdi.c
933     DSO_LDOPTS=-r
935     case "$target_os" in
936     bsdi1.1*)
937         AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
938         AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
939         AC_DEFINE(_PR_NEED_H_ERRNO)
940         MKSHLIB=
941         DSO_CFLAGS=
942         DSO_LDOPTS=
943         ;;
945     bsdi2.1*)
946         AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
947         AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
948         AC_DEFINE(HAVE_DLL)
949         AC_DEFINE(USE_DLFCN)
950         AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
951         PR_MD_ASFILES=os_BSD_OS_386_2.s
952         ;;
954     bsdi4.* | bsdi5.*)
955         AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
956         AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
957         AC_DEFINE(HAVE_DLL)
958         AC_DEFINE(USE_DLFCN)
959         AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
960         MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
961         DSO_CFLAGS=-fPIC
962         DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
963         STRIP="$STRIP -d"
964         case "$target_os" in
965         bsdi4.2* | bsdi4.3* | bsdi5.*)
966             AC_DEFINE(_PR_HAVE_GETPROTO_R)
967             AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
968             ;;
969         esac
970         ;;
971     *)
972         AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
973         AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
974         AC_DEFINE(HAVE_DLL)
975         AC_DEFINE(USE_DLFCN)
976         AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
977         ;;
978     esac
980     ;;
982 *-darwin*)
983     AC_DEFINE(XP_UNIX)
984     AC_DEFINE(DARWIN)
985     AC_DEFINE(HAVE_BSD_FLOCK)
986     AC_DEFINE(HAVE_SOCKLEN_T)
987     AS='$(CC) -x assembler-with-cpp'
988     CFLAGS="$CFLAGS -Wall -fno-common"
989     case "${target_cpu}" in
990         i*86*)
991             if test -n "$USE_64"; then
992                 CPU_ARCH=x86_64
993                 CC="$CC -arch x86_64"
994             else        
995                 CPU_ARCH=i386
996             fi
997             ;;
998         *)
999             CPU_ARCH=ppc
1000             ;;
1001     esac
1002     DSO_CFLAGS=-fPIC
1003     DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
1004     _OPTIMIZE_FLAGS=-O2
1005     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1006     STRIP="$STRIP -x -S"
1007     DLL_SUFFIX=dylib
1008     USE_PTHREADS=1
1009     MDCPUCFG_H=_darwin.cfg
1010     PR_MD_CSRCS=darwin.c
1011     PR_MD_ASFILES=os_Darwin.s
1013     # Add Mac OS X support for loading CFM & CFBundle plugins
1014     if test -f /System/Library/Frameworks/Carbon.framework/Carbon; then
1015         AC_DEFINE(XP_MACOSX)
1016         OS_TARGET=MacOSX
1018         if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
1019             dnl Use the specified value
1020             export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
1021         elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
1022             dnl No value specified on the command line or in the environment,
1023             dnl use the lesser of the library's minimum or the architecture's
1024             dnl minimum.
1025             case "${target_cpu}" in
1026                 powerpc*)
1027                     dnl Architecture minimum 10.2
1028                     export MACOSX_DEPLOYMENT_TARGET=10.2
1029                     ;;
1030                 i*86*)
1031                     dnl Architecture minimum 10.4
1032                     export MACOSX_DEPLOYMENT_TARGET=10.4
1033                     ;;
1034             esac
1035         fi
1037         dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
1038         dnl in use.  NEXT_ROOT will be set and exported if it's needed for
1039         dnl ld.
1041         if test "$MACOS_SDK_DIR"; then
1042             dnl Sync this section with the one in Mozilla's top level.
1044             if test ! -d "$MACOS_SDK_DIR"; then
1045                 AC_MSG_ERROR([SDK not found.  When using --with-macos-sdk, you must
1046 specify a valid SDK.  SDKs are installed when the optional cross-development
1047 tools are selected during the Xcode/Developer Tools installation.])
1048             fi
1050             changequote(,)
1051             CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
1052             GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
1053             GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
1054             changequote([,])
1055             GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
1056             if test "$GCC_VERSION_MAJOR" -lt "4" ; then
1057                 SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
1058                 if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
1059                     SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
1060                 fi
1062                 SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
1064                 CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
1066                 dnl CPP needs to be set for AC_CHECK_HEADER.
1067                 CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
1069                 changequote(,)
1070                 HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
1071                 changequote([,])
1072                 if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
1073                     dnl The build host is running Tiger (10.4) or earlier.
1074                     dnl ld support for -syslibroot is compiler-agnostic, but
1075                     dnl only available on Tiger and later.  On Tiger and
1076                     dnl earlier build hosts, just rely on NEXT_ROOT, because
1077                     dnl it's not been shown to cause any problems.
1078                     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}"
1079                 else
1080                     dnl The build host is running Leopard (10.5) or later.
1081                     dnl With NEXT_ROOT set, the linker will still not apply
1082                     dnl it when resolving dependencies.  This causes problems
1083                     dnl on Leopard, where an SDK depends on frameworks which
1084                     dnl were present in earlier OS releases (and the associated
1085                     dnl SDK) but not in Leopard.  -syslibroot does not have
1086                     dnl this problem, but it results in harmless warnings when
1087                     dnl NEXT_ROOT is set.  NEXT_ROOT needs to remain set even
1088                     dnl on Leopard because the compiler uses it too.
1089                     MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
1090                 fi
1092                 LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
1093                 export NEXT_ROOT=$MACOS_SDK_DIR
1095                 if test -n "$CROSS_COMPILE" ; then
1096                     dnl NEXT_ROOT will be in the environment, but it
1097                     dnl shouldn't be set for the build host.  HOST_CXX is
1098                     dnl presently unused.
1099                     HOST_CC="NEXT_ROOT= $HOST_CC"
1100                     HOST_CXX="NEXT_ROOT= $HOST_CXX"
1101                 fi
1102             else
1103                 dnl gcc >= 4.0 uses different paths than above, but knows
1104                 dnl how to find them itself.
1105                 CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
1107                 dnl CPP needs to be set for AC_CHECK_HEADER.
1108                 CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
1110                 dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
1111                 dnl has an ld that supports -syslibroot.  Don't set
1112                 dnl NEXT_ROOT because it will be ignored and cause
1113                 dnl warnings when -syslibroot is specified.
1114                 if test "$GCC_VERSION_FULL" != "4.0.0" ; then
1115                     dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
1116                     dnl based on the -isysroot it receives.
1117                     LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
1118                 else
1119                     dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
1120                     dnl to be explicit.
1121                     LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
1122                 fi
1123             fi
1124         fi
1125     fi
1126     ;;
1128 *-dgux*)
1129     AC_DEFINE(XP_UNIX)
1130     AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
1131     AC_DEFINE(SVR4)
1132     AC_DEFINE(SYSV)
1133     AC_DEFINE(DGUX)
1134     AC_DEFINE(_DGUX_SOURCE)
1135     AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
1136     DSO_LDOPTS=-G
1137     _OPTIMIZE_FLAGS=-O2
1138     _DEBUG_FLAGS=
1139     MDCPUCFG_H=_dgux.cfg
1140     PR_MD_CSRCS=dgux.c
1141     ;;
1143 *-freebsd*)
1144     if test -z "$USE_NSPR_THREADS"; then
1145         USE_PTHREADS=1
1146     fi
1147     AC_DEFINE(XP_UNIX)
1148     AC_DEFINE(FREEBSD)
1149     AC_DEFINE(HAVE_BSD_FLOCK)
1150     AC_DEFINE(HAVE_SOCKLEN_T)
1151     CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
1152     MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo elf`
1153     if test "$MOZ_OBJFORMAT" = "elf"; then
1154         DLL_SUFFIX=so
1155     else
1156         DLL_SUFFIX=so.1.0
1157     fi
1158     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1159     DSO_CFLAGS=-fPIC
1160     DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1161     MDCPUCFG_H=_freebsd.cfg
1162     PR_MD_CSRCS=freebsd.c
1163     ;;
1165 *-hpux*)
1166     AC_DEFINE(XP_UNIX)
1167     AC_DEFINE(HPUX)
1168     AC_DEFINE(_HPUX_SOURCE)
1169     # OSF1 and HPUX report the POLLHUP event for a socket when the
1170     # shutdown(SHUT_WR) operation is called for the remote end, even though
1171     # the socket is still writeable. Use select(), instead of poll(), to
1172     # workaround this problem.
1173     AC_DEFINE(_PR_POLL_WITH_SELECT)
1174     AC_DEFINE(_USE_BIG_FDS)
1175     DSO_LDOPTS='-b +h $(notdir $@)'
1176     PR_MD_CSRCS=hpux.c
1177     if test "$OS_TEST" = "ia64"; then
1178         DLL_SUFFIX=so
1179         DSO_LDOPTS="$DSO_LDOPTS +b '\$\$ORIGIN'"
1180         CPU_ARCH_TAG=_$OS_TEST 
1181         if test -z "$USE_64"; then
1182             COMPILER_TAG=_32
1183         fi
1184         PR_MD_ASFILES=os_HPUX_ia64.s
1185     else
1186         AC_DEFINE(hppa)
1187         DLL_SUFFIX=sl
1188         PR_MD_ASFILES=os_HPUX.s
1189     fi
1190     if test -n "$USE_64"; then
1191         MDCPUCFG_H=_hpux64.cfg
1192     else
1193         MDCPUCFG_H=_hpux32.cfg
1194     fi
1195     if test -z "$GNU_CC"; then
1196         CC="$CC -Ae"
1197         CXX="$CXX -ext"
1198         DSO_CFLAGS=+Z
1199     else
1200         DSO_CFLAGS=-fPIC
1201     fi
1203     if test -n "$MOZILLA_CLIENT"; then
1204         DEFAULT_IMPL_STRATEGY=_EMU
1205     fi
1207     if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
1208         AC_DEFINE(_PR_NEED_H_ERRNO)
1209         AC_DEFINE(HPUX9)
1210         DEFAULT_IMPL_STRATEGY=_EMU
1211         USE_NSPR_THREADS=1
1212     fi
1214     if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
1215         AC_DEFINE(_PR_NO_LARGE_FILES)
1216     fi
1218     if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1219         AC_DEFINE(_PR_NEED_H_ERRNO)
1220     fi
1222     if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
1223         AC_DEFINE(HAVE_INT_LOCALTIME_R)
1224     fi
1226     if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
1227         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1228     fi
1230     # HP-UX 11i v2 (B.11.23) or higher
1231     changequote(<<,>>)
1232     case "$OS_RELEASE" in
1233     [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[3-9]*|B.11.2[3-9]*)
1234         USE_IPV6=1
1235         ;;
1236     esac
1237     changequote([,])
1239     if test "$OS_RELEASE" = "B.10.01"; then
1240         AC_DEFINE(HPUX10)
1241         DEFAULT_IMPL_STRATEGY=_EMU
1242     fi
1244     if test "$OS_RELEASE" = "B.10.10"; then
1245         AC_DEFINE(HPUX10)
1246         AC_DEFINE(HPUX10_10)
1247         DEFAULT_IMPL_STRATEGY=_PTH
1248     fi
1250     if test "$OS_RELEASE" = "B.10.20"; then
1251         AC_DEFINE(HPUX10)
1252         AC_DEFINE(HPUX10_20)
1253         if test -z "$GNU_CC"; then
1254             CFLAGS="$CFLAGS +DAportable +DS1.1"
1255             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1256         fi
1257         DEFAULT_IMPL_STRATEGY=_PTH
1258     fi
1260     if test "$OS_RELEASE" = "B.10.30"; then
1261         AC_DEFINE(HPUX10)
1262         AC_DEFINE(HPUX10_30)
1263         if test -z "$GNU_CC"; then
1264             CFLAGS="$CFLAGS +DAportable +DS1.1"
1265             CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1266         fi
1267         DEFAULT_IMPL_STRATEGY=_PTH
1268     fi
1270     if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1271         AC_DEFINE(HPUX10)
1272         AC_DEFINE(HPUX11)
1273         AC_DEFINE(_LARGEFILE64_SOURCE)
1274         AC_DEFINE(_PR_HAVE_OFF64_T)
1275         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1276         if test -z "$GNU_CC"; then
1277             if test -z "$USE_64"; then
1278                 if test "$OS_TEST" = "ia64"; then
1279                     CFLAGS="$CFLAGS +DD32"
1280                     CXXFLAGS="$CXXFLAGS +DD32"
1281                 else
1282                     CFLAGS="$CFLAGS +DAportable +DS2.0"
1283                     CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1284                 fi
1285             else
1286                 if test "$OS_TEST" = "ia64"; then
1287                     CFLAGS="$CFLAGS +DD64"
1288                     CXXFLAGS="$CXXFLAGS +DD64"
1289                 else
1290                     CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1291                     CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1292                 fi
1293             fi
1294         fi
1295         DEFAULT_IMPL_STRATEGY=_PTH
1296     fi
1298     if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1299         USE_NSPR_THREADS=1
1300         USE_PTHREADS=
1301         USE_USER_PTHREADS=
1302     elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1303         USE_PTHREADS=1
1304         if test "$USE_NSPR_THREADS"; then
1305             USE_PTHREADS=
1306         fi
1307         if test "$USE_USER_PTHREADS"; then
1308             USE_PTHREADS=
1309         fi
1310     fi
1311     ;;
1313 *-irix*)
1314     AC_DEFINE(XP_UNIX)
1315     AC_DEFINE(IRIX)
1316     AC_DEFINE(SVR4)
1317     AC_DEFINE(_SGI_MP_SOURCE)
1318     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1319     PR_MD_CSRCS=irix.c
1320     PR_MD_ASFILES=os_Irix.s
1321     MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1322     STRIP="$STRIP -f"
1323     RESOLVE_LINK_SYMBOLS=1
1324     if test -n "$USE_64"; then
1325         MDCPUCFG_H=_irix64.cfg
1326     else
1327         MDCPUCFG_H=_irix32.cfg
1328     fi
1329     case "${target_os}" in
1330     irix6*)
1331         AC_DEFINE(IRIX6)
1332         USE_PTHREADS=1
1333         USE_N32=1
1334         COMPILER_TAG=_n32
1335         IMPL_STRATEGY=_PTH
1336         ;;
1337     irix5*)
1338         AC_DEFINE(IRIX5)
1339         USE_NSPR_THREADS=1
1340         ;;
1341     *)
1342         USE_PTHREADS=1
1343         USE_N32=1
1344         ;;
1345     esac
1346     if test "$GNU_CC"; then
1347         dnl
1348         dnl If we are using gcc with native binutils, we need to
1349         dnl suppress the
1350         dnl #lineno "filename" num num
1351         dnl lines, which confuse IRIX native as.  Add -Wp,-P to the
1352         dnl gcc command line, which passes -P to the preprocessor.
1353         dnl
1354             AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1355             CFLAGS="$CFLAGS -Wall -Wno-format"
1356             _OPTIMIZE_FLAGS="-O6"
1357     else
1358             if test -n "$USE_N32"; then
1359                 AS='as -D_ASM $(INCLUDES) -n32'
1360             else
1361                 AS='as -D_ASM $(INCLUDES)'
1362             fi
1363             CFLAGS="$CFLAGS -fullwarn -xansi"
1364             if test "$USE_N32"; then
1365                 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1366             else
1367                 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1368             fi
1369             if test "$USE_MDUPDATE"; then
1370                 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1371             fi
1372             case "${target}" in
1373             *-irix6.*)
1374                 CFLAGS="$CFLAGS -multigot"
1375                 DSO_LDOPTS="-no_unresolved"
1376                 if test "$USE_N32"; then
1377                         CFLAGS="$CFLAGS -n32 -woff 1209"
1378                         DSO_LDOPTS="$DSO_LDOPTS -n32"
1379                 else
1380                         if test "$USE_64"; then
1381                             CFLAGS="$CFLAGS -64"
1382                         else
1383                             CFLAGS="$CFLAGS -32"
1384                         fi
1385                 fi
1386                 ;;
1387             *)
1388                 CFLAGS="$CFLAGS -xgot"
1389                 ;;
1390             esac
1391     fi
1392     if test "${target_os}" = "irix5.3"; then
1393             AC_DEFINE(IRIX5_3)
1394     fi
1395     case "${target_os}" in
1396         irix6.5)
1397             if test -z "$GNU_CC"; then
1398                     CFLAGS="$CFLAGS -mips3"
1399             fi
1400             AC_DEFINE(_PR_HAVE_GETPROTO_R)
1401             AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1402             AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1403             ;;
1404         irix5*)
1405             ;;
1406         *)
1407             AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1408             ;;
1409         esac
1410     ;;
1412 *-linux*|*-gnu*|*-k*bsd*-gnu)
1413     if test -z "$USE_NSPR_THREADS"; then
1414         USE_PTHREADS=1
1415         IMPL_STRATEGY=_PTH
1416     fi
1417     AC_DEFINE(XP_UNIX)
1418     AC_DEFINE(_GNU_SOURCE)
1419     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1420     case "${target_os}" in
1421     linux*)
1422         AC_DEFINE(LINUX)
1423         ;;
1424     esac
1425     CFLAGS="$CFLAGS -Wall"
1426     CXXFLAGS="$CXXFLAGS -Wall"
1427     MDCPUCFG_H=_linux.cfg
1428     PR_MD_CSRCS=linux.c
1429     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1430     DSO_CFLAGS=-fPIC
1431     DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1432     _OPTIMIZE_FLAGS=-O2
1433     _DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb, and that
1434                                    # combo is not yet good at debugging inlined
1435                                    # functions (even when using DWARF2 as the
1436                                    # debugging format)
1437     COMPILER_TAG=_glibc
1438     if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1439         CPU_ARCH=x86
1440     else
1441         CPU_ARCH=$OS_TEST
1442     fi
1443     CPU_ARCH_TAG=_${CPU_ARCH}
1444     case "${target_cpu}" in
1445     alpha)
1446         AC_DEFINE(_ALPHA_)
1447         AC_DEFINE(__alpha)
1448         CFLAGS="$CFLAGS -mieee"
1449         CXXFLAGS="$CXXFLAGS -mieee"
1450         ;;
1451     i*86)
1452         AC_DEFINE(i386)
1453         PR_MD_ASFILES=os_Linux_x86.s
1454         ;;
1455     ia64)
1456         PR_MD_ASFILES=os_Linux_ia64.s
1457         ;;
1458     x86_64)
1459         if test -n "$USE_64"; then
1460             PR_MD_ASFILES=os_Linux_x86_64.s
1461         else
1462             AC_DEFINE(i386)
1463             PR_MD_ASFILES=os_Linux_x86.s
1464             CC="$CC -m32"
1465             CXX="$CXX -m32"
1466         fi
1467         ;;
1468     ppc|powerpc)
1469         PR_MD_ASFILES=os_Linux_ppc.s
1470         ;;
1471     powerpc64)
1472         if test -n "$USE_64"; then
1473             CC="$CC -m64"
1474             CXX="$CXX -m64"
1475         else
1476             PR_MD_ASFILES=os_Linux_ppc.s
1477         fi
1478         ;;
1479     m68k)
1480         CFLAGS="$CFLAGS -m68020-60"
1481         CXXFLAGS="$CXXFLAGS -m68020-60"
1482         ;;
1483     esac    
1484     ;;
1486 *-mingw*|*-cygwin*|*-msvc*|*-mks*)
1487     AC_DEFINE(XP_PC)
1488     AC_DEFINE(WIN32)
1489     PR_MD_ARCH_DIR=windows
1490     RESOLVE_LINK_SYMBOLS=1
1492     if test -n "$GNU_CC"; then
1493         CC="$CC -mno-cygwin"
1494         CXX="$CXX -mno-cygwin"
1495         DLL_SUFFIX=dll
1496         MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1497         RC=$WINDRES
1498         # Use temp file for windres (bug 213281)
1499         RCFLAGS='-O coff --use-temp-file'
1500     else
1501         CC=cl
1502         CXX=cl
1503         LD=link
1504         AR='lib -NOLOGO -OUT:"$@"'
1505         AR_FLAGS=
1506         RANLIB='echo not_ranlib'
1507         STRIP='echo not_strip'
1508         RC=rc.exe
1509         GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1510         OBJ_SUFFIX=obj
1511         LIB_SUFFIX=lib
1512         DLL_SUFFIX=dll
1514         # Determine compiler version
1515         CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'`
1516         _CC_MAJOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $1 }'`
1517         _CC_MINOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $2 }'`
1518         MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1520         # Ensure that mt is Microsoft (R) Manifest Tool and not magnetic
1521         # tape manipulation utility (or something else)
1522         if test "$MSC_VER" -ge "1400"; then
1523             changequote(,)
1524             _MSMT_VER_FILTER='s|.* \([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*|\1|p'
1525             changequote([,])
1527             MSMT_TOOL=`mt 2>&1|grep 'Microsoft (R) Manifest Tool'`
1528             if test -n "$MSMT_TOOL"; then
1529                 MSMANIFEST_TOOL_VERSION=`echo ${MSMT_TOOL}|sed -ne "$_MSMT_VER_FILTER"`
1530                 if test -z "$MSMANIFEST_TOOL_VERSION"; then
1531                     AC_MSG_WARN([Unknown version of the Microsoft (R) Manifest Tool.])
1532                 fi
1533                 MT=mt
1534                 unset MSMT_TOOL
1535             else
1536                 AC_MSG_ERROR([Microsoft (R) Manifest Tool must be in your \$PATH.])
1537             fi
1538         fi
1539         
1540         CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1541         DLLFLAGS="$DLLFLAGS -OUT:\"\$@\""
1542         _DEBUG_FLAGS=-Z7
1543         _OPTIMIZE_FLAGS=-O2
1544         if test -z "$MOZ_OPTIMIZE"; then
1545             CFLAGS="$CFLAGS -Od"
1546         fi
1548         if test -n "$USE_DEBUG_RTL"; then
1549             CFLAGS="$CFLAGS -MDd"
1550         else
1551             CFLAGS="$CFLAGS -MD"
1552         fi
1554         if test -n "$MOZ_DEBUG"; then
1555             AC_DEFINE(_DEBUG)
1556         else
1557             DEFINES="$DEFINES -U_DEBUG"
1558         fi
1560         if test -n "$MOZ_OPTIMIZE"; then
1561             if test -n "$MOZ_DEBUG_SYMBOLS"; then
1562                 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Zi"
1563                 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1564                 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1565             fi
1566         fi
1568         if test -n "$MOZ_DEBUG"; then
1569             DLLFLAGS="$DLLFLAGS -DEBUG"
1570             LDFLAGS="$LDFLAGS -DEBUG"
1571         fi
1573         OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1574         if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1575             OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
1576         fi
1577         
1578         if test "$OS_TARGET" = "WINNT"; then
1579             CFLAGS="$CFLAGS -GT"
1580             LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1581             LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1582         else
1583             LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1584             LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1585         fi
1586     fi # GNU_CC
1588     if test -n "$USE_STATIC_TLS"; then
1589         AC_DEFINE(_PR_USE_STATIC_TLS)
1590     fi
1592     if test "$OS_TARGET" = "WINNT"; then
1593         AC_DEFINE(WINNT)
1594     else
1595         AC_DEFINE(WIN95)
1596         # undefine WINNT as some versions of mingw gcc define it by default
1597         DEFINES="$DEFINES -UWINNT"
1598         AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1599     fi
1601     if test "$CPU_ARCH" = "x86"; then
1602         CPU_ARCH_TAG=
1603     else
1604         CPU_ARCH_TAG=$CPU_ARCH
1605     fi
1607     if test -n "$USE_DEBUG_RTL"; then
1608         OBJDIR_SUFFIX=OBJD
1609     fi
1611     case "$OS_TARGET" in
1612     WINNT)
1613             MDCPUCFG_H=_winnt.cfg
1614             ;;
1615     WIN95)
1616             MDCPUCFG_H=_win95.cfg
1617             ;;
1618     *)
1619             AC_MSG_ERROR([Missing OS_TARGET for ${target}.  Use --enable-win32-target to set.])
1620         ;;
1621     esac
1623     case "$target_cpu" in
1624     i*86)
1625         if test -n "$USE_64"; then
1626             AC_DEFINE(_AMD64_)
1627             AC_DEFINE(_M_AMD64)    
1628         else            
1629             AC_DEFINE(_X86_)
1630         fi
1631         ;;
1632     alpha)
1633             AC_DEFINE(_ALPHA_)
1634             ;;
1635     mips)
1636             AC_DEFINE(_MIPS_)
1637             ;;
1638     x86_64)
1639             AC_DEFINE(_AMD64_)
1640             AC_DEFINE(_M_AMD64)
1641             USE_64=1
1642             ;;
1643     ia64)
1644             AC_DEFINE(_IA64_)
1645             AC_DEFINE(_M_IA64)
1646             USE_64=1
1647             ;;
1648     *)
1649             AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
1650             ;;
1651     esac
1653     if test "$USE_64"; then
1654         AC_DEFINE(_WIN64)
1655     fi
1657     ;;
1659 *-wince*)
1660     AC_DEFINE(XP_PC)
1661     AC_DEFINE(WIN32)
1662     AC_DEFINE(WINCE)
1663     AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1665     AR='lib -NOLOGO -OUT:"$@"'
1666     AR_FLAGS=
1668     OBJ_SUFFIX=obj
1669     LIB_SUFFIX=lib
1670     DLL_SUFFIX=dll
1671     MKSHLIB='$(LD) -DLL $(DSO_LDOPTS) -OUT:$@'
1673     PR_MD_ARCH_DIR=windows
1674     RESOLVE_LINK_SYMBOLS=1
1676     MDCPUCFG_H=_win95.cfg
1677     LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1678     LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1680     DLLFLAGS='-OUT:"$@"'
1681     if test -n "$MOZ_DEBUG_SYMBOLS"; then
1682         OS_LDFLAGS=-DEBUG -DEBUGTYPE:CV
1683         OS_DLLFLAGS=-DEBUG -DEBUGTYPE:CV
1684         DSO_LDOPTS=-DEBUG -DEBUGTYPE:CV
1685     fi
1686     _DEBUG_FLAGS=-Zi
1687     ;;
1689 *-ncr-sysv*)
1690     AC_DEFINE(XP_UNIX)
1691     AC_DEFINE(SVR4)
1692     AC_DEFINE(SYSV)
1693     AC_DEFINE(NCR)
1694     USE_NSPR_THREADS=1
1695     if test "$OS_RELEASE" = "2.03"; then
1696         AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
1697     else
1698         AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
1699     fi
1701     if test -z "$GNU_CC"; then
1702         CFLAGS="$CFLAGS -Hnocopyr"
1703         CXXFLAGS="$CXXFLAGS -Hnocopyr"
1704     else
1705         CFLAGS="$CFLAGS -fPIC -Wall"
1706         CXXFLAGS="$CXXFLAGS -fPIC -Wall"
1707         DSO_LDOPTS=-G
1708     fi
1709     MDCPUCFG_H=_ncr.cfg
1710     PR_MD_CSRCS=ncr.c
1711     ;;
1713 mips-nec-sysv*)
1714     AC_DEFINE(XP_UNIX)
1715     AC_DEFINE(SVR4)
1716     AC_DEFINE(__SVR4)
1717     AC_DEFINE(NEC)
1718     AC_DEFINE(nec_ews)
1719     USE_NSPR_THREADS=1
1720     if test -z "$GNU_CC"; then
1721         CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
1722         CXX=g++
1723     fi
1724     OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
1725     DSO_LDOPTS=-G
1726     MDCPUCFG_H=_nec.cfg
1727     PR_MD_CSRCS=nec.c
1728     ;;
1730 *-netbsd*)
1731     AC_DEFINE(XP_UNIX)
1732     AC_DEFINE(NETBSD)
1733     AC_DEFINE(HAVE_BSD_FLOCK)
1734     if test -z "$USE_NSPR_THREADS"; then
1735         USE_PTHREADS=1
1736     fi
1737     MDCPUCFG_H=_netbsd.cfg
1738     PR_MD_CSRCS=netbsd.c
1740     DSO_CFLAGS='-fPIC -DPIC'
1741     CFLAGS="$CFLAGS -ansi -Wall"
1742     CXXFLAGS="$CXXFLAGS -ansi -Wall"
1743     MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1745     if test -z "$OBJECT_FMT"; then
1746         if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
1747             OBJECT_FMT=a.out
1748             DLL_SUFFIX=so.1.0
1749             DSO_LDOPTS='-shared'
1750         else
1751             OBJECT_FMT=ELF
1752             DLL_SUFFIX=so
1753             DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
1754         fi
1755     fi
1757     if test "$LIBRUNPATH"; then
1758         DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
1759     fi
1760     ;;
1762 mips-sony-newsos*)
1763     AC_DEFINE(XP_UNIX)
1764     AC_DEFINE(SONY)
1765     AC_DEFINE(SYSV)
1766     AC_DEFINE(SVR4)
1767     AC_DEFINE(__svr4)
1768     AC_DEFINE(__svr4__)
1769     AC_DEFINE(HAVE_SVID_GETTOD)
1770     USE_NSPR_THREADS=1
1771     CFLAGS="$CFLAGS -Xa -fullwarn"
1772     CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
1773     DSO_LDOPTS=-G
1774     MDCPUCFG_H=_sony.cfg
1775     PR_MD_CSRCS=sony.c
1776     ;;
1778 *-nextstep*|*-openstep*)
1779     AC_DEFINE(XP_UNIX)
1780     AC_DEFINE(NEXTSTEP)
1781     AC_DEFINE(HAVE_BSD_FLOCK)
1782     AC_DEFINE(_POSIX_SOURCE)
1783     CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
1784     CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
1785     USE_NSPR_THREADS=1
1786     DLL_SUFFIX=dylib
1787     MDCPUCFG_H=_nextstep.cfg
1788     PR_MD_CSRCS=nextstep.c
1789     ;;
1792 *-nto*)
1793     AC_DEFINE(XP_UNIX)
1794     AC_DEFINE(NTO)
1795     AC_DEFINE(_QNX_SOURCE)
1796     AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1797     MDCPUCFG_H=_nto.cfg
1798     PR_MD_CSRCS=nto.c
1799     MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
1800     DSO_CFLAGS=-fPIC
1801     DSO_LDOPTS=-shared
1802     OS_LIBS="$OS_LIBS -lsocket"
1803     _OPTIMIZE_FLAGS="-O1"
1804     _DEBUG_FLAGS="-gstabs"
1805         ;;
1807 *-openbsd*)
1808     AC_DEFINE(XP_UNIX)
1809     AC_DEFINE(OPENBSD)
1810     AC_DEFINE(HAVE_BSD_FLOCK)
1811     AC_DEFINE(HAVE_SOCKLEN_T)
1812     CFLAGS="$CFLAGS -ansi -Wall"
1813     CXXFLAGS="$CXXFLAGS -ansi -Wall"
1814     DLL_SUFFIX=so.1.0
1815     DSO_CFLAGS=-fPIC
1816     MDCPUCFG_H=_openbsd.cfg
1817     PR_MD_CSRCS=openbsd.c
1818     OS_LIBS="-lc"
1819     if test -z "$USE_NSPR_THREADS"; then
1820         USE_PTHREADS=1
1821     fi
1822     DSO_LDOPTS='-shared -fPIC'
1823     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1824     ;;
1826 *-osf*)
1827     SHELL_OVERRIDE="SHELL               = /usr/bin/ksh"
1828     AC_DEFINE(XP_UNIX)
1829     AC_DEFINE(OSF1)
1830     AC_DEFINE(_REENTRANT)
1831     # OSF1 and HPUX report the POLLHUP event for a socket when the
1832     # shutdown(SHUT_WR) operation is called for the remote end, even though
1833     # the socket is still writeable. Use select(), instead of poll(), to
1834     # workaround this problem.
1835     AC_DEFINE(_PR_POLL_WITH_SELECT)
1837     if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
1838         USE_NSPR_THREADS=1
1839     fi
1841     if test -z "$GNU_CC"; then
1842         CC="$CC -std1 -ieee_with_inexact"
1843         if test "$OS_RELEASE" != "V2.0"; then
1844             CC="$CC -readonly_strings"
1845         fi
1846         _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
1847         AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
1848     else
1849         CFLAGS="$CFLAGS -mieee"
1850         CXXFLAGS="$CXXFLAGS -mieee"
1851     fi
1853     if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
1854         AC_DEFINE(HAVE_INT_LOCALTIME_R)
1855     else
1856         AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1857         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1858     fi
1859     if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
1860         AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
1861     fi
1862     DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
1863     MDCPUCFG_H=_osf1.cfg
1864     PR_MD_CSRCS=osf1.c
1865     ;;
1867 *-qnx*)
1868     AC_DEFINE(XP_UNIX)
1869     AC_DEFINE(QNX)
1870     AC_DEFINE(_PR_NEED_H_ERRNO)
1871     USE_NSPR_THREADS=1
1872     MDCPUCFG_H=_qnx.cfg
1873     PR_MD_CSRCS=qnx.c
1874     ;;
1876 *-riscos*)
1877     AC_DEFINE(XP_UNIX)
1878     AC_DEFINE(RISCOS)
1879     AC_DEFINE(_PR_NEED_H_ERRNO)
1880     USE_PTHREADS=1
1881     MDCPUCFG_H=_riscos.cfg
1882     PR_MD_CSRCS=riscos.c
1883     DLL_SUFFIX=a
1884     LD="/home/riscos/env/ro-ar cr"
1885     ;;
1887 *-*-sco*)
1888     AC_DEFINE(XP_UNIX)
1889     AC_DEFINE(SCO)
1890     AC_DEFINE(sco)
1891     AC_DEFINE(SYSV)
1892     AC_DEFINE(_SVID3)
1893     AC_DEFINE(_PR_NEED_H_ERRNO)
1894     CC='cc -b elf -KPIC'
1895     CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
1896     USE_NSPR_THREADS=1
1897     CPU_ARCH=x86
1898     DSO_LDOPTS='-b elf -G'
1899     MDCPUCFG_H=_scoos.cfg
1900     PR_MD_SRCS=scoos.c
1901     ;;
1903 *-sinix*)
1904     AC_DEFINE(XP_UNIX)
1905     AC_DEFINE(SVR4)
1906     AC_DEFINE(SNI)
1907     AC_DEFINE(RELIANTUNIX)
1908     AC_DEFINE(sinix)
1909     AC_DEFINE(HAVE_SVID_GETTOD)
1910     if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
1911         AC_DEFINE(i386)
1912         CPU_ARCH=x86
1913     else
1914         CPU_ARCH=mips
1915     fi
1917     if test "$GNU_CC"; then
1918         AS='$(CC) -x assembler-with-cpp'
1919         if test "$CPU_ARCH" = "mips"; then
1920             LD=gld
1921         fi
1922         CFLAGS="$CFLAGS -Wall -Wno-format"
1923     else
1924         AS='/usr/bin/cc'
1925         _OPTIMIZE_FLAGS='-O -F Olimit,4000'
1926     fi
1928     DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
1930     if test "$OS_RELEASE" = "5.43"; then
1931         AC_DEFINE(IP_MULTICAST)
1932     fi
1934     OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
1935     USE_NSPR_THREADS=1
1936     MDCPUCFG_H=_reliantunix.cfg
1937     PR_MD_CSRCS=reliantunix.c
1938     if test "${OS_ARCH}" = "mips"; then
1939         PR_MD_ASFILES=os_ReliantUNIX.s
1940     fi
1941     ;;
1943 *-sunos*)
1944     AC_DEFINE(XP_UNIX)
1945     AC_DEFINE(SUNOS4)
1946     CFLAGS="$CFLAGS -Wall -Wno-format"
1947     if test "$USE_MDUPDATE"; then
1948         CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1949     fi
1950     CPU_ARCH=sparc
1951     DLL_SUFFIX=so.1.0
1952     DSO_LDOPTS=
1953     DSO_CFLAGS=-fPIC
1954     USE_NSPR_THREADS=1
1955     if test "$OS_RELEASE" = "4.1.3_U1"; then
1956         _OPTIMIZE_FLAGS=
1957         OS_LIBS="$OS_LIBS -lm"
1958     fi
1959     MDCPUCFG_H=_sunos4.cfg
1960     PR_MD_CSRCS=sunos4.c
1961     ;;
1963 *-solaris*)
1964     if test -z "$USE_NSPR_THREADS"; then
1965         USE_PTHREADS=1
1966     fi
1967     AC_DEFINE(XP_UNIX)
1968     AC_DEFINE(SVR4)
1969     AC_DEFINE(SYSV)
1970     AC_DEFINE(__svr4)
1971     AC_DEFINE(__svr4__)
1972     AC_DEFINE(SOLARIS)
1973     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1974     CPU_ARCH=`uname -p`
1975     MDCPUCFG_H=_solaris.cfg
1976     PR_MD_CSRCS=solaris.c
1977     LD=/usr/ccs/bin/ld
1978     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1979     RESOLVE_LINK_SYMBOLS=1
1980     case "${OS_RELEASE}" in
1981     5.8|5.9)
1982         ;;
1983     *)
1984         # It is safe to use the -Bdirect linker flag on Solaris 10 or later.
1985         USE_B_DIRECT=1
1986         ;;
1987     esac
1988     if test -n "$GNU_CC"; then
1989         DSO_CFLAGS=-fPIC
1990         if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
1991             GCC_USE_GNU_LD=1
1992         fi
1993         DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs,-z,ignore' 
1994         if test -n "$USE_B_DIRECT"; then
1995             DSO_LDOPTS="$DSO_LDOPTS,-Bdirect"
1996         fi
1997     else
1998         DSO_CFLAGS=-KPIC
1999         DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs -z ignore'
2000         if test -n "$USE_B_DIRECT"; then
2001             DSO_LDOPTS="$DSO_LDOPTS -Bdirect"
2002         fi
2003     fi
2004     if test -n "$GNU_CC"; then
2005         CFLAGS="$CFLAGS -Wall"
2006         CXXFLAGS="$CXXFLAGS -Wall"
2007         if test -n "$USE_MDUPDATE"; then
2008             CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
2009             CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
2010         fi
2011         GCC_AS=`$CC -print-prog-name=as`
2012         if test "`echo | $GCC_AS -v 2>&1 | grep -c GNU`" != "0"; then
2013             GNU_AS=1
2014         fi
2015     else
2016         CFLAGS="$CFLAGS -xstrconst"
2017         CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
2018         if test -z "$MOZ_OPTIMIZE"; then
2019             CFLAGS="$CFLAGS -xs"
2020             CXXFLAGS="$CXXFLAGS -xs"
2021         fi
2022         _OPTIMIZE_FLAGS=-xO4
2023     fi
2024     if test -z "$GNU_AS"; then
2025         ASFLAGS="$ASFLAGS -Wa,-P"
2026     fi
2027     if test -n "$USE_64"; then
2028         if test -n "$GNU_CC"; then
2029             CC="$CC -m64"
2030             CXX="$CXX -m64"
2031         else
2032             if test "$OS_TEST" = "i86pc"; then
2033                 CC="$CC -xarch=amd64"
2034                 CXX="$CXX -xarch=amd64"
2035             else
2036                 CC="$CC -xarch=v9"
2037                 CXX="$CXX -xarch=v9"
2038             fi
2039         fi
2040     fi
2041     if test "$OS_TEST" = "i86pc"; then
2042         if test -z "$USE_64"; then
2043             AC_DEFINE(i386)
2044         fi
2045         CPU_ARCH_TAG=_$OS_TEST
2046         # The default debug format, DWARF (-g), is not supported by gcc
2047         # on i386-ANY-sysv4/solaris, but the stabs format is.  It is
2048         # assumed that the Solaris assembler /usr/ccs/bin/as is used.
2049         # If your gcc uses GNU as, you do not need the -Wa,-s option.
2050         if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
2051             _DEBUG_FLAGS=-gstabs
2052             if test -z "$GNU_AS"; then
2053                 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
2054             fi
2055         fi
2056     fi
2057     case "${target_os}" in
2058     solaris2.3*)
2059         AC_DEFINE(_PR_NO_LARGE_FILES)
2060         ;;
2061     solaris2.4*)
2062         AC_DEFINE(_PR_NO_LARGE_FILES)
2063         ;;
2064     solaris2.5*)
2065         AC_DEFINE(SOLARIS2_5)    
2066         ;;
2067     *)
2068         AC_DEFINE(_PR_HAVE_OFF64_T)
2069         # The lfcompile64(5) man page on Solaris 2.6 says:
2070         #     For applications that do not wish to conform to the POSIX or
2071         #     X/Open  specifications,  the  64-bit transitional interfaces
2072         #     are available by default.  No compile-time flags need to  be
2073         #     set.
2074         # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
2075         # The native compiler, gcc 2.8.x, and egcs don't have this problem.
2076         if test -n "$GNU_CC"; then
2077             AC_DEFINE(_LARGEFILE64_SOURCE)
2078         fi
2079         ;;
2080     esac
2081     case "${target_os}" in
2082     solaris2.3*)
2083         ;;
2084     solaris2.4*)
2085         ;;
2086     solaris2.5*)
2087         ;;
2088     solaris2.6*)
2089         ;;
2090     solaris2.7*)
2091         ;;
2092     *)
2093         # Solaris 8 or higher has IPv6.
2094         AC_DEFINE(_PR_INET6)
2095         ;;
2096     esac
2097     if test "$CPU_ARCH" = "sparc"; then
2098         # 64-bit Solaris SPARC requires V9 architecture, so the following
2099         # is not needed.
2100         if test -z "$USE_64"; then
2101             ULTRASPARC_LIBRARY=nspr_flt
2102         fi
2103     fi
2104     # Purify requires that binaries linked against nspr also
2105     # be linked against -lrt (or -lposix4) so add it to OS_LIBS
2106     _rev=`uname -r`
2107     _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
2108     OS_LIBS="$OS_LIBS $_librt"
2109     ;;
2111 *-sco-sysv5*)
2112     AC_DEFINE(XP_UNIX)
2113     AC_DEFINE(UNIXWARE)
2114     AC_DEFINE(SVR4)
2115     AC_DEFINE(SYSV)
2116     USE_NSPR_THREADS=1
2117     if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
2118         AC_DEFINE(_PR_NO_LARGE_FILES)
2119         CC='$(NSDEPTH)/build/hcc cc'
2120         CXX='$(NSDEPTH)/build/hcpp CC'
2121         MDCPUCFG_H=_unixware.cfg
2122     else
2123         AC_DEFINE(_LARGEFILE64_SOURCE)
2124         AC_DEFINE(_PR_HAVE_OFF64_T)
2125         AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
2126         MDCPUCFG_H=_unixware7.cfg
2127     fi
2128     PR_MD_CSRCS=unixware.c
2129     DSO_LDOPTS=-G
2130     CPU_ARCH=x86
2131     ;;
2133 *-symbian*)
2134     AC_ARG_WITH(symbian-sdk,
2135     [  --with-symbian-sdk=SYMBIAN_SDK_DIR
2136                           The path to the Symbian SDK],
2137     SYMBIAN_SDK_DIR=$withval)
2139     echo -----------------------------------------------------------------------------
2140     echo Building with Symbian SDK in: $SYMBIAN_SDK_DIR
2141     echo -----------------------------------------------------------------------------
2143     AC_DEFINE(XP_UNIX)
2144     AC_DEFINE(SYMBIAN)
2145     AC_DEFINE(__arm__)
2146     AC_DEFINE(__SYMBIAN32__)
2147     AC_DEFINE(_UNICODE)
2148     AC_DEFINE(NDEBUG)
2149     AC_DEFINE(__SUPPORT_CPP_EXCEPTIONS__)
2150     AC_DEFINE(MOZ_STDERR_TO_STDOUT)
2151     AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
2152     AC_DEFINE(HAVE_SOCKLEN_T)
2153     USE_PTHREADS=1
2154     LIB_SUFFIX=lib
2155     DLL_SUFFIX=dll
2156     MKSHLIB=
2157     DSO_LDOPTS=
2158     DSO_CFLAGS=
2159     VISIBILITY_FLAGS=
2160     MDCPUCFG_H=_symbian.cfg
2161     PR_MD_CSRCS=symbian.c
2162     NSINSTALL=nsinstall
2163     RANLIB='echo no ranlib '
2164     CPU_ARCH=ARM
2165     OS_ARCH=SYMBIAN
2166     OS_EXE_CFLAGS="$OS_EXE_CFLAGS -D__EXE__"
2167     CFLAGS="$CFLAGS -MD -nostdinc"
2168     SYMBIAN_SYS_INCLUDE="-I$SYMBIAN_SDK_DIR/Epoc32/include/variant -I$SYMBIAN_SDK_DIR/Epoc32/include -I$SYMBIAN_SDK_DIR/Epoc32/include/stdapis"
2169     echo -------------------------------------------------------
2170     echo SYMBIAN_SYS_INCLUDE is: $SYMBIAN_SYS_INCLUDE
2171     echo -------------------------------------------------------
2172     case "$OS_TARGET" in
2173     WINSCW)
2174         CC=mwccsym2.exe
2175         CXX=mwccsym2.exe
2176         LD=mwldsym2.exe
2177         AR=mwldsym2.exe
2178         WINSCW_LD_DIR="\$(SYMBIAN_SDK_DIR)/EPOC32/RELEASE/WINSCW/UDEB"
2179         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)"
2180         SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include Symbian_OS_v9.2.hrh"
2181         AR_FLAGS="-library -msgstyle gcc -stdlib -subsystem windows -noimplib -o \$@"
2182         AC_DEFINE(_DEBUG)
2183         AC_DEFINE(__CW32__)
2184         AC_DEFINE(__WINS__)
2185         AC_DEFINE(__WINSCW__)
2186         DEFINES="$DEFINES -U_WIN32"
2187             ;;
2188     GCCE)
2189         CFLAGS="$CFLAGS -Wall -Wno-unknown-pragmas -fexceptions -march=armv5t -mapcs -pipe -x c -msoft-float"
2190         CXXFLAGS="$CXXFLAGS $CFLAGS -Wno-ctor-dtor-privacy"
2191         SYMBIAN_SYS_INCLUDE="$SYMBIAN_SYS_INCLUDE -include $SYMBIAN_SDK_DIR/EPOC32/INCLUDE/GCCE/GCCE.h"
2192         AC_DEFINE(__GCCE__)
2193         AC_DEFINE(__EABI__)
2194         DEFINES="$DEFINES -D__PRODUCT_INCLUDE__=$SYMBIAN_SDK_DIR/Epoc32/include/variant/Symbian_OS_v9.2.hrh"
2195             ;;
2196     *)
2197             AC_MSG_ERROR([Missing OS_TARGET for ${target}. Set --enable-symbian-target to with 'WINSCW' or 'GCCE'.])
2198         ;;
2199     esac
2200     CFLAGS="$CFLAGS ${SYMBIAN_SYS_INCLUDE}"
2201     ;;
2203 *-os2*)
2204     AC_DEFINE(XP_OS2)
2205     AC_DEFINE(XP_PC)
2206     AC_DEFINE(BSD_SELECT)
2207     AC_DEFINE(TCPV40HDRS)
2208     LIB_SUFFIX=lib
2209     DLL_SUFFIX=dll
2210     RC=rc.exe
2211     PR_MD_ARCH_DIR=os2
2212     PROG_SUFFIX=.exe
2213     NSINSTALL=nsinstall
2214     MDCPUCFG_H=_os2.cfg
2215     RESOLVE_LINK_SYMBOLS=1
2217     AC_DEFINE(OS2)
2218     AR=emxomfar
2219     AR_FLAGS='r $@'
2220     CFLAGS="$CFLAGS -Wall -Zomf"
2221     CXXFLAGS="$CFLAGS -Wall -Zomf"
2222     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
2223     DSO_CFLAGS=
2224     DSO_LDOPTS='-Zomf -Zdll'
2225     LDFLAGS='-Zmap'
2226     _OPTIMIZE_FLAGS="-O2 -s"
2227     _DEBUG_FLAGS="-g -fno-inline"
2228     if test -n "$MOZ_OPTIMIZE"; then
2229       DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
2230     fi
2231     OS_LIBS="-lsocket"
2232     IMPLIB='emximp -o'
2233     FILTER='emxexp -o'
2234     if test -n "$MOZ_OS2_HIGH_MEMORY"; then
2235       LDFLAGS="$LDFLAGS -Zhigh-mem"
2236       AC_DEFINE(MOZ_OS2_HIGH_MEMORY)
2237     fi
2239     # GCC for OS/2 currently predefines these, but we don't want them
2240     DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
2241     ;;
2244     AC_DEFINE(XP_UNIX)
2245     ;;
2246    
2247 esac
2249 if test -z "$SKIP_LIBRARY_CHECKS"; then
2250 dnl ========================================================
2251 dnl Check for system libraries
2252 dnl ========================================================
2253 dnl AC_CHECK_LIB(C, main)
2254 dnl AC_CHECK_LIB(C_r, main)
2255 dnl AC_CHECK_LIB(c, main)
2256 dnl AC_CHECK_LIB(c_r, main)
2257 dnl AC_CHECK_LIB(dce, main)
2258 dnl AC_CHECK_LIB(dl, main)
2259 dnl AC_CHECK_LIB(dld, main)
2260 dnl AC_CHECK_LIB(gen, main)
2261 dnl AC_CHECK_LIB(ip6, main)
2262 dnl AC_CHECK_LIB(l, main)
2263 dnl AC_CHECK_LIB(m, main)
2264 dnl AC_CHECK_LIB(nsl, main)
2265 dnl AC_CHECK_LIB(posix4, main)
2266 dnl AC_CHECK_LIB(prstrms, main)
2267 dnl AC_CHECK_LIB(prstrms_shr, main)
2268 dnl AC_CHECK_LIB(pthread, main)
2269 dnl AC_CHECK_LIB(pthreads, main)
2270 dnl AC_CHECK_LIB(resolv, main)
2271 dnl AC_CHECK_LIB(rt, main)
2272 dnl AC_CHECK_LIB(socket, main)
2273 dnl AC_CHECK_LIB(svld, main)
2274 dnl AC_CHECK_LIB(thread, main)
2275 dnl AC_CHECK_LIB(vms_jackets, main)
2278 dnl We don't want anything to link with libdl even if it's present on OS X, 
2279 dnl since it's not used and not part of the default installation.
2280 dnl The same goes for BeOS.
2282 case $target in
2283 *-darwin*|*-beos*)
2284     ;;
2286     AC_CHECK_LIB(dl, dlopen,
2287         AC_CHECK_HEADER(dlfcn.h,
2288             OS_LIBS="-ldl $OS_LIBS"))
2289     ;;
2290 esac
2293 dnl ========================================================
2294 dnl Check for system header files.
2295 dnl ========================================================
2296 dnl AC_HEADER_DIRENT
2297 dnl AC_HEADER_STDC
2298 dnl AC_HEADER_SYS_WAIT
2299 dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
2301 dnl ========================================================
2302 dnl Check for typedefs and structs
2303 dnl ========================================================
2304 dnl AC_C_CONST
2305 dnl AC_TYPE_UID_T
2306 dnl AC_TYPE_MODE_T
2307 dnl AC_TYPE_OFF_T
2308 dnl AC_TYPE_PID_T
2309 dnl AC_TYPE_SIZE_T
2310 dnl AC_STRUCT_ST_BLKSIZE
2311 dnl AC_STRUCT_ST_BLOCKS
2312 dnl AC_STRUCT_ST_RDEV
2313 dnl AC_HEADER_TIME
2314 dnl AC_STRUCT_TM
2316 dnl ========================================================
2317 dnl Checks for library functions.
2318 dnl ========================================================
2319 AC_PROG_GCC_TRADITIONAL
2320 AC_CHECK_FUNCS(lchown strerror)
2322 dnl AC_FUNC_MEMCMP
2323 dnl AC_FUNC_MMAP
2324 dnl AC_FUNC_SETVBUF_REVERSED
2325 dnl AC_FUNC_STRCOLL
2326 dnl AC_FUNC_STRFTIME
2327 dnl AC_FUNC_UTIME_NULL
2328 dnl AC_FUNC_VPRINTF
2329 dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
2331 dnl ========================================================
2332 dnl Check options
2333 dnl ========================================================
2335 dnl ========================================================
2336 dnl =
2337 dnl = --enable-strip
2338 dnl = 
2339 dnl = Enable stripping of libs and executables
2340 dnl = 
2341 dnl ========================================================
2342 AC_ARG_ENABLE(strip,
2343     [  --enable-strip          Enable stripping of shared libs and programs],
2344     [ if test "$enableval" = "yes"; then
2345             ENABLE_STRIP=1
2346       fi ])
2348 dnl Check for hpux options
2349 case "${target_os}" in
2350 hpux*)
2351 if test -z "$GNU_CC"; then
2353     AC_CACHE_CHECK(for +Olit support,
2354         ac_cv_hpux_usable_olit_option,
2355         dnl since aCC doesn't throw an error on invalid options,
2356         dnl we have to test this the hard way
2357         [ac_cv_hpux_usable_olit_option=no
2358         rm -f conftest*
2359         echo 'int main() { return 0; }' | cat > conftest.c
2360         ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
2361         if test $? -eq 0; then
2362             if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2363                 ac_cv_hpux_usable_olit_option=yes
2364             fi
2365         fi
2366         rm -f conftest*
2367         ])
2369     if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2370         CFLAGS="$CFLAGS +Olit=all"
2371         CXXFLAGS="$CXXFLAGS +Olit=all"
2372     else
2373         CFLAGS="$CFLAGS +ESlit"
2374         CXXFLAGS="$CXXFLAGS +ESlit"
2375     fi
2378 esac
2381 dnl Apparently, some systems cannot properly check for the pthread
2382 dnl library unless <pthread.h> is included so we need to test
2383 dnl using it
2385 dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2386 AC_DEFUN(MOZ_CHECK_PTHREADS,
2388 AC_MSG_CHECKING([for pthread_create in -l$1])
2389 echo "
2390     #include <pthread.h> 
2391     void *foo(void *v) { return v; } 
2392     int main() { 
2393         pthread_t t;
2394         if (!pthread_create(&t, 0, &foo, 0)) {
2395             pthread_join(t, 0);
2396         }
2397         return 0;
2398     }" > dummy.c ;
2399     echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2400     ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2401     _res=$? ;
2402     rm -f dummy.c dummy${ac_exeext} ;
2403     if test "$_res" = "0"; then
2404         AC_MSG_RESULT([yes])
2405         [$2]
2406     else
2407         AC_MSG_RESULT([no])
2408         [$3]
2409     fi
2412 case "$target_os" in
2413 darwin*)
2414     _HAVE_PTHREADS=1
2415     ;;
2417     MOZ_CHECK_PTHREADS(pthreads,
2418         _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2419         MOZ_CHECK_PTHREADS(pthread,
2420             _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2421             MOZ_CHECK_PTHREADS(c_r,
2422                 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2423                 MOZ_CHECK_PTHREADS(c,
2424                     _HAVE_PTHREADS=1
2425                 )
2426             )
2427         )
2428     )
2429     ;;
2430 esac
2432 AC_ARG_WITH(pthreads,
2433     [  --with-pthreads         Use system pthreads library as thread subsystem],
2434     [ if test "$withval" = "yes"; then
2435             if test -n "$_HAVE_PTHREADS"; then
2436                     USE_PTHREADS=1 
2437                     USE_USER_PTHREADS=
2438                     USE_NSPR_THREADS=
2439             else
2440                     AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2441             fi
2442           else
2443             USE_PTHREADS=
2444             _PTHREAD_LDFLAGS=
2445           fi],
2446         [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2447             USE_PTHREADS=1
2448             USE_USER_PTHREADS=
2449             USE_NSPR_THREADS=
2450           fi])
2452 AC_ARG_ENABLE(user-pthreads,
2453     [  --enable-user-pthreads  Build using userland pthreads],
2454     [ if test "$enableval" = "yes"; then
2455         if test -n "$_HAVE_PTHREADS"; then
2456                     USE_PTHREADS=
2457                     USE_USER_PTHREADS=1
2458                     USE_NSPR_THREADS=
2459             else
2460                     AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2461             fi
2462           fi])
2464 AC_ARG_ENABLE(nspr-threads,
2465     [  --enable-nspr-threads   Build using classic nspr threads],
2466     [ if test "$enableval" = "yes"; then
2467             USE_PTHREADS=
2468             USE_USER_PTHREADS=
2469             USE_NSPR_THREADS=1
2470           fi])
2472 case "$target" in
2473 *-beos*)
2474     AC_ARG_WITH(bthreads,
2475     [  --with-bthreads         Use system bthreads library as thread subsystem
2476                           (BeOS only)],
2477     [   if test "$withval" = "yes"; then
2478             USE_BTHREADS=1
2479                 USE_USER_PTHREADS=
2480                 USE_PTHREADS=
2481             fi])
2482     ;;
2483 esac
2485 fi # SKIP_LIBRARY_CHECKS
2487 AC_ARG_ENABLE(ipv6,
2488     [  --enable-ipv6           Compile ipv6 support],
2489     [ if test "$enableval" = "yes"; then
2490             USE_IPV6=1
2491       else
2492             USE_IPV6=
2493       fi])
2496 AC_ARG_ENABLE(boehm,
2497     [  --enable-boehm          Enable the Boehm Garbage Collector],
2498     [ if test "$enableval" = "yes"; then
2499         AC_DEFINE(GC_LEAK_DETECTOR)
2500         GC_LEAK_DETECTOR=1
2501     fi])
2503 if test -n "$USE_PTHREADS"; then
2504    dnl See if -pthread is supported.
2505    rm -f conftest*
2506    ac_cv_have_dash_pthread=no
2507    AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2508    echo 'int main() { return 0; }' | cat > conftest.c
2509    ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2510    if test $? -eq 0; then
2511         if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2512             ac_cv_have_dash_pthread=yes
2513                 case "$target_os" in
2514             freebsd*)
2515 # Freebsd doesn't use -pthread for compiles, it uses them for linking
2516             ;;
2517             *)
2518             CFLAGS="$CFLAGS -pthread"
2519             CXXFLAGS="$CXXFLAGS -pthread"
2520             ;;
2521         esac
2522         fi
2523     fi
2524     rm -f conftest*
2525     AC_MSG_RESULT($ac_cv_have_dash_pthread)
2527         dnl
2528         dnl See if -pthreads is supported.
2529         dnl
2530     ac_cv_have_dash_pthreads=no
2531     if test "$ac_cv_have_dash_pthread" = "no"; then
2532             AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2533         echo 'int main() { return 0; }' | cat > conftest.c
2534             ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2535         if test $? -eq 0; then
2536                 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2537                             ac_cv_have_dash_pthreads=yes
2538                             CFLAGS="$CFLAGS -pthreads"
2539                             CXXFLAGS="$CXXFLAGS -pthreads"
2540                     fi
2541             fi
2542             rm -f conftest*
2543         AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2544     fi
2546     case "$target" in
2547     *-solaris*)
2548         if test "$ac_cv_have_dash_pthreads" = "yes"; then
2549             _PTHREAD_LDFLAGS=
2550         fi
2551             ;;
2552     *-freebsd*)
2553             AC_DEFINE(_REENTRANT)
2554             AC_DEFINE(_THREAD_SAFE)
2555             dnl -pthread links in -lc_r, so don't specify it explicitly.
2556             if test "$ac_cv_have_dash_pthread" = "yes"; then
2557                 _PTHREAD_LDFLAGS="-pthread"
2558             else
2559                 _PTHREAD_LDFLAGS="-lc_r"
2560             fi
2561             ;;
2562     *-netbsd*)
2563             if test "$ac_cv_have_dash_pthread" = "yes"; then
2564                 _PTHREAD_LDFLAGS="-pthread"
2565             fi
2566             ;;
2567     *-bsdi*)
2568             AC_DEFINE(_THREAD_SAFE)
2569             dnl -pthread links in -lc_r, so don't specify it explicitly.
2570             if test "$ac_cv_have_dash_pthread" = "yes"; then
2571                 _PTHREAD_LDFLAGS=
2572             fi
2573             ;;
2574     *-openbsd*)
2575         if test "$ac_cv_have_dash_pthread" = "yes"; then
2576             _PTHREAD_LDFLAGS=-pthread
2577         fi
2578         ;;
2579     *-linux*|*-gnu*|*-k*bsd*-gnu)
2580         AC_DEFINE(_REENTRANT)
2581         ;;
2582     esac
2584 else 
2585     if test -n "$USE_USER_PTHREADS"; then
2586             USE_PTHREADS=
2587             USE_NSPR_THREADS=
2588     else
2589         _PTHREAD_LDFLAGS=
2590     fi
2592 dnl Special thread exceptions
2594 case "$target" in
2595 *-aix*)
2596     if test -n "$USE_NSPR_THREADS"; then
2597         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2598     fi
2599     case "$target_os" in
2600     aix4.1*)
2601         if test -z "$USE_PTHREADS"; then
2602             AC_DEFINE(AIX_RENAME_SELECT)
2603         fi
2604         ;;
2605     aix4.2*)
2606         if test -z "$USE_NSPR_THREADS"; then
2607             AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2608         fi
2609         ;;
2610     aix4.3*)
2611         if test -z "$USE_NSPR_THREADS"; then
2612             AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2613         fi
2614         if test -n "$USE_PTHREADS"; then
2615             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2616         fi
2617         ;;
2618     *)
2619         if test -z "$USE_NSPR_THREADS"; then
2620             AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2621         fi
2622         if test -n "$USE_PTHREADS"; then
2623             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2624         fi
2625         ;;
2626     esac
2627     ;;
2628 *-bsdi*)
2629     if test -n "$USE_PTHREADS"; then
2630         AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2631     fi
2632     ;;
2633 *-freebsd*)
2634     if test -n "$USE_NSPR_THREADS"; then
2635         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2636     fi
2637     ;;
2638 *-hpux*)
2639     if test -n "$USE_NSPR_THREADS"; then
2640         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2641     fi 
2642     if test "$USE_PTHREADS"; then
2643         if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2644             AC_DEFINE(_REENTRANT)
2645             AC_DEFINE(_PR_DCETHREADS)
2646         else
2647             AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2648             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2649         fi
2650     fi
2651     if test "$USE_USER_PTHREADS"; then
2652         AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2653     fi
2654     ;;
2655 *-irix*)
2656     if test "${target_os}" = "irix6.5"; then
2657         if test -n "$USE_PTHREADS"; then
2658             AC_DEFINE(_PR_HAVE_GETHOST_R)
2659             AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2660         fi
2661     fi
2662     ;;
2663 *-linux*|*-gnu*|*-k*bsd*-gnu)
2664     if test -n "$USE_NSPR_THREADS"; then
2665         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2666     fi
2667     ;;
2668 *-mingw*|*-cygwin*|*-msvc*|*-mks*|*-wince*|*-os2*|*-beos*)
2669     dnl win32, wince, os2 & beos cannot use pthreads
2670     USE_PTHREADS=
2671     _PTHREAD_LDFLAGS=
2672     USE_USER_PTHREADS=
2673     ;;
2674 *-netbsd*|*-openbsd*)
2675     if test -n "$USE_NSPR_THREADS"; then
2676         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2677     fi
2678     ;;
2679 *-osf*)
2680     if test -n "$USE_NSPR_THREADS"; then
2681         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2682     fi
2683     if test -n "$USE_PTHREADS"; then
2684         if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2685             :
2686         else
2687             AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2688         fi
2689     fi
2690     ;;
2691 *-solaris*)
2692     if test -n "$USE_NSPR_THREADS"; then
2693         AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2694     fi
2695     if test -n "$USE_PTHREADS"; then
2696         AC_DEFINE(_REENTRANT)
2697         AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2698         if test "$OS_TEST" = "i86pc"; then
2699             if test -n "$USE_64"; then
2700                PR_MD_ASFILES=os_SunOS_x86_64.s
2701             else
2702                PR_MD_ASFILES=os_SunOS_x86.s
2703             fi
2704         else
2705             if test -n "$USE_64"; then
2706                 PR_MD_ASFILES=os_SunOS_sparcv9.s
2707             fi
2708         fi
2709     fi
2710     ;;
2711 *-nto*)
2712     if test -n "$USE_PTHREADS"; then
2713         AC_DEFINE(_PR_HAVE_GETHOST_R)
2714         AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2715     fi
2716     ;;
2717 esac
2719 OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
2721 dnl If the user passed in arg to --enable-optimize or --enable-debug,
2722 dnl make sure that we use it.
2723 if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
2724     _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
2727 if test -n "$_SAVE_DEBUG_FLAGS"; then
2728     _DEBUG_FLAGS="$_SAVE_DEBUG_FLAGS"
2731 if test -n "$MOZ_OPTIMIZE"; then
2732     CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
2733     CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
2736 if test -n "$MOZ_DEBUG"; then
2737     CFLAGS="$CFLAGS $_DEBUG_FLAGS"
2738     CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
2741 if test -n "$MOZ_OPTIMIZE"; then
2742     OBJDIR_TAG=_OPT
2743 else
2744     OBJDIR_TAG=_DBG
2747 if test -n "$USE_64"; then
2748     COMPILER_TAG=_64
2751 RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
2753 dnl ========================================================
2754 dnl Use cygwin wrapper for win32 builds, except MSYS/MinGW
2755 dnl ========================================================
2756 case "$target_os" in
2757 cygwin*|msvc*|mks*)
2758     CC="\$(CYGWIN_WRAPPER) $CC"
2759     CXX="\$(CYGWIN_WRAPPER) $CXX"
2760     RC="\$(CYGWIN_WRAPPER) $RC"
2761     ;;
2762 esac
2764 dnl ========================================================
2765 dnl Substitution of found variables.
2766 dnl ========================================================
2767 AC_SUBST(SHELL_OVERRIDE)
2769 AC_SUBST(MOZILLA_CLIENT)
2770 AC_SUBST(CC)
2771 AC_SUBST(CXX)
2772 AC_SUBST(CFLAGS)
2773 AC_SUBST(CXXFLAGS)
2774 AC_SUBST(CPPFLAGS)
2775 AC_SUBST(HOST_CC)
2776 AC_SUBST(HOST_CFLAGS)
2777 AC_SUBST(LDFLAGS)
2778 AC_SUBST(HOST_LDFLAGS)
2779 AC_SUBST(GNU_CC)
2780 AC_SUBST(GCC_USE_GNU_LD)
2781 AC_SUBST(MSC_VER)
2782 AC_SUBST(CROSS_COMPILE)
2784 AC_SUBST(MOZ_OPTIMIZE)
2786 AC_SUBST(USE_CPLUS)
2787 AC_SUBST(USE_IPV6)
2788 AC_SUBST(USE_N32)
2789 AC_SUBST(USE_64)
2790 AC_SUBST(OBJECT_MODE)
2791 AC_SUBST(GC_LEAK_DETECTOR)
2792 AC_SUBST(ENABLE_STRIP)
2794 AC_SUBST(USE_PTHREADS)
2795 AC_SUBST(USE_BTHREADS)
2796 AC_SUBST(USE_USER_PTHREADS)
2797 AC_SUBST(USE_NSPR_THREADS)
2799 AC_SUBST(LIBNSPR)
2800 AC_SUBST(LIBPLC)
2802 AC_SUBST(MOD_MAJOR_VERSION)
2803 AC_SUBST(MOD_MINOR_VERSION)
2804 AC_SUBST(MOD_PATCH_VERSION)
2805 AC_SUBST(NSPR_MODNAME)
2806 AC_SUBST(MDCPUCFG_H)
2807 AC_SUBST(PR_MD_CSRCS)
2808 AC_SUBST(PR_MD_ASFILES)
2809 AC_SUBST(PR_MD_ARCH_DIR)
2810 AC_SUBST(CPU_ARCH)
2812 AC_SUBST(OBJ_SUFFIX)
2813 AC_SUBST(LIB_SUFFIX)
2814 AC_SUBST(DLL_SUFFIX)
2815 AC_SUBST(ASM_SUFFIX)
2816 AC_SUBST(MKSHLIB)
2817 AC_SUBST(DSO_CFLAGS)
2818 AC_SUBST(DSO_LDOPTS)
2820 AC_SUBST(OS_TARGET)
2821 AC_SUBST(OS_ARCH)
2822 AC_SUBST(OS_RELEASE)
2823 AC_SUBST(OS_TEST)
2824 AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
2826 AC_SUBST(DEFINES)
2827 AC_SUBST(DEFS)
2828 AC_SUBST(AR)
2829 AC_SUBST(AR_FLAGS)
2830 AC_SUBST(AS)
2831 AC_SUBST(ASFLAGS)
2832 AC_SUBST(LD)
2833 AC_SUBST(RANLIB)
2834 AC_SUBST(PERL)
2835 AC_SUBST(STRIP)
2836 AC_SUBST(FILTER)
2837 AC_SUBST(IMPLIB)
2839 AC_SUBST(OS_LIBS)
2840 AC_SUBST(RESOLVE_LINK_SYMBOLS)
2841 AC_SUBST(AIX_LINK_OPTS)
2842 AC_SUBST(NOSUCHFILE)
2843 AC_SUBST(MOZ_OBJFORMAT)
2844 AC_SUBST(ULTRASPARC_LIBRARY)
2846 AC_SUBST(OBJDIR)
2847 AC_SUBST(OBJDIR_NAME)
2848 AC_SUBST(RELEASE_OBJDIR_NAME)
2849 AC_SUBST(NSINSTALL)
2850 AC_SUBST(OPTIMIZER)
2851 AC_SUBST(RC)
2852 AC_SUBST(RCFLAGS)
2853 AC_SUBST(DLLFLAGS)
2854 AC_SUBST(EXEFLAGS)
2855 AC_SUBST(OS_DLLFLAGS)
2856 AC_SUBST(CYGWIN_WRAPPER)
2857 AC_SUBST(VISIBILITY_FLAGS)
2858 AC_SUBST(WRAP_SYSTEM_INCLUDES)
2859 AC_SUBST(MACOS_SDK_DIR)
2860 AC_SUBST(SYMBIAN_SDK_DIR)
2861 AC_SUBST(NEXT_ROOT)
2862 AC_SUBST(MT)
2864 dnl ========================================================
2865 dnl Generate output files.
2866 dnl ========================================================
2867 MAKEFILES="
2868 Makefile 
2869 config/Makefile
2870 config/autoconf.mk
2871 config/nsprincl.mk
2872 config/nsprincl.sh
2873 config/nspr-config
2874 lib/Makefile 
2875 lib/ds/Makefile 
2876 lib/libc/Makefile 
2877 lib/libc/include/Makefile 
2878 lib/libc/src/Makefile 
2879 lib/tests/Makefile
2880 pkg/Makefile
2881 pkg/linux/Makefile
2882 pkg/solaris/Makefile
2883 pkg/solaris/SUNWpr/Makefile
2884 pkg/solaris/SUNWprd/Makefile
2885 pr/Makefile 
2886 pr/include/Makefile 
2887 pr/include/md/Makefile 
2888 pr/include/obsolete/Makefile 
2889 pr/include/private/Makefile 
2890 pr/src/Makefile 
2891 pr/src/io/Makefile 
2892 pr/src/linking/Makefile 
2893 pr/src/malloc/Makefile 
2894 pr/src/md/Makefile 
2895 pr/src/md/${PR_MD_ARCH_DIR}/Makefile 
2896 pr/src/memory/Makefile 
2897 pr/src/misc/Makefile 
2898 pr/src/threads/Makefile 
2899 pr/tests/Makefile 
2900 pr/tests/dll/Makefile 
2903 dnl lib/tests/Makefile
2904 dnl pr/tests/w16gui/Makefile
2905 dnl tools/Makefile
2907 if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
2908     MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
2909 elif test -n "$USE_PTHREADS"; then
2910     MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"
2911 elif test -n "$USE_BTHREADS"; then
2912     MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
2915 if test -n "$USE_CPLUS"; then
2916     MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
2919 echo $MAKEFILES > unallmakefiles
2921 AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])