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