forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
2545 lines (2334 loc) · 67 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; -*-
dnl
dnl The contents of this file are subject to the Mozilla Public
dnl License Version 1.1 (the "License"); you may not use this file
dnl except in compliance with the License. You may obtain a copy of
dnl the License at http://www.mozilla.org/MPL/
dnl
dnl Software distributed under the License is distributed on an "AS
dnl IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
dnl implied. See the License for the specific language governing
dnl rights and limitations under the License.
dnl
dnl The Original Code is the Netscape Portable Runtime (NSPR).
dnl
dnl The Initial Developer of the Original Code is Netscape
dnl Communications Corporation. Portions created by Netscape are
dnl Copyright (C) 1998o-2000 Netscape Communications Corporation. All
dnl Rights Reserved.
dnl
dnl Contributor(s):
dnl Christopher Seawood <[email protected]>
dnl
dnl Alternatively, the contents of this file may be used under the
dnl terms of the GNU General Public License Version 2 or later (the
dnl "GPL"), in which case the provisions of the GPL are applicable
dnl instead of those above. If you wish to allow use of your
dnl version of this file only under the terms of the GPL and not to
dnl allow others to use your version of this file under the MPL,
dnl indicate your decision by deleting the provisions above and
dnl replace them with the notice and other provisions required by
dnl the GPL. If you do not delete the provisions above, a recipient
dnl may use your version of this file under either the MPL or the
dnl GPL.
dnl
AC_PREREQ(2.12)
AC_INIT(config/libc_r.h)
AC_CONFIG_AUX_DIR(${srcdir}/build/autoconf)
AC_CANONICAL_SYSTEM
dnl ========================================================
dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=5
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
USE_USER_PTHREADS=
USE_NSPR_THREADS=
USE_N32=
USE_64=
USE_CPLUS=
USE_IPV6=
USE_MDUPDATE=
MACOS_DEPLOYMENT_TARGET=
_OPTIMIZE_FLAGS=-O
_DEBUG_FLAGS=-g
MOZ_DEBUG=1
MOZ_OPTIMIZE=
OBJDIR=.
OBJDIR_NAME=.
OBJDIR_SUFFIX=OBJ
NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
NOSUCHFILE=/no-such-file
LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
CYGWIN_WRAPPER=
dnl Link in libraries necessary to resolve all symbols for shared libs
RESOLVE_LINK_SYMBOLS=
dnl ========================================================
dnl =
dnl = Dont change the following lines. Doing so breaks:
dnl =
dnl = CFLAGS="-foo" ./configure
dnl =
dnl ========================================================
CFLAGS="${CFLAGS=}"
CXXFLAGS="${CXXFLAGS=}"
LDFLAGS="${LDFLAGS=}"
HOST_CFLAGS="${HOST_CFLAGS=}"
HOST_LDFLAGS="${HOST_LDFLAGS=}"
case "$target" in
*-cygwin*|*-mingw*)
# Check to see if we are really running in a msvc environemnt
_WIN32_MSVC=
AC_CHECK_PROGS(CC, cl)
if test "$CC" = "cl"; then
echo 'main() { return 0; }' > dummy.c
${CC} -o dummy dummy.c >/dev/null 2>&1
if test $? = 0; then
_WIN32_MSVC=1
CXX=$CC
else
AC_MSG_WARN([$(CC) test failed. Using normal feature tests])
fi
rm -f dummy dummy.o dummy.obj dummy.exe dummy.c
fi
;;
*-msvc*)
_WIN32_MSVC=1
;;
*-mks*)
_WIN32_MSVC=1
;;
esac
if test -n "$_WIN32_MSVC"; then
SKIP_PATH_CHECKS=1
SKIP_COMPILER_CHECKS=1
SKIP_LIBRARY_CHECKS=1
fi
dnl ========================================================
dnl =
dnl = Check options that may affect the compiler
dnl =
dnl ========================================================
dist_prefix='${MOD_DEPTH}/dist'
dist_bindir='${dist_prefix}/bin'
dist_includedir='${dist_prefix}/include/nspr'
dist_libdir='${dist_prefix}/lib'
if test "${includedir}" = '${prefix}/include'; then
includedir='${prefix}/include/nspr'
fi
AC_ARG_WITH(dist-prefix,
[ --with-dist-prefix=DIST_PREFIX
place build files in DIST_PREFIX [dist]],
dist_prefix=$withval)
AC_ARG_WITH(dist-bindir,
[ --with-dist-bindir=DIR build execuatables in DIR [DIST_PREFIX/bin]],
dist_bindir=$withval)
AC_ARG_WITH(dist-includedir,
[ --with-dist-includedir=DIR
build include files in DIR [DIST_PREFIX/include/nspr]],
dist_includedir=$withval)
AC_ARG_WITH(dist-libdir,
[ --with-dist-libdir=DIR build library files in DIR [DIST_PREFIX/lib]],
dist_libdir=$withval)
AC_SUBST(dist_prefix)
AC_SUBST(dist_bindir)
AC_SUBST(dist_includedir)
AC_SUBST(dist_libdir)
dnl Check if NSPR is being compiled for Mozilla
dnl Let --with-arg override environment setting
dnl
AC_ARG_WITH(mozilla,
[ --with-mozilla Compile NSPR with Mozilla support],
[ if test "$withval" = "yes"; then
AC_DEFINE(MOZILLA_CLIENT)
MOZILLA_CLIENT=1
else
MOZILLA_CLIENT=
fi],
[ if test -n "$MOZILLA_CLIENT"; then
AC_DEFINE(MOZILLA_CLIENT)
fi])
AC_ARG_ENABLE(optimize,
[ --enable-optimize(=val) Enable code optimizations (val, ie. -O2) ],
[ if test "$enableval" != "no"; then
MOZ_OPTIMIZE=1
if test -n "$enableval" && test "$enableval" != "yes"; then
_OPTIMIZE_FLAGS=`echo $enableval | sed -e 's|\\\ | |g'`
_SAVE_OPTIMIZE_FLAGS=$_OPTIMIZE_FLAGS
fi
fi ])
AC_ARG_ENABLE(debug,
[ --disable-debug Do not compile in debugging symbols],
[ if test "$enableval" = "no"; then
MOZ_DEBUG=
fi])
AC_ARG_ENABLE(win32-target,
[ --enable-win32-target=\$t
Specify win32 flavor. (WIN95 or WINNT)],
OS_TARGET=`echo $enableval | tr a-z A-Z`,
OS_TARGET=)
AC_ARG_ENABLE(debug-rtl,
[ --enable-debug-rtl Use the MSVC debug runtime library],
[ if test "$enableval" = "yes"; then
USE_DEBUG_RTL=1
fi ])
AC_ARG_ENABLE(n32,
[ --enable-n32 Enable n32 ABI support (IRIX only)],
[ if test "$enableval" = "yes"; then
USE_N32=1
else if test "$enableval" = "no"; then
USE_N32=
fi
fi ])
AC_ARG_ENABLE(64bit,
[ --enable-64bit Enable 64-bit support (on certain platforms)],
[ if test "$enableval" = "yes"; then
USE_64=1
fi ])
AC_ARG_ENABLE(mdupdate,
[ --enable-mdupdate Enable use of certain compilers' mdupdate feature],
[ if test "$enableval" = "yes"; then
USE_MDUPDATE=1
fi ])
AC_ARG_ENABLE(macos-target,
[ --enable-macos-target=VER (default=10.1)
Set the minimum MacOS version needed at runtime],
[MACOS_DEPLOYMENT_TARGET_STR=$enableval],
[MACOS_DEPLOYMENT_TARGET_STR=10.1])
dnl ========================================================
dnl =
dnl = Set the threading model
dnl =
dnl ========================================================
case "$target" in
*-aix*)
case "${target_os}" in
aix3.2*)
USE_NSPR_THREADS=1
;;
*)
USE_PTHREADS=1
;;
esac
;;
esac
dnl ========================================================
dnl =
dnl = Set the default C compiler
dnl =
dnl ========================================================
if test -z "$CC"; then
case "$target" in
*-aix*)
if test -z "$USE_NSPR_THREADS"; then
CC=xlc_r
else
CC=xlc
fi
;;
*-hpux*)
CC=cc
;;
*-irix*)
CC=cc
;;
*-openvms*)
CC=cc
;;
*-osf*)
CC=cc
;;
*-solaris*)
CC=cc
;;
esac
fi
dnl ========================================================
dnl =
dnl = Set the default C++ compiler
dnl =
dnl ========================================================
if test -z "$CXX"; then
case "$target" in
*-aix*)
if test -z "$USE_NSPR_THREADS"; then
CXX=xlC_r
else
CXX=xlC
fi
;;
*-hpux*)
case "${target_os}" in
hpux10.30)
CXX=aCC
;;
hpux11.*)
CXX=aCC
;;
*)
CXX=CC
;;
esac
;;
*-irix*)
CXX=CC
;;
*-openvms*)
CXX=cxx
;;
*-osf*)
CXX=cxx
;;
*-solaris*)
CXX=CC
;;
esac
fi
if test -z "$SKIP_PATH_CHECKS"; then
AC_PATH_PROG(WHOAMI, $WHOAMI whoami, echo not_whoami)
fi
if test -n "$MOZ_DEBUG"; then
AC_DEFINE(DEBUG)
DEFINES="$DEFINES -UNDEBUG"
case "${target_os}" in
beos*)
DEFINES="$DEFINES -DDEBUG_${USER}"
;;
msvc*|mks*|cygwin*|mingw*|os2*)
DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
;;
*)
DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
;;
esac
else
AC_DEFINE(NDEBUG)
DEFINES="$DEFINES -UDEBUG"
fi
if test -z "$SKIP_COMPILER_CHECKS"; then
dnl ========================================================
dnl Checks for compilers.
dnl ========================================================
if test "$target" != "$host"; then
echo "cross compiling from $host to $target"
cross_compiling=yes
_SAVE_CC="$CC"
_SAVE_CFLAGS="$CFLAGS"
_SAVE_LDFLAGS="$LDFLAGS"
AC_MSG_CHECKING([for $host compiler])
if test -z "$HOST_CC"; then
AC_CHECK_PROGS(HOST_CC, gcc cc /usr/ucb/cc, "")
if test -z "$HOST_CC"; then
AC_MSG_ERROR([no acceptable cc found in \$PATH])
fi
fi
AC_MSG_RESULT([$HOST_CC])
if test -z "$HOST_CFLAGS"; then
HOST_CFLAGS="$CFLAGS"
fi
if test -z "$HOST_LDFLAGS"; then
HOST_LDFLAGS="$LDFLAGS"
fi
CC="$HOST_CC"
CFLAGS="$HOST_CFLAGS"
LDFLAGS="$HOST_LDFLAGS"
AC_MSG_CHECKING([whether the $host compiler ($HOST_CC $HOST_CFLAGS $HOST_LDFLAGS) works])
AC_TRY_COMPILE([], [return(0);],
[ac_cv_prog_host_cc_works=1 AC_MSG_RESULT([yes])],
AC_MSG_ERROR([installation or configuration problem: $host compiler $HOST_CC cannot create executables.]) )
CC=$_SAVE_CC
CFLAGS=$_SAVE_CFLAGS
LDFLAGS=$_SAVE_LDFLAGS
if test -z "$CC"; then
AC_CHECK_PROGS(CC, "${target_alias}-gcc" "${target}-gcc", echo)
fi
unset ac_cv_prog_CC
AC_PROG_CC
if test -z "$CXX"; then
AC_CHECK_PROGS(CXX, "${target_alias}-g++" "${target}-g++", echo)
fi
unset ac_cv_prog_CXX
AC_PROG_CXX
if test -z "$RANLIB"; then
AC_CHECK_PROGS(RANLIB, "${target_alias}-ranlib" "${target}-ranlib", echo)
fi
if test -z "$AR"; then
AC_CHECK_PROGS(AR, "${target_alias}-ar" "${target}-ar", echo)
fi
if test -z "$AS"; then
AC_CHECK_PROGS(AS, "${target_alias}-as" "${target}-as", echo)
fi
if test -z "$LD"; then
AC_CHECK_PROGS(LD, "${target_alias}-ld" "${target}-ld", echo)
fi
if test -z "$STRIP"; then
AC_CHECK_PROGS(STRIP, "${target_alias}-strip" "${target}-strip", echo)
fi
if test -z "$WINDRES"; then
AC_CHECK_PROGS(WINDRES, "${target_alias}-windres" "${target}-windres", echo)
fi
else
AC_PROG_CXX
if test "$CXX" = "cl" -a -z "$CC"; then
CC=$CXX
else
AC_PROG_CC
fi
AC_PROG_CPP
AC_PROG_RANLIB
AC_PATH_PROGS(AS, as, $CC)
AC_PATH_PROGS(AR, ar, echo not_ar)
AC_PATH_PROGS(LD, ld link, echo not_ld)
AC_PATH_PROGS(STRIP, strip, echo not_strip)
AC_PATH_PROGS(WINDRES, windres, echo not_windres)
if test -z "$HOST_CC"; then
HOST_CC="$CC"
fi
if test -z "$HOST_CFLAGS"; then
HOST_CFLAGS="$CFLAGS"
fi
fi
if test "$GCC" = "yes"; then
GNU_CC=1
fi
if test "$GXX" = "yes"; then
GNU_CXX=1
fi
if test "`echo | $AS -v 2>&1 | grep -c GNU`" != "0"; then
GNU_AS=1
fi
rm -f a.out
if test "$cross_compiling" = "yes"; then
CROSS_COMPILE=1
else
CROSS_COMPILE=
fi
dnl ========================================================
dnl Check for gcc -pipe support
dnl ========================================================
AC_MSG_CHECKING([for gcc -pipe support])
if test -n "$GNU_CC" && test -n "$GNU_CXX" && test -n "$GNU_AS"; then
echo '#include <stdio.h>' > dummy-hello.c
echo 'int main() { printf("Hello World\n"); return 0; }' >> dummy-hello.c
${CC} -S dummy-hello.c -o dummy-hello.s 2>&5
cat dummy-hello.s | ${AS} -o dummy-hello.S - 2>&5
if test $? = 0; then
_res_as_stdin="yes"
else
_res_as_stdin="no"
fi
if test "$_res_as_stdin" = "yes"; then
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -pipe"
AC_TRY_COMPILE( [ #include <stdio.h> ],
[printf("Hello World\n");],
[_res_gcc_pipe="yes"],
[_res_gcc_pipe="no"] )
CFLAGS=$_SAVE_CFLAGS
fi
if test "$_res_as_stdin" = "yes" && test "$_res_gcc_pipe" = "yes"; then
_res="yes";
CFLAGS="$CFLAGS -pipe"
CXXFLAGS="$CXXFLAGS -pipe"
else
_res="no"
fi
rm -f dummy-hello.c dummy-hello.s dummy-hello.S dummy-hello a.out
AC_MSG_RESULT([$_res])
else
AC_MSG_RESULT([no])
fi
fi # SKIP_COMPILER_CHECKS
dnl ========================================================
dnl Checks for programs.
dnl ========================================================
if test -z "$SKIP_PATH_CHECKS"; then
AC_PATH_PROGS(PERL, perl5 perl, echo not_perl)
elif test -z "$PERL"; then
PERL=perl
fi
dnl ========================================================
dnl Default platform specific options
dnl ========================================================
OBJ_SUFFIX=o
LIB_SUFFIX=a
DLL_SUFFIX=so
ASM_SUFFIX=s
MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
PR_MD_ASFILES=
PR_MD_CSRCS=
PR_MD_ARCH_DIR=unix
AR_FLAGS='cr $@'
AS='$(CC)'
ASFLAGS='$(CFLAGS)'
OS_ARCH=`uname -s | sed -e 's|/|_|g'`
OS_RELEASE=`uname -r`
OS_TEST=`uname -m`
if test "$OS_ARCH" = "IRIX64"; then
OS_ARCH=IRIX
fi
if test "$OS_ARCH" = "AIX"; then
OS_RELEASE=`uname -v`.`uname -r`
fi
if test "$OS_ARCH" = "FreeBSD"; then
OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
fi
if test "$OS_ARCH" = "Linux"; then
OS_RELEASE=`echo $OS_RELEASE | sed 's/-.*//'`
OS_RELEASE=`echo $OS_RELEASE | awk -F\. '{ print $1 "." $2 }'`
fi
if test "$OS_ARCH" = "OpenVMS"; then
OS_RELEASE=`uname -v`
fi
#######################################################################
# Master "Core Components" macros for getting the OS target #
#######################################################################
#
# Note: OS_TARGET should be specified on the command line for gmake.
# When OS_TARGET=WIN95 is specified, then a Windows 95 target is built.
# The difference between the Win95 target and the WinNT target is that
# the WinNT target uses Windows NT specific features not available
# in Windows 95. The Win95 target will run on Windows NT, but (supposedly)
# at lesser performance (the Win95 target uses threads; the WinNT target
# uses fibers).
#
# When OS_TARGET=WIN16 is specified, then a Windows 3.11 (16bit) target
# is built. See: win16_3.11.mk for lots more about the Win16 target.
#
# If OS_TARGET is not specified, it defaults to $(OS_ARCH), i.e., no
# cross-compilation.
#
#
# The following hack allows one to build on a WIN95 machine (as if
# s/he were cross-compiling on a WINNT host for a WIN95 target).
# It also accomodates for MKS's uname.exe. If you never intend
# to do development on a WIN95 machine, you don't need this hack.
#
if test "$OS_ARCH" = "WIN95"; then
OS_ARCH=WINNT
OS_TARGET=WIN95
elif test "$OS_ARCH" = 'Windows_95'; then
OS_ARCH=Windows_NT
OS_TARGET=WIN95
elif test "$OS_ARCH" = 'Windows_98'; then
OS_ARCH=Windows_NT
OS_TARGET=WIN95
elif test "`echo $OS_ARCH | egrep -c '^(CYGWIN_9|CYGWIN_ME)' 2>/dev/null`" != 0; then
OS_ARCH='CYGWIN_NT-4.0'
OS_TARGET=WIN95
elif test "$OS_ARCH" = "OS_2"; then
OS_ARCH=OS2
OS_TARGET=OS2
fi
#
# On WIN32, we also define the variable CPU_ARCH.
#
if test "$OS_ARCH" = "WINNT"; then
CPU_ARCH=`uname -p`
if test "$CPU_ARCH" = "I386"; then
CPU_ARCH=x86
fi
elif test "$OS_ARCH" = "Windows_NT"; then
#
# If uname -s returns "Windows_NT", we assume that we are using
# the uname.exe in MKS toolkit.
#
# The -r option of MKS uname only returns the major version number.
# So we need to use its -v option to get the minor version number.
# Moreover, it doesn't have the -p option, so we need to use uname -m.
#
OS_ARCH=WINNT
OS_MINOR_RELEASE=`uname -v`
if test "$OS_MINOR_RELEASE" = "00"; then
OS_MINOR_RELEASE=0
fi
OS_RELEASE="${OS_RELEASE}.${OS_MINOR_RELEASE}"
CPU_ARCH=`uname -m`
#
# MKS's uname -m returns "586" on a Pentium machine.
#
if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
CPU_ARCH=x86
fi
elif echo "$OS_ARCH" | grep -c CYGWIN_NT >/dev/null; then
#
# If uname -s returns "CYGWIN_NT-4.0", we assume that we are using
# the uname.exe in the Cygwin tools.
#
OS_RELEASE=`echo $OS_ARCH | sed 's|^CYGWIN_NT-||'`
OS_ARCH=WINNT
CPU_ARCH=`uname -m`
#
# Cygwin's uname -m returns "i686" on a Pentium Pro machine.
#
if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
CPU_ARCH=x86
fi
elif test "$OS_ARCH" = "CYGWIN32_NT"; then
#
# Prior to the Beta 20 release, Cygwin was called GNU-Win32.
# If uname -s returns "CYGWIN32/NT", we assume that we are using
# the uname.exe in the GNU-Win32 tools.
#
OS_ARCH=WINNT
CPU_ARCH=`uname -m`
#
# GNU-Win32's uname -m returns "i686" on a Pentium Pro machine.
#
if echo "$CPU_ARCH" | grep -c 86 >/dev/null; then
CPU_ARCH=x86
fi
fi
if test -n "$MOZILLA_CLIENT" && test "$OS_ARCH" = "WINNT"; then
OS_TARGET=WIN95
if test -n "$MOZ_DEBUG"; then
USE_DEBUG_RTL=1
fi
fi
if test -z "$OS_TARGET"; then
OS_TARGET=$OS_ARCH
fi
if test "$OS_TARGET" = "WIN95"; then
OS_RELEASE="4.0"
fi
if test "$OS_TARGET" = "WIN16"; then
OS_RELEASE=
fi
OS_CONFIG="${OS_TARGET}${OS_RELEASE}"
dnl ========================================================
dnl ========================================================
dnl Override of system specific host options
dnl ========================================================
case "$host" in
*-mingw*|*-cygwin*|*-msvc*|*-mks*)
;;
*-beos*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_BEOS -DBeOS -DBEOS -D_POSIX_SOURCE"
;;
*os2*)
;;
*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
;;
esac
dnl ========================================================
dnl Override of system specific target options
dnl ========================================================
case "$target" in
*-aix*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(AIX)
AC_DEFINE(SYSV)
DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
AC_CHECK_HEADER(sys/atomic_op.h, AC_DEFINE(AIX_HAVE_ATOMIC_OP_H))
case "${target_os}" in
aix3.2*)
AC_DEFINE(AIX_RENAME_SELECT)
AC_DEFINE(_PR_NO_LARGE_FILES)
AIX_LINK_OPTS='-bnso -berok'
PR_MD_ASFILES=os_AIX.s
;;
aix4.1*)
AC_DEFINE(AIX_TIMERS)
AC_DEFINE(_PR_NO_LARGE_FILES)
AC_DEFINE(AIX4_1)
MKSHLIB=
DSO_LDOPTS=
AIX_LINK_OPTS='-bnso -berok'
LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)_shr'
LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)_shr'
;;
aix4.2*)
AC_DEFINE(AIX_TIMERS)
AC_DEFINE(_PR_HAVE_OFF64_T)
AIX_LINK_OPTS='-brtl -bnso -berok'
;;
aix4.3*)
AC_DEFINE(AIX_TIMERS)
AC_DEFINE(_PR_HAVE_OFF64_T)
AC_DEFINE(AIX4_3_PLUS)
AC_DEFINE(HAVE_SOCKLEN_T)
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
USE_IPV6=1
AIX_LINK_OPTS='-brtl -bnso -berok'
;;
*)
AC_DEFINE(AIX_TIMERS)
AC_DEFINE(_PR_HAVE_OFF64_T)
AC_DEFINE(AIX4_3_PLUS)
AC_DEFINE(HAVE_SOCKLEN_T)
AC_DEFINE(HAVE_FCNTL_FILE_LOCKING)
USE_IPV6=1
AIX_LINK_OPTS='-brtl -bnso -berok'
;;
esac
CFLAGS="$CFLAGS -qro -qroconst"
AIX_WRAP='$(DIST)/lib/aixwrap.o'
AIX_TMP='./_aix_tmp.o'
if test -n "$USE_64"; then
MDCPUCFG_H=_aix64.cfg
OBJECT_MODE=64
else
MDCPUCFG_H=_aix32.cfg
fi
PR_MD_CSRCS=aix.c
RESOLVE_LINK_SYMBOLS=1
;;
*-beos*)
AC_DEFINE(XP_BEOS)
AC_DEFINE(BeOS)
AC_DEFINE(BEOS)
AC_DEFINE(_POSIX_SOURCE)
DSO_LDOPTS=-nostart
MDCPUCFG_H=_beos.cfg
USE_BTHREADS=1
PR_MD_ARCH_DIR=beos
RESOLVE_LINK_SYMBOLS=1
case "${target_cpu}" in
i*86)
_OPTIMIZE_FLAGS=-O2
_DEBUG_FLAGS='-gdwarf-2 -O0'
MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
AC_CHECK_LIB(bind, gethostbyaddr, [OS_LIBS="$OS_LIBS -lbind -lsocket"])
;;
powerpc)
CC=mwcc
CCC=mwcc
LD=mwld
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'
_OPTIMIZE_FLAGS=-O2
_DEBUG_FLAGS='-g -O0'
;;
esac
;;
*-bsdi*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(BSDI)
AC_DEFINE(NEED_BSDREGEX)
CFLAGS="$CFLAGS -Wall -Wno-format"
CXXFLAGS="$CXXFLAGS -Wall -Wno-format"
if echo "$OS_TEST" | grep -c 86 >/dev/null; then
CPU_ARCH=x86
elif echo "$OS_TEST" | grep -c sparc >/dev/null; then
CPU_ARCH=sparc
fi
MDCPUCFG_H=_bsdi.cfg
PR_MD_CSRCS=bsdi.c
DSO_LDOPTS=-r
case "$target_os" in
bsdi1.1*)
AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
AC_DEFINE(_PR_STAT_HAS_ONLY_ST_ATIME)
AC_DEFINE(_PR_NEED_H_ERRNO)
MKSHLIB=
DSO_CFLAGS=
DSO_LDOPTS=
;;
bsdi2.1*)
AC_DEFINE(_PR_TIMESPEC_HAS_TS_SEC)
AC_DEFINE(_PR_BSDI_JMPBUF_IS_ARRAY)
AC_DEFINE(HAVE_DLL)
AC_DEFINE(USE_DLFCN)
AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
PR_MD_ASFILES=os_BSD_OS_386_2.s
;;
bsdi4.* | bsdi5.*)
AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
AC_DEFINE(HAVE_DLL)
AC_DEFINE(USE_DLFCN)
AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
MKSHLIB='$(CC) -o $@ $(DSO_LDOPTS)'
DSO_CFLAGS=-fPIC
DSO_LDOPTS='-shared -Wl,-soname,$(@:$(OBJDIR)/%.so=%.so)'
STRIP="$STRIP -d"
case "$target_os" in
bsdi4.2* | bsdi4.3* | bsdi5.*)
AC_DEFINE(_PR_HAVE_GETPROTO_R)
AC_DEFINE(_PR_HAVE_GETPROTO_R_POINTER)
;;
esac
;;
*)
AC_DEFINE(_PR_SELECT_CONST_TIMEVAL)
AC_DEFINE(_PR_BSDI_JMPBUF_IS_STRUCT)
AC_DEFINE(HAVE_DLL)
AC_DEFINE(USE_DLFCN)
AC_DEFINE(_PR_STAT_HAS_ST_ATIMESPEC)
;;
esac
;;
*-darwin*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(DARWIN)
AC_DEFINE(HAVE_BSD_FLOCK)
CFLAGS="$CFLAGS -Wmost -fno-common"
if echo $OS_TEST | grep -c 86 2>/dev/null; then
AC_DEFINE(i386)
CPU_ARCH=i386
else
AC_DEFINE(ppc)
CPU_ARCH=ppc
fi
DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @executable_path/$@ -headerpad_max_install_names'
# Use the standard preprocessor (cpp)
CFLAGS="$CFLAGS -no-cpp-precomp"
MKSHLIB='$(CC) -arch $(CPU_ARCH) $(DSO_LDOPTS) -o $@'
STRIP="$STRIP -x -S"
DLL_SUFFIX=dylib
USE_PTHREADS=1
MDCPUCFG_H=_darwin.cfg
PR_MD_CSRCS=darwin.c
if test "$CPU_ARCH" = "ppc"; then
PR_MD_ASFILES=os_Darwin_ppc.s
fi
# Add Mac OS X support for loading CFM & CFBundle plugins
if test -f /System/Library/Frameworks/Carbon.framework/Carbon; then
AC_DEFINE(XP_MACOSX)
OS_TARGET=MacOSX
dnl The C preprocessor can only handle integers in comparisons, so
dnl convert the version to the form AABBCC where AA=major release,
dnl BB=minor release, and CC=point/micro release.
MACOS_VERSION_MAJOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 1`
MACOS_VERSION_MINOR=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 2`
MACOS_VERSION_MICRO=`echo $MACOS_DEPLOYMENT_TARGET_STR | cut -d . -f 3`
if test -z "$MACOS_VERSION_MINOR"; then
MACOS_VERSION_MINOR=0
fi
if test -z "$MACOS_VERSION_MICRO"; then
MACOS_VERSION_MICRO=0
fi
MACOS_DEPLOYMENT_TARGET=`printf "%02d%02d%02d" "$MACOS_VERSION_MAJOR" "$MACOS_VERSION_MINOR" "$MACOS_VERSION_MICRO"`
AC_DEFINE_UNQUOTED(MACOS_DEPLOYMENT_TARGET, $MACOS_DEPLOYMENT_TARGET)
fi
# do the right thing for panther SDK support
if test "$NEXT_ROOT"; then
CFLAGS="-I${NEXT_ROOT}/usr/include $CFLAGS"
CXXFLAGS="-I${NEXT_ROOT}/usr/include $CXXFLAGS"
fi
;;
*-dgux*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(_PR_LOCAL_THREADS_ONLY)
AC_DEFINE(SVR4)
AC_DEFINE(SYSV)
AC_DEFINE(DGUX)
AC_DEFINE(_DGUX_SOURCE)
AC_DEFINE(_POSIX4A_DRAFT6_SOURCE)
DSO_LDOPTS=-G
_OPTIMIZE_FLAGS=-O2
_DEBUG_FLAGS=
MDCPUCFG_H=_dgux.cfg
PR_MD_CSRCS=dgux.c
;;
*-freebsd*)
if test -z "$USE_NSPR_THREADS"; then
USE_PTHREADS=1
fi
AC_DEFINE(XP_UNIX)
AC_DEFINE(FREEBSD)
AC_DEFINE(HAVE_BSD_FLOCK)
AC_DEFINE(HAVE_SOCKLEN_T)
CFLAGS="$CFLAGS $(DSO_CFLAGS) -ansi -Wall"
MOZ_OBJFORMAT=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
if test "$MOZ_OBJFORMAT" = "elf"; then
DLL_SUFFIX=so
else
DLL_SUFFIX=so.1.0
fi
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
DSO_CFLAGS=-fPIC
DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
MDCPUCFG_H=_freebsd.cfg
PR_MD_CSRCS=freebsd.c
;;
*-hpux*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(HPUX)
AC_DEFINE(_HPUX_SOURCE)
AC_DEFINE(hppa)
# OSF1 and HPUX report the POLLHUP event for a socket when the
# shutdown(SHUT_WR) operation is called for the remote end, even though
# the socket is still writeable. Use select(), instead of poll(), to
# workaround this problem.
AC_DEFINE(_PR_POLL_WITH_SELECT)
AC_DEFINE(_USE_BIG_FDS)
DLL_SUFFIX=sl
DSO_LDOPTS='-b +h $(notdir $@)'
PR_MD_CSRCS=hpux.c
if test "$OS_TEST" != "ia64"; then
PR_MD_ASFILES=os_HPUX.s
fi
if test -n "$USE_64"; then
MDCPUCFG_H=_hpux64.cfg
else
MDCPUCFG_H=_hpux32.cfg
fi
if test -z "$GNU_CC"; then
CC="$CC -Ae"
CXX="$CXX -ext"
DSO_CFLAGS=+Z
else
DSO_CFLAGS=-fPIC
fi
if test -n "$MOZILLA_CLIENT"; then
DEFAULT_IMPL_STRATEGY=_EMU
fi
if echo "$OS_RELEASE" | grep ^A.09 >/dev/null; then
AC_DEFINE(_PR_NEED_H_ERRNO)
AC_DEFINE(HPUX9)
DEFAULT_IMPL_STRATEGY=_EMU
USE_NSPR_THREADS=1
fi
if echo "$OS_RELEASE" | egrep '^(A.09|B.10)' >/dev/null; then
AC_DEFINE(_PR_NO_LARGE_FILES)
fi
if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
AC_DEFINE(_PR_NEED_H_ERRNO)
fi
if echo "$OS_RELEASE" | egrep '^(B.10.10|B.10.20)' >/dev/null; then
AC_DEFINE(HAVE_INT_LOCALTIME_R)
fi
if echo "$OS_RELEASE" | egrep '^(B.10.30|B.11)' >/dev/null; then
AC_DEFINE(HAVE_POINTER_LOCALTIME_R)
fi
# HP-UX 11i (B.11.11) or higher
changequote(<<,>>)
case "$OS_RELEASE" in