4 # BS2000 (Posix Subsystem) hints by Thomas Dorner <Thomas.Dorner@start.de>
6 # Thanks to the authors of the os390.sh for the very first draft.
8 # You can modify almost any parameter set here using Configure with
9 # the appropriate -D option.
11 # remove this line if dynamic libraries are working for you:
14 # To get ANSI C, we need to use c89
15 # You can override this with Configure -Dcc=gcc
16 # (if you ever get a gcc ported to BS2000 ;-).
24 # -D_XOPEN_SOURCE_EXTENDED alters system headers.
25 # Prepend your favorites with Configure -Dccflags=your_favorites
26 ccflags="$ccflags -Kc_names_unlimited,enum_long,llm_case_lower,llm_keep,no_integer_overflow -DPOSIX_BC -DUSE_PURE_BISON -D_XOPEN_SOURCE_EXTENDED"
28 # Now, what kind of BS2000 system are we running on?
30 if [ -n "`bs2cmd SHOW-SYSTEM-INFO | egrep 'HSI-ATT.*TYPE.*SR'`" ]; then
31 echo "You are running a BS2000 machine with Sunrise CPUs."
32 echo "Let's hope you have the matching RISC compiler as well."
33 ccflags="-K risc_4000 $ccflags"
34 bs2000_ldflags='-K risc_4000'
36 echo "Seems like a standard 390 BS2000 machine to me."
40 if [ -z "$bs2000_ignoredl" -a -e /usr/lib/libdl.a ]; then
41 echo "Wow, your BS2000 is State Of The Art and seems to support dynamic libraries."
42 echo "I just can't resist giving them a try."
43 bs2000_lddlflags='-Bsymbolic -Bdynamic'
44 # dynamic linkage of system libraries gave us runtime linker
45 # errors, so we use static linkage while generating our DLLs :-(
46 # bs2000_lddlflags='-Bstatic'
50 case $bs2000_ldflags in
52 bs2000_ld="perl_genso"
54 Now you must buy everything they sell you, musn't you?
55 Didn't somebody tell you that RISC machines and dynamic library support gives
56 you helluva lot of configuration problems at the moment?
57 Sigh. Now you'll expect me to fix it for you, eh?
58 OK, OK, I'll give you a wrapper.
59 Just copy $bs2000_ld anywhere into your path before you try to install
62 cat > $bs2000_ld <<EOF
65 # Perl's wrapper for genso by Thomas.Dorner@start.de
70 while [[ \$# -gt 0 ]]; do
79 options="\$options -L\${1%/lib*.a} -l\${lib%.a}"
85 options="\$options \$1"
89 echo \$GENSO \$options \$params
90 exec \$GENSO \$options \$params
94 if [[ -w /usr/local/bin && ! -f /usr/local/bin/$bs2000_ld ]]; then
95 cp -p $bs2000_ld /usr/local/bin/$bs2000_ld
96 echo "(Actually I just did that as well, have a look into /usr/local/bin.)"
103 if [ -e /usr/lib/libdl.a ]; then
104 echo "Your BS2000 supports dynamic libraries, but you (or we ;-) decided to leave them alone."
106 echo "Your BS2000 does'n support dynamic libraries so we're just staying static."
119 # ccdlflags have yet to be determined.
120 #case "$ccdlflags" in
121 #'') ccdlflags='-c' ;;
124 # cccdlflags have yet to be determined.
125 #case "$cccdlflags" in
126 #'') cccdlflags='' ;;
130 '') ldflags=$bs2000_ldflags ;;
134 '') lddlflags=$bs2000_lddlflags ;;
137 # Turning on optimization breaks perl (CORE-DUMP):
138 # You can override this with Configure -Doptimize='-O' or somesuch.
140 '') optimize='none' ;;
143 # BS2000 doesn't use dynamic memory on its own (yet):
148 case "$usemymalloc" in
149 '') usemymalloc='n' ;;
152 # On BS2000/Posix, libc.a does not really hold anything at all,
153 # so running nm on it is pretty useless.
154 # You can override this with Configure -Dusenm.
159 # Configure -Dusedl -Ddlext=.so -Ddlsrc=dl_dllload.xs.
161 '') usedl=$bs2000_usedl ;;
164 '') dlext=$bs2000_dlext ;;
169 #case "$ldlibpthname" in
170 #'') ldlibpthname=LIBPATH ;;