usb 2.0.0-alpha.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/.gitmodules +1 -1
  2. package/CHANGELOG.md +100 -0
  3. package/README.md +573 -0
  4. package/binding.gyp +12 -2
  5. package/dist/index.d.ts +4 -4
  6. package/dist/index.js +14 -8
  7. package/dist/index.js.map +1 -1
  8. package/dist/usb/bindings.d.ts +13 -0
  9. package/dist/usb/bindings.js +2 -1
  10. package/dist/usb/bindings.js.map +1 -1
  11. package/dist/usb/index.js +86 -2
  12. package/dist/usb/index.js.map +1 -1
  13. package/dist/usb/interface.js.map +1 -1
  14. package/dist/webusb/index.d.ts +32 -19
  15. package/dist/webusb/index.js +163 -67
  16. package/dist/webusb/index.js.map +1 -1
  17. package/dist/webusb/webusb-device.d.ts +1 -1
  18. package/dist/webusb/webusb-device.js +27 -15
  19. package/dist/webusb/webusb-device.js.map +1 -1
  20. package/libusb/.private/pre-commit.sh +7 -1
  21. package/libusb/.travis.yml +49 -0
  22. package/libusb/AUTHORS +44 -3
  23. package/libusb/Brewfile +4 -0
  24. package/libusb/ChangeLog +74 -2
  25. package/libusb/README.md +32 -0
  26. package/libusb/TODO +1 -1
  27. package/libusb/Xcode/common.xcconfig +12 -0
  28. package/libusb/Xcode/config.h +25 -0
  29. package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +959 -1
  30. package/libusb/android/README +4 -2
  31. package/libusb/android/config.h +75 -0
  32. package/libusb/appveyor.yml +41 -0
  33. package/libusb/appveyor_cygwin.bat +11 -0
  34. package/libusb/appveyor_minGW.bat +19 -0
  35. package/libusb/autogen.sh +1 -1
  36. package/libusb/bootstrap.sh +3 -16
  37. package/libusb/configure.ac +108 -80
  38. package/libusb/doc/doxygen.cfg.in +1785 -739
  39. package/libusb/examples/Makefile.am +1 -1
  40. package/libusb/examples/dpfp.c +3 -1
  41. package/libusb/examples/dpfp_threaded.c +23 -10
  42. package/libusb/examples/ezusb.c +3 -3
  43. package/libusb/examples/ezusb.h +2 -2
  44. package/libusb/examples/fxload.c +31 -9
  45. package/libusb/examples/hotplugtest.c +35 -7
  46. package/libusb/examples/listdevs.c +3 -1
  47. package/libusb/examples/sam3u_benchmark.c +3 -3
  48. package/libusb/examples/testlibusb.c +277 -0
  49. package/libusb/examples/xusb.c +40 -34
  50. package/libusb/libusb/Makefile.am +49 -23
  51. package/libusb/libusb/core.c +855 -457
  52. package/libusb/libusb/descriptor.c +72 -78
  53. package/libusb/libusb/hotplug.c +122 -76
  54. package/libusb/libusb/hotplug.h +42 -25
  55. package/libusb/libusb/io.c +625 -390
  56. package/libusb/libusb/libusb-1.0.def +12 -0
  57. package/libusb/libusb/libusb.h +218 -150
  58. package/libusb/libusb/libusbi.h +346 -176
  59. package/libusb/libusb/os/darwin_usb.c +604 -319
  60. package/libusb/libusb/os/darwin_usb.h +61 -20
  61. package/libusb/libusb/os/haiku_pollfs.cpp +367 -0
  62. package/libusb/libusb/os/haiku_usb.h +113 -0
  63. package/libusb/libusb/os/haiku_usb_backend.cpp +533 -0
  64. package/libusb/libusb/os/haiku_usb_raw.cpp +267 -0
  65. package/libusb/libusb/os/haiku_usb_raw.h +188 -0
  66. package/libusb/libusb/os/linux_netlink.c +186 -146
  67. package/libusb/libusb/os/linux_udev.c +36 -14
  68. package/libusb/libusb/os/linux_usbfs.c +426 -225
  69. package/libusb/libusb/os/linux_usbfs.h +5 -3
  70. package/libusb/libusb/os/netbsd_usb.c +21 -77
  71. package/libusb/libusb/os/openbsd_usb.c +32 -115
  72. package/libusb/libusb/os/poll_posix.c +38 -5
  73. package/libusb/libusb/os/poll_posix.h +3 -0
  74. package/libusb/libusb/os/poll_windows.c +277 -626
  75. package/libusb/libusb/os/poll_windows.h +11 -44
  76. package/libusb/libusb/os/sunos_usb.c +1695 -0
  77. package/libusb/libusb/os/sunos_usb.h +80 -0
  78. package/libusb/libusb/os/threads_posix.c +24 -26
  79. package/libusb/libusb/os/threads_posix.h +73 -21
  80. package/libusb/libusb/os/threads_windows.c +71 -157
  81. package/libusb/libusb/os/threads_windows.h +68 -44
  82. package/libusb/libusb/os/wince_usb.c +276 -420
  83. package/libusb/libusb/os/wince_usb.h +23 -28
  84. package/libusb/libusb/os/windows_common.h +78 -58
  85. package/libusb/libusb/os/windows_nt_common.c +1010 -0
  86. package/libusb/libusb/os/windows_nt_common.h +110 -0
  87. package/libusb/libusb/os/windows_nt_shared_types.h +147 -0
  88. package/libusb/libusb/os/windows_usbdk.c +830 -0
  89. package/libusb/libusb/os/windows_usbdk.h +103 -0
  90. package/libusb/libusb/os/windows_winusb.c +4391 -0
  91. package/libusb/libusb/os/windows_winusb.h +783 -0
  92. package/libusb/libusb/strerror.c +41 -7
  93. package/libusb/libusb/sync.c +41 -13
  94. package/libusb/libusb/version.h +1 -1
  95. package/libusb/libusb/version_nano.h +1 -1
  96. package/libusb/libusb-1.0.pc.in +1 -1
  97. package/libusb/msvc/appveyor.bat +27 -0
  98. package/libusb/msvc/config.h +5 -4
  99. package/libusb/msvc/ddk_build.cmd +87 -43
  100. package/libusb/msvc/fxload_2010.vcxproj +24 -104
  101. package/libusb/msvc/fxload_2012.vcxproj +24 -107
  102. package/libusb/msvc/fxload_2013.vcxproj +24 -107
  103. package/libusb/msvc/fxload_2015.vcxproj +91 -0
  104. package/libusb/msvc/fxload_2017.vcxproj +114 -0
  105. package/libusb/msvc/fxload_sources +1 -1
  106. package/libusb/msvc/getopt_2010.vcxproj +16 -75
  107. package/libusb/msvc/getopt_2012.vcxproj +16 -79
  108. package/libusb/msvc/getopt_2013.vcxproj +16 -79
  109. package/libusb/msvc/getopt_2015.vcxproj +73 -0
  110. package/libusb/msvc/getopt_2017.vcxproj +98 -0
  111. package/libusb/msvc/getopt_sources +6 -2
  112. package/libusb/msvc/hotplugtest_2010.vcxproj +18 -99
  113. package/libusb/msvc/hotplugtest_2012.vcxproj +18 -102
  114. package/libusb/msvc/hotplugtest_2013.vcxproj +18 -102
  115. package/libusb/msvc/hotplugtest_2015.vcxproj +83 -0
  116. package/libusb/msvc/hotplugtest_2017.vcxproj +106 -0
  117. package/libusb/msvc/hotplugtest_sources +1 -1
  118. package/libusb/msvc/libusb_2005.sln +20 -20
  119. package/libusb/msvc/libusb_2010.sln +57 -46
  120. package/libusb/msvc/libusb_2012.sln +57 -46
  121. package/libusb/msvc/libusb_2013.sln +57 -50
  122. package/libusb/msvc/libusb_2015.sln +59 -52
  123. package/libusb/msvc/libusb_2017.sln +186 -0
  124. package/libusb/msvc/libusb_dll.dsp +2 -2
  125. package/libusb/msvc/libusb_dll_2005.vcproj +30 -2
  126. package/libusb/msvc/libusb_dll_2010.vcxproj +26 -90
  127. package/libusb/msvc/libusb_dll_2012.vcxproj +28 -96
  128. package/libusb/msvc/libusb_dll_2013.vcxproj +28 -96
  129. package/libusb/msvc/libusb_dll_2015.vcxproj +107 -0
  130. package/libusb/msvc/libusb_dll_2017.vcxproj +134 -0
  131. package/libusb/msvc/libusb_dll_wince.vcproj +9 -1
  132. package/libusb/msvc/libusb_sources +10 -5
  133. package/libusb/msvc/libusb_static.dsp +2 -2
  134. package/libusb/msvc/libusb_static_2005.vcproj +32 -4
  135. package/libusb/msvc/libusb_static_2010.vcxproj +24 -83
  136. package/libusb/msvc/libusb_static_2012.vcxproj +25 -87
  137. package/libusb/msvc/libusb_static_2013.vcxproj +25 -87
  138. package/libusb/msvc/libusb_static_2015.vcxproj +98 -0
  139. package/libusb/msvc/libusb_static_2017.vcxproj +117 -0
  140. package/libusb/msvc/libusb_static_wince.vcproj +20 -26
  141. package/libusb/msvc/libusb_wince.sln +88 -88
  142. package/libusb/msvc/listdevs_2010.vcxproj +16 -99
  143. package/libusb/msvc/listdevs_2012.vcxproj +16 -102
  144. package/libusb/msvc/listdevs_2013.vcxproj +16 -102
  145. package/libusb/msvc/listdevs_2015.vcxproj +83 -0
  146. package/libusb/msvc/listdevs_2017.vcxproj +106 -0
  147. package/libusb/msvc/listdevs_sources +2 -1
  148. package/libusb/msvc/stress_2010.vcxproj +20 -101
  149. package/libusb/msvc/stress_2012.vcxproj +20 -104
  150. package/libusb/msvc/stress_2013.vcxproj +20 -104
  151. package/libusb/msvc/stress_2015.vcxproj +87 -0
  152. package/libusb/msvc/stress_2017.vcxproj +110 -0
  153. package/libusb/msvc/stress_sources +21 -0
  154. package/libusb/msvc/testlibusb_2010.vcxproj +82 -0
  155. package/libusb/msvc/testlibusb_2012.vcxproj +83 -0
  156. package/libusb/msvc/testlibusb_2013.vcxproj +83 -0
  157. package/libusb/msvc/testlibusb_2015.vcxproj +83 -0
  158. package/libusb/msvc/testlibusb_2017.vcxproj +106 -0
  159. package/libusb/msvc/testlibusb_sources +20 -0
  160. package/libusb/msvc/xusb_2010.vcxproj +17 -98
  161. package/libusb/msvc/xusb_2012.vcxproj +17 -101
  162. package/libusb/msvc/xusb_2013.vcxproj +17 -101
  163. package/libusb/msvc/xusb_2015.vcxproj +83 -0
  164. package/libusb/msvc/xusb_2017.vcxproj +106 -0
  165. package/libusb/msvc/xusb_sources +1 -1
  166. package/libusb/tests/stress.c +2 -2
  167. package/libusb/tests/testlib.c +0 -4
  168. package/libusb/travis-autogen.sh +39 -0
  169. package/libusb.gypi +21 -2
  170. package/package.json +18 -13
  171. package/prebuilds/android-arm/node.napi.node +0 -0
  172. package/prebuilds/android-arm64/node.napi.node +0 -0
  173. package/prebuilds/darwin-x64+arm64/node.napi.node +0 -0
  174. package/prebuilds/linux-arm/node.napi.node +0 -0
  175. package/prebuilds/linux-arm64/node.napi.node +0 -0
  176. package/prebuilds/linux-ia32/node.napi.node +0 -0
  177. package/prebuilds/linux-x64/node.napi.node +0 -0
  178. package/prebuilds/win32-ia32/node.napi.node +0 -0
  179. package/prebuilds/win32-x64/node.napi.node +0 -0
  180. package/src/device.cc +7 -7
  181. package/src/node_usb.cc +43 -1
  182. package/src/node_usb.h +1 -0
  183. package/src/uv_async_queue.h +33 -25
  184. package/test/usb.coffee +6 -0
  185. package/tsc/index.ts +13 -7
  186. package/tsc/usb/bindings.ts +19 -1
  187. package/tsc/usb/index.ts +67 -19
  188. package/tsc/usb/interface.ts +2 -2
  189. package/tsc/webusb/index.ts +197 -74
  190. package/tsc/webusb/webusb-device.ts +30 -17
  191. package/.github/workflows/prebuild.yml +0 -48
  192. package/Readme.md +0 -339
  193. package/dist/webusb/typed-event-target.d.ts +0 -11
  194. package/dist/webusb/typed-event-target.js +0 -21
  195. package/dist/webusb/typed-event-target.js.map +0 -1
  196. package/docs/assets/css/main.css +0 -2660
  197. package/docs/assets/images/icons.png +0 -0
  198. package/docs/assets/images/icons@2x.png +0 -0
  199. package/docs/assets/images/widgets.png +0 -0
  200. package/docs/assets/images/widgets@2x.png +0 -0
  201. package/docs/assets/js/main.js +0 -248
  202. package/docs/assets/js/search.js +0 -1
  203. package/docs/classes/usb_bindings.device.html +0 -1338
  204. package/docs/classes/usb_bindings.libusbexception.html +0 -234
  205. package/docs/classes/usb_bindings.transfer.html +0 -344
  206. package/docs/classes/usb_capability.capability.html +0 -297
  207. package/docs/classes/usb_device.extendeddevice.html +0 -766
  208. package/docs/classes/usb_endpoint.endpoint.html +0 -472
  209. package/docs/classes/usb_endpoint.inendpoint.html +0 -766
  210. package/docs/classes/usb_endpoint.outendpoint.html +0 -582
  211. package/docs/classes/usb_interface.interface.html +0 -648
  212. package/docs/classes/webusb.webusb-1.html +0 -615
  213. package/docs/classes/webusb_mutex.mutex.html +0 -270
  214. package/docs/classes/webusb_typed_event_target.typedeventtarget.html +0 -443
  215. package/docs/classes/webusb_webusb_device.webusbdevice.html +0 -904
  216. package/docs/index.html +0 -500
  217. package/docs/interfaces/usb.deviceevents.html +0 -242
  218. package/docs/interfaces/usb_descriptors.bosdescriptor.html +0 -293
  219. package/docs/interfaces/usb_descriptors.capabilitydescriptor.html +0 -274
  220. package/docs/interfaces/usb_descriptors.configdescriptor.html +0 -388
  221. package/docs/interfaces/usb_descriptors.devicedescriptor.html +0 -464
  222. package/docs/interfaces/usb_descriptors.endpointdescriptor.html +0 -370
  223. package/docs/interfaces/usb_descriptors.interfacedescriptor.html +0 -407
  224. package/docs/interfaces/webusb.usboptions.html +0 -226
  225. package/docs/modules/index.html +0 -304
  226. package/docs/modules/usb.html +0 -173
  227. package/docs/modules/usb_bindings.html +0 -2248
  228. package/docs/modules/usb_capability.html +0 -156
  229. package/docs/modules/usb_descriptors.html +0 -176
  230. package/docs/modules/usb_device.html +0 -156
  231. package/docs/modules/usb_endpoint.html +0 -164
  232. package/docs/modules/usb_interface.html +0 -156
  233. package/docs/modules/webusb.html +0 -165
  234. package/docs/modules/webusb_mutex.html +0 -156
  235. package/docs/modules/webusb_typed_event_target.html +0 -156
  236. package/docs/modules/webusb_webusb_device.html +0 -156
  237. package/docs/modules.html +0 -156
  238. package/libusb/INSTALL +0 -234
  239. package/libusb/README +0 -28
  240. package/libusb/libusb/os/windows_usb.c +0 -5347
  241. package/libusb/libusb/os/windows_usb.h +0 -971
  242. package/libusb/msvc/fxload_2010.vcxproj.filters +0 -25
  243. package/libusb/msvc/fxload_2012.vcxproj.filters +0 -25
  244. package/libusb/msvc/getopt_2010.vcxproj.filters +0 -26
  245. package/libusb/msvc/getopt_2012.vcxproj.filters +0 -26
  246. package/libusb/msvc/hotplugtest_2010.vcxproj.filters +0 -14
  247. package/libusb/msvc/hotplugtest_2012.vcxproj.filters +0 -14
  248. package/libusb/msvc/libusb_dll_2010.vcxproj.filters +0 -81
  249. package/libusb/msvc/libusb_dll_2012.vcxproj.filters +0 -84
  250. package/libusb/msvc/libusb_static_2010.vcxproj.filters +0 -74
  251. package/libusb/msvc/libusb_static_2012.vcxproj.filters +0 -74
  252. package/libusb/msvc/listdevs_2010.vcxproj.filters +0 -14
  253. package/libusb/msvc/listdevs_2012.vcxproj.filters +0 -14
  254. package/libusb/msvc/stress_2010.vcxproj.filters +0 -25
  255. package/libusb/msvc/stress_2012.vcxproj.filters +0 -25
  256. package/libusb/msvc/xusb_2010.vcxproj.filters +0 -14
  257. package/libusb/msvc/xusb_2012.vcxproj.filters +0 -14
  258. package/tsc/webusb/typed-event-target.ts +0 -23
@@ -24,8 +24,10 @@ The libusb library, examples and tests can then be found in:
24
24
  Where $ARCH is one of:
25
25
  armeabi
26
26
  armeabi-v7a
27
+ mips
28
+ mips64
27
29
  x86
28
-
30
+ x86_64
29
31
 
30
32
  Installing:
31
33
  -----------
@@ -62,7 +64,7 @@ image of a running device:
62
64
  # Install libusb
63
65
  adb push obj/local/armeabi/libusb1.0.so /sdcard/
64
66
  adb shell su -c "cat > /system/lib/libusb1.0.so < /sdcard/libusb1.0.so"
65
- adb shell rm /system/lib/libusb1.0.so
67
+ adb shell rm /sdcard/libusb1.0.so
66
68
 
67
69
  # Install the samples and tests
68
70
  for B in listdevs fxload xusb sam3u_benchmark hotplugtest stress
@@ -0,0 +1,75 @@
1
+ /*
2
+ * Android build config for libusb
3
+ * Copyright © 2012-2013 RealVNC Ltd. <toby.gray@realvnc.com>
4
+ *
5
+ * This library is free software; you can redistribute it and/or
6
+ * modify it under the terms of the GNU Lesser General Public
7
+ * License as published by the Free Software Foundation; either
8
+ * version 2.1 of the License, or (at your option) any later version.
9
+ *
10
+ * This library is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
+ * Lesser General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU Lesser General Public
16
+ * License along with this library; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
+ */
19
+
20
+ /* Start with debug message logging enabled */
21
+ /* #undef ENABLE_DEBUG_LOGGING */
22
+
23
+ /* Message logging */
24
+ #define ENABLE_LOGGING
25
+
26
+ /* Define to 1 if you have the <dlfcn.h> header file. */
27
+ #define HAVE_DLFCN_H 1
28
+
29
+ /* Define to 1 if you have the <inttypes.h> header file. */
30
+ #define HAVE_INTTYPES_H 1
31
+
32
+ /* Linux backend */
33
+ #define OS_LINUX 1
34
+
35
+ /* Enable output to system log */
36
+ #define USE_SYSTEM_LOGGING_FACILITY 1
37
+
38
+ /* type of second poll() argument */
39
+ #define POLL_NFDS_TYPE nfds_t
40
+
41
+ /* Use POSIX Threads */
42
+ #define THREADS_POSIX 1
43
+
44
+ /* Default visibility */
45
+ #define DEFAULT_VISIBILITY __attribute__((visibility("default")))
46
+
47
+ /* Define to 1 if you have the <memory.h> header file. */
48
+ #define HAVE_MEMORY_H 1
49
+
50
+ /* Define to 1 if you have the <poll.h> header file. */
51
+ #define HAVE_POLL_H 1
52
+
53
+ /* Define to 1 if you have the <sys/stat.h> header file. */
54
+ #define HAVE_SYS_STAT_H 1
55
+
56
+ /* Define to 1 if you have the <sys/time.h> header file. */
57
+ #define HAVE_SYS_TIME_H 1
58
+
59
+ /* Define to 1 if you have the <sys/types.h> header file. */
60
+ #define HAVE_SYS_TYPES_H 1
61
+
62
+ /* Define to 1 if you have the <unistd.h> header file. */
63
+ #define HAVE_UNISTD_H 1
64
+
65
+ /* Define to 1 if you have the <linux/filter.h> header file. */
66
+ #define HAVE_LINUX_FILTER_H 1
67
+
68
+ /* Define to 1 if you have the <linux/netlink.h> header file. */
69
+ #define HAVE_LINUX_NETLINK_H 1
70
+
71
+ /* Define to 1 if you have the <asm/types.h> header file. */
72
+ #define HAVE_ASM_TYPES_H 1
73
+
74
+ /* Define to 1 if you have the <sys/socket.h> header file. */
75
+ #define HAVE_SYS_SOCKET_H 1
@@ -0,0 +1,41 @@
1
+ version: 1.0.{build}
2
+ configuration:
3
+ - Debug
4
+ - Release
5
+ platform:
6
+ - x64
7
+ - Win32
8
+ build:
9
+ project: msvc\libusb_2013.sln
10
+ parallel: true
11
+ verbosity: detailed
12
+ environment:
13
+ matrix:
14
+ - libusb_2015: msvc\libusb_2015.sln
15
+ libusb_2013: msvc\libusb_2013.sln
16
+ libusb_2012: msvc\libusb_2012.sln
17
+ libusb_2010: msvc\libusb_2010.sln
18
+ install:
19
+
20
+ - cmd: >-
21
+ rem Copying libusb to cygwin home directory
22
+
23
+ xcopy /S C:\projects\libusb C:\cygwin\home\appveyor\
24
+
25
+ rem Copying libusb to MinGW home directory
26
+
27
+ xcopy /S C:\projects\libusb C:\msys64\home\appveyor\
28
+
29
+ build_script:
30
+ - cmd: >-
31
+ msbuild %libusb_2015% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
32
+
33
+ msbuild %libusb_2013% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
34
+
35
+ msbuild %libusb_2012% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
36
+
37
+ msvc/appveyor.bat
38
+
39
+ appveyor_minGW.bat
40
+
41
+ appveyor_cygwin.bat
@@ -0,0 +1,11 @@
1
+ echo on
2
+ SetLocal EnableDelayedExpansion
3
+
4
+ if [%Configuration%] NEQ [Release] exit 0
5
+ if [%Platform%] NEQ [Win32] exit 0
6
+
7
+ C:\cygwin\bin\bash -e -l -c "./bootstrap.sh" || exit /B
8
+ C:\cygwin\bin\bash -e -l -c "mkdir build-Win32-cygwin" || exit /B
9
+ C:\cygwin\bin\bash -e -l -c "cd build-Win32-cygwin && ../configure --enable-examples-build --enable-tests-build" || exit /B
10
+ C:\cygwin\bin\bash -e -l -c "cd build-Win32-cygwin && make -j4" || exit /B
11
+ C:\cygwin\bin\bash -e -l -c "cd build-Win32-cygwin && make install" || exit /B
@@ -0,0 +1,19 @@
1
+ echo on
2
+ SetLocal EnableDelayedExpansion
3
+
4
+ if [%Configuration%] NEQ [Release] exit 0
5
+
6
+ if [%Platform%] NEQ [x64] goto Win32
7
+ C:\msys64\usr\bin\bash -e -l -c "./bootstrap.sh" || exit /B
8
+ C:\msys64\usr\bin\bash -e -l -c "mkdir build-x64" || exit /B
9
+ C:\msys64\usr\bin\bash -e -l -c "cd build-x64 && ../configure --prefix=/mingw64 --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32" || exit /B
10
+ C:\msys64\usr\bin\bash -e -l -c "cd build-x64 && make -j4" || exit /B
11
+ C:\msys64\usr\bin\bash -e -l -c "cd build-x64 && make install" || exit /B
12
+
13
+ :Win32
14
+ if [%Platform%] NEQ [Win32] exit 0
15
+ C:\msys64\usr\bin\bash -e -l -c "./bootstrap.sh" || exit /B
16
+ C:\msys64\usr\bin\bash -e -l -c "mkdir build-Win32" || exit /B
17
+ C:\msys64\usr\bin\bash -e -l -c "cd build-Win32 && ../configure --prefix=/mingw32 --build=i686-w64-mingw32 --host=i686-w64-mingw32" || exit /B
18
+ C:\msys64\usr\bin\bash -e -l -c "cd build-Win32 && make -j4" || exit /B
19
+ C:\msys64\usr\bin\bash -e -l -c "cd build-Win32 && make install" || exit /B
package/libusb/autogen.sh CHANGED
@@ -4,5 +4,5 @@ set -e
4
4
 
