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
7 # Use Configure -Dusethreads to enable threads.
8 # Use Configure -Dcc=gcc to use gcc.
11 test -f $cc || cc='/usr/ccs/bin/cc'
14 # "$gccversion" not set yet
15 vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'`
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
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
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)
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
44 # Leave leading tabs so Configure doesn't propagate variables to config.sh
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.
58 if [ "$want_ucb" ] ; then
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
63 libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
64 glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
66 # If see libdbm in /usr/local and not overidden assume its the
67 # non ucblib rebuild from skunkware and use it
68 if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then
70 libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
74 if [ "$want_gdbm" -a -f /usr/local/lib/libgdbm.so ] ; then
78 libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
82 # Don't use problematic libraries:
83 # libmalloc.a - Probably using Perl's malloc() anyway.
84 # libc: on UW7 don't want -lc explicitly as native cc gives warnings/errors
85 libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'`
87 # Don't use irrelevant (but existing) lib dirs
88 # don't want /usr/gnu/lib - original(older) system supplied distrib of perl5
89 loclibpth=`echo " $loclibpth " | sed -e 's@ /usr/gnu/lib @ @'`
91 # remove /shlib and /lib from library search path as both symlink to /usr/lib
92 # where runtime shared libc is
93 glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /`
95 # Don't use BSD emulation pieces (/usr/ucblib) regardless
96 # these would probably be autonondetected anyway but ...
97 d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert().
98 d_bcopy='undef' d_bcmp='undef' d_bzero='undef' d_safebcpy='undef'
99 d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
101 d_setregid='undef' d_setreuid='undef' # -- in /usr/lib/libc.so.1
104 # use nm to probe libs - its fast enough on uw7
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`
114 if [ "$sh_cnt" -ne "$csh_cnt" ]; then
115 echo "You're csh has a broken 'glob', disabling..." >&2
119 # Unixware-specific problems. UW7 give correctname with uname -s
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
123 # Leave leading tabs on the next two lines so Configure doesn't
124 # propagate these variables to config.sh
126 uw_isuw=`uname -s 2>&1`
128 if [ "$uw_isuw" = "UnixWare" ]; then
134 stdio_cnt='((fp)->__cnt)'
135 d_stdio_cnt_lval='define'
136 stdio_ptr='((fp)->__ptr)'
137 d_stdio_ptr_lval='define'
139 d_bcopy='define' # In /usr/lib/libc.so.1
140 d_setregid='define' # "
141 d_setreuid='define' # "
143 if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then
144 libswanted=" $libswanted cudk70"
151 stdio_cnt='((fp)->__cnt)'
152 d_stdio_cnt_lval='define'
153 stdio_ptr='((fp)->__ptr)'
154 d_stdio_ptr_lval='define'
158 # End of Unixware-specific tests.
160 ###############################################################
161 # Dynamic loading section:
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
167 # /usr/local/lib is added for convenience, since additional libraries
168 # are usually put there
170 # use shared perl lib
175 ccdlflags='-Xlinker -Bexport -L/usr/local/lib'
177 lddlflags='-G -L/usr/local/lib'
181 ccdlflags='-Wl,-Bexport -L/usr/local/lib'
183 lddlflags='-G -Wl,-Bexport -L/usr/local/lib'
187 ###############################################################
188 # Use dynamic loading
194 ############################################################################
196 # use Configure -Dusethreads to enable
197 # This script UU/usethreads.cbu will get 'called-back' by Configure
198 # after it has prompted the user for whether to use threads.
199 cat > UU/usethreads.cbu <<'EOCBU'
200 case "$usethreads" in
203 set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
208 ccflags="-D_REENTRANT $ccflags -fpic -pthread"
210 lddlflags='-pthread -G -L/usr/local/lib '
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'
217 ldflags='-Kthread -L/usr/local/lib'
224 # Just in case Configure fails to find lstat() Its in /usr/lib/libc.so.1.
227 d_suidsafe='define' # "./Configure -d" can't figure this out easily