This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use sv_catpvn instead of sv_catsv in doop.c:do_join
[perl5.git] / hints / posix-bc.sh
CommitLineData
84891885 1:
a1a0e61e
TD
2# hints/posix-bc.sh
3#
4# BS2000 (Posix Subsystem) hints by Thomas Dorner <Thomas.Dorner@start.de>
5#
84891885 6# Thanks to the authors of the os390.sh for the very first draft.
a1a0e61e 7#
84891885
JH
8# You can modify almost any parameter set here using Configure with
9# the appropriate -D option.
a1a0e61e 10
84891885 11# remove this line if dynamic libraries are working for you:
c8c28942 12 bs2000_ignoredl='y'
84891885
JH
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 ;-).
a7a44c04
IRC
17case "$cc" in
18'') cc='c89' ;;
19esac
a1a0e61e
TD
20
21# C-Flags:
a7a44c04
IRC
22# -DPOSIX_BC
23# -DUSE_PURE_BISON
24# -D_XOPEN_SOURCE_EXTENDED alters system headers.
25# Prepend your favorites with Configure -Dccflags=your_favorites
1a6a79b7 26ccflags="$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"
84891885
JH
27
28# Now, what kind of BS2000 system are we running on?
29echo
30if [ -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'
35else
36 echo "Seems like a standard 390 BS2000 machine to me."
37 bs2000_ldflags=''
38fi
39echo
40if [ -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 "
dca46f05 54Now you must buy everything they sell you, mustn't you?
84891885
JH
55Didn't somebody tell you that RISC machines and dynamic library support gives
56you helluva lot of configuration problems at the moment?
57Sigh. Now you'll expect me to fix it for you, eh?
58OK, OK, I'll give you a wrapper.
59Just copy $bs2000_ld anywhere into your path before you try to install
60additional modules!"
61
62cat > $bs2000_ld <<EOF
63#! /bin/sh
64#
65# Perl's wrapper for genso by Thomas.Dorner@start.de
66
c8c28942
JH
67 GENSO=/usr/bin/genso
68 options=""
69 params=""
84891885
JH
70while [[ \$# -gt 0 ]]; do
71 case \$1 in
72 -K)
73 shift
74 ;;
75 -K*)
76 ;;
77 *.a)
78 lib=\${1##*/lib}
79 options="\$options -L\${1%/lib*.a} -l\${lib%.a}"
80 ;;
81 *.o)
82 params="\$params \$1"
83 ;;
84 *)
85 options="\$options \$1"
86 esac
87 shift
88done
89echo \$GENSO \$options \$params
90exec \$GENSO \$options \$params
91EOF
92
93 chmod +x $bs2000_ld
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.)"
97 fi
98 ;;
99 *)
100 bs2000_ld='genso'
101 esac
102else
103 if [ -e /usr/lib/libdl.a ]; then
104 echo "Your BS2000 supports dynamic libraries, but you (or we ;-) decided to leave them alone."
105 else
106 echo "Your BS2000 does'n support dynamic libraries so we're just staying static."
107 fi
108 bs2000_ld='c89'
109 bs2000_lddlflags=''
110 bs2000_so='none'
111 bs2000_usedl='n'
112 bs2000_dlext='none'
113fi
114
115case "$ld" in
116'') ld=$bs2000_ld ;;
117esac
a7a44c04
IRC
118
119# ccdlflags have yet to be determined.
120#case "$ccdlflags" in
121#'') ccdlflags='-c' ;;
122#esac
123
124# cccdlflags have yet to be determined.
125#case "$cccdlflags" in
126#'') cccdlflags='' ;;
127#esac
128
84891885
JH
129case "$ldflags" in
130'') ldflags=$bs2000_ldflags ;;
131esac
a1a0e61e 132
84891885
JH
133case "$lddlflags" in
134'') lddlflags=$bs2000_lddlflags ;;
135esac
4113c5bc 136
a1a0e61e 137# Turning on optimization breaks perl (CORE-DUMP):
a7a44c04
IRC
138# You can override this with Configure -Doptimize='-O' or somesuch.
139case "$optimize" in
140'') optimize='none' ;;
141esac
a1a0e61e 142
84891885 143# BS2000 doesn't use dynamic memory on its own (yet):
a7a44c04 144case "$so" in
84891885 145'') so=$bs2000_so ;;
a7a44c04
IRC
146esac
147
148case "$usemymalloc" in
149'') usemymalloc='n' ;;
150esac
a1a0e61e 151
c8e8bf6a 152# On BS2000/Posix, libc.a does not really hold anything at all,
a1a0e61e 153# so running nm on it is pretty useless.
a7a44c04
IRC
154# You can override this with Configure -Dusenm.
155case "$usenm" in
156'') usenm='false' ;;
157esac
a1a0e61e 158
a7a44c04
IRC
159# Configure -Dusedl -Ddlext=.so -Ddlsrc=dl_dllload.xs.
160case "$usedl" in
84891885 161'') usedl=$bs2000_usedl ;;
a7a44c04
IRC
162esac
163case "$dlext" in
84891885 164'') dlext=$bs2000_dlext ;;
a7a44c04
IRC
165esac
166#case "$dlsrc" in
167#'') dlsrc='none' ;;
168#esac
169#case "$ldlibpthname" in
170#'') ldlibpthname=LIBPATH ;;
171#esac