diff options
author | Hannes Weisbach <hannes.weisbach@gmail.com> | 2023-04-27 20:59:25 +0200 |
---|---|---|
committer | Hannes Weisbach <hannesweisbach@gmail.com> | 2023-10-11 21:11:19 +0200 |
commit | 2996e23d5866d5d692acdba1d68bcaea2808ef71 (patch) | |
tree | a70078497f3ab21253fcbc369582931f5be6def4 | |
parent | 09af21c154cf7b239f39644d1245d2191abf2c76 (diff) | |
download | usbutils-2996e23d5866d5d692acdba1d68bcaea2808ef71.tar.gz |
Generate usbutils.pc pkgconfig file
Allow buildsystems using pkgconfig to find usb-utils.
I think some library I was using was trying to find usb.ids using pkgconfig.
Signed-off-by: Hannes Weisbach <hannesweisbach@gmail.com>
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | usbutils.pc.in | 18 |
3 files changed, 24 insertions, 0 deletions
diff --git a/Makefile.am b/Makefile.am index 448c854..ae9e383 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,6 +60,8 @@ EXTRA_DIST = \ LICENSES/GPL-2.0-only.txt \ LICENSES/GPL-3.0-only.txt +pkgconfig_DATA = usbutils.pc + lsusb.py: $(srcdir)/lsusb.py.in sed 's|VERSION|$(VERSION)|g;s|@usbids@|$(datadir)/usb.ids|g' $< >$@ chmod 755 $@ diff --git a/configure.ac b/configure.ac index b51b4ce..1e5a3f5 100644 --- a/configure.ac +++ b/configure.ac @@ -15,12 +15,15 @@ AC_SYS_LARGEFILE AC_CHECK_HEADERS([byteswap.h]) AC_CHECK_FUNCS([nl_langinfo iconv]) +PKG_INSTALLDIR + PKG_CHECK_MODULES(LIBUSB, libusb-1.0 >= 1.0.14) PKG_CHECK_MODULES(UDEV, libudev >= 196) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([ + usbutils.pc Makefile ]) AC_CONFIG_SUBDIRS([usbhid-dump]) @@ -33,6 +36,7 @@ AC_MSG_RESULT([ prefix: ${prefix} datarootdir: ${datarootdir} datadir: ${datadir} + pkgconfigdir: ${pkgconfigdir} mandir: ${mandir} usb.ids: ${datadir}/usb.ids diff --git a/usbutils.pc.in b/usbutils.pc.in new file mode 100644 index 0000000..d156532 --- /dev/null +++ b/usbutils.pc.in @@ -0,0 +1,18 @@ +prefix=@prefix@ +exec_prefix=@prefix@ +libdir=@prefix@/lib64 +includedir=@prefix@/include +usbids=@datadir@/usb.ids + +Name: @PACKAGE_NAME@ +Description: usbutils This is a collection of USB tools for use on Linux and BSD systems\ + to query what type of USB devices are connected to the system. This is to be run on a USB host\ + (i.e. a machine you plug USB devices into), not on a USB device (i.e. a device you plug into a USB host.) + +Version: @VERSION@ +URL: https://github.com/gregkh/usbutils +Requires: libusb-1.0 >= 1.0.14 libudev >= 196 +Conflicts: +Libs: -L@prefix@/lib64 +Libs.private: @LIBUSB_LIBS@ @UDEV_LIBS@ +Cflags: @CFLAGS@ @LIBUSB_CFLAGS@ @UDEV_CFLAGS@ |