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