VirtualBox

source: vbox/trunk/src/libs/xpcom18a4/nsprpub/configure.in@ 3273

Last change on this file since 3273 was 1, checked in by vboxsync, 55 years ago

import

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 67.6 KB
Line 
1dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
2dnl
3dnl The contents of this file are subject to the Mozilla Public
4dnl License Version 1.1 (the "License"); you may not use this file
5dnl except in compliance with the License. You may obtain a copy of
6dnl the License at http://www.mozilla.org/MPL/
7dnl
8dnl Software distributed under the License is distributed on an "AS
9dnl IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10dnl implied. See the License for the specific language governing
11dnl rights and limitations under the License.
12dnl
13dnl The Original Code is the Netscape Portable Runtime (NSPR).
14dnl
15dnl The Initial Developer of the Original Code is Netscape
16dnl Communications Corporation. Portions created by Netscape are
17dnl Copyright (C) 1998o-2000 Netscape Communications Corporation. All
18dnl Rights Reserved.
19dnl
20dnl Contributor(s):
21dnl Christopher Seawood <cls@seawood.org>
22dnl
23dnl Alternatively, the contents of this file may be used under the
24dnl terms of the GNU General Public License Version 2 or later (the
25dnl "GPL"), in which case the provisions of the GPL are applicable
26dnl instead of those above. If you wish to allow use of your
27dnl version of this file only under the terms of the GPL and not to
28dnl allow others to use your version of this file under the MPL,
29dnl indicate your decision by deleting the provisions above and
30dnl replace them with the notice and other provisions required by
31dnl the GPL. If you do not delete the provisions above, a recipient
32dnl may use your version of this file under either the MPL or the
33dnl GPL.
34dnl
35
36AC_PREREQ(2.12)
37AC_INIT(config/libc_r.h)
38
39AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
40AC_CANONICAL_SYSTEM
41
42dnl ========================================================
43dnl = Defaults
44dnl ========================================================
45MOD_MAJOR_VERSION=4
46MOD_MINOR_VERSION=5
47MOD_PATCH_VERSION=0
48NSPR_MODNAME=nspr20
49_HAVE_PTHREADS=
50USE_PTHREADS=
51USE_USER_PTHREADS=
52USE_NSPR_THREADS=
53USE_N32=
54USE_64=
55USE_CPLUS=
56USE_IPV6=
57USE_MDUPDATE=
58MACOS_DEPLOYMENT_TARGET=
59_OPTIMIZE_FLAGS=-O
60_DEBUG_FLAGS=-g
61MOZ_DEBUG=1
62MOZ_OPTIMIZE=
63OBJDIR=.
64OBJDIR_NAME=.
65OBJDIR_SUFFIX=OBJ
66NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
67NOSUCHFILE=/no-such-file
68LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
69LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
70CYGWIN_WRAPPER=
71
72dnl Link in libraries necessary to resolve all symbols for shared libs
73RESOLVE_LINK_SYMBOLS=
74
75dnl ========================================================
76dnl =
77dnl = Dont change the following lines. Doing so breaks:
78dnl =
79dnl = CFLAGS="-foo" ./configure
80dnl =
81dnl ========================================================
82CFLAGS="${CFLAGS=}"
83CXXFLAGS="${CXXFLAGS=}"
84LDFLAGS="${LDFLAGS=}"
85HOST_CFLAGS="${HOST_CFLAGS=}"
86HOST_LDFLAGS="${HOST_LDFLAGS=}"
87
88case "$target" in
89*-cygwin*|*-mingw*)
90 # Check to see if we are really running in a msvc environemnt
91 _WIN32_MSVC=
92 AC_CHECK_PROGS(CC, cl)
93 if test "$CC" = "cl"; then
94 echo 'main() { return 0; }' > dummy.c
95 ${CC} -o dummy dummy.c >/dev/null 2>&1
96 if test $? = 0; then
97 _WIN32_MSVC=1
98 CXX=$CC
99 else
100 AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
101 fi
102 rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
103 fi
104 ;;
105*-msvc*)
106 _WIN32_MSVC=1
107 ;;
108*-mks*)
109 _WIN32_MSVC=1
110 ;;
111esac
112
113if test -n "$_WIN32_MSVC"; then
114 SKIP_PATH_CHECKS=1
115 SKIP_COMPILER_CHECKS=1
116 SKIP_LIBRARY_CHECKS=1
117fi
118
119dnl ========================================================
120dnl =
121dnl = Check options that may affect the compiler
122dnl =
123dnl ========================================================
124dist_prefix='${MOD_DEPTH}/dist'
125dist_bindir='${dist_prefix}/bin'
126dist_includedir='${dist_prefix}/include/nspr'
127dist_libdir='${dist_prefix}/lib'
128if test "${includedir}" = '${prefix}/include'; then
129 includedir='${prefix}/include/nspr'
130fi
131
132AC_ARG_WITH(dist-prefix,
133 [ --with-dist-prefix=DIST_PREFIX
134 place build files in DIST_PREFIX [dist]],
135 dist_prefix=$withval)
136
137AC_ARG_WITH(dist-bindir,
138 [ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
139 dist_bindir=$withval)
140
141AC_ARG_WITH(dist-includedir,
142 [ --with-dist-includedir=DIR
143 build include files in DIR [DIST_PREFIX/include/nspr]],
144 dist_includedir=$withval)
145
146AC_ARG_WITH(dist-libdir,
147 [ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
148 dist_libdir=$withval)
149
150AC_SUBST(dist_prefix)
151AC_SUBST(dist_bindir)
152AC_SUBST(dist_includedir)
153AC_SUBST(dist_libdir)
154
155dnl Check if NSPR is being compiled for Mozilla
156dnl Let --with-arg override environment setting
157dnl
158AC_ARG_WITH(mozilla,
159 [ --with-mozilla Compile NSPR with Mozilla support],
160 [ if test "$withval" = "yes"; then
161 AC_DEFINE(MOZILLA_CLIENT)
162 MOZILLA_CLIENT=1
163 else
164 MOZILLA_CLIENT=
165 fi],
166 [ if test -n "$MOZILLA_CLIENT"; then
167 AC_DEFINE(MOZILLA_CLIENT)
168 fi])
169
170AC_ARG_ENABLE(optimize,
171 [ --enable-optimize(=val) Enable code optimizations (val, ie. -O2) ],
172 [ if test "$enableval" != "no"; then
173 MOZ_OPTIMIZE=1
174 if test -n "$enableval" && test "$enableval" != "yes"; then
175 _OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
176 _SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
177 fi
178 else
179 MOZ_OPTIMIZE=
180 fi ])
181
182AC_ARG_ENABLE(debug,
183 [ --disable-debug Do not compile in debugging symbols],
184 [ if test "$enableval" = "no"; then
185 MOZ_DEBUG=
186 else
187 MOZ_DEBUG=1
188 fi])
189
190AC_ARG_ENABLE(win32-target,
191 [ --enable-win32-target=\$t
192 Specify win32 flavor. (WIN95 or WINNT)],
193 OS_TARGET=`echo $enableval | tr a-z A-Z`,
194 OS_TARGET=)
195
196AC_ARG_ENABLE(debug-rtl,
197 [ --enable-debug-rtl Use the MSVC debug runtime library],
198 [ if test "$enableval" = "yes"; then
199 USE_DEBUG_RTL=1
200 fi ])
201
202AC_ARG_ENABLE(n32,
203 [ --enable-n32 Enable n32 ABI support (IRIX only)],
204 [ if test "$enableval" = "yes"; then
205 USE_N32=1
206 else if test "$enableval" = "no"; then
207 USE_N32=
208 fi
209 fi ])
210
211AC_ARG_ENABLE(64bit,
212 [ --enable-64bit Enable 64-bit support (on certain platforms)],
213 [ if test "$enableval" = "yes"; then
214 USE_64=1
215 fi ])
216
217AC_ARG_ENABLE(mdupdate,
218 [ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
219 [ if test "$enableval" = "yes"; then
220 USE_MDUPDATE=1
221 fi ])
222
223AC_ARG_ENABLE(macos-target,
224 [ --enable-macos-target=VER (default=10.1)
225 Set the minimum MacOS version needed at runtime],
226 [MACOS_DEPLOYMENT_TARGET_STR=$enableval],
227 [MACOS_DEPLOYMENT_TARGET_STR=10.1])
228
229dnl ========================================================
230dnl =
231dnl = Set the threading model
232dnl =
233dnl ========================================================
234case "$target" in
235
236*-aix*)
237 case "${target_os}" in
238 aix3.2*)
239 USE_NSPR_THREADS=1
240 ;;
241 *)
242 USE_PTHREADS=1
243 ;;
244 esac
245 ;;
246
247esac
248
249dnl ========================================================
250dnl =
251dnl = Set the default C compiler
252dnl =
253dnl ========================================================
254if test -z "$CC"; then
255 case "$target" in
256
257 *-aix*)
258 if test -z "$USE_NSPR_THREADS"; then
259 CC=xlc_r
260 else
261 CC=xlc
262 fi
263 ;;
264
265 *-hpux*)
266 CC=cc
267 ;;
268
269 *-irix*)
270 CC=cc
271 ;;
272
273 *-openvms*)
274 CC=cc
275 ;;
276
277 *-osf*)
278 CC=cc
279 ;;
280
281 *-solaris*)
282 CC=cc
283 ;;
284
285 esac
286fi
287
288dnl ========================================================
289dnl =
290dnl = Set the default C++ compiler
291dnl =
292dnl ========================================================
293if test -z "$CXX"; then
294 case "$target" in
295
296 *-aix*)
297 if test -z "$USE_NSPR_THREADS"; then
298 CXX=xlC_r
299 else
300 CXX=xlC
301 fi
302 ;;
303
304 *-hpux*)
305 case "${target_os}" in
306 hpux10.30)
307 CXX=aCC
308 ;;
309 hpux11.*)
310 CXX=aCC
311 ;;
312 *)
313 CXX=CC
314 ;;
315 esac
316 ;;
317
318 *-irix*)
319 CXX=CC
320 ;;
321
322 *-openvms*)
323 CXX=cxx
324 ;;
325
326 *-osf*)
327 CXX=cxx
328 ;;
329
330 *-solaris*)
331 CXX=CC
332 ;;
333
334 esac
335fi
336
337if test -z "$SKIP_PATH_CHECKS"; then
338 AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
339fi
340
341if test -n "$MOZ_DEBUG"; then
342 AC_DEFINE(DEBUG)
343 DEFINES="$DEFINES -UNDEBUG"
344
345 case "${target_os}" in
346 beos*)
347 DEFINES="$DEFINES -DDEBUG_${USER}"
348 ;;
349 msvc*|mks*|cygwin*|mingw*|os2*)
350 DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
351 ;;
352 *)
353 DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
354 ;;
355 esac
356else
357 AC_DEFINE(NDEBUG)
358 DEFINES="$DEFINES -UDEBUG"
359fi
360
361if test -z "$SKIP_COMPILER_CHECKS"; then
362dnl ========================================================
363dnl Checks for compilers.
364dnl ========================================================
365if test "$target" != "$host"; then
366 echo "cross compiling from $host to $target"
367 cross_compiling=yes
368
369 _SAVE_CC="$CC"
370 _SAVE_CFLAGS="$CFLAGS"
371 _SAVE_LDFLAGS="$LDFLAGS"
372
373 AC_MSG_CHECKING([for $host compiler])
374 AC_CHECK_PROGS(HOST_CC, $HOST_CC gcc cc /usr/ucb/cc, "")
375 if test -z "$HOST_CC"; then
376 AC_MSG_ERROR([no acceptable cc found in \$PATH])
377 fi
378 AC_MSG_RESULT([$HOST_CC])
379 if test -z "$HOST_CFLAGS"; then
380 HOST_CFLAGS="$CFLAGS"
381 fi
382 if test -z "$HOST_LDFLAGS"; then
383 HOST_LDFLAGS="$LDFLAGS"
384 fi
385
386 CC="$HOST_CC"
387 CFLAGS="$HOST_CFLAGS"
388 LDFLAGS="$HOST_LDFLAGS"
389
390 AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
391 AC_TRY_COMPILE([], [return(0);],
392 [ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
393 AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
394
395 CC=$_SAVE_CC
396 CFLAGS=$_SAVE_CFLAGS
397 LDFLAGS=$_SAVE_LDFLAGS
398
399 AC_CHECK_PROGS(CC, $CC "${target_alias}-gcc" "${target}-gcc", echo)
400 unset ac_cv_prog_CC
401 AC_PROG_CC
402 AC_CHECK_PROGS(CXX, $CXX "${target_alias}-g++" "${target}-g++", echo)
403 unset ac_cv_prog_CXX
404 AC_PROG_CXX
405 AC_CHECK_PROGS(RANLIB, $RANLIB "${target_alias}-ranlib" "${target}-ranlib", echo)
406 AC_CHECK_PROGS(AR, $AR "${target_alias}-ar" "${target}-ar", echo)
407 AC_CHECK_PROGS(AS, $AS "${target_alias}-as" "${target}-as", echo)
408 AC_CHECK_PROGS(LD, $LD "${target_alias}-ld" "${target}-ld", echo)
409 AC_CHECK_PROGS(STRIP, $STRIP "${target_alias}-strip" "${target}-strip", echo)
410 AC_CHECK_PROGS(WINDRES, $WINDRES "${target_alias}-windres" "${target}-windres", echo)
411
412else
413 AC_PROG_CXX
414 if test "$CXX" = "cl" -a -z "$CC"; then
415 CC=$CXX
416 else
417 AC_PROG_CC
418 fi
419 AC_PROG_CPP
420 AC_PROG_RANLIB
421 AC_PATH_PROGS(AS, as, $CC)
422 AC_PATH_PROGS(AR, ar, echo not_ar)
423 AC_PATH_PROGS(LD, ld link, echo not_ld)
424 AC_PATH_PROGS(STRIP, strip, echo not_strip)
425 AC_PATH_PROGS(WINDRES, windres, echo not_windres)
426 if test -z "$HOST_CC"; then
427 HOST_CC="$CC"
428 fi
429 if test -z "$HOST_CFLAGS"; then
430 HOST_CFLAGS="$CFLAGS"
431 fi
432fi
433
434if test "$GCC" = "yes"; then
435 GNU_CC=1
436fi
437if test "$GXX" = "yes"; then
438 GNU_CXX=1
439fi
440if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
441 GNU_AS=1
442fi
443rm -f a.out
444
445if test "$cross_compiling" = "yes"; then
446 CROSS_COMPILE=1
447else
448 CROSS_COMPILE=
449fi
450
451dnl ========================================================
452dnl Check for gcc -pipe support
453dnl ========================================================
454AC_MSG_CHECKING([for gcc -pipe support])
455if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
456 echo '#include <stdio.h>' > dummy-hello.c
457 echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
458 ${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
459 cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
460 if test $? = 0; then
461 _res_as_stdin="yes"
462 else
463 _res_as_stdin="no"
464 fi
465 if test "$_res_as_stdin" = "yes"; then
466 _SAVE_CFLAGS=$CFLAGS
467 CFLAGS="$CFLAGS -pipe"
468 AC_TRY_COMPILE( [ #include <stdio.h> ],
469 [printf("Hello World\n");],
470 [_res_gcc_pipe="yes"],
471 [_res_gcc_pipe="no"] )
472 CFLAGS=$_SAVE_CFLAGS
473 fi
474 if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
475 _res="yes";
476 CFLAGS="$CFLAGS -pipe"
477 CXXFLAGS="$CXXFLAGS -pipe"
478 else
479 _res="no"
480 fi
481 rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
482 AC_MSG_RESULT([$_res])
483else
484 AC_MSG_RESULT([no])
485fi
486
487fi # SKIP_COMPILER_CHECKS
488
489dnl ========================================================
490dnl Checks for programs.
491dnl ========================================================
492if test -z "$SKIP_PATH_CHECKS"; then
493 AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
494elif test -z "$PERL"; then
495 PERL=perl
496fi
497
498dnl ========================================================
499dnl Default platform specific options
500dnl ========================================================
501OBJ_SUFFIX=o
502LIB_SUFFIX=a
503DLL_SUFFIX=so
504ASM_SUFFIX=s
505MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
506PR_MD_ASFILES=
507PR_MD_CSRCS=
508PR_MD_ARCH_DIR=unix
509AR_FLAGS='cr $@'
510AS='$(CC)'
511ASFLAGS='$(CFLAGS)'
512
513if test -n "$CROSS_COMPILE"; then
514 OS_ARCH=`echo $target_os | sed -e 's|/|_|g'`
515 OS_RELEASE=
516 OS_TEST="${target_cpu}"
517 case "${target_os}" in
518 linux*) OS_ARCH=Linux ;;
519 solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
520 mingw*) OS_ARCH=WINNT ;;
521 esac
522else
523 OS_ARCH=`uname -s | sed -e 's|/|_|g'`
524 OS_RELEASE=`uname -r`
525 OS_TEST=`uname -m`
526fi
527
528if test "$OS_ARCH" = "IRIX64"; then
529 OS_ARCH=IRIX
530fi
531
532if test "$OS_ARCH" = "AIX"; then
533 OS_RELEASE=`uname -v`.`uname -r`
534fi
535
536if test "$OS_ARCH" = "FreeBSD"; then
537 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
538fi
539
540if test "$OS_ARCH" = "Linux"; then
541 OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
542 OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
543fi
544
545if test "$OS_ARCH" = "OpenVMS"; then
546 OS_RELEASE=`uname -v`
547fi
548
549#######################################################################
550# Master "Core Components" macros for getting the OS target #
551#######################################################################
552
553#
554# Note: OS_TARGET should be specified on the command line for gmake.
555# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
556# The difference between the Win95 target and the WinNT target is that
557# the WinNT target uses Windows NT specific features not available
558# in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
559# at lesser performance (the Win95 target uses threads; the WinNT target
560# uses fibers).
561#
562# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
563# is built. See: win16_3.11.mk for lots more about the Win16 target.
564#
565# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
566# cross-compilation.
567#
568
569#
570# The following hack allows one to build on a WIN95 machine (as if
571# s/he were cross-compiling on a WINNT host for a WIN95 target).
572# It also accomodates for MKS's uname.exe. If you never intend
573# to do development on a WIN95 machine, you don't need this hack.
574#
575if test "$OS_ARCH" = "WIN95"; then
576 OS_ARCH=WINNT
577 OS_TARGET=WIN95
578elif test "$OS_ARCH" = 'Windows_95'; then
579 OS_ARCH=Windows_NT
580 OS_TARGET=WIN95
581elif test "$OS_ARCH" = 'Windows_98'; then
582 OS_ARCH=Windows_NT
583 OS_TARGET=WIN95
584elif test "`echo $OS_ARCH | egrep -c '^(CYGWIN_9|CYGWIN_ME)' 2>/dev/null`" != 0; then
585 OS_ARCH='CYGWIN_NT-4.0'
586 OS_TARGET=WIN95
587elif test "$OS_ARCH" = "OS_2"; then
588 OS_ARCH=OS2
589 OS_TARGET=OS2
590fi
591
592#
593# On WIN32, we also define the variable CPU_ARCH.
594#
595
596if test "$OS_ARCH" = "WINNT"; then
597 CPU_ARCH=`uname -p`
598 if test "$CPU_ARCH" = "I386"; then
599 CPU_ARCH=x86
600 fi
601elif test "$OS_ARCH" = "Windows_NT"; then
602#
603# If uname -s returns "Windows_NT", we assume that we are using
604# the uname.exe in MKS toolkit.
605#
606# The -r option of MKS uname only returns the major version number.
607# So we need to use its -v option to get the minor version number.
608# Moreover, it doesn't have the -p option, so we need to use uname -m.
609#
610 OS_ARCH=WINNT
611 OS_MINOR_RELEASE=`uname -v`
612 if test "$OS_MINOR_RELEASE" = "00"; then
613 OS_MINOR_RELEASE=0
614 fi
615 OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
616 CPU_ARCH=`uname -m`
617 #
618 # MKS's uname -m returns "586" on a Pentium machine.
619 #
620 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
621 CPU_ARCH=x86
622 fi
623elif echo "$OS_ARCH" | grep -c CYGWIN_NT >/dev/null; then
624#
625# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
626# the uname.exe in the Cygwin tools.
627#
628 OS_RELEASE=`echo $OS_ARCH | sed 's|^CYGWIN_NT-||'`
629 OS_ARCH=WINNT
630 CPU_ARCH=`uname -m`
631 #
632 # Cygwin's uname -m returns "i686" on a Pentium Pro machine.
633 #
634 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
635 CPU_ARCH=x86
636 fi
637elif test "$OS_ARCH" = "CYGWIN32_NT"; then
638#
639# Prior to the Beta 20 release, Cygwin was called GNU-Win32.
640# If uname -s returns "CYGWIN32/NT", we assume that we are using
641# the uname.exe in the GNU-Win32 tools.
642#
643 OS_ARCH=WINNT
644 CPU_ARCH=`uname -m`
645 #
646 # GNU-Win32's uname -m returns "i686" on a Pentium Pro machine.
647 #
648 if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
649 CPU_ARCH=x86
650 fi
651fi
652
653if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
654 OS_TARGET=WIN95
655 if test -n "$MOZ_DEBUG"; then
656 USE_DEBUG_RTL=1
657 fi
658fi
659if test -z "$OS_TARGET"; then
660 OS_TARGET=$OS_ARCH
661fi
662if test "$OS_TARGET" = "WIN95"; then
663 OS_RELEASE="4.0"
664fi
665if test "$OS_TARGET" = "WIN16"; then
666 OS_RELEASE=
667fi
668OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
669
670dnl ========================================================
671
672dnl ========================================================
673dnl Override of system specific host options
674dnl ========================================================
675case "$host" in
676*-mingw*|*-cygwin*|*-msvc*|*-mks*)
677 NSINSTALL='$(CYGWIN_WRAPPER) nsinstall'
678 if test `echo "${PATH}" | grep -c \;` = 0; then
679 CYGWIN_WRAPPER='sh $(topsrcdir)/build/cygwin-wrapper'
680 fi
681 ;;
682*-beos*)
683 HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
684 ;;
685*os2*)
686 ;;
687*)
688 HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
689 ;;
690esac
691
692dnl ========================================================
693dnl Override of system specific target options
694dnl ========================================================
695case "$target" in
696
697*-aix*)
698 AC_DEFINE(XP_UNIX)
699 AC_DEFINE(AIX)
700 AC_DEFINE(SYSV)
701 DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
702 AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
703 case "${target_os}" in
704 aix3.2*)
705 AC_DEFINE(AIX_RENAME_SELECT)
706 AC_DEFINE(_PR_NO_LARGE_FILES)
707 AIX_LINK_OPTS='-bnso -berok'
708 PR_MD_ASFILES=os_AIX.s
709 ;;
710 aix4.1*)
711 AC_DEFINE(AIX_TIMERS)
712 AC_DEFINE(_PR_NO_LARGE_FILES)
713 AC_DEFINE(AIX4_1)
714 MKSHLIB=
715 DSO_LDOPTS=
716 AIX_LINK_OPTS='-bnso -berok'
717 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
718 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
719 ;;
720 aix4.2*)
721 AC_DEFINE(AIX_TIMERS)
722 AC_DEFINE(_PR_HAVE_OFF64_T)
723 AIX_LINK_OPTS='-brtl -bnso -berok'
724 ;;
725 aix4.3*)
726 AC_DEFINE(AIX_TIMERS)
727 AC_DEFINE(_PR_HAVE_OFF64_T)
728 AC_DEFINE(AIX4_3_PLUS)
729 AC_DEFINE(HAVE_SOCKLEN_T)
730 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
731 USE_IPV6=1
732 AIX_LINK_OPTS='-brtl -bnso -berok'
733 ;;
734 *)
735 AC_DEFINE(AIX_TIMERS)
736 AC_DEFINE(_PR_HAVE_OFF64_T)
737 AC_DEFINE(AIX4_3_PLUS)
738 AC_DEFINE(HAVE_SOCKLEN_T)
739 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
740 USE_IPV6=1
741 AIX_LINK_OPTS='-brtl -bnso -berok'
742 ;;
743 esac
744 CFLAGS="$CFLAGS -qro -qroconst"
745 AIX_WRAP='$(DIST)/lib/aixwrap.o'
746 AIX_TMP='./_aix_tmp.o'
747 if test -n "$USE_64"; then
748 MDCPUCFG_H=_aix64.cfg
749 OBJECT_MODE=64
750 else
751 MDCPUCFG_H=_aix32.cfg
752 fi
753 PR_MD_CSRCS=aix.c
754 RESOLVE_LINK_SYMBOLS=1
755 ;;
756
757*-beos*)
758 AC_DEFINE(XP_BEOS)
759 AC_DEFINE(BeOS)
760 AC_DEFINE(BEOS)
761 AC_DEFINE(_POSIX_SOURCE)
762 DSO_LDOPTS=-nostart
763 MDCPUCFG_H=_beos.cfg
764 USE_BTHREADS=1
765 PR_MD_ARCH_DIR=beos
766 RESOLVE_LINK_SYMBOLS=1
767 case "${target_cpu}" in
768 i*86)
769 _OPTIMIZE_FLAGS=-O2
770 _DEBUG_FLAGS='-gdwarf-2 -O0'
771 MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
772 AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
773 ;;
774 powerpc)
775 CC=mwcc
776 CCC=mwcc
777 LD=mwld
778 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'
779 _OPTIMIZE_FLAGS=-O2
780 _DEBUG_FLAGS='-g -O0'
781 ;;
782 esac
783 ;;
784
785*-bsdi*)
786 AC_DEFINE(XP_UNIX)
787 AC_DEFINE(BSDI)
788 AC_DEFINE(NEED_BSDREGEX)
789
790 CFLAGS="$CFLAGS -Wall -Wno-format"
791 CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
792
793 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
794 CPU_ARCH=x86
795 elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
796 CPU_ARCH=sparc
797 fi
798
799 MDCPUCFG_H=_bsdi.cfg
800 PR_MD_CSRCS=bsdi.c
801
802 DSO_LDOPTS=-r
803
804 case "$target_os" in
805 bsdi1.1*)
806 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
807 AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
808 AC_DEFINE(_PR_NEED_H_ERRNO)
809 MKSHLIB=
810 DSO_CFLAGS=
811 DSO_LDOPTS=
812 ;;
813
814 bsdi2.1*)
815 AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
816 AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
817 AC_DEFINE(HAVE_DLL)
818 AC_DEFINE(USE_DLFCN)
819 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
820 PR_MD_ASFILES=os_BSD_OS_386_2.s
821 ;;
822
823 bsdi4.* | bsdi5.*)
824 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
825 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
826 AC_DEFINE(HAVE_DLL)
827 AC_DEFINE(USE_DLFCN)
828 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
829 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
830 DSO_CFLAGS=-fPIC
831 DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
832 STRIP="$STRIP -d"
833 case "$target_os" in
834 bsdi4.2* | bsdi4.3* | bsdi5.*)
835 AC_DEFINE(_PR_HAVE_GETPROTO_R)
836 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
837 ;;
838 esac
839 ;;
840 *)
841 AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
842 AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
843 AC_DEFINE(HAVE_DLL)
844 AC_DEFINE(USE_DLFCN)
845 AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
846 ;;
847 esac
848
849 ;;
850
851*-darwin*)
852 AC_DEFINE(XP_UNIX)
853 AC_DEFINE(DARWIN)
854 AC_DEFINE(HAVE_BSD_FLOCK)
855 CFLAGS="$CFLAGS -Wmost -fno-common"
856 if echo $OS_TEST | grep -c 86 2>/dev/null; then
857 AC_DEFINE(i386)
858 CPU_ARCH=i386
859 else
860 AC_DEFINE(ppc)
861 CPU_ARCH=ppc
862 fi
863 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
864 # Use the standard preprocessor (cpp)
865 CFLAGS="$CFLAGS -no-cpp-precomp"
866 MKSHLIB='$(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS) -o $@'
867 STRIP="$STRIP -x -S"
868 DLL_SUFFIX=dylib
869 USE_PTHREADS=1
870 MDCPUCFG_H=_darwin.cfg
871 PR_MD_CSRCS=darwin.c
872 if test "$CPU_ARCH" = "ppc"; then
873 PR_MD_ASFILES=os_Darwin_ppc.s
874 fi
875
876 # Add Mac OS X support for loading CFM & CFBundle plugins
877 if test -f /System/Library/Frameworks/Carbon.framework/Carbon; then
878 AC_DEFINE(XP_MACOSX)
879 OS_TARGET=MacOSX
880
881 dnl The C preprocessor can only handle integers in comparisons, so
882 dnl convert the version to the form AABBCC where AA=major release,
883 dnl BB=minor release, and CC=point/micro release.
884
885 MACOS_VERSION_MAJOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 1`
886 MACOS_VERSION_MINOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 2`
887 MACOS_VERSION_MICRO=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 3`
888 if test -z "$MACOS_VERSION_MINOR"; then
889 MACOS_VERSION_MINOR=0
890 fi
891 if test -z "$MACOS_VERSION_MICRO"; then
892 MACOS_VERSION_MICRO=0
893 fi
894 MACOS_DEPLOYMENT_TARGET=`printf "%02d%02d%02d" "$MACOS_VERSION_MAJOR" "$MACOS_VERSION_MINOR" "$MACOS_VERSION_MICRO"`
895 AC_DEFINE_UNQUOTED(MACOS_DEPLOYMENT_TARGET, $MACOS_DEPLOYMENT_TARGET)
896 fi
897
898 # do the right thing for panther SDK support
899 if test "$NEXT_ROOT"; then
900 CFLAGS="-I${NEXT_ROOT}/usr/include $CFLAGS"
901 CXXFLAGS="-I${NEXT_ROOT}/usr/include $CXXFLAGS"
902 fi
903 ;;
904
905*-dgux*)
906 AC_DEFINE(XP_UNIX)
907 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
908 AC_DEFINE(SVR4)
909 AC_DEFINE(SYSV)
910 AC_DEFINE(DGUX)
911 AC_DEFINE(_DGUX_SOURCE)
912 AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
913 DSO_LDOPTS=-G
914 _OPTIMIZE_FLAGS=-O2
915 _DEBUG_FLAGS=
916 MDCPUCFG_H=_dgux.cfg
917 PR_MD_CSRCS=dgux.c
918 ;;
919
920*-freebsd*)
921 if test -z "$USE_NSPR_THREADS"; then
922 USE_PTHREADS=1
923 fi
924 AC_DEFINE(XP_UNIX)
925 AC_DEFINE(FREEBSD)
926 AC_DEFINE(HAVE_BSD_FLOCK)
927 AC_DEFINE(HAVE_SOCKLEN_T)
928 CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
929 MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
930 if test "$MOZ_OBJFORMAT" = "elf"; then
931 DLL_SUFFIX=so
932 else
933 DLL_SUFFIX=so.1.0
934 fi
935 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
936 DSO_CFLAGS=-fPIC
937 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
938 MDCPUCFG_H=_freebsd.cfg
939 PR_MD_CSRCS=freebsd.c
940 ;;
941
942*-hpux*)
943 AC_DEFINE(XP_UNIX)
944 AC_DEFINE(HPUX)
945 AC_DEFINE(_HPUX_SOURCE)
946 AC_DEFINE(hppa)
947 # OSF1 and HPUX report the POLLHUP event for a socket when the
948 # shutdown(SHUT_WR) operation is called for the remote end, even though
949 # the socket is still writeable. Use select(), instead of poll(), to
950 # workaround this problem.
951 AC_DEFINE(_PR_POLL_WITH_SELECT)
952 AC_DEFINE(_USE_BIG_FDS)
953 DLL_SUFFIX=sl
954 DSO_LDOPTS='-b +h $(notdir $@)'
955 PR_MD_CSRCS=hpux.c
956 if test "$OS_TEST" != "ia64"; then
957 PR_MD_ASFILES=os_HPUX.s
958 fi
959 if test -n "$USE_64"; then
960 MDCPUCFG_H=_hpux64.cfg
961 else
962 MDCPUCFG_H=_hpux32.cfg
963 fi
964 if test -z "$GNU_CC"; then
965 CC="$CC -Ae"
966 CXX="$CXX -ext"
967 DSO_CFLAGS=+Z
968 else
969 DSO_CFLAGS=-fPIC
970 fi
971
972 if test -n "$MOZILLA_CLIENT"; then
973 DEFAULT_IMPL_STRATEGY=_EMU
974 fi
975
976 if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
977 AC_DEFINE(_PR_NEED_H_ERRNO)
978 AC_DEFINE(HPUX9)
979 DEFAULT_IMPL_STRATEGY=_EMU
980 USE_NSPR_THREADS=1
981 fi
982
983 if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
984 AC_DEFINE(_PR_NO_LARGE_FILES)
985 fi
986
987 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
988 AC_DEFINE(_PR_NEED_H_ERRNO)
989 fi
990
991 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
992 AC_DEFINE(HAVE_INT_LOCALTIME_R)
993 fi
994
995 if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
996 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
997 fi
998
999 # HP-UX 11i (B.11.11) or higher
1000 changequote(<<,>>)
1001 case "$OS_RELEASE" in
1002 [C-Z]*|B.[2-9]*|B.1[2-9]*|B.11.[2-9]*|B.11.1[1-9]*)
1003 USE_IPV6=1
1004 ;;
1005 esac
1006 changequote([,])
1007
1008 if test "$OS_RELEASE" = "B.10.01"; then
1009 AC_DEFINE(HPUX10)
1010 DEFAULT_IMPL_STRATEGY=_EMU
1011 fi
1012
1013 if test "$OS_RELEASE" = "B.10.10"; then
1014 AC_DEFINE(HPUX10)
1015 AC_DEFINE(HPUX10_10)
1016 DEFAULT_IMPL_STRATEGY=_PTH
1017 fi
1018
1019 if test "$OS_RELEASE" = "B.10.20"; then
1020 AC_DEFINE(HPUX10)
1021 AC_DEFINE(HPUX10_20)
1022 if test -z "$GNU_CC"; then
1023 CFLAGS="$CFLAGS +DAportable +DS1.1"
1024 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1025 fi
1026 DEFAULT_IMPL_STRATEGY=_PTH
1027 fi
1028
1029 if test "$OS_RELEASE" = "B.10.30"; then
1030 AC_DEFINE(HPUX10)
1031 AC_DEFINE(HPUX10_30)
1032 if test -z "$GNU_CC"; then
1033 CFLAGS="$CFLAGS +DAportable +DS1.1"
1034 CXXFLAGS="$CXXFLAGS +DAportable +DS1.1"
1035 fi
1036 DEFAULT_IMPL_STRATEGY=_PTH
1037 fi
1038
1039 if echo "$OS_RELEASE" | grep ^B.11 >/dev/null; then
1040 AC_DEFINE(HPUX10)
1041 AC_DEFINE(HPUX11)
1042 AC_DEFINE(_LARGEFILE64_SOURCE)
1043 AC_DEFINE(_PR_HAVE_OFF64_T)
1044 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1045 if test -z "$GNU_CC"; then
1046 if test -z "$USE_64"; then
1047 if test "$OS_TEST" = "ia64"; then
1048 CFLAGS="$CFLAGS +DD32"
1049 CXXFLAGS="$CXXFLAGS +DD32"
1050 else
1051 CFLAGS="$CFLAGS +DAportable +DS2.0"
1052 CXXFLAGS="$CXXFLAGS +DAportable +DS2.0"
1053 fi
1054 else
1055 if test "$OS_TEST" = "ia64"; then
1056 CFLAGS="$CFLAGS +DD64"
1057 CXXFLAGS="$CXXFLAGS +DD64"
1058 else
1059 CFLAGS="$CFLAGS +DA2.0W +DS2.0"
1060 CXXFLAGS="$CXXFLAGS +DA2.0W +DS2.0"
1061 fi
1062 fi
1063 fi
1064 DEFAULT_IMPL_STRATEGY=_PTH
1065 fi
1066
1067 if test "$DEFAULT_IMPL_STRATEGY" = "_EMU"; then
1068 USE_NSPR_THREADS=1
1069 USE_PTHREADS=
1070 USE_USER_THREADS=
1071 elif test "$DEFAULT_IMPL_STRATEGY" = "_PTH"; then
1072 USE_PTHREADS=1
1073 if test "$USE_NSPR_THREADS"; then
1074 USE_PTHREADS=
1075 fi
1076 if test "$USE_USER_PTHREADS"; then
1077 USE_PTHREADS=
1078 fi
1079 fi
1080 ;;
1081
1082*-irix*)
1083 AC_DEFINE(XP_UNIX)
1084 AC_DEFINE(IRIX)
1085 AC_DEFINE(SVR4)
1086 AC_DEFINE(_SGI_MP_SOURCE)
1087 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1088 PR_MD_CSRCS=irix.c
1089 PR_MD_ASFILES=os_Irix.s
1090 MKSHLIB='$(LD) $(DSO_LDOPTS) -rdata_shared -shared -soname $(notdir $@) -o $@'
1091 STRIP="$STRIP -f"
1092 RESOLVE_LINK_SYMBOLS=1
1093 if test -n "$USE_64"; then
1094 MDCPUCFG_H=_irix64.cfg
1095 else
1096 MDCPUCFG_H=_irix32.cfg
1097 fi
1098 case "${target_os}" in
1099 irix6*)
1100 AC_DEFINE(IRIX6)
1101 USE_PTHREADS=1
1102 USE_N32=1
1103 COMPILER_TAG=_n32
1104 IMPL_STRATEGY=_PTH
1105 ;;
1106 irix5*)
1107 AC_DEFINE(IRIX5)
1108 USE_NSPR_THREADS=1
1109 ;;
1110 *)
1111 USE_PTHREADS=1
1112 USE_N32=1
1113 ;;
1114 esac
1115 if test "$GNU_CC"; then
1116 dnl
1117 dnl If we are using gcc with native binutils, we need to
1118 dnl suppress the
1119 dnl #lineno "filename" num num
1120 dnl lines, which confuse IRIX native as. Add -Wp,-P to the
1121 dnl gcc command line, which passes -P to the preprocessor.
1122 dnl
1123 AS='$(CC) -Wp,-P -x assembler-with-cpp -D_ASM -mips2 $(INCLUDES)'
1124 CFLAGS="$CFLAGS -Wall -Wno-format"
1125 _OPTIMIZE_FLAGS="-O6"
1126 else
1127 if test -n "$USE_N32"; then
1128 AS='as -D_ASM $(INCLUDES) -n32'
1129 else
1130 AS='as -D_ASM $(INCLUDES)'
1131 fi
1132 CFLAGS="$CFLAGS -fullwarn -xansi"
1133 if test "$USE_N32"; then
1134 _OPTIMIZE_FLAGS="-O -OPT:Olimit=4000"
1135 else
1136 _OPTIMIZE_FLAGS="-O -Olimit 4000"
1137 fi
1138 if test "$USE_MDUPDATE"; then
1139 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1140 fi
1141 case "${target}" in
1142 *-irix6.*)
1143 CFLAGS="$CFLAGS -multigot"
1144 DSO_LDOPTS="-no_unresolved"
1145 if test "$USE_N32"; then
1146 CFLAGS="$CFLAGS -n32 -woff 1209"
1147 DSO_LDOPTS="$DSO_LDOPTS -n32"
1148 else
1149 if test "$USE_64"; then
1150 CFLAGS="$CFLAGS -64"
1151 else
1152 CFLAGS="$CFLAGS -32"
1153 fi
1154 fi
1155 ;;
1156 *)
1157 CFLAGS="$CFLAGS -xgot"
1158 ;;
1159 esac
1160 fi
1161 if test "${target_os}" = "irix5.3"; then
1162 AC_DEFINE(IRIX5_3)
1163 fi
1164 case "${target_os}" in
1165 irix6.5)
1166 if test -z "$GNU_CC"; then
1167 CFLAGS="$CFLAGS -mips3"
1168 fi
1169 AC_DEFINE(_PR_HAVE_GETPROTO_R)
1170 AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
1171 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1172 ;;
1173 irix5*)
1174 ;;
1175 *)
1176 AC_DEFINE(_PR_HAVE_SGI_PRDA_PROCMASK)
1177 ;;
1178 esac
1179 ;;
1180
1181*-linux*)
1182 if test -z "$USE_NSPR_THREADS"; then
1183 USE_PTHREADS=1
1184 IMPL_STRATEGY=_PTH
1185 fi
1186 AC_DEFINE(XP_UNIX)
1187 AC_DEFINE(_POSIX_SOURCE)
1188 AC_DEFINE(_BSD_SOURCE)
1189 AC_DEFINE(_SVID_SOURCE)
1190 AC_DEFINE(_LARGEFILE64_SOURCE)
1191 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1192 AC_DEFINE(LINUX)
1193 CFLAGS="$CFLAGS -ansi -Wall"
1194 CXXFLAGS="$CXXFLAGS -ansi -Wall"
1195 MDCPUCFG_H=_linux.cfg
1196 PR_MD_CSRCS=linux.c
1197 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1198 DSO_CFLAGS=-fPIC
1199 DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
1200 _OPTIMIZE_FLAGS=-O2
1201 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
1202 # combo is not yet good at debugging inlined
1203 # functions (even when using DWARF2 as the
1204 # debugging format)
1205 COMPILER_TAG=_glibc
1206 if echo "$OS_TEST" | grep -c 86 >/dev/null; then
1207 CPU_ARCH=x86
1208 else
1209 CPU_ARCH=$OS_TEST
1210 fi
1211 CPU_ARCH_TAG=_${CPU_ARCH}
1212 case "${target_cpu}" in
1213 alpha)
1214 AC_DEFINE(_ALPHA_)
1215 AC_DEFINE(__alpha)
1216 CFLAGS="$CFLAGS -mieee"
1217 CXXFLAGS="$CXXFLAGS -mieee"
1218 ;;
1219 i*86)
1220 AC_DEFINE(i386)
1221 PR_MD_ASFILES=os_Linux_x86.s
1222 ;;
1223 ia64)
1224 PR_MD_ASFILES=os_Linux_ia64.s
1225 ;;
1226 x86_64)
1227 PR_MD_ASFILES=os_Linux_x86_64.s
1228 ;;
1229 m68k)
1230 CFLAGS="$CFLAGS -m68020-60"
1231 CXXFLAGS="$CXXFLAGS -m68020-60"
1232 ;;
1233 esac
1234 ;;
1235
1236*-mingw*|*-cygwin*|*-msvc*|*-mks*)
1237 AC_DEFINE(XP_PC)
1238 AC_DEFINE(WIN32)
1239 PR_MD_ARCH_DIR=windows
1240 RESOLVE_LINK_SYMBOLS=1
1241
1242 if test -n "$GNU_CC"; then
1243 CC="$CC -mno-cygwin"
1244 CXX="$CXX -mno-cygwin"
1245 DLL_SUFFIX=dll
1246 MKSHLIB='$(CC) -shared -Wl,--export-all-symbols -Wl,--out-implib -Wl,$(IMPORT_LIBRARY) $(DLLBASE) -o $(subst $(OBJDIR)/,,$(SHARED_LIBRARY))'
1247 RC=$WINDRES
1248 # Use temp file for windres (bug 213281)
1249 RCFLAGS='-O coff --use-temp-file'
1250 else
1251 CC=cl
1252 CXX=cl
1253 LD=link
1254 AR='lib -NOLOGO -OUT:"$@"'
1255 AR_FLAGS=
1256 RANLIB='echo not_ranlib'
1257 STRIP='echo not_strip'
1258 RC=rc.exe
1259 GARBAGE='$(OBJDIR)/vc20.pdb $(OBJDIR)/vc40.pdb'
1260 OBJ_SUFFIX=obj
1261 LIB_SUFFIX=lib
1262 DLL_SUFFIX=dll
1263
1264 # Determine compiler version
1265 CC_VERSION=`"${CC}" -v 2>&1 | grep Version | sed -e 's|.* Version ||' -e 's| .*||'`
1266 _CC_MAJOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $1 }'`
1267 _CC_MINOR_VERSION=`echo $CC_VERSION | awk -F\. '{ print $2 }'`
1268 MSC_VER=${_CC_MAJOR_VERSION}${_CC_MINOR_VERSION}
1269
1270 CFLAGS="$CFLAGS -W3 -nologo -GF -Gy"
1271 DLLFLAGS='-OUT:"$@"'
1272 _DEBUG_FLAGS=-Z7
1273 _OPTIMIZE_FLAGS=-O2
1274 if test -z "$MOZ_OPTIMIZE"; then
1275 CFLAGS="$CFLAGS -Od"
1276 fi
1277
1278 if test -n "$USE_DEBUG_RTL"; then
1279 CFLAGS="$CFLAGS -MDd"
1280 else
1281 CFLAGS="$CFLAGS -MD"
1282 fi
1283
1284 if test -n "$MOZ_DEBUG"; then
1285 AC_DEFINE(_DEBUG)
1286 else
1287 DEFINES="$DEFINES -U_DEBUG"
1288 fi
1289
1290 if test -n "$MOZ_OPTIMIZE"; then
1291 if test -n "$MOZ_PROFILE"; then
1292 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Z7"
1293 fi
1294 if test -n "$MOZ_DEBUG_SYMBOLS"; then
1295 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Zi"
1296 fi
1297 if test -n "$MOZ_PROFILE" -o -n "$MOZ_DEBUG_SYMBOLS"; then
1298 DLLFLAGS="$DLLFLAGS -DEBUG -OPT:REF"
1299 LDFLAGS="$LDFLAGS -DEBUG -OPT:REF"
1300 fi
1301 fi
1302
1303 if test -n "$MOZ_DEBUG"; then
1304 DLLFLAGS="$DLLFLAGS -DEBUG -DEBUGTYPE:CV"
1305 LDFLAGS="$LDFLAGS -DEBUG -DEBUGTYPE:CV"
1306 fi
1307
1308 if test "$OS_TARGET" = "WINNT"; then
1309 CFLAGS="$CFLAGS -GT"
1310 if test "$CPU_ARCH" = "x86"; then
1311 CFLAGS="$CFLAGS -G5"
1312 fi
1313 LIBNSPR='$(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1314 LIBPLC='$(dist_libdir)/libplc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1315 else
1316 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1317 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1318 fi
1319 fi # GNU_CC
1320
1321 if test -n "$USE_STATIC_TLS"; then
1322 AC_DEFINE(_PR_USE_STATIC_TLS)
1323 fi
1324
1325 if test "$OS_TARGET" = "WINNT"; then
1326 AC_DEFINE(WINNT)
1327 else
1328 AC_DEFINE(WIN95)
1329 # undefine WINNT as some versions of mingw gcc define it by default
1330 DEFINES="$DEFINES -UWINNT"
1331 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
1332 fi
1333
1334 if test "$CPU_ARCH" = "x86"; then
1335 CPU_ARCH_TAG=
1336 else
1337 CPU_ARCH_TAG=$CPU_ARCH
1338 fi
1339
1340 if test -n "$USE_DEBUG_RTL"; then
1341 OBJDIR_SUFFIX=OBJD
1342 fi
1343
1344 OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
1345 if test "$MSC_VER" = "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
1346 OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
1347 fi
1348
1349 case "$OS_TARGET" in
1350 WINNT)
1351 MDCPUCFG_H=_winnt.cfg
1352 ;;
1353 WIN95)
1354 MDCPUCFG_H=_win95.cfg
1355 ;;
1356 WIN16)
1357 MDCPUCFG_H=_win16.cfg
1358 ;;
1359 *)
1360 AC_MSG_ERROR([Missing OS_TARGET for ${target}. Use --enable-win32-target to set.])
1361 ;;
1362 esac
1363
1364 case "$target_cpu" in
1365 i*86)
1366 AC_DEFINE(_X86_)
1367 ;;
1368 alpha)
1369 AC_DEFINE(_ALPHA_)
1370 ;;
1371 mips)
1372 AC_DEFINE(_MIPS_)
1373 ;;
1374 *)
1375 AC_DEFINE(_CPU_ARCH_NOT_DEFINED)
1376 ;;
1377 esac
1378
1379 ;;
1380
1381*-ncr-sysv*)
1382 AC_DEFINE(XP_UNIX)
1383 AC_DEFINE(SVR4)
1384 AC_DEFINE(SYSV)
1385 AC_DEFINE(NCR)
1386 USE_NSPR_THREADS=1
1387 if test "$OS_RELEASE" = "2.03"; then
1388 AC_DEFINE(_PR_STAT_HAS_ST_ATIM)
1389 else
1390 AC_DEFINE(_PR_STAT_HAS_ST_ATIM_UNION)
1391 fi
1392
1393 if test -z "$GNU_CC"; then
1394 CFLAGS="$CFLAGS -Hnocopyr"
1395 CXXFLAGS="$CXXFLAGS -Hnocopyr"
1396 else
1397 CFLAGS="$CFLAGS -fPIC -Wall"
1398 CXXFLAGS="$CXXFLAGS -fPIC -Wall"
1399 DSO_LDOPTS=-G
1400 fi
1401 MDCPUCFG_H=_ncr.cfg
1402 PR_MD_CSRCS=ncr.c
1403 ;;
1404
1405mips-nec-sysv*)
1406 AC_DEFINE(XP_UNIX)
1407 AC_DEFINE(SVR4)
1408 AC_DEFINE(__SVR4)
1409 AC_DEFINE(NEC)
1410 AC_DEFINE(nec_ews)
1411 USE_NSPR_THREADS=1
1412 if test -z "$GNU_CC"; then
1413 CC='$(NSDEPTH)/build/hcc cc -Xa -KGnum=0 -KOlimit=4000'
1414 CXX=g++
1415 fi
1416 OS_LIBS="$OS_LIBS -lsocket -lnsl -ldl"
1417 DSO_LDOPTS=-G
1418 MDCPUCFG_H=_nec.cfg
1419 PR_MD_CSRCS=nec.c
1420 ;;
1421
1422*-netbsd*)
1423 AC_DEFINE(XP_UNIX)
1424 AC_DEFINE(NETBSD)
1425 AC_DEFINE(HAVE_BSD_FLOCK)
1426 USE_NSPR_THREADS=1
1427 MDCPUCFG_H=_netbsd.cfg
1428 PR_MD_CSRCS=netbsd.c
1429
1430 DSO_CFLAGS='-fPIC -DPIC'
1431 CFLAGS="$CFLAGS -ansi -Wall"
1432 CXXFLAGS="$CXXFLAGS -ansi -Wall"
1433 MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
1434
1435 if test -z "$OBJECT_FMT"; then
1436 if echo __ELF__ | ${CC-cc} -E - | grep -q __ELF__ 2>/dev/null; then
1437 OBJECT_FMT=a.out
1438 DLL_SUFFIX=so.1.0
1439 DSO_LDOPTS='-shared'
1440 else
1441 OBJECT_FMT=ELF
1442 DLL_SUFFIX=so
1443 DSO_LDOPTS='-shared -Wl,-soname,$(notdir $@)'
1444 fi
1445 fi
1446
1447 if test "$LIBRUNPATH"; then
1448 DSO_LDOPTS="$DSO_LDOPTS -Wl,-R$LIBRUNPATH"
1449 fi
1450 ;;
1451
1452mips-sony-newsos*)
1453 AC_DEFINE(XP_UNIX)
1454 AC_DEFINE(SONY)
1455 AC_DEFINE(SYSV)
1456 AC_DEFINE(SVR4)
1457 AC_DEFINE(__svr4)
1458 AC_DEFINE(__svr4__)
1459 AC_DEFINE(HAVE_SVID_GETTOD)
1460 USE_NSPR_THREADS=1
1461 CFLAGS="$CFLAGS -Xa -fullwarn"
1462 CXXFLAGS="$CXXFLAGS -Xa -fullwarn"
1463 DSO_LDOPTS=-G
1464 MDCPUCFG_H=_sony.cfg
1465 PR_MD_CSRCS=sony.c
1466 ;;
1467
1468*-nextstep*|*-openstep*)
1469 AC_DEFINE(XP_UNIX)
1470 AC_DEFINE(NEXTSTEP)
1471 AC_DEFINE(HAVE_BSD_FLOCK)
1472 AC_DEFINE(_POSIX_SOURCE)
1473 CFLAGS="$CFLAGS -Wall -fno-common -traditional-cpp -posix"
1474 CXXFLAGS="$CXXFLAGS -Wall -fno-common -traditional-cpp -posix"
1475 USE_NSPR_THREADS=1
1476 DLL_SUFFIX=dylib
1477 MDCPUCFG_H=_nextstep.cfg
1478 PR_MD_CSRCS=nextstep.c
1479 ;;
1480
1481
1482*-nto*)
1483 AC_DEFINE(XP_UNIX)
1484 AC_DEFINE(NTO)
1485 AC_DEFINE(_QNX_SOURCE)
1486 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1487 MDCPUCFG_H=_nto.cfg
1488 PR_MD_CSRCS=nto.c
1489 MKSHLIB='$(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(notdir $@) -o $@'
1490 DSO_CFLAGS=-fPIC
1491 DSO_LDOPTS=-shared
1492 OS_LIBS="$OS_LIBS -lsocket"
1493 _OPTIMIZE_FLAGS="-O1"
1494 _DEBUG_FLAGS="-gstabs"
1495 ;;
1496
1497*-openbsd*)
1498 AC_DEFINE(XP_UNIX)
1499 AC_DEFINE(OPENBSD)
1500 AC_DEFINE(HAVE_BSD_FLOCK)
1501 AC_DEFINE(HAVE_SOCKLEN_T)
1502 CFLAGS="$CFLAGS -ansi -Wall"
1503 CXXFLAGS="$CXXFLAGS -ansi -Wall"
1504 DLL_SUFFIX=so.1.0
1505 DSO_CFLAGS=-fPIC
1506 MDCPUCFG_H=_openbsd.cfg
1507 PR_MD_CSRCS=openbsd.c
1508 USE_NSPR_THREADS=1
1509 DSO_LDOPTS='-shared -fPIC'
1510 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1511 ;;
1512
1513*-openvms*)
1514 AC_DEFINE(XP_UNIX)
1515 AC_DEFINE(VMS)
1516 AC_DEFINE(PR_GETIPNODE_NOT_THREADSAFE)
1517 RESOLVE_LINK_SYMBOLS=1
1518 AR_FLAGS='c $@'
1519 MDCPUCFG_H=_openvms.cfg
1520 PR_MD_CSRCS=openvms.c
1521 DSO_LDOPTS='-shared -auto_symvec $(LDFLAGS)'
1522 if test -n "$MOZ_DEBUG"; then
1523 DSO_LDOPTS="$DSO_LDOPTS $_DEBUG_FLAGS"
1524 else
1525 DSO_LDOPTS="$DSO_LDOPTS $_OPTIMIZE_FLAGS"
1526 fi
1527 ;;
1528
1529*-osf*)
1530 SHELL_OVERRIDE="SHELL = /usr/bin/ksh"
1531 AC_DEFINE(XP_UNIX)
1532 AC_DEFINE(OSF1)
1533 AC_DEFINE(_REENTRANT)
1534 # OSF1 and HPUX report the POLLHUP event for a socket when the
1535 # shutdown(SHUT_WR) operation is called for the remote end, even though
1536 # the socket is still writeable. Use select(), instead of poll(), to
1537 # workaround this problem.
1538 AC_DEFINE(_PR_POLL_WITH_SELECT)
1539
1540 if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
1541 USE_NSPR_THREADS=1
1542 fi
1543
1544 if test -z "$GNU_CC"; then
1545 CC="$CC -std1 -ieee_with_inexact"
1546 if test "$OS_RELEASE" != "V2.0"; then
1547 CC="$CC -readonly_strings"
1548 fi
1549 _OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
1550 AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
1551 else
1552 CFLAGS="$CFLAGS -mieee"
1553 CXXFLAGS="$CXXFLAGS -mieee"
1554 fi
1555
1556 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
1557 AC_DEFINE(HAVE_INT_LOCALTIME_R)
1558 else
1559 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1560 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
1561 fi
1562 if echo $OS_RELEASE | grep -c V4.0 >/dev/null; then
1563 AC_DEFINE(OSF1V4_MAP_PRIVATE_BUG)
1564 fi
1565 DSO_LDOPTS='-shared -all -expect_unresolved "*" -soname $(notdir $@)'
1566 MDCPUCFG_H=_osf1.cfg
1567 PR_MD_CSRCS=osf1.c
1568 ;;
1569
1570*-qnx*)
1571 AC_DEFINE(XP_UNIX)
1572 AC_DEFINE(QNX)
1573 AC_DEFINE(_PR_NEED_H_ERRNO)
1574 USE_NSPR_THREADS=1
1575 MDCPUCFG_H=_qnx.cfg
1576 PR_MD_CSRCS=qnx.c
1577 ;;
1578
1579*-*-sco*)
1580 AC_DEFINE(XP_UNIX)
1581 AC_DEFINE(SCO)
1582 AC_DEFINE(sco)
1583 AC_DEFINE(SYSV)
1584 AC_DEFINE(_SVID3)
1585 AC_DEFINE(_PR_NEED_H_ERRNO)
1586 CC='cc -b elf -KPIC'
1587 CXX='$(NSDEPTH)/build/hcpp CC +.cpp +w'
1588 USE_NSPR_THREADS=1
1589 CPU_ARCH=x86
1590 DSO_LDOPTS='-b elf -G'
1591 MDCPUCFG_H=_scoos.cfg
1592 PR_MD_SRCS=scoos.c
1593 ;;
1594
1595*-sinix*)
1596 AC_DEFINE(XP_UNIX)
1597 AC_DEFINE(SVR4)
1598 AC_DEFINE(SNI)
1599 AC_DEFINE(RELIANTUNIX)
1600 AC_DEFINE(sinix)
1601 AC_DEFINE(HAVE_SVID_GETTOD)
1602 if echo "$OS_TEST" | grep -c 86 2>/dev/null; then
1603 AC_DEFINE(i386)
1604 CPU_ARCH=x86
1605 else
1606 CPU_ARCH=mips
1607 fi
1608
1609 if test "$GNU_CC"; then
1610 AS='$(CC) -x assembler-with-cpp'
1611 if test "$CPU_ARCH" = "mips"; then
1612 LD=gld
1613 fi
1614 CFLAGS="$CFLAGS -Wall -Wno-format"
1615 else
1616 AS='/usr/bin/cc'
1617 _OPTIMIZE_FLAGS='-O -F Olimit,4000'
1618 fi
1619
1620 DSO_LDOPTS='-G -z defs -h $(@:$(OBJDIR)/%.so=%.so)'
1621
1622 if test "$OS_RELEASE" = "5.43"; then
1623 AC_DEFINE(IP_MULTICAST)
1624 fi
1625
1626 OS_LIBS="$OS_LIBS -lsocket -lnsl -lresolv -ldl -lc"
1627 USE_NSPR_THREADS=1
1628 MDCPUCFG_H=_reliantunix.cfg
1629 PR_MD_CSRCS=reliantunix.c
1630 if test "${OS_ARCH}" = "mips"; then
1631 PR_MD_ASFILES=os_ReliantUNIX.s
1632 fi
1633 ;;
1634
1635*-sunos*)
1636 AC_DEFINE(XP_UNIX)
1637 AC_DEFINE(SUNOS4)
1638 CFLAGS="$CFLAGS -Wall -Wno-format"
1639 if test "$USE_MDUPDATE"; then
1640 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1641 fi
1642 CPU_ARCH=sparc
1643 DLL_SUFFIX=so.1.0
1644 DSO_LDOPTS=
1645 DSO_CFLAGS=-fPIC
1646 USE_NSPR_THREADS=1
1647 if test "$OS_RELEASE" = "4.1.3_U1"; then
1648 _OPTIMIZE_FLAGS=
1649 OS_LIBS="$OS_LIBS -lm"
1650 fi
1651 MDCPUCFG_H=_sunos4.cfg
1652 PR_MD_CSRCS=sunos4.c
1653 ;;
1654
1655*-solaris*)
1656 if test -z "$USE_USER_THREADS" && test -z "$USE_NATIVE_THREADS"; then
1657 USE_PTHREADS=1
1658 fi
1659 AC_DEFINE(XP_UNIX)
1660 AC_DEFINE(SVR4)
1661 AC_DEFINE(SYSV)
1662 AC_DEFINE(__svr4)
1663 AC_DEFINE(__svr4__)
1664 AC_DEFINE(SOLARIS)
1665 AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
1666 if test -n "$USE_64"; then
1667 MDCPUCFG_H=_solaris64.cfg
1668 else
1669 MDCPUCFG_H=_solaris32.cfg
1670 fi
1671 PR_MD_CSRCS=solaris.c
1672 LD=/usr/ccs/bin/ld
1673 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1674 RESOLVE_LINK_SYMBOLS=1
1675 if test -n "$GNU_CC"; then
1676 DSO_CFLAGS=-fPIC
1677 if `$CC -print-prog-name=ld` -v 2>&1 | grep -c GNU >/dev/null; then
1678 GCC_USE_GNU_LD=1
1679 fi
1680 DSO_LDOPTS='-shared -Wl,-h,$(notdir $@),-z,combreloc,-z,defs'
1681 else
1682 DSO_CFLAGS=-KPIC
1683 DSO_LDOPTS='-G -h $(notdir $@) -z combreloc -z defs'
1684 fi
1685 if test -z "$GNU_AS"; then
1686 ASFLAGS="$ASFLAGS -Wa,-P"
1687 fi
1688 if test -n "$GNU_CC"; then
1689 CFLAGS="$CFLAGS -Wall"
1690 CXXFLAGS="$CXXFLAGS -Wall"
1691 if test -n "$USE_MDUPDATE"; then
1692 CFLAGS="$CFLAGS -MDupdate \$(DEPENDENCIES)"
1693 CXXFLAGS="$CXXFLAGS -MDupdate \$(DEPENDENCIES)"
1694 fi
1695 else
1696 CFLAGS="$CFLAGS -xstrconst"
1697 CXXFLAGS="$CXXFLAGS -Qoption cg -xstrconst -features=tmplife"
1698 if test -z "$MOZ_OPTIMIZE"; then
1699 CFLAGS="$CFLAGS -xs"
1700 CXXFLAGS="$CXXFLAGS -xs"
1701 fi
1702 _OPTIMIZE_FLAGS=-xO4
1703 fi
1704 if test -n "$USE_64"; then
1705 if test -n "$GNU_CC"; then
1706 CC="$CC -m64"
1707 CXX="$CXX -m64"
1708 else
1709 CC="$CC -xarch=v9"
1710 CXX="$CXX -xarch=v9"
1711 fi
1712 fi
1713 if test "$OS_TEST" = "i86pc"; then
1714 AC_DEFINE(i386)
1715 CPU_ARCH_TAG=_$OS_TEST
1716 # The default debug format, DWARF (-g), is not supported by gcc
1717 # on i386-ANY-sysv4/solaris, but the stabs format is. It is
1718 # assumed that the Solaris assembler /usr/ccs/bin/as is used.
1719 # If your gcc uses GNU as, you do not need the -Wa,-s option.
1720 if test -n "$MOZ_DEBUG" && test -n "$GNU_CC"; then
1721 _DEBUG_FLAGS=-gstabs
1722 if test -z "$GNU_AS"; then
1723 _DEBUG_FLAGS="$_DEBUG_FLAGS -Wa,-s"
1724 fi
1725 fi
1726 fi
1727 case "${target_os}" in
1728 solaris2.3*)
1729 AC_DEFINE(_PR_NO_LARGE_FILES)
1730 ;;
1731 solaris2.4*)
1732 AC_DEFINE(_PR_NO_LARGE_FILES)
1733 ;;
1734 solaris2.5*)
1735 AC_DEFINE(SOLARIS2_5)
1736 ;;
1737 *)
1738 AC_DEFINE(_PR_HAVE_OFF64_T)
1739 # The lfcompile64(5) man page on Solaris 2.6 says:
1740 # For applications that do not wish to conform to the POSIX or
1741 # X/Open specifications, the 64-bit transitional interfaces
1742 # are available by default. No compile-time flags need to be
1743 # set.
1744 # But gcc 2.7.2.x fails to define _LARGEFILE64_SOURCE by default.
1745 # The native compiler, gcc 2.8.x, and egcs don't have this problem.
1746 if test -n "$GNU_CC"; then
1747 AC_DEFINE(_LARGEFILE64_SOURCE)
1748 fi
1749 ;;
1750 esac
1751 case "${target_os}" in
1752 solaris2.3*)
1753 ;;
1754 solaris2.4*)
1755 ;;
1756 solaris2.5*)
1757 ;;
1758 solaris2.6*)
1759 ;;
1760 solaris2.7*)
1761 ;;
1762 *)
1763 # Solaris 8 or higher has IPv6.
1764 AC_DEFINE(_PR_INET6)
1765 ;;
1766 esac
1767 if test "$OS_TEST" = "sun4u"; then
1768 # 64-bit Solaris requires SPARC V9 architecture, so the following
1769 # is not needed.
1770 if test -z "$USE_64"; then
1771 ULTRASPARC_LIBRARY=nspr_flt
1772 fi
1773 fi
1774 # Purify requires that binaries linked against nspr also
1775 # be linked against -lrt (or -lposix4) so add it to OS_LIBS
1776 _rev=`uname -r`
1777 _librt=`echo $_rev 5.6 | awk '{ if ($1 > $2) print "-lrt"; else print "-lposix4" }'`
1778 OS_LIBS="$OS_LIBS $_librt"
1779 ;;
1780
1781*-sco-sysv5*)
1782 AC_DEFINE(XP_UNIX)
1783 AC_DEFINE(UNIXWARE)
1784 AC_DEFINE(SVR4)
1785 AC_DEFINE(SYSV)
1786 USE_NSPR_THREADS=1
1787 if echo $OS_RELEASE | grep -c 2.1 2>/dev/null; then
1788 AC_DEFINE(_PR_NO_LARGE_FILES)
1789 CC='$(NSDEPTH)/build/hcc cc'
1790 CXX='$(NSDEPTH)/build/hcpp CC'
1791 MDCPUCFG_H=_unixware.cfg
1792 else
1793 AC_DEFINE(_LARGEFILE64_SOURCE)
1794 AC_DEFINE(_PR_HAVE_OFF64_T)
1795 AC_DEFINE(_PR_HAVE_SOCKADDR_LEN)
1796 MDCPUCFG_H=_unixware7.cfg
1797 fi
1798 PR_MD_CSRCS=unixware.c
1799 DSO_LDOPTS=-G
1800 CPU_ARCH=x86
1801 ;;
1802
1803*-os2*)
1804 AC_DEFINE(XP_OS2)
1805 AC_DEFINE(XP_PC)
1806 AC_DEFINE(BSD_SELECT)
1807 AC_DEFINE(TCPV40HDRS)
1808 LIB_SUFFIX=lib
1809 DLL_SUFFIX=dll
1810 RC=rc.exe
1811 PR_MD_ARCH_DIR=os2
1812 PROG_SUFFIX=.exe
1813 NSINSTALL=nsinstall
1814 MDCPUCFG_H=_os2.cfg
1815 RESOLVE_LINK_SYMBOLS=1
1816
1817 # EMX/GCC build
1818 if test -n "$GNU_CC"; then
1819 AC_DEFINE(XP_OS2_EMX)
1820 AC_DEFINE(OS2)
1821 AR=emxomfar
1822 AR_FLAGS='r $@'
1823 CFLAGS="$CFLAGS -Wall -Zomf"
1824 CXXFLAGS="$CFLAGS -Wall -Zomf"
1825 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
1826 DSO_CFLAGS=
1827 DSO_LDOPTS='-Zomf -Zdll -Zmap'
1828 LDFLAGS='-Zmap'
1829 _OPTIMIZE_FLAGS="-O2 -s"
1830 _DEBUG_FLAGS="-g -fno-inline"
1831 if test -n "$MOZ_OPTIMIZE"; then
1832 DSO_LDOPTS="$DSO_LDOPTS -Zlinker /EXEPACK:2 -Zlinker /PACKCODE -Zlinker /PACKDATA"
1833 fi
1834 OS_LIBS="-lsocket"
1835 IMPLIB='emximp -o'
1836 FILTER='emxexp -o'
1837
1838 # GCC for OS/2 currently predefines these, but we don't want them
1839 DEFINES="$DEFINES -Uunix -U__unix -U__unix__"
1840
1841 # Visual Age C++ build
1842 elif test "$VACPP" = "yes"; then
1843 AC_DEFINE(XP_OS2_VACPP)
1844 AC_DEFINE(OS2,4)
1845 AC_DEFINE(_X86_)
1846 OBJ_SUFFIX=obj
1847 AS=alp
1848 ASFLAGS='-Mb'
1849 ASM_SUFFIX=asm
1850 AR=-ilib
1851 AR_FLAGS='/NOL /NOI /O:$(subst /,\\,$@)'
1852 CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
1853 HOST_CFLAGS="$CFLAGS"
1854 OS_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
1855 OS_EXE_CFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
1856 CXXFLAGS='/Q /qlibansi /Gd+ /Gm+ /Su4 /Mp /Tl9'
1857 OS_LIBS='so32dll.lib tcp32dll.lib'
1858 LD='-ilink'
1859 MKSHLIB='$(LD) $(DSO_LDOPTS)'
1860 IMPLIB='implib -nologo -noignorecase'
1861 FILTER='cppfilt -q -B -P'
1862 _OPTIMIZE_FLAGS='/O+ /Gl+ /qtune=pentium /qarch=pentium'
1863 _DEBUG_FLAGS='/Ti+ '
1864 LDFLAGS='/NOL /M /L'
1865 DLLFLAGS='/O:$@ /DLL /INC:_dllentry /MAP:$(@:.dll=.map) /L /NOL'
1866 EXEFLAGS='/OUT:$@ /PMTYPE:VIO /MAP:$(@:.exe=.map) /L /NOL'
1867 if test -n "$MOZ_DEBUG"; then
1868 LDFLAGS="$LDFLAGS /DE"
1869 DLLFLAGS="$DLLFLAGS /DE"
1870 EXEFLAGS="$EXEFLAGS /DE"
1871 fi
1872 if test -n "$MOZ_OPTIMIZE"; then
1873 LDFLAGS="$LDFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
1874 DLLFLAGS="$DLLFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
1875 EXEFLAGS="$EXEFLAGS /OPTFUNC /EXEPACK:2 /PACKCODE /PACKDATA"
1876 fi
1877 LIBNSPR='$(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1878 LIBPLC='$(dist_libdir)/plc$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)'
1879 fi
1880 ;;
1881
1882*)
1883 AC_DEFINE(XP_UNIX)
1884 ;;
1885
1886esac
1887
1888if test -z "$SKIP_LIBRARY_CHECKS"; then
1889dnl ========================================================
1890dnl Check for system libraries
1891dnl ========================================================
1892dnl AC_CHECK_LIB(C, main)
1893dnl AC_CHECK_LIB(C_r, main)
1894dnl AC_CHECK_LIB(c, main)
1895dnl AC_CHECK_LIB(c_r, main)
1896dnl AC_CHECK_LIB(dce, main)
1897dnl AC_CHECK_LIB(dl, main)
1898dnl AC_CHECK_LIB(dld, main)
1899dnl AC_CHECK_LIB(gen, main)
1900dnl AC_CHECK_LIB(ip6, main)
1901dnl AC_CHECK_LIB(l, main)
1902dnl AC_CHECK_LIB(m, main)
1903dnl AC_CHECK_LIB(nsl, main)
1904dnl AC_CHECK_LIB(posix4, main)
1905dnl AC_CHECK_LIB(prstrms, main)
1906dnl AC_CHECK_LIB(prstrms_shr, main)
1907dnl AC_CHECK_LIB(pthread, main)
1908dnl AC_CHECK_LIB(pthreads, main)
1909dnl AC_CHECK_LIB(resolv, main)
1910dnl AC_CHECK_LIB(rt, main)
1911dnl AC_CHECK_LIB(socket, main)
1912dnl AC_CHECK_LIB(svld, main)
1913dnl AC_CHECK_LIB(thread, main)
1914dnl AC_CHECK_LIB(vms_jackets, main)
1915
1916
1917dnl We don't want anything to link with libdl even if it's present on OS X,
1918dnl since it's not used and not part of the default installation.
1919
1920case $target in
1921*-darwin*)
1922 ;;
1923*)
1924 AC_CHECK_LIB(dl, dlopen,
1925 AC_CHECK_HEADER(dlfcn.h,
1926 OS_LIBS="-ldl $OS_LIBS"))
1927 ;;
1928esac
1929
1930
1931dnl ========================================================
1932dnl Check for system header files.
1933dnl ========================================================
1934dnl AC_HEADER_DIRENT
1935dnl AC_HEADER_STDC
1936dnl AC_HEADER_SYS_WAIT
1937dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/file.h sys/ioctl.h sys/time.h unistd.h)
1938
1939dnl ========================================================
1940dnl Check for typedefs and structs
1941dnl ========================================================
1942dnl AC_C_CONST
1943dnl AC_TYPE_UID_T
1944dnl AC_TYPE_MODE_T
1945dnl AC_TYPE_OFF_T
1946dnl AC_TYPE_PID_T
1947dnl AC_TYPE_SIZE_T
1948dnl AC_STRUCT_ST_BLKSIZE
1949dnl AC_STRUCT_ST_BLOCKS
1950dnl AC_STRUCT_ST_RDEV
1951dnl AC_HEADER_TIME
1952dnl AC_STRUCT_TM
1953
1954dnl ========================================================
1955dnl Checks for library functions.
1956dnl ========================================================
1957AC_PROG_GCC_TRADITIONAL
1958AC_CHECK_FUNCS(lchown strerror)
1959
1960dnl AC_FUNC_MEMCMP
1961dnl AC_FUNC_MMAP
1962dnl AC_FUNC_SETVBUF_REVERSED
1963dnl AC_FUNC_STRCOLL
1964dnl AC_FUNC_STRFTIME
1965dnl AC_FUNC_UTIME_NULL
1966dnl AC_FUNC_VPRINTF
1967dnl AC_CHECK_FUNCS(ftime getcwd gethostname gettimeofday getwd mkdir mktime putenv rmdir select socket strdup strerror strstr strtol strtoul uname)
1968
1969dnl ========================================================
1970dnl Check options
1971dnl ========================================================
1972
1973dnl ========================================================
1974dnl =
1975dnl = --enable-strip
1976dnl =
1977dnl = Enable stripping of libs and executables
1978dnl =
1979dnl ========================================================
1980AC_ARG_ENABLE(strip,
1981 [ --enable-strip Enable stripping of shared libs and programs],
1982 [ if test "$enableval" = "yes"; then
1983 ENABLE_STRIP=1
1984 fi ])
1985
1986dnl Check for hpux options
1987case "${target_os}" in
1988hpux*)
1989if test -z "$GNU_CC"; then
1990
1991 AC_CACHE_CHECK(for +Olit support,
1992 ac_cv_hpux_usable_olit_option,
1993 dnl since aCC doesn't throw an error on invalid options,
1994 dnl we have to test this the hard way
1995 [ac_cv_hpux_usable_olit_option=no
1996 rm -f conftest*
1997 echo 'int main() { return 0; }' | cat > conftest.c
1998 ${CC-cc} ${CFLAGS} +Olit=all -o conftest conftest.c > conftest.out 2>&1
1999 if test $? -eq 0; then
2000 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out`"; then
2001 ac_cv_hpux_usable_olit_option=yes
2002 fi
2003 fi
2004 rm -f conftest*
2005 ])
2006
2007 if test "$ac_cv_hpux_usable_olit_option" = "yes"; then
2008 CFLAGS="$CFLAGS +Olit=all"
2009 CXXFLAGS="$CXXFLAGS +Olit=all"
2010 else
2011 CFLAGS="$CFLAGS +ESlit"
2012 CXXFLAGS="$CXXFLAGS +ESlit"
2013 fi
2014fi
2015;;
2016esac
2017
2018dnl
2019dnl Apparently, some systems cannot properly check for the pthread
2020dnl library unless <pthread.h> is included so we need to test
2021dnl using it
2022dnl
2023dnl MOZ_CHECK_PTHREADS(lib, success, failure)
2024AC_DEFUN(MOZ_CHECK_PTHREADS,
2025[
2026AC_MSG_CHECKING([for pthread_create in -l$1])
2027echo "
2028 #include <pthread.h>
2029 void *foo(void *v) { return v; }
2030 int main() {
2031 pthread_t t;
2032 if (!pthread_create(&t, 0, &foo, 0)) {
2033 pthread_join(t, 0);
2034 }
2035 return 0;
2036 }" > dummy.c ;
2037 echo "${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS" 1>&5;
2038 ${CC-cc} -o dummy${ac_exeext} dummy.c $CFLAGS $CPPFLAGS -l[$1] $LDFLAGS $LIBS 2>&5;
2039 _res=$? ;
2040 rm -f dummy.c dummy${ac_exeext} ;
2041 if test "$_res" = "0"; then
2042 AC_MSG_RESULT([yes])
2043 [$2]
2044 else
2045 AC_MSG_RESULT([no])
2046 [$3]
2047 fi
2048])
2049
2050MOZ_CHECK_PTHREADS(pthreads,
2051 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthreads",
2052 MOZ_CHECK_PTHREADS(pthread,
2053 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lpthread",
2054 MOZ_CHECK_PTHREADS(c_r,
2055 _HAVE_PTHREADS=1 _PTHREAD_LDFLAGS="-lc_r",
2056 MOZ_CHECK_PTHREADS(c,
2057 _HAVE_PTHREADS=1
2058 )
2059 )
2060 )
2061)
2062
2063AC_ARG_WITH(pthreads,
2064 [ --with-pthreads Use system pthreads library as thread subsystem],
2065 [ if test "$withval" = "yes"; then
2066 if test -n "$_HAVE_PTHREADS"; then
2067 USE_PTHREADS=1
2068 USE_USER_PTHREADS=
2069 USE_NSPR_THREADS=
2070 else
2071 AC_MSG_ERROR([ --with-pthreads specified for a system without pthread support ]);
2072 fi
2073 else
2074 USE_PTHREADS=
2075 _PTHREAD_LDFLAGS=
2076 fi],
2077 [ if test -n "$_HAVE_PTHREADS" && test -z "$USE_USER_PTHREADS" && test -z "$USE_NSPR_THREADS"; then
2078 USE_PTHREADS=1
2079 USE_USER_PTHREADS=
2080 USE_NSPR_THREADS=
2081 fi])
2082
2083AC_ARG_ENABLE(user-pthreads,
2084 [ --enable-user-pthreads Build using userland pthreads],
2085 [ if test "$enableval" = "yes"; then
2086 if test -n "$_HAVE_PTHREADS"; then
2087 USE_PTHREADS=
2088 USE_USER_PTHREADS=1
2089 USE_NSPR_THREADS=
2090 else
2091 AC_MSG_ERROR([ --enable-user-pthreads specified for a system without pthread support ]);
2092 fi
2093 fi])
2094
2095AC_ARG_ENABLE(nspr-threads,
2096 [ --enable-nspr-threads Build using classic nspr threads],
2097 [ if test "$enableval" = "yes"; then
2098 USE_PTHREADS=
2099 USE_USER_PTHREADS=
2100 USE_NSPR_THREADS=1
2101 fi])
2102
2103case "$target" in
2104*-beos*)
2105 AC_ARG_WITH(bthreads,
2106 [ --with-bthreads Use system bthreads library as thread subsystem (BeOS only)],
2107 [ if test "$withval" = "yes"; then
2108 USE_BTHREADS=1
2109 USE_USER_PTHREADS=
2110 USE_PTHREADS=
2111 fi])
2112 ;;
2113
2114*-solaris*)
2115 AC_ARG_WITH(native-threads,
2116 [ --with-native-threads Use native system threads as thread subsystem (Solaris only)],
2117 [ if test "$withval" = "yes"; then
2118 USE_NATIVE_THREADS=1
2119 USE_USER_PTHREADS=
2120 USE_PTHREADS=
2121 fi])
2122 ;;
2123esac
2124
2125fi # SKIP_LIBRARY_CHECKS
2126
2127AC_ARG_ENABLE(cplus,
2128 [ --enable-cplus Enable some c++ api routines],
2129 [ if test "$enableval" = "yes"; then
2130 USE_CPLUS=1
2131 fi])
2132
2133AC_ARG_ENABLE(ipv6,
2134 [ --enable-ipv6 Compile ipv6 support],
2135 [ if test "$enableval" = "yes"; then
2136 USE_IPV6=1
2137 else
2138 USE_IPV6=
2139 fi])
2140
2141
2142AC_ARG_ENABLE(boehm,
2143 [ --enable-boehm Enable the Boehm Garbage Collector],
2144 [ if test "$enableval" = "yes"; then
2145 AC_DEFINE(GC_LEAK_DETECTOR)
2146 GC_LEAK_DETECTOR=1
2147 fi])
2148
2149if test -n "$USE_PTHREADS"; then
2150 dnl See if -pthread is supported.
2151 rm -f conftest*
2152 ac_cv_have_dash_pthread=no
2153 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthread)
2154 echo 'int main() { return 0; }' | cat > conftest.c
2155 ${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
2156 if test $? -eq 0; then
2157 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthread`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2158 ac_cv_have_dash_pthread=yes
2159 case "$target_os" in
2160 freebsd*)
2161# Freebsd doesn't use -pthread for compiles, it uses them for linking
2162 ;;
2163 *)
2164 CFLAGS="$CFLAGS -pthread"
2165 CXXFLAGS="$CXXFLAGS -pthread"
2166 ;;
2167 esac
2168 fi
2169 fi
2170 rm -f conftest*
2171 AC_MSG_RESULT($ac_cv_have_dash_pthread)
2172
2173 dnl
2174 dnl See if -pthreads is supported.
2175 dnl
2176 ac_cv_have_dash_pthreads=no
2177 if test "$ac_cv_have_dash_pthread" = "no"; then
2178 AC_MSG_CHECKING(whether ${CC-cc} accepts -pthreads)
2179 echo 'int main() { return 0; }' | cat > conftest.c
2180 ${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
2181 if test $? -eq 0; then
2182 if test -z "`egrep -i '(unrecognize|unknown)' conftest.out | grep pthreads`" && test -z "`egrep -i '(error|incorrect)' conftest.out`" ; then
2183 ac_cv_have_dash_pthreads=yes
2184 CFLAGS="$CFLAGS -pthreads"
2185 CXXFLAGS="$CXXFLAGS -pthreads"
2186 fi
2187 fi
2188 rm -f conftest*
2189 AC_MSG_RESULT($ac_cv_have_dash_pthreads)
2190 fi
2191
2192 case "$target" in
2193 *-solaris*)
2194 if test "$ac_cv_have_dash_pthreads" = "yes"; then
2195 _PTHREAD_LDFLAGS=
2196 fi
2197 ;;
2198 *-freebsd*)
2199 AC_DEFINE(_REENTRANT)
2200 AC_DEFINE(_THREAD_SAFE)
2201 dnl -pthread links in -lc_r, so don't specify it explicitly.
2202 if test "$ac_cv_have_dash_pthread" = "yes"; then
2203 _PTHREAD_LDFLAGS="-pthread"
2204 else
2205 _PTHREAD_LDFLAGS="-lc_r"
2206 fi
2207 ;;
2208 *-netbsd*)
2209 if test "$ac_cv_have_dash_pthread" = "yes"; then
2210 _PTHREAD_LDFLAGS="-pthread"
2211 fi
2212 ;;
2213 *-bsdi*)
2214 AC_DEFINE(_THREAD_SAFE)
2215 dnl -pthread links in -lc_r, so don't specify it explicitly.
2216 if test "$ac_cv_have_dash_pthread" = "yes"; then
2217 _PTHREAD_LDFLAGS=
2218 fi
2219 ;;
2220 *-openbsd*)
2221 if test "$ac_cv_have_dash_pthread" = "yes"; then
2222 _PTHREAD_LDFLAGS=-pthread
2223 fi
2224 ;;
2225 *-linux*)
2226 AC_DEFINE(_REENTRANT)
2227 ;;
2228 esac
2229
2230else
2231 if test -n "$USE_USER_PTHREADS"; then
2232 USE_PTHREADS=
2233 USE_NSPR_THREADS=
2234 else
2235 _PTHREAD_LDFLAGS=
2236 fi
2237fi
2238dnl Special thread exceptions
2239
2240case "$target" in
2241*-aix*)
2242 if test -n "$USE_NSPR_THREADS"; then
2243 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2244 fi
2245 case "$target_os" in
2246 aix4.1*)
2247 if test -z "$USE_PTHREADS"; then
2248 AC_DEFINE(AIX_RENAME_SELECT)
2249 fi
2250 ;;
2251 aix4.2*)
2252 if test -z "$USE_NSPR_THREADS"; then
2253 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2254 fi
2255 ;;
2256 aix4.3*)
2257 if test -z "$USE_NSPR_THREADS"; then
2258 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2259 fi
2260 if test -n "$USE_PTHREADS"; then
2261 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2262 fi
2263 ;;
2264 *)
2265 if test -z "$USE_NSPR_THREADS"; then
2266 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2267 fi
2268 if test -n "$USE_PTHREADS"; then
2269 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2270 fi
2271 ;;
2272 esac
2273 ;;
2274*-bsdi*)
2275 if test -n "$USE_PTHREADS"; then
2276 AC_DEFINE(_PR_NEED_PTHREAD_INIT)
2277 fi
2278 ;;
2279*-freebsd*)
2280 if test -n "$USE_NSPR_THREADS"; then
2281 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2282 fi
2283 ;;
2284*-hpux*)
2285 if test -n "$USE_NSPR_THREADS"; then
2286 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2287 fi
2288 if test "$USE_PTHREADS"; then
2289 if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
2290 AC_DEFINE(_REENTRANT)
2291 AC_DEFINE(_PR_DCETHREADS)
2292 else
2293 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2294 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2295 fi
2296 fi
2297 if test "$USE_USER_PTHREADS"; then
2298 AC_DEFINE_UNQUOTED(_POSIX_C_SOURCE,199506L)
2299 fi
2300 ;;
2301*-irix*)
2302 if test "${target_os}" = "irix6.5"; then
2303 if test -n "$USE_PTHREADS"; then
2304 AC_DEFINE(_PR_HAVE_GETHOST_R)
2305 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2306 fi
2307 fi
2308 ;;
2309*-linux*)
2310 if test -n "$USE_NSPR_THREADS"; then
2311 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2312 fi
2313 ;;
2314*-mingw*|*-cygwin*|*-msvc*|*-mks*)
2315 dnl win32 does not use pthreads
2316 USE_PTHREADS=
2317 _PTHREAD_LDFLAGS=
2318 USE_USER_PTHREADS=
2319 ;;
2320*-netbsd*|*-openbsd*)
2321 if test -n "$USE_NSPR_THREADS"; then
2322 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2323 fi
2324 ;;
2325*-osf*)
2326 if test -n "$USE_NSPR_THREADS"; then
2327 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2328 fi
2329 if test -n "$USE_PTHREADS"; then
2330 if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then
2331 :
2332 else
2333 AC_DEFINE(_PR_HAVE_THREADSAFE_GETHOST)
2334 fi
2335 fi
2336 ;;
2337*-solaris*)
2338 if test -n "$USE_NATIVE_THREADS"; then
2339 AC_DEFINE(_PR_GLOBAL_THREADS_ONLY)
2340 else
2341 if test -n "$USE_NSPR_THREADS"; then
2342 AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
2343 fi
2344 fi
2345 if test -z "$USE_NSPR_THREADS"; then
2346 AC_DEFINE(_REENTRANT)
2347 AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
2348 if test "$OS_TEST" = "i86pc"; then
2349 PR_MD_ASFILES=os_SunOS_x86.s
2350 else
2351 PR_MD_ASFILES=os_SunOS.s
2352 if test -n "$USE_64"; then
2353 PR_MD_ASFILES="$PR_MD_ASFILES os_SunOS_sparcv9.s"
2354 fi
2355 fi
2356 fi
2357 ;;
2358*-nto*)
2359 if test -n "$USE_PTHREADS"; then
2360 AC_DEFINE(_PR_HAVE_GETHOST_R)
2361 AC_DEFINE(_PR_HAVE_GETHOST_R_POINTER)
2362 fi
2363 ;;
2364esac
2365
2366OS_LIBS="$_PTHREAD_LDFLAGS $OS_LIBS"
2367
2368dnl If the user passed in arg to --enable-optimize,
2369dnl make sure that we use it.
2370if test -n "$_SAVE_OPTIMIZE_FLAGS"; then
2371 _OPTIMIZE_FLAGS="$_SAVE_OPTIMIZE_FLAGS"
2372fi
2373
2374if test -n "$MOZ_OPTIMIZE"; then
2375 CFLAGS="$CFLAGS $_OPTIMIZE_FLAGS"
2376 CXXFLAGS="$CXXFLAGS $_OPTIMIZE_FLAGS"
2377fi
2378
2379if test -n "$MOZ_DEBUG"; then
2380 CFLAGS="$CFLAGS $_DEBUG_FLAGS"
2381 CXXFLAGS="$CXXFLAGS $_DEBUG_FLAGS"
2382fi
2383
2384if test -n "$MOZ_OPTIMIZE"; then
2385 OBJDIR_TAG=_OPT
2386else
2387 OBJDIR_TAG=_DBG
2388fi
2389
2390if test -n "$USE_64"; then
2391 COMPILER_TAG=_64
2392fi
2393
2394RELEASE_OBJDIR_NAME="${OS_CONFIG}${CPU_ARCH_TAG}${COMPILER_TAG}${IMPL_STRATEGY}${OBJDIR_TAG}.${OBJDIR_SUFFIX}"
2395
2396dnl ========================================================
2397dnl Use cygwin wrapper for win32 builds
2398dnl ========================================================
2399case "$target_os" in
2400mingw*|cygwin*|msvc*|mks*)
2401 CC="\$(CYGWIN_WRAPPER) $CC"
2402 CXX="\$(CYGWIN_WRAPPER) $CXX"
2403 RC="\$(CYGWIN_WRAPPER) $RC"
2404 ;;
2405esac
2406
2407dnl ========================================================
2408dnl Substitution of found variables.
2409dnl ========================================================
2410AC_SUBST(SHELL_OVERRIDE)
2411
2412AC_SUBST(MOZILLA_CLIENT)
2413AC_SUBST(CC)
2414AC_SUBST(CXX)
2415AC_SUBST(CFLAGS)
2416AC_SUBST(CXXFLAGS)
2417AC_SUBST(CPPFLAGS)
2418AC_SUBST(HOST_CC)
2419AC_SUBST(HOST_CFLAGS)
2420AC_SUBST(LDFLAGS)
2421AC_SUBST(GNU_CC)
2422AC_SUBST(GCC_USE_GNU_LD)
2423AC_SUBST(MSC_VER)
2424AC_SUBST(CROSS_COMPILE)
2425
2426AC_SUBST(MOZ_OPTIMIZE)
2427
2428AC_SUBST(USE_CPLUS)
2429AC_SUBST(USE_IPV6)
2430AC_SUBST(USE_N32)
2431AC_SUBST(USE_64)
2432AC_SUBST(OBJECT_MODE)
2433AC_SUBST(GC_LEAK_DETECTOR)
2434AC_SUBST(ENABLE_STRIP)
2435
2436AC_SUBST(USE_PTHREADS)
2437AC_SUBST(USE_BTHREADS)
2438AC_SUBST(USE_USER_PTHREADS)
2439AC_SUBST(USE_NATIVE_THREADS)
2440AC_SUBST(USE_NSPR_THREADS)
2441
2442AC_SUBST(LIBNSPR)
2443AC_SUBST(LIBPLC)
2444
2445AC_SUBST(MOD_MAJOR_VERSION)
2446AC_SUBST(MOD_MINOR_VERSION)
2447AC_SUBST(MOD_PATCH_VERSION)
2448AC_SUBST(NSPR_MODNAME)
2449AC_SUBST(MDCPUCFG_H)
2450AC_SUBST(PR_MD_CSRCS)
2451AC_SUBST(PR_MD_ASFILES)
2452AC_SUBST(PR_MD_ARCH_DIR)
2453AC_SUBST(CPU_ARCH)
2454
2455AC_SUBST(OBJ_SUFFIX)
2456AC_SUBST(LIB_SUFFIX)
2457AC_SUBST(DLL_SUFFIX)
2458AC_SUBST(ASM_SUFFIX)
2459AC_SUBST(MKSHLIB)
2460AC_SUBST(DSO_CFLAGS)
2461AC_SUBST(DSO_LDOPTS)
2462
2463AC_SUBST(OS_TARGET)
2464AC_SUBST(OS_ARCH)
2465AC_SUBST(OS_RELEASE)
2466AC_SUBST(OS_TEST)
2467AC_SUBST(MACOS_DEPLOYMENT_TARGET)
2468
2469AC_SUBST(DEFINES)
2470AC_SUBST(DEFS)
2471AC_SUBST(AR)
2472AC_SUBST(AR_FLAGS)
2473AC_SUBST(AS)
2474AC_SUBST(ASFLAGS)
2475AC_SUBST(LD)
2476AC_SUBST(RANLIB)
2477AC_SUBST(PERL)
2478AC_SUBST(STRIP)
2479AC_SUBST(FILTER)
2480AC_SUBST(IMPLIB)
2481
2482AC_SUBST(OS_LIBS)
2483AC_SUBST(RESOLVE_LINK_SYMBOLS)
2484AC_SUBST(AIX_LINK_OPTS)
2485AC_SUBST(NOSUCHFILE)
2486AC_SUBST(MOZ_OBJFORMAT)
2487AC_SUBST(ULTRASPARC_LIBRARY)
2488
2489AC_SUBST(OBJDIR)
2490AC_SUBST(OBJDIR_NAME)
2491AC_SUBST(RELEASE_OBJDIR_NAME)
2492AC_SUBST(NSINSTALL)
2493AC_SUBST(OPTIMIZER)
2494AC_SUBST(RC)
2495AC_SUBST(RCFLAGS)
2496AC_SUBST(DLLFLAGS)
2497AC_SUBST(EXEFLAGS)
2498AC_SUBST(OS_DLLFLAGS)
2499AC_SUBST(CYGWIN_WRAPPER)
2500
2501dnl ========================================================
2502dnl Generate output files.
2503dnl ========================================================
2504MAKEFILES="
2505Makefile
2506config/Makefile
2507config/autoconf.mk
2508config/nsprincl.mk
2509config/nsprincl.sh
2510config/nspr-config
2511lib/Makefile
2512lib/ds/Makefile
2513lib/libc/Makefile
2514lib/libc/include/Makefile
2515lib/libc/src/Makefile
2516lib/tests/Makefile
2517pkg/Makefile
2518pkg/linux/Makefile
2519pkg/solaris/Makefile
2520pkg/solaris/SUNWpr/Makefile
2521pkg/solaris/SUNWprx/Makefile
2522pr/Makefile
2523pr/include/Makefile
2524pr/include/md/Makefile
2525pr/include/obsolete/Makefile
2526pr/include/private/Makefile
2527pr/src/Makefile
2528pr/src/io/Makefile
2529pr/src/linking/Makefile
2530pr/src/malloc/Makefile
2531pr/src/md/Makefile
2532pr/src/md/${PR_MD_ARCH_DIR}/Makefile
2533pr/src/memory/Makefile
2534pr/src/misc/Makefile
2535pr/src/threads/Makefile
2536pr/tests/Makefile
2537pr/tests/dll/Makefile
2538"
2539
2540dnl lib/tests/Makefile
2541dnl pr/tests/w16gui/Makefile
2542dnl tools/Makefile
2543
2544if test -z "$USE_PTHREADS" && test -z "$USE_BTHREADS"; then
2545 MAKEFILES="$MAKEFILES pr/src/threads/combined/Makefile"
2546elif test -n "$USE_PTHREADS"; then
2547 MAKEFILES="$MAKEFILES pr/src/pthreads/Makefile"
2548elif test -n "$USE_BTHREADS"; then
2549 MAKEFILES="$MAKEFILES pr/src/bthreads/Makefile"
2550fi
2551
2552if test -n "$USE_CPLUS"; then
2553 MAKEFILES="$MAKEFILES pr/src/cplus/Makefile pr/src/cplus/tests/Makefile"
2554fi
2555
2556AC_OUTPUT([$MAKEFILES], [chmod +x config/nspr-config])
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette