[inseparable changes from patch from perl5.003_18 to perl5.003_19]
[p5sagit/p5-mst-13.2.git] / hints / hpux.sh
1 # hints/hpux.sh
2 # Perl Configure hints file for Hewlett Packard HP-UX 9.x and 10.x
3 # This file is based on 
4 # hints/hpux_9.sh, Perl Configure hints file for Hewlett Packard HP-UX 9.x
5 # Use Configure -Dcc=gcc to use gcc.
6 # From: Jeff Okamoto <okamoto@corp.hp.com>
7 # and
8 # hints/hpux_10.sh, Perl Configure hints file for Hewlett Packard HP-UX 10.x
9 # From: Giles Lean <giles@nemeton.com.au>
10
11 # This version: December 27, 1996
12 # Current maintainer: Jeff Okamoto <okamoto@corp.hp.com>
13
14 # Use Configure -Dcc=gcc to use gcc.
15 # Use Configure -Dprefix=/usr/local to install in /usr/local.
16
17 # Some users have reported problems with dynamic loading if the 
18 # environment variable LDOPTS='-a archive' .
19
20 # Turn on the _HPUX_SOURCE flag to get many of the HP add-ons
21 ccflags="$ccflags -D_HPUX_SOURCE"
22
23 # If you plan to use gcc, then you should uncomment the following line
24 # so you get the HP math library and not the GCC math library.
25 # ccflags="$ccflags -L/lib/pa1.1"
26
27 # Check if you're using the bundled C compiler.  This compiler doesn't support
28 # ANSI C (the -Aa flag) nor can it produce shared libraries.  Thus we have
29 # to turn off dynamic loading.
30 case "$cc" in
31 '') if cc $ccflags -Aa 2>&1 | $contains 'option' >/dev/null
32     then
33         case "$usedl" in
34          '') usedl="$undef"
35              cat <<'EOM'
36
37 The bundled C compiler can not produce shared libraries, so you will
38 not be able to use dynamic loading. 
39
40 EOM
41              ;;
42         esac
43     else
44         ccflags="$ccflags -Aa"  # The add-on compiler supports ANSI C
45     fi
46     optimize='-O'
47     ;;
48 esac
49
50 # Determine the architecture type of this system.
51 xxuname=`uname -r`
52 if echo $xxuname | $contains '10'
53 then
54         # This system is running 10.0
55         xxcpu1=`getconf CPU_VERSION`
56         xxcpu2=`printf %#x ${xxcpu1}`
57         xxcontext=`grep "$xxcpu2" /usr/include/sys/unistd.h`
58         if echo "$xxcontext" | $contains 'PA-RISC1.1'
59         then
60                 archname='PA-RISC1.1'
61         elif echo "$xxcontext" | $contains 'PA-RISC1.0'
62         then
63                 archname='PA-RISC1.0'
64         elif echo "$xxcontext" | $contains 'PA-RISC2'
65         then
66                 archname='PA-RISC2'
67         else
68                 echo "This 10.0 system is of a PA-RISC type I don't recognize."
69                 echo "Debugging output: $xxcontext"
70                 archname=''
71         fi
72 else
73         # This system is not running 10.0
74         xxcontext=`/bin/getcontext`
75         if echo "$xxcontext" | $contains 'PA-RISC1.1'
76         then
77                 archname='PA-RISC1.1'
78         elif echo "$xxcontext" | $contains 'PA-RISC1.0'
79         then
80                 archname='PA-RISC1.0'
81         elif echo "$xxcontext" | $contains 'HP-MC'
82         then
83                 archname='HP-MC68K'
84         else
85                 echo "I cannot recognize what chip set this system is using."
86                 echo "Debugging output: $xxcontext"
87                 archname=''
88         fi
89 fi
90
91 # Remove bad libraries that will cause problems
92 # (This doesn't remove libraries that don't actually exist)
93 # -lld is unneeded (and I can't figure out what it's used for anyway)
94 # -ldbm is obsolete and should not be used
95 # -lBSD contains BSD-style duplicates of SVR4 routines that cause confusion
96 # -lPW is obsolete and should not be used
97 # The libraries crypt, malloc, ndir, and net are empty.
98 # Although -lndbm should be included, it will make perl blow up if you should
99 # copy the binary to a system without libndbm.sl.  See ccdlflags below.
100 set `echo " $libswanted " | sed  -e 's@ ld @ @' -e 's@ dbm @ @' -e 's@ BSD @ @' -e 's@ PW @ @'`
101 libswanted="$*"
102
103 # By setting the deferred flag below, this means that if you run perl on a
104 # system that does not have the required shared library that you linked it
105 # with, it will die when you try to access a symbol in the (missing) shared
106 # library.  If you would rather know at perl startup time that you are
107 # missing an important shared library, switch the comments so that immediate,
108 # rather than deferred loading is performed.
109 # ccdlflags="-Wl,-E $ccdlflags"
110 ccdlflags="-Wl,-E -Wl,-B,deferred $ccdlflags"
111
112 usemymalloc='y'
113 alignbytes=8
114 selecttype='int *'
115
116 # For no good reason, HP-UX sets argv[0] to the name of a script
117 # executed with #!, which makes $^X wrong.  This macro enables a
118 # workaround.
119 toke_cflags='ccflags="$ccflags -DARG_ZERO_IS_SCRIPT"'
120
121 # If your compile complains about FLT_MIN, uncomment the next line
122 # POSIX_cflags='ccflags="$ccflags -DFLT_MIN=1.17549435E-38"'
123
124 # Comment this out if you don't want to follow the SVR4 filesystem layout
125 # that HP-UX 10.0 uses
126 case "$prefix" in
127 '') prefix='/opt/perl5.003' ;;
128 esac
129
130 # Date: Fri, 6 Sep 96 23:15:31 CDT
131 # From: "Daniel S. Lewart" <d-lewart@uiuc.edu>
132 # I looked through the gcc.info and found this:
133 #   * GNU CC compiled code sometimes emits warnings from the HP-UX
134 #     assembler of the form:
135 #          (warning) Use of GR3 when frame >= 8192 may cause conflict.
136 #     These warnings are harmless and can be safely ignored.