5
5
  ./bootstrap.sh
6
6
  if test -z "$NOCONFIGURE"; then
7
- exec ./configure --enable-maintainer-mode --enable-examples-build --enable-tests-build "$@"
7
+ exec ./configure --enable-examples-build --enable-tests-build "$@"
8
8
  fi
@@ -1,19 +1,6 @@
1
1
  #!/bin/sh
2
2
 
3
- set -e
4
-
5
- # use libtoolize if available, otherwise look for glibtoolize (darwin)
6
- if (libtoolize --version) < /dev/null > /dev/null 2>&1; then
7
- LIBTOOLIZE=libtoolize
8
- elif (glibtoolize --version) < /dev/null > /dev/null 2>&1; then
9
- LIBTOOLIZE=glibtoolize
10
- else
11
- echo "libtoolize or glibtoolize was not found! Please install libtool." 1>&2
12
- exit 1
3
+ if ! test -d m4 ; then
4
+ mkdir m4
13
5
  fi
14
-
15
- $LIBTOOLIZE --copy --force || exit 1
16
- aclocal || exit 1
17
- autoheader || exit 1
18
- autoconf || exit 1
19
- automake -a -c || exit 1
6
+ autoreconf -ivf || exit 1
@@ -21,21 +21,21 @@ AC_INIT([libusb],[LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC],[libusb
21
21
  # These numbers should be tweaked on every release. Read carefully:
22
22
  # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
23
23
  # http://sourceware.org/autobook/autobook/autobook_91.html
24
- lt_current="1"
25
- lt_revision="0"
26
- lt_age="1"
24
+ lt_current=2
25
+ lt_revision=0
26
+ lt_age=2
27
27
  LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}"
28
28
 
29
29
  AM_INIT_AUTOMAKE
30
- AM_MAINTAINER_MODE
31
30
 
32
31
  AC_CONFIG_SRCDIR([libusb/core.c])
33
32
  AC_CONFIG_MACRO_DIR([m4])
34
33
  AC_CONFIG_HEADERS([config.h])
35
34
  m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
36
35
 
37
- AC_PREREQ([2.50])
36
+ AC_PREREQ([2.69])
38
37
  AC_PROG_CC
38
+ AC_PROG_CXX
39
39
  LT_INIT
40
40
  LT_LANG([Windows Resource])
41
41
  AC_C_INLINE
@@ -50,87 +50,87 @@ dnl on linux-android platform, some functions are in different places
50
50
  case $host in
51
51
  *-linux-android*)
