1 # svr5 hints, System V Release 5.x (UnixWare 7)
2 # mods after mail fm Andy Dougherty
3 # Reworked by hops@sco.com Sept/Oct 1999 for UW7.1 platform support
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
8 # Use Configure -Dusethreads to enable threads.
9 # Use Configure -Dcc=gcc to use gcc.
12 # "$gccversion" not set yet
13 vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'`
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
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
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)
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
42 # Leave leading tabs so Configure doesn't propagate variables to config.sh
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
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
55 # installed on any/all 7.0 systems and leave the above unset.
57 if [ "$want_ucb" ] ; then
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
62 libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
63 glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
65 # If see libdbm in /usr/local and not overidden assume its the
66 # non ucblib rebuild from skunkware and use it
67 if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then
69 libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
73 if [ ! "$want_gdbm" ] ; then
75 libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
79 # Don't use problematic libraries:
80 # libmalloc.a - Probably using Perl's malloc() anyway.
81 # libc: on UW7 don't want -lc explicitly as native cc gives warnings/errors
82 libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'`
84 # remove /shlib and /lib from library search path as both symlink to /usr/lib
85 # where runtime shared libc is
86 glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /`
88 # Don't use BSD emulation pieces (/usr/ucblib) regardless
89 # these would probably be autonondetected anyway but ...
90 d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert().
91 d_bcopy='undef' d_bcmp='undef' d_bzero='undef' d_safebcpy='undef'
92 d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
94 d_setregid='undef' d_setreuid='undef' # -- in /usr/lib/libc.so.1
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`
102 if [ "$sh_cnt" -ne "$csh_cnt" ]; then
103 echo "You're csh has a broken 'glob', disabling..." >&2
107 # Unixware-specific problems. UW7 give correctname with uname -s
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
111 # Leave leading tabs on the next two lines so Configure doesn't
112 # propagate these variables to config.sh
114 uw_isuw=`uname -s 2>&1`
116 if [ "$uw_isuw" = "UnixWare" ]; then
122 stdio_cnt='((fp)->__cnt)'
123 d_stdio_cnt_lval='define'
124 stdio_ptr='((fp)->__ptr)'
125 d_stdio_ptr_lval='define'
127 d_bcopy='define' # In /usr/lib/libc.so.1
128 d_setregid='define' # "
129 d_setreuid='define' # "
131 if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then
132 libswanted=" $libswanted cudk70"
139 stdio_cnt='((fp)->__cnt)'
140 d_stdio_cnt_lval='define'
141 stdio_ptr='((fp)->__ptr)'
142 d_stdio_ptr_lval='define'
146 # End of Unixware-specific tests.
148 ###############################################################
149 # Dynamic loading section: Is default so it should just happen.
150 # set below to explicitly force.
153 # dlsrc='dl_dlopen.xs'
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
159 # use shared perl lib
164 ccdlflags='-Xlinker -Bexport '
170 ccdlflags='-Wl,-Bexport'
172 lddlflags='-G -Wl,-Bexport'
176 ############################################################################
178 # use Configure -Dusethreads to enable
179 # This script UU/usethreads.cbu will get 'called-back' by Configure
180 # after it has prompted the user for whether to use threads.
181 cat > UU/usethreads.cbu <<'EOCBU'
182 case "$usethreads" in
189 ccflags="-D_REENTRANT $ccflags -fpic -pthread"
191 lddlflags='-pthread -G '
194 ccflags="-D_REENTRANT $ccflags -KPIC -Kthread"
195 ccdlflags='-Kthread -Wl,-Bexport'
196 cccdlflags='-KPIC -Kthread'
197 lddlflags='-G -Kthread -Wl,-Bexport '
205 d_suidsafe='define' # "./Configure -d" can't figure this out easily
207 ################## final caveat msgs to builder ###############
210 If you wish to use dynamic linking, you must use
211 LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
213 setenv LD_LIBRARY_PATH `pwd`
216 If you are using shared libraries from /usr/local/lib
217 for libdbm or libgdbm you may need to set
218 LD_RUN_PATH=/usr/local/lib; export LD_RUN_PATH
219 in order for Configure to compile the simple test program