58 Commits

Author SHA1 Message Date
Peter Stuge
fa9b682a63 configure.ac: Enable libtool support for Windows Resource language 2011-10-17 16:25:51 +02:00
Peter Stuge
cbc2d7b2de Support release candidate versions in configure.ac and libusb-1.0.rc 2011-10-17 16:25:50 +02:00
Sean McBride
bb8854ff56 configure.ac: Fix #97 clang warning about -fgnu89-inline
Remove the test that sets the flag since GNU89 inline semantics are not
required by libusb.

[stuge: Also remove reference to the test result]
2011-07-24 22:29:09 +02:00
Sean McBride
40327cd134 Darwin: Fix #63 error when apps use Objective-C garbage collection 2011-06-13 22:06:32 +02:00
Peter Stuge
85a14f43e0 Move library version number from configure.ac to libusb/version.h
This is neccessary to support native MS builds. The Windows resource
file libusb/libusb-1.0.rc must include the release version, which was
previously only available after configure had run and had substituted
the numbers into a generated libusb/libusb-1.0.rc file.

The version atoms are now stored as CPP style #defines in libusb/version.h
so that the .rc no longer needs to be generated but can simply include the
header file and access the version information directly.

The m4 macro LU_DEFINE_VERSION_ATOM() was added to configure.ac to get
version atoms from libusb/version.h for use in AC_INIT(). The macro
handles C and C++ style comments in version.h, but can easily be made
to fail by obscuring the file. Please don't do that.

Tested with MinGW using autoconf, and manual compile of libusb-1.0.rc
using RC.EXE Version 5.2.3690.0 from Visual C++ 2005 Express Edition.
2011-06-13 22:06:30 +02:00
Pete Batard
ae675c1f49 Windows: Remove SetupAPI, AdvAPI32 and OLE32 link-time dependencies
* this ensures that libusb dependent applications only need
  to explicitly link against libusb on Windows

The run-time dependency on Cfgmgr32.dll, OLE32.dll and SetupAPI.dll remains.
2011-06-13 22:06:30 +02:00
Peter Stuge
1a2d21fe42 configure.ac: Refactor Windows backend settings into one occurence
The Windows backend is used both with MinGW and Cygwin, and since most
settings are identical they can be set in one place.
2011-06-13 22:01:43 +02:00
Peter Stuge
717f47621d configure.ac: Rename AM_LDFLAGS to LTLDFLAGS and actually use them
The new variable name tries to clarify that libtool is being used.
Linker flags must thus always be specified with -Wl.

Factor out the libtool flag -no-undefined from host specific cases.
The flag is required to build a Windows DLL, but is correct also for
the other supported systems.

Also, start actually using LTLDFLAGS in libusb/Makefile.am, so that
libtool will see the options set by configure.
2011-06-13 22:01:43 +02:00
Peter Stuge
3cbe573646 configure.ac: Clean up PC_LIBS_PRIVATE and AM_LDFLAGS
Move linker options for when linking the library itself from
PC_LIBS_PRIVATE into AM_LDFLAGS. PC_LIBS_PRIVATE should only
contain flags needed to link applications statically against libusb.
Fixes #72.
2011-06-13 22:01:43 +02:00
Peter Stuge
ef39d15105 configure.ac: Call AC_CONFIG_FILES() for each output file
This avoids a problem with Windows line endings.
2011-06-13 22:01:43 +02:00
Peter Stuge
6e52ea0677 configure.ac: Whitespace changes and trivial reordering 2011-06-13 22:01:42 +02:00
Peter Stuge
44b85dabc3 configure.ac: Quote AC_COMPILE_IFELSE() input 2011-06-13 22:01:42 +02:00
Peter Stuge
19d5882c39 configure.ac: Define booleans to 1 when set, instead of an empty string
This makes the generated config.h look a lot nicer.
2011-06-13 22:01:42 +02:00
Peter Stuge
c24649d796 configure.ac: Clean up redundancy and fix LIBS on Linux
LIBS, AM_LDFLAGS, OS_ conditionals and THREADS_POSIX had a bit of
redundancy throughout the file, and on Linux LIBS ended up missing
the -pthread flag.
2011-06-13 22:01:42 +02:00
Peter Stuge
0bd4a4dd89 configure.ac: Touch up Darwin and Cygwin OS messages 2011-06-13 22:01:42 +02:00
Peter Stuge
16cf11a121 configure.ac: Do not use -pthread on Darwin
It's not needed because Darwin has POSIX Threads in libc. Fixes #96.
2011-06-13 22:01:42 +02:00
Peter Stuge
a120747d56 configure.ac: Check for poll.h, and for nfds_t on Darwin
On Linux, assume nfds_t is always available.

