Chip noticed that the intended optionality of the 'IV' was
[p5sagit/p5-mst-13.2.git] / hints / os390.sh
CommitLineData
86339dc9 1# hints/os390.sh
9d116dd7 2#
3# OS/390 hints by David J. Fiander <davidf@mks.com>
4#
86339dc9 5# OS/390 OpenEdition Release 3 Mon Sep 22 1997 thanks to:
ac9901e0 6#
7# John Goodyear <johngood@us.ibm.com>
86339dc9 8# John Pfuntner <pfuntner@vnet.ibm.com>
9# Len Johnson <lenjay@ibm.net>
10# Bud Huff <BAHUFF@us.oracle.com>
11# Peter Prymmer <pvhp@forte.com>
1973dd96 12# Andy Dougherty <doughera@lafayette.edu>
86339dc9 13# Tim Bunce <Tim.Bunce@ig.co.uk>
14#
15# as well as the authors of the aix.sh file
16#
17
9d116dd7 18# To get ANSI C, we need to use c89, and ld doesn't exist
5f912e1c 19# You can override this with Configure -Dcc=gcc -Dld=ld.
20case "$cc" in
21'') cc='c89' ;;
22esac
23case "$ld" in
24'') ld='c89' ;;
25esac
26
27# -DMAXSIG=38 maximum signal number
28# -DOEMVS is used in place of #ifdef __MVS__ in certain places.
29# -D_OE_SOCKETS alters system headers.
30# -D_XOPEN_SOURCE_EXTENDEDA alters system headers.
31# c89 hides most of the useful header stuff, _ALL_SOURCE turns it on again.
9d116dd7 32# YYDYNAMIC ensures that the OS/390 yacc generated parser is reentrant.
5f912e1c 33# -DEBCDIC should come from Configure and need not be mentioned here.
34# Prepend your favorites with Configure -Dccflags=your_favorites
35case "$ccflags" in
7014c407 36'') ccflags='-DMAXSIG=38 -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC' ;;
37*) ccflags="$ccflags -DMAXSIG=38 -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC" ;;
5f912e1c 38esac
39
40# Turning on optimization breaks perl.
41# You can override this with Configure -Doptimize='-O' or somesuch.
42case "$optimize" in
43'') optimize='none' ;;
44esac
45
5f912e1c 46# To link via definition side decks we need the dll option
47# You can override this with Configure -Ucccdlflags or somesuch.
48case "$cccdlflags" in
ac9901e0 49'') cccdlflags='-W 0,dll' ;;
5f912e1c 50esac
51
5f912e1c 52case "$so" in
53'') so='a' ;;
54esac
9d116dd7 55
5f912e1c 56case "$alignbytes" in
57'') alignbytes=8 ;;
58esac
9d116dd7 59
5f912e1c 60case "$usemymalloc" in
61'') usemymalloc='n' ;;
62esac
9d116dd7 63
64# On OS/390, libc.a doesn't really hold anything at all,
65# so running nm on it is pretty useless.
5f912e1c 66# You can override this with Configure -Dusenm.
67case "$usenm" in
68'') usenm='false' ;;
69esac
9d116dd7 70
59c9e5d6 71# Setting ldflags='-Wl,EDIT=NO' will get rid of the symbol
72# information at the end of the executable (=> smaller binaries).
73# Override this option with -Dldflags='whatever else you wanted'.
74case "$ldflags" in
75'') ldflags='-Wl,EDIT=NO' ;;
76esac
77
78# In order to build with dynamic be sure to specify:
79# Configure -Dusedl
80# Do not forget to add $archlibexp/CORE to your LIBPATH.
81# You might want to override some of this with things like:
ac9901e0 82# Configure -Dusedl -Ddlext=so -Ddlsrc=dl_dllload.xs.
5f912e1c 83case "$usedl" in
ac9901e0 84'')
85 usedl='n'
86 case "$dlext" in
87 '') dlext='none' ;;
88 esac
89 ;;
90define)
91 case "$useshrplib" in
92 '') useshrplib='true' ;;
93 esac
ac9901e0 94 case "$dlsrc" in
95 '') dlsrc='dl_dllload.xs' ;;
96 esac
f2766b05 97 # For performance use 'so' at or beyond v2.8, 'dll' for 2.7 and prior versions
98 case "`uname -v`x`uname -r`" in
99 02x0[89].*|02x1[0-9].*|[0-9][3-9]x*)
100 so='so'
101 case "$dlext" in
102 '') dlext='so' ;;
103 esac
104 ;;
105 *)
106 so='dll'
107 case "$dlext" in
108 '') dlext='dll' ;;
109 esac
110 ;;
111 esac
112 libperl="libperl.$so"
ac9901e0 113 ccflags="$ccflags -D_SHR_ENVIRON -DPERL_EXTERNAL_GLOB -Wc,dll"
114 cccdlflags='-c -Wc,dll,EXPORTALL'
f2766b05 115 # The following will need to be modified for the installed libperl.x.
116 # The modification to Config.pm is done by the installperl script after the build and test.
ac9901e0 117 ccdlflags="-W l,dll `pwd`/libperl.x"
f2766b05 118 lddlflags="-W l,dll `pwd`/libperl.x"
ac9901e0 119 ;;
5f912e1c 120esac
ac9901e0 121# even on static builds using LIBPATH should be OK.
5f912e1c 122case "$ldlibpthname" in
123'') ldlibpthname=LIBPATH ;;
124esac
9d116dd7 125
5f912e1c 126# Header files to include.
127# You can override these with Configure -Ui_time -Ui_systime.
128case "$i_time" in
129'') i_time='define' ;;
130esac
131case "$i_systime" in
132'') i_systime='define' ;;
133esac
86339dc9 134
135# (from aix.sh)
136# uname -m output is too specific and not appropriate here
9d116dd7 137# osname should come from Configure
5f912e1c 138# You can override this with Configure -Darchname='s390' but please don't.
86339dc9 139case "$archname" in
140'') archname="$osname" ;;
141esac
142
5f912e1c 143# We have our own cppstdin script. This is not a variable since
144# Configure sees the presence of the script file.
145# We put system header -D definitions in so that Configure
146# can find the shmat() prototype in <sys/shm.h> and various
147# other things. Unfortunately, cppflags occurs too late to be of
148# value external to the script. This may need to be revisited
149# under a compiler other than c89.
f2766b05 150case "$usedl" in
151define)
152echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -D_SHR_ENVIRON -E -Wc,NOLOC ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
153 ;;
154*)
5f912e1c 155echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -E -Wc,NOLOC ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
f2766b05 156 ;;
157esac
23e2eca9 158
159#
5f912e1c 160# Note that Makefile.SH employs a bare yacc command to generate
23e2eca9 161# perly.[hc] and a2p.[hc], hence you may wish to:
162#
163# alias yacc='myyacc'
164#
165# Then if you would like to use myyacc and skip past the
166# following warnings try invoking Configure like so:
167#
168# sh Configure -Dbyacc=yacc
169#
170# This trick ought to work even if your yacc is byacc.
171#
172if test "X$byacc" = "Xbyacc" ; then
173 if test -e /etc/yyparse.c ; then
174 : we should be OK - perhaps do a test -r?
175 else
176 cat <<EOWARN >&4
177
178Warning. You do not have a copy of yyparse.c, the default
179yacc parser template file, in place in /etc.
180EOWARN
181 if test -e /samples/yyparse.c ; then
182 cat <<EOWARN >&4
183
184There does appear to be a template file in /samples though.
185Please run:
186
187 cp /samples/yyparse.c /etc
188
189before attempting to Configure the build of $package.
190
191EOWARN
192 else
193 cat <<EOWARN >&4
194
195There does not appear to be one in /samples either.
196If you feel you can make use of an alternate yacc-like
197parser generator then please read the comments in the
198hints/os390.sh file carefully.
199
200EOWARN
201 fi
202 exit 1
203 fi
204fi
205
eecdb66e 206# Most of the time gcvt() seems to work fine but
207# sometimes values like 0.1, 0.2, come out as "10", "20",
208# a trivial Perl demonstration snippet is 'print 0.1'.
1f361dc9 209# The -W 0,float(ieee) seems to be the switch breaking gcvt().
eecdb66e 210# sprintf() seems to get things right(er).
aade5aff 211gconvert_preference=sprintf
eecdb66e 212
965a5e93 213cat >config.arch<<'__CONFIG_ARCH__'
214# The '-W 0,float(ieee)' cannot be used during Configure as ldflags.
215
b7380707 216ccflags="$ccflags -W 0,float(ieee)"
965a5e93 217
218__CONFIG_ARCH__