5.003_08: OS/2-specific bugs/enhancements
[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
26a1e0bd 35libpth="$libemx/mt $libemx"
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
4633a7c4 132libs='-lsocket -lm'
cf8a192d 133archobjs="os2$obj_ext dl_os2$obj_ext"
4633a7c4 134
487a7f01 135# Run files without extension with sh:
eacfb5f1 136EXECSHELL=sh
4633a7c4 137
138cccdlflags='-Zdll'
cf8a192d 139dlsrc='dl_dlopen.xs'
4633a7c4 140ld='gcc'
eacfb5f1 141
142#cppflags='-DDOSISH -DOS2=2 -DEMBED -I.'
4633a7c4 143
4633a7c4 144# for speedup: (some patches to ungetc are also needed):
145# Note that without this guy tests 8 and 10 of io/tell.t fail, with it 11 fails
146
eacfb5f1 147stdstdunder=`echo "#include <stdio.h>" | cpp | egrep -c "char +\* +_ptr"`
4633a7c4 148d_stdstdio='define'
149d_stdiobase='define'
150d_stdio_ptr_lval='define'
151d_stdio_cnt_lval='define'
4633a7c4 152
eacfb5f1 153if test "$stdstdunder" = 0; then
154 stdio_ptr='((fp)->ptr)'
155 stdio_cnt='((fp)->rcount)'
156 stdio_base='((fp)->buffer)'
157 stdio_bufsiz='((fp)->rcount + (fp)->ptr - (fp)->buffer)'
158 ccflags="$ccflags -DMYTTYNAME"
159 myttyname='define'
160else
161 stdio_ptr='((fp)->_ptr)'
162 stdio_cnt='((fp)->_rcount)'
163 stdio_base='((fp)->_buffer)'
164 stdio_bufsiz='((fp)->_rcount + (fp)->_ptr - (fp)->_buffer)'
165fi
166
167# to put into config.sh
168myttyname="$myttyname"
169
170# To have manpages installed
171nroff='nroff.cmd'
172# above will be overwritten otherwise, indented to avoid config.sh
173 _nroff='nroff.cmd'
174
31e507d9 175# should be handled automatically by Configure now.
eacfb5f1 176ln='cp'
177# Will be rewritten otherwise, indented to not put in config.sh
178 _ln='cp'
179lns='cp'
180
181nm_opt='-p'
182
cf8a192d 183####### We define these functions ourselves
4633a7c4 184
cf8a192d 185d_getprior='define'
186d_setprior='define'
187
188####### All the rest is commented
4633a7c4 189
4633a7c4 190# The next two are commented. pdksh handles #!
191# sharpbang='extproc '
192# shsharp='false'
193
194# Commented:
195#startsh='extproc ksh\\n#! sh'
760ac839 196
26a1e0bd 197# Copy pod:
198
199cp ../README.os2 ../pod/perlos2.pod
200
760ac839 201# Now install the external modules. We are in the ./hints directory.
202
203cd ../os2/OS2
204
205if ! test -d ../../ext/OS2 ; then
206 mkdir ../../ext/OS2
207fi
208
209cp -rfu * ../../ext/OS2/
210
211# Install tests:
212
213for xxx in * ; do
214 if $test -d $xxx/t; then
215 cp -uf $xxx/t/*.t ../../t/lib
216 else
217 if $test -d $xxx; then
218 cd $xxx
219 for yyy in * ; do
220 if $test -d $yyy/t; then
221 cp -uf $yyy/t/*.t ../../t/lib
222 fi
223 done
224 cd ..
225 fi
226 fi
227done
228
229
230# Now go back
231cd ../../hints