3 This patch is a partial backport of
4 https://github.com/libusb/libusb/commit/3dc781ce3ecd0315cfc0b4fdcef9e062990f289b
6 Signed-off-by: Jeroen Roovers <jer@airfi.aero>
10 @@ -36,6 +36,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RU
16 LT_LANG([Windows Resource])
18 @@ -91,7 +92,6 @@ case $host in
21 AC_MSG_RESULT([Haiku])
22 - AC_CONFIG_SUBDIRS([libusb/os/haiku])
26 @@ -193,6 +193,7 @@ AM_CONDITIONAL(OS_HAIKU, test "x$backend
27 AM_CONDITIONAL(THREADS_POSIX, test "x$threads" = xposix)
28 AM_CONDITIONAL(CREATE_IMPORT_LIB, test "x$create_import_lib" = "xyes")
29 AM_CONDITIONAL(USE_UDEV, test "x$enable_udev" = xyes)
30 +AM_CONDITIONAL(USE_USBDK, test "x$enable_usbdk" = xyes)
31 if test "$threads" = posix; then
32 AC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads])
34 --- a/libusb/Makefile.am
35 +++ b/libusb/Makefile.am
36 @@ -4,58 +4,66 @@ AUTOMAKE_OPTIONS = subdir-objects
38 lib_LTLIBRARIES = libusb-1.0.la
40 -POSIX_POLL_SRC = os/poll_posix.c
41 -LINUX_USBFS_SRC = os/linux_usbfs.c
42 -DARWIN_USB_SRC = os/darwin_usb.c
43 +POSIX_POLL_SRC = os/poll_posix.h os/poll_posix.c
44 +POSIX_THREADS_SRC = os/threads_posix.h os/threads_posix.c
45 +WINDOWS_POLL_SRC = os/poll_windows.h os/poll_windows.c
46 +WINDOWS_THREADS_SRC = os/threads_windows.h os/threads_windows.c
47 +LINUX_USBFS_SRC = os/linux_usbfs.h os/linux_usbfs.c
48 +DARWIN_USB_SRC = os/darwin_usb.h os/darwin_usb.c
49 OPENBSD_USB_SRC = os/openbsd_usb.c
50 NETBSD_USB_SRC = os/netbsd_usb.c
51 -WINDOWS_USB_SRC = os/poll_windows.c os/windows_usb.c libusb-1.0.rc libusb-1.0.def
52 -WINCE_USB_SRC = os/wince_usb.c os/wince_usb.h
56 -EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \
57 - $(NETBSD_USB_SRC) $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \
59 - os/threads_posix.c os/threads_windows.c \
60 +WINDOWS_COMMON_SRC = os/windows_nt_common.h os/windows_nt_common.c \
61 + os/windows_common.h libusb-1.0.rc libusb-1.0.def
62 +WINDOWS_USB_SRC = os/windows_winusb.h os/windows_winusb.c
63 +WINDOWS_USBDK_SRC = os/windows_usbdk.h os/windows_usbdk.c
64 +WINCE_USB_SRC = os/wince_usb.h os/wince_usb.c
65 +HAIKU_USB_SRC = os/haiku_usb.h os/haiku_usb_backend.cpp \
66 + os/haiku_usb_raw.h os/haiku_usb_raw.cpp os/haiku_pollfs.cpp
68 +EXTRA_DIST = $(POSIX_POLL_SRC) $(POSIX_THREADS_SRC) \
69 + $(WINDOWS_POLL_SRC) $(WINDOWS_THREADS_SRC) \
70 + $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) \
71 + $(OPENBSD_USB_SRC) $(NETBSD_USB_SRC) \
72 + $(WINDOWS_COMMON_SRC) $(WINDOWS_USB_SRC) $(WINDOWS_USBDK_SRC) \
73 + $(WINCE_USB_SRC) $(HAIKU_USB_SRC) \
74 os/linux_udev.c os/linux_netlink.c
77 - cp -r os/haiku $(distdir)/os/haiku
78 - rm -rf $(distdir)/os/haiku/autom4te.cache
83 -OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
85 +OS_SRC = $(LINUX_USBFS_SRC) os/linux_udev.c
87 -OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
89 +OS_SRC = $(LINUX_USBFS_SRC) os/linux_netlink.c
95 -OS_SRC = $(DARWIN_USB_SRC) $(POSIX_POLL_SRC)
96 +OS_SRC = $(DARWIN_USB_SRC)
97 AM_CFLAGS_EXT = -no-cpp-precomp
101 -OS_SRC = $(OPENBSD_USB_SRC) $(POSIX_POLL_SRC)
102 +OS_SRC = $(OPENBSD_USB_SRC)
106 -OS_SRC = $(NETBSD_USB_SRC) $(POSIX_POLL_SRC)
107 +OS_SRC = $(NETBSD_USB_SRC)
111 -OS_SRC = $(POSIX_POLL_SRC)
113 +noinst_LTLIBRARIES = libusb_haiku.la
114 +libusb_haiku_la_SOURCES = $(HAIKU_USB_SRC)
115 +libusb_1_0_la_LIBADD = libusb_haiku.la
119 -OS_SRC = $(WINDOWS_USB_SRC)
122 +OS_SRC = $(WINDOWS_USBDK_SRC) $(WINDOWS_COMMON_SRC)
124 +OS_SRC = $(WINDOWS_USB_SRC) $(WINDOWS_COMMON_SRC)
128 $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
129 @@ -69,22 +77,23 @@ if CREATE_IMPORT_LIB
130 $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a
134 +POLL_SRC = $(WINDOWS_POLL_SRC)
136 +POLL_SRC = $(POSIX_POLL_SRC)
140 -THREADS_SRC = os/threads_posix.h os/threads_posix.c
141 +THREADS_SRC = $(POSIX_THREADS_SRC)
143 -THREADS_SRC = os/threads_windows.h os/threads_windows.c
144 +THREADS_SRC = $(WINDOWS_THREADS_SRC)
147 libusb_1_0_la_CFLAGS = $(AM_CFLAGS)
148 libusb_1_0_la_LDFLAGS = $(LTLDFLAGS)
149 -libusb_1_0_la_SOURCES = libusbi.h core.c descriptor.c io.c strerror.c sync.c \
150 - os/linux_usbfs.h os/darwin_usb.h os/windows_usb.h os/windows_common.h \
151 - hotplug.h hotplug.c $(THREADS_SRC) $(OS_SRC) \
152 - os/poll_posix.h os/poll_windows.h
155 -libusb_1_0_la_LIBADD = os/haiku/libhaikuusb.la
157 +libusb_1_0_la_SOURCES = libusbi.h libusb.h version.h version_nano.h \
158 + core.c descriptor.c hotplug.h hotplug.c io.c strerror.c sync.c \
159 + $(POLL_SRC) $(THREADS_SRC) $(OS_SRC)
161 hdrdir = $(includedir)/libusb-1.0
162 hdr_HEADERS = libusb.h