This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[patch] -Wall
[perl5.git] / hints / bsdos.sh
1 # hints/bsdos.sh
2 #
3 # hints file for BSD/OS (adapted from bsd386.sh)
4 # Original by Neil Bowers <neilb@khoros.unm.edu>; Tue Oct  4 12:01:34 EDT 1994
5 # Updated by Tony Sanders <sanders@bsdi.com>; Sat Aug 23 12:47:45 MDT 1997
6 #     Added 3.1 with ELF dynamic libraries (NOT in 3.1 yet.
7 #     Estimated for 4.0) SYSV IPC tested Ok so I re-enabled.
8 #
9 # Updated to work in post-4.0 by Todd C. Miller <millert@openbsd.org>
10 #
11 # Updated for threads by "Timur I. Bakeyev" <bsdi@listserv.bat.ru>
12 #
13 # To override the compiler on the command line:
14 #     ./Configure -Dcc=gcc2
15 #
16 # The BSD/OS distribution is built with:
17 #     ./Configure -des -Dbsdos_distribution=defined
18
19 signal_t='void'
20 d_voidsig='define'
21
22 usemymalloc='n'
23
24 # setre?[ug]id() have been replaced by the _POSIX_SAVED_IDS versions.
25 # See <A HREF="http://www.bsdi.com/bsdi-man?setuid">http://www.bsdi.com/bsdi-man?setuid</A>(2)
26 d_setregid='undef'
27 d_setreuid='undef'
28 d_setrgid='undef'
29 d_setruid='undef'
30
31 # we don't want to use -lnm, since exp() is busted (in 1.1 anyway)
32 set `echo X "$libswanted "| sed -e 's/ nm / /'`
33 shift
34 libswanted="$*"
35
36 # X libraries are in their own tree
37 glibpth="$glibpth /usr/X11/lib"
38 ldflags="$ldflags -L/usr/X11/lib"
39
40 case "$optimize" in
41 '')     optimize='-O2' ;;
42 esac
43
44 case "$bsdos_distribution" in
45 ''|undef|false) ;;
46 *)
47         d_dosuid='define'
48         d_portable='undef'
49         prefix='/usr/contrib'
50         perlpath='/usr/bin/perl5'
51         startperl='#!/usr/bin/perl5'
52         scriptdir='/usr/contrib/bin'
53         privlib='/usr/libdata/perl5'
54         man1dir='/usr/contrib/man/man1'
55         man3dir='/usr/contrib/man/man3'
56         # phlib added by BSDI -- we share the *.ph include dir with perl4
57         phlib="/usr/libdata/perl5/site_perl/$(arch)-$osname/include"
58         phlibexp="/usr/libdata/perl5/site_perl/$(arch)-$osname/include"
59         ;;
60 esac
61
62 case "$osvers" in
63 1.0*)
64         # Avoid problems with HUGE_VAL in POSIX in 1.0's cc.
65         POSIX_cflags='ccflags="$ccflags -UHUGE_VAL"' 
66         ;;
67 1.1*)
68         # Use gcc2
69         case "$cc" in
70         '')     cc='gcc2' ;;
71         esac
72         ;;
73 2.0*|2.1*|3.0*|3.1*)
74         so='o'
75
76         # default to GCC 2.X w/shared libraries
77         case "$cc" in
78         '')     cc='shlicc2'
79                 cccdlflags=' ' ;; # Avoid the dreaded -fpic
80         esac
81
82         # default ld to shared library linker
83         case "$ld" in
84         '')     ld='shlicc2'
85                 lddlflags='-r' ;; # this one is necessary
86         esac
87
88         # Must preload the static shared libraries.
89         libswanted="Xpm Xaw Xmu Xt SM ICE Xext X11 $libswanted"
90         libswanted="rpc curses termcap $libswanted"
91         ;;
92 4.*)
93         # ELF dynamic link libraries starting in 4.0
94         useshrplib='true'
95         so='so'
96         dlext='so'
97
98         case "$cc" in
99         '')     cc='cc'                 # cc is gcc2 in 4.0
100                 cccdlflags="-fPIC"
101                 ccdlflags="-rdynamic -Wl,-rpath,$privlib/$archname/CORE"
102                 ;;
103         esac
104
105         case "$ld" in
106         '')     ld='ld'
107                 lddlflags="-shared -x $lddlflags" ;;
108         esac
109         # Due usage of static pointer from crt.o
110         libswanted="util $libswanted" ;;
111 esac
112
113 # This script UU/usethreads.cbu will get 'called-back' by Configure 
114 # after it has prompted the user for whether to use threads.
115 cat > UU/usethreads.cbu <<'EOCBU'
116 case "$usethreads" in
117 $define|true|[yY]*)
118         case "$osvers" in 
119         3.*|4.*)        ccflags="-D_REENTRANT $ccflags" 
120             ;;
121         *)   cat <<EOM >&4
122 I did not know that BSD/OS $osvers supports POSIX threads.
123
124 Feel free to tell perlbug@perl.org otherwise.
125 EOM
126             exit 1
127             ;;
128         esac
129         ;;
130 esac
131 EOCBU