This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
When overloading, don't throw away nomethod's value
[perl5.git] / hints / dec_osf.sh
CommitLineData
a0d0e21e 1# hints/dec_osf.sh
8e964347
AB
2
3#
4# How to make a DEBUGGING VERSION of perl for DECs cc compiler
5#
6# If you want to debug perl or want to send a
7# stack trace for inclusion into an bug report, call
8# Configure with the additional argument -Doptimize=-g2
9# or uncomment this assignment to "optimize":
10#
11#optimize=-g2
12#
8a019ce7
JH
13# If you want both to optimise and debug with the DEC cc
14# you must have -g3, e.g. "-O4 -g3", and (re)run Configure.
15#
16# Note 1: gcc can always have both -g and optimisation on.
17#
18# Note 2: debugging optimised code, no matter what compiler
19# one is using, can be surprising and confusing because of
20# the optimisation tricks like code motion, code removal,
21# loop unrolling, and inlining. The source code and the
22# executable code simply do not agree any more while in
23# mid-execution, the optimiser only cares about the results.
24#
f2c69087
JH
25# Note 3: Configure will automatically add the often quoted
26# -DDEBUGGING for you if the -g is specified.
27#
28# Note 4: There is even more optimisation available in the new
29# (GEM) DEC cc: -O5 and -fast. "man cc" will tell more about them.
30# The jury is still out whether either or neither help for Perl
31# and how much. Based on very quick testing, -fast boosts
32# raw data copy by about 5-15% (-fast brings in, among other
33# things, inlined, ahem, fast memcpy()), while on the other
34# hand searching things (index, m//, s///), seems to get slower.
35# Your mileage will vary.
8e964347
AB
36#
37
dfa3a3d3 38_DEC_cc_style=
1fc4cb55 39case "$optimize" in
8e964347 40'') case "$cc" in
8a019ce7
JH
41 *gcc*)
42 optimize='-O3'
43 ;;
44 *)
45 # compile something small: taint.c is fine for this.
46 # the main point is the '-v' flag of 'cc'.
47 case "`cc -v -I. -c taint.c -o /tmp/taint$$.o 2>&1`" in
48 */gemc_cc*)
49 # we have the new DEC GEM CC
50 optimize='-O4'
dfa3a3d3 51 _DEC_cc_style=new
8a019ce7
JH
52 ;;
53 *)
54 # we have the old MIPS CC
55 optimize='-O2 -Olimit 3200'
dfa3a3d3 56 _DEC_cc_style=old
8a019ce7
JH
57 ;;
58 esac
59 # cleanup
60 rm -f /tmp/taint$$.o
8e964347
AB
61 esac
62 ;;
1fc4cb55 63esac
28757baa 64
8a019ce7 65# all compilers are ANSI
fed7345c 66ccflags="$ccflags -DSTANDARD_C"
28757baa 67
dfa3a3d3
CS
68# be nauseatingly ANSI
69case "$cc" in
70gcc) ccflags="$ccflags -ansi"
71 ;;
72*) ccflags="$ccflags -std1"
73 # -vaxc not to get warnings about stuff like$this for VMS.
74 # -vaxc is available only in newer DEC compilers.
75 test X"$_DEC_cc_style"Y = XnewY && ccflags="$ccflags -vaxc"
76 ;;
77esac
78
8e964347
AB
79# dlopen() is in libc
80libswanted="`echo $libswanted | sed -e 's/ dl / /'`"
81
8a019ce7
JH
82# PW contains nothing useful for perl
83libswanted="`echo $libswanted | sed -e 's/ PW / /'`"
84
85# bsd contains nothing used by perl that is not already in libc
86libswanted="`echo $libswanted | sed -e 's/ bsd / /'`"
87
88# c need not be separately listed
89libswanted="`echo $libswanted | sed -e 's/ c / /'`"
90
91# dbm is already in libc (as is ndbm)
92libswanted="`echo $libswanted | sed -e 's/ dbm / /'`"
93
94# the basic lddlflags used always
95lddlflags='-shared -expect_unresolved "*"'
96
97# Check if it's a CMW version of OSF1,
98# if so, do not hide the symbols.
99test `uname -s` = "MLS+" || lddlflags="$lddlflags -hidden"
100
101# If debugging (-g) do not strip the objects, otherwise, strip.
102case "$optimize" in
103 *-g*) ;; # left intentionally blank
104 *) lddlflags="$lddlflags -s"
105esac
8e964347
AB
106
107#
108# History:
109#
dfa3a3d3
CS
110# perl5.003_26:
111#
112# 15-Feb-1997 Jarkko Hietaniemi <jhi@iki.fi>
113#
114# * -std1 and -ansi.
115#
116#
f2c69087
JH
117# perl5.003_24:
118#
119# 30-Jan-1997 Jarkko Hietaniemi <jhi@iki.fi>
120#
121# * Fixing the note on -DDEBUGGING.
122#
123# * Note on -O5 -fast.
124#
125#
8a019ce7
JH
126# perl5.003_23:
127#
128# 26-Jan-1997 Jarkko Hietaniemi <jhi@iki.fi>
129#
130# * Notes on how to do both optimisation and debugging.
131#
132#
133# 25-Jan-1997 Jarkko Hietaniemi <jhi@iki.fi>
134#
135# * Remove unneeded libraries from $libswanted: PW, bsd, c, dbm
136#
137# * Restructure the $lddlflags build.
138#
139# * $optimize based on which compiler we have.
140#
141#
8e964347
AB
142# perl5.003_22:
143#
144# 23-Jan-1997 Achim Bohnet <ach@rosat.mpe-garching.mpg.de>
145#
146# * Added comments 'how to create a debugging version of perl'
147#
148# * Fixed logic of this script to prevent stripping of shared
149# objects by the loader (see ld man page for -s) is debugging
150# is set via the -g switch.
151#
152#
153# 21-Jan-1997 Achim Bohnet <ach@rosat.mpe-garching.mpg.de>
154#
155# * now 'dl' is always removed from libswanted. Not only if
156# optimize is an empty string.
157#
158#
159# 17-Jan-1997 Achim Bohnet <ach@rosat.mpe-garching.mpg.de>
160#
161# * Removed 'dl' from libswanted: When the FreePort binary
162# translator for Sun binaries is installed Configure concludes
163# that it should use libdl.x.yz.fpx.so :-(
164# Because the dlopen, dlclose,... calls are in the
165# C library it not necessary at all to check for the
166# dl library. Therefore dl is removed from libswanted.
167#
168#
169# 1-Jan-1997 Achim Bohnet <ach@rosat.mpe-garching.mpg.de>
170#
171# * Set -Olimit to 3200 because perl_yylex.c got too big
172# for the optimizer.
173#