diff options
author | kristerw <kristerw> | 2002-01-06 22:09:31 +0000 |
---|---|---|
committer | kristerw <kristerw> | 2002-01-06 22:09:31 +0000 |
commit | 51970414778a58d6da92ccdb6efb3924e1aef765 (patch) | |
tree | ba76464607ccb368d430f7d1e4d6611c02e2a08d /emulators/xmame/patches | |
parent | 18b2ee53b407f6c5397abe148de8c105d183cdb7 (diff) | |
download | pkgsrc-51970414778a58d6da92ccdb6efb3924e1aef765.tar.gz |
Make xmame compile for new systems that have libusbhid.so instead of libusb.so.
Noted by Rui-Xiang Guo in a mail to tech-pkg.
Diffstat (limited to 'emulators/xmame/patches')
-rw-r--r-- | emulators/xmame/patches/patch-ab | 20 | ||||
-rw-r--r-- | emulators/xmame/patches/patch-ac | 60 |
2 files changed, 80 insertions, 0 deletions
diff --git a/emulators/xmame/patches/patch-ab b/emulators/xmame/patches/patch-ab new file mode 100644 index 00000000000..ac8c972f30f --- /dev/null +++ b/emulators/xmame/patches/patch-ab @@ -0,0 +1,20 @@ +$NetBSD: patch-ab,v 1.13 2002/01/06 22:09:32 kristerw Exp $ +--- src/unix/unix.mak.orig Sun Jan 6 03:44:58 2002 ++++ src/unix/unix.mak Sun Jan 6 19:01:36 2002 +@@ -214,7 +214,16 @@ + endif + ifdef JOY_USB + CONFIG += -DUSB_JOYSTICK ++ifeq ($(ARCH), netbsd) ++ifeq ($(shell test -f /usr/include/usbhid.h && echo have_usbhid), have_usbhid) ++CONFIG += -DHAVE_USBHID_H ++MY_LIBS += -lusbhid ++else + MY_LIBS += -lusb ++endif ++else ++MY_LIBS += -lusb ++endif + endif + + ifdef EFENCE diff --git a/emulators/xmame/patches/patch-ac b/emulators/xmame/patches/patch-ac new file mode 100644 index 00000000000..508c48eece1 --- /dev/null +++ b/emulators/xmame/patches/patch-ac @@ -0,0 +1,60 @@ +$NetBSD: patch-ac,v 1.6 2002/01/06 22:09:32 kristerw Exp $ +--- src/unix/joystick-drivers/joy_usb.c.orig Wed Jan 2 03:45:55 2002 ++++ src/unix/joystick-drivers/joy_usb.c Sun Jan 6 22:17:55 2002 +@@ -21,7 +21,11 @@ + #endif + + #if defined(__ARCH_netbsd) ++#ifdef HAVE_USBHID_H ++#include <usbhid.h> ++#else + #include <usb.h> ++#endif + #elif defined(__ARCH_freebsd) + #include <libusb.h> + #endif +@@ -69,7 +73,7 @@ + + static int joy_initialize_hid(int i) + { +- int size, is_joystick, report_id; ++ int size, is_joystick, report_id = 0; + struct hid_data *d; + struct hid_item h; + report_desc_t rd; +@@ -82,7 +86,19 @@ + + priv_joy_data[i].hids = NULL; + ++#ifdef HAVE_USBHID_H ++ if (ioctl(joy_data[i].fd, USB_GET_REPORT_ID, &report_id) < 0) ++ { ++ fprintf(stderr_file, "error: /dev/uhid%d: %s", i, strerror(errno)); ++ return FALSE; ++ } ++ ++ size = hid_report_size(rd, hid_input, report_id); ++ priv_joy_data[i].offset = 0; ++#else + size = hid_report_size(rd, hid_input, &report_id); ++ priv_joy_data[i].offset = (report_id != 0); ++#endif + if ((priv_joy_data[i].data_buf = malloc(size)) == NULL) + { + fprintf(stderr_file, "error: couldn't malloc %d bytes\n", size); +@@ -90,10 +106,14 @@ + return FALSE; + } + priv_joy_data[i].dlen = size; +- priv_joy_data[i].offset = (report_id != 0); + + is_joystick = 0; ++#ifdef HAVE_USBHID_H ++ for (d = hid_start_parse(rd, 1 << hid_input, report_id); ++ hid_get_item(d, &h); ) ++#else + for (d = hid_start_parse(rd, 1 << hid_input); hid_get_item(d, &h); ) ++#endif + { + int axis, usage, page, interesting_hid; + |