partial support for dynaloading on OS/390
[p5sagit/p5-mst-13.2.git] / hints / os390.sh
1 # hints/os390.sh
2 #
3 # OS/390 hints by David J. Fiander <davidf@mks.com>
4 #
5 # OS/390 OpenEdition Release 3 Mon Sep 22 1997 thanks to:
6
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@lafcol.lafayette.edu>
13 #     Tim Bunce  <Tim.Bunce@ig.co.uk>
14 #
15 #  as well as the authors of the aix.sh file
16 #
17
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.
20 case "$cc" in
21 '') cc='c89' ;;
22 esac
23 case "$ld" in
24 '') ld='c89' ;;
25 esac
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.
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 case "$ccflags" in
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" ;;
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
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
49 '') cccdlflags='-W 0,dll' ;;
50 esac
51
52 case "$so" in
53 '') so='a' ;;
54 esac
55
56 case "$alignbytes" in
57 '') alignbytes=8 ;;
58 esac
59
60 case "$usemymalloc" in
61 '') usemymalloc='n' ;;
62 esac
63
64 # On OS/390, libc.a doesn't really hold anything at all,
65 # so running nm on it is pretty useless.
66 # You can override this with Configure -Dusenm.
67 case "$usenm" in
68 '') usenm='false' ;;
69 esac
70
71 # Dynamic loading doesn't work on OS/390 quite yet.
72 # However the easiest way to experiment with dynamic loading is with:
73 #  Configure -Dusedl
74 # You can even override some of this with things like:
75 #  Configure -Dusedl -Ddlext=so -Ddlsrc=dl_dllload.xs.
76 case "$usedl" in
77 '')
78     usedl='n' 
79     case "$dlext" in
80     '') dlext='none' ;;
81     esac
82     ;;
83 define)
84     case "$useshrplib" in
85     '') useshrplib='true' ;;
86     esac
87     case "$dlext" in
88     '') dlext='dll' ;;
89     esac
90     case "$dlsrc" in
91     '') dlsrc='dl_dllload.xs' ;;
92     esac
93     so='dll'
94     libperl='libperl.dll'
95     ccflags="$ccflags -D_SHR_ENVIRON -DPERL_EXTERNAL_GLOB -Wc,dll"
96     cccdlflags='-c -Wc,dll,EXPORTALL'
97     # You might add '-Wl,EDIT=NO' to get rid of the symbol
98     # information at the end of the executable.
99     #
100     # The following will need to be modified for the installed libperl.x
101     ccdlflags="-W l,dll `pwd`/libperl.x"
102     ldflags=''
103     lddlflags='-W l,dll'
104     ;;
105 esac
106 # even on static builds using LIBPATH should be OK.
107 case "$ldlibpthname" in
108 '') ldlibpthname=LIBPATH ;;
109 esac
110
111 # Header files to include.
112 # You can override these with Configure -Ui_time -Ui_systime.
113 case "$i_time" in
114 '') i_time='define' ;;
115 esac
116 case "$i_systime" in
117 '') i_systime='define' ;;
118 esac
119
120 # (from aix.sh)
121 # uname -m output is too specific and not appropriate here
122 # osname should come from Configure
123 # You can override this with Configure -Darchname='s390' but please don't.
124 case "$archname" in
125 '') archname="$osname" ;;
126 esac
127
128 # Architecture related object files.
129 # ebcdic.c contains special \cX mapping code for EBCDIC char sets.
130 # Prepend your preference with Configure -Darchobs=your_preference.o.
131 case "$archname" in
132 '') archobjs="ebcdic.o" ;;
133 *) archobjs="$archobjs ebcdic.o" ;;
134 esac
135
136 # We have our own cppstdin script.  This is not a variable since 
137 # Configure sees the presence of the script file.
138 # We put system header -D definitions in so that Configure
139 # can find the shmat() prototype in <sys/shm.h> and various
140 # other things.  Unfortunately, cppflags occurs too late to be of 
141 # value external to the script.  This may need to be revisited 
142 # under a compiler other than c89.
143 echo 'cat >.$$.c; '"$cc"' -D_OE_SOCKETS -D_XOPEN_SOURCE_EXTENDED -D_ALL_SOURCE -E -Wc,NOLOC ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
144
145 #
146 # Note that Makefile.SH employs a bare yacc command to generate 
147 # perly.[hc] and a2p.[hc], hence you may wish to:
148 #
149 #    alias yacc='myyacc'
150 #
151 # Then if you would like to use myyacc and skip past the
152 # following warnings try invoking Configure like so: 
153 #
154 #    sh Configure -Dbyacc=yacc
155 #
156 # This trick ought to work even if your yacc is byacc.
157 #
158 if test "X$byacc" = "Xbyacc" ; then
159     if test -e /etc/yyparse.c ; then
160         : we should be OK - perhaps do a test -r?
161     else
162         cat <<EOWARN >&4
163
164 Warning.  You do not have a copy of yyparse.c, the default 
165 yacc parser template file, in place in /etc.
166 EOWARN
167         if test -e /samples/yyparse.c ; then
168             cat <<EOWARN >&4
169
170 There does appear to be a template file in /samples though.
171 Please run:
172
173       cp /samples/yyparse.c /etc
174
175 before attempting to Configure the build of $package.
176
177 EOWARN
178         else
179             cat <<EOWARN >&4
180
181 There does not appear to be one in /samples either.  
182 If you feel you can make use of an alternate yacc-like 
183 parser generator then please read the comments in the
184 hints/os390.sh file carefully.
185
186 EOWARN
187         fi
188         exit 1
189     fi
190 fi
191