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 | |
cf8a192d |
17 | bin_sh=`../UU/loc sh.exe /bin c:/bin d:/bin e:/bin f:/bin g:/bin h:/bin /bin` |
18 | echo "####### Shell found at $bin_sh #############" >&4 |
760ac839 |
19 | sh="$bin_sh" |
20 | startsh="#!$bin_sh" |
cf8a192d |
21 | |
4633a7c4 |
22 | #osname="OS/2" |
eacfb5f1 |
23 | 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 |
24 | cc='gcc' |
25 | usrinc='/emx/include' |
eacfb5f1 |
26 | libemx="`../UU/loc . X c:/emx/lib d:/emx/lib e:/emx/lib f:/emx/lib g:/emx/lib h:/emx/lib /emx/lib`" |
27 | |
28 | if test "$libemx" = "X"; then echo "Cannot find C library!"; fi |
29 | |
30 | libpth="$libemx/st $libemx" |
4633a7c4 |
31 | |
32 | so='dll' |
33 | |
34 | # Additional definitions: |
35 | |
4633a7c4 |
36 | firstmakefile='GNUmakefile' |
4633a7c4 |
37 | exe_ext='.exe' |
4633a7c4 |
38 | |
cf8a192d |
39 | # We provide it |
40 | i_dlfcn='define' |
41 | |
42 | aout_d_shrplib='undef' |
43 | aout_obj_ext='.o' |
44 | aout_lib_ext='.a' |
45 | aout_ar='ar' |
46 | aout_plibext='.a' |
47 | aout_d_fork='define' |
48 | aout_lddlflags='-Zdll' |
49 | aout_ldflags='-Zexe' |
50 | aout_ccflags='-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS' |
51 | aout_cppflags='-DDOSISH -DPERL_IS_AOUT -DOS2=2 -DEMBED -I. -DPACK_MALLOC =DDEBUGGING_MSTATS' |
52 | aout_use_clib='c' |
53 | aout_usedl='undef' |
54 | aout_archobjs="os2.o dl_os2.o" |
55 | |
56 | # variable which have different values for aout compile |
57 | used_aout='d_shrplib plibext lib_ext obj_ext ar plibext d_fork lddlflags ldflags ccflags use_clib usedl archobjs cppflags' |
58 | |
eacfb5f1 |
59 | if [ "$emxaout" != "" ]; then |
cf8a192d |
60 | d_shrplib="$aout_d_shrplib" |
61 | obj_ext="$aout_obj_ext" |
62 | lib_ext="$aout_lib_ext" |
63 | ar="$aout_ar" |
64 | plibext="$aout_plibext" |
65 | d_fork="$aout_d_fork" |
66 | lddlflags="$aout_lddlflags" |
67 | ldflags="$aout_ldflags" |
68 | ccflags="$aout_ccflags" |
69 | cppflags="$aout_cppflags" |
70 | use_clib="$aout_use_clib" |
71 | usedl="$aout_usedl" |
eacfb5f1 |
72 | else |
73 | d_shrplib='define' |
74 | obj_ext='.obj' |
75 | lib_ext='.lib' |
76 | ar='emxomfar' |
77 | plibext='.lib' |
78 | d_fork='undef' |
760ac839 |
79 | lddlflags='-Zdll -Zomf -Zmt -Zcrtdll' |
4bf4dbb3 |
80 | # Recursive regmatch may eat 2.5M of stack alone. |
760ac839 |
81 | ldflags='-Zexe -Zomf -Zmt -Zcrtdll -Zstack 32000' |
82 | ccflags='-Zomf -Zmt -DDOSISH -DOS2=2 -DEMBED -I. -DPACK_MALLOC -DDEBUGGING_MSTATS' |
eacfb5f1 |
83 | use_clib='c_import' |
cf8a192d |
84 | usedl='define' |
eacfb5f1 |
85 | fi |
86 | |
87 | # To get into config.sh (should start at the beginning of line) |
9a5ea778 |
88 | # or you can put it into config.over. |
eacfb5f1 |
89 | plibext="$plibext" |
90 | |
91 | #libc="/emx/lib/st/c_import$lib_ext" |
92 | libc="$libemx/st/$use_clib$lib_ext" |
93 | |
94 | if test -r "$libemx/c_alias$lib_ext"; then |
95 | libnames="$libemx/c_alias$lib_ext" |
96 | fi |
4633a7c4 |
97 | # otherwise puts -lc ??? |
98 | |
9a5ea778 |
99 | # [Maybe we should just remove c from $libswanted ?] |
100 | |
4633a7c4 |
101 | libs='-lsocket -lm' |
cf8a192d |
102 | archobjs="os2$obj_ext dl_os2$obj_ext" |
4633a7c4 |
103 | |
104 | # Run files without extension with sh - feature of patched ksh |
9a5ea778 |
105 | # [???] |
cf8a192d |
106 | # NOHASHBANG=sh |
eacfb5f1 |
107 | # Same with newer ksh |
108 | EXECSHELL=sh |
4633a7c4 |
109 | |
110 | cccdlflags='-Zdll' |
cf8a192d |
111 | dlsrc='dl_dlopen.xs' |
4633a7c4 |
112 | ld='gcc' |
eacfb5f1 |
113 | |
114 | #cppflags='-DDOSISH -DOS2=2 -DEMBED -I.' |
4633a7c4 |
115 | |
4633a7c4 |
116 | # for speedup: (some patches to ungetc are also needed): |
117 | # Note that without this guy tests 8 and 10 of io/tell.t fail, with it 11 fails |
118 | |
eacfb5f1 |
119 | stdstdunder=`echo "#include <stdio.h>" | cpp | egrep -c "char +\* +_ptr"` |
4633a7c4 |
120 | d_stdstdio='define' |
121 | d_stdiobase='define' |
122 | d_stdio_ptr_lval='define' |
123 | d_stdio_cnt_lval='define' |
4633a7c4 |
124 | |
eacfb5f1 |
125 | if test "$stdstdunder" = 0; then |
126 | stdio_ptr='((fp)->ptr)' |
127 | stdio_cnt='((fp)->rcount)' |
128 | stdio_base='((fp)->buffer)' |
129 | stdio_bufsiz='((fp)->rcount + (fp)->ptr - (fp)->buffer)' |
130 | ccflags="$ccflags -DMYTTYNAME" |
131 | myttyname='define' |
132 | else |
133 | stdio_ptr='((fp)->_ptr)' |
134 | stdio_cnt='((fp)->_rcount)' |
135 | stdio_base='((fp)->_buffer)' |
136 | stdio_bufsiz='((fp)->_rcount + (fp)->_ptr - (fp)->_buffer)' |
137 | fi |
138 | |
139 | # to put into config.sh |
140 | myttyname="$myttyname" |
141 | |
142 | # To have manpages installed |
143 | nroff='nroff.cmd' |
144 | # above will be overwritten otherwise, indented to avoid config.sh |
145 | _nroff='nroff.cmd' |
146 | |
147 | ln='cp' |
148 | # Will be rewritten otherwise, indented to not put in config.sh |
149 | _ln='cp' |
150 | lns='cp' |
151 | |
152 | nm_opt='-p' |
153 | |
cf8a192d |
154 | ####### We define these functions ourselves |
4633a7c4 |
155 | |
cf8a192d |
156 | d_getprior='define' |
157 | d_setprior='define' |
158 | |
159 | ####### All the rest is commented |
4633a7c4 |
160 | |
4633a7c4 |
161 | # The next two are commented. pdksh handles #! |
162 | # sharpbang='extproc ' |
163 | # shsharp='false' |
164 | |
165 | # Commented: |
166 | #startsh='extproc ksh\\n#! sh' |
760ac839 |
167 | |
168 | # Now install the external modules. We are in the ./hints directory. |
169 | |
170 | cd ../os2/OS2 |
171 | |
172 | if ! test -d ../../ext/OS2 ; then |
173 | mkdir ../../ext/OS2 |
174 | fi |
175 | |
176 | cp -rfu * ../../ext/OS2/ |
177 | |
178 | # Install tests: |
179 | |
180 | for xxx in * ; do |
181 | if $test -d $xxx/t; then |
182 | cp -uf $xxx/t/*.t ../../t/lib |
183 | else |
184 | if $test -d $xxx; then |
185 | cd $xxx |
186 | for yyy in * ; do |
187 | if $test -d $yyy/t; then |
188 | cp -uf $yyy/t/*.t ../../t/lib |
189 | fi |
190 | done |
191 | cd .. |
192 | fi |
193 | fi |
194 | done |
195 | |
196 | |
197 | # Now go back |
198 | cd ../../hints |