diff options
author | Pete Batard <pete@akeo.ie> | 2012-06-08 23:31:56 +0100 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2012-06-08 23:31:56 +0100 |
commit | 6b33cd458921a6023e6e54f3715ead7ed441c648 (patch) | |
tree | e51e8cc74d5160241a36e182fd9c0cd62ea6d34d /libusb | |
parent | a983fad006fe39a48517e061bf9f66501ff900be (diff) | |
download | libusb-6b33cd458921a6023e6e54f3715ead7ed441c648.tar.gz |
Windows: Enable MinGW and MSVC DLL interchangeability
* Because we use the WINAPI calling convention, the def file MUST have the @n
aliases. There is no way around this as MinGW's .o use decoration always
for __stdcall, which can't be turned off.
* dlltool must therefore be invoked to create a proper import lib from the .def,
using the --kill-at option.
* To do that, a CREATE_IMPORT_LIB autotools variable is introduced.
* Note: the .def file is currently maintained manually.
Diffstat (limited to 'libusb')
-rw-r--r-- | libusb/Makefile.am | 9 | ||||
-rw-r--r-- | libusb/version_nano.h | 2 |
2 files changed, 10 insertions, 1 deletions
diff --git a/libusb/Makefile.am b/libusb/Makefile.am index 0e7fc88..4a6859e 100644 --- a/libusb/Makefile.am +++ b/libusb/Makefile.am @@ -1,3 +1,5 @@ +all: libusb-1.0.la libusb-1.0.dll + lib_LTLIBRARIES = libusb-1.0.la LINUX_USBFS_SRC = os/linux_usbfs.c @@ -30,6 +32,13 @@ OS_SRC = $(WINDOWS_USB_SRC) libusb-1.0.rc: version.h endif +libusb-1.0.dll: +if CREATE_IMPORT_LIB +# Rebuild the import lib from the .def so that MS and MinGW DLLs can be interchanged + $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/libusb-1.0.def --dllname $@ --output-lib .libs/$@.a +endif + + if THREADS_POSIX THREADS_SRC = os/threads_posix.h os/threads_posix.c else diff --git a/libusb/version_nano.h b/libusb/version_nano.h index ee5933f..2e047f4 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10525 +#define LIBUSB_NANO 10526 |