18 Commits

Author SHA1 Message Date
Vadim Mikhailov
d96308569c uhubctl is in homebrew core now - remove obsolete files, update readme
* remove custom homebrew tap - uhubctl is included in homebrew core now.
* remove bitbake recipe - it does not seem to be used for years now,
  and it should not have been committed in first place.
* add `installing` paragraph to readme. since most relevant OS include uhubctl
  in standard package managers now, most people don't want to compile it,
  but instead know how to install it quickly.
* update short links to not use bit.ly as it became very spammy now.
* update few expired links to point to archive.org cache.
* add `all` target to Makefile (FreeBSD ports want `all` target to always exist).
2025-04-18 23:13:56 -07:00
Vadim Mikhailov
07abf4cbea Fix warnings when compiled in C++ mode
Fixed all warnings when compiling with `c++ -std=c++11 ...`:
* bzero() appears to be deprecated, replaced with memset()
* fixed few const warnings
* suppressed zero array warnings (emitted by libusb headers)
2025-01-21 19:25:50 -08:00
Vadim Mikhailov
a7df8f8367 Cleanup ifdef usage
* No need to check for both __gnu_linux__ and __linux__, latter is enough.
* Require libusb 1.0.13 to build - this makes LIBUSB_API_VERSION always defined.
* Include `<libusb.h>` not `<libusb-1.0/libusb.h>` - this will always work
  if `pkg-config` is detected. For backwards compatibility still try building
  without `pkg-config` present, but it is much less reliable and will not work on Mac.
* Bump copyright year.
2025-01-18 14:04:34 -08:00
Vadim Mikhailov
92736a8604 Honor PKG_CONFIG variable if exists
Some build systems want to pass location for pkg-config.

Closes #315.
2021-02-11 17:48:11 -08:00
Vadim Mikhailov
e65d077712 Do not allow just commit id to be used as version
Homebrew is forcing `--no-tags` for cloned repos.
Because we used `git describe --always` brew was choosing raw commit id as version, which is quite bad.
By removing `--always` we will use contents of VERSION file as a backup.
2020-12-08 15:24:41 -08:00
Vadim Mikhailov
d3a79ace46 Use pkg-config when available
Remove custom handling for different platforms for CFLAGS and LDFLAGS
and prefer using pkg-config when available.
However, this is tested to still build ok on Linux on Mac howebrew
even if pkg-config is not available.

Closes #292, should also simplify issues raised by #142, #147, #289 and 5db248771e.
2020-12-05 21:24:17 -08:00
Jim Klimov
9183aef17e Makefile: add support for "SunOS" (e.g. with modern illumos) 2020-11-26 14:56:16 -08:00
Vadim Mikhailov
8ba36bd8df Improve getting version from git describe
* To determine version, only consider tags starting with v{digit}
* Strip v prefix from version
2020-05-22 13:21:45 -07:00
Vadim Mikhailov
05647714b6 Apply debian hardening suggestions for Linux
Follow hardening tips per https://wiki.debian.org/Hardening.
We have already applied `-z relro` before, now add `-z now` as well.
2019-09-20 17:43:36 -07:00
Vadim Mikhailov
beea0c0fc7 Use longer git hash for dirty version 2019-09-02 23:12:46 -07:00
Vadim Mikhailov
5db248771e Add support for NetBSD
This adds support to be able to build and use uhubctl on NetBSD by using pkg-config to get proper CFLAGS and LDFLAGS.
Perhaps we should use pkg-config universally across all platforms,
but I don't want to potentially break support for existing plaftorms
because pkg-config does not seem to be unconditionally available everywhere.
2019-07-26 18:00:49 -07:00
Vadim Mikhailov
e93d1a06a2 Use version from VERSION file if git describe fails
This fixes issue #100.

We prefer to determine version from git tags (using git describe).
However, sometimes people don't use git or don't have it installed,
which leads to empty version used.
To solve this, we use version from VERSION file as a backup.
2019-04-28 11:38:17 -07:00
Vadim Mikhailov
069c67c836 Respect CPPFLAGS
This should fix issue #125.
2018-11-14 21:53:44 -08:00
Vadim Mikhailov
63122bacb5 Use program version from git tag
This should fix issue #51.
2017-09-19 20:17:29 -07:00
Vadim Mikhailov
d5cf8f882a use C99 and enable pedantic checking
Also simplify ifdef spaghetti.
Remove _WIN64 use as _WIN32 is defined on both Win32 and Win64.
2017-07-28 11:19:50 -07:00
Vadim Mikhailov
40d446b394 Add support for FreeBSD and MacPorts on Mac 2017-04-06 11:43:02 -07:00
Richard Leitner
a45cb2a59a Makefile: add cross-compile functionality
Add cross-compile functionality to the Makefile and add an "install"
target. This makes uhubctl "Yocto Project Compatible".

Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
2017-02-20 10:49:30 +01:00
Vadim Mikhailov
d5da2677eb Added uhubctl source code 2015-01-14 16:32:36 -08:00