usb 1.7.2-prebuild

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 (183) hide show
  1. package/.github/workflows/prebuild.yml +62 -0
  2. package/.gitmodules +3 -0
  3. package/LICENSE +7 -0
  4. package/Readme.md +339 -0
  5. package/binding.gyp +90 -0
  6. package/libusb/.gitattributes +11 -0
  7. package/libusb/.private/README.txt +5 -0
  8. package/libusb/.private/bd.cmd +89 -0
  9. package/libusb/.private/bm.sh +54 -0
  10. package/libusb/.private/bwince.cmd +57 -0
  11. package/libusb/.private/post-rewrite.sh +28 -0
  12. package/libusb/.private/pre-commit.sh +42 -0
  13. package/libusb/.private/wbs.txt +61 -0
  14. package/libusb/.private/wbs_wince.txt +42 -0
  15. package/libusb/AUTHORS +78 -0
  16. package/libusb/COPYING +504 -0
  17. package/libusb/ChangeLog +211 -0
  18. package/libusb/INSTALL +234 -0
  19. package/libusb/INSTALL_WIN.txt +73 -0
  20. package/libusb/Makefile.am +28 -0
  21. package/libusb/NEWS +2 -0
  22. package/libusb/PORTING +94 -0
  23. package/libusb/README +28 -0
  24. package/libusb/README.git +41 -0
  25. package/libusb/TODO +2 -0
  26. package/libusb/Xcode/common.xcconfig +49 -0
  27. package/libusb/Xcode/debug.xcconfig +29 -0
  28. package/libusb/Xcode/libusb.xcconfig +21 -0
  29. package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +1 -0
  30. package/libusb/Xcode/libusb_debug.xcconfig +21 -0
  31. package/libusb/Xcode/libusb_release.xcconfig +21 -0
  32. package/libusb/Xcode/release.xcconfig +30 -0
  33. package/libusb/android/README +114 -0
  34. package/libusb/android/jni/Android.mk +23 -0
  35. package/libusb/android/jni/Application.mk +24 -0
  36. package/libusb/android/jni/examples.mk +134 -0
  37. package/libusb/android/jni/libusb.mk +54 -0
  38. package/libusb/android/jni/tests.mk +56 -0
  39. package/libusb/autogen.sh +8 -0
  40. package/libusb/bootstrap.sh +19 -0
  41. package/libusb/configure.ac +304 -0
  42. package/libusb/doc/Makefile.am +9 -0
  43. package/libusb/doc/doxygen.cfg.in +1288 -0
  44. package/libusb/doc/libusb.png +0 -0
  45. package/libusb/examples/Makefile.am +19 -0
  46. package/libusb/examples/dpfp.c +506 -0
  47. package/libusb/examples/dpfp_threaded.c +544 -0
  48. package/libusb/examples/ezusb.c +831 -0
  49. package/libusb/examples/ezusb.h +120 -0
  50. package/libusb/examples/fxload.c +287 -0
  51. package/libusb/examples/getopt/getopt.c +1060 -0
  52. package/libusb/examples/getopt/getopt.h +180 -0
  53. package/libusb/examples/getopt/getopt1.c +188 -0
  54. package/libusb/examples/hotplugtest.c +104 -0
  55. package/libusb/examples/listdevs.c +71 -0
  56. package/libusb/examples/sam3u_benchmark.c +193 -0
  57. package/libusb/examples/xusb.c +1129 -0
  58. package/libusb/libusb/Makefile.am +75 -0
  59. package/libusb/libusb/core.c +2342 -0
  60. package/libusb/libusb/descriptor.c +1199 -0
  61. package/libusb/libusb/hotplug.c +327 -0
  62. package/libusb/libusb/hotplug.h +82 -0
  63. package/libusb/libusb/io.c +2631 -0
  64. package/libusb/libusb/libusb-1.0.def +166 -0
  65. package/libusb/libusb/libusb-1.0.rc +61 -0
  66. package/libusb/libusb/libusb.h +1998 -0
  67. package/libusb/libusb/libusbi.h +1040 -0
  68. package/libusb/libusb/os/darwin_usb.c +2009 -0
  69. package/libusb/libusb/os/darwin_usb.h +162 -0
  70. package/libusb/libusb/os/linux_netlink.c +369 -0
  71. package/libusb/libusb/os/linux_udev.c +307 -0
  72. package/libusb/libusb/os/linux_usbfs.c +2695 -0
  73. package/libusb/libusb/os/linux_usbfs.h +192 -0
  74. package/libusb/libusb/os/netbsd_usb.c +738 -0
  75. package/libusb/libusb/os/openbsd_usb.c +832 -0
  76. package/libusb/libusb/os/poll_posix.c +51 -0
  77. package/libusb/libusb/os/poll_posix.h +11 -0
  78. package/libusb/libusb/os/poll_windows.c +796 -0
  79. package/libusb/libusb/os/poll_windows.h +131 -0
  80. package/libusb/libusb/os/threads_posix.c +82 -0
  81. package/libusb/libusb/os/threads_posix.h +50 -0
  82. package/libusb/libusb/os/threads_windows.c +212 -0
  83. package/libusb/libusb/os/threads_windows.h +87 -0
  84. package/libusb/libusb/os/wince_usb.c +1032 -0
  85. package/libusb/libusb/os/wince_usb.h +131 -0
  86. package/libusb/libusb/os/windows_common.h +108 -0
  87. package/libusb/libusb/os/windows_usb.c +5347 -0
  88. package/libusb/libusb/os/windows_usb.h +971 -0
  89. package/libusb/libusb/strerror.c +199 -0
  90. package/libusb/libusb/sync.c +307 -0
  91. package/libusb/libusb/version.h +18 -0
  92. package/libusb/libusb/version_nano.h +1 -0
  93. package/libusb/libusb-1.0.pc.in +11 -0
  94. package/libusb/msvc/config.h +50 -0
  95. package/libusb/msvc/ddk_build.cmd +175 -0
  96. package/libusb/msvc/errno.h +102 -0
  97. package/libusb/msvc/fxload_2010.vcxproj +170 -0
  98. package/libusb/msvc/fxload_2010.vcxproj.filters +25 -0
  99. package/libusb/msvc/fxload_2012.vcxproj +174 -0
  100. package/libusb/msvc/fxload_2012.vcxproj.filters +25 -0
  101. package/libusb/msvc/fxload_2013.vcxproj +174 -0
  102. package/libusb/msvc/fxload_sources +23 -0
  103. package/libusb/msvc/getopt_2005.vcproj +288 -0
  104. package/libusb/msvc/getopt_2010.vcxproj +131 -0
  105. package/libusb/msvc/getopt_2010.vcxproj.filters +26 -0
  106. package/libusb/msvc/getopt_2012.vcxproj +136 -0
  107. package/libusb/msvc/getopt_2012.vcxproj.filters +26 -0
  108. package/libusb/msvc/getopt_2013.vcxproj +136 -0
  109. package/libusb/msvc/getopt_sources +20 -0
  110. package/libusb/msvc/hotplugtest_2010.vcxproj +163 -0
  111. package/libusb/msvc/hotplugtest_2010.vcxproj.filters +14 -0
  112. package/libusb/msvc/hotplugtest_2012.vcxproj +167 -0
  113. package/libusb/msvc/hotplugtest_2012.vcxproj.filters +14 -0
  114. package/libusb/msvc/hotplugtest_2013.vcxproj +167 -0
  115. package/libusb/msvc/hotplugtest_sources +20 -0
  116. package/libusb/msvc/inttypes.h +295 -0
  117. package/libusb/msvc/libusb.dsw +71 -0
  118. package/libusb/msvc/libusb_2005.sln +95 -0
  119. package/libusb/msvc/libusb_2010.sln +94 -0
  120. package/libusb/msvc/libusb_2012.sln +94 -0
  121. package/libusb/msvc/libusb_2013.sln +100 -0
  122. package/libusb/msvc/libusb_2015.sln +100 -0
  123. package/libusb/msvc/libusb_dll.dsp +194 -0
  124. package/libusb/msvc/libusb_dll_2005.vcproj +436 -0
  125. package/libusb/msvc/libusb_dll_2010.vcxproj +170 -0
  126. package/libusb/msvc/libusb_dll_2010.vcxproj.filters +81 -0
  127. package/libusb/msvc/libusb_dll_2012.vcxproj +175 -0
  128. package/libusb/msvc/libusb_dll_2012.vcxproj.filters +84 -0
  129. package/libusb/msvc/libusb_dll_2013.vcxproj +175 -0
  130. package/libusb/msvc/libusb_dll_wince.vcproj +1243 -0
  131. package/libusb/msvc/libusb_sources +38 -0
  132. package/libusb/msvc/libusb_static.dsp +174 -0
  133. package/libusb/msvc/libusb_static_2005.vcproj +362 -0
  134. package/libusb/msvc/libusb_static_2010.vcxproj +156 -0
  135. package/libusb/msvc/libusb_static_2010.vcxproj.filters +74 -0
  136. package/libusb/msvc/libusb_static_2012.vcxproj +160 -0
  137. package/libusb/msvc/libusb_static_2012.vcxproj.filters +74 -0
  138. package/libusb/msvc/libusb_static_2013.vcxproj +160 -0
  139. package/libusb/msvc/libusb_static_wince.vcproj +1185 -0
  140. package/libusb/msvc/libusb_wince.sln +246 -0
  141. package/libusb/msvc/listdevs.dsp +103 -0
  142. package/libusb/msvc/listdevs_2005.vcproj +360 -0
  143. package/libusb/msvc/listdevs_2010.vcxproj +165 -0
  144. package/libusb/msvc/listdevs_2010.vcxproj.filters +14 -0
  145. package/libusb/msvc/listdevs_2012.vcxproj +169 -0
  146. package/libusb/msvc/listdevs_2012.vcxproj.filters +14 -0
  147. package/libusb/msvc/listdevs_2013.vcxproj +169 -0
  148. package/libusb/msvc/listdevs_sources +19 -0
  149. package/libusb/msvc/listdevs_wince.vcproj +1120 -0
  150. package/libusb/msvc/missing.c +80 -0
  151. package/libusb/msvc/missing.h +32 -0
  152. package/libusb/msvc/stdint.h +256 -0
  153. package/libusb/msvc/stress_2005.vcproj +390 -0
  154. package/libusb/msvc/stress_2010.vcxproj +167 -0
  155. package/libusb/msvc/stress_2010.vcxproj.filters +25 -0
  156. package/libusb/msvc/stress_2012.vcxproj +171 -0
  157. package/libusb/msvc/stress_2012.vcxproj.filters +25 -0
  158. package/libusb/msvc/stress_2013.vcxproj +171 -0
  159. package/libusb/msvc/stress_wince.vcproj +1128 -0
  160. package/libusb/msvc/xusb.dsp +102 -0
  161. package/libusb/msvc/xusb_2005.vcproj +344 -0
  162. package/libusb/msvc/xusb_2010.vcxproj +163 -0
  163. package/libusb/msvc/xusb_2010.vcxproj.filters +14 -0
  164. package/libusb/msvc/xusb_2012.vcxproj +167 -0
  165. package/libusb/msvc/xusb_2012.vcxproj.filters +14 -0
  166. package/libusb/msvc/xusb_2013.vcxproj +167 -0
  167. package/libusb/msvc/xusb_sources +20 -0
  168. package/libusb/msvc/xusb_wince.vcproj +1120 -0
  169. package/libusb/tests/Makefile.am +6 -0
  170. package/libusb/tests/libusb_testlib.h +107 -0
  171. package/libusb/tests/stress.c +160 -0
  172. package/libusb/tests/testlib.c +281 -0
  173. package/libusb.gypi +136 -0
  174. package/libusb_config/config.h +1 -0
  175. package/package.json +69 -0
  176. package/src/device.cc +412 -0
  177. package/src/helpers.h +64 -0
  178. package/src/node_usb.cc +319 -0
  179. package/src/node_usb.h +120 -0
  180. package/src/transfer.cc +148 -0
  181. package/src/uv_async_queue.h +33 -0
  182. package/test/usb.coffee +191 -0
  183. package/usb.js +524 -0
