1 |
# $MidnightBSD: mports/emulators/bochs/Makefile,v 1.7 2010/04/27 13:14:13 laffer1 Exp $ |
2 |
|
3 |
PORTNAME= bochs |
4 |
PORTVERSION= 2.4.5 |
5 |
PORTEPOCH= 2 |
6 |
CATEGORIES= emulators |
7 |
MASTER_SITES= SF |
8 |
|
9 |
MAINTAINER= ports@MidnightBSD.org |
10 |
COMMENT= An IA-32 (x86) PC emulator that runs DOS, Win 95, and more |
11 |
LICENSE= lgpl |
12 |
|
13 |
USE_GMAKE= yes |
14 |
USE_AUTOTOOLS= libtool:22 |
15 |
CONFIGURE_ENV= CPPFLAGS="${CPPFLAGS}" LDFLAGS="${LDFLAGS}" |
16 |
CONFIGURE_ARGS= --disable-docbook |
17 |
|
18 |
OPTIONS= A20_PIN "Enable support for A20 pin" on \ |
19 |
ACPI "Enable ACPI emulation" off \ |
20 |
ALIGN_CHECK "Enable alignment check support" on \ |
21 |
ASSERT_CHECK "Enable BX_ASSERT checks" off \ |
22 |
CDROM "Enable CDROM support" on \ |
23 |
CLGD54XX "Enable Cirrus Logic GD54xx video card" off \ |
24 |
CONF_MSRS "Enable configurable MSR registers support" on \ |
25 |
DEBUGGER "Enable debugger support" off \ |
26 |
DEBUGGER_X86 "Enable x86 hardware debugger" off \ |
27 |
DISASM "Enable disassemler support " on \ |
28 |
FAST_FUNCCALL "Enable fast function calls support (x86 only)" off \ |
29 |
FPU "Enable FPU emulator" on \ |
30 |
GAMEPORT "Enable standard PC gameport support" off \ |
31 |
GDB_STUB "Enable GDB stub support" off \ |
32 |
IDLE_HACK "Keep Bochs from using all CPU time" off \ |
33 |
INSTRUMENT "Enable support for instrumentation" off \ |
34 |
IODEBUG "Enable I/O interface to debugger" off \ |
35 |
LOGGING "Enable logging" on \ |
36 |
LONG_PHY_ADDR "Enable support for physical address >= 32bit" off \ |
37 |
MISALIGNEDSSE "Enable misaligned SSE support" off \ |
38 |
MWAIT "Enable experimental MONITOR/MWAIT support" off \ |
39 |
NE2000 "Enable limited ne2000 support" on \ |
40 |
NEW_PIT "Enable use of the new PIT model" on \ |
41 |
OPTIMIZATIONS "Enable all safe speeed optimizations" on \ |
42 |
PCI "Enable limited i440FX PCI support" on \ |
43 |
PLUGINS "Enable building dynamic loadable plugins" off \ |
44 |
PNIC "Enable PCI pseudo NIC (network card) support" off \ |
45 |
RAW_SERIAL "Use raw serial port access" off \ |
46 |
READLINE "Enable readline support in debugger" off \ |
47 |
REPEAT_SPEED "Enable repeated IO and mem copy speedups" off \ |
48 |
RFB "Enable VNC server support in display" off \ |
49 |
SB16 "Enable Sound Blaster 16 emulation (broken)" off \ |
50 |
SDL "Enable SDL display interface" off \ |
51 |
SHOW_IPS "Enable logging of measured IPS" off \ |
52 |
SMP "Enable SMP simulation support (CPU level 6)" off \ |
53 |
SVGA "Enable SVGAlib support" off \ |
54 |
TCACHE "Enable trace cache" on \ |
55 |
TERM "Use text only, console based interface" off \ |
56 |
USB "Enable limited USB UHCI support" off \ |
57 |
USB_OHCI "Enable limited USB OHCI support" off \ |
58 |
VBE "Enable VGA BIOS Extensions" on \ |
59 |
VMX "Enable Virtialization extensions" off \ |
60 |
WX "Use WxWidgets display interface" off \ |
61 |
X11 "Use X11 display interface" on \ |
62 |
X86_64 "Enable AMD x86-64 support" off \ |
63 |
XPM "Enable XPM library support" off |
64 |
|
65 |
CFLAGS+= -fno-exceptions -fomit-frame-pointer |
66 |
CXXFLAGS+= -fno-rtti |
67 |
CPPFLAGS= -I${LOCALBASE}/include |
68 |
LDFLAGS= -L${LOCALBASE}/lib |
69 |
|
70 |
MANCOMPRESSED= yes |
71 |
MAN1= bochs.1 bochs-dlx.1 bxcommit.1 bximage.1 |
72 |
MAN5= bochsrc.5 |
73 |
|
74 |
SUB_FILES= pkg-message |
75 |
|
76 |
.include <bsd.port.pre.mk> |
77 |
|
78 |
.if defined(WITHOUT_TERM) && defined(WITHOUT_WX) && defined(WITHOUT_X11) |
79 |
CONFIGURE_ARGS+=--with-nogui |
80 |
.endif |
81 |
|
82 |
.if !defined(WITH_A20_PIN) |
83 |
CONFIGURE_ARGS+=--disable-a20-pin |
84 |
.else |
85 |
CONFIGURE_ARGS+=--enable-a20-pin |
86 |
.endif |
87 |
|
88 |
.if defined(WITH_ACPI) |
89 |
CONFIGURE_ARGS+=--enable-acpi |
90 |
.else |
91 |
CONFIGURE_ARGS+=--disable-acpi |
92 |
.endif |
93 |
|
94 |
.if !defined(WITH_ALIGN_CHECK) |
95 |
CONFIGURE_ARGS+=--disable-alignment-check |
96 |
.else |
97 |
CONFIGURE_ARGS+=--enable-alignment-check |
98 |
.endif |
99 |
|
100 |
.if defined(WITH_ASSERT_CHECK) |
101 |
CONFIGURE_ARGS+=--enable-assert-checks |
102 |
.else |
103 |
CONFIGURE_ARGS+=--disable-assert-checks |
104 |
.endif |
105 |
|
106 |
.if !defined(WITH_CDROM) |
107 |
CONFIGURE_ARGS+=--disable-cdrom |
108 |
.else |
109 |
CONFIGURE_ARGS+=--enable-cdrom |
110 |
.endif |
111 |
|
112 |
.if defined(WITH_CLGD54XX) |
113 |
CONFIGURE_ARGS+=--enable-clgd54xx |
114 |
.else |
115 |
CONFIGURE_ARGS+=--disable-clgd54xx |
116 |
.endif |
117 |
|
118 |
.if !defined(WITH_CONF_MSRS) |
119 |
CONFIGURE_ARGS+=--disable-configurable-msrs |
120 |
.else |
121 |
CONFIGURE_ARGS+=--enable-configurable-msrs |
122 |
.endif |
123 |
|
124 |
.if defined(WITH_DEBUGGER) |
125 |
CONFIGURE_ARGS+=--enable-debugger |
126 |
.else |
127 |
CONFIGURE_ARGS+=--disable-debugger |
128 |
.endif |
129 |
|
130 |
.if defined(WITH_DEBUGGER_X86) |
131 |
CONFIGURE_ARGS+=--enable-x86-debugger |
132 |
.else |
133 |
CONFIGURE_ARGS+=--disable-x86-debugger |
134 |
.endif |
135 |
|
136 |
.if !defined(WITH_DISASM) |
137 |
CONFIGURE_ARGS+=--disable-disasm |
138 |
.else |
139 |
CONFIGURE_ARGS+=--enable-disasm |
140 |
.endif |
141 |
|
142 |
.if defined(WITH_FAST_FUNCCALL) |
143 |
CONFIGURE_ARGS+=--enable-fast-function-calls |
144 |
.else |
145 |
CONFIGURE_ARGS+=--disable-fast-function-calls |
146 |
.endif |
147 |
|
148 |
.if !defined(WITH_FPU) |
149 |
CONFIGURE_ARGS+=--disable-fpu |
150 |
.else |
151 |
CONFIGURE_ARGS+=--enable-fpu |
152 |
.endif |
153 |
|
154 |
.if defined(WITH_GAMEPORT) |
155 |
CONFIGURE_ARGS+=--enable-gameport |
156 |
.else |
157 |
CONFIGURE_ARGS+=--disable-gameport |
158 |
.endif |
159 |
|
160 |
.if defined(WITH_GDB_STUB) |
161 |
CONFIGURE_ARGS+=--enable-gdb-stub |
162 |
.else |
163 |
CONFIGURE_ARGS+=--disable-gdb-stub |
164 |
.endif |
165 |
|
166 |
.if defined(WITH_IDLE_HACK) |
167 |
CONFIGURE_ARGS+=--enable-idle-hack |
168 |
.else |
169 |
CONFIGURE_ARGS+=--disable-idle-hack |
170 |
.endif |
171 |
|
172 |
.if defined(WITH_INSTRUMENT) |
173 |
CONFIGURE_ARGS+=--enable-instrumentation |
174 |
.else |
175 |
CONFIGURE_ARGS+=--disable-instrumentation |
176 |
.endif |
177 |
|
178 |
.if defined(WITH_IODEBUG) |
179 |
CONFIGURE_ARGS+=--enable-iodebug |
180 |
.else |
181 |
CONFIGURE_ARGS+=--disable-iodebug |
182 |
.endif |
183 |
|
184 |
.if !defined(WITH_LOGGING) |
185 |
CONFIGURE_ARGS+=--disable-logging |
186 |
.else |
187 |
CONFIGURE_ARGS+=--enable-logging |
188 |
.endif |
189 |
|
190 |
.if defined(WITH_LONG_PHY_ADDR) |
191 |
CONFIGURE_ARGS+=--enable-long-phy-address |
192 |
.else |
193 |
CONFIGURE_ARGS+=--disable-long-phy-address |
194 |
.endif |
195 |
|
196 |
.if defined(WITH_MISALIGNDSSE) |
197 |
CONFIGURE_ARGS+=--enable-misaligned-sse |
198 |
.else |
199 |
CONFIGURE_ARGS+=--disable-misaligned-sse |
200 |
.endif |
201 |
|
202 |
.if defined(WITH_MWAIT) |
203 |
CONFIGURE_ARGS+=--enable-monitor-mwait |
204 |
.else |
205 |
CONFIGURE_ARGS+=--disable-monitor-mwait |
206 |
.endif |
207 |
|
208 |
.if defined(WITH_NE2000) |
209 |
CONFIGURE_ARGS+=--enable-ne2000 |
210 |
.else |
211 |
CONFIGURE_ARGS+=--disable-ne2000 |
212 |
.endif |
213 |
|
214 |
.if !defined(WITH_NEW_PIT) |
215 |
CONFIGURE_ARGS+=--disable-new-pit |
216 |
.else |
217 |
CONFIGURE_ARGS+=--enable-new-pit |
218 |
.endif |
219 |
|
220 |
.if defined(WITH_OPTIMIZATIONS) |
221 |
CONFIGURE_ARGS+=--enable-all-optimizations |
222 |
.else |
223 |
CONFIGURE_ARGS+=--disable-all-optimizations |
224 |
.endif |
225 |
|
226 |
.if defined(WITH_PCI) |
227 |
CONFIGURE_ARGS+=--enable-pci |
228 |
.else |
229 |
CONFIGURE_ARGS+=--disable-pci |
230 |
.endif |
231 |
|
232 |
.if defined(WITH_PLUGINS) |
233 |
CONFIGURE_ARGS+=--enable-plugins |
234 |
.else |
235 |
CONFIGURE_ARGS+=--disable-plugins |
236 |
.endif |
237 |
|
238 |
.if defined(WITH_PNIC) |
239 |
CONFIGURE_ARGS+=--enable-pnic |
240 |
.else |
241 |
CONFIGURE_ARGS+=--disable-pnic |
242 |
.endif |
243 |
|
244 |
.if defined(WITH_RAW_SERIAL) |
245 |
CONFIGURE_ARGS+=--enable-raw-serial |
246 |
.else |
247 |
CONFIGURE_ARGS+=--disable-raw-serial |
248 |
.endif |
249 |
|
250 |
.if defined(WITH_READLINE) |
251 |
CONFIGURE_ARGS+=--enable-readline |
252 |
.else |
253 |
CONFIGURE_ARGS+=--disable-readline |
254 |
.endif |
255 |
|
256 |
.if defined(WITH_REPEAT_SPEED) |
257 |
CONFIGURE_ARGS+=--enable-repeat-speedups |
258 |
.else |
259 |
CONFIGURE_ARGS+=--disable-repeat-speedups |
260 |
.endif |
261 |
|
262 |
.if defined(WITH_RFB) |
263 |
CONFIGURE_ARGS+=--with-rfb |
264 |
.else |
265 |
CONFIGURE_ARGS+=--without-rfb |
266 |
.endif |
267 |
|
268 |
.if defined(WITH_SB16) |
269 |
CONFIGURE_ARGS+=--enable-sb16=freebsd |
270 |
.endif |
271 |
|
272 |
.if defined(WITH_SDL) |
273 |
USE_SDL= sdl |
274 |
CONFIGURE_ARGS+=--with-sdl |
275 |
.endif |
276 |
|
277 |
.if defined(WITH_SHOW_IPS) |
278 |
CONFIGURE_ARGS+=--enable-show-ips |
279 |
.else |
280 |
CONFIGURE_ARGS+=--disable-show-ips |
281 |
.endif |
282 |
|
283 |
.if defined(WITH_SMP) |
284 |
CONFIGURE_ARGS+=--enable-smp |
285 |
WITH_CPU_LEVEL= 6 |
286 |
.endif |
287 |
|
288 |
.if defined(WITH_SVGA) |
289 |
LIB_DEPENDS+= vga.1:${PORTSDIR}/graphics/svgalib |
290 |
CONFIGURE_ARGS+=--with-svga |
291 |
.endif |
292 |
|
293 |
.if defined(WITH_TERM) |
294 |
CONFIGURE_ARGS+=--with-term |
295 |
.endif |
296 |
|
297 |
.if !defined(WITH_TCACHE) |
298 |
CONFIGURE_ARGS+=--disable-trace-cache |
299 |
.else |
300 |
CONFIGURE_ARGS+=--enable-trace-cache |
301 |
.endif |
302 |
|
303 |
.if defined(WITH_USB) |
304 |
CONFIGURE_ARGS+=--enable-usb |
305 |
.else |
306 |
CONFIGURE_ARGS+=--disable-usb |
307 |
.endif |
308 |
|
309 |
.if defined(WITH_USB_OHCI) |
310 |
CONFIGURE_ARGS+=--enable-usb-ohci |
311 |
.else |
312 |
CONFIGURE_ARGS+=--disable-usb-ohci |
313 |
.endif |
314 |
|
315 |
.if !defined(WITH_VBE) |
316 |
CONFIGURE_ARGS+=--disable-vbe |
317 |
.else |
318 |
CONFIGURE_ARGS+=--enable-vbe |
319 |
.endif |
320 |
|
321 |
.if defined(WITH_VMX) |
322 |
CONFIGURE_ARGS+=--enable-vmx |
323 |
WITH_CPU_LEVEL= 6 |
324 |
.else |
325 |
CONFIGURE_ARGS+=--disable-vmx |
326 |
.endif |
327 |
|
328 |
.if defined(WITH_WX) |
329 |
USE_WX= 2.4+ |
330 |
CONFIGURE_ENV= WX_CONFIG="${WX_CONFIG}" |
331 |
CONFIGURE_ARGS+=--with-wx |
332 |
.else |
333 |
CONFIGURE_ARGS+=--disable-debugger-gui |
334 |
.endif |
335 |
|
336 |
.if defined(WITH_X11) |
337 |
USE_XORG= xext xt |
338 |
CONFIGURE_ARGS+=--with-x11 |
339 |
.endif |
340 |
|
341 |
.if defined(WITH_X86_64) |
342 |
CONFIGURE_ARGS+=--enable-x86-64 |
343 |
.else |
344 |
CONFIGURE_ARGS+=--disable-x86-64 |
345 |
.endif |
346 |
|
347 |
.if defined(WITH_XPM) |
348 |
USE_XORG= xpm |
349 |
CONFIGURE_ARGS+=--enable-xpm |
350 |
.else |
351 |
CONFIGURE_ARGS+=--disable-xpm |
352 |
.endif |
353 |
|
354 |
.if defined(WITH_CPU_LEVEL) |
355 |
.if ${WITH_CPU_LEVEL} < 3 || ${WITH_CPU_LEVEL} > 6 |
356 |
IGNORE= can not install: WITH_CPU_LEVEL must be an integer value between 3 and 6 |
357 |
.endif |
358 |
CONFIGURE_ARGS+=--enable-cpu-level=${WITH_CPU_LEVEL} |
359 |
.endif |
360 |
|
361 |
pre-everything:: |
362 |
@${ECHO_CMD} |
363 |
.if !defined(WITH_CPU_LEVEL) |
364 |
@${ECHO_CMD} "If you want to change the processor level to emulate (default is 5, aka Pentium), set WITH_CPU_LEVEL to the desired value. Choices are 3, 4, 5 and 6 which mean target 386, 486, Pentium or Pentium Pro emulation." | ${FMT} |
365 |
.endif |
366 |
@${ECHO_CMD} |
367 |
|
368 |
post-patch: |
369 |
@${REINPLACE_CMD} -Ee \ |
370 |
's|$$BXSHARE/|${DATADIR}/|; \ |
371 |
s|^#clock: sync=none|clock: sync=realtime|; \ |
372 |
s|^log: .+|log: /dev/null|; \ |
373 |
s|^panic: .+|panic: action=ask|; \ |
374 |
s|^parport1: .+|#&|' \ |
375 |
${WRKSRC}/.bochsrc |
376 |
@${REINPLACE_CMD} -Ee \ |
377 |
's|install_share install_doc|install_share|; \ |
378 |
s|(^sharedir.+=).+|\1 ${DATADIR}|; \ |
379 |
s|(^docdir.+=).+|\1 ${DOCSDIR}|' \ |
380 |
${WRKSRC}/Makefile.in |
381 |
@${REINPLACE_CMD} -e \ |
382 |
's|/usr/local/share/bochs|${DATADIR}|; \ |
383 |
s|/usr/local/share/doc/bochs|${DOCSDIR}|' \ |
384 |
${WRKSRC}/doc/docbook/user/user.dbk ${WRKSRC}/doc/man/*.[15] |
385 |
@${REINPLACE_CMD} -Ee 's|/usr/(include/vga\.h)|${LOCALBASE}/\1|' \ |
386 |
${WRKSRC}/gui/svga.cc |
387 |
@${REINPLACE_CMD} -Ee \ |
388 |
's|(^LOCAL_CXXFLAGS.+=)|\1 @CPPFLAGS@|; \ |
389 |
s|(-lvgagl)$$|\1 @LDFLAGS@|' \ |
390 |
${WRKSRC}/gui/Makefile.in |
391 |
|
392 |
post-install: |
393 |
.if defined(WITH_PLUGINS) |
394 |
@${FIND} ${PREFIX}/lib/bochs ! -type d | \ |
395 |
${SED} 's,^${PREFIX}/,,' >> ${TMPPLIST} |
396 |
@${FIND} ${PREFIX}/lib/bochs -type d | ${SORT} -r | \ |
397 |
${SED} 's,^${PREFIX}/,@dirrm ,' >> ${TMPPLIST} |
398 |
.endif |
399 |
.if !defined(NOPORTDOCS) |
400 |
@${MKDIR} ${DOCSDIR} |
401 |
@${INSTALL_DATA} ${WRKSRC}/CHANGES ${DOCSDIR}/CHANGES |
402 |
@${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}/README |
403 |
@${INSTALL_DATA} ${WRKSRC}/TODO ${DOCSDIR}/TODO |
404 |
@${INSTALL_DATA} ${WRKSRC}/.bochsrc ${DOCSDIR}/bochsrc-sample.txt |
405 |
@${INSTALL_DATA} ${WRKSRC}/docs-html/*.txt ${DOCSDIR} |
406 |
@${MKDIR} ${DOCSDIR}/html |
407 |
@${INSTALL_DATA} ${WRKSRC}/docs-html/*.html ${DOCSDIR}/html |
408 |
.endif |
409 |
|
410 |
.include <bsd.port.post.mk> |