Commit | Line | Data |
1dc48e02 |
1 | #!/usr/bin/sh |
8e07c86e |
2 | |
1dc48e02 |
3 | ### SYSTEM ARCHITECTURE |
8e07c86e |
4 | |
1dc48e02 |
5 | # Determine the architecture type of this system. |
6 | # Keep leading tab below -- Configure Black Magic -- RAM, 03/02/97 |
7 | xxOsRevMajor=`uname -r | sed -e 's/^[^0-9]*//' | cut -d. -f1`; |
bf5ca8fd |
8 | xxOsRevMinor=`uname -r | sed -e 's/^[^0-9]*//' | cut -d. -f2`; |
9 | xxOsRev=`expr 100 \* $xxOsRevMajor + $xxOsRevMinor` |
1dc48e02 |
10 | if [ "$xxOsRevMajor" -ge 10 ]; then |
11 | # This system is running >= 10.x |
12 | |
13 | # Tested on 10.01 PA1.x and 10.20 PA[12].x. |
14 | # Idea: Scan /usr/include/sys/unistd.h for matches with |
15 | # "#define CPU_* `getconf # CPU_VERSION`" to determine CPU type. |
16 | # Note the text following "CPU_" is used, *NOT* the comment. |
17 | # |
18 | # ASSUMPTIONS: Numbers will continue to be defined in hex -- and in |
19 | # /usr/include/sys/unistd.h -- and the CPU_* #defines will be kept |
20 | # up to date with new CPU/OS releases. |
21 | xxcpu=`getconf CPU_VERSION`; # Get the number. |
22 | xxcpu=`printf '0x%x' $xxcpu`; # convert to hex |
94c7f405 |
23 | archname=`sed -n -e "s/^#[[:space:]]*define[[:space:]]*CPU_//p" /usr/include/sys/unistd.h | |
24 | sed -n -e "s/[[:space:]]*$xxcpu[[:space:]].*//p" | |
38dbb4c5 |
25 | sed -e s/_RISC/-RISC/ -e s/HP_// -e s/_/./ -e "s/[[:space:]]*//g"`; |
1dc48e02 |
26 | else |
27 | # This system is running <= 9.x |
28 | # Tested on 9.0[57] PA and [78].0 MC680[23]0. Idea: After removing |
29 | # MC6888[12] from context string, use first CPU identifier. |
30 | # |
31 | # ASSUMPTION: Only CPU identifiers contain no lowercase letters. |
32 | archname=`getcontext | tr ' ' '\012' | grep -v '[a-z]' | grep -v MC688 | |
33 | sed -e 's/HP-//' -e 1q`; |
34 | selecttype='int *' |
8e07c86e |
35 | fi |
1717e83e |
36 | |
37 | # For some strange reason, the u32align test from Configure hangs in |
38 | # HP-UX 10.20 since the December 2001 patches. So hint it to avoid |
39 | # the test. |
40 | if [ "$xxOsRevMajor" -le 10 ]; then |
41 | d_u32align=$define |
2da79f33 |
42 | fi |
8e07c86e |
43 | |
1dc48e02 |
44 | echo "Archname is $archname" |
45 | |
90e831dc |
46 | # Fix XSlib (CPAN) confusion when re-using a prefix but changing from ILP32 |
47 | # to LP64 builds. They're NOT binary compatible, so quit claiming they are. |
48 | archname64=LP64 |
49 | |
1dc48e02 |
50 | |
51 | ### HP-UX OS specific behaviour |
5e4c82f0 |
52 | |
e08bfeb2 |
53 | # -ldbm is obsolete and should not be used |
54 | # -lBSD contains BSD-style duplicates of SVR4 routines that cause confusion |
55 | # -lPW is obsolete and should not be used |
56 | # The libraries crypt, malloc, ndir, and net are empty. |
c723583c |
57 | set `echo "X $libswanted " | sed -e 's/ ld / /' -e 's/ dbm / /' -e 's/ BSD / /' -e 's/ PW / /'` |
58 | shift |
e08bfeb2 |
59 | libswanted="$*" |
60 | |
1dc48e02 |
61 | cc=${cc:-cc} |
c723583c |
62 | ar=/usr/bin/ar # Yes, truly override. We do not want the GNU ar. |
63 | full_ar=$ar # I repeat, no GNU ar. arrr. |
167d2fcb |
64 | |
c723583c |
65 | set `echo "X $ccflags " | sed -e 's/ -A[ea] / /' -e 's/ -D_HPUX_SOURCE / /'` |
66 | shift |
67 | cc_cppflags="$* -D_HPUX_SOURCE" |
68 | cppflags="-Aa -D__STDC_EXT__ $cc_cppflags" |
69 | |
70 | case "$prefix" in |
71 | "") prefix='/opt/perl5' ;; |
72 | esac |
0f3ba31f |
73 | |
dcd01700 |
74 | gnu_as=no |
75 | gnu_ld=no |
b36fec95 |
76 | case `$cc -v 2>&1`"" in |
c723583c |
77 | *gcc*) ccisgcc="$define" |
dcd01700 |
78 | ccflags="$cc_cppflags" |
16c1da12 |
79 | if [ "X$gccversion" = "X" ]; then |
80 | # Done too late in Configure if hinted |
a4349bea |
81 | gccversion=`$cc --version | sed 's/.*(GCC) *//'` |
16c1da12 |
82 | fi |
1717e83e |
83 | case "$gccversion" in |
84 | [012]*) # HP-UX and gcc-2.* break UINT32_MAX :-( |
85 | ccflags="$ccflags -DUINT32_MAX_BROKEN" |
86 | ;; |
b951dd56 |
87 | [34]*) # GCC (both 32bit and 64bit) will define __STDC_EXT__ |
51d2fe06 |
88 | # by default when using GCC 3.0 and newer versions of |
89 | # the compiler. |
90 | cppflags="$cc_cppflags" |
91 | ;; |
1717e83e |
92 | esac |
0f3ba31f |
93 | case "`getconf KERNEL_BITS 2>/dev/null`" in |
dcd01700 |
94 | *64*) |
eb9ee3dc |
95 | echo "main(){}">try.c |
16c1da12 |
96 | case "$gccversion" in |
b951dd56 |
97 | [34]*) |
90e831dc |
98 | case "$archname" in |
87a010a9 |
99 | PA-RISC*) |
100 | case "$ccflags" in |
101 | *-mpa-risc*) ;; |
102 | *) ccflags="$ccflags -mpa-risc-2-0" ;; |
103 | esac |
104 | ;; |
90e831dc |
105 | esac |
dcd01700 |
106 | ;; |
eb9ee3dc |
107 | *) # gcc with gas will not accept +DA2.0 |
16c1da12 |
108 | case "`$cc -c -Wa,+DA2.0 try.c 2>&1`" in |
109 | *"+DA2.0"*) # gas |
110 | gnu_as=yes |
111 | ;; |
112 | *) # HPas |
113 | ccflags="$ccflags -Wa,+DA2.0" |
114 | ;; |
115 | esac |
dcd01700 |
116 | ;; |
117 | esac |
118 | # gcc with gld will not accept +vnocompatwarnings |
119 | case "`$cc -o try -Wl,+vnocompatwarnings try.c 2>&1`" in |
120 | *"+vnocompat"*) # gld |
121 | gnu_ld=yes |
122 | ;; |
123 | *) # HPld |
1717e83e |
124 | case "$gccversion" in |
125 | [12]*) |
90e831dc |
126 | # Why not 3 as well here? |
127 | # Since not relevant to IA64, not changed. |
1717e83e |
128 | ldflags="$ldflags -Wl,+vnocompatwarnings" |
129 | ccflags="$ccflags -Wl,+vnocompatwarnings" |
130 | ;; |
131 | esac |
dcd01700 |
132 | ;; |
133 | esac |
eb9ee3dc |
134 | rm -f try.c |
dcd01700 |
135 | ;; |
0f3ba31f |
136 | esac |
c723583c |
137 | ;; |
138 | *) ccisgcc='' |
bd7dcc15 |
139 | # What cannot be use in combination with ccache links :( |
140 | cc_found="" |
141 | for p in `echo $PATH | tr : ' ''` ; do |
142 | x="$p/cc" |
143 | if [ -f $x ] && [ -x $x ]; then |
144 | if [ -h $x ]; then |
145 | l=`ls -l $x | sed 's,.*-> ,,'` |
146 | case $l in |
147 | /*) x=$l ;; |
148 | *) x="$p/$l" ;; |
149 | esac |
150 | fi |
151 | x=`echo $x | sed 's,/\./,/,g'` |
152 | case $x in |
153 | *ccache*) ;; |
154 | *) [ -z "$cc_found" ] && cc_found=$x ;; |
155 | esac |
156 | fi |
157 | done |
158 | [ -z "$cc_found" ] && cc_found=`which cc` |
159 | what $cc_found >&4 |
8ab815d3 |
160 | ccversion=`what $cc_found | awk '/Compiler/{print $2}/Itanium/{print $6,$7}'` |
0fb2d8c6 |
161 | case "$ccflags" in |
51d2fe06 |
162 | "-Ae "*) ;; |
bf5ca8fd |
163 | *) ccflags="-Ae $cc_cppflags" |
164 | # +vnocompatwarnings not known in 10.10 and older |
165 | if [ $xxOsRev -ge 1020 ]; then |
17ad866a |
166 | ccflags="$ccflags -Wl,+vnocompatwarnings" |
bf5ca8fd |
167 | fi |
168 | ;; |
51d2fe06 |
169 | esac |
5e2807cc |
170 | # Needed because cpp does only support -Aa (not -Ae) |
171 | cpplast='-' |
172 | cppminus='-' |
173 | cppstdin='cc -E -Aa -D__STDC_EXT__' |
174 | cpprun=$cppstdin |
0b93aee7 |
175 | # case "$d_casti32" in |
176 | # "") d_casti32='undef' ;; |
177 | # esac |
0f3ba31f |
178 | ;; |
1dc48e02 |
179 | esac |
180 | |
e08bfeb2 |
181 | # When HP-UX runs a script with "#!", it sets argv[0] to the script name. |
182 | toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"' |
1dc48e02 |
183 | |
1dc48e02 |
184 | ### 64 BITNESS |
b36fec95 |
185 | |
8cb447e0 |
186 | # Some gcc versions do native 64 bit long (e.g. 2.9-hppa-000310 and gcc-3.0) |
dcd01700 |
187 | # We have to force 64bitness to go search the right libraries |
188 | gcc_64native=no |
189 | case "$ccisgcc" in |
190 | $define|true|[Yy]) |
eb9ee3dc |
191 | echo 'int main(){long l;printf("%d\\n",sizeof(l));}'>try.c |
dcd01700 |
192 | $cc -o try $ccflags $ldflags try.c |
193 | if [ "`try`" = "8" ]; then |
194 | cat <<EOM >&4 |
195 | |
196 | *** This version of gcc uses 64 bit longs. -Duse64bitall is |
197 | *** implicitly set to enable continuation |
198 | EOM |
199 | use64bitall=$define |
200 | gcc_64native=yes |
201 | fi |
202 | ;; |
203 | esac |
204 | |
ec7b9793 |
205 | case "$use64bitall" in |
1dc48e02 |
206 | $define|true|[yY]*) use64bitint="$define" ;; |
207 | esac |
208 | |
6d5d7abf |
209 | case "$usemorebits" in |
1dc48e02 |
210 | $define|true|[yY]*) use64bitint="$define"; uselongdouble="$define" ;; |
211 | esac |
bf0c440f |
212 | |
38dbb4c5 |
213 | case "$archname" in |
214 | IA64*) |
215 | # While here, override so=sl auto-detection |
216 | so='so' |
217 | ;; |
218 | *) |
1717e83e |
219 | case "$uselongdouble" in |
220 | *) ;; |
221 | $define|true|[yY]*) |
222 | cat <<EOM >&4 |
1dc48e02 |
223 | |
224 | *** long doubles are not (yet) supported on HP-UX (any version) |
225 | *** Until it does, we cannot continue, aborting. |
bf0c440f |
226 | EOM |
1717e83e |
227 | exit 1 ;; |
228 | esac |
38dbb4c5 |
229 | ;; |
1dc48e02 |
230 | esac |
bf0c440f |
231 | |
1dc48e02 |
232 | case "$use64bitint" in |
233 | $define|true|[Yy]) |
bf0c440f |
234 | |
1dc48e02 |
235 | if [ "$xxOsRevMajor" -lt 11 ]; then |
236 | cat <<EOM >&4 |
237 | |
238 | *** 64-bit compilation is not supported on HP-UX $xxOsRevMajor. |
239 | *** You need at least HP-UX 11.0. |
ec7b9793 |
240 | *** Cannot continue, aborting. |
bf0c440f |
241 | EOM |
1dc48e02 |
242 | exit 1 |
243 | fi |
bf0c440f |
244 | |
1dc48e02 |
245 | # Set libc and the library paths |
246 | case "$archname" in |
247 | PA-RISC*) |
248 | loclibpth="$loclibpth /lib/pa20_64" |
249 | libc='/lib/pa20_64/libc.sl' ;; |
250 | IA64*) |
251 | loclibpth="$loclibpth /usr/lib/hpux64" |
252 | libc='/usr/lib/hpux64/libc.so' ;; |
253 | esac |
254 | if [ ! -f "$libc" ]; then |
255 | cat <<EOM >&4 |
256 | |
257 | *** You do not seem to have the 64-bit libc. |
258 | *** I cannot find the file $libc. |
259 | *** Cannot continue, aborting. |
260 | EOM |
261 | exit 1 |
262 | fi |
bf0c440f |
263 | |
dcd01700 |
264 | case "$ccisgcc" in |
265 | $define|true|[Yy]) |
266 | # For the moment, don't care that it ain't supported (yet) |
267 | # by gcc (up to and including 2.95.3), cause it'll crash |
268 | # anyway. Expect auto-detection of 64-bit enabled gcc on |
269 | # HP-UX soon, including a user-friendly exit |
270 | case $gcc_64native in |
16c1da12 |
271 | no) case "$gccversion" in |
b951dd56 |
272 | [1234]*) |
273 | ccflags="$ccflags -mlp64" |
274 | case "$archname" in |
275 | PA-RISC*) |
276 | ldflags="$ldflags -Wl,+DD64" |
277 | ;; |
278 | IA64*) |
279 | ldflags="$ldflags -mlp64" |
280 | ;; |
281 | esac |
16c1da12 |
282 | ;; |
283 | esac |
dcd01700 |
284 | ;; |
285 | esac |
286 | ;; |
287 | *) |
288 | ccflags="$ccflags +DD64" |
289 | ldflags="$ldflags +DD64" |
290 | ;; |
291 | esac |
bf0c440f |
292 | |
1dc48e02 |
293 | # Reset the library checker to make sure libraries |
294 | # are the right type |
38dbb4c5 |
295 | # (NOTE: on IA64, this doesn't work with .a files.) |
1dc48e02 |
296 | libscheck='case "`/usr/bin/file $xxx`" in |
297 | *ELF-64*|*LP64*|*PA-RISC2.0*) ;; |
298 | *) xxx=/no/64-bit$xxx ;; |
299 | esac' |
300 | |
301 | ;; |
302 | |
303 | *) # Not in 64-bit mode |
304 | |
305 | case "$archname" in |
306 | PA-RISC*) |
307 | libc='/lib/libc.sl' ;; |
308 | IA64*) |
309 | loclibpth="$loclibpth /usr/lib/hpux32" |
310 | libc='/usr/lib/hpux32/libc.so' ;; |
311 | esac |
312 | ;; |
313 | esac |
314 | |
dcd01700 |
315 | # By setting the deferred flag below, this means that if you run perl |
316 | # on a system that does not have the required shared library that you |
317 | # linked it with, it will die when you try to access a symbol in the |
318 | # (missing) shared library. If you would rather know at perl startup |
319 | # time that you are missing an important shared library, switch the |
320 | # comments so that immediate, rather than deferred loading is |
321 | # performed. Even with immediate loading, you can postpone errors for |
322 | # undefined (or multiply defined) routines until actual access by |
323 | # adding the "nonfatal" option. |
324 | # ccdlflags="-Wl,-E -Wl,-B,immediate $ccdlflags" |
325 | # ccdlflags="-Wl,-E -Wl,-B,immediate,-B,nonfatal $ccdlflags" |
326 | if [ "$gnu_ld" = "yes" ]; then |
327 | ccdlflags="-Wl,-E $ccdlflags" |
328 | else |
329 | ccdlflags="-Wl,-E -Wl,-B,deferred $ccdlflags" |
330 | fi |
331 | |
1dc48e02 |
332 | |
333 | ### COMPILER SPECIFICS |
bf0c440f |
334 | |
7f128676 |
335 | ## Local restrictions (point to README.hpux to lift these) |
336 | |
337 | ## Optimization limits |
338 | cat >try.c <<EOF |
339 | #include <sys/resource.h> |
340 | |
341 | int main () |
342 | { |
343 | struct rlimit rl; |
344 | int i = getrlimit (RLIMIT_DATA, &rl); |
345 | printf ("%d\n", rl.rlim_cur / (1024 * 1024)); |
346 | } /* main */ |
347 | EOF |
348 | $cc -o try $ccflags $ldflags try.c |
349 | maxdsiz=`try` |
303aa268 |
350 | rm -f try try.c core |
7f128676 |
351 | if [ $maxdsiz -le 64 ]; then |
352 | # 64 Mb is probably not enough to optimize toke.c |
353 | # and regexp.c with -O2 |
354 | cat <<EOM >&4 |
355 | Your kernel limits the data section of your programs to $maxdsiz Mb, |
356 | which is (sadly) not enough to fully optimize some parts of the |
357 | perl binary. I'll try to use a lower optimization level for |
358 | those parts. If you are a sysadmin, and you *do* want full |
359 | optimization, raise the 'maxdsiz' kernel configuration parameter |
360 | to at least 0x08000000 (128 Mb) and rebuild your kernel. |
361 | EOM |
a6bab54c |
362 | regexec_cflags='' |
38dbb4c5 |
363 | doop_cflags='' |
7f128676 |
364 | fi |
365 | |
b36fec95 |
366 | case "$ccisgcc" in |
1dc48e02 |
367 | $define|true|[Yy]) |
368 | |
369 | case "$optimize" in |
c723583c |
370 | "") optimize="-g -O" ;; |
371 | *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;; |
1dc48e02 |
372 | esac |
c723583c |
373 | #ld="$cc" |
5e2807cc |
374 | ld=/usr/bin/ld |
1dc48e02 |
375 | cccdlflags='-fPIC' |
c723583c |
376 | #lddlflags='-shared' |
5e2807cc |
377 | lddlflags='-b' |
c723583c |
378 | case "$optimize" in |
379 | *-g*-O*|*-O*-g*) |
380 | # gcc without gas will not accept -g |
381 | echo "main(){}">try.c |
382 | case "`$cc $optimize -c try.c 2>&1`" in |
383 | *"-g option disabled"*) |
384 | set `echo "X $optimize " | sed -e 's/ -g / /'` |
385 | shift |
386 | optimize="$*" |
387 | ;; |
388 | esac |
389 | ;; |
390 | esac |
7f128676 |
391 | if [ $maxdsiz -le 64 ]; then |
7f128676 |
392 | case "$optimize" in |
393 | *O2*) opt=`echo "$optimize" | sed -e 's/O2/O1/'` |
a6bab54c |
394 | toke_cflags="$toke_cflags;optimize=\"$opt\"" |
395 | regexec_cflags="optimize=\"$opt\"" |
7f128676 |
396 | ;; |
397 | esac |
398 | fi |
1dc48e02 |
399 | ;; |
400 | |
401 | *) # HP's compiler cannot combine -g and -O |
402 | case "$optimize" in |
5e2807cc |
403 | "") optimize="+O2 +Onolimit" ;; |
c723583c |
404 | *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;; |
1dc48e02 |
405 | esac |
38dbb4c5 |
406 | case "$optimize" in |
407 | *-O*|\ |
1717e83e |
408 | *O2*) opt=`echo "$optimize" | sed -e 's/-O/+O2/' -e 's/O2/O1/' -e 's/ *+Onolimit//'` |
38dbb4c5 |
409 | ;; |
1717e83e |
410 | *) opt="$optimize" |
411 | ;; |
412 | esac |
38dbb4c5 |
413 | if [ $maxdsiz -le 64 ]; then |
1717e83e |
414 | toke_cflags="$toke_cflags;optimize=\"$opt\"" |
415 | regexec_cflags="optimize=\"$opt\"" |
7f128676 |
416 | fi |
38dbb4c5 |
417 | case "$archname" in |
418 | IA64*) |
419 | doop_cflags="optimize=\"$opt\"" |
420 | ;; |
421 | esac |
1dc48e02 |
422 | ld=/usr/bin/ld |
423 | cccdlflags='+Z' |
c723583c |
424 | lddlflags='-b +vnocompatwarnings' |
1dc48e02 |
425 | ;; |
b36fec95 |
426 | esac |
8e07c86e |
427 | |
1dc48e02 |
428 | ## LARGEFILES |
bf5ca8fd |
429 | if [ $xxOsRev -lt 1020 ]; then |
430 | uselargefiles="$undef" |
431 | fi |
774d564b |
432 | |
c723583c |
433 | #case "$uselargefiles-$ccisgcc" in |
434 | # "$define-$define"|'-define') |
435 | # cat <<EOM >&4 |
436 | # |
437 | #*** I'm ignoring large files for this build because |
438 | #*** I don't know how to do use large files in HP-UX using gcc. |
439 | # |
440 | #EOM |
441 | # uselargefiles="$undef" |
442 | # ;; |
443 | # esac |
dc45a647 |
444 | |
aed17120 |
445 | # Once we have the compiler flags defined, Configure will |
446 | # execute the following call-back script. See hints/README.hints |
447 | # for details. |
448 | cat > UU/cc.cbu <<'EOCBU' |
449 | # This script UU/cc.cbu will get 'called-back' by Configure after it |
450 | # has prompted the user for the C compiler to use. |
451 | |
452 | # Compile and run the a test case to see if a certain gcc bug is |
453 | # present. If so, lower the optimization level when compiling |
454 | # pp_pack.c. This works around a bug in unpack. |
455 | |
456 | if test -z "$ccisgcc" -a -z "$gccversion"; then |
457 | : no tests needed for HPc |
458 | else |
459 | echo " " |
460 | echo "Testing for a certain gcc bug is fixed in your compiler..." |
461 | |
462 | # Try compiling the test case. |
03ae59b2 |
463 | if $cc -o t001 -O $ccflags $ldflags -lm ../hints/t001.c; then |
aed17120 |
464 | gccbug=`$run ./t001` |
465 | case "$gccbug" in |
466 | *fails*) |
467 | cat >&4 <<EOF |
468 | This C compiler ($gccversion) is known to have optimizer |
469 | problems when compiling pp_pack.c. |
470 | |
471 | Disabling optimization for pp_pack.c. |
472 | EOF |
473 | case "$pp_pack_cflags" in |
474 | '') pp_pack_cflags='optimize=' |
475 | echo "pp_pack_cflags='optimize=\"\"'" >> config.sh ;; |
476 | *) echo "You specified pp_pack_cflags yourself, so we'll go with your value." >&4 ;; |
477 | esac |
478 | ;; |
479 | *) echo "Your compiler is ok." >&4 |
480 | ;; |
481 | esac |
482 | else |
483 | echo " " |
484 | echo "*** WHOA THERE!!! ***" >&4 |
485 | echo " Your C compiler \"$cc\" doesn't seem to be working!" >&4 |
486 | case "$knowitall" in |
487 | '') echo " You'd better start hunting for one and let me know about it." >&4 |
488 | exit 1 |
489 | ;; |
490 | esac |
491 | fi |
492 | |
493 | rm -f t001$_o t001$_exe |
494 | fi |
495 | EOCBU |
496 | |
1dc48e02 |
497 | cat >UU/uselargefiles.cbu <<'EOCBU' |
498 | # This script UU/uselargefiles.cbu will get 'called-back' by Configure |
499 | # after it has prompted the user for whether to use large files. |
500 | case "$uselargefiles" in |
501 | ""|$define|true|[yY]*) |
502 | # there are largefile flags available via getconf(1) |
503 | # but we cheat for now. (Keep that in the left margin.) |
504 | ccflags_uselargefiles="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" |
5cf1d1f1 |
505 | |
38dbb4c5 |
506 | case " $ccflags " in |
507 | *" $ccflags_uselargefiles "*) ;; |
0fb2d8c6 |
508 | *) ccflags="$ccflags $ccflags_uselargefiles" ;; |
509 | esac |
1dc48e02 |
510 | |
1717e83e |
511 | if test -z "$ccisgcc" -a -z "$gccversion"; then |
1dc48e02 |
512 | # The strict ANSI mode (-Aa) doesn't like large files. |
513 | ccflags=`echo " $ccflags "|sed 's@ -Aa @ @g'` |
514 | case "$ccflags" in |
515 | *-Ae*) ;; |
516 | *) ccflags="$ccflags -Ae" ;; |
517 | esac |
fa2879fb |
518 | fi |
519 | ;; |
520 | esac |
1dc48e02 |
521 | EOCBU |
fa2879fb |
522 | |
1dc48e02 |
523 | # THREADING |
104d25b7 |
524 | |
525 | # This script UU/usethreads.cbu will get 'called-back' by Configure |
526 | # after it has prompted the user for whether to use threads. |
1dc48e02 |
527 | cat >UU/usethreads.cbu <<'EOCBU' |
104d25b7 |
528 | case "$usethreads" in |
1dc48e02 |
529 | $define|true|[yY]*) |
530 | if [ "$xxOsRevMajor" -lt 10 ]; then |
531 | cat <<EOM >&4 |
f1ee07ac |
532 | |
104d25b7 |
533 | HP-UX $xxOsRevMajor cannot support POSIX threads. |
534 | Consider upgrading to at least HP-UX 11. |
535 | Cannot continue, aborting. |
536 | EOM |
1dc48e02 |
537 | exit 1 |
538 | fi |
539 | |
540 | if [ "$xxOsRevMajor" -eq 10 ]; then |
541 | # Under 10.X, a threaded perl can be built |
542 | if [ -f /usr/include/pthread.h ]; then |
c7d9b096 |
543 | if [ -f /usr/lib/libcma.sl ]; then |
544 | # DCE (from Core OS CD) is installed |
545 | |
1717e83e |
546 | # Check if it is pristine, or patched |
547 | cmavsn=`what /usr/lib/libcma.sl 2>&1 | grep 1996` |
548 | if [ ! -z "$cmavsn" ]; then |
549 | cat <<EOM >&4 |
fa01be49 |
550 | \a |
551 | *************************************************************************** |
552 | |
553 | Perl will support threading through /usr/lib/libcma.sl from |
554 | the HP DCE package, but the version found is too old to be |
555 | reliable. |
556 | |
557 | If you are not depending on this specific version of the library, |
558 | consider to upgrade using patch PHSS_23672 (read README.hpux) |
559 | |
560 | *************************************************************************** |
561 | |
562 | (sleeping for 10 seconds...) |
563 | EOM |
1717e83e |
564 | sleep 10 |
565 | fi |
fa01be49 |
566 | |
1dc48e02 |
567 | # It needs # libcma and OLD_PTHREADS_API. Also |
568 | # <pthread.h> needs to be #included before any |
569 | # other includes (in perl.h) |
c7d9b096 |
570 | |
571 | # HP-UX 10.X uses the old pthreads API |
572 | d_oldpthreads="$define" |
573 | |
574 | # include libcma before all the others |
575 | libswanted="cma $libswanted" |
576 | |
1dc48e02 |
577 | # tell perl.h to include <pthread.h> before other |
578 | # include files |
c7d9b096 |
579 | ccflags="$ccflags -DPTHREAD_H_FIRST" |
5a5efdd7 |
580 | # First column on purpose: |
581 | # this is not a standard Configure variable |
582 | # but we need to get this noticed. |
cce6a207 |
583 | pthread_h_first="$define" |
5a5efdd7 |
584 | |
585 | # HP-UX 10.X seems to have no easy |
586 | # way of detecting these *time_r protos. |
587 | d_gmtime_r_proto='define' |
588 | gmtime_r_proto='REENTRANT_PROTO_I_TS' |
589 | d_localtime_r_proto='define' |
590 | localtime_r_proto='REENTRANT_PROTO_I_TS' |
591 | |
58a9dc44 |
592 | # Avoid the poisonous conflicting (and irrelevant) |
593 | # prototypes of setkey(). |
594 | i_crypt="$undef" |
c7d9b096 |
595 | |
1dc48e02 |
596 | # CMA redefines select to cma_select, and cma_select |
597 | # expects int * instead of fd_set * (just like 9.X) |
c7d9b096 |
598 | selecttype='int *' |
599 | |
600 | elif [ -f /usr/lib/libpthread.sl ]; then |
601 | # PTH package is installed |
602 | libswanted="pthread $libswanted" |
603 | else |
604 | libswanted="no_threads_available" |
605 | fi |
606 | else |
607 | libswanted="no_threads_available" |
608 | fi |
609 | |
1dc48e02 |
610 | if [ $libswanted = "no_threads_available" ]; then |
611 | cat <<EOM >&4 |
f1ee07ac |
612 | |
104d25b7 |
613 | In HP-UX 10.X for POSIX threads you need both of the files |
c7d9b096 |
614 | /usr/include/pthread.h and either /usr/lib/libcma.sl or /usr/lib/libpthread.sl. |
615 | Either you must upgrade to HP-UX 11 or install a posix thread library: |
f1ee07ac |
616 | |
617 | DCE-CoreTools from HP-UX 10.20 Hardware Extensions 3.0 CD (B3920-13941) |
618 | |
619 | or |
620 | |
1dc48e02 |
621 | PTH package from e.g. http://hpux.tn.tudelft.nl/hppd/hpux/alpha.html |
f1ee07ac |
622 | |
104d25b7 |
623 | Cannot continue, aborting. |
624 | EOM |
1dc48e02 |
625 | exit 1 |
c7d9b096 |
626 | fi |
1dc48e02 |
627 | else |
628 | # 12 may want upping the _POSIX_C_SOURCE datestamp... |
10bc17b6 |
629 | ccflags=" -D_POSIX_C_SOURCE=199506L -D_REENTRANT $ccflags" |
1dc48e02 |
630 | set `echo X "$libswanted "| sed -e 's/ c / pthread c /'` |
631 | shift |
632 | libswanted="$*" |
633 | fi |
104d25b7 |
634 | |
104d25b7 |
635 | ;; |
1dc48e02 |
636 | esac |
bd9b35c9 |
637 | EOCBU |
758a5d79 |
638 | |
c2eedc99 |
639 | # The mysterious io_xs memory corruption in 11.00 32bit seems to get |
b1157548 |
640 | # fixed by not using Perl's malloc. Flip side is performance loss. |
641 | # So we want mymalloc for all situations possible |
642 | usemymalloc='y' |
643 | case "$usethreads" in |
644 | $define|true|[yY]*) usemymalloc='n' ;; |
645 | *) case "$ccisgcc" in |
646 | $undef|false|[nN]*) |
647 | case "$use64bitint" in |
648 | $undef|false|[nN]*) |
649 | case "$ccflags" in |
650 | *-DDEBUGGING*) ;; |
651 | *) usemymalloc='n' ;; |
652 | esac |
653 | ;; |
654 | esac |
655 | ;; |
656 | esac |
657 | ;; |
658 | esac |
659 | |
c2eedc99 |
660 | usemymalloc='n' |
7b9f4e92 |
661 | case "$useperlio" in |
662 | $undef|false|[nN]*) usemymalloc='y' ;; |
663 | esac |
c2eedc99 |
664 | |
da0b61dd |
665 | # malloc wrap works |
666 | case "$usemallocwrap" in |
667 | '') usemallocwrap='define' ;; |
668 | esac |
669 | |
758a5d79 |
670 | # fpclassify() is a macro, the library call is Fpclassify |
38dbb4c5 |
671 | # Similarly with the others below. |
758a5d79 |
672 | d_fpclassify='define' |
38dbb4c5 |
673 | d_isnan='define' |
674 | d_isinf='define' |
675 | d_isfinite='define' |
676 | d_unordered='define' |
90e831dc |
677 | # Next one(s) need the leading tab. These are special 'hint' symbols that |
678 | # are not to be propagated to config.sh, all related to pthreads draft 4 |
679 | # interfaces. |
680 | case "$d_oldpthreads" in |
681 | ''|$undef) |
682 | d_crypt_r_proto='undef' |
683 | d_getgrent_r_proto='undef' |
684 | d_getpwent_r_proto='undef' |
685 | d_strerror_r_proto='undef' |
686 | ;; |
687 | esac |