[ID 19991012.002] Latest UnixWare7 (svr5.sh) hints file
[p5sagit/p5-mst-13.2.git] / hints / svr5.sh
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
6
7 # Use Configure -Dusethreads to enable threads.
8 # Use Configure -Dcc=gcc to use gcc.
9 case "$cc" in
10 '') cc='/bin/cc'
11     test -f $cc || cc='/usr/ccs/bin/cc'
12     ;;
13 *gcc*)
14     #  "$gccversion" not set yet
15     vers=`gcc -v 2>&1 | sed -n -e 's@.*version \([^ ][^ ]*\) .*@\1@p'`
16     case $vers in
17     *2.95*)
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
23         #  optimize=' '
24         ;;
25     esac
26     ;;  
27 esac
28
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
32
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)
37
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
43
44 #    Leave leading tabs so Configure doesn't propagate variables to config.sh
45
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.
57
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
62 else
63     libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'`
64     glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'`
65
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
69         i_dbm='undef'
70         libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'`
71     fi
72 fi
73
74 if [ "$want_gdbm" -a -f /usr/local/lib/libgdbm.so ] ; then 
75     i_gdbm='define'
76 else
77     i_gdbm='undef'
78    libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'`
79 fi
80
81
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 / /'`
86
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 @ @'`
90
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 / /`
94
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'
100 d_setlinebuf='undef' 
101 d_setregid='undef' d_setreuid='undef'  # -- in /usr/lib/libc.so.1
102
103
104 # use nm to probe libs - its fast enough on uw7
105 case "$usenm" in
106 '') usenm=true;;
107 esac
108
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
116     d_csh='undef'
117 fi
118
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
122 #
123 #    Leave leading tabs on the next two lines so Configure doesn't 
124 #    propagate these variables to config.sh
125         uw_ver=`uname -v`
126         uw_isuw=`uname -s 2>&1`
127
128 if [ "$uw_isuw" = "UnixWare" ]; then
129    case $uw_ver in
130    7.1*)
131         d_csh='undef'
132         d_memcpy='define'
133         d_memset='define'
134         stdio_cnt='((fp)->__cnt)'
135         d_stdio_cnt_lval='define'
136         stdio_ptr='((fp)->__ptr)'
137         d_stdio_ptr_lval='define'
138
139         d_bcopy='define'    # In /usr/lib/libc.so.1
140         d_setregid='define' #  " 
141         d_setreuid='define' #  " 
142
143         if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then
144             libswanted=" $libswanted cudk70"
145         fi
146         ;;
147    7*)
148         d_csh='undef'
149         d_memcpy='define'
150         d_memset='define'
151         stdio_cnt='((fp)->__cnt)'
152         d_stdio_cnt_lval='define'
153         stdio_ptr='((fp)->__ptr)'
154         d_stdio_ptr_lval='define'
155         ;;
156    esac
157 fi
158 # End of Unixware-specific tests.
159
160 ###############################################################
161 # Dynamic loading section:
162 #
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
166 #
167 # /usr/local/lib is added for convenience, since additional libraries
168 # are usually put there 
169 #
170 # use shared perl lib    
171 useshrplib='true'
172
173 case "$cc" in
174        *gcc*)
175            ccdlflags='-Xlinker -Bexport -L/usr/local/lib'
176            cccdlflags='-fpic'
177            lddlflags='-G -L/usr/local/lib'
178         ;;
179
180         *)
181            ccdlflags='-Wl,-Bexport -L/usr/local/lib'
182            cccdlflags='-Kpic'
183            lddlflags='-G -Wl,-Bexport -L/usr/local/lib'
184         ;;
185 esac
186
187 ###############################################################
188 # Use dynamic loading
189 usedl='define'
190 dlext='so'
191 dlsrc='dl_dlopen.xs'
192
193
194 ############################################################################
195 # Thread support
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
201 $define|true|[yY]*)
202         ccflags="$ccflags"
203         set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
204         shift
205         libswanted="$*"
206   case "$cc" in
207        *gcc*)
208            ccflags="-D_REENTRANT $ccflags -fpic -pthread"
209            cccdlflags='-fpic'
210            lddlflags='-pthread -G -L/usr/local/lib '
211         ;;
212         *)
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'
218         ;;
219   esac
220 esac
221 EOCBU
222
223
224 # Just in case Configure fails to find lstat() Its in /usr/lib/libc.so.1.
225 d_lstat=define
226
227 d_suidsafe='define'     # "./Configure -d" can't figure this out easily