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 if [ "X$gccversion" = "X" ]; then
14 # Done too late in Configure if hinted
15 gccversion=`$cc --version | sed 's/.*(GCC) *//'`
19 ccflags='-fno-strict-aliasing'
20 # More optimisation provided in gcc-2.95 causes miniperl to segv.
21 # -fno-strict-aliasing is supposed to correct this but
22 # if it doesn't and you get segv when the build runs miniperl then
23 # disable optimisation as below
30 # Hardwire the processor to 586 for consistancy with autoconf
31 # archname='i586-svr5'
32 # -- seems this is generally disliked by perl porters so leave it to float
34 # Our default setup excludes anything from /usr/ucblib (and consequently dbm)
35 # as later modules assume symbols found are available in shared libs
36 # On svr5 these are static archives which causes problems for
37 # dynamic modules loaded later (and ucblib is a bad dream anyway)
39 # However there is a dbm library built from the ucb sources outside ucblib
40 # at http://www.sco.com/skunkware (installing into /usr/local) so if we
41 # detect this we'll use it. You can change the default
42 # (to allow ucblib and its dbm or disallowing non ucb dbm) by
43 # changing 'want_*' config values below to '' to disable or otherwise to enable
45 # Leave leading tabs so Configure doesn't propagate variables to config.sh
47 want_ucb='' # don't use anything from /usr/ucblib - icky
48 want_dbm='yes' # use dbm if can find library in /usr/local/lib
49 want_gdbm='yes' # use gdbm if can find library in /usr/local/lib
50 want_udk70='' # link with old static libc pieces
51 # link with udk70 if building on 7.1 abd want resulting binary
52 # to run on uw7.0* - it will link in referenced static symbols
53 # of libc that are (now) in the shared libc.so on 7.1 but were
55 # There are still scenarios where this is still insufficient so
56 # overall it is preferable to get ptf7051e
57 # ftp://ftp.sco.com/SLS/ptf7051e.Z
58 # installed on any/all 7.0 systems and leave the above unset.
60 if [ "$want_ucb" ] ; then
61 ldflags= '-L/usr/ucblib'
62 ccflags='-I/usr/ucbinclude'
63 # /usr/ccs/include and /usr/ccs/lib are used implicitly by cc as reqd
65 libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
66 glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
68 # If see libdbm in /usr/local and not overidden assume its the
69 # non ucblib rebuild from skunkware and use it
70 if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then
72 libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
76 if [ ! "$want_gdbm" ] ; 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 # remove /shlib and /lib from library search path as both symlink to /usr/lib
88 # where runtime shared libc is
89 glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /'`
91 # Don't use BSD emulation pieces (/usr/ucblib) regardless
92 # these would probably be autonondetected anyway but ...
93 gconvert_preference='gcvt sprintf' # Try gcvt() before gconvert().
94 d_bcopy='undef' d_bcmp='undef' d_bzero='undef' d_safebcpy='undef'
95 d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
97 d_setregid='undef' d_setreuid='undef' # -- in /usr/lib/libc.so.1
100 # Broken C-Shell tests (Thanks to Tye McQueen):
101 # The OS-specific checks may be obsoleted by the this generic test.
102 sh_cnt=`sh -c 'echo /*' | wc -c`
103 csh_cnt=`csh -f -c 'glob /*' 2>/dev/null | wc -c`
104 csh_cnt=`expr 1 + $csh_cnt`
105 if [ "$sh_cnt" -ne "$csh_cnt" ]; then
106 echo "You're csh has a broken 'glob', disabling..." >&2
110 # Unixware-specific problems. UW7 give correctname with uname -s
111 # UnixWare has a broken csh. (This might already be detected above).
112 # Configure can't detect memcpy or memset on Unixware 2 or 7
114 # Leave leading tabs on the next two lines so Configure doesn't
115 # propagate these variables to config.sh
117 uw_isuw=`uname -s 2>&1`
119 if [ "$uw_isuw" = "UnixWare" ]; then
125 stdio_cnt='((fp)->__cnt)'
126 d_stdio_cnt_lval='define'
127 stdio_ptr='((fp)->__ptr)'
128 d_stdio_ptr_lval='define'
130 d_bcopy='define' # In /usr/lib/libc.so.1
131 d_setregid='define' # "
132 d_setreuid='define' # "
134 if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then
135 libswanted=" $libswanted cudk70"
142 stdio_cnt='((fp)->__cnt)'
143 d_stdio_cnt_lval='define'
144 stdio_ptr='((fp)->__ptr)'
145 d_stdio_ptr_lval='define'
149 # End of Unixware-specific tests.
151 ###############################################################
152 # Dynamic loading section: Is default so it should just happen.
153 # set below to explicitly force.
156 # dlsrc='dl_dlopen.xs'
158 # ccdlflags : must tell the linker to export all global symbols
159 # cccdlflags: must tell the compiler to generate relocatable code
160 # lddlflags : must tell the linker to output a shared library
162 # use shared perl lib if the user doesn't choose otherwise
163 if test "x$useshrplib" = "x"; then
169 ccdlflags='-Xlinker -Bexport '
175 ccdlflags='-Wl,-Bexport'
177 lddlflags='-G -Wl,-Bexport'
181 ############################################################################
183 # use Configure -Dusethreads to enable
184 # This script UU/usethreads.cbu will get 'called-back' by Configure
185 # after it has prompted the user for whether to use threads.
186 cat > UU/usethreads.cbu <<'EOCBU'
187 case "$usethreads" in
194 ccflags="-D_REENTRANT $ccflags -fpic -pthread"
196 lddlflags='-pthread -G '
199 ccflags="-D_REENTRANT $ccflags -KPIC -Kthread"
200 ccdlflags='-Kthread -Wl,-Bexport'
201 cccdlflags='-KPIC -Kthread'
202 lddlflags='-G -Kthread -Wl,-Bexport '
210 d_suidsafe='define' # "./Configure -d" can't figure this out easily
212 ################## final caveat msgs to builder ###############
215 If you wish to use dynamic linking, you must use
216 LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH
218 setenv LD_LIBRARY_PATH `pwd`
221 If you are using shared libraries from /usr/local/lib
222 for libdbm or libgdbm you may need to set
223 LD_RUN_PATH=/usr/local/lib; export LD_RUN_PATH
224 in order for Configure to compile the simple test program