Integrate with Sarathy.
[p5sagit/p5-mst-13.2.git] / hints / svr5.sh
CommitLineData
d1fdab89 1# svr5 hints, System V Release 5.x (UnixWare 7)
2# Reworked by hops@sco.com Sept 1999 for better platform support
3# Boyd Gerber, gerberb@zenez.com 1999/09/21 for threads support.
4# Originally taken from svr4 hints.sh 21-Sep-98 hops@sco.com
5# which was version of 1996/10/25 by Tye McQueen, tye@metronet.com
0337d152 6
d1fdab89 7# Use Configure -Dusethreads to enable threads.
0337d152 8# Use Configure -Dcc=gcc to use gcc.
9case "$cc" in
10'') cc='/bin/cc'
11 test -f $cc || cc='/usr/ccs/bin/cc'
12 ;;
d1fdab89 13*gcc*)
14 # "$gccversion" not set yet
15 vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'`
16 case $vers in
17 *2.95*)
18 ccflags='-fno-strict-aliasing'
19 # More optimisation provided in gcc-2.95 causes miniperl to segv.
20 # -fno-strict-aliasing is supposed to correct this but
21 # if it doesn't and you get segv when the build runs miniperl then
22 # disable optimisation as below
23 # optimize=' '
24 ;;
0337d152 25 esac
d1fdab89 26 ;;
0337d152 27esac
28
d1fdab89 29# Hardwire the processor to 586 for consistancy with autoconf
30# archname='i586-svr5'
31# -- seems this is generally disliked by perl porters so leave it to float
32
33# Our default setup excludes anything from /usr/ucblib (and consequently dbm)
34# as later modules assume symbols found are available in shared libs
35# On svr5 these are static archives which causes problems for
36# dynamic modules loaded later (and ucblib is a bad dream anyway)
37#
38# However there is a dbm library built from the ucb sources outside ucblib
39# at http://www.sco.com/skunkware (installing into /usr/local) so if we
40# detect this we'll use it. You can change the default
41# (to allow ucblib and its dbm or disallowing non ucb dbm) by
42# changing 'want_*' config values below to '' to disable or otherwise to enable
43
44# Leave leading tabs so Configure doesn't propagate variables to config.sh
45
46 want_ucb='' # don't use anything from /usr/ucblib - icky
47 want_dbm='yes' # use dbm if can find library in /usr/local/lib
48 want_gdbm='yes' # use gdbm if can find library in /usr/local/lib
49 want_udk70='' # link with old static libc pieces
50 # link with udk70 if want resulting binary to run on uw7.0*
51 # - it will link in referenced static symbols of libc that are (now)
52 # in the shared libc.so on 7.1 but were not in 7.0.
53 # There are still scenarios where this is still insufficient so
54 # overall it is preferable to get ptf7051e
55 # ftp://ftp.sco.com/SLS/ptf7051e.Z
56 # installed on any/all 7.0 systems.
0337d152 57
58if [ "$want_ucb" ] ; then
d1fdab89 59 ldflags= '-L/usr/ucblib'
60 ccflags='-I/usr/ucbinclude'
61 # /usr/ccs/include and /usr/ccs/lib are used implicitly by cc as reqd
0337d152 62else
0337d152 63 libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
64 glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
65
d1fdab89 66 # If see libdbm in /usr/local and not overidden assume its the
67 # non ucblib rebuild from skunkware and use it
0337d152 68 if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then
d1fdab89 69 i_dbm='undef'
0337d152 70 libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
71 fi
72fi
73
74if [ "$want_gdbm" -a -f /usr/local/lib/libgdbm.so ] ; then
75 i_gdbm='define'
76else
77 i_gdbm='undef'
78 libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
79fi
80
d1fdab89 81
0337d152 82# Don't use problematic libraries:
83# libmalloc.a - Probably using Perl's malloc() anyway.
d1fdab89 84# libc: on UW7 don't want -lc explicitly as native cc gives warnings/errors
0337d152 85libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'`
86
d1fdab89 87# Don't use irrelevant (but existing) lib dirs
88# don't want /usr/gnu/lib - original(older) system supplied distrib of perl5
89loclibpth=`echo " $loclibpth " | sed -e 's@ /usr/gnu/lib @ @'`
90
0337d152 91# remove /shlib and /lib from library search path as both symlink to /usr/lib
92# where runtime shared libc is
93glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /`
94
d1fdab89 95# Don't use BSD emulation pieces (/usr/ucblib) regardless
96# these would probably be autonondetected anyway but ...
97d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert().
98d_bcopy='undef' d_bcmp='undef' d_bzero='undef' d_safebcpy='undef'
99d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
100d_setlinebuf='undef'
101d_setregid='undef' d_setreuid='undef' # -- in /usr/lib/libc.so.1
102
103
104# use nm to probe libs - its fast enough on uw7
0337d152 105case "$usenm" in
d1fdab89 106'') usenm=true;;
0337d152 107esac
108
109# Broken C-Shell tests (Thanks to Tye McQueen):
110# The OS-specific checks may be obsoleted by the this generic test.
111 sh_cnt=`sh -c 'echo /*' | wc -c`
112 csh_cnt=`csh -f -c 'glob /*' 2>/dev/null | wc -c`
113 csh_cnt=`expr 1 + $csh_cnt`
114if [ "$sh_cnt" -ne "$csh_cnt" ]; then
115 echo "You're csh has a broken 'glob', disabling..." >&2
116 d_csh='undef'
117fi
118
d1fdab89 119# Unixware-specific problems. UW7 give correctname with uname -s
0337d152 120# UnixWare has a broken csh. (This might already be detected above).
121# Configure can't detect memcpy or memset on Unixware 2 or 7
122#
123# Leave leading tabs on the next two lines so Configure doesn't
124# propagate these variables to config.sh
125 uw_ver=`uname -v`
d1fdab89 126 uw_isuw=`uname -s 2>&1`
0337d152 127
d1fdab89 128if [ "$uw_isuw" = "UnixWare" ]; then
0337d152 129 case $uw_ver in
d1fdab89 130 7.1*)
131 d_csh='undef'
132 d_memcpy='define'
133 d_memset='define'
134 stdio_cnt='((fp)->__cnt)'
135 d_stdio_cnt_lval='define'
136 stdio_ptr='((fp)->__ptr)'
137 d_stdio_ptr_lval='define'
138
139 d_bcopy='define' # In /usr/lib/libc.so.1
140 d_setregid='define' # "
141 d_setreuid='define' # "
142
143 if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then
144 libswanted=" $libswanted cudk70"
145 fi
146 ;;
0337d152 147 7*)
148 d_csh='undef'
149 d_memcpy='define'
150 d_memset='define'
151 stdio_cnt='((fp)->__cnt)'
152 d_stdio_cnt_lval='define'
153 stdio_ptr='((fp)->__ptr)'
154 d_stdio_ptr_lval='define'
155 ;;
156 esac
157fi
d1fdab89 158# End of Unixware-specific tests.
0337d152 159
160###############################################################
161# Dynamic loading section:
162#
163# ccdlflags : must tell the linker to export all global symbols
164# cccdlflags: must tell the compiler to generate relocatable code
165# lddlflags : must tell the linker to output a shared library
166#
167# /usr/local/lib is added for convenience, since additional libraries
168# are usually put there
169#
170# use shared perl lib
171useshrplib='true'
172
173case "$cc" in
174 *gcc*)
175 ccdlflags='-Xlinker -Bexport -L/usr/local/lib'
176 cccdlflags='-fpic'
177 lddlflags='-G -L/usr/local/lib'
178 ;;
d1fdab89 179
0337d152 180 *)
181 ccdlflags='-Wl,-Bexport -L/usr/local/lib'
d1fdab89 182 cccdlflags='-Kpic'
0337d152 183 lddlflags='-G -Wl,-Bexport -L/usr/local/lib'
184 ;;
185esac
186
187###############################################################
188# Use dynamic loading
189usedl='define'
190dlext='so'
191dlsrc='dl_dlopen.xs'
192
0337d152 193
d1fdab89 194############################################################################
195# Thread support
196# use Configure -Dusethreads to enable
0337d152 197# This script UU/usethreads.cbu will get 'called-back' by Configure
198# after it has prompted the user for whether to use threads.
199cat > UU/usethreads.cbu <<'EOCBU'
200case "$usethreads" in
201$define|true|[yY]*)
202 ccflags="$ccflags"
203 set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
204 shift
205 libswanted="$*"
206 case "$cc" in
207 *gcc*)
208 ccflags="-D_REENTRANT $ccflags -fpic -pthread"
209 cccdlflags='-fpic'
210 lddlflags='-pthread -G -L/usr/local/lib '
211 ;;
212 *)
213 ccflags="-D_REENTRANT $ccflags -KPIC -Kthread"
214 ccdlflags='-Kthread -Wl,-Bexport -L/usr/local/lib'
215 cccdlflags='-KPIC -Kthread'
216 lddlflags='-G -Kthread -Wl,-Bexport -L/usr/local/lib'
d1fdab89 217 ldflags='-Kthread -L/usr/local/lib'
0337d152 218 ;;
219 esac
220esac
221EOCBU
222
0337d152 223
d1fdab89 224# Just in case Configure fails to find lstat() Its in /usr/lib/libc.so.1.
225d_lstat=define
0337d152 226
d1fdab89 227d_suidsafe='define' # "./Configure -d" can't figure this out easily