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