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.
- package/.github/workflows/prebuild.yml +62 -0
- package/.gitmodules +3 -0
- package/LICENSE +7 -0
- package/Readme.md +339 -0
- package/binding.gyp +90 -0
- package/libusb/.gitattributes +11 -0
- package/libusb/.private/README.txt +5 -0
- package/libusb/.private/bd.cmd +89 -0
- package/libusb/.private/bm.sh +54 -0
- package/libusb/.private/bwince.cmd +57 -0
- package/libusb/.private/post-rewrite.sh +28 -0
- package/libusb/.private/pre-commit.sh +42 -0
- package/libusb/.private/wbs.txt +61 -0
- package/libusb/.private/wbs_wince.txt +42 -0
- package/libusb/AUTHORS +78 -0
- package/libusb/COPYING +504 -0
- package/libusb/ChangeLog +211 -0
- package/libusb/INSTALL +234 -0
- package/libusb/INSTALL_WIN.txt +73 -0
- package/libusb/Makefile.am +28 -0
- package/libusb/NEWS +2 -0
- package/libusb/PORTING +94 -0
- package/libusb/README +28 -0
- package/libusb/README.git +41 -0
- package/libusb/TODO +2 -0
- package/libusb/Xcode/common.xcconfig +49 -0
- package/libusb/Xcode/debug.xcconfig +29 -0
- package/libusb/Xcode/libusb.xcconfig +21 -0
- package/libusb/Xcode/libusb.xcodeproj/project.pbxproj +1 -0
- package/libusb/Xcode/libusb_debug.xcconfig +21 -0
- package/libusb/Xcode/libusb_release.xcconfig +21 -0
- package/libusb/Xcode/release.xcconfig +30 -0
- package/libusb/android/README +114 -0
- package/libusb/android/jni/Android.mk +23 -0
- package/libusb/android/jni/Application.mk +24 -0
- package/libusb/android/jni/examples.mk +134 -0
- package/libusb/android/jni/libusb.mk +54 -0
- package/libusb/android/jni/tests.mk +56 -0
- package/libusb/autogen.sh +8 -0
- package/libusb/bootstrap.sh +19 -0
- package/libusb/configure.ac +304 -0
- package/libusb/doc/Makefile.am +9 -0
- package/libusb/doc/doxygen.cfg.in +1288 -0
- package/libusb/doc/libusb.png +0 -0
- package/libusb/examples/Makefile.am +19 -0
- package/libusb/examples/dpfp.c +506 -0
- package/libusb/examples/dpfp_threaded.c +544 -0
- package/libusb/examples/ezusb.c +831 -0
- package/libusb/examples/ezusb.h +120 -0
- package/libusb/examples/fxload.c +287 -0
- package/libusb/examples/getopt/getopt.c +1060 -0
- package/libusb/examples/getopt/getopt.h +180 -0
- package/libusb/examples/getopt/getopt1.c +188 -0
- package/libusb/examples/hotplugtest.c +104 -0
- package/libusb/examples/listdevs.c +71 -0
- package/libusb/examples/sam3u_benchmark.c +193 -0
- package/libusb/examples/xusb.c +1129 -0
- package/libusb/libusb/Makefile.am +75 -0
- package/libusb/libusb/core.c +2342 -0
- package/libusb/libusb/descriptor.c +1199 -0
- package/libusb/libusb/hotplug.c +327 -0
- package/libusb/libusb/hotplug.h +82 -0
- package/libusb/libusb/io.c +2631 -0
- package/libusb/libusb/libusb-1.0.def +166 -0
- package/libusb/libusb/libusb-1.0.rc +61 -0
- package/libusb/libusb/libusb.h +1998 -0
- package/libusb/libusb/libusbi.h +1040 -0
- package/libusb/libusb/os/darwin_usb.c +2009 -0
- package/libusb/libusb/os/darwin_usb.h +162 -0
- package/libusb/libusb/os/linux_netlink.c +369 -0
- package/libusb/libusb/os/linux_udev.c +307 -0
- package/libusb/libusb/os/linux_usbfs.c +2695 -0
- package/libusb/libusb/os/linux_usbfs.h +192 -0
- package/libusb/libusb/os/netbsd_usb.c +738 -0
- package/libusb/libusb/os/openbsd_usb.c +832 -0
- package/libusb/libusb/os/poll_posix.c +51 -0
- package/libusb/libusb/os/poll_posix.h +11 -0
- package/libusb/libusb/os/poll_windows.c +796 -0
- package/libusb/libusb/os/poll_windows.h +131 -0
- package/libusb/libusb/os/threads_posix.c +82 -0
- package/libusb/libusb/os/threads_posix.h +50 -0
- package/libusb/libusb/os/threads_windows.c +212 -0
- package/libusb/libusb/os/threads_windows.h +87 -0
- package/libusb/libusb/os/wince_usb.c +1032 -0
- package/libusb/libusb/os/wince_usb.h +131 -0
- package/libusb/libusb/os/windows_common.h +108 -0
- package/libusb/libusb/os/windows_usb.c +5347 -0
- package/libusb/libusb/os/windows_usb.h +971 -0
- package/libusb/libusb/strerror.c +199 -0
- package/libusb/libusb/sync.c +307 -0
- package/libusb/libusb/version.h +18 -0
- package/libusb/libusb/version_nano.h +1 -0
- package/libusb/libusb-1.0.pc.in +11 -0
- package/libusb/msvc/config.h +50 -0
- package/libusb/msvc/ddk_build.cmd +175 -0
- package/libusb/msvc/errno.h +102 -0
- package/libusb/msvc/fxload_2010.vcxproj +170 -0
- package/libusb/msvc/fxload_2010.vcxproj.filters +25 -0
- package/libusb/msvc/fxload_2012.vcxproj +174 -0
- package/libusb/msvc/fxload_2012.vcxproj.filters +25 -0
- package/libusb/msvc/fxload_2013.vcxproj +174 -0
- package/libusb/msvc/fxload_sources +23 -0
- package/libusb/msvc/getopt_2005.vcproj +288 -0
- package/libusb/msvc/getopt_2010.vcxproj +131 -0
- package/libusb/msvc/getopt_2010.vcxproj.filters +26 -0
- package/libusb/msvc/getopt_2012.vcxproj +136 -0
- package/libusb/msvc/getopt_2012.vcxproj.filters +26 -0
- package/libusb/msvc/getopt_2013.vcxproj +136 -0
- package/libusb/msvc/getopt_sources +20 -0
- package/libusb/msvc/hotplugtest_2010.vcxproj +163 -0
- package/libusb/msvc/hotplugtest_2010.vcxproj.filters +14 -0
- package/libusb/msvc/hotplugtest_2012.vcxproj +167 -0
- package/libusb/msvc/hotplugtest_2012.vcxproj.filters +14 -0
- package/libusb/msvc/hotplugtest_2013.vcxproj +167 -0
- package/libusb/msvc/hotplugtest_sources +20 -0
- package/libusb/msvc/inttypes.h +295 -0
- package/libusb/msvc/libusb.dsw +71 -0
- package/libusb/msvc/libusb_2005.sln +95 -0
- package/libusb/msvc/libusb_2010.sln +94 -0
- package/libusb/msvc/libusb_2012.sln +94 -0
- package/libusb/msvc/libusb_2013.sln +100 -0
- package/libusb/msvc/libusb_2015.sln +100 -0
- package/libusb/msvc/libusb_dll.dsp +194 -0
- package/libusb/msvc/libusb_dll_2005.vcproj +436 -0
- package/libusb/msvc/libusb_dll_2010.vcxproj +170 -0
- package/libusb/msvc/libusb_dll_2010.vcxproj.filters +81 -0
- package/libusb/msvc/libusb_dll_2012.vcxproj +175 -0
- package/libusb/msvc/libusb_dll_2012.vcxproj.filters +84 -0
- package/libusb/msvc/libusb_dll_2013.vcxproj +175 -0
- package/libusb/msvc/libusb_dll_wince.vcproj +1243 -0
- package/libusb/msvc/libusb_sources +38 -0
- package/libusb/msvc/libusb_static.dsp +174 -0
- package/libusb/msvc/libusb_static_2005.vcproj +362 -0
- package/libusb/msvc/libusb_static_2010.vcxproj +156 -0
- package/libusb/msvc/libusb_static_2010.vcxproj.filters +74 -0
- package/libusb/msvc/libusb_static_2012.vcxproj +160 -0
- package/libusb/msvc/libusb_static_2012.vcxproj.filters +74 -0
- package/libusb/msvc/libusb_static_2013.vcxproj +160 -0
- package/libusb/msvc/libusb_static_wince.vcproj +1185 -0
- package/libusb/msvc/libusb_wince.sln +246 -0
- package/libusb/msvc/listdevs.dsp +103 -0
- package/libusb/msvc/listdevs_2005.vcproj +360 -0
- package/libusb/msvc/listdevs_2010.vcxproj +165 -0
- package/libusb/msvc/listdevs_2010.vcxproj.filters +14 -0
- package/libusb/msvc/listdevs_2012.vcxproj +169 -0
- package/libusb/msvc/listdevs_2012.vcxproj.filters +14 -0
- package/libusb/msvc/listdevs_2013.vcxproj +169 -0
- package/libusb/msvc/listdevs_sources +19 -0
- package/libusb/msvc/listdevs_wince.vcproj +1120 -0
- package/libusb/msvc/missing.c +80 -0
- package/libusb/msvc/missing.h +32 -0
- package/libusb/msvc/stdint.h +256 -0
- package/libusb/msvc/stress_2005.vcproj +390 -0
- package/libusb/msvc/stress_2010.vcxproj +167 -0
- package/libusb/msvc/stress_2010.vcxproj.filters +25 -0
- package/libusb/msvc/stress_2012.vcxproj +171 -0
- package/libusb/msvc/stress_2012.vcxproj.filters +25 -0
- package/libusb/msvc/stress_2013.vcxproj +171 -0
- package/libusb/msvc/stress_wince.vcproj +1128 -0
- package/libusb/msvc/xusb.dsp +102 -0
- package/libusb/msvc/xusb_2005.vcproj +344 -0
- package/libusb/msvc/xusb_2010.vcxproj +163 -0
- package/libusb/msvc/xusb_2010.vcxproj.filters +14 -0
- package/libusb/msvc/xusb_2012.vcxproj +167 -0
- package/libusb/msvc/xusb_2012.vcxproj.filters +14 -0
- package/libusb/msvc/xusb_2013.vcxproj +167 -0
- package/libusb/msvc/xusb_sources +20 -0
- package/libusb/msvc/xusb_wince.vcproj +1120 -0
- package/libusb/tests/Makefile.am +6 -0
- package/libusb/tests/libusb_testlib.h +107 -0
- package/libusb/tests/stress.c +160 -0
- package/libusb/tests/testlib.c +281 -0
- package/libusb.gypi +136 -0
- package/libusb_config/config.h +1 -0
- package/package.json +69 -0
- package/src/device.cc +412 -0
- package/src/helpers.h +64 -0
- package/src/node_usb.cc +319 -0
- package/src/node_usb.h +120 -0
- package/src/transfer.cc +148 -0
- package/src/uv_async_queue.h +33 -0
- package/test/usb.coffee +191 -0
- 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
|