libusb-compat: fixup libusb-config script similarly to other *-config scripts
authorPeter Korsgaard <jacmet@sunsite.dk>
Mon, 31 Jan 2011 19:02:36 +0000 (20:02 +0100)
committerPeter Korsgaard <jacmet@sunsite.dk>
Mon, 31 Jan 2011 19:02:36 +0000 (20:02 +0100)
So programs using this don't end up looking for host includes / libraries.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/libusb-compat/libusb-compat.mk

index 98271c7d1c4e5470c92bbc669bdde4785089b2bf..6590e893b9556e35686140f0dd5c894523ecffbc 100644 (file)
@@ -11,4 +11,12 @@ LIBUSB_COMPAT_DEPENDENCIES = host-pkg-config libusb
 LIBUSB_COMPAT_INSTALL_STAGING = YES
 LIBUSB_COMPAT_INSTALL_TARGET = YES
 
+define LIBUSB_COMPAT_FIXUP_CONFIG
+       $(SED) 's%prefix=/usr%prefix=$(STAGING_DIR)/usr%' \
+           -e 's%exec_prefix=/usr%exec_prefix=$(STAGING_DIR)/usr%' \
+               $(STAGING_DIR)/usr/bin/libusb-config
+endef
+
+LIBUSB_COMPAT_POST_INSTALL_STAGING_HOOKS+=LIBUSB_COMPAT_FIXUP_CONFIG
+
 $(eval $(call AUTOTARGETS,package,libusb-compat))