Commit | Line | Data |
381c1bae |
1 | # svr5 hints, System V Release 5.x (UnixWare 7, OpenUNIX 8) |
878143fb |
2 | # mods after mail fm Andy Dougherty |
3 | # Reworked by hops@sco.com Sept/Oct 1999 for UW7.1 platform support |
d1fdab89 |
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 |
0337d152 |
7 | |
d1fdab89 |
8 | # Use Configure -Dusethreads to enable threads. |
0337d152 |
9 | # Use Configure -Dcc=gcc to use gcc. |
10 | case "$cc" in |
d1fdab89 |
11 | *gcc*) |
12 | # "$gccversion" not set yet |
a4349bea |
13 | if [ "X$gccversion" = "X" ]; then |
14 | # Done too late in Configure if hinted |
0baa0948 |
15 | gccversion=`$cc -dumpversion` |
a4349bea |
16 | fi |
17 | case $gccversion in |
d1fdab89 |
18 | *2.95*) |
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 |
24 | # optimize=' ' |
25 | ;; |
0337d152 |
26 | esac |
d1fdab89 |
27 | ;; |
0337d152 |
28 | esac |
29 | |
d1fdab89 |
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 |
33 | |
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) |
38 | # |
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 |
44 | |
45 | # Leave leading tabs so Configure doesn't propagate variables to config.sh |
46 | |
878143fb |
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 |
46c3340e |
51 | # link with udk70 if building on 7.1 and want resulting binary |
878143fb |
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 |
54 | # not there in 7.0. |
d1fdab89 |
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 |
46c3340e |
58 | # installed on any/all 7.0 systems and leave the above unset |
59 | # (sadly this is unavailable as of 2009-08-03) |
0337d152 |
60 | |
61 | if [ "$want_ucb" ] ; then |
d1fdab89 |
62 | ldflags= '-L/usr/ucblib' |
63 | ccflags='-I/usr/ucbinclude' |
64 | # /usr/ccs/include and /usr/ccs/lib are used implicitly by cc as reqd |
0337d152 |
65 | else |
0337d152 |
66 | libswanted=`echo " $libswanted " | sed -e 's/ ucb / /'` |
67 | glibpth=`echo " $glibpth " | sed -e 's/ \/usr\/ucblib / /'` |
68 | |
d1fdab89 |
69 | # If see libdbm in /usr/local and not overidden assume its the |
70 | # non ucblib rebuild from skunkware and use it |
0337d152 |
71 | if [ ! -f /usr/local/lib/libdbm.so -o ! "$want_dbm" ] ; then |
d1fdab89 |
72 | i_dbm='undef' |
0337d152 |
73 | libswanted=`echo " $libswanted " | sed -e 's/ dbm / /'` |
74 | fi |
75 | fi |
76 | |
878143fb |
77 | if [ ! "$want_gdbm" ] ; then |
78 | i_gdbm='undef' |
0337d152 |
79 | libswanted=`echo " $libswanted " | sed -e 's/ gdbm / /'` |
80 | fi |
81 | |
d1fdab89 |
82 | |
0337d152 |
83 | # Don't use problematic libraries: |
84 | # libmalloc.a - Probably using Perl's malloc() anyway. |
d1fdab89 |
85 | # libc: on UW7 don't want -lc explicitly as native cc gives warnings/errors |
0337d152 |
86 | libswanted=`echo " $libswanted " | sed -e 's/ malloc / /' -e 's/ c / /'` |
87 | |
88 | # remove /shlib and /lib from library search path as both symlink to /usr/lib |
89 | # where runtime shared libc is |
0373784c |
90 | glibpth=`echo " $glibpth " | sed -e 's/ \/shlib / /' -e 's/ \/lib / /'` |
0337d152 |
91 | |
d1fdab89 |
92 | # Don't use BSD emulation pieces (/usr/ucblib) regardless |
93 | # these would probably be autonondetected anyway but ... |
aade5aff |
94 | gconvert_preference='gcvt sprintf' # Try gcvt() before gconvert(). |
d1fdab89 |
95 | d_bcopy='undef' d_bcmp='undef' d_bzero='undef' d_safebcpy='undef' |
96 | d_index='undef' d_killpg='undef' d_getprior='undef' d_setprior='undef' |
97 | d_setlinebuf='undef' |
98 | d_setregid='undef' d_setreuid='undef' # -- in /usr/lib/libc.so.1 |
99 | |
0337d152 |
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 |
381c1bae |
106 | echo "Your csh has a broken 'glob', disabling..." >&2 |
0337d152 |
107 | d_csh='undef' |
108 | fi |
109 | |
d1fdab89 |
110 | # Unixware-specific problems. UW7 give correctname with uname -s |
0337d152 |
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 |
113 | # |
114 | # Leave leading tabs on the next two lines so Configure doesn't |
115 | # propagate these variables to config.sh |
116 | uw_ver=`uname -v` |
d1fdab89 |
117 | uw_isuw=`uname -s 2>&1` |
0337d152 |
118 | |
381c1bae |
119 | if [ "$uw_isuw" = "UnixWare" -o "$uw_isuw" = "OpenUNIX" ]; then |
0337d152 |
120 | case $uw_ver in |
381c1bae |
121 | 8.*|7.1*) |
d1fdab89 |
122 | d_csh='undef' |
123 | d_memcpy='define' |
124 | d_memset='define' |
125 | stdio_cnt='((fp)->__cnt)' |
126 | d_stdio_cnt_lval='define' |
127 | stdio_ptr='((fp)->__ptr)' |
128 | d_stdio_ptr_lval='define' |
129 | |
130 | d_bcopy='define' # In /usr/lib/libc.so.1 |
131 | d_setregid='define' # " |
132 | d_setreuid='define' # " |
133 | |
134 | if [ -f /usr/ccs/lib/libcudk70.a -a "$want_udk70" ] ; then |
135 | libswanted=" $libswanted cudk70" |
136 | fi |
137 | ;; |
0337d152 |
138 | 7*) |
139 | d_csh='undef' |
140 | d_memcpy='define' |
141 | d_memset='define' |
142 | stdio_cnt='((fp)->__cnt)' |
143 | d_stdio_cnt_lval='define' |
144 | stdio_ptr='((fp)->__ptr)' |
145 | d_stdio_ptr_lval='define' |
146 | ;; |
147 | esac |
148 | fi |
d1fdab89 |
149 | # End of Unixware-specific tests. |
0337d152 |
150 | |
151 | ############################################################### |
878143fb |
152 | # Dynamic loading section: Is default so it should just happen. |
153 | # set below to explicitly force. |
154 | # usedl='define' |
155 | # dlext='so' |
156 | # dlsrc='dl_dlopen.xs' |
0337d152 |
157 | # |
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 |
878143fb |
161 | |
0373784c |
162 | # use shared perl lib if the user doesn't choose otherwise |
381c1bae |
163 | if test "$uw_isuw" != "OpenUNIX"; then |
164 | if test "x$useshrplib" = "x"; then |
165 | useshrplib='true' |
166 | fi |
0373784c |
167 | fi |
0337d152 |
168 | |
169 | case "$cc" in |
170 | *gcc*) |
878143fb |
171 | ccdlflags='-Xlinker -Bexport ' |
0337d152 |
172 | cccdlflags='-fpic' |
878143fb |
173 | lddlflags='-G ' |
0337d152 |
174 | ;; |
d1fdab89 |
175 | |
0337d152 |
176 | *) |
878143fb |
177 | ccdlflags='-Wl,-Bexport' |
d1fdab89 |
178 | cccdlflags='-Kpic' |
878143fb |
179 | lddlflags='-G -Wl,-Bexport' |
0337d152 |
180 | ;; |
181 | esac |
182 | |
d1fdab89 |
183 | ############################################################################ |
184 | # Thread support |
185 | # use Configure -Dusethreads to enable |
0337d152 |
186 | # This script UU/usethreads.cbu will get 'called-back' by Configure |
187 | # after it has prompted the user for whether to use threads. |
188 | cat > UU/usethreads.cbu <<'EOCBU' |
189 | case "$usethreads" in |
190 | $define|true|[yY]*) |
191 | ccflags="$ccflags" |
0337d152 |
192 | shift |
c2ca7025 |
193 | libswanted="$libswanted $*" |
0337d152 |
194 | case "$cc" in |
195 | *gcc*) |
196 | ccflags="-D_REENTRANT $ccflags -fpic -pthread" |
197 | cccdlflags='-fpic' |
878143fb |
198 | lddlflags='-pthread -G ' |
0337d152 |
199 | ;; |
200 | *) |
201 | ccflags="-D_REENTRANT $ccflags -KPIC -Kthread" |
878143fb |
202 | ccdlflags='-Kthread -Wl,-Bexport' |
0337d152 |
203 | cccdlflags='-KPIC -Kthread' |
878143fb |
204 | lddlflags='-G -Kthread -Wl,-Bexport ' |
205 | ldflags='-Kthread' |
0337d152 |
206 | ;; |
207 | esac |
208 | esac |
209 | EOCBU |
210 | |
0337d152 |
211 | |
d1fdab89 |
212 | d_suidsafe='define' # "./Configure -d" can't figure this out easily |
878143fb |
213 | |
214 | ################## final caveat msgs to builder ############### |
215 | cat <<'EOM' >&4 |
216 | |
217 | If you wish to use dynamic linking, you must use |
218 | LD_LIBRARY_PATH=`pwd`; export LD_LIBRARY_PATH |
219 | or |
220 | setenv LD_LIBRARY_PATH `pwd` |
221 | before running make. |
222 | |
223 | If you are using shared libraries from /usr/local/lib |
224 | for libdbm or libgdbm you may need to set |
225 | LD_RUN_PATH=/usr/local/lib; export LD_RUN_PATH |
226 | in order for Configure to compile the simple test program |
227 | |
228 | EOM |