1 # svr5 hints, System V Release 5.x
2 # Last modified 1999/09/21 by Boyd Gerber, gerberb@zenez.com
3 # with changes from Mike Hopkirk hops@sco.com
5 # Use Configure -Dcc=gcc to use gcc.
8 test -f $cc || cc='/usr/ccs/bin/cc'
11 # "$gccversion" not set yet
12 vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'`
15 ccflags='-fno-strict-aliasing'
16 # If it coredumps when running miniperl with the above switch on
17 # try instead without optimisation.
28 # We include support for using libraries in /usr/ucblib, but the setting
29 # of libswanted excludes some libraries found there. If you run into
30 # problems, you may have to remove "ucb" from libswanted. Just delete
31 # the comment '#' from the sed command below.
32 # ldflags='-L/usr/ccs/lib -L/usr/ucblib'
33 # ccflags='-I/usr/include -I/usr/ucbinclude'
34 # Don't use problematic libraries:
35 libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'`
36 # libmalloc.a - Probably using Perl's malloc() anyway.
37 # libucb.a - Remove it if you have problems ld'ing. We include it because
38 # it is needed for ODBM_File and NDBM_File extensions.
40 if [ "$want_ucb" ] ; then
41 ldflags= '-L/usr/ccs/lib -L/usr/ucblib'
42 ccflags='-I/usr/include -I/usr/ucbinclude'
43 if [ -r /usr/ucblib/libucb.a ]; then # If using BSD-compat. library:
44 d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert().
45 # Use the "native" counterparts, not the BSD emulation stuff:
46 d_bcmp='undef' d_bcopy='undef' d_bzero='undef' d_safebcpy='undef'
47 d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
49 # d_setregid='undef' d_setreuid='undef' # ???
52 # libswanted=`echo " $libswanted " | sed -e 's/ ucb / /' -e 's/ dbm / /'`
53 libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
54 glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
56 # a non ucb native version of libdbm for /usr/local is available from
57 # http://www.sco.com/skunkware
58 # if its installed (and not overidden) we'll use it.
59 if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then
60 libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
64 if [ "$want_gdbm" -a -f /usr/local/lib/libgdbm.so ] ; then
68 libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
71 # Don't use problematic libraries:
72 # libmalloc.a - Probably using Perl's malloc() anyway.
73 # libc: on UW7 don't want -lc explicitly - cc gives warnings/errors
74 libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'`
76 # remove /shlib and /lib from library search path as both symlink to /usr/lib
77 # where runtime shared libc is
78 glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /`
80 # UnixWare has /usr/lib/libc.so.1, /usr/lib/libc.so.1.1, and
81 # /usr/ccs/lib/libc.so. Configure chooses libc.so.1.1 while it
82 # appears that /usr/ccs/lib/libc.so contains more symbols:
84 # Try the following if you want to use nm-extraction. We'll just
85 # skip the nm-extraction phase, since searching for all the different
86 # library versions will be hard to keep up-to-date.
88 # if [ "" = "$libc" -a -f /usr/ccs/lib/libc.so -a \
89 # -f /usr/lib/libc.so.1 -a -f /usr/lib/libc.so.1.1 ]; then
90 # if nm -h /usr/ccs/lib/libc.so | egrep '\<_?select$' >/dev/null; then
91 # if nm -h /usr/lib/libc.so.1 | egrep '\<_?select$'` >/dev/null ||
92 # nm -h /usr/lib/libc.so.1.1 | egrep '\<_?select$'` >/dev/null; then
95 # libc=/usr/ccs/lib/libc.so
100 # Don't bother with nm. Just compile & link a small C program.
105 # Broken C-Shell tests (Thanks to Tye McQueen):
106 # The OS-specific checks may be obsoleted by the this generic test.
107 sh_cnt=`sh -c 'echo /*' | wc -c`
108 csh_cnt=`csh -f -c 'glob /*' 2>/dev/null | wc -c`
109 csh_cnt=`expr 1 + $csh_cnt`
110 if [ "$sh_cnt" -ne "$csh_cnt" ]; then
111 echo "You're csh has a broken 'glob', disabling..." >&2
115 # Unixware-specific problems. The undocumented -X argument to uname
116 # is probably a reasonable way of detecting UnixWare.
117 # UnixWare has a broken csh. (This might already be detected above).
118 # Configure can't detect memcpy or memset on Unixware 2 or 7
120 # Leave leading tabs on the next two lines so Configure doesn't
121 # propagate these variables to config.sh
123 uw_isuw=`uname -X 2>&1 | grep Release`
125 if [ "$uw_isuw" = "Release = 5" ]; then
131 stdio_cnt='((fp)->__cnt)'
132 d_stdio_cnt_lval='define'
133 stdio_ptr='((fp)->__ptr)'
134 d_stdio_ptr_lval='define'
139 ###############################################################
140 # Dynamic loading section:
142 # ccdlflags : must tell the linker to export all global symbols
143 # cccdlflags: must tell the compiler to generate relocatable code
144 # lddlflags : must tell the linker to output a shared library
146 # /usr/local/lib is added for convenience, since additional libraries
147 # are usually put there
149 # use shared perl lib
154 ccdlflags='-Xlinker -Bexport -L/usr/local/lib'
156 lddlflags='-G -L/usr/local/lib'
159 ccdlflags='-Wl,-Bexport -L/usr/local/lib'
161 lddlflags='-G -Wl,-Bexport -L/usr/local/lib'
165 ###############################################################
166 # Use dynamic loading
171 # Configure may fail to find lstat() since it's a static/inline function
172 # in <sys/stat.h> on Unisys U6000 SVR4, UnixWare 2.x, and possibly other
173 # SVR4 derivatives. (Though UnixWare has it in /usr/ccs/lib/libc.so.)
177 # DDE SMES Supermax Enterprise Server
178 case "`uname -sm`" in
180 # the *grent functions are in libgen.
181 libswanted="$libswanted gen"
182 # csh is broken (also) in SMES
183 # This may already be detected by the generic test above.
187 *) # for cc we need -K PIC (not -K pic)
188 cccdlflags="$cccdlflags -K PIC"
194 # This script UU/usethreads.cbu will get 'called-back' by Configure
195 # after it has prompted the user for whether to use threads.
196 cat > UU/usethreads.cbu <<'EOCBU'
197 case "$usethreads" in
200 set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
205 ccflags="-D_REENTRANT $ccflags -fpic -pthread"
207 lddlflags='-pthread -G -L/usr/local/lib '
210 ccflags="-D_REENTRANT $ccflags -KPIC -Kthread"
211 ccdlflags='-Kthread -Wl,-Bexport -L/usr/local/lib'
212 cccdlflags='-KPIC -Kthread'
213 lddlflags='-G -Kthread -Wl,-Bexport -L/usr/local/lib'
214 ldflags='-Kthread -L/usr/local/lib -L/usr/gnu/lib'
220 # End of Unixware-specific tests.
221 # Configure may fail to find lstat() since it's a static/inline function
222 # in <sys/stat.h> on Unisys U6000 SVR4, UnixWare 2.x, and possibly other
223 # SVR4 derivatives. (Though UnixWare has it in /usr/ccs/lib/libc.so.)
226 d_suidsafe='define' # "./Configure -d" can't figure this out easilly