On Darwin, fall back to unsigned int when poll() exists but there
is no nfds_t, such as on Mac OS X before 10.4.

On Windows (both MinGW and Cygwin), always use unsigned int instead
of nfds_t, and don't check for poll.h because we use our own poll()
implementation.
2011-06-13 22:01:42 +02:00
Nathan Hjelm
67d9ef7b68 Remove USBI_OS_HANDLES_TIMEOUT and fix int/isoc timeouts on Darwin
Backends set USBI_TRANSFER_OS_HANDLES_TIMEOUT for transfers instead.
Darwin only handles timeouts for bulk and control transfers, so the
backend now sets that flag accordingly, making libusb core handle
timeouts for interrupt and isochronous transfers. Fixes #31.

Signed-off-by: Nathan Hjelm <hjelmn@me.com>

[stuge: rework libusb_get_next_timeout() and enum usbi_transfer_flags]
[stuge: fix typo; set USBI_TRANSFER_TIMED_OUT flag correctly]
2010-11-26 20:47:23 +01:00
Daniel Drake
d7c25451f4 Fix libtool version setting
This was being set too early to take effect.
2010-10-04 20:03:58 +01:00
Mike Frysinger
a6fb54e2ee Populate the pkg-config Libs.private field 2010-10-04 20:01:07 +01:00
Daniel Drake
d192c5bd32 Update libtool version info
With input from various people on the mailing list, update the libtool
versioning info and start to update this on every release.

The next libusb release will not need a change here. All following ones
will.
2010-10-04 18:45:18 +01:00
Daniel Drake
bd623f70d9 MinGW: Use --add-stdcall-alias linker option
Naming of symbols inside the library is inconsistent on Windows:
http://wyw.dcweb.cn/stdcall.htm

Use this linker option to add aliases which add compatibility with
the "MSVC DLL" platform when a DEF file is used. It also better matches
the appearance of the Windows API itself.
2010-09-19 15:09:17 +01:00
Pete Batard
29f9f9e3af Introduced calling convention (for Windows)
Under Windows, a variety of compilers and configurations are available,
meaning that the manner of parameter passing (e.g. registers vs stack)
can vary.

Match the Windows API calling convention and document this appropriately.
This calling convention will be used regardless of the configuration of
the user's development platform.

The only user-level complication is that all functions used as libusb
callbacks must use the same calling convention as libusb. The
LIBUSB_CALL macro is provided to make this easy.

Signed-off-by: Michael Plante <michael.plante@gmail.com>
Signed-off-by: Pete Batard <pbatard@gmail.com>
[dsd: slight change of strategy, add documentation]
2010-08-23 18:48:55 -06:00
Pete Batard
33cd2f68b4 removed trailing whitespaces 2010-08-06 21:44:10 -06:00
Pete Batard
9a4249f8a1 Add Windows support
Via Cygwin/MinGW, libusb now has windows support.
Thanks to contributors: Michael Plante, Orin Eman, Peter Stuge,
Stephan Meyer, Xiaofan Chen.
2010-07-27 20:57:20 -06:00
Daniel Drake
a516fcb993 Only compile dpfp examples when sigaction is available
It's not available on MinGW.
2010-07-22 18:33:37 -06:00
Aurelien Jarno
a1d831ef82 configure.ac: fix bashisms 2010-07-05 21:36:56 -06:00
Daniel Drake
7211aba6e2 Only include sys/time.h on appropriate platforms
This header doesn't exist on windows.
For libusb, determine at configure-time if the header is available.
For libusb.h, use gcc predefined macros to only include the header
on platforms that need it.
2010-06-25 12:01:58 -05:00
Ludovic Rousseau
351c062aac add AM_MAINTAINER_MODE 2010-06-10 17:03:18 -05:00
Peter Stuge
23b5db8b3e Add internal abstraction for POSIX Threads
This prepares for a Windows backend without dependency on pthreads-w32.

