[dummy merge]
[p5sagit/p5-mst-13.2.git] / hints / os2.sh
CommitLineData
cf8a192d 1#! /bin/sh
9a5ea778 2# hints/os2.sh
3# This file reflects the tireless work of
4# Ilya Zakharevich <ilya@math.ohio-state.edu>
5#
6# Trimmed and comments added by
7# Andy Dougherty <doughera@lafcol.lafayette.edu>
8# Exactly what is required beyond a standard OS/2 installation?
cf8a192d 9# There are notes about "patched pdksh" I do not understand.
4633a7c4 10
eacfb5f1 11# Note that symbol extraction code gives wrong answers (sometimes?) on
12# gethostent and setsid.
4633a7c4 13
14# Note that during the .obj compile you need to move the perl.dll file
15# to LIBPATH :-(
16
26a1e0bd 17# Optimization (GNU make 3.74 cannot be loaded :-():
18emxload -m 30 sh.exe ls.exe tr.exe id.exe sed.exe # make.exe
19emxload -m 30 grep.exe egrep.exe fgrep.exe cat.exe rm.exe mv.exe cp.exe
20emxload -m 30 uniq.exe basename.exe sort.exe awk.exe echo.exe
21
487a7f01 22path_sep=\;
23
24if test -f $sh.exe; then sh=$sh.exe; fi
25
26startsh="#!$sh"
cf8a192d 27
eacfb5f1 28sysman=`../UU/loc . /man/man1 c:/man/man1 c:/usr/man/man1 d:/man/man1 d:/usr/man/man1 e:/man/man1 e:/usr/man/man1 f:/man/man1 f:/usr/man/man1 g:/man/man1 g:/usr/man/man1 /usr/man/man1`
4633a7c4 29cc='gcc'
30usrinc='/emx/include'
eacfb5f1 31libemx="`../UU/loc . X c:/emx/lib d:/emx/lib e:/emx/lib f:/emx/lib g:/emx/lib h:/emx/lib /emx/lib`"
32
33if test "$libemx" = "X"; then echo "Cannot find C library!"; fi
34
385588b3 35libpth="$libemx/mt $libemx"
26a1e0bd 36
37set `emxrev -f emxlibcm`
38emxcrtrev=$5
4633a7c4 39
40so='dll'
41
42# Additional definitions:
43
4633a7c4 44firstmakefile='GNUmakefile'
4633a7c4 45exe_ext='.exe'
4633a7c4 46
cf8a192d 47# We provide it
48i_dlfcn='define'
49
50aout_d_shrplib='undef'
31e507d9 51aout_useshrplib='false'
cf8a192d 52aout_obj_ext='.o'
53aout_lib_ext='.a'
54aout_ar='ar'
55aout_plibext='.a'
cf8a192d 56aout_lddlflags='-Zdll'
26a1e0bd 57if [ $emxcrtrev -ge 50 ]; then
58 aout_ldflags='-Zexe -Zsmall-conv'
59else
60 aout_ldflags='-Zexe'
61fi
62
63# To get into config.sh:
64aout_ldflags="$aout_ldflags"
65
66aout_d_fork='define'
72ea3524 67aout_ccflags='-DPERL_CORE -DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK'
68aout_cppflags='-DPERL_CORE -DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK'
cf8a192d 69aout_use_clib='c'
70aout_usedl='undef'
71aout_archobjs="os2.o dl_os2.o"
72
73# variable which have different values for aout compile
31e507d9 74used_aout='d_shrplib useshrplib plibext lib_ext obj_ext ar plibext d_fork lddlflags ldflags ccflags use_clib usedl archobjs cppflags'
cf8a192d 75
eacfb5f1 76if [ "$emxaout" != "" ]; then
cf8a192d 77 d_shrplib="$aout_d_shrplib"
31e507d9 78 useshrplib="$aout_useshrplib"
cf8a192d 79 obj_ext="$aout_obj_ext"
80 lib_ext="$aout_lib_ext"
81 ar="$aout_ar"
82 plibext="$aout_plibext"
26a1e0bd 83 if [ $emxcrtrev -lt 50 ]; then
84 d_fork="$aout_d_fork"
85 fi
cf8a192d 86 lddlflags="$aout_lddlflags"
87 ldflags="$aout_ldflags"
88 ccflags="$aout_ccflags"
89 cppflags="$aout_cppflags"
90 use_clib="$aout_use_clib"
91 usedl="$aout_usedl"
eacfb5f1 92else
93 d_shrplib='define'
31e507d9 94 useshrplib='true'
eacfb5f1 95 obj_ext='.obj'
96 lib_ext='.lib'
97 ar='emxomfar'
98 plibext='.lib'
26a1e0bd 99 if [ $emxcrtrev -ge 50 ]; then
100 d_fork='define'
101 else
102 d_fork='undef'
103 fi
760ac839 104 lddlflags='-Zdll -Zomf -Zmt -Zcrtdll'
4bf4dbb3 105 # Recursive regmatch may eat 2.5M of stack alone.
760ac839 106 ldflags='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000'
26a1e0bd 107 if [ $emxcrtrev -ge 50 ]; then
72ea3524 108 ccflags='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK'
26a1e0bd 109 else
110 ccflags='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DEMX_BAD_SBRK'
111 fi
eacfb5f1 112 use_clib='c_import'
cf8a192d 113 usedl='define'
eacfb5f1 114fi
115
116# To get into config.sh (should start at the beginning of line)
9a5ea778 117# or you can put it into config.over.
eacfb5f1 118plibext="$plibext"
31e507d9 119# plibext is not needed anymore. Just directly set $libperl.
120libperl="libperl${plibext}"
eacfb5f1 121
122#libc="/emx/lib/st/c_import$lib_ext"
26a1e0bd 123libc="$libemx/mt/$use_clib$lib_ext"
eacfb5f1 124
125if test -r "$libemx/c_alias$lib_ext"; then
126 libnames="$libemx/c_alias$lib_ext"
127fi
4633a7c4 128# otherwise puts -lc ???
129
9a5ea778 130# [Maybe we should just remove c from $libswanted ?]
131
44a8e56a 132# Test would pick up wrong rand, so we hardwire the value for random()
133libs='-lsocket -lm -lbsd'
134randbits=31
cf8a192d 135archobjs="os2$obj_ext dl_os2$obj_ext"
4633a7c4 136
487a7f01 137# Run files without extension with sh:
eacfb5f1 138EXECSHELL=sh
4633a7c4 139
140cccdlflags='-Zdll'
cf8a192d 141dlsrc='dl_dlopen.xs'
4633a7c4 142ld='gcc'
eacfb5f1 143
144#cppflags='-DDOSISH -DOS2=2 -DEMBED -I.'
4633a7c4 145
4633a7c4 146# for speedup: (some patches to ungetc are also needed):
147# Note that without this guy tests 8 and 10 of io/tell.t fail, with it 11 fails
148
eacfb5f1 149stdstdunder=`echo "#include <stdio.h>" | cpp | egrep -c "char +\* +_ptr"`
4633a7c4 150d_stdstdio='define'
151d_stdiobase='define'
152d_stdio_ptr_lval='define'
153d_stdio_cnt_lval='define'
4633a7c4 154
eacfb5f1 155if test "$stdstdunder" = 0; then
156 stdio_ptr='((fp)->ptr)'
157 stdio_cnt='((fp)->rcount)'
158 stdio_base='((fp)->buffer)'
159 stdio_bufsiz='((fp)->rcount + (fp)->ptr - (fp)->buffer)'
160 ccflags="$ccflags -DMYTTYNAME"
161 myttyname='define'
162else
163 stdio_ptr='((fp)->_ptr)'
164 stdio_cnt='((fp)->_rcount)'
165 stdio_base='((fp)->_buffer)'
166 stdio_bufsiz='((fp)->_rcount + (fp)->_ptr - (fp)->_buffer)'
167fi
168
169# to put into config.sh
170myttyname="$myttyname"
171
172# To have manpages installed
173nroff='nroff.cmd'
174# above will be overwritten otherwise, indented to avoid config.sh
175 _nroff='nroff.cmd'
176
31e507d9 177# should be handled automatically by Configure now.
eacfb5f1 178ln='cp'
179# Will be rewritten otherwise, indented to not put in config.sh
180 _ln='cp'
181lns='cp'
182
183nm_opt='-p'
184
cf8a192d 185####### We define these functions ourselves
4633a7c4 186
cf8a192d 187d_getprior='define'
188d_setprior='define'
189
190####### All the rest is commented
4633a7c4 191
4633a7c4 192# The next two are commented. pdksh handles #!
193# sharpbang='extproc '
194# shsharp='false'
195
196# Commented:
197#startsh='extproc ksh\\n#! sh'
760ac839 198
26a1e0bd 199# Copy pod:
200
201cp ../README.os2 ../pod/perlos2.pod
202
760ac839 203# Now install the external modules. We are in the ./hints directory.
204
205cd ../os2/OS2
206
207if ! test -d ../../ext/OS2 ; then
208 mkdir ../../ext/OS2
209fi
210
211cp -rfu * ../../ext/OS2/
212
213# Install tests:
214
215for xxx in * ; do
216 if $test -d $xxx/t; then
217 cp -uf $xxx/t/*.t ../../t/lib
218 else
219 if $test -d $xxx; then
220 cd $xxx
221 for yyy in * ; do
222 if $test -d $yyy/t; then
223 cp -uf $yyy/t/*.t ../../t/lib
224 fi
225 done
226 cd ..
227 fi
228 fi
229done
230
231
232# Now go back
233cd ../../hints