aboutsummaryrefslogtreecommitdiff
path: root/package/libusb
diff options
context:
space:
mode:
authorGravatar Mike Frysinger <vapier@gentoo.org>2005-12-13 05:00:18 +0000
committerGravatar Mike Frysinger <vapier@gentoo.org>2005-12-13 05:00:18 +0000
commita604fbc18a24e729913b930c83a236d1f83cd812 (patch)
tree1b8cc10a216d4f81b8e7b33abc3f32bb496a51ab /package/libusb
parent05e5438fe3d73e4b067b2436fa5e156bd49a29a6 (diff)
downloadbuildroot-a604fbc18a24e729913b930c83a236d1f83cd812.tar.gz
buildroot-a604fbc18a24e729913b930c83a236d1f83cd812.tar.bz2
import libusb package
Diffstat (limited to 'package/libusb')
-rw-r--r--package/libusb/Config.in7
-rw-r--r--package/libusb/libusb.mk59
2 files changed, 66 insertions, 0 deletions
diff --git a/package/libusb/Config.in b/package/libusb/Config.in
new file mode 100644
index 0000000000..44a2018c7a
--- /dev/null
+++ b/package/libusb/Config.in
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_LIBUSB
+ bool "libusb"
+ default n
+ help
+ Userspace library for accessing USB devices
+
+ http://libusb.sourceforge.net/
diff --git a/package/libusb/libusb.mk b/package/libusb/libusb.mk
new file mode 100644
index 0000000000..0fbb3bf28c
--- /dev/null
+++ b/package/libusb/libusb.mk
@@ -0,0 +1,59 @@
+#############################################################
+#
+# libusb
+#
+#############################################################
+LIBUSB_VER:=0.1.10a
+LIBUSB_SOURCE:=libusb-$(LIBUSB_VER).tar.gz
+LIBUSB_SITE:=http://$(BR2_SOURCEFORGE_MIRROR).dl.sourceforge.net/sourceforge/libusb/
+LIBUSB_DIR:=$(BUILD_DIR)/libusb-$(LIBUSB_VER)
+LIBUSB_CAT:=zcat
+LIBUSB_BINARY:=libusb.la
+LIBUSB_TARGET_BINARY:=usr/lib/libusb.so
+
+$(DL_DIR)/$(LIBUSB_SOURCE):
+ $(WGET) -P $(DL_DIR) $(LIBUSB_SITE)/$(LIBUSB_SOURCE)
+
+libusb-unpacked: $(LIBUSB_DIR)/.unpacked
+$(LIBUSB_DIR)/.unpacked: $(DL_DIR)/$(LIBUSB_SOURCE)
+ $(LIBUSB_CAT) $(DL_DIR)/$(LIBUSB_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+ touch $(LIBUSB_DIR)/.unpacked
+
+$(LIBUSB_DIR)/.configured: $(LIBUSB_DIR)/.unpacked
+ (cd $(LIBUSB_DIR); rm -rf config.cache; \
+ $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ ac_cv_header_regex_h=no \
+ ./configure \
+ --target=$(GNU_TARGET_NAME) \
+ --host=$(GNU_TARGET_NAME) \
+ --build=$(GNU_HOST_NAME) \
+ --prefix=/usr \
+ --disable-debug \
+ --disable-build-docs \
+ );
+ touch $(LIBUSB_DIR)/.configured
+
+$(LIBUSB_DIR)/$(LIBUSB_BINARY): $(LIBUSB_DIR)/.configured
+ $(TARGET_CONFIGURE_OPTS) $(MAKE) CC=$(TARGET_CC) -C $(LIBUSB_DIR)
+
+$(TARGET_DIR)/$(LIBUSB_TARGET_BINARY): $(LIBUSB_DIR)/$(LIBUSB_BINARY)
+ make -C $(LIBUSB_DIR) DESTDIR=$(TARGET_DIR) install
+ rm -f $(TARGET_DIR)/usr/lib/libusb*.a $(TARGET_DIR)/usr/lib/libusb*.la
+
+libusb: uclibc $(TARGET_DIR)/$(LIBUSB_TARGET_BINARY)
+
+libusb-clean:
+ rm -f $(TARGET_DIR)/$(LIBUSB_TARGET_BINARY)
+ -$(MAKE) -C $(LIBUSB_DIR) clean
+
+libusb-dirclean:
+ rm -rf $(LIBUSB_DIR)
+#############################################################
+#
+# Toplevel Makefile options
+#
+#############################################################
+ifeq ($(strip $(BR2_PACKAGE_LIBUSB)),y)
+TARGETS+=libusb
+endif