New dec_osf hints
[p5sagit/p5-mst-13.2.git] / hints / dec_osf.sh
1 # hints/dec_osf.sh
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 #
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 #
25 #       Note: Configure will automatically
26 #       add the often quoted -DDEBUGGING for you)
27 #
28
29 case "$optimize" in
30 '')     case "$cc" in 
31         *gcc*)  
32                 optimize='-O3'
33                 ;;
34         *)      
35                 # compile something small: taint.c is fine for this.
36                 # the main point is the '-v' flag of 'cc'.
37                 case "`cc -v -I. -c taint.c -o /tmp/taint$$.o 2>&1`" in
38                 */gemc_cc*)
39                         # we have the new DEC GEM CC
40                         optimize='-O4'
41                         ;;
42                 *)
43                         # we have the old MIPS CC
44                         optimize='-O2 -Olimit 3200'
45                         ;;
46                 esac
47                 # cleanup
48                 rm -f /tmp/taint$$.o
49         esac
50         ;;
51 esac
52
53 # all compilers are ANSI
54 ccflags="$ccflags -DSTANDARD_C"
55
56 # dlopen() is in libc
57 libswanted="`echo $libswanted | sed -e 's/ dl / /'`"
58
59 # PW contains nothing useful for perl
60 libswanted="`echo $libswanted | sed -e 's/ PW / /'`"
61
62 # bsd contains nothing used by perl that is not already in libc
63 libswanted="`echo $libswanted | sed -e 's/ bsd / /'`"
64
65 # c need not be separately listed
66 libswanted="`echo $libswanted | sed -e 's/ c / /'`"
67
68 # dbm is already in libc (as is ndbm)
69 libswanted="`echo $libswanted | sed -e 's/ dbm / /'`"
70
71 # the basic lddlflags used always
72 lddlflags='-shared -expect_unresolved "*"'
73
74 # Check if it's a CMW version of OSF1,
75 # if so, do not hide the symbols.
76 test `uname -s` = "MLS+" || lddlflags="$lddlflags -hidden"
77
78 # If debugging (-g) do not strip the objects, otherwise, strip.
79 case "$optimize" in
80         *-g*) ;; # left intentionally blank
81         *) lddlflags="$lddlflags -s"
82 esac
83
84 #
85 # History:
86 #
87 # perl5.003_23:
88 #
89 #       26-Jan-1997 Jarkko Hietaniemi <jhi@iki.fi>
90 #
91 #       * Notes on how to do both optimisation and debugging.
92 #
93 #
94 #       25-Jan-1997 Jarkko Hietaniemi <jhi@iki.fi>
95 #
96 #       * Remove unneeded libraries from $libswanted: PW, bsd, c, dbm
97 #
98 #       * Restructure the $lddlflags build.
99 #
100 #       * $optimize based on which compiler we have.
101 #
102 #
103 # perl5.003_22:
104 #
105 #       23-Jan-1997 Achim Bohnet <ach@rosat.mpe-garching.mpg.de>
106 #
107 #       * Added comments 'how to create a debugging version of perl'
108 #
109 #       * Fixed logic of this script to prevent stripping of shared
110 #         objects by the loader (see ld man page for -s) is debugging
111 #         is set via the -g switch.
112 #
113 #
114 #       21-Jan-1997 Achim Bohnet <ach@rosat.mpe-garching.mpg.de>
115 #
116 #       * now 'dl' is always removed from libswanted. Not only if
117 #         optimize is an empty string.
118 #        
119 #
120 #       17-Jan-1997 Achim Bohnet <ach@rosat.mpe-garching.mpg.de>
121 #
122 #       * Removed 'dl' from libswanted: When the FreePort binary
123 #         translator for Sun binaries is installed Configure concludes
124 #         that it should use libdl.x.yz.fpx.so :-(
125 #         Because the dlopen, dlclose,... calls are in the
126 #         C library it not necessary at all to check for the
127 #         dl library.  Therefore dl is removed from libswanted.
128 #       
129 #
130 #       1-Jan-1997 Achim Bohnet <ach@rosat.mpe-garching.mpg.de>
131 #       
132 #       * Set -Olimit to 3200 because perl_yylex.c got too big
133 #         for the optimizer.
134 #