summaryrefslogtreecommitdiff
path: root/emulators/bochs/Makefile
blob: 51b33bbee01e64ff1d64c0c4fa8e7983942bc01b (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
# $NetBSD: Makefile,v 1.90 2018/04/16 14:34:25 wiz Exp $

DISTNAME=		bochs-2.6.8
PKGREVISION=		6
CATEGORIES=		emulators
MASTER_SITES=		${MASTER_SITE_SOURCEFORGE:=bochs/}

MAINTAINER=		pkgsrc-users@NetBSD.org
HOMEPAGE=		http://bochs.sourceforge.net/
COMMENT=		IA32 and AMD64 PC emulator
LICENSE=		gnu-lgpl-v2.1

MAKE_JOBS_SAFE=		no

GNU_CONFIGURE=		yes
USE_TOOLS+=		gmake gunzip gzip
USE_LANGUAGES=		c c++
USE_LIBTOOL=		yes

CXXFLAGS+=		-DPARANOID

CONFIGURE_ARGS+=	--enable-cdrom
CONFIGURE_ARGS+=	--enable-ne2000

MAKE_ENV+=		GZIP_CMD=${GZIP_CMD:Q}
MAKE_ENV+=		GUNZIP_CMD=${GUNZIP_CMD:Q}
MAKE_ENV+=		WGET=${FETCH_CMD:Q}

PLIST_VARS+=		debug notiny nox11 plugins x11

PKG_OPTIONS_VAR=	PKG_OPTIONS.bochs
PKG_SUPPORTED_OPTIONS+=	debug tiny x11
PKG_SUGGESTED_OPTIONS+=	x11

.include "../../mk/bsd.prefs.mk"
.include "../../mk/bsd.options.mk"

# Debugging features for the client operating systems. These options are
# not enabled by default because they can adversely impact performance.
.if !empty(PKG_OPTIONS:Mdebug)
CONFIGURE_ARGS+=	--disable-plugins
CONFIGURE_ARGS+=	--enable-debugger
CONFIGURE_ARGS+=	--enable-disasm
CONFIGURE_ARGS+=	--enable-iodebug
CONFIGURE_ARGS+=	--enable-x86-debugger
.endif

.if empty(PKG_OPTIONS:Mtiny)
PLIST.notiny=		yes

CONFIGURE_ARGS+=	--enable-idle-hack
CONFIGURE_ARGS+=	--enable-a20-pin
CONFIGURE_ARGS+=	--enable-x86-64
CONFIGURE_ARGS+=	--enable-smp
CONFIGURE_ARGS+=	--enable-long-phy-address
CONFIGURE_ARGS+=	--enable-cpu-level=6
CONFIGURE_ARGS+=	--enable-pci
CONFIGURE_ARGS+=	--enable-usb
CONFIGURE_ARGS+=	--enable-usb-ohci
CONFIGURE_ARGS+=	--enable-pnic
CONFIGURE_ARGS+=	--enable-repeat-speedups
CONFIGURE_ARGS+=	--enable-configurable-msrs
CONFIGURE_ARGS+=	--enable-all-optimizations
#CONFIGURE_ARGS+=	--enable-instrumentation
CONFIGURE_ARGS+=	--enable-clgd54xx
CONFIGURE_ARGS+=	--enable-fpu
CONFIGURE_ARGS+=	--enable-vmx=2
#CONFIGURE_ARGS+=	--enable-3dnow
CONFIGURE_ARGS+=	--enable-alignment-check
#CONFIGURE_ARGS+=	--enable-gdb-stub
CONFIGURE_ARGS+=	--enable-gameport

.  if empty(PKG_OPTIONS:Mdebug)
PLIST.plugins=		yes
CONFIGURE_ARGS+=	--enable-plugins
.  endif

.  if !empty(MACHINE_PLATFORM:M*-*-i386)
CONFIGURE_ARGS+=	--enable-fast-function-calls
.  endif

CONFIGURE_ARGS.Darwin+=		--enable-sb16=osx
CONFIGURE_ARGS.FreeBSD+=	--enable-sb16=freebsd
CONFIGURE_ARGS.Linux+=		--enable-sb16=linux
CONFIGURE_ARGS.Linux+=		--enable-pcidev
CONFIGURE_ARGS.*+=		--enable-sb16=dummy
.endif

.if empty(PKG_OPTIONS:Mx11)
PLIST.nox11=		yes
CONFIGURE_ARGS+=	--without-x
CONFIGURE_ARGS+=	--without-x11
CONFIGURE_ARGS+=	--with-term
.else
PLIST.x11=		yes
.endif

OPSYSVARS+=		BOCHSRC_SUBST
BOCHSRC_SUBST.Linux+=	-e 's,@FLOPPY_BSD@,\#,'
BOCHSRC_SUBST.Linux+=	-e 's,@FLOPPY_LINUX@,,'
BOCHSRC_SUBST.Darwin+=	-e 's,@FLOPPY_BSD@,\#,'
BOCHSRC_SUBST.Darwin+=	-e 's,@FLOPPY_LINUX@,\#,'
BOCHSRC_SUBST.*+=	-e 's,@FLOPPY_BSD@,,'
BOCHSRC_SUBST.*+=	-e 's,@FLOPPY_LINUX@,\#,'

.if ${OPSYS} == "Darwin"
MESSAGE_SRC=		${.CURDIR}/MESSAGE.Darwin
PLIST_SRC=		${.CURDIR}/PLIST.Darwin

post-build:
	{ ${ECHO} '#! ${SH}'; \
	  ${ECHO} 'exec ${PREFIX}/libexec/bochs.app/Contents/MacOS/bochs'\
	          '"$$@"'; } >${WRKDIR}/bochs.sh

post-install:
	/Developer/Tools/CpMac -r -p ${WRKSRC}/bochs.app ${PREFIX}/libexec
	${INSTALL_PROGRAM} ${WRKSRC}/bxcommit ${PREFIX}/bin
	${INSTALL_PROGRAM} ${WRKSRC}/bximage ${PREFIX}/bin
	${RM} -rf ${PREFIX}/libexec/bochs.app/.build
	${INSTALL_SCRIPT} ${WRKDIR}/bochs.sh ${PREFIX}/bin/bochs
.else

.if !empty(PKG_OPTIONS:Mdebug) && !empty(PKG_OPTIONS:Mx11)
.include "../../x11/gtk2/buildlink3.mk"
.endif
.  if empty(PKG_OPTIONS:Mx11)
.  include "../../mk/curses.buildlink3.mk"
.  else
BUILDLINK_DEPMETHOD.libXt?=	build

.  include "../../x11/libSM/buildlink3.mk"
.  include "../../x11/libX11/buildlink3.mk"
.  include "../../x11/libXpm/buildlink3.mk"
.  include "../../x11/libXrandr/buildlink3.mk"
.  include "../../x11/libXt/buildlink3.mk"
.  endif
.endif

pre-configure:
	${SED} ${BOCHSRC_SUBST} <${WRKSRC}/.bochsrc >${WRKSRC}/.bochsrc.new
	mv ${WRKSRC}/.bochsrc.new ${WRKSRC}/.bochsrc

.include "../../mk/bsd.pkg.mk"