Tweak emulators/advancemame version 1.4
[dports.git] / emulators / gngeo / Makefile
1 # Created by: Alejandro Pulver <alejandro@varnet.biz>
2 # $FreeBSD$
3
4 PORTNAME=       gngeo
5 PORTVERSION=    0.8
6 PORTREVISION=   2
7 CATEGORIES=     emulators
8 MASTER_SITES=   GOOGLE_CODE/${PORTNAME}
9
10 MAINTAINER=     acm@FreeBSD.org
11 COMMENT=        NeoGeo emulator
12
13 USES=           compiler:features gmake
14 USE_SDL=        image sdl
15 USE_GL=         yes
16
17 GNU_CONFIGURE=  yes
18 CONFIGURE_ARGS= --program-transform-name="" --disable-gp2x
19 MAKE_JOBS_UNSAFE=       yes
20
21 CPPFLAGS+=      ${CFLAGS} `${SDL_CONFIG} --cflags` -I${LOCALBASE}/include
22 LDFLAGS+=       `${SDL_CONFIG} --libs` -L${LOCALBASE}/lib
23 USE_CSTD=       gnu89
24 MAKE_ARGS+=     CC_FOR_BUILD=${CC}
25
26 SUB_FILES=      pkg-message
27
28 OPTIONS_DEFINE_i386=    ASM RAZE STAR
29 OPTIONS_DEFAULT_i386=   ASM
30 RAZE_DESC=      Use Raze as z80 emulator (broken)
31 STAR_DESC=      Use Starscream as 68k emulator (broken)
32
33 .include <bsd.port.pre.mk>
34
35 .if ${PORT_OPTIONS:MI386ASM} || ${PORT_OPTIONS:MRAZE} || \
36     ${PORT_OPTIONS:MSTAR}
37 BUILD_DEPENDS+=         nasm:${PORTSDIR}/devel/nasm
38 .endif
39
40 .if ${PORT_OPTIONS:MI386ASM}
41 CONFIGURE_ARGS+=        --enable-i386asm
42 .else
43 CONFIGURE_ARGS+=        --disable-i386asm
44 .endif
45
46 .if ${PORT_OPTIONS:MRAZE}
47 CONFIGURE_ARGS+=        --with-z80core=raze
48 BROKEN=                 fails to link
49 .else
50 CONFIGURE_ARGS+=        --with-z80core=mamez80
51 .endif
52
53 .if ${PORT_OPTIONS:MSTAR}
54 CONFIGURE_ARGS+=        --with-m68kcore=starscream
55 BROKEN=                 fails to link
56 .else
57 CONFIGURE_ARGS+=        --with-m68kcore=gen68k
58 .endif
59
60 post-patch:
61         @${REINPLACE_CMD} -e 's|x86_64|amd64|' ${WRKSRC}/configure
62 .if ${ARCH} == "x86_64"
63         @${REINPLACE_CMD} -e 's|-malign-double||' ${WRKSRC}/configure
64 .endif
65 .if ${COMPILER_TYPE} == "clang"
66         @${REINPLACE_CMD} -e 's|-frerun-loop-opt||; \
67                 s|-falign-jumps=2||; s|-falign-loops=2||; \
68                 s|-fschedule-insns2||; s|-malign-double||' \
69                 ${WRKSRC}/configure
70 .endif
71         @${REINPLACE_CMD} -e 's|sdl-config|${SDL_CONFIG}|' \
72                 ${CONFIGURE_WRKSRC}/${CONFIGURE_SCRIPT} \
73                 ${WRKSRC}/src/generator68k/Makefile.in
74
75 post-install:
76         ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
77         ${INSTALL_DATA} ${WRKSRC}/sample_gngeorc ${STAGEDIR}${EXAMPLESDIR}/gngeorc
78
79 .include <bsd.port.post.mk>