52
52
  AC_MSG_RESULT([This is a Linux-Android system])
53
- is_backend_android="yes"
53
+ is_backend_android=yes
54
54
  ;;
55
55
  *)
56
- is_backend_android="no"
56
+ is_backend_android=no
57
57
  esac
58
58
 
59
59
  case $host in
60
60
  *-linux* | *-uclinux*)
61
61
  AC_MSG_RESULT([Linux])
62
- backend="linux"
63
- threads="posix"
62
+ backend=linux
63
+ threads=posix
64
64
  ;;
65
65
  *-darwin*)
66
66
  AC_MSG_RESULT([Darwin/Mac OS X])
67
- backend="darwin"
68
- threads="posix"
67
+ backend=darwin
68
+ threads=posix
69
69
  ;;
70
70
  *-openbsd*)
71
71
  AC_MSG_RESULT([OpenBSD])
72
- backend="openbsd"
73
- threads="posix"
72
+ backend=openbsd
73
+ threads=posix
74
74
  ;;
75
75
  *-netbsd*)
76
76
  AC_MSG_RESULT([NetBSD])
77
- backend="netbsd"
78
- threads="posix"
77
+ backend=netbsd
78
+ threads=posix
79
79
  ;;
80
- *-mingw*)
80
+ *-mingw* | *msys*)
81
81
  AC_MSG_RESULT([Windows])
