summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorPete Batard <pbatard@gmail.com>2010-08-02 23:13:17 +0100
committerPete Batard <pbatard@gmail.com>2010-08-02 23:13:17 +0100
commit7f4f7bd7538bec65a162e6f19bf4c5e1139e1a5a (patch)
tree430da7451a187f9962aad9069da920bbe982751a /autogen.sh
parentc9b0a3b82e3c7771e1f34c134578f9d9bfd71b2e (diff)
downloadlibusb-7f4f7bd7538bec65a162e6f19bf4c5e1139e1a5a.tar.gz
reverted to using a (generated) .def file for DLL exportspbr291
added libusb-1.0.def (plus reference in MS projects) removed LIBUSB_EXP/__declspec(dllexport) from libusb.h removed LIBUSB_DLL_BUILD macros added -Wl,--add-stdcall-alias linker option for MinGW/cygwin for DLL generation added sed script in autogen to update the libusb-1.0.def
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/autogen.sh b/autogen.sh
index 10ac773..8c6dd32 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,5 +1,14 @@
#!/bin/sh
+# rebuilds the Windows def file by parsing the core and exporting all API_EXPORTED call
+create_def()
+{
+ echo "rebuidling libusb-1.0.def file"
+ echo "LIBRARY" > libusb/libusb-1.0.def
+ echo "EXPORTS" >> libusb/libusb-1.0.def
+ sed -n -e "s/.*API_EXPORTED.*\([[:blank:]]\)\(.*\)(.*/ \2/p" libusb/*.c >> libusb/libusb-1.0.def
+}
+
# use glibtoolize if it is available (darwin)
(glibtoolize --version) < /dev/null > /dev/null 2>&1 && LIBTOOLIZE=glibtoolize || LIBTOOLIZE=libtoolize
@@ -14,4 +23,6 @@ autoheader || exit 1
autoconf || exit 1
automake -a -c || exit 1
./configure --enable-maintainer-mode --enable-debug-log \
- --enable-examples-build $* \ No newline at end of file
+ --enable-examples-build $*
+# rebuild .def, if sed is available
+type -P sed &>/dev/null && create_def \ No newline at end of file