This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix build under -DPERL_GLOBAL_STRUCT
[perl5.git] / hints / hpux.sh
1 #!/usr/bin/sh
2
3 ### SYSTEM ARCHITECTURE
4
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`;
8         xxOsRevMinor=`uname -r | sed -e 's/^[^0-9]*//' | cut -d. -f2`;
9         xxOsRev=`expr 100 \* $xxOsRevMajor + $xxOsRevMinor`
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
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" |
25         sed -e s/_RISC/-RISC/ -e s/HP_// -e s/_/./ -e "s/[[:space:]]*//g"`;
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 *'
35     fi
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
42     fi
43
44 echo "Archname is $archname"
45
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
50
51 ### HP-UX OS specific behaviour
52
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.
57 set `echo "X $libswanted " | sed -e 's/ ld / /' -e 's/ dbm / /' -e 's/ BSD / /' -e 's/ PW / /'`
58 shift
59 libswanted="$*"
60
61 cc=${cc:-cc}
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.
64
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
73
74     gnu_as=no
75     gnu_ld=no
76 case `$cc -v 2>&1`"" in
77     *gcc*)  ccisgcc="$define"
78             ccflags="$cc_cppflags"
79             if [ "X$gccversion" = "X" ]; then
80                 # Done too late in Configure if hinted
81                 gccversion=`$cc -dumpversion`
82                 fi
83             case "$gccversion" in
84                 [012]*) # HP-UX and gcc-2.* break UINT32_MAX :-(
85                         ccflags="$ccflags -DUINT32_MAX_BROKEN"
86                         ;;
87                 [34]*) # GCC (both 32bit and 64bit) will define __STDC_EXT__
88                        # by default when using GCC 3.0 and newer versions of
89                        # the compiler.
90                        cppflags="$cc_cppflags"
91                        ;;
92                 esac
93             case "`getconf KERNEL_BITS 2>/dev/null`" in
94                 *64*)
95                     echo "main(){}">try.c
96                     case "$gccversion" in
97                         [34]*)
98                             case "$archname" in
99                                PA-RISC*)
100                                    case "$ccflags" in
101                                        *-mpa-risc*) ;;
102                                        *) ccflags="$ccflags -mpa-risc-2-0" ;;
103                                        esac
104                                    ;;
105                                 esac
106                             ;;
107                         *)  # gcc with gas will not accept +DA2.0
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
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
124                            case "$gccversion" in
125                                [12]*)
126                                    # Why not 3 as well here?
127                                    # Since not relevant to IA64, not changed.
128                                    ldflags="$ldflags -Wl,+vnocompatwarnings"
129                                    ccflags="$ccflags -Wl,+vnocompatwarnings"
130                                    ;;
131                                esac
132                             ;;
133                         esac
134                     rm -f try.c
135                     ;;
136                 esac
137             ;;
138     *)      ccisgcc=''
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
160             ccversion=`what $cc_found | awk '/Compiler/{print $2}/Itanium/{print $6,$7}/for Integrity/{print $6,$7}'`
161             case "$ccflags" in
162                "-Ae "*) ;;
163                 *)  ccflags="-Ae $cc_cppflags"
164                     # +vnocompatwarnings not known in 10.10 and older
165                     if [ $xxOsRev -ge 1020 ]; then
166                         ccflags="$ccflags -Wl,+vnocompatwarnings"
167                         fi
168                     ;;
169                esac
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
175 #           case "$d_casti32" in
176 #               "") d_casti32='undef' ;;
177 #               esac
178             ;;
179     esac
180
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"'
183
184 ### 64 BITNESS
185
186 # Some gcc versions do native 64 bit long (e.g. 2.9-hppa-000310 and gcc-3.0)
187 # We have to force 64bitness to go search the right libraries
188     gcc_64native=no
189 case "$ccisgcc" in
190     $define|true|[Yy])
191         echo '#include <stdio.h>\nint main(){long l;printf("%d\\n",sizeof(l));}'>try.c
192         $cc -o try $ccflags $ldflags try.c
193         if [ "`try`" = "8" ]; then
194             case "$use64bitall" in
195                 $define|true|[Yy]) ;;
196                 *)  cat <<EOM >&4
197
198 *** This version of gcc uses 64 bit longs. -Duse64bitall is
199 *** implicitly set to enable continuation
200 EOM
201                 esac
202             use64bitall=$define
203             gcc_64native=yes
204             fi
205         ;;
206     esac
207
208 case "$use64bitall" in
209     $define|true|[yY]*) use64bitint="$define" ;;
210     esac
211
212 case "$usemorebits" in
213     $define|true|[yY]*) use64bitint="$define"; uselongdouble="$define" ;;
214     esac
215
216 case "$archname" in
217     IA64*)
218         # While here, override so=sl auto-detection
219         so='so'
220         ;;
221     esac
222
223 case "$use64bitall" in
224     $define|true|[Yy])
225
226         if [ "$xxOsRevMajor" -lt 11 ]; then
227             cat <<EOM >&4
228
229 *** 64-bit compilation is not supported on HP-UX $xxOsRevMajor.
230 *** You need at least HP-UX 11.0.
231 *** Cannot continue, aborting.
232 EOM
233             exit 1
234             fi
235
236         if [ $xxOsRev -eq 1100 ]; then
237             # HP-UX 11.00 uses only 48 bits internally in 64bit mode, not 64
238             # force min/max to 2**47-1
239             sGMTIME_max=140737488355327
240             sGMTIME_min=-62167219200
241             sLOCALTIME_max=140737488355327
242             sLOCALTIME_min=-62167219200
243             fi
244
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
263
264         case "$ccisgcc" in
265             $define|true|[Yy])
266                 # The fixed socket.h header file is wrong for gcc-4.x
267                 # on PA-RISC2.0W, so Sock_type_t is size_t which is
268                 # unsigned long which is 64bit which is too long
269                 case "$gccversion" in
270                     4*) case "$archname" in
271                             PA-RISC*) socksizetype=int ;;
272                             esac
273                         ;;
274                     esac
275
276                 # For the moment, don't care that it ain't supported (yet)
277                 # by gcc (up to and including 2.95.3), cause it'll crash
278                 # anyway. Expect auto-detection of 64-bit enabled gcc on
279                 # HP-UX soon, including a user-friendly exit
280                 case $gcc_64native in
281                     no) case "$gccversion" in
282                             [1234]*)
283                                 ccflags="$ccflags -mlp64"
284                                 case "$archname" in
285                                     PA-RISC*)
286                                         ldflags="$ldflags -Wl,+DD64"
287                                         ;;
288                                     IA64*)
289                                         ldflags="$ldflags -mlp64"
290                                         ;;
291                                     esac
292                                 ;;
293                             esac
294                         ;;
295                     esac
296                 ;;
297             *)
298                 case "$use64bitall" in
299                     $define|true|[yY]*)
300                         ccflags="$ccflags +DD64"
301                         ldflags="$ldflags +DD64"
302                         ;;
303                     esac
304                 ;;
305             esac
306
307         # Reset the library checker to make sure libraries
308         # are the right type
309         # (NOTE: on IA64, this doesn't work with .a files.)
310         libscheck='case "`/usr/bin/file $xxx`" in
311                        *ELF-64*|*LP64*|*PA-RISC2.0*) ;;
312                        *) xxx=/no/64-bit$xxx ;;
313                        esac'
314
315         ;;
316
317     *)  # Not in 64-bit mode
318
319         case "$archname" in
320             PA-RISC*)
321                 libc='/lib/libc.sl' ;;
322             IA64*)
323                 loclibpth="$loclibpth /usr/lib/hpux32"
324                 libc='/usr/lib/hpux32/libc.so' ;;
325             esac
326         ;;
327     esac
328
329 # By setting the deferred flag below, this means that if you run perl
330 # on a system that does not have the required shared library that you
331 # linked it with, it will die when you try to access a symbol in the
332 # (missing) shared library.  If you would rather know at perl startup
333 # time that you are missing an important shared library, switch the
334 # comments so that immediate, rather than deferred loading is
335 # performed.  Even with immediate loading, you can postpone errors for
336 # undefined (or multiply defined) routines until actual access by
337 # adding the "nonfatal" option.
338 # ccdlflags="-Wl,-E -Wl,-B,immediate $ccdlflags"
339 # ccdlflags="-Wl,-E -Wl,-B,immediate,-B,nonfatal $ccdlflags"
340 if [ "$gnu_ld" = "yes" ]; then
341     ccdlflags="-Wl,-E $ccdlflags"
342 else
343     ccdlflags="-Wl,-E -Wl,-B,deferred $ccdlflags"
344     fi
345
346
347 ### COMPILER SPECIFICS
348
349 ## Local restrictions (point to README.hpux to lift these)
350
351 ## Optimization limits
352 cat >try.c <<EOF
353 #include <stdio.h>
354 #include <sys/resource.h>
355
356 int main ()
357 {
358     struct rlimit rl;
359     int i = getrlimit (RLIMIT_DATA, &rl);
360     printf ("%d\n", (int)(rl.rlim_cur / (1024 * 1024)));
361     } /* main */
362 EOF
363 $cc -o try $ccflags $ldflags try.c
364         maxdsiz=`try`
365 rm -f try try.c core
366 if [ $maxdsiz -le 64 ]; then
367     # 64 Mb is probably not enough to optimize toke.c
368     # and regexp.c with -O2
369     cat <<EOM >&4
370 Your kernel limits the data section of your programs to $maxdsiz Mb,
371 which is (sadly) not enough to fully optimize some parts of the
372 perl binary. I'll try to use a lower optimization level for
373 those parts. If you are a sysadmin, and you *do* want full
374 optimization, raise the 'maxdsiz' kernel configuration parameter
375 to at least 0x08000000 (128 Mb) and rebuild your kernel.
376 EOM
377 regexec_cflags=''
378 doop_cflags=''
379 op_cflags=''
380 opmini_cflags=''
381 perlmain_cflags=''
382     fi
383
384 case "$ccisgcc" in
385     $define|true|[Yy])
386
387         case "$optimize" in
388             "")           optimize="-g -O" ;;
389             *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;;
390             esac
391         #ld="$cc"
392         ld=/usr/bin/ld
393         cccdlflags='-fPIC'
394         #lddlflags='-shared'
395         lddlflags='-b'
396         case "$optimize" in
397             *-g*-O*|*-O*-g*)
398                 # gcc without gas will not accept -g
399                 echo "main(){}">try.c
400                 case "`$cc $optimize -c try.c 2>&1`" in
401                     *"-g option disabled"*)
402                         set `echo "X $optimize " | sed -e 's/ -g / /'`
403                         shift
404                         optimize="$*"
405                         ;;
406                     esac
407                 ;;
408             esac
409         if [ $maxdsiz -le 64 ]; then
410             case "$optimize" in
411                 *O2*)   opt=`echo "$optimize" | sed -e 's/O2/O1/'`
412                         toke_cflags="$toke_cflags;optimize=\"$opt\""
413                         regexec_cflags="optimize=\"$opt\""
414                         ;;
415                 esac
416             fi
417         ;;
418
419     *)
420         case "$optimize" in
421             "")           optimize="+O2 +Onolimit" ;;
422             *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;;
423             esac
424         case "$optimize" in
425             *-O*|\
426             *O2*)   opt=`echo "$optimize" | sed -e 's/-O/+O2/' -e 's/O2/O1/' -e 's/ *+Onolimit//'`
427                     ;;
428             *)      opt="$optimize"
429                     ;;
430             esac
431         case "$archname" in
432             PA-RISC2.0)
433                 case "$ccversion" in
434                     B.11.11.*)
435                         # opmini.c and op.c with +O2 makes the compiler die
436                         # of internal error, for perlmain.c only +O0 (no opt)
437                         # works.
438                         case "$optimize" in
439                         *O2*)   opt=`echo "$optimize" | sed -e 's/O2/O1/'`
440                                 opmini_cflags="optimize=\"$opt\""
441                                 op_cflags="optimize=\"$opt\""
442                                 perlmain_cflags="optimize=\"\""
443                                 ;;
444                         esac
445                     esac
446                 ;;
447             IA64*)
448                 case "$ccversion" in
449                     B3910B*A.06.0[12345])
450                         # > cc --version
451                         # cc: HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005]
452                         # Has optimizing problems with -O2 and up for both
453                         # maint (5.8.8+) and blead (5.9.3+)
454                         # -O1/+O1 passed all tests (m)'05 [ 10 Jan 2005 ]
455                         optimize="$opt"                 ;;
456                         B3910B*A.06.15)
457                         # > cc --version
458                         # cc: HP C/aC++ B3910B A.06.15 [May 16 2007]
459                         # Has optimizing problems with +O2 for blead (5.17.4),
460                         # see https://rt.perl.org:443/rt3/Ticket/Display.html?id=103668.
461                         #
462                         # +O2 +Onolimit +Onoprocelim  +Ostore_ordering \
463                         # +Onolibcalls=strcmp
464                         # passes all tests (with/without -DDEBUGGING) [Nov 17 2011]
465                         case "$optimize" in
466                                 *O2*) optimize="$optimize +Onoprocelim +Ostore_ordering +Onolibcalls=strcmp" ;;
467                                 esac
468                         ;;
469                     *)  doop_cflags="optimize=\"$opt\""
470                         op_cflags="optimize=\"$opt\""   ;;
471                     esac
472                 ;;
473             esac
474         if [ $maxdsiz -le 64 ]; then
475             toke_cflags="$toke_cflags;optimize=\"$opt\""
476             regexec_cflags="optimize=\"$opt\""
477             fi
478         ld=/usr/bin/ld
479         cccdlflags='+Z'
480         lddlflags='-b +vnocompatwarnings'
481         ;;
482     esac
483
484 ## LARGEFILES
485 if [ $xxOsRev -lt 1020 ]; then
486     uselargefiles="$undef"
487     fi
488
489 #case "$uselargefiles-$ccisgcc" in
490 #    "$define-$define"|'-define')
491 #       cat <<EOM >&4
492 #
493 #*** I'm ignoring large files for this build because
494 #*** I don't know how to do use large files in HP-UX using gcc.
495 #
496 #EOM
497 #       uselargefiles="$undef"
498 #       ;;
499 #    esac
500
501 # Once we have the compiler flags defined, Configure will
502 # execute the following call-back script. See hints/README.hints
503 # for details.
504 cat > UU/cc.cbu <<'EOCBU'
505 # This script UU/cc.cbu will get 'called-back' by Configure after it
506 # has prompted the user for the C compiler to use.
507
508 # Compile and run the a test case to see if a certain gcc bug is
509 # present. If so, lower the optimization level when compiling
510 # pp_pack.c.  This works around a bug in unpack.
511
512 if test -z "$ccisgcc" -a -z "$gccversion"; then
513     : no tests needed for HPc
514 else
515     echo " "
516     echo "Testing for a certain gcc bug is fixed in your compiler..."
517
518     # Try compiling the test case.
519     if $cc -o t001 -O $ccflags $ldflags -lm ../hints/t001.c; then
520        gccbug=`$run ./t001`
521        case "$gccbug" in
522            *fails*)
523                cat >&4 <<EOF
524 This C compiler ($gccversion) is known to have optimizer
525 problems when compiling pp_pack.c.
526
527 Disabling optimization for pp_pack.c.
528 EOF
529                case "$pp_pack_cflags" in
530                    '') pp_pack_cflags='optimize='
531                        echo "pp_pack_cflags='optimize=\"\"'" >> config.sh ;;
532                    *)  echo "You specified pp_pack_cflags yourself, so we'll go with your value." >&4 ;;
533                    esac
534                ;;
535            *)  echo "Your compiler is ok." >&4
536                ;;
537            esac
538     else
539        echo " "
540        echo "*** WHOA THERE!!! ***" >&4
541        echo "    Your C compiler \"$cc\" doesn't seem to be working!" >&4
542        case "$knowitall" in
543            '') echo "    You'd better start hunting for one and let me know about it." >&4
544                exit 1
545                ;;
546            esac
547        fi
548
549     rm -f t001$_o t001$_exe
550     fi
551 EOCBU
552
553 cat >config.arch <<'EOCBU'
554 # This script UU/config.arch will get 'called-back' by Configure after
555 # all other configurations are done just before config.h is generated
556 case "$archname:$optimize" in
557   PA*:*-g*[-+]O*|PA*:*[-+]O*-g*)
558     case "$ccflags" in
559       *DD64*) ;;
560       *) case "$ccversion" in
561           # Only on PA-RISC. B3910B (aCC) is not faulty
562           # B.11.* and A.10.* are
563           [AB].1*)
564               # cc: error 1414: Can't handle preprocessed file foo.i if -g and -O specified.
565               echo "HP-UX C-ANSI-C on PA-RISC does not accept both -g and -O on preprocessed files" >&4
566               echo "when compiling in 32bit mode. The optimizer will be disabled." >&4
567               optimize=`echo "$optimize" | sed -e 's/[-+]O[0-9]*//' -e 's/+Onolimit//' -e 's/^ *//'`
568               ;;
569           esac
570       esac
571   esac
572 EOCBU
573
574 cat >UU/uselargefiles.cbu <<'EOCBU'
575 # This script UU/uselargefiles.cbu will get 'called-back' by Configure
576 # after it has prompted the user for whether to use large files.
577 case "$uselargefiles" in
578     ""|$define|true|[yY]*)
579         # there are largefile flags available via getconf(1)
580         # but we cheat for now.  (Keep that in the left margin.)
581 ccflags_uselargefiles="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
582
583         case " $ccflags " in
584         *" $ccflags_uselargefiles "*) ;;
585         *) ccflags="$ccflags $ccflags_uselargefiles" ;;
586         esac
587
588         if test -z "$ccisgcc" -a -z "$gccversion"; then
589             # The strict ANSI mode (-Aa) doesn't like large files.
590             ccflags=`echo " $ccflags "|sed 's@ -Aa @ @g'`
591             case "$ccflags" in
592                 *-Ae*) ;;
593                 *)     ccflags="$ccflags -Ae" ;;
594                 esac
595             fi
596         ;;
597     esac
598 EOCBU
599
600 # THREADING
601
602 # This script UU/usethreads.cbu will get 'called-back' by Configure
603 # after it has prompted the user for whether to use threads.
604 cat >UU/usethreads.cbu <<'EOCBU'
605 case "$usethreads" in
606     $define|true|[yY]*)
607         if [ "$xxOsRevMajor" -lt 10 ]; then
608             cat <<EOM >&4
609
610 HP-UX $xxOsRevMajor cannot support POSIX threads.
611 Consider upgrading to at least HP-UX 11.
612 Cannot continue, aborting.
613 EOM
614             exit 1
615             fi
616
617         if [ "$xxOsRevMajor" -eq 10 ]; then
618             # Under 10.X, a threaded perl can be built
619             if [ -f /usr/include/pthread.h ]; then
620                 if [ -f /usr/lib/libcma.sl ]; then
621                     # DCE (from Core OS CD) is installed
622
623                    # Check if it is pristine, or patched
624                    cmavsn=`what /usr/lib/libcma.sl 2>&1 | grep 1996`
625                    if [ ! -z "$cmavsn" ]; then
626                        cat <<EOM >&4
627 \a
628 ***************************************************************************
629
630 Perl will support threading through /usr/lib/libcma.sl from
631 the HP DCE package, but the version found is too old to be
632 reliable.
633
634 If you are not depending on this specific version of the library,
635 consider to upgrade using patch PHSS_23672 (read README.hpux)
636
637 ***************************************************************************
638
639 (sleeping for 10 seconds...)
640 EOM
641                        sleep 10
642                        fi
643
644                     # It needs # libcma and OLD_PTHREADS_API. Also
645                     # <pthread.h> needs to be #included before any
646                     # other includes (in perl.h)
647
648                     # HP-UX 10.X uses the old pthreads API
649                     d_oldpthreads="$define"
650
651                     # include libcma before all the others
652                     libswanted="cma $libswanted"
653
654                     # tell perl.h to include <pthread.h> before other
655                     # include files
656                     ccflags="$ccflags -DPTHREAD_H_FIRST"
657 # First column on purpose:
658 # this is not a standard Configure variable
659 # but we need to get this noticed.
660 pthread_h_first="$define"
661
662                     # HP-UX 10.X seems to have no easy
663                     # way of detecting these *time_r protos.
664                     d_gmtime_r_proto='define'
665                     gmtime_r_proto='REENTRANT_PROTO_I_TS'
666                     d_localtime_r_proto='define'
667                     localtime_r_proto='REENTRANT_PROTO_I_TS'
668
669                     # Avoid the poisonous conflicting (and irrelevant)
670                     # prototypes of setkey ().
671                     i_crypt="$undef"
672
673                     # CMA redefines select to cma_select, and cma_select
674                     # expects int * instead of fd_set * (just like 9.X)
675                     selecttype='int *'
676
677                 elif [ -f /usr/lib/libpthread.sl ]; then
678                     # PTH package is installed
679                     libswanted="pthread $libswanted"
680                 else
681                     libswanted="no_threads_available"
682                     fi
683             else
684                 libswanted="no_threads_available"
685                 fi
686
687             if [ $libswanted = "no_threads_available" ]; then
688                 cat <<EOM >&4
689
690 In HP-UX 10.X for POSIX threads you need both of the files
691 /usr/include/pthread.h and either /usr/lib/libcma.sl or /usr/lib/libpthread.sl.
692 Either you must upgrade to HP-UX 11 or install a posix thread library:
693
694     DCE-CoreTools from HP-UX 10.20 Hardware Extensions 3.0 CD (B3920-13941)
695
696 or
697
698     PTH package from e.g. http://hpux.connect.org.uk/hppd/hpux/Gnu/pth-2.0.7/
699
700 Cannot continue, aborting.
701 EOM
702                 exit 1
703                 fi
704         else
705             # 12 may want upping the _POSIX_C_SOURCE datestamp...
706             ccflags=" -D_POSIX_C_SOURCE=199506L -D_REENTRANT $ccflags"
707             set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
708             shift
709             libswanted="$*"
710
711             # HP-UX 11.X seems to have no easy
712             # way of detecting these *time_r protos.
713             d_gmtime_r_proto='define'
714             gmtime_r_proto='REENTRANT_PROTO_S_TS'
715             d_localtime_r_proto='define'
716             localtime_r_proto='REENTRANT_PROTO_S_TS'
717             fi
718         ;;
719     esac
720 EOCBU
721
722 # There used to be:
723 #  The mysterious io_xs memory corruption in 11.00 32bit seems to get
724 #  fixed by not using Perl's malloc.  Flip side is performance loss.
725 #  So we want mymalloc for all situations possible
726 # That set usemymalloc to 'n' for threaded builds and non-gcc 32bit
727 #  non-debugging builds and 'y' for all others
728
729 usemymalloc='n'
730 case "$useperlio" in
731     $undef|false|[nN]*) usemymalloc='y' ;;
732     esac
733
734 # malloc wrap works
735 case "$usemallocwrap" in
736     '') usemallocwrap='define' ;;
737     esac
738
739 # ctime_r () and asctime_r () seem to have issues for versions before
740 # HP-UX 11
741 if [ $xxOsRevMajor -lt 11 ]; then
742     d_ctime_r="$undef"
743     d_asctime_r="$undef"
744     fi
745
746 # fpclassify () is a macro, the library call is Fpclassify
747 # Similarly with the others below.
748 d_fpclassify='define'
749 d_isnan='define'
750 d_isinf='define'
751 d_isfinite='define'
752 d_unordered='define'
753 # Next one(s) need the leading tab.  These are special 'hint' symbols that
754 # are not to be propagated to config.sh, all related to pthreads draft 4
755 # interfaces.
756 case "$d_oldpthreads" in
757     ''|$undef)
758         d_crypt_r_proto='undef'
759         d_getgrent_r_proto='undef'
760         d_getpwent_r_proto='undef'
761         d_strerror_r_proto='undef'
762         ;;
763     esac
764
765 # H.Merijn says it's not 1998 anymore: ODBM is not needed,
766 # and it seems to be buggy in HP-UX anyway.
767 i_dbm=undef
768
769 # In HP-UXes prior to 11.23 strtold() returned a HP-UX
770 # specific union called long_double, not a C99 long double.
771 case "`grep 'double strtold.const' /usr/include/stdlib.h`" in
772 *"long double strtold"*) ;; # strtold should be safe.
773 *) echo "Looks like your strtold() is non-standard..." >&4
774    d_strtold=undef ;;
775 esac
776
777 # In pre-11 HP-UXes there really isn't isfinite(), despite what
778 # Configure might think. (There is finite(), though.)
779 case "`grep 'isfinite' /usr/include/math.h`" in
780 *"isfinite"*) ;;
781 *) d_isfinite=undef ;;
782 esac