Limit HP-UX 11.00 time to 48 bit in 64bit mode
[p5sagit/p5-mst-13.2.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}'`
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 "$use64bitint" 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=-140737488355327
241             sLOCALTIME_max=140737488355327
242             sLOCALTIME_min=-140737488355327
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                 # 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
271                     no) case "$gccversion" in
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
282                                     ;;
283                             esac
284                         ;;
285                     esac
286                 ;;
287             *)
288                 ccflags="$ccflags +DD64"
289                 ldflags="$ldflags +DD64"
290                 ;;
291             esac
292
293         # Reset the library checker to make sure libraries
294         # are the right type
295         # (NOTE: on IA64, this doesn't work with .a files.)
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
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
332
333 ### COMPILER SPECIFICS
334
335 ## Local restrictions (point to README.hpux to lift these)
336
337 ## Optimization limits
338 cat >try.c <<EOF
339 #include <stdio.h>
340 #include <sys/resource.h>
341
342 int main ()
343 {
344     struct rlimit rl;
345     int i = getrlimit (RLIMIT_DATA, &rl);
346     printf ("%d\n", (int)(rl.rlim_cur / (1024 * 1024)));
347     } /* main */
348 EOF
349 $cc -o try $ccflags $ldflags try.c
350         maxdsiz=`try`
351 rm -f try try.c core
352 if [ $maxdsiz -le 64 ]; then
353     # 64 Mb is probably not enough to optimize toke.c
354     # and regexp.c with -O2
355     cat <<EOM >&4
356 Your kernel limits the data section of your programs to $maxdsiz Mb,
357 which is (sadly) not enough to fully optimize some parts of the
358 perl binary. I'll try to use a lower optimization level for
359 those parts. If you are a sysadmin, and you *do* want full
360 optimization, raise the 'maxdsiz' kernel configuration parameter
361 to at least 0x08000000 (128 Mb) and rebuild your kernel.
362 EOM
363 regexec_cflags=''
364 doop_cflags=''
365 op_cflags=''
366     fi
367
368 case "$ccisgcc" in
369     $define|true|[Yy])
370
371         case "$optimize" in
372             "")           optimize="-g -O" ;;
373             *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;;
374             esac
375         #ld="$cc"
376         ld=/usr/bin/ld
377         cccdlflags='-fPIC'
378         #lddlflags='-shared'
379         lddlflags='-b'
380         case "$optimize" in
381             *-g*-O*|*-O*-g*)
382                 # gcc without gas will not accept -g
383                 echo "main(){}">try.c
384                 case "`$cc $optimize -c try.c 2>&1`" in
385                     *"-g option disabled"*)
386                         set `echo "X $optimize " | sed -e 's/ -g / /'`
387                         shift
388                         optimize="$*"
389                         ;;
390                     esac
391                 ;;
392             esac
393         if [ $maxdsiz -le 64 ]; then
394             case "$optimize" in
395                 *O2*)   opt=`echo "$optimize" | sed -e 's/O2/O1/'`
396                         toke_cflags="$toke_cflags;optimize=\"$opt\""
397                         regexec_cflags="optimize=\"$opt\""
398                         ;;
399                 esac
400             fi
401         ;;
402
403     *)  # HP's compiler cannot combine -g and -O
404         case "$optimize" in
405             "")           optimize="+O2 +Onolimit" ;;
406             *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;;
407             esac
408         case "$optimize" in
409             *-O*|\
410             *O2*)   opt=`echo "$optimize" | sed -e 's/-O/+O2/' -e 's/O2/O1/' -e 's/ *+Onolimit//'`
411                     ;;
412             *)      opt="$optimize"
413                     ;;
414             esac
415         case "$archname" in
416             IA64*)
417                 case "$ccversion" in
418                     B3910B*A.06.0[12345])
419                         # > cc --version
420                         # cc: HP aC++/ANSI C B3910B A.06.05 [Jul 25 2005]
421                         # Has optimizing problems with -O2 and up for both
422                         # maint (5.8.8+) and blead (5.9.3+)
423                         # -O1/+O1 passed all tests (m)'05 [ 10 Jan 2005 ]
424                         optimize="$opt"                 ;;
425                     *)  doop_cflags="optimize=\"$opt\""
426                         op_cflags="optimize=\"$opt\""   ;;
427                     esac
428                 ;;
429             esac
430         if [ $maxdsiz -le 64 ]; then
431             toke_cflags="$toke_cflags;optimize=\"$opt\""
432             regexec_cflags="optimize=\"$opt\""
433             fi
434         ld=/usr/bin/ld
435         cccdlflags='+Z'
436         lddlflags='-b +vnocompatwarnings'
437         ;;
438     esac
439
440 ## LARGEFILES
441 if [ $xxOsRev -lt 1020 ]; then
442     uselargefiles="$undef"
443     fi
444
445 #case "$uselargefiles-$ccisgcc" in
446 #    "$define-$define"|'-define')
447 #       cat <<EOM >&4
448 #
449 #*** I'm ignoring large files for this build because
450 #*** I don't know how to do use large files in HP-UX using gcc.
451 #
452 #EOM
453 #       uselargefiles="$undef"
454 #       ;;
455 #    esac
456
457 # Once we have the compiler flags defined, Configure will
458 # execute the following call-back script. See hints/README.hints
459 # for details.
460 cat > UU/cc.cbu <<'EOCBU'
461 # This script UU/cc.cbu will get 'called-back' by Configure after it
462 # has prompted the user for the C compiler to use.
463
464 # Compile and run the a test case to see if a certain gcc bug is
465 # present. If so, lower the optimization level when compiling
466 # pp_pack.c.  This works around a bug in unpack.
467
468 if test -z "$ccisgcc" -a -z "$gccversion"; then
469     : no tests needed for HPc
470 else
471     echo " "
472     echo "Testing for a certain gcc bug is fixed in your compiler..."
473
474     # Try compiling the test case.
475     if $cc -o t001 -O $ccflags $ldflags -lm ../hints/t001.c; then
476        gccbug=`$run ./t001`
477        case "$gccbug" in
478            *fails*)
479                cat >&4 <<EOF
480 This C compiler ($gccversion) is known to have optimizer
481 problems when compiling pp_pack.c.
482
483 Disabling optimization for pp_pack.c.
484 EOF
485                case "$pp_pack_cflags" in
486                    '') pp_pack_cflags='optimize='
487                        echo "pp_pack_cflags='optimize=\"\"'" >> config.sh ;;
488                    *)  echo "You specified pp_pack_cflags yourself, so we'll go with your value." >&4 ;;
489                    esac
490                ;;
491            *)  echo "Your compiler is ok." >&4
492                ;;
493            esac
494     else
495        echo " "
496        echo "*** WHOA THERE!!! ***" >&4
497        echo "    Your C compiler \"$cc\" doesn't seem to be working!" >&4
498        case "$knowitall" in
499            '') echo "    You'd better start hunting for one and let me know about it." >&4
500                exit 1
501                ;;
502            esac
503        fi
504
505     rm -f t001$_o t001$_exe
506     fi
507 EOCBU
508
509 cat >UU/uselargefiles.cbu <<'EOCBU'
510 # This script UU/uselargefiles.cbu will get 'called-back' by Configure
511 # after it has prompted the user for whether to use large files.
512 case "$uselargefiles" in
513     ""|$define|true|[yY]*)
514         # there are largefile flags available via getconf(1)
515         # but we cheat for now.  (Keep that in the left margin.)
516 ccflags_uselargefiles="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
517
518         case " $ccflags " in
519         *" $ccflags_uselargefiles "*) ;;
520         *) ccflags="$ccflags $ccflags_uselargefiles" ;;
521         esac
522
523         if test -z "$ccisgcc" -a -z "$gccversion"; then
524             # The strict ANSI mode (-Aa) doesn't like large files.
525             ccflags=`echo " $ccflags "|sed 's@ -Aa @ @g'`
526             case "$ccflags" in
527                 *-Ae*) ;;
528                 *)     ccflags="$ccflags -Ae" ;;
529                 esac
530             fi
531         ;;
532     esac
533 EOCBU
534
535 # THREADING
536
537 # This script UU/usethreads.cbu will get 'called-back' by Configure
538 # after it has prompted the user for whether to use threads.
539 cat >UU/usethreads.cbu <<'EOCBU'
540 case "$usethreads" in
541     $define|true|[yY]*)
542         if [ "$xxOsRevMajor" -lt 10 ]; then
543             cat <<EOM >&4
544
545 HP-UX $xxOsRevMajor cannot support POSIX threads.
546 Consider upgrading to at least HP-UX 11.
547 Cannot continue, aborting.
548 EOM
549             exit 1
550             fi
551
552         if [ "$xxOsRevMajor" -eq 10 ]; then
553             # Under 10.X, a threaded perl can be built
554             if [ -f /usr/include/pthread.h ]; then
555                 if [ -f /usr/lib/libcma.sl ]; then
556                     # DCE (from Core OS CD) is installed
557
558                    # Check if it is pristine, or patched
559                    cmavsn=`what /usr/lib/libcma.sl 2>&1 | grep 1996`
560                    if [ ! -z "$cmavsn" ]; then
561                        cat <<EOM >&4
562 \a
563 ***************************************************************************
564
565 Perl will support threading through /usr/lib/libcma.sl from
566 the HP DCE package, but the version found is too old to be
567 reliable.
568
569 If you are not depending on this specific version of the library,
570 consider to upgrade using patch PHSS_23672 (read README.hpux)
571
572 ***************************************************************************
573
574 (sleeping for 10 seconds...)
575 EOM
576                        sleep 10
577                        fi
578
579                     # It needs # libcma and OLD_PTHREADS_API. Also
580                     # <pthread.h> needs to be #included before any
581                     # other includes (in perl.h)
582
583                     # HP-UX 10.X uses the old pthreads API
584                     d_oldpthreads="$define"
585
586                     # include libcma before all the others
587                     libswanted="cma $libswanted"
588
589                     # tell perl.h to include <pthread.h> before other
590                     # include files
591                     ccflags="$ccflags -DPTHREAD_H_FIRST"
592 # First column on purpose:
593 # this is not a standard Configure variable
594 # but we need to get this noticed.
595 pthread_h_first="$define"
596
597                     # HP-UX 10.X seems to have no easy
598                     # way of detecting these *time_r protos.
599                     d_gmtime_r_proto='define'
600                     gmtime_r_proto='REENTRANT_PROTO_I_TS'
601                     d_localtime_r_proto='define'
602                     localtime_r_proto='REENTRANT_PROTO_I_TS'
603
604                     # Avoid the poisonous conflicting (and irrelevant)
605                     # prototypes of setkey ().
606                     i_crypt="$undef"
607
608                     # CMA redefines select to cma_select, and cma_select
609                     # expects int * instead of fd_set * (just like 9.X)
610                     selecttype='int *'
611
612                 elif [ -f /usr/lib/libpthread.sl ]; then
613                     # PTH package is installed
614                     libswanted="pthread $libswanted"
615                 else
616                     libswanted="no_threads_available"
617                     fi
618             else
619                 libswanted="no_threads_available"
620                 fi
621
622             if [ $libswanted = "no_threads_available" ]; then
623                 cat <<EOM >&4
624
625 In HP-UX 10.X for POSIX threads you need both of the files
626 /usr/include/pthread.h and either /usr/lib/libcma.sl or /usr/lib/libpthread.sl.
627 Either you must upgrade to HP-UX 11 or install a posix thread library:
628
629     DCE-CoreTools from HP-UX 10.20 Hardware Extensions 3.0 CD (B3920-13941)
630
631 or
632
633     PTH package from e.g. http://hpux.tn.tudelft.nl/hppd/hpux/alpha.html
634
635 Cannot continue, aborting.
636 EOM
637                 exit 1
638                 fi
639         else
640             # 12 may want upping the _POSIX_C_SOURCE datestamp...
641             ccflags=" -D_POSIX_C_SOURCE=199506L -D_REENTRANT $ccflags"
642             set `echo X "$libswanted "| sed -e 's/ c / pthread c /'`
643             shift
644             libswanted="$*"
645
646             # HP-UX 11.X seems to have no easy
647             # way of detecting these *time_r protos.
648             d_gmtime_r_proto='define'
649             gmtime_r_proto='REENTRANT_PROTO_S_TS'
650             d_localtime_r_proto='define'
651             localtime_r_proto='REENTRANT_PROTO_S_TS'
652             fi
653         ;;
654     esac
655 EOCBU
656
657 # There used to be:
658 #  The mysterious io_xs memory corruption in 11.00 32bit seems to get
659 #  fixed by not using Perl's malloc.  Flip side is performance loss.
660 #  So we want mymalloc for all situations possible
661 # That set usemymalloc to 'n' for threaded builds and non-gcc 32bit
662 #  non-debugging builds and 'y' for all others
663
664 usemymalloc='n'
665 case "$useperlio" in
666     $undef|false|[nN]*) usemymalloc='y' ;;
667     esac
668
669 # malloc wrap works
670 case "$usemallocwrap" in
671     '') usemallocwrap='define' ;;
672     esac
673
674 # ctime_r () and asctime_r () seem to have issues for versions before
675 # HP-UX 11
676 if [ $xxOsRevMajor -lt 11 ]; then
677     d_ctime_r="$undef"
678     d_asctime_r="$undef"
679     fi
680
681 # fpclassify () is a macro, the library call is Fpclassify
682 # Similarly with the others below.
683 d_fpclassify='define'
684 d_isnan='define'
685 d_isinf='define'
686 d_isfinite='define'
687 d_unordered='define'
688 # Next one(s) need the leading tab.  These are special 'hint' symbols that
689 # are not to be propagated to config.sh, all related to pthreads draft 4
690 # interfaces.
691 case "$d_oldpthreads" in
692     ''|$undef)
693         d_crypt_r_proto='undef'
694         d_getgrent_r_proto='undef'
695         d_getpwent_r_proto='undef'
696         d_strerror_r_proto='undef'
697         ;;
698     esac