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