-
Notifications
You must be signed in to change notification settings - Fork 8
/
configure.in
224 lines (196 loc) · 9.92 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT(doslib2, 2.0, jonathan@impactstudiopro.com)
AM_INIT_AUTOMAKE(doslib2,2.0)
AC_CONFIG_SRCDIR([cleantree])
AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
AC_PREFIX_DEFAULT(/usr)
AC_PROG_LIBTOOL
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
# We need Perl
AC_CHECK_PROGS(PERL,$PERL perl,error)
if test x"$PERL" = x"error"; then
AC_MSG_ERROR([Perl is required to build this source code])
fi
# We need NASM
AC_CHECK_PROGS(NASM,$NASM nasm,error)
if test x"$NASM" = x"error"; then
AC_MSG_ERROR([NASM (Netwide assembler) is required to build this source code])
fi
# we need to find the Open Watcom installation
# TODO: Can we also allow the user to install WINE and Windows binaries of Open Watcom?
if test x"$OPENWATCOM" = x; then if [[ -d "$HOME/src/open-watcom-2.0/rel2" ]]; then OPENWATCOM="$HOME/src/open-watcom-2.0/rel2"; fi; fi
if test x"$OPENWATCOM" = x; then if [[ -d "$HOME/src/open-watcom-v2/rel" ]]; then OPENWATCOM="$HOME/src/open-watcom-v2/rel"; fi; fi
if test x"$OPENWATCOM" = x; then if [[ -d "/usr/src/open-watcom-v2/rel" ]]; then OPENWATCOM="/usr/src/open-watcom-v2/rel"; fi; fi
if test x"$OPENWATCOM" = x; then if [[ -d /usr/src/openwatcom-2.0/rel2 ]]; then OPENWATCOM=/usr/src/openwatcom-2.0/rel2; fi; fi
if test x"$OPENWATCOM" = x; then if [[ -d /usr/src/openwatcom-1.9/rel2 ]]; then OPENWATCOM=/usr/src/openwatcom-1.9/rel2; fi; fi
if test x"$OPENWATCOM" = x; then if [[ -d /usr/watcom-2.0 ]]; then OPENWATCOM=/usr/watcom-2.0; fi; fi
if test x"$OPENWATCOM" = x; then if [[ -d /usr/watcom-1.9 ]]; then OPENWATCOM=/usr/watcom-1.9; fi; fi
if test x"$OPENWATCOM" = x; then if [[ -d /usr/watcom-1.8 ]]; then OPENWATCOM=/usr/watcom-1.8; fi; fi
if test x"$OPENWATCOM" = x; then if [[ -d /usr/watcom ]]; then OPENWATCOM=/usr/watcom; fi; fi
if test x"$OPENWATCOM" = x; then
AC_MSG_ERROR([Open Watcom is required to build this source code])
fi
# We need Watcom C (16-bit)
AC_CHECK_PROGS(OWCC,$OWCC $OPENWATCOM/binl/wcc,error,[$PATH /])
if test x"$OWCC" = x"error"; then
AC_MSG_ERROR([Open Watcom C compiler wcc is required to build this source code])
fi
# We need Watcom C (32-bit)
AC_CHECK_PROGS(OWCC386,$OWCC386 $OPENWATCOM/binl/wcc386,error,[$PATH /])
if test x"$OWCC386" = x"error"; then
AC_MSG_ERROR([Open Watcom C compiler wcc386 is required to build this source code])
fi
# We need Watcom C strip utility
AC_CHECK_PROGS(OWSTRIP,$OWSTRIP $OPENWATCOM/binl/wstrip,error,[$PATH /])
if test x"$OWSTRIP" = x"error"; then
AC_MSG_ERROR([Open Watcom wstrip is required to build this source code])
fi
# We need Watcom C resource compiler
AC_CHECK_PROGS(OWRC,$OWRC $OPENWATCOM/binl/wrc,error,[$PATH /])
if test x"$OWRC" = x"error"; then
AC_MSG_ERROR([Open Watcom resource compiler (wrc) is required to build this source code])
fi
# We need Watcom C bind utility (for Win386 builds)
AC_CHECK_PROGS(OWBIND,$OWBIND $OPENWATCOM/binl/wbind,error,[$PATH /])
if test x"$OWBIND" = x"error"; then
AC_MSG_ERROR([Open Watcom win386 bind utility (wbind) is required to build this source code])
fi
# We need Watcom C lib utility
AC_CHECK_PROGS(OWLIB,$OWLIB $OPENWATCOM/binl/wlib,error,[$PATH /])
if test x"$OWLIB" = x"error"; then
AC_MSG_ERROR([Open Watcom wlib is required to build this source code])
fi
# We need Watcom C linker
AC_CHECK_PROGS(OWLINK,$OWLINK $OPENWATCOM/binl/wlink,error,[$PATH /])
if test x"$OWLINK" = x"error"; then
AC_MSG_ERROR([Open Watcom wlink is required to build this source code])
fi
# We need Watcom C linker
AC_CHECK_PROGS(OWCL,$OWCL $OPENWATCOM/binl/wcl,error,[$PATH /])
if test x"$OWCL" = x"error"; then
AC_MSG_ERROR([Open Watcom wcl is required to build this source code])
fi
# We need Watcom C linker
AC_CHECK_PROGS(OWCL386,$OWCL386 $OPENWATCOM/binl/wcl386,error,[$PATH /])
if test x"$OWCL386" = x"error"; then
AC_MSG_ERROR([Open Watcom wcl386 is required to build this source code])
fi
# define Watcom environment block
WATENV="\"PATH=$OPENWATCOM/binl:$OPENWATCOM/binw:$PATH\" \"WATCOM=$OPENWATCOM\" \"EDPATH=$OPENWATCOM/eddat\""
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdint.h stdlib.h string.h sys/socket.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT64_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_CHECK_FUNCS([memset])
LT_INIT
LIBS=-lm
m4_define([ISP_AUTO_OPTION_ENABLED_DEF],[
AC_ARG_ENABLE([$1],AC_HELP_STRING([--][$5][-][$1],[$5 $3]))
if test x"$enable_$2" = x
then
enable_$2=$4
fi
if test x"$enable_$2" = xyes
then
AC_DEFINE([ENABLE_][$2],[1],[$3])
fi
AM_CONDITIONAL([ENABLE_][$2],[test x"$enable_$2" = xyes])
])
m4_define([ISP_AUTO_OPTION_ENABLED],[ISP_AUTO_OPTION_ENABLED_DEF([$1],[$2],[$3],[yes],[disable])])
m4_define([ISP_AUTO_OPTION_DISABLED],[ISP_AUTO_OPTION_ENABLED_DEF([$1],[$2],[$3],[no],[enable])])
ISP_AUTO_OPTION_DISABLED([debug], [debug], [debug builds])
ISP_AUTO_OPTION_DISABLED([cpuonly], [cpuonly], [cpu-specific builds])
ISP_AUTO_OPTION_DISABLED([extlib], [extlib], [builds that call external memory-resident library functions])
ISP_AUTO_OPTION_ENABLED([mm-compact], [mm_compact], [16-bit compact memory model builds])
ISP_AUTO_OPTION_ENABLED([mm-small], [mm_small], [16-bit small memory model builds])
ISP_AUTO_OPTION_ENABLED([mm-medium], [mm_medium], [16-bit medium memory model builds])
ISP_AUTO_OPTION_ENABLED([mm-large], [mm_large], [16-bit large memory model builds])
ISP_AUTO_OPTION_DISABLED([mm-huge], [mm_huge], [16-bit huge memory model builds])
ISP_AUTO_OPTION_ENABLED([mm-flat], [mm_flat], [32-bit flat memory model builds])
ISP_AUTO_OPTION_ENABLED([dos16r], [dos16r], [16-bit real-mode DOS programs])
ISP_AUTO_OPTION_ENABLED([dos32p], [dos32p], [32-bit protected-mode DOS programs])
ISP_AUTO_OPTION_ENABLED([win16r], [win16r], [16-bit real-mode Win16 programs])
ISP_AUTO_OPTION_ENABLED([win16p], [win16p], [16-bit protected-mode Win16 programs])
ISP_AUTO_OPTION_ENABLED([win16b], [win16b], [16-bit bimodal (protected or real mode) Win16 programs])
ISP_AUTO_OPTION_ENABLED([win386], [win386], [32-bit Win386 programs])
ISP_AUTO_OPTION_ENABLED([win32s], [win32s], [32-bit Win32s programs])
ISP_AUTO_OPTION_ENABLED([win32], [win32], [32-bit Win32 programs (designed for Windows 9x/ME and NT/2000/XP/Vista/7/etc])
ISP_AUTO_OPTION_ENABLED([linux-host], [linux_host], [programs for your host Linux. Note that they are compiled anyway if needed for the build])
ISP_AUTO_OPTION_ENABLED([cpu-8086], [cpu_8086], [8086 level builds])
ISP_AUTO_OPTION_DISABLED([cpu-286], [cpu_286], [286 level builds])
ISP_AUTO_OPTION_ENABLED([cpu-386], [cpu_386], [386 level builds])
ISP_AUTO_OPTION_DISABLED([cpu-486], [cpu_486], [486 level builds])
ISP_AUTO_OPTION_DISABLED([cpu-586], [cpu_586], [586 level builds])
ISP_AUTO_OPTION_DISABLED([cpu-686], [cpu_686], [686 level builds])
ISP_AUTO_OPTION_ENABLED([windows-nt], [windows_nt], [Windows NT-only targets])
ISP_AUTO_OPTION_DISABLED([windows-me], [windows_me], [Windows ME targets])
ISP_AUTO_OPTION_DISABLED([windows-98], [windows_98], [Windows 98 targets])
ISP_AUTO_OPTION_ENABLED([windows-95], [windows_95], [Windows 95 targets])
ISP_AUTO_OPTION_ENABLED([windows-31], [windows_31], [Windows 3.1 targets])
ISP_AUTO_OPTION_ENABLED([windows-30], [windows_30], [Windows 3.0 targets])
ISP_AUTO_OPTION_DISABLED([windows-20], [windows_20], [Windows 2.0 targets])
ISP_AUTO_OPTION_DISABLED([windows-10], [windows_10], [Windows 1.0 targets])
ISP_AUTO_OPTION_DISABLED([efi-ia32], [efi_ia32], [EFI 32-bit builds (Extensible Firmware Interface)])
ISP_AUTO_OPTION_DISABLED([efi-x64], [efi_x64], [EFI 64-bit builds (Extensible Firmware Interface)])
AC_CONFIG_FILES(Makefile)
AC_CONFIG_FILES(dos/Makefile)
AC_CONFIG_FILES(dos/lib/Makefile)
AC_CONFIG_FILES(dos/empty/Makefile)
AC_CONFIG_FILES(dos/asmexam/Makefile)
AC_CONFIG_FILES(dos/lib/stub/Makefile)
AC_CONFIG_FILES(dos/lib/dsomgr/Makefile)
AC_CONFIG_FILES(dos/lib/loader/Makefile)
AC_CONFIG_FILES(dos/lib/examdll/Makefile)
AC_CONFIG_FILES(bios/Makefile)
AC_CONFIG_FILES(graphics/Makefile)
AC_CONFIG_FILES(graphics/lines/Makefile)
AC_CONFIG_FILES(bios/asmexam/Makefile)
AC_CONFIG_FILES(bios/snapshot/Makefile)
AC_CONFIG_FILES(bios/asmexam/video/Makefile)
AC_CONFIG_FILES(bios/asmexam/mouse/Makefile)
AC_CONFIG_FILES(windows/Makefile)
AC_CONFIG_FILES(windows/winfcon/Makefile)
AC_CONFIG_FILES(windows/winfvtcn/Makefile)
AC_CONFIG_FILES(windows/asmhello/Makefile)
AC_CONFIG_FILES(windows/asmhewin/Makefile)
AC_CONFIG_FILES(traplog/Makefile)
AC_CONFIG_FILES(traplog/dos/Makefile)
AC_CONFIG_FILES(ext/bzip2/Makefile)
AC_CONFIG_FILES(autoinst/automs622hdd/Makefile)
AC_CONFIG_FILES(autoinst/Makefile)
AC_CONFIG_FILES(ext/gzip/Makefile)
AC_CONFIG_FILES(ext/zlib/Makefile)
AC_CONFIG_FILES(ext/Makefile)
AC_CONFIG_FILES(test/Makefile)
AC_CONFIG_FILES(test/test1/Makefile)
AC_CONFIG_FILES(hw/Makefile)
AC_CONFIG_FILES(hw/cpu/Makefile)
AC_CONFIG_FILES(hw/cpu/lib/Makefile)
AC_CONFIG_FILES(hw/serial/Makefile)
AC_CONFIG_FILES(efi/Makefile)
AC_CONFIG_FILES(efi/example/Makefile)
AC_CONFIG_FILES(efi/doslib/Makefile)
AC_CONFIG_FILES(unittest/Makefile)
AC_CONFIG_FILES(unittest/cpu/Makefile)
AC_OUTPUT
echo -n >>config.h
cat >>config.h <<_EOF
_EOF
./config_mak >config.mak
./config.h.filter <config.h >config_public.h
# emit other vars to config.mak
echo OPENWATCOM=$OPENWATCOM >>config.mak
echo WATENV=$WATENV >>config.mak
echo '-include $(abs_top_srcdir)/config.utils.mak' >>config.mak