Skip to contentSkip to conversation

configure: allow usb.ids location to be specified

PATCH In review Scott James Remnant 4 participants 6 messages May 20, 2011 – May 23, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: allow usb.ids location to be specified

We already allow the pci.ids location to be specified, so add a patch doing the same for usb.ids. Please don't make me explain why this is necessary, it will only make you cry.

---
 configure.ac |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)
configure.ac +12 -2
index 3646f93..11e5bc5 100644
@@ -93,8 +93,18 @@ if test "x$enable_hwdb" = xyes; then
 		AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
 	fi
 
-	PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
-	AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+	AC_ARG_WITH(usb-ids-path,
+		[AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
+		[USB_DATABASE=${withval}],
+		[if test -n "$usbids" ; then
+			PCI_DATABASE="$usbids"
+		else
+			PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
+			AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+		fi])
+	AC_MSG_CHECKING([for USB database location])
+	AC_MSG_RESULT([$USB_DATABASE])
+	AC_SUBST(USB_DATABASE)
 
 	AC_ARG_WITH(pci-ids-path,
 		[AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
Signature · 1 line
1.7.3.1
Acked-by Greg Kroah-Hartman on v1 1/1
#1 lore raw
Quoted 5 lines · Scott James Remnant

We already allow the pci.ids location to be specified, so add a patch doing the same for usb.ids. Please don't make me explain why this is necessary, it will only make you cry.

As the maintainer of the usbutils package, I too cry when I see where this file ends up :(

#2 lore raw
In reply to Scott James Remnant
Quoted 3 lines · Scott James Remnant

We already allow the pci.ids location to be specified, so add a patch doing the same for usb.ids. Please don't make me explain why this is necessary, it will only make you cry.

I'll not ask. :) Sure, go ahead.

Kay

#3 lore raw
In reply to Scott James Remnant

Pushed with the C&P fix.

Quoted 9 lines · Kay Sievers
Quoted 3 lines · Scott James Remnant

We already allow the pci.ids location to be specified, so add a patch doing the same for usb.ids. Please don't make me explain why this is necessary, it will only make you cry.

I'll not ask. :) Sure, go ahead.

Kay

#4 lore raw
In reply to Scott James Remnant
Quoted 1 line · Scott James Remnant

Pushed with the C&P fix ;-)

Btw, why doesn't your system find out where it is installed by asking pkgconfig? That's why nobody else needs it, unlike they do for pci.

Kay

#5 lore raw
In reply to Scott James Remnant

Because it's a cross-compiled Gentoo.

So pkg-config reports the location inside the cross-compiled $ROOT, rather than the runtime location. The designers of pkg-config forgot about host vs. build vs. target *sigh*

Quoted 8 lines · Kay Sievers
Quoted 1 line · Scott James Remnant

Pushed with the C&P fix ;-)

Btw, why doesn't your system find out where it is installed by asking pkgconfig? That's why nobody else needs it, unlike they do for pci.

Kay