perl-cross: bump to version 1.1.4
[buildroot-gz.git] / package / libusb / 0001-parallel-make.patch
bloba326e9951646e6ea9f564086dd3e3fcd30bdaec2
1 Fix parallel build
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>
8 --- a/configure.ac
9 +++ b/configure.ac
10 @@ -36,6 +36,7 @@ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RU
12 AC_PREREQ([2.50])
13 AC_PROG_CC
14 +AC_PROG_CXX
15 LT_INIT
16 LT_LANG([Windows Resource])
17 AC_C_INLINE
18 @@ -91,7 +92,6 @@ case $host in
20 *-haiku*)
21 AC_MSG_RESULT([Haiku])
22 - AC_CONFIG_SUBDIRS([libusb/os/haiku])
23 backend="haiku"
24 threads="posix"
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
54 -DIST_SUBDIRS =
56 -EXTRA_DIST = $(LINUX_USBFS_SRC) $(DARWIN_USB_SRC) $(OPENBSD_USB_SRC) \
57 - $(NETBSD_USB_SRC) $(WINDOWS_USB_SRC) $(WINCE_USB_SRC) \
58 - $(POSIX_POLL_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
76 -dist-hook:
77 - cp -r os/haiku $(distdir)/os/haiku
78 - rm -rf $(distdir)/os/haiku/autom4te.cache
80 if OS_LINUX
82 if USE_UDEV
83 -OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
84 - os/linux_udev.c
85 +OS_SRC = $(LINUX_USBFS_SRC) os/linux_udev.c
86 else
87 -OS_SRC = $(LINUX_USBFS_SRC) $(POSIX_POLL_SRC) \
88 - os/linux_netlink.c
89 +OS_SRC = $(LINUX_USBFS_SRC) os/linux_netlink.c
90 endif
92 endif
94 if OS_DARWIN
95 -OS_SRC = $(DARWIN_USB_SRC) $(POSIX_POLL_SRC)
96 +OS_SRC = $(DARWIN_USB_SRC)
97 AM_CFLAGS_EXT = -no-cpp-precomp
98 endif
100 if OS_OPENBSD
101 -OS_SRC = $(OPENBSD_USB_SRC) $(POSIX_POLL_SRC)
102 +OS_SRC = $(OPENBSD_USB_SRC)
103 endif
105 if OS_NETBSD
106 -OS_SRC = $(NETBSD_USB_SRC) $(POSIX_POLL_SRC)
107 +OS_SRC = $(NETBSD_USB_SRC)
108 endif
110 if OS_HAIKU
111 -OS_SRC = $(POSIX_POLL_SRC)
112 -SUBDIRS = os/haiku
113 +noinst_LTLIBRARIES = libusb_haiku.la
114 +libusb_haiku_la_SOURCES = $(HAIKU_USB_SRC)
115 +libusb_1_0_la_LIBADD = libusb_haiku.la
116 endif
118 if OS_WINDOWS
119 -OS_SRC = $(WINDOWS_USB_SRC)
121 +if USE_USBDK
122 +OS_SRC = $(WINDOWS_USBDK_SRC) $(WINDOWS_COMMON_SRC)
123 +else
124 +OS_SRC = $(WINDOWS_USB_SRC) $(WINDOWS_COMMON_SRC)
125 +endif
127 .rc.lo:
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
131 endif
133 +if OS_WINDOWS
134 +POLL_SRC = $(WINDOWS_POLL_SRC)
135 +else
136 +POLL_SRC = $(POSIX_POLL_SRC)
137 +endif
139 if THREADS_POSIX
140 -THREADS_SRC = os/threads_posix.h os/threads_posix.c
141 +THREADS_SRC = $(POSIX_THREADS_SRC)
142 else
143 -THREADS_SRC = os/threads_windows.h os/threads_windows.c
144 +THREADS_SRC = $(WINDOWS_THREADS_SRC)
145 endif
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
154 -if OS_HAIKU
155 -libusb_1_0_la_LIBADD = os/haiku/libhaikuusb.la
156 -endif
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