summaryrefslogtreecommitdiff
path: root/emulators/xmame
diff options
context:
space:
mode:
authorjlam <jlam>2001-12-04 05:52:22 +0000
committerjlam <jlam>2001-12-04 05:52:22 +0000
commit5a2ba0507dbc89502de47e7e6be295771d1c1984 (patch)
tree3dec703fcbaa6b831adef5da501a428b61d088d2 /emulators/xmame
parent822221ac505e5861ccfaeddc8a4bd024412b9f43 (diff)
downloadpkgsrc-5a2ba0507dbc89502de47e7e6be295771d1c1984.tar.gz
* Strongly buildlink'ify.
* Reduce the number of patches needed by passing flags down to the make(1) process instead of patching the Makefiles and sources in unnecessary ways. * Remove unnecessary endian.sh script as the computation is down directly in the package Makefile. * Preliminary support for platforms other than NetBSD. * Generalize the package Makefile enough to make it usable if/when xmess compiles again on UNIX platforms * Use the general INSTALL scripts to manage the spool directory during installation/deinstallation. Approved by kristerw@netbsd.org.
Diffstat (limited to 'emulators/xmame')
-rw-r--r--emulators/xmame/Makefile138
-rw-r--r--emulators/xmame/distinfo6
-rwxr-xr-xemulators/xmame/files/endian.sh4
-rw-r--r--emulators/xmame/patches/patch-aa72
-rw-r--r--emulators/xmame/patches/patch-ab11
-rw-r--r--emulators/xmame/patches/patch-ac13
6 files changed, 100 insertions, 144 deletions
diff --git a/emulators/xmame/Makefile b/emulators/xmame/Makefile
index 7e61420f489..f803a2a4bfb 100644
--- a/emulators/xmame/Makefile
+++ b/emulators/xmame/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.57 2001/11/23 23:51:23 kristerw Exp $
+# $NetBSD: Makefile,v 1.58 2001/12/04 05:52:22 jlam Exp $
#
DISTNAME= xmame-0.56.1
@@ -16,61 +16,107 @@ NO_SRC_ON_CDROM= ${RESTRICTED}
NO_BIN_ON_CDROM= ${RESTRICTED}
USE_X11BASE= YES
-USE_XPM= YES
USE_GMAKE= YES
-MAKE_ENV+= OPSYS=${OPSYS} ARCH=${ARCH} \
- MAME_CPU=${MAME_CPU} \
- INSTALL_MAN="${INSTALL_MAN}" \
- INSTALL_PROGRAM="${INSTALL_PROGRAM}" \
- NETBSD_JOYSTICK="${NETBSD_JOYSTICK}" \
- NETBSD_DGA="${NETBSD_DGA}" \
- DISPLAY_METHOD="${DISPLAY_METHOD}"
MAKEFILE= makefile.unix
-DISPLAY_METHOD= x11
+TARGET= ${PKGBASE}
.include "../../mk/bsd.prefs.mk"
-ROMPATH= ${PREFIX}/share/xmame
-SPOOLDIR= /var/games/xmame
-.if exists(/usr/include/machine/joystick.h)
-NETBSD_JOYSTICK= yes
-.else
-NETBSD_JOYSTICK= no
+ROMPATH= ${PREFIX}/share/${TARGET}
+SPOOLDIR= /var/games/${TARGET}
+
+MAKE_FLAGS+= CC="${CC}"
+MAKE_FLAGS+= LIBS="${LDFLAGS} ${LIBS}"
+MAKE_FLAGS+= CFLAGS="${CFLAGS}"
+MAKE_FLAGS+= X11INC= X11LIB=
+
+MAME_DISP_METHOD?= x11
+
+# Determine which CPU-specific code to use.
+.for MARCH in i386 alpha m68k
+MAME_CPU.${MARCH}?= ${MARCH}
+.endfor
+.if !defined(MAME_CPU.${MACHINE_ARCH})
+# Determine the endianness of the CPU by checking header files.
+. if !defined(MACHINE_ENDIAN)
+_ENDIAN_H_FILES= /usr/include/sys/endian.h
+_ENDIAN_H_FILES+= /usr/include/machine/endian.h
+_ENDIAN_H_FILES+= /usr/include/endian.h
+_ENDIAN_H_FILES+= /usr/include/sys/byteorder.h
+_ENDIAN_H_FILES+= /dev/null
+. for FILE in ${_ENDIAN_H_FILES}
+. if exists(${FILE})
+_ENDIAN_H?= ${FILE:S/\/usr\/include\///}
+. endif
+. endfor
+MACHINE_ENDIAN!= \
+ if ( \
+ ${ECHO} "\#include <${_ENDIAN_H}>"; \
+ ${ECHO} "\#ifndef BYTE_ORDER"; \
+ ${ECHO} "\#ifdef _BIG_ENDIAN"; \
+ ${ECHO} "\#define BYTE_ORDER 4321"; \
+ ${ECHO} "\#else"; \
+ ${ECHO} "\#define BYTE_ORDER 1234"; \
+ ${ECHO} "\#endif"; \
+ ${ECHO} "\#endif"; \
+ ${ECHO} "BYTE_ORDER"; \
+ ) | ${CC} -E - | ${GREP} "4321" >/dev/null 2>&1; \
+ then \
+ ${ECHO} big; \
+ else \
+ ${ECHO} little; \
+ fi
+MAKEFLAGS+= MACHINE_ENDIAN="${MACHINE_ENDIAN}"
+. endif
+_MAME_CPU.big-endian= risc
+_MAME_CPU.little-endian= risc_lsb
+MAME_CPU.${MACHINE_ARCH}?= ${_MAME_CPU.${MACHINE_ENDIAN}-endian}
+.endif
+
+# Determine which operating system defaults to use.
+MAME_ARCH.NetBSD?= netbsd
+MAME_ARCH.Linux?= linux
+MAME_ARCH.SunOS?= solaris
+.if !defined(MAME_ARCH.${OPSYS})
+MAME_ARCH.${OPSYS}?= generic
+.endif
+
+MAKE_FLAGS+= DISPLAY_METHOD="${MAME_DISP_METHOD}"
+MAKE_FLAGS+= MY_CPU="${MAME_CPU.${MACHINE_ARCH}}"
+MAKE_FLAGS+= ARCH="${MAME_ARCH.${OPSYS}}"
+
+.if exists({${X11BASE}/include/X11/extensions/xf86dga.h)
+MAKE_FLAGS+= X11_DGA=1
+.endif
+
+# If supported, add appropriate definitions to build joystick drivers.
+.if exists(/usr/include/machine/joystick.h) || \
+ exists(/usr/include/linux/joystick.h)
+MAKE_FLAGS+= JOY_I386=1
.endif
-.if exists(${X11BASE}/include/X11/extensions/xf86dga.h)
-NETBSD_DGA= yes
-.else
-NETBSD_DGA= no
+.if ${OPSYS} == "NetBSD"
+. if exists(/usr/lib/libusb.a)
+MAKE_FLAGS+= JOY_USB=1
+. endif
.endif
-post-patch:
- (cd ${WRKSRC}/doc && ${SED} 's|@ROMPATH@|${ROMPATH}|;s|@SPOOLDIR@|${SPOOLDIR}|' \
- xmamerc.dist >xmamerc)
+OWN_DIRS= ${SPOOLDIR}
+
+post-configure:
+ cd ${WRKSRC}/doc; \
+ ${SED} -e "s|@ROMPATH@|${ROMPATH}|g" \
+ -e "s|@SPOOLDIR@|${SPOOLDIR}|g" \
+ ${TARGET}rc.dist > ${TARGET}rc
do-install:
- (cd ${WRKSRC} && ${INSTALL_PROGRAM} xmame.${DISPLAY_METHOD} \
- ${PREFIX}/bin/xmame)
- (cd ${WRKSRC}/doc && ${INSTALL_MAN} xmame.6 \
- ${PREFIX}/man/man6/xmame.6)
+ ${INSTALL_PROGRAM} ${WRKSRC}/${TARGET}.${MAME_DISP_METHOD} \
+ ${PREFIX}/bin/${TARGET}
+ ${INSTALL_MAN} ${WRKSRC}/doc/${TARGET}.6 \
+ ${PREFIX}/man/man6/${TARGET}.6
${INSTALL_DATA_DIR} ${ROMPATH}
- (cd ${WRKSRC}/doc && ${INSTALL_DATA} xmamerc ${ROMPATH}/xmamerc)
- @${ECHO} Remember to set ROMPATH to ${ROMPATH}.
+ ${INSTALL_DATA} ${WRKSRC}/doc/${TARGET}rc ${ROMPATH}/${TARGET}rc
+.include "../../graphics/xpm/buildlink.mk"
+.include "../../mk/x11.buildlink.mk"
+.include "../../mk/bsd.pkg.install.mk"
.include "../../mk/bsd.pkg.mk"
-
-# This has to come after bsd.pkg.mk to make sure we have FILESDIR
-.if ${MACHINE_ARCH} == "m68k"
-MAME_CPU= m68k
-.elif ${MACHINE_ARCH} == "alpha"
-MAME_CPU= alpha
-.elif ${MACHINE_ARCH} == "i386"
-MAME_CPU= i386
-.else
-# Rather than enumerating all CPU types, check machine/endian.h
-ENDIAN!= ${SH} ${FILESDIR}/endian.sh
-.if ${ENDIAN} == "LITTLE_ENDIAN"
-MAME_CPU= risc_lsb
-.else
-MAME_CPU= risc
-.endif
-.endif
diff --git a/emulators/xmame/distinfo b/emulators/xmame/distinfo
index f672ccfdba1..47c7eae8279 100644
--- a/emulators/xmame/distinfo
+++ b/emulators/xmame/distinfo
@@ -1,8 +1,6 @@
-$NetBSD: distinfo,v 1.13 2001/11/23 23:51:23 kristerw Exp $
+$NetBSD: distinfo,v 1.14 2001/12/04 05:52:22 jlam Exp $
SHA1 (xmame-0.56.1.tar.bz2) = e39502c8f44b3f40e24645423e5b05de4b0b4403
Size (xmame-0.56.1.tar.bz2) = 5263162 bytes
-SHA1 (patch-aa) = d1befb0e0c7def20c64a1c927f7b486db122f5f6
-SHA1 (patch-ab) = b5875ce04c6e2f33bcd44e119bbe78473085141e
-SHA1 (patch-ac) = b49d3957bd02d357cd1e359f0ecfb4250d90cb4f
+SHA1 (patch-aa) = 37f2f2dcf59e5bbdbafb90180520327ca7a5fdfb
SHA1 (patch-ae) = b1513e59b68bfa2babd8bd2ad3314a14d030e85f
diff --git a/emulators/xmame/files/endian.sh b/emulators/xmame/files/endian.sh
deleted file mode 100755
index 0a7f33f0331..00000000000
--- a/emulators/xmame/files/endian.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# $Id: endian.sh,v 1.1 2000/12/07 12:58:14 abs Exp $
-# Trivial script to output BIG_ENDIAN or LITTLE_ENDIAN
-printf '#include <machine/endian.h>\n#if BYTE_ORDER == BIG_ENDIAN\nORDER_BIG_ENDIAN\n#else\nORDER_LITTLE_ENDIAN\n#endif\n' | cpp -P | sed -n 's/^ORDER_//p'
diff --git a/emulators/xmame/patches/patch-aa b/emulators/xmame/patches/patch-aa
index 8ecf6b8fff1..f55c55ec0c2 100644
--- a/emulators/xmame/patches/patch-aa
+++ b/emulators/xmame/patches/patch-aa
@@ -1,73 +1,13 @@
-$NetBSD: patch-aa,v 1.28 2001/11/23 23:51:24 kristerw Exp $
---- makefile.unix.orig Wed Nov 14 05:13:38 2001
-+++ makefile.unix Fri Nov 23 23:19:45 2001
-@@ -201,7 +201,7 @@
+$NetBSD: patch-aa,v 1.29 2001/12/04 05:52:23 jlam Exp $
+
+--- makefile.unix.orig Tue Nov 13 23:13:38 2001
++++ makefile.unix
+@@ -201,7 +203,7 @@
# *** xmameroot, this is the default rompath, place where the highscores are
# stored, global rc location etc. Since most of these are configurable through
# the rc-file anyway, there are no longer seperate defines for each.
-XMAMEROOT = $(PREFIX)/lib/x$(TARGET)
-+XMAMEROOT = $(PREFIX)/share/xmame
++XMAMEROOT = $(PREFIX)/share/x$(TARGET)
##############################################################################
-@@ -209,7 +209,7 @@
- ##############################################################################
-
- ### i386 + gnu-asm
--MY_CPU = i386
-+MY_CPU = ${MAME_CPU}
- ### i386 no asm -- needed for the Intel C++ Compiler which does not fully
- # understand gcc's inline assembly syntax (you may still enable X86_ASM_68000
- # etc. which are assembled by NASM). You may also need to use this for BeOS.
-@@ -232,11 +232,11 @@
- ##############################################################################
-
- ### Linux
--ARCH = linux
-+# ARCH = linux
- ### FreeBSD
- # ARCH = freebsd
- ### NetBSD
--# ARCH = netbsd
-+ARCH = netbsd
- ### OpenBSD
- # ARCH = openbsd
- ### Solaris / SunOS
-@@ -271,11 +271,13 @@
- # X Input Extensions based joystick, this is known to not work right now ;|
- # JOY_X11 = 1
- # On iX86 based OS's, if supported, you can use standard joystick driver.
--# JOY_I386 = 1
-+ifeq (${NETBSD_JOYSTICK},yes)
-+JOY_I386 = 1
-+endif
- # Linux FM-TOWNS game PAD joystick emulation support, thanks to Osamu Kurati.
- # JOY_PAD = 1
- # NetBSD/FreeBSD USB joystick support.
--# JOY_USB = 1
-+JOY_USB = 1
-
-
- ##############################################################################
-@@ -324,7 +326,9 @@
- # MIT-Shared Memory X Extensions, comment the
- X11_MITSHM = 1
- # XFree86 DGA
--# X11_DGA = 1
-+ifeq (${NETBSD_DGA},yes)
-+X11_DGA = 1
-+endif
- # The XIL library (Solaris 2.5.1 and higher), uncomment
- # X11_XIL = 1
-
-@@ -333,8 +337,8 @@
- # X11INC = -I/usr/include/X11
- # X11LIB = -L/usr/lib/X11
- # standard location for XFree86
--X11INC = -I/usr/X11R6/include
--X11LIB = -L/usr/X11R6/lib
-+X11INC = -I${PREFIX}/include -I${X11BASE}/include
-+X11LIB = -L${PREFIX}/lib -Wl,-R${PREFIX}/lib -L${X11BASE}/lib -Wl,-R${X11BASE}/lib
- # for Sun systems
- # X11INC = -I/usr/openwin/include
- # X11LIB = -L/usr/openwin/lib
diff --git a/emulators/xmame/patches/patch-ab b/emulators/xmame/patches/patch-ab
deleted file mode 100644
index 76a89b0ecd3..00000000000
--- a/emulators/xmame/patches/patch-ab
+++ /dev/null
@@ -1,11 +0,0 @@
-$NetBSD: patch-ab,v 1.11 2001/11/01 14:45:39 tron Exp $
-
---- src/unix/Makefile.orig Mon Sep 17 01:52:00 2001
-+++ src/unix/Makefile Thu Nov 1 15:04:47 2001
-@@ -153,3 +153,6 @@
- video-drivers/glxtool.h
- $(VID_DIR)/gltool.h: video-drivers/gl-disp-var.h video-drivers/glu-disp-var.h
-
-+$(JOY_DIR)/joy_usb.o: joystick-drivers/joy_usb.c xmame.h
-+ $(CC_COMMENT) @echo 'Compiling src/unix/$< ...'
-+ $(CC_COMPILE) $(CC) -I/usr/include $(MY_CFLAGS) -o $@ -c $<
diff --git a/emulators/xmame/patches/patch-ac b/emulators/xmame/patches/patch-ac
deleted file mode 100644
index beb34dd9137..00000000000
--- a/emulators/xmame/patches/patch-ac
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ac,v 1.4 2001/11/01 14:45:39 tron Exp $
-
---- src/unix/unix.mak.orig Thu Nov 1 15:12:47 2001
-+++ src/unix/unix.mak Thu Nov 1 15:12:15 2001
-@@ -202,7 +202,7 @@
- endif
- ifdef JOY_USB
- CONFIG += -DUSB_JOYSTICK
--MY_LIBS += -lusb
-+MY_LIBS += /usr/lib/libusb.so
- endif
-
- ifdef EFENCE