1 # svr5 hints, System V Release 5.x
2 # Last modified 1999/09/21 by Boyd Gerber, gerberb@zenez.com
4 # Use Configure -Dcc=gcc to use gcc.
7 test -f $cc || cc='/usr/ccs/bin/cc'
12 ccflags='-fno-strict-aliasing'
23 # We include support for using libraries in /usr/ucblib, but the setting
24 # of libswanted excludes some libraries found there. If you run into
25 # problems, you may have to remove "ucb" from libswanted. Just delete
26 # the comment '#' from the sed command below.
27 # ldflags='-L/usr/ccs/lib -L/usr/ucblib'
28 # ccflags='-I/usr/include -I/usr/ucbinclude'
29 # Don't use problematic libraries:
30 libswanted=`echo " $libswanted " | sed -e 's/ malloc / /'` # -e 's/ ucb / /'`
31 # libmalloc.a - Probably using Perl's malloc() anyway.
32 # libucb.a - Remove it if you have problems ld'ing. We include it because
33 # it is needed for ODBM_File and NDBM_File extensions.
35 if [ "$want_ucb" ] ; then
36 ldflags= '-L/usr/ccs/lib -L/usr/ucblib'
37 ccflags='-I/usr/include -I/usr/ucbinclude'
38 if [ -r /usr/ucblib/libucb.a ]; then # If using BSD-compat. library:
39 d_Gconvert='gcvt((x),(n),(b))' # Try gcvt() before gconvert().
40 # Use the "native" counterparts, not the BSD emulation stuff:
41 d_bcmp='undef' d_bcopy='undef' d_bzero='undef' d_safebcpy='undef'
42 d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef'
44 # d_setregid='undef' d_setreuid='undef' # ???
47 # libswanted=`echo " $libswanted " | sed -e 's/ ucb / /' -e 's/ dbm / /'`
48 libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
49 glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
51 # a non ucb native version of libdbm for /usr/local is available from
52 # http://www.sco.com/skunkware
53 # if its installed (and not overidden) we'll use it.
54 if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then
55 libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
59 if [ "$want_gdbm" -a -f /usr/local/lib/libgdbm.so ] ; then
63 libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
66 # Don't use problematic libraries:
67 # libmalloc.a - Probably using Perl's malloc() anyway.
68 # libc: on UW7 don't want -lc explicitly - cc gives warnings/errors
69 libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'`
71 # remove /shlib and /lib from library search path as both symlink to /usr/lib
72 # where runtime shared libc is
73 glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /`
75 # UnixWare has /usr/lib/libc.so.1, /usr/lib/libc.so.1.1, and
76 # /usr/ccs/lib/libc.so. Configure chooses libc.so.1.1 while it
77 # appears that /usr/ccs/lib/libc.so contains more symbols:
79 # Try the following if you want to use nm-extraction. We'll just
80 # skip the nm-extraction phase, since searching for all the different
81 # library versions will be hard to keep up-to-date.
83 # if [ "" = "$libc" -a -f /usr/ccs/lib/libc.so -a \
84 # -f /usr/lib/libc.so.1 -a -f /usr/lib/libc.so.1.1 ]; then
85 # if nm -h /usr/ccs/lib/libc.so | egrep '\<_?select$' >/dev/null; then
86 # if nm -h /usr/lib/libc.so.1 | egrep '\<_?select$'` >/dev/null ||
87 # nm -h /usr/lib/libc.so.1.1 | egrep '\<_?select$'` >/dev/null; then
90 # libc=/usr/ccs/lib/libc.so
95 # Don't bother with nm. Just compile & link a small C program.
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. The undocumented -X argument to uname
111 # is probably a reasonable way of detecting UnixWare.
112 # UnixWare has a broken csh. (This might already be detected above).
113 # Configure can't detect memcpy or memset on Unixware 2 or 7
115 # Leave leading tabs on the next two lines so Configure doesn't
116 # propagate these variables to config.sh
118 uw_isuw=`uname -X 2>&1 | grep Release`
120 if [ "$uw_isuw" = "Release = 5" ]; then
126 stdio_cnt='((fp)->__cnt)'
127 d_stdio_cnt_lval='define'
128 stdio_ptr='((fp)->__ptr)'
129 d_stdio_ptr_lval='define'
134 ###############################################################
135 # Dynamic loading section:
137 # ccdlflags : must tell the linker to export all global symbols
138 # cccdlflags: must tell the compiler to generate relocatable code
139 # lddlflags : must tell the linker to output a shared library
141 # /usr/local/lib is added for convenience, since additional libraries
142 # are usually put there
144 # use shared perl lib
149 ccdlflags='-Xlinker -Bexport -L/usr/local/lib'
151 lddlflags='-G -L/usr/local/lib'
154 ccdlflags='-Wl,-Bexport -L/usr/local/lib'
156 lddlflags='-G -Wl,-Bexport -L/usr/local/lib'
160 ###############################################################
161 # Use dynamic loading
166 # Configure may fail to find lstat() since it's a static/inline function
167 # in <sys/stat.h> on Unisys U6000 SVR4, UnixWare 2.x, and possibly other
168 # SVR4 derivatives. (Though UnixWare has it in /usr/ccs/lib/libc.so.)
172 # DDE SMES Supermax Enterprise Server
173 case "`uname -sm`" in
175 # the *grent functions are in libgen.
176 libswanted="$libswanted gen"
177 # csh is broken (also) in SMES
178 # This may already be detected by the generic test above.
182 *) # for cc we need -K PIC (not -K pic)
183 cccdlflags="$cccdlflags -K PIC"
189 # This script UU/usethreads.cbu will get 'called-back' by Configure
190 # after it has prompted the user for whether to use threads.
191 cat > UU/usethreads.cbu <<'EOCBU'
192 case "$usethreads" in
195 set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
200 ccflags="-D_REENTRANT $ccflags -fpic -pthread"
202 lddlflags='-pthread -G -L/usr/local/lib '
205 ccflags="-D_REENTRANT $ccflags -KPIC -Kthread"
206 ccdlflags='-Kthread -Wl,-Bexport -L/usr/local/lib'
207 cccdlflags='-KPIC -Kthread'
208 lddlflags='-G -Kthread -Wl,-Bexport -L/usr/local/lib'
209 ldflags='-Kthread -L/usr/local/lib -L/usr/gnu/lib'
215 # End of Unixware-specific tests.
216 # Configure may fail to find lstat() since it's a static/inline function
217 # in <sys/stat.h> on Unisys U6000 SVR4, UnixWare 2.x, and possibly other
218 # SVR4 derivatives. (Though UnixWare has it in /usr/ccs/lib/libc.so.)
221 d_suidsafe='define' # "./Configure -d" can't figure this out easilly