| 1 | :
|
|---|
| 2 | # hints/posix-bc.sh
|
|---|
| 3 | #
|
|---|
| 4 | # BS2000 (Posix Subsystem) hints by Thomas Dorner <[email protected]>
|
|---|
| 5 | #
|
|---|
| 6 | # Thanks to the authors of the os390.sh for the very first draft.
|
|---|
| 7 | #
|
|---|
| 8 | # You can modify almost any parameter set here using Configure with
|
|---|
| 9 | # the appropriate -D option.
|
|---|
| 10 |
|
|---|
| 11 | # remove this line if dynamic libraries are working for you:
|
|---|
| 12 | bs2000_ignoredl='y'
|
|---|
| 13 |
|
|---|
| 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 ;-).
|
|---|
| 17 | case "$cc" in
|
|---|
| 18 | '') cc='c89' ;;
|
|---|
| 19 | esac
|
|---|
| 20 |
|
|---|
| 21 | # C-Flags:
|
|---|
| 22 | # -DPOSIX_BC
|
|---|
| 23 | # -DUSE_PURE_BISON
|
|---|
| 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 -DYYMAXDEPTH=65000 -DYYINITDEPTH=1000 -D_XOPEN_SOURCE_EXTENDED"
|
|---|
| 27 |
|
|---|
| 28 | # Now, what kind of BS2000 system are we running on?
|
|---|
| 29 | echo
|
|---|
| 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'
|
|---|
| 35 | else
|
|---|
| 36 | echo "Seems like a standard 390 BS2000 machine to me."
|
|---|
| 37 | bs2000_ldflags=''
|
|---|
| 38 | fi
|
|---|
| 39 | echo
|
|---|
| 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'
|
|---|
| 47 | bs2000_so='none'
|
|---|
| 48 | bs2000_usedl='define'
|
|---|
| 49 | bs2000_dlext='so'
|
|---|
| 50 | case $bs2000_ldflags in
|
|---|
| 51 | *risc_4000*)
|
|---|
| 52 | bs2000_ld="perl_genso"
|
|---|
| 53 | echo "
|
|---|
| 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
|
|---|
| 60 | additional modules!"
|
|---|
| 61 |
|
|---|
| 62 | cat > $bs2000_ld <<EOF
|
|---|
| 63 | #! /bin/sh
|
|---|
| 64 | #
|
|---|
| 65 | # Perl's wrapper for genso by [email protected]
|
|---|
| 66 |
|
|---|
| 67 | GENSO=/usr/bin/genso
|
|---|
| 68 | options=""
|
|---|
| 69 | params=""
|
|---|
| 70 | while [[ \$# -gt 0 ]]; do
|
|---|
| 71 | case \$1 in
|
|---|
| 72 | -K)
|
|---|
| 73 | shift
|
|---|
| 74 | ;;
|
|---|
| 75 | -K*)
|
|---|
| 76 | ;;
|
|---|
| 77 | *.a)
|
|---|
| 78 | lib=\${1##*/lib}
|
|---|
|
|---|