pthread_* is renamed to usbi_* and PTHREAD_* to USBI_*.

A usbi_mutex_static_t and usbi_mutex_static_lock() and _unlock() are
introduced for statically initialized mutexes, since they may be
implemented using other types when pthreads mutexes aren't used.

Move -pthread from libusb/Makefile.am to host-specific THREAD_CFLAGS in
configure.ac. This will enable optional use of -lpthread for cygwin.

[dsd: minor tweaks, and roll in a change based on patches from Pete
Batard to only build dpfp_threaded example when we're using pthreads]
2010-05-12 22:11:29 -03:00
Daniel Drake
a04cbb0095 v1.0.8 release 2010-05-04 19:01:59 -03:00
Daniel Drake
3af329db6d v1.0.7 release 2010-04-19 19:36:55 -03:00
Daniel Drake
a4186794d8 v1.0.6 release 2009-11-22 17:20:53 +00:00
Daniel Drake
0bd7ef5d86 Refine timerfd header check (#18)
Require glibc-2.9 for the working timerfd support.
2009-11-21 16:58:31 +00:00
Daniel Drake
90d8fcab90 v1.0.5 release 2009-11-15 12:17:13 +00:00
Daniel Drake
4783008b7e Use timerfd for timeout handling
Use a new file descriptor from the timerfd system calls to handle
timeouts. On supported systems, this means that there is less hassle
figuring out when the poll() timeout should be, since
libusb_get_next_timeout() will always return 0 and the timeout events will
be triggered as regular activity on the file descriptor set.

Add API function libusb_pollfds_handle_timeouts() to detect whether
you're on a platform with the timing headache, and flesh out the
surrounding documentation.
2009-11-07 10:46:09 +00:00
Daniel Drake
9b120c2b37 Use AM_SILENT_RULES for building 2009-11-07 10:03:20 +00:00
Daniel Drake
ef6ea6c3ae v1.0.4 release 2009-11-06 21:54:08 +00:00
Daniel Drake
f46716f420 v1.0.3 release 2009-08-27 21:40:57 +05:45
Nathan Hjelm
86f79fbf61 Darwin: Don't cancel transfers on timeout
...because the OS does this for us.
2009-06-19 22:18:44 +01:00
Daniel Drake
8be256082e v1.0.2 release 2009-06-13 17:19:07 +01:00
Alex Vatchenko
b501795985 pre-gcc-3.4 compatibility
The -fvisibility and -Wno-pointer-sign options are not available on
old GCC versions.
2009-05-28 16:06:24 -04:00
Daniel Drake
aa24c04e40 v1.0.1 release 2009-05-12 19:03:37 -04:00
Nathan Hjelm
b49f6bf5c9 Darwin backend 2009-02-16 21:40:45 -03:00
Nathan Hjelm
ccf6d3d2f6 Only link with librt on Linux
[dsd: tweak configure.ac change]
2009-02-16 21:19:56 -03:00
Daniel Drake
34b9eebe35 v1.0.0 release
It's here!
2008-12-13 20:06:49 +00:00
Daniel Drake
a133875e6e v0.9.4 release 2008-11-21 10:54:57 +00:00
Aurelien Jarno
d25b566b3b Support for out-of-tree building
Contrary to libusb 0.1, libusb 1.0 does not support out-of-tree building
for the documentation part. This patch fixes that by using a
doxygen.cfg.in file, which contains @top_srcdir@ to refer to the
location of the libusb source code.
2008-11-02 15:05:47 +00:00
Daniel Drake
046e681e4a v0.9.3 release 2008-08-23 01:00:21 -05:00
Daniel Drake
1631eaefcc v0.9.2 release 2008-07-19 17:51:42 -05:00