82
- backend="windows"
83
- threads="windows"
84
- create_import_lib="yes"
82
+ backend=windows
83
+ threads=windows
84
+ create_import_lib=yes
85
85
  AM_CFLAGS="${AM_CFLAGS} -fno-omit-frame-pointer"
86
86
  ;;
87
87
  *-cygwin*)
88
88
  AC_MSG_RESULT([Cygwin (using Windows backend)])
89
- backend="windows"
90
- threads="posix"
89
+ backend=windows
90
+ threads=posix
91
+ ;;
92
+ *-haiku*)
93
+ AC_MSG_RESULT([Haiku])
94
+ backend=haiku
95
+ threads=posix
96
+ ;;
97
+ *-solaris*)
98
+ AC_MSG_RESULT([SunOS])
99
+ backend=sunos
100
+ threads=posix
91
101
  ;;
92
102
  *)
93
- AC_MSG_ERROR([unsupported operating system])
103
+ AC_MSG_ERROR([unsupported operating system $host])
94
104
  esac
95
105
 
96
106
  case $backend in
97
107
  linux)
98
108
  AC_DEFINE(OS_LINUX, 1, [Linux backend])
99
109
  AC_SUBST(OS_LINUX)
100
- AC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread)
110
+ AC_SEARCH_LIBS([clock_gettime], [rt], [], [], [-pthread])
101
111
  AC_ARG_ENABLE([udev],
102
112
  [AC_HELP_STRING([--enable-udev], [use udev for device enumeration and hotplug support (recommended) [default=yes]])],
103
- [], [enable_udev="yes"])
104
- if test "x$enable_udev" = "xyes" ; then
113
+ [], [enable_udev=yes])
114
+ if test "x$enable_udev" = xyes ; then
105
115
  # system has udev. use it or fail!