@@ -0,0 +1,304 @@
1
+ dnl These m4 macros are whitespace sensitive and break if moved around much.
2
+ m4_define([LU_VERSION_H], m4_include([libusb/version.h]))
3
+ m4_define([LU_DEFINE_VERSION_ATOM],
4
+ [m4_define([$1], m4_bregexp(LU_VERSION_H,
5
+ [^#define\s*$1\s*\([0-9]*\).*], [\1]))])
6
+ m4_define([LU_DEFINE_VERSION_RC_ATOM],
7
+ [m4_define([$1], m4_bregexp(LU_VERSION_H,
8
+ [^#define\s*$1\s*"\(-rc[0-9]*\)".*], [\1]))])
9
+ dnl The m4_bregexp() returns (only) the numbers following the #define named
10
+ dnl in the first macro parameter. m4_define() then defines the name for use
11
+ dnl in AC_INIT.
12
+
13
+ LU_DEFINE_VERSION_ATOM([LIBUSB_MAJOR])
14
+ LU_DEFINE_VERSION_ATOM([LIBUSB_MINOR])
15
+ LU_DEFINE_VERSION_ATOM([LIBUSB_MICRO])
16
+ LU_DEFINE_VERSION_RC_ATOM([LIBUSB_RC])
17
+
18
+ AC_INIT([libusb],[LIBUSB_MAJOR[.]LIBUSB_MINOR[.]LIBUSB_MICRO[]LIBUSB_RC],[libusb-devel@lists.sourceforge.net],[libusb],[http://libusb.info])
19
+
20
+ # Library versioning
21
+ # These numbers should be tweaked on every release. Read carefully:
22
+ # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
23
+ # http://sourceware.org/autobook/autobook/autobook_91.html
24
+ lt_current="1"
25
+ lt_revision="0"
26
+ lt_age="1"
27
+ LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}"
28
+
29
+ AM_INIT_AUTOMAKE
30
+ AM_MAINTAINER_MODE
31
+
32
+ AC_CONFIG_SRCDIR([libusb/core.c])
33
+ AC_CONFIG_MACRO_DIR([m4])
34
+ AC_CONFIG_HEADERS([config.h])
35
+ m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
36
+
37
+ AC_PREREQ([2.50])
38
+ AC_PROG_CC
39
+ LT_INIT
40
+ LT_LANG([Windows Resource])
41
+ AC_C_INLINE
42
+ AM_PROG_CC_C_O
43
+ AC_DEFINE([_GNU_SOURCE], 1, [Use GNU extensions])
44
+
45
+ LTLDFLAGS="${LTLDFLAGS} -no-undefined"
46
+
47
+ AC_MSG_CHECKING([operating system])
48
+
49
+ dnl on linux-android platform, some functions are in different places
50
+ case $host in
51
+ *-linux-android*)
52
+ AC_MSG_RESULT([This is a Linux-Android system])
53
+ is_backend_android="yes"
54
+ ;;
55
+ *)
56
+ is_backend_android="no"
57
+ esac
58
+
59
+ case $host in
60
+ *-linux* | *-uclinux*)
61
+ AC_MSG_RESULT([Linux])
62
+ backend="linux"
63
+ threads="posix"
64
+ ;;
65
+ *-darwin*)
66
+ AC_MSG_RESULT([Darwin/Mac OS X])
67
+ backend="darwin"
68
+ threads="posix"
69
+ ;;
70
+ *-openbsd*)
71
+ AC_MSG_RESULT([OpenBSD])
72
+ backend="openbsd"
73
+ threads="posix"
74
+ ;;
75
+ *-netbsd*)
76
+ AC_MSG_RESULT([NetBSD])
77
+ backend="netbsd"
78
+ threads="posix"
79
+ ;;
80
+ *-mingw*)
81
+ AC_MSG_RESULT([Windows])
82
+ backend="windows"
83
+ threads="windows"
84
+ create_import_lib="yes"
85
+ AM_CFLAGS="${AM_CFLAGS} -fno-omit-frame-pointer"
86
+ ;;
87
+ *-cygwin*)
88
+ AC_MSG_RESULT([Cygwin (using Windows backend)])
89
+ backend="windows"
90
+ threads="posix"
91
+ ;;
92
+ *)
93
+ AC_MSG_ERROR([unsupported operating system])
94
+ esac
95
+
96
+ case $backend in
97
+ linux)
98
+ AC_DEFINE(OS_LINUX, 1, [Linux backend])
99
+ AC_SUBST(OS_LINUX)
100
+ AC_SEARCH_LIBS(clock_gettime, rt, [], [], -pthread)
101
+ AC_ARG_ENABLE([udev],
102
+ [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
105
+ # 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"])])
108
+ AC_DEFINE(USE_UDEV, 1, [Use udev for device enumeration/hotplug])
109
+ 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"])], [
112
+ #ifdef HAVE_ASM_TYPES_H
113
+ #include <asm/types.h>
114
+ #endif
115
+ #ifdef HAVE_SYS_SOCKET_H
116
+ #include <sys/socket.h>
117
+ #endif
118
+ ])
119
+ fi
120
+ AC_SUBST(USE_UDEV)
121
+
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
134
+
135
+ AC_CHECK_HEADERS([poll.h])
136
+ AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
137
+ ;;
138
+ darwin)
139
+ AC_DEFINE(OS_DARWIN, 1, [Darwin backend])
140
+ AC_SUBST(OS_DARWIN)
141
+ LIBS="-lobjc -Wl,-framework,IOKit -Wl,-framework,CoreFoundation"
142
+ LTLDFLAGS="${LTLDFLAGS} -Wl,-prebind"
143
+ AC_CHECK_HEADERS([poll.h])
144
+ AC_CHECK_TYPE([nfds_t],
145
+ [AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])],
146
+ [AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument])],
147
+ [#include <poll.h>])
148
+ ;;
149
+ openbsd)
150
+ AC_DEFINE(OS_OPENBSD, 1, [OpenBSD backend])
151
+ AC_SUBST(OS_OPENBSD)
152
+ THREAD_CFLAGS="-pthread"
153
+ LIBS="-pthread"
154
+ AC_CHECK_HEADERS([poll.h])
155
+ AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
156
+ ;;
157
+ netbsd)
158
+ AC_DEFINE(OS_NETBSD, 1, [NetBSD backend])
159
+ AC_SUBST(OS_NETBSD)
160
+ THREAD_CFLAGS="-pthread"
161
+ LIBS="-pthread"
162
+ AC_CHECK_HEADERS([poll.h])
163
+ AC_DEFINE([POLL_NFDS_TYPE],[nfds_t],[type of second poll() argument])
164
+ ;;
165
+ windows)
166
+ AC_DEFINE(OS_WINDOWS, 1, [Windows backend])
167
+ AC_SUBST(OS_WINDOWS)
168
+ LIBS=""
169
+ LTLDFLAGS="${LTLDFLAGS} -avoid-version -Wl,--add-stdcall-alias"
170
+ AC_DEFINE([POLL_NFDS_TYPE],[unsigned int],[type of second poll() argument])
171
+ AC_DEFINE([WINVER], 0x0501, [Oldest Windows version supported])
172
+ ;;
173
+ esac
174
+
175
+ AC_SUBST(LIBS)
176
+
177
+ AM_CONDITIONAL(OS_LINUX, test "x$backend" = xlinux)
178
+ AM_CONDITIONAL(OS_DARWIN, test "x$backend" = xdarwin)
179
+ AM_CONDITIONAL(OS_OPENBSD, test "x$backend" = xopenbsd)
180
+ AM_CONDITIONAL(OS_NETBSD, test "x$backend" = xnetbsd)
181
+ AM_CONDITIONAL(OS_WINDOWS, test "x$backend" = xwindows)
182
+ AM_CONDITIONAL(THREADS_POSIX, test "x$threads" = xposix)
183
+ AM_CONDITIONAL(CREATE_IMPORT_LIB, test "x$create_import_lib" = "xyes")
184
+ AM_CONDITIONAL(USE_UDEV, test "x$enable_udev" = xyes)
185
+ if test "$threads" = posix; then
186
+ AC_DEFINE(THREADS_POSIX, 1, [Use POSIX Threads])
187
+ fi
188
+
189
+ # timerfd
190
+ AC_CHECK_HEADER([sys/timerfd.h], [timerfd_h=1], [timerfd_h=0])
191
+ AC_ARG_ENABLE([timerfd],
192
+ [AS_HELP_STRING([--enable-timerfd],
193
+ [use timerfd for timing [default=auto]])],
194
+ [use_timerfd=$enableval], [use_timerfd='auto'])
195
+
196
+ if test "x$use_timerfd" = "xyes" -a "x$timerfd_h" = "x0"; then
197
+ AC_MSG_ERROR([timerfd header not available; glibc 2.9+ required])
198
+ fi
199
+
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
202
+ AC_MSG_ERROR([timerfd header not usable; glibc 2.9+ required])
203
+ fi
204
+
205
+ AC_MSG_CHECKING([whether to use timerfd for timing])
206
+ if test "x$use_timerfd" = "xno"; then
207
+ AC_MSG_RESULT([no (disabled by user)])
208
+ else
209
+ if test "x$timerfd_h" = "x1" -a "x$tfd_hdr_ok" = "xyes"; then
210
+ AC_MSG_RESULT([yes])
211
+ AC_DEFINE(USBI_TIMERFD_AVAILABLE, 1, [timerfd headers available])
212
+ else
213
+ AC_MSG_RESULT([no (header not available)])
214
+ fi
215
+ fi
216
+
217
+ AC_CHECK_TYPES(struct timespec)
218
+
219
+ # Message logging
220
+ AC_ARG_ENABLE([log], [AS_HELP_STRING([--disable-log], [disable all logging])],
221
+ [log_enabled=$enableval],
222
+ [log_enabled='yes'])
223
+ if test "x$log_enabled" != "xno"; then
224
+ AC_DEFINE([ENABLE_LOGGING], 1, [Message logging])
225
+ fi
226
+
227
+ AC_ARG_ENABLE([debug-log], [AS_HELP_STRING([--enable-debug-log],
228
+ [start with debug message logging enabled [default=no]])],
229
+ [debug_log_enabled=$enableval],
230
+ [debug_log_enabled='no'])
231
+ if test "x$debug_log_enabled" != "xno"; then
232
+ AC_DEFINE([ENABLE_DEBUG_LOGGING], 1, [Start with debug message logging enabled])
233
+ fi
234
+
235
+ AC_ARG_ENABLE([system-log], [AS_HELP_STRING([--enable-system-log],
236
+ [output logging messages to system wide log, if supported by the OS [default=no]])],
237
+ [system_log_enabled=$enableval],
238
+ [system_log_enabled='no'])
239
+ if test "x$system_log_enabled" != "xno"; then
240
+ AC_DEFINE([USE_SYSTEM_LOGGING_FACILITY], 1, [Enable output to system log])
241
+ fi
242
+
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])
248
+ fi
249
+
250
+ # Examples build
251
+ AC_ARG_ENABLE([examples-build], [AS_HELP_STRING([--enable-examples-build],
252
+ [build example applications [default=no]])],
253
+ [build_examples=$enableval],
254
+ [build_examples='no'])
255
+ AM_CONDITIONAL([BUILD_EXAMPLES], [test "x$build_examples" != "xno"])
256
+
257
+ # Tests build
258
+ AC_ARG_ENABLE([tests-build], [AS_HELP_STRING([--enable-tests-build],
259
+ [build test applications [default=no]])],
260
+ [build_tests=$enableval],
261
+ [build_tests='no'])
262
+ AM_CONDITIONAL([BUILD_TESTS], [test "x$build_tests" != "xno"])
263
+
264
+ # check for -fvisibility=hidden compiler support (GCC >= 3.4)
265
+ saved_cflags="$CFLAGS"
266
+ # -Werror required for cygwin
267
+ CFLAGS="$CFLAGS -Werror -fvisibility=hidden"
268
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
269
+ [VISIBILITY_CFLAGS="-fvisibility=hidden"
270
+ AC_DEFINE([DEFAULT_VISIBILITY], [__attribute__((visibility("default")))], [Default visibility]) ],
271
+ [ VISIBILITY_CFLAGS=""
272
+ AC_DEFINE([DEFAULT_VISIBILITY], [], [Default visibility]) ],
273
+ ])
274
+ CFLAGS="$saved_cflags"
275
+
276
+ # check for -Wno-pointer-sign compiler support (GCC >= 4)
277
+ saved_cflags="$CFLAGS"
278
+ CFLAGS="$CFLAGS -Wno-pointer-sign"
279
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
280
+ nopointersign_cflags="-Wno-pointer-sign", nopointersign_cflags="")
281
+ CFLAGS="$saved_cflags"
282
+
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])
291
+
292
+ AM_CFLAGS="${AM_CFLAGS} -std=gnu99 -Wall -Wundef -Wunused -Wstrict-prototypes -Werror-implicit-function-declaration $nopointersign_cflags -Wshadow ${THREAD_CFLAGS} ${VISIBILITY_CFLAGS}"
293
+
294
+ AC_SUBST(AM_CFLAGS)
295
+ AC_SUBST(LTLDFLAGS)
296
+
297
+ AC_CONFIG_FILES([libusb-1.0.pc])
298
+ AC_CONFIG_FILES([Makefile])
299
+ AC_CONFIG_FILES([libusb/Makefile])
300
+ AC_CONFIG_FILES([examples/Makefile])
301
+ AC_CONFIG_FILES([tests/Makefile])
302
+ AC_CONFIG_FILES([doc/Makefile])
303
+ AC_CONFIG_FILES([doc/doxygen.cfg])
304
+ AC_OUTPUT
@@ -0,0 +1,9 @@
1
+ EXTRA_DIST = doxygen.cfg.in
2
+
3
+ docs: doxygen.cfg
4
+ doxygen $^
5
+
6
+ docs-upload: docs
7
+ ln -s html api-1.0
8
+ scp -r api-1.0 pbatard@web.sourceforge.net:/home/project-web/libusb/htdocs
9
+ rm -f api-1.0