3 # OS/390 hints by David J. Fiander <davidf@mks.com>
5 # OS/390 OpenEdition Release 3 Mon Sep 22 1997 thanks to:
7 # John Goodyear <johngood@us.ibm.com>
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>
12 # Andy Dougherty <doughera@lafayette.edu>
13 # Tim Bunce <Tim.Bunce@ig.co.uk>
15 # as well as the authors of the aix.sh file
18 # To get ANSI C, we need to use c89, and ld doesn't exist
19 # You can override this with Configure -Dcc=gcc -Dld=ld.
27 # -DMAXSIG=39 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.
32 # YYDYNAMIC ensures that the OS/390 yacc generated parser is reentrant.
33 # -DEBCDIC should come from Configure and need not be mentioned here.
34 # Prepend your favorites with Configure -Dccflags=your_favorites
35 def_os390_cflags='-qlanglvl=extended:extc89:extc99 -qlongname -qxplink -qdll -qfloat=ieee -qexportall -qhaltonmsg=3296:4108'
36 def_os390_cflags="$def_os390_cflags -Wc,XPLINK,dll,EXPORTALL -Wl,XPLINK,dll"
37 def_os390_defs='-DMAXSIG=39 -DOEMVS -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -DYYDYNAMIC -D_POSIX_SOURCE=1'
39 '') ccflags="$def_os390_cflags $def_os390_defs" ;;
40 *) ccflags="$ccflags $def_os390_cflags $def_os390_defs" ;;
43 # Turning on optimization breaks perl.
44 # You can override this with Configure -Doptimize='-O' or somesuch.
49 # To link via definition side decks we need the dll option
50 # You can override this with Configure -Ucccdlflags or somesuch.
52 '') cccdlflags='-qxplink -qdll -qexportall -Wc,XPLINK,dll,EXPORTALL -Wl,XPLINK,dll' ;;
63 case "$usemymalloc" in
64 '') usemymalloc='n' ;;
67 # On OS/390, libc.a doesn't really hold anything at all,
68 # so running nm on it is pretty useless.
69 # You can override this with Configure -Dusenm.
74 # Setting ldflags='-Wl,EDIT=NO' will get rid of the symbol
75 # information at the end of the executable (=> smaller binaries).
76 # Override this option with -Dldflags='whatever else you wanted'.
78 '') ldflags='-qxplink -qdll -Wl,XPLINK,dll' ;;
82 *) ldflags="$ldflags -Wl,EDIT=NO"
85 # In order to build with dynamic be sure to specify:
87 # Do not forget to add $archlibexp/CORE to your LIBPATH.
88 # You might want to override some of this with things like:
89 # Configure -Dusedl -Ddlext=so -Ddlsrc=dl_dllload.xs.
99 '') useshrplib='true' ;;
102 '') dlsrc='dl_dllload.xs' ;;
104 # For performance use 'so' at or beyond v2.8, 'dll' for 2.7 and prior versions
105 case "`uname -v`x`uname -r`" in
106 02x0[89].*|02x1[0-9].*|[0-9][3-9]x*)
119 libperl="libperl.$so"
120 ccflags="$ccflags -D_SHR_ENVIRON -DPERL_EXTERNAL_GLOB -qexportall -qdll -qxplink"
121 cccdlflags='-c -qexportall -qxplink -qdll -Wc,XPLINK,dll,EXPORTALL -Wl,XPLINK,dll'
122 # The following will need to be modified for the installed libperl.x.
123 # The modification to Config.pm is done by the installperl script after the build and test.
124 ccdlflags="-qxplink -qdll -Wl,XPLINK,dll `pwd`/libperl.x"
125 lddlflags="-qxplink -qdll -Wl,XPLINK,dll `pwd`/libperl.x"
128 # even on static builds using LIBPATH should be OK.
129 case "$ldlibpthname" in
130 '') ldlibpthname=LIBPATH ;;
133 # The following should always be used
134 d_oldpthreads='define'
136 # Header files to include.
137 # You can override these with Configure -Ui_time -Ui_systime -Dd_pthread_atfork.
139 '') i_time='define' ;;
142 '') i_systime='define' ;;
144 case "$d_pthread_atfork" in
145 '') d_pthread_atfork='undef' ;;
147 case "$d_pthread_atfork" in
148 '') d_pthread_atfork='undef' ;;
152 # uname -m output is too specific and not appropriate here
153 # osname should come from Configure
154 # You can override this with Configure -Darchname='s390' but please don't.
156 '') archname="$osname" ;;
159 # We have our own cppstdin script. This is not a variable since
160 # Configure sees the presence of the script file.
161 # We put system header -D definitions in so that Configure
162 # can find the shmat() prototype in <sys/shm.h> and various
163 # other things. Unfortunately, cppflags occurs too late to be of
164 # value external to the script. This may need to be revisited
165 # under a compiler other than c89.
168 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
171 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
176 # Note that Makefile.SH employs a bare yacc command to generate
177 # perly.[hc], hence you may wish to:
179 # alias yacc='myyacc'
181 # Then if you would like to use myyacc and skip past the
182 # following warnings try invoking Configure like so:
184 # sh Configure -Dbyacc=yacc
186 # This trick ought to work even if your yacc is byacc.
188 if test "X$byacc" = "Xbyacc" ; then
189 if test -e /etc/yyparse.c ; then
190 : we should be OK - perhaps do a test -r?
194 Warning. You do not have a copy of yyparse.c, the default
195 yacc parser template file, in place in /etc.
197 if test -e /samples/yyparse.c ; then
200 There does appear to be a template file in /samples though.
203 cp /samples/yyparse.c /etc
205 before attempting to Configure the build of $package.
211 There does not appear to be one in /samples either.
212 If you feel you can make use of an alternate yacc-like
213 parser generator then please read the comments in the
214 hints/os390.sh file carefully.
222 # Most of the time gcvt() seems to work fine but
223 # sometimes values like 0.1, 0.2, come out as "10", "20",
224 # a trivial Perl demonstration snippet is 'print 0.1'.
225 # The -W 0,float(ieee) seems to be the switch breaking gcvt().
226 # sprintf() seems to get things right(er).
227 gconvert_preference=sprintf
229 # Configure gets these wrong for some reason.
230 d_gethostbyaddr_r='undef'
231 d_gethostbyname_r='undef'
232 d_gethostent_r='undef'
234 # The z/OS C compiler supports the attribute keyword, but in a
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:
243 # INFORMATIONAL CCN4108 ./proto.h:4534 The use of keyword '__attribute__' is non-portable.
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'
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
258 # http://www.cplusplus.com/reference/cmath/nan-function/
259 # (C++ but C99 math agrees)
260 # XXX: Configure scan for proper behavior
263 # Configures says this exists, but it doesn't work properly. See
264 # <54DCE073.4010100@khwilliamson.com>