106
- AC_CHECK_HEADERS([libudev.h],[],[AC_ERROR(["udev support requested but libudev not installed"])])
107
- AC_CHECK_LIB([udev], [udev_new], [], [AC_ERROR(["udev support requested but libudev not installed"])])
116
+ AC_CHECK_HEADERS([libudev.h], [], [AC_MSG_ERROR([udev support requested but libudev header not installed])])
117
+ AC_CHECK_LIB([udev], [udev_new], [], [AC_MSG_ERROR([udev support requested but libudev not installed])])
108
118
  AC_DEFINE(USE_UDEV, 1, [Use udev for device enumeration/hotplug])
109
119
  else
110
- AC_CHECK_HEADERS([asm/types.h sys/socket.h], [], [])
111
- AC_CHECK_HEADERS([linux/netlink.h linux/filter.h], [], [AC_ERROR(["Linux netlink headers not found"])], [
120
+ AC_CHECK_HEADERS([asm/types.h], [], [])
121
+ AC_CHECK_HEADERS([sys/socket.h linux/netlink.h], [], [AC_MSG_ERROR([Linux netlink headers not found])], [
112
122
  #ifdef HAVE_ASM_TYPES_H
113
123
  #include <asm/types.h>
114
124
  #endif
115
- #ifdef HAVE_SYS_SOCKET_H
116
125
  #include <sys/socket.h>
117
- #endif
118
126
  ])
119
127
  fi
120
128
  AC_SUBST(USE_UDEV)
121
129
 
122
- case $is_backend_android in
123
- yes)
124
- dnl some pthread functions is in libc
125
- THREAD_CFLAGS="-c"
126
- LIBS="${LIBS} -c"
127
- dnl there are gettimeofday function but configure doesn't seem to be able to find it.
128
- AC_DEFINE([HAVE_GETTIMEOFDAY], [1], [Define if you have gettimeofday])
129
- ;;
130
- *)
131
- THREAD_CFLAGS="-pthread"
132
- LIBS="${LIBS} -pthread"
133
- esac
130
+ if test "x$is_backend_android" != xyes; then
131
+ THREAD_CFLAGS="-pthread"
132
+ LIBS="${LIBS} -pthread"
133
+ fi
134
134
 
135
135
  AC_CHECK_HEADERS([poll.h])
136
136
  AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
@@ -154,6 +154,14 @@ openbsd)
154
154
  AC_CHECK_HEADERS([poll.h])
155
155
  AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
