Commit | Line | Data |
---|---|---|
86339dc9 | 1 | # hints/os390.sh |
9d116dd7 JH |
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 PP |
6 | # |
7 | # John Goodyear <johngood@us.ibm.com> | |
86339dc9 TB |
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 TB |
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 PP |
19 | # You can override this with Configure -Dcc=gcc -Dld=ld. |
20 | case "$cc" in | |
21 | '') cc='c89' ;; | |
22 | esac | |
23 | case "$ld" in | |
24 | '') ld='c89' ;; | |
25 | esac | |
26 | ||
4144573e | 27 | # -DMAXSIG=39 maximum signal number |
5f912e1c PP |
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 PP |
33 | # -DEBCDIC should come from Configure and need not be mentioned here. |
34 | # Prepend your favorites with Configure -Dccflags=your_favorites | |
35 | case "$ccflags" in | |
4144573e JH |
36 | '') ccflags='-2 -Wc,XPLINK -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC' ;; |
37 | *) ccflags="$ccflags -2 -Wc,XPLINK -DMAXSIG=39 -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC" ;; | |
5f912e1c PP |
38 | esac |
39 | ||
40 | # Turning on optimization breaks perl. | |
41 | # You can override this with Configure -Doptimize='-O' or somesuch. | |
42 | case "$optimize" in | |
43 | '') optimize='none' ;; | |
44 | esac | |
45 | ||
5f912e1c PP |
46 | # To link via definition side decks we need the dll option |
47 | # You can override this with Configure -Ucccdlflags or somesuch. | |
48 | case "$cccdlflags" in | |
ac9901e0 | 49 | '') cccdlflags='-W 0,dll' ;; |
5f912e1c PP |
50 | esac |
51 | ||
5f912e1c PP |
52 | case "$so" in |
53 | '') so='a' ;; | |
54 | esac | |
9d116dd7 | 55 | |
5f912e1c PP |
56 | case "$alignbytes" in |
57 | '') alignbytes=8 ;; | |
58 | esac | |
9d116dd7 | 59 | |
5f912e1c PP |
60 | case "$usemymalloc" in |
61 | '') usemymalloc='n' ;; | |
62 | esac | |
9d116dd7 JH |
63 | |
64 | # On OS/390, libc.a doesn't really hold anything at all, | |
65 | # so running nm on it is pretty useless. | |
5f912e1c PP |
66 | # You can override this with Configure -Dusenm. |
67 | case "$usenm" in | |
68 | '') usenm='false' ;; | |
69 | esac | |
9d116dd7 | 70 | |
59c9e5d6 PP |
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'. | |
74 | case "$ldflags" in | |
4144573e | 75 | '') ldflags='-Wl,EDIT=NO -Wl,XPLINK,dll' ;; |
59c9e5d6 PP |
76 | esac |
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 | 83 | case "$usedl" in |
ac9901e0 PP |
84 | '') |
85 | usedl='n' | |
86 | case "$dlext" in | |
87 | '') dlext='none' ;; | |
88 | esac | |
89 | ;; | |
90 | define) | |
91 | case "$useshrplib" in | |
92 | '') useshrplib='true' ;; | |
93 | esac | |
ac9901e0 PP |
94 | case "$dlsrc" in |
95 | '') dlsrc='dl_dllload.xs' ;; | |
96 | esac | |
f2766b05 PP |
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" |
4144573e | 114 | cccdlflags='-c -Wc,XPLINK,dll,EXPORTALL' |
f2766b05 PP |
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. | |
4144573e JH |
117 | ccdlflags="-W l,XPLINK,dll `pwd`/libperl.x" |
118 | lddlflags="-W l,XPLINK,dll `pwd`/libperl.x" | |
ac9901e0 | 119 | ;; |
5f912e1c | 120 | esac |
ac9901e0 | 121 | # even on static builds using LIBPATH should be OK. |
5f912e1c PP |
122 | case "$ldlibpthname" in |
123 | '') ldlibpthname=LIBPATH ;; | |
124 | esac | |
9d116dd7 | 125 | |
dca46f05 | 126 | # The following should always be used |
20b634c2 JH |
127 | d_oldpthreads='define' |
128 | ||
5f912e1c | 129 | # Header files to include. |
20b634c2 | 130 | # You can override these with Configure -Ui_time -Ui_systime -Dd_pthread_atfork. |
5f912e1c PP |
131 | case "$i_time" in |
132 | '') i_time='define' ;; | |
133 | esac | |
134 | case "$i_systime" in | |
135 | '') i_systime='define' ;; | |
136 | esac | |
20b634c2 JH |
137 | case "$d_pthread_atfork" in |
138 | '') d_pthread_atfork='undef' ;; | |
139 | esac | |
6cfe8af5 JH |
140 | case "$d_pthread_atfork" in |
141 | '') d_pthread_atfork='undef' ;; | |
142 | esac | |
86339dc9 TB |
143 | |
144 | # (from aix.sh) | |
145 | # uname -m output is too specific and not appropriate here | |
9d116dd7 | 146 | # osname should come from Configure |
5f912e1c | 147 | # You can override this with Configure -Darchname='s390' but please don't. |
86339dc9 TB |
148 | case "$archname" in |
149 | '') archname="$osname" ;; | |
150 | esac | |
151 | ||
5f912e1c PP |
152 | # We have our own cppstdin script. This is not a variable since |
153 | # Configure sees the presence of the script file. | |
154 | # We put system header -D definitions in so that Configure | |
155 | # can find the shmat() prototype in <sys/shm.h> and various | |
156 | # other things. Unfortunately, cppflags occurs too late to be of | |
157 | # value external to the script. This may need to be revisited | |
158 | # under a compiler other than c89. | |
f2766b05 PP |
159 | case "$usedl" in |
160 | define) | |
a4c2c75a | 161 | echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -D_SHR_ENVIRON -E -Wc,"LANGLVL(DOLLARINNAMES)",NOLOC ${1+"$@"} .$$.c | fgrep -v "??="; rm .$$.c' > cppstdin |
f2766b05 PP |
162 | ;; |
163 | *) | |
a4c2c75a | 164 | echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -E -Wc,"LANGLVL(DOLLARINNAMES)",NOLOC ${1+"$@"} .$$.c | fgrep -v "??="; rm .$$.c' > cppstdin |
f2766b05 PP |
165 | ;; |
166 | esac | |
23e2eca9 PP |
167 | |
168 | # | |
5f912e1c | 169 | # Note that Makefile.SH employs a bare yacc command to generate |
c67aee7a | 170 | # perly.[hc], hence you may wish to: |
23e2eca9 PP |
171 | # |
172 | # alias yacc='myyacc' | |
173 | # | |
174 | # Then if you would like to use myyacc and skip past the | |
175 | # following warnings try invoking Configure like so: | |
176 | # | |
177 | # sh Configure -Dbyacc=yacc | |
178 | # | |
179 | # This trick ought to work even if your yacc is byacc. | |
180 | # | |
181 | if test "X$byacc" = "Xbyacc" ; then | |
182 | if test -e /etc/yyparse.c ; then | |
183 | : we should be OK - perhaps do a test -r? | |
184 | else | |
185 | cat <<EOWARN >&4 | |
186 | ||
187 | Warning. You do not have a copy of yyparse.c, the default | |
188 | yacc parser template file, in place in /etc. | |
189 | EOWARN | |
190 | if test -e /samples/yyparse.c ; then | |
191 | cat <<EOWARN >&4 | |
192 | ||
193 | There does appear to be a template file in /samples though. | |
194 | Please run: | |
195 | ||
196 | cp /samples/yyparse.c /etc | |
197 | ||
198 | before attempting to Configure the build of $package. | |
199 | ||
200 | EOWARN | |
201 | else | |
202 | cat <<EOWARN >&4 | |
203 | ||
204 | There does not appear to be one in /samples either. | |
205 | If you feel you can make use of an alternate yacc-like | |
206 | parser generator then please read the comments in the | |
207 | hints/os390.sh file carefully. | |
208 | ||
209 | EOWARN | |
210 | fi | |
211 | exit 1 | |
212 | fi | |
213 | fi | |
214 | ||
eecdb66e JH |
215 | # Most of the time gcvt() seems to work fine but |
216 | # sometimes values like 0.1, 0.2, come out as "10", "20", | |
217 | # a trivial Perl demonstration snippet is 'print 0.1'. | |
1f361dc9 | 218 | # The -W 0,float(ieee) seems to be the switch breaking gcvt(). |
eecdb66e | 219 | # sprintf() seems to get things right(er). |
aade5aff | 220 | gconvert_preference=sprintf |
eecdb66e | 221 | |
965a5e93 JH |
222 | cat >config.arch<<'__CONFIG_ARCH__' |
223 | # The '-W 0,float(ieee)' cannot be used during Configure as ldflags. | |
224 | ||
c68fc1f1 | 225 | ccflags="$ccflags -W 0,float(ieee) -W 0,LANGLVL(LONGLONG)" |
965a5e93 JH |
226 | |
227 | __CONFIG_ARCH__ | |
4144573e JH |
228 | |
229 | # Configure gets these wrong for some reason. | |
230 | d_gethostbyaddr_r='undef' | |
231 | d_gethostbyname_r='undef' | |
232 | d_gethostent_r='undef' | |
233 | ||
636a024b AD |
234 | # The z/OS C compiler compiler supports the attribute keyword, but in a |
235 | # limited manner. | |
236 | # | |
237 | # Ideally, Configure's tests should test the attributes as they are expected | |
238 | # to be used in perl, and, ideally, those tests would fail on z/OS. | |
239 | # Until then, just tell Configure to ignore the attributes. Currently, | |
240 | # Configure thinks attributes are supported because it does not recognize | |
241 | # warning messages like this: | |
242 | # | |
243 | # INFORMATIONAL CCN4108 ./proto.h:4534 The use of keyword '__attribute__' is non-portable. | |
244 | ||
245 | d_attribute_deprecated='undef' | |
246 | d_attribute_format='undef' | |
247 | d_attribute_malloc='undef' | |
248 | d_attribute_nonnull='undef' | |
249 | d_attribute_noreturn='undef' | |
250 | d_attribute_pure='undef' | |
251 | d_attribute_unused='undef' | |
252 | d_attribute_warn_unused_result='undef' | |
d3ac2b76 JH |
253 | |
254 | # nan() is in libm but doesn't work as expected: nan("") or nan("0") | |
255 | # returns zero, not a nan: | |
256 | # http://www-01.ibm.com/support/knowledgecenter/SSLTBW_1.12.0/com.ibm.zos.r12.bpxbd00/nan.htm%23nan?lang=en | |
257 | # contrast with e.g. | |
258 | # http://www.cplusplus.com/reference/cmath/nan-function/ | |
259 | # (C++ but C99 math agrees) | |
260 | # XXX: Configure scan for proper behavior | |
261 | d_nan='undef' |