Allows statically linking vc++ runtime dependencies inside libusb-1.0
Windows libraries.
'Release' and 'Debug' configurations produce /MD compiled binaries while
the new 'Release-MT' and 'Debug-MT" configurations produce /MT compiled
binaries.
The /MT flag causes the application to include the multithread, static
version of the vc++ run-time library, whereas the default flag /MD will
cause the vc++ run-time library to be dynamically linked run-time. Using
/MT thus builds a standalone libusb DLL that doesn't require a vc++
runtime DLL to be shipped along with it.
For the official description of /MT see:
https://docs.microsoft.com/en-us/cpp/build/reference/md-mt-ld-use-run-time-libraryCloses#1188
Commit f69548c3b3 ("examples: Enable all examples to build on all
platforms") modified dpfp and sam3u_benchmark to be buildable on any
platform, however there were some oversights and regressions introduced
for Android and Xcode.
Update the Android and Xcode build files to account for the removal of
dpfp_threaded.c as well as the inclusion of config.h from examples
and/or tests source.
Additionally switch the threaded version of dpfp to use sem_open()
instead of sem_init() as the latter is in fact deprecated on MacOS.
Closes#808
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
Add '-fvisibility=hidden' to the additional compiler flags of the libusb
target so that internal library symbols are hidden.
Add '-pthread' to the additional compiler flags of the targets that
directly use pthread functionality
Add the 'sam3u_benchmark' and 'testlibusb' targets so that all examples
are now built and fix build warnings that occur when building
'sam3u_benchmark'.
Fix target dependencies so that all targets are able to build without
issues.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
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>
Commit a9b34d170a ("Adding support for ARM & ARM64 Windows Platform")
introduced a dependency on a particular version of the Windows 10 SDK
for *all* platforms. This is particularly annoying for most users who
will only be building for Windows. Fix this by specifying the SDK
dependency only for the ARM/ARM64 platforms and bump to the latest.
Commit 77037c4dd6 ("Adds /utf-8 to compile options") added this compiler
option to all versions of the Visual Studio project files. This results
in a number of warnings with the older versions that don't recognize
this option. Fix this by keeping this option only for 2015 and newer.
Explicitly specify library dependencies for non-static targets. With a
small change in the UsbDk backend we can completely remove all
depenencies other than kernel32.lib.
Lastly, remove the 'MinimalRebuild' option for 2015 and newer project
files as this option is now deprecated and results in a warning for each
project.
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>
* Don't limit support to ARM only (adds MIPS support)
* Also add a workaround for a MIPS NDK linker bug
* Also add a gitignore entry required to run bootstrap.sh on OS X
* Closes#134
The internal API is changing as follows:
- Adding two new functions. usbi_connect_device, and usbi_disconnect_device.
Backends must call these functions to add them to the context's device list
at one of two places: initial enumeration (done at init), and on device
attach and removal. These functions need to be called once per context.
- Backends that support hotplug should not provide a get_device_list funtion.
This function is now deprecated and will likely be removed once all backends
support hotplug.
The external API is changing as follows:
- Two new functions have been added to register and deregister callbacks for
hotplug notification: libusb_hotplug_register_callback(),
libusb_hotplug_deregister_callback(). Hotplug callbacks are called by
libusb_handle_events(). Details of the new API can be found in libusb.h.
- A new capability check has been added to check for hotplug support. See
LIBUSB_CAP_HAS_HOTPLUG.
Aa suggested by Xiaofan add new example has been added to show how to use
the new external hotplug API. See examples/hotplugtest.c.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* adds the MSVC support files used by MSVC6, VS2005 and WDK
* also adds missing defines required by MS compilers in libusb.h
* also anticipatory sets .gitattributes for CRLF handling
* also adds manually maintained .def file for import lib generation
References #57.