156
156
  ;;
157
+ sunos)
158
+ AC_DEFINE(OS_SUNOS, 1, [SunOS backend])
159
+ AC_SUBST(OS_SUNOS)
160
+ THREAD_CFLAGS="-pthread"
161
+ LIBS="-pthread -ldevinfo"
162
+ AC_CHECK_HEADERS([poll.h])
163
+ AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
164
+ ;;
157
165
  netbsd)
158
166
  AC_DEFINE(OS_NETBSD, 1, [NetBSD backend])
159
167
  AC_SUBST(OS_NETBSD)
@@ -169,6 +177,14 @@ windows)
169
177
  LTLDFLAGS="${LTLDFLAGS} -avoid-version -Wl,--add-stdcall-alias"
170
178
  AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument])
171
179
  AC_DEFINE([WINVER], 0x0501, [Oldest Windows version supported])
180
+ AC_DEFINE([_WIN32_WINNT], 0x0501, [Oldest Windows version supported])
181
+ ;;
182
+ haiku)
183
+ AC_DEFINE(OS_HAIKU, 1, [Haiku backend])
184
+ AC_SUBST(OS_HAIKU)
185
+ LIBS="${LIBS} -lbe"
186
+ AC_CHECK_HEADERS([poll.h])
187
+ AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
172
188
  ;;
173
189
  esac
174
190
 
@@ -177,12 +193,14 @@ AC_SUBST(LIBS)
177
193
  AM_CONDITIONAL(OS_LINUX, test "x$backend" = xlinux)
178
194
  AM_CONDITIONAL(OS_DARWIN, test "x$backend" = xdarwin)
179
195
  AM_CONDITIONAL(OS_OPENBSD, test "x$backend" = xopenbsd)
196
+ AM_CONDITIONAL(OS_SUNOS, test "x$backend" = xsunos)
180
197
  AM_CONDITIONAL(OS_NETBSD, test "x$backend" = xnetbsd)
181
198
  AM_CONDITIONAL(OS_WINDOWS, test "x$backend" = xwindows)
199
+ AM_CONDITIONAL(OS_HAIKU, test "x$backend" = xhaiku)
182
200
  AM_CONDITIONAL(THREADS_POSIX, test "x$threads" = xposix)
183
- AM_CONDITIONAL(CREATE_IMPORT_LIB, test "x$create_import_lib" = "xyes")
201
+ AM_CONDITIONAL(CREATE_IMPORT_LIB, test "x$create_import_lib" = xyes)
184
202
  AM_CONDITIONAL(USE_UDEV, test "x$enable_udev" = xyes)
185
- if test "$threads" = posix; then
203
+ if test "x$threads" = xposix; then
186
204
  AC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads])
187
205
  fi
188
206
 
@@ -191,22 +209,22 @@ AC_CHECK_HEADER([sys/timerfd.h], [timerfd_h=1], [timerfd_h=0])
191
209
  AC_ARG_ENABLE([timerfd],
192
210
  [AS_HELP_STRING([--enable-timerfd],
193
211
  [use timerfd for timing [default=auto]])],
194
- [use_timerfd=$enableval], [use_timerfd='auto'])
212
+ [use_timerfd=$enableval], [use_timerfd=auto])
195
213
 
196
- if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then
214
+ if test "x$use_timerfd" = xyes -a "x$timerfd_h" = x0; then
197
215
  AC_MSG_ERROR([timerfd header not available; glibc 2.9+ required])
198
216
  fi
199
217
 
200
- AC_CHECK_DECL([TFD_NONBLOCK], [tfd_hdr_ok=yes], [tfd_hdr_ok=no], [#include <sys/timerfd.h>])
201
- if test "x$use_timerfd" = "xyes" -a "x$tfd_hdr_ok" = "xno"; then
218
+ AC_CHECK_DECLS([TFD_NONBLOCK, TFD_CLOEXEC], [tfd_hdr_ok=yes], [tfd_hdr_ok=no], [#include <sys/timerfd.h>])
219
+ if test "x$use_timerfd" = xyes -a "x$tfd_hdr_ok" = xno; then
202
220
  AC_MSG_ERROR([timerfd header not usable; glibc 2.9+ required])
203
221
  fi
204
222
 
205
223
  AC_MSG_CHECKING([whether to use timerfd for timing])
206
- if test "x$use_timerfd" = "xno"; then
224
+ if test "x$use_timerfd" = xno; then
207
225
  AC_MSG_RESULT([no (disabled by user)])
208
226
  else
209
- if test "x$timerfd_h" = "x1" -a "x$tfd_hdr_ok" = "xyes"; then
227
+ if test "x$timerfd_h" = x1 -a "x$tfd_hdr_ok" = xyes; then
210
228
  AC_MSG_RESULT([yes])
211
229
  AC_DEFINE(USBI_TIMERFD_AVAILABLE, 1, [timerfd headers available])
212
230
  else
@@ -214,52 +232,60 @@ else
214
232
  fi
215
233
  fi
216
234
 
217
- AC_CHECK_TYPES(struct timespec)
235
+ AC_CHECK_FUNCS([pipe2])
236
+ AC_CHECK_TYPES([struct timespec])
218
237
 
219
238
  # Message logging
220
239
  AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])],
221
240
  [log_enabled=$enableval],
222
- [log_enabled='yes'])
223
- if test "x$log_enabled" != "xno"; then
241
+ [log_enabled=yes])
242
+ if test "x$log_enabled" != xno; then
224
243
  AC_DEFINE([ENABLE_LOGGING], 1, [Message logging])
225
244
  fi
226
245
 
227
246
  AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],
