Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / perl5 / hints / sco.sh
1 # sco.sh
2 # Courtesy of Joel Rosi-Schwartz <j.schwartz@agonet.it>
3 ###############################################################
4 # Additional SCO version info from
5 # Peter Wolfe   <wolfe@teloseng.com>
6 # Fri Jul 19 14:54:25 EDT 1996
7 # and again Tue Sep 29 16:37:25 EDT 1998
8 # by Andy Dougherty  <doughera@lafayette.edu>
9 # Mostly rewritten on
10 # Tue Jan 19 23:00:00 CET 1999
11 # by Francois Desarmenien <desar@club-internet.fr>
12 ###############################################################
13 #
14 # To use cc,  use   sh Configure
15 # To use gcc, use   sh Configure -Dcc=gcc
16 #
17 # Default on 3.2v4 is to use static link (dynamic loading unsupported).
18 # Default on 3.2v5 is to use dynamic loading.
19 # To use static linkink instead, use to sh Configure -Dusedl=n
20 #
21 # Warning: - to use dynamic loading with gcc, you need gcc 2.8.0 or later
22 # ******** - to compile with older releases of gcc, use Configure -Dusedl=n
23 #            or it wont compile properly
24 #
25 ###############################################################
26 # NOTES:
27 # -----
28 #
29 # I Have removed inclusion of ODBM_File for OSR5
30 # because it core dumps and make tests fails.
31 #
32 # Support for icc compiler has been removed, because it 'breaks'
33 # a lot of code :-(
34 #
35 # It's *always* a good idea to first make a static link to be sure to
36 # have all symbols resolved with the current choice of libraries, since
37 # with dynamic linking, unresolved symbols are allowed an will be detected
38 # only at runtime (when you try to load the module or worse, when you call
39 # the symbol)
40 #
41 # The best choice of compiler on OSR 5 (3.2v5.*) seems to be gcc >= 2.8.0:
42 # -You cannot optimize with genuine sco cc (miniperl core dumps),
43 #  so Perl is faster if compiled with gcc.
44 # -Even optimized for speed, gcc generated code is smaller (!!!)
45 # -gcc is free
46 # -I use ld to link which is distributed with the core OS distribution, so you
47 #  don't need to buy the developement kit, just find someone kind enough to
48 #  give you a binary release of gcc.
49 #
50 #
51
52 ###############################################################
53 # figure out what SCO version we are. The output of uname -X is
54 # something like:
55 #       System = SCO_SV
56 #       Node = xxxxx
57 #       Release = 3.2v5.0.0
58 #       KernelID = 95/08/08
59 #   Machine = Pentium
60 #       BusType = ISA
61 #       Serial = xxxxx
62 #       Users = 5-user
63 #       OEM# = 0
64 #       Origin# = 1
65 #   NumCPU = 1
66
67 # Use /bin/uname (because GNU uname may be first in $PATH and
68 # it does not support -X) to figure out what SCO version we are:
69 # Matching '^Release' is broken by locale setting:
70 # matching '3.2v' should be enough -- FD
71 case `/bin/uname -X | egrep '3\.2v'` in
72 *3.2v4.*) scorls=3 ;;   # OSR 3
73 *3.2v5.*) scorls=5 ;;   # OSR 5
74 *)
75    # Future of SCO OSR is SCO UnixWare: there should not be new OSR releases
76    echo "************************************************************" >&4
77    echo "\a" >&4
78    echo "  sco.sh hints file only supports:" >&4
79    echo "\a" >&4
80    echo "    - SCO Unix 3.2v4.x (OSR 3)" >&4
81    echo "    - SCO Unix 3.2v5.x (OSR 5)" >&4
82    echo "\a" >&4
83    echo "\a" >&4
84    echo "  For UnixWare, use svr4.sh hints instead" >&4
85    echo "\a" >&4
86    echo "***********************************************************" >&4
87    exit
88 ;;
89 esac
90
91 ###############################################################
92 # Common fixes for all compilers an releases:
93
94 ###############################################################
95 # What is true for SCO5 is true for SCO3 too today, so let's have a single
96 # symbol for both
97 ccflags="-U M_XENIX -D PERL_SCO"
98
99 ###############################################################
100 # Compilers options section:
101 if test "$scorls" = "3"
102 then 
103     dlext=''
104     case "$cc" in
105         gcc)    optimize='-O2' ;;
106         *)      ccflags="$ccflags -W0 -quiet"
107                 optimize='-O' ;;
108     esac
109 else
110     ###############################################################
111     # Need this in release 5 because of changed fpu exeption rules
112     ccflags="$ccflags -D PERL_SCO5"
113
114     ###############################################################
115     # In Release 5, always compile ELF objects
116     case "$cc" in
117         gcc)
118             ccflags="$ccflags -melf"
119             optimize='-O2'
120         ;;
121         *)
122             ccflags="$ccflags -w0 -belf"
123             optimize='-O0'
124         ;;
125     esac
126     ###############################################################
127     # Dynamic loading section:
128     #
129     # We use ld to build shared libraries as it is always available
130     # and seems to work better than GNU's one on SCO
131     #
132     # ccdlflags : must tell the linker to export all global symbols
133     # cccdlflags: must tell the compiler to generate relocatable code
134     # lddlflags : must tell the linker to output a shared library
135     #
136     # /usr/local/lib is added for convenience, since 'foreign' libraries
137     # are usually put there in sco
138     #
139     if test "$usedl" != "n"; then
140         ld='ld'
141         case "$cc" in
142             gcc)
143                 ccdlflags='-Xlinker -Bexport -L/usr/local/lib'
144                 cccdlflags='-fpic'
145                 lddlflags='-G -L/usr/local/lib'
146             ;;
147             *)
148                 ccdlflags='-Bexport -L/usr/local/lib'
149                 cccdlflags='-Kpic'
150                 lddlflags='-G -L/usr/local/lib'
151             ;;
152         esac
153
154         ###############################################################
155         # Use dynamic loading
156         usedl='define'
157         dlext='so'
158         dlsrc='dl_dlopen.xs'
159
160         ###############################################################
161         # Force to define those symbols, as they are #defines and not
162         # catched by Configure, and they are useful
163         d_dlopen='define'
164         d_dlerror='define'
165     fi
166 fi
167
168
169 ###############################################################
170 # Various hints, common to all releases, to have it work better:
171
172 ###############################################################
173 # We need to remove libdl, as libdl.so exists, but ld complains
174 # it can't find libdl.a ! Bug or feature ? :-)
175 libswanted=`echo " $libswanted " | sed -e 's/ dl / /'`
176 set X $libswanted
177 shift
178 libswanted="$*"
179
180 ###############################################################
181 # Try to use libintl.a since it has strcoll and strxfrm
182 libswanted="intl $libswanted"
183
184 ###############################################################
185 # Try to use libdbm.nfs.a since it has dbmclose.
186 if test -f /usr/lib/libdbm.nfs.a ; then
187     libswanted=`echo "dbm.nfs $libswanted " | sed -e 's/ dbm / /'`
188     set X $libswanted
189     shift
190     libswanted="$*"
191 fi
192
193 ###############################################################
194 # We disable ODBM_File if OSR5 because it's mostly broken
195 # but keep it for ODT3 as it seems to work.
196 if test "$scorls" = "5"; then
197     i_dbm='undef'
198 fi
199
200 ###############################################################
201 # We don't want Xenix cross-development libraries
202 glibpth=`echo $glibpth | sed -e 's! /usr/lib/386 ! !' -e 's! /lib/386 ! !'`
203 xlibpth=''
204
205 ###############################################################
206 # I have received one report that nm extraction doesn't work if you're
207 # using the scocc compiler.  This system had the following 'myconfig'
208 # uname='xxx xxx 3.2 2 i386 '
209 # cc='scocc', optimize='-O'
210 # You can override this with Configure -Dusenm.
211 case "$usenm" in
212 '') usenm='false' ;;
213 esac
214
215 ###############################################################
216 # If you want to use nm, you'll probably have to use nm -p.  The
217 # following does that for you:
218 nm_opt='-p'
219
220 ###############################################################
221 # I have received one report that you can't include utime.h in
222 # pp_sys.c.  Uncomment the following line if that happens to you:
223 # i_utime=undef
224
225 ###############################################################
226 # Perl 5.003_05 and later try to include both <time.h> and <sys/select.h>
227 # in pp_sys.c, but that fails due to a redefinition of struct timeval.
228 # This will generate a WHOA THERE.  Accept the default.
229 i_sysselct=$undef
230
231
232 ###############################################################
233 #END of hint file