summaryrefslogtreecommitdiff
path: root/libusb
diff options
context:
space:
mode:
authorChris Dickens <christopher.a.dickens@gmail.com>2020-03-25 00:09:26 -0700
committerChris Dickens <christopher.a.dickens@gmail.com>2020-03-25 00:09:26 -0700
commit4a5540a925e47923ed20b4ea68aabe550dac976d (patch)
treef95d0db794b626a025aea4af5b91d8f3e367ef28 /libusb
parent07d6d3a2a5c415fa0b819ee0bdb48565f444a58a (diff)
downloadlibusb-4a5540a925e47923ed20b4ea68aabe550dac976d.tar.gz
autotools: Fix a number of issues
Change the name of the project to be what it actually is called everywhere: libusb-1.0. This allows the public libusb.h header file to be tracked by automake through pkginclude_HEADERS. Decouple the doc directory from automake. There aren't any targets that automake understands, so the build uselessly recurses into the directory. Update the makefile targets with the correct dependencies so that the docs aren't regenerated unnecessarily. Update the doxygen config file to include the version, exclude irrelevant source files and create the output into 'api-1.0' instead of 'html'. Also fix a deprecation tag for the libusb_get_port_path() function and add Solaris to the list of supported platforms. Fix the 'dist' target. Clean up the README file to remote the GitHub Markdown and remove the .gitattributes file from the msvc directory. Add doc/libusb.png to EXTRA_DIST. Enhance the {dist,doc}-upload targets to look at the SF_USER environment variable to get the SourceForge username. This allows maintainers (like me!) to have a local username that is different from their SourceForge username. Switch the docs-upload recipe to use rsync with --delete to clean up obsolete files. Fix the Windows shared library (DLL) targets. The dependencies for the RC file were incorrect, leading to cases of missed recompilation. The 'all' rule should not be overridden, so define an 'all-local' rule when necessary. Fix the rule for running dlltool on the just generated DLL so that it only fires when the correct dependencies change and do not bother to run the rule when not building a DLL. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Diffstat (limited to 'libusb')
-rw-r--r--libusb/Makefile.am18
-rw-r--r--libusb/core.c5
-rw-r--r--libusb/libusb.h6
-rw-r--r--libusb/libusbi.h3
-rw-r--r--libusb/version_nano.h2
5 files changed, 16 insertions, 18 deletions
diff --git a/libusb/Makefile.am b/libusb/Makefile.am
index 5adba7c..b8936a5 100644
--- a/libusb/Makefile.am
+++ b/libusb/Makefile.am
@@ -1,5 +1,3 @@
-all: libusb-1.0.la libusb-1.0.dll
-
AUTOMAKE_OPTIONS = subdir-objects
lib_LTLIBRARIES = libusb-1.0.la
@@ -87,22 +85,22 @@ if OS_WINDOWS
OS_SRC = $(OS_WINDOWS_SRC)
.rc.lo:
- $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --tag=RC --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
+ $(AM_V_GEN)$(LIBTOOL) $(AM_V_lt) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(RC) $(RCFLAGS) -i $< -o $@
-libusb-1.0.rc: version.h version_nano.h
-endif
+libusb-1.0.lo: libusb-1.0.rc version.h version_nano.h
-libusb-1.0.dll: libusb-1.0.def libusb-1.0.la
if CREATE_IMPORT_LIB
+all-local: .libs/libusb-1.0.dll.a
# 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
+.libs/libusb-1.0.dll.a: libusb-1.0.def libusb-1.0.la
+ $(AM_V_GEN)$(DLLTOOL) $(DLLTOOLFLAGS) --kill-at --input-def $(srcdir)/$< --dllname libusb-1.0.dll --output-lib $@
+endif
endif
libusb_1_0_la_CFLAGS = $(AM_CFLAGS)
libusb_1_0_la_LDFLAGS = $(LTLDFLAGS)
-libusb_1_0_la_SOURCES = libusbi.h libusb.h version.h version_nano.h \
+libusb_1_0_la_SOURCES = libusbi.h version.h version_nano.h \
core.c descriptor.c hotplug.h hotplug.c io.c strerror.c sync.c \
$(POLL_SRC) $(THREADS_SRC) $(OS_SRC)
-hdrdir = $(includedir)/libusb-1.0
-hdr_HEADERS = libusb.h
+pkginclude_HEADERS = libusb.h
diff --git a/libusb/core.c b/libusb/core.c
index e7f8d5e..5b87132 100644
--- a/libusb/core.c
+++ b/libusb/core.c
@@ -22,6 +22,7 @@
#include "libusbi.h"
#include "hotplug.h"
+#include "version.h"
#ifdef __ANDROID__
#include <android/log.h>
@@ -943,7 +944,7 @@ int API_EXPORTED libusb_get_port_numbers(libusb_device *dev,
}
/** \ingroup libusb_dev
- * Deprecated please use libusb_get_port_numbers instead.
+ * \deprecated Please use \ref libusb_get_port_numbers() instead.
*/
int API_EXPORTED libusb_get_port_path(libusb_context *ctx, libusb_device *dev,
uint8_t* port_numbers, uint8_t port_numbers_len)
@@ -961,7 +962,7 @@ int API_EXPORTED libusb_get_port_path(libusb_context *ctx, libusb_device *dev,
* function and make sure that you only access the parent before issuing
* \ref libusb_free_device_list(). The reason is that libusb currently does
* not maintain a permanent list of device instances, and therefore can
- * only guarantee that parents are fully instantiated within a
+ * only guarantee that parents are fully instantiated within a
* libusb_get_device_list() - libusb_free_device_list() block.
*/
DEFAULT_VISIBILITY
diff --git a/libusb/libusb.h b/libusb/libusb.h
index 2c4d589..4cd9149 100644
--- a/libusb/libusb.h
+++ b/libusb/libusb.h
@@ -898,7 +898,7 @@ struct libusb_version {
const char *rc;
/** For ABI compatibility only. */
- const char* describe;
+ const char *describe;
};
/** \ingroup libusb_lib
@@ -1359,9 +1359,9 @@ void LIBUSB_CALL libusb_free_container_id_descriptor(
struct libusb_container_id_descriptor *container_id);
uint8_t LIBUSB_CALL libusb_get_bus_number(libusb_device *dev);
uint8_t LIBUSB_CALL libusb_get_port_number(libusb_device *dev);
-int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t* port_numbers, int port_numbers_len);
+int LIBUSB_CALL libusb_get_port_numbers(libusb_device *dev, uint8_t *port_numbers, int port_numbers_len);
LIBUSB_DEPRECATED_FOR(libusb_get_port_numbers)
-int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t* path, uint8_t path_length);
+int LIBUSB_CALL libusb_get_port_path(libusb_context *ctx, libusb_device *dev, uint8_t *path, uint8_t path_length);
libusb_device * LIBUSB_CALL libusb_get_parent(libusb_device *dev);
uint8_t LIBUSB_CALL libusb_get_device_address(libusb_device *dev);
int LIBUSB_CALL libusb_get_device_speed(libusb_device *dev);
diff --git a/libusb/libusbi.h b/libusb/libusbi.h
index a9f904e..da8ec53 100644
--- a/libusb/libusbi.h
+++ b/libusb/libusbi.h
@@ -35,7 +35,6 @@
#endif
#include "libusb.h"
-#include "version.h"
#define container_of(ptr, type, member) \
((type *)((uintptr_t)(ptr) - (uintptr_t)offsetof(type, member)))
@@ -209,7 +208,7 @@ static inline void *usbi_reallocf(void *ptr, size_t size)
#define TIMESPEC_IS_SET(ts) ((ts)->tv_sec || (ts)->tv_nsec)
#define TIMESPEC_CLEAR(ts) (ts)->tv_sec = (ts)->tv_nsec = 0
-#define TIMESPEC_CMP(a, b, CMP) \
+#define TIMESPEC_CMP(a, b, CMP) \
(((a)->tv_sec == (b)->tv_sec) \
? ((a)->tv_nsec CMP (b)->tv_nsec) \
: ((a)->tv_sec CMP (b)->tv_sec))
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 3c9623c..fb6345c 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 11469
+#define LIBUSB_NANO 11470