blob: 10d8ed6b7114da2e5e96b09049eb8717c4fe7781 (
plain)
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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
|
# ex:ts=8
# Ports collection makefile for: bochs
# Date created: 16 December 1997
# Whom: alex
#
# $FreeBSD$
#
PORTNAME= bochs
PORTVERSION= 2.0.2
PORTEPOCH= 2
CATEGORIES= emulators
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTFILES= ${PORTNAME}-${PORTVERSION}.tar.gz
MAINTAINER= anholt@FreeBSD.org
COMMENT= An IA-32 (x86) PC emulator that runs DOS, Win 95, and more
# Global variables
#
USE_XLIB= yes
USE_REINPLACE= yes
USE_GMAKE= yes
GNU_CONFIGURE= yes
CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL}
CONFIGURE_ARGS= --disable-split-hd \
--enable-all-optimizations \
--with-x11 \
--enable-pci
CFLAGS+= -fno-rtti -fno-exceptions -fomit-frame-pointer
MAN1= bochs.1 bximage.1
MAN5= bochsrc.5
.include <bsd.port.pre.mk>
.if ${XFREE86_VERSION} == 4
BUILD_DEPENDS+= mkfontdir:${PORTSDIR}/x11/XFree86-4-clients
RUN_DEPENDS+= mkfontdir:${PORTSDIR}/x11/XFree86-4-clients
.endif
.if defined(WITH_BOCHS_PROCESSORS)
.if ${WITH_BOCHS_PROCESSORS} < 1 || ${WITH_BOCHS_PROCESSORS} > 15
.error "WITH_BOCHS_PROCESSORS must be an integer value between 1 and 15."
.endif
CONFIGURE_ARGS+= --enable-processors=${WITH_BOCHS_PROCESSORS}
WITH_BOCHS_CPU_LEVEL= 6
.endif
.if defined(WITH_BOCHS_CPU_LEVEL)
.if ${WITH_BOCHS_CPU_LEVEL} < 3 || ${WITH_BOCHS_CPU_LEVEL} > 6
.error "WITH_BOCHS_CPU_LEVEL must be an integer value between 3 and 6."
.endif
CONFIGURE_ARGS+= --enable-cpu-level=${WITH_BOCHS_CPU_LEVEL}
.if ${WITH_BOCHS_CPU_LEVEL} < 5
CONFIGURE_ARGS+= --disable-mmx
.endif
.endif
.if defined(WITH_BOCHS_TERM)
CONFIGURE_ARGS+= --with-term
.endif
.if defined(WITH_BOCHS_VESA)
CONFIGURE_ARGS+= --enable-vbe
.endif
.if defined(WITH_BOCHS_AMD64)
CONFIGURE_ARGS+= --enable-x86-64
.endif
.if defined(WITH_BOCHS_DEBUGGER)
CONFIGURE_ARGS+= --enable-debugger --enable-disasm
.endif
.if defined(WITH_BOCHS_X86_DEBUGGER)
CONFIGURE_ARGS+= --enable-x86-debugger
.endif
.if defined(WITH_NE2000)
CONFIGURE_ARGS+= --enable-ne2000
.endif
.if defined(WITH_SOUND)
CONFIGURE_ARGS+= --enable-sb16=freebsd
.endif
MSG_FILE= ${PKGDIR}/pkg-message
PKGMESSAGE= ${WRKDIR}/pkg-message
# Local variables
#
BIOS_DIR= ${DATADIR}/bios
FONT_DIR= ${DATADIR}/font
MKFONTDIR?= mkfontdir
# Pre-everything
#
pre-everything::
@${ECHO_MSG}
.if !defined(WITH_BOCHS_CPU_LEVEL)
@${ECHO_MSG} "If you want to change the processor level to emulate (default is 5, aka Pentium)"
@${ECHO_MSG} "Choices are 3,4,5,6 which mean target 386, 486, Pentium or Pentium Pro emulation"
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_BOCHS_CPU_LEVEL=<cpu level>\""
@${ECHO_MSG}
.endif
.if !defined(WITH_BOCHS_TERM)
@${ECHO_MSG} "If you want to enable the plain text, console-based bochs interface"
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_BOCHS_GUI_TERM=yes\""
@${ECHO_MSG}
.endif
.if !defined(WITH_BOCHS_VESA)
@${ECHO_MSG} "If you want to enable the VESA BIOS video extensions of bochs,"
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_BOCHS_VESA=yes\""
@${ECHO_MSG}
.else
@${ECHO_MSG} "Remember that with the VESA option you must also use VGABIOS-lgpl-latest"
@${ECHO_MSG}
.endif
.if !defined(WITH_BOCHS_PROCESSORS)
@${ECHO_MSG} "If you want to compile with SMP support (implies WITH_BOCHS_CPU_LEVEL=6)."
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_BOCHS_PROCESSORS=<number of processors>\""
@${ECHO_MSG}
.endif
.if !defined(WITH_BOCHS_DEBUGGER)
@${ECHO_MSG} "If you want to compile with builtin debugger and disassembler support."
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_BOCHS_DEBUGGER=yes\""
@${ECHO_MSG}
.endif
.if !defined(WITH_BOCHS_X86_DEBUGGER)
@${ECHO_MSG} "If you want to compile with x86 hardware debugger support."
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_BOCHS_X86_DEBUGGER=yes\""
@${ECHO_MSG}
.endif
.if !defined(WITH_BOCHS_AMD64)
@${ECHO_MSG} "If you want to compile with AMD x86-64 support."
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_BOCHS_AMD64=yes\""
@${ECHO_MSG}
.endif
.if !defined(WITH_NE2000)
@${ECHO_MSG} "If you want to compile with networking (ne2000) support."
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_NE2000=yes\""
@${ECHO_MSG}
.endif
.if !defined(WITH_SOUND)
@${ECHO_MSG} "If you want to compile with sound (blaster 16) support."
@${ECHO_MSG} "hit Ctrl-C right now and use \"make WITH_SOUND=yes\""
.endif
@${ECHO_MSG}
# Post-configure
#
post-patch: patch-bochsrc patch-mans patch-wrapper patch-pkgmessage
patch-bochsrc:
@${REINPLACE_CMD} -E ' \
s|^vgaromimage: bios/|vgaromimage: ${BIOS_DIR}/|; \
s|^romimage: file=bios/|romimage: file=${BIOS_DIR}/|; \
' ${WRKSRC}/.bochsrc
patch-mans:
@${REINPLACE_CMD} -e ' \
s|/usr/local/share/doc/bochs|${DOCSDIR}|; \
' ${WRKSRC}/doc/man/*.1 ${WRKSRC}/doc/man/*.5
patch-wrapper:
@${SED} 's|%%PREFIX%%|${PREFIX}|;s|%%X11BASE%%|${X11BASE}|; \
s|%%FONT_DIR%%|${FONT_DIR}| \
' ${FILESDIR}/bochs.sh > ${WRKDIR}/bochs.sh
patch-pkgmessage:
@${SED} 's|%%DATADIR%%|${DATADIR}|g' ${MSG_FILE} > ${PKGMESSAGE}
# Post-build
#
post-build: compress-font-file
compress-font-file:
@${GZIP_CMD} < ${WRKSRC}/font/vga.pcf > ${WRKSRC}/font/vga.pcf.gz
# Install
#
do-install: install-bins install-mans install-bochsrc \
install-bios install-fonts install-docs
install-bins:
@${INSTALL_PROGRAM} ${WRKSRC}/bochs ${PREFIX}/libexec/bochs.bin
@${INSTALL_PROGRAM} ${WRKSRC}/bximage ${PREFIX}/bin
install-mans:
.for mansect in 1 5
.for man in ${MAN${mansect}}
@${INSTALL_MAN} ${WRKSRC}/doc/man/${man} \
${MAN${mansect}PREFIX}/man/man${mansect}
.endfor
.endfor
install-bochsrc:
@${MKDIR} ${DATADIR}
@${INSTALL_DATA} ${WRKSRC}/.bochsrc ${DATADIR}/bochsrc.sample
install-bios:
@${MKDIR} ${BIOS_DIR}
@${INSTALL_DATA} ${WRKSRC}/bios/VGABIOS-* ${BIOS_DIR}
@${INSTALL_DATA} ${WRKSRC}/bios/BIOS-* ${BIOS_DIR}
install-fonts:
@${MKDIR} ${FONT_DIR}
@${INSTALL_DATA} ${WRKSRC}/font/vga.pcf.gz ${FONT_DIR}
@${MKFONTDIR} ${FONT_DIR}
install-docs:
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
@${INSTALL_DATA} ${WRKSRC}/docs-html/*.txt ${DOCSDIR}
@${MKDIR} ${DOCSDIR}/html
@${INSTALL_DATA} ${WRKSRC}/docs-html/*.html ${DOCSDIR}/html
@${INSTALL_DATA} ${WRKSRC}/docs-html/*.gif ${DOCSDIR}/html
.endif
# Post-install
#
post-install: install-script display-message
install-script:
@${INSTALL_SCRIPT} ${WRKDIR}/bochs.sh ${PREFIX}/bin/bochs
display-message:
@${ECHO_MSG}
@${CAT} ${PKGMESSAGE}
@${ECHO_MSG}
.include <bsd.port.post.mk>
|