Commit | Line | Data |
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 :-(): |
18 | emxload -m 30 sh.exe ls.exe tr.exe id.exe sed.exe # make.exe |
19 | emxload -m 30 grep.exe egrep.exe fgrep.exe cat.exe rm.exe mv.exe cp.exe |
20 | emxload -m 30 uniq.exe basename.exe sort.exe awk.exe echo.exe |
21 | |
487a7f01 |
22 | path_sep=\; |
23 | |
24 | if test -f $sh.exe; then sh=$sh.exe; fi |
25 | |
26 | startsh="#!$sh" |
cf8a192d |
27 | |
eacfb5f1 |
28 | sysman=`../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 |
29 | cc='gcc' |
30 | usrinc='/emx/include' |
eacfb5f1 |
31 | libemx="`../UU/loc . X c:/emx/lib d:/emx/lib e:/emx/lib f:/emx/lib g:/emx/lib h:/emx/lib /emx/lib`" |
32 | |
33 | if test "$libemx" = "X"; then echo "Cannot find C library!"; fi |
34 | |
26a1e0bd |
35 | libpth="$libemx/mt $libemx" |
36 | |
37 | set `emxrev -f emxlibcm` |
38 | emxcrtrev=$5 |
4633a7c4 |
39 | |
40 | so='dll' |
41 | |
42 | # Additional definitions: |
43 | |
4633a7c4 |
44 | firstmakefile='GNUmakefile' |
4633a7c4 |
45 | exe_ext='.exe' |
4633a7c4 |
46 | |
cf8a192d |
47 | # We provide it |
48 | i_dlfcn='define' |
49 | |
50 | aout_d_shrplib='undef' |
31e507d9 |
51 | aout_useshrplib='false' |
cf8a192d |
52 | aout_obj_ext='.o' |
53 | aout_lib_ext='.a' |
54 | aout_ar='ar' |
55 | aout_plibext='.a' |
cf8a192d |
56 | aout_lddlflags='-Zdll' |
26a1e0bd |
57 | if [ $emxcrtrev -ge 50 ]; then |
58 | aout_ldflags='-Zexe -Zsmall-conv' |
59 | else |
60 | aout_ldflags='-Zexe' |
61 | fi |
62 | |
63 | # To get into config.sh: |
64 | aout_ldflags="$aout_ldflags" |
65 | |
66 | aout_d_fork='define' |
72ea3524 |
67 | aout_ccflags='-DPERL_CORE -DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK' |
68 | aout_cppflags='-DPERL_CORE -DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS -DTWO_POT_OPTIMIZE -DPERL_EMERGENCY_SBRK' |
cf8a192d |
69 | aout_use_clib='c' |
70 | aout_usedl='undef' |
71 | aout_archobjs="os2.o dl_os2.o" |
72 | |
73 | # variable which have different values for aout compile |
31e507d9 |
74 | used_aout='d_shrplib useshrplib plibext lib_ext obj_ext ar plibext d_fork lddlflags ldflags ccflags use_clib usedl archobjs cppflags' |
cf8a192d |
75 | |
eacfb5f1 |
76 | if [ "$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 |
92 | else |
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 |
114 | fi |
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 |
118 | plibext="$plibext" |
31e507d9 |
119 | # plibext is not needed anymore. Just directly set $libperl. |
120 | libperl="libperl${plibext}" |
eacfb5f1 |
121 | |
122 | #libc="/emx/lib/st/c_import$lib_ext" |
26a1e0bd |
123 | libc="$libemx/mt/$use_clib$lib_ext" |
eacfb5f1 |
124 | |
125 | if test -r "$libemx/c_alias$lib_ext"; then |
126 | libnames="$libemx/c_alias$lib_ext" |
127 | fi |
4633a7c4 |
128 | # otherwise puts -lc ??? |
129 | |
9a5ea778 |
130 | # [Maybe we should just remove c from $libswanted ?] |
131 | |
4633a7c4 |
132 | libs='-lsocket -lm' |
cf8a192d |
133 | archobjs="os2$obj_ext dl_os2$obj_ext" |
4633a7c4 |
134 | |
487a7f01 |
135 | # Run files without extension with sh: |
eacfb5f1 |
136 | EXECSHELL=sh |
4633a7c4 |
137 | |
138 | cccdlflags='-Zdll' |
cf8a192d |
139 | dlsrc='dl_dlopen.xs' |
4633a7c4 |
140 | ld='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 |
147 | stdstdunder=`echo "#include <stdio.h>" | cpp | egrep -c "char +\* +_ptr"` |
4633a7c4 |
148 | d_stdstdio='define' |
149 | d_stdiobase='define' |
150 | d_stdio_ptr_lval='define' |
151 | d_stdio_cnt_lval='define' |
4633a7c4 |
152 | |
eacfb5f1 |
153 | if 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' |
160 | else |
161 | stdio_ptr='((fp)->_ptr)' |
162 | stdio_cnt='((fp)->_rcount)' |
163 | stdio_base='((fp)->_buffer)' |
164 | stdio_bufsiz='((fp)->_rcount + (fp)->_ptr - (fp)->_buffer)' |
165 | fi |
166 | |
167 | # to put into config.sh |
168 | myttyname="$myttyname" |
169 | |
170 | # To have manpages installed |
171 | nroff='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 |
176 | ln='cp' |
177 | # Will be rewritten otherwise, indented to not put in config.sh |
178 | _ln='cp' |
179 | lns='cp' |
180 | |
181 | nm_opt='-p' |
182 | |
cf8a192d |
183 | ####### We define these functions ourselves |
4633a7c4 |
184 | |
cf8a192d |
185 | d_getprior='define' |
186 | d_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 | |
199 | cp ../README.os2 ../pod/perlos2.pod |
200 | |
760ac839 |
201 | # Now install the external modules. We are in the ./hints directory. |
202 | |
203 | cd ../os2/OS2 |
204 | |
205 | if ! test -d ../../ext/OS2 ; then |
206 | mkdir ../../ext/OS2 |
207 | fi |
208 | |
209 | cp -rfu * ../../ext/OS2/ |
210 | |
211 | # Install tests: |
212 | |
213 | for 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 |
227 | done |
228 | |
229 | |
230 | # Now go back |
231 | cd ../../hints |