228
247
  [start with debug message logging enabled [default=no]])],
229
248
  [debug_log_enabled=$enableval],
230
- [debug_log_enabled='no'])
231
- if test "x$debug_log_enabled" != "xno"; then
249
+ [debug_log_enabled=no])
250
+ if test "x$debug_log_enabled" != xno; then
232
251
  AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Start with debug message logging enabled])
233
252
  fi
234
253
 
235
254
  AC_ARG_ENABLE([system-log], [AS_HELP_STRING([--enable-system-log],
236
255
  [output logging messages to system wide log, if supported by the OS [default=no]])],
237
256
  [system_log_enabled=$enableval],
238
- [system_log_enabled='no'])
239
- if test "x$system_log_enabled" != "xno"; then
257
+ [system_log_enabled=no])
258
+ if test "x$system_log_enabled" != xno; then
240
259
  AC_DEFINE([USE_SYSTEM_LOGGING_FACILITY], 1, [Enable output to system log])
241
- fi
242
260
 
243
- # Check if syslog is available in standard C library
244
- AC_CHECK_HEADERS(syslog.h)
245
- AC_CHECK_FUNC([syslog], [have_syslog=yes], [have_syslog=no])
246
- if test "x$have_syslog" != "xno"; then
247
- AC_DEFINE([HAVE_SYSLOG_FUNC], 1, [syslog() function available])
261
+ # Check if syslog is available in standard C library
262
+ AC_CHECK_HEADERS(syslog.h)
263
+ AC_CHECK_FUNC([syslog], [have_syslog=yes], [have_syslog=no])
264
+ if test "x$have_syslog" != xno; then
265
+ AC_DEFINE([HAVE_SYSLOG_FUNC], 1, [syslog() function available])
266
+ fi
248
267
  fi
249
268
 
250
269
  # Examples build
251
270
  AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
252
271
  [build example applications [default=no]])],
253
272
  [build_examples=$enableval],
254
- [build_examples='no'])
255
- AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
273
+ [build_examples=no])
274
+ AM_CONDITIONAL(BUILD_EXAMPLES, test "x$build_examples" != xno)
256
275
 
257
276
  # Tests build
258
277
  AC_ARG_ENABLE([tests-build], [AS_HELP_STRING([--enable-tests-build],
259
278
  [build test applications [default=no]])],
260
279
  [build_tests=$enableval],
261
- [build_tests='no'])
262
- AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != "xno"])
280
+ [build_tests=no])
281
+ AM_CONDITIONAL(BUILD_TESTS, test "x$build_tests" != xno)
282
+
283
+ # headers not available on all platforms but required on others
284
+ AC_CHECK_HEADERS([sys/time.h])
285
+
286
+ # sigaction not available on MinGW
287
+ AC_CHECK_FUNC([sigaction], [have_sigaction=yes], [have_sigaction=no])
288
+ AM_CONDITIONAL(HAVE_SIGACTION, test "x$have_sigaction" = xyes)
263
289
 
264
290
  # check for -fvisibility=hidden compiler support (GCC >= 3.4)
265
291
  saved_cflags="$CFLAGS"
@@ -267,9 +293,9 @@ saved_cflags="$CFLAGS"
267
293
  CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
268
294
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
269
295
  [VISIBILITY_CFLAGS="-fvisibility=hidden"
270
- AC_DEFINE([DEFAULT_VISIBILITY], [__attribute__((visibility("default")))], [Default visibility]) ],
271
- [ VISIBILITY_CFLAGS=""
272
- AC_DEFINE([DEFAULT_VISIBILITY], [], [Default visibility]) ],
296
+ AC_DEFINE([DEFAULT_VISIBILITY], [__attribute__((visibility("default")))], [Default visibility])],
297
+ [VISIBILITY_CFLAGS=""
298
+ AC_DEFINE([DEFAULT_VISIBILITY], [], [Default visibility])],
273
299
  ])
274
300
  CFLAGS="$saved_cflags"
275
301
 
@@ -280,16 +306,18 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
280
306
  nopointersign_cflags="-Wno-pointer-sign", nopointersign_cflags="")
281
307
  CFLAGS="$saved_cflags"
282
308
 
283
- # sigaction not available on MinGW
284
- AC_CHECK_FUNC([sigaction], [have_sigaction=yes], [have_sigaction=no])
285
- AM_CONDITIONAL([HAVE_SIGACTION], [test "x$have_sigaction" = "xyes"])
286
-
287
- # headers not available on all platforms but required on others
288
- AC_CHECK_HEADERS([sys/time.h])
289
- AC_CHECK_FUNCS(gettimeofday)
290
- AC_CHECK_HEADERS([signal.h])
309
+ # check for -std=gnu99 compiler support
310
+ saved_cflags="$CFLAGS"
311
+ CFLAGS="-std=gnu99"
312
+ AC_MSG_CHECKING([whether CC supports -std=gnu99])
313
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
314
+ [AC_MSG_RESULT([yes])]
315
+ [AM_CFLAGS="${AM_CFLAGS} -std=gnu99"],
316
+ [AC_MSG_RESULT([no])]
317
+ )
318
+ CFLAGS="$saved_cflags"
291
319
 
292
- AM_CFLAGS="${AM_CFLAGS} -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow ${THREAD_CFLAGS} ${VISIBILITY_CFLAGS}"
320
+ AM_CFLAGS="${AM_CFLAGS} -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow ${THREAD_CFLAGS} ${VISIBILITY_CFLAGS}"
293
321
 
294
322
  AC_SUBST(AM_CFLAGS)
295
323
  AC_SUBST(LTLDFLAGS)