summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
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