add which
authorMike Frysinger <vapier@gentoo.org>
Thu, 11 Nov 2004 14:28:17 +0000 (14:28 -0000)
committerMike Frysinger <vapier@gentoo.org>
Thu, 11 Nov 2004 14:28:17 +0000 (14:28 -0000)
package/Config.in
package/which/Config.in [new file with mode: 0644]
package/which/Makefile.in [new file with mode: 0644]
package/which/which.mk [new file with mode: 0644]

index 6702a6c771ba28581b10f9dd4db33ec286938e00..4da1f5016bc8b8e354e6f037968c9623468b69a6 100644 (file)
@@ -105,6 +105,7 @@ source "package/util-linux/Config.in"
 source "package/valgrind/Config.in"
 source "package/vtun/Config.in"
 source "package/wget/Config.in"
+source "package/which/Config.in"
 source "package/wtools/Config.in"
 source "package/zlib/Config.in"
 
diff --git a/package/which/Config.in b/package/which/Config.in
new file mode 100644 (file)
index 0000000..73f2591
--- /dev/null
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_WHICH
+       bool "which"
+       default n
+       help
+         The standard 'which' utility.
+
+         http://www.xs4all.nl/~carlo17/which/
diff --git a/package/which/Makefile.in b/package/which/Makefile.in
new file mode 100644 (file)
index 0000000..b115ce3
--- /dev/null
@@ -0,0 +1,3 @@
+ifeq ($(strip $(BR2_PACKAGE_WHICH)),y)
+TARGETS+=which
+endif
diff --git a/package/which/which.mk b/package/which/which.mk
new file mode 100644 (file)
index 0000000..0450cc1
--- /dev/null
@@ -0,0 +1,46 @@
+#############################################################
+#
+# which
+#
+#############################################################
+WHICH_VER:=2.16
+WHICH_SOURCE:=which-$(WHICH_VER).tar.gz
+WHICH_SITE:=http://www.xs4all.nl/~carlo17/which/
+WHICH_DIR:=$(BUILD_DIR)/which-$(WHICH_VER)
+WHICH_CAT:=zcat
+WHICH_BINARY:=which
+WHICH_TARGET_BINARY:=bin/which
+
+$(DL_DIR)/$(WHICH_SOURCE):
+       $(WGET) -P $(DL_DIR) $(WHICH_SITE)/$(WHICH_SOURCE)
+
+$(WHICH_DIR)/.unpacked: $(DL_DIR)/$(WHICH_SOURCE)
+       $(WHICH_CAT) $(DL_DIR)/$(WHICH_SOURCE) | tar -C $(BUILD_DIR) $(TAR_OPTIONS) -
+       touch $(WHICH_DIR)/.unpacked
+
+$(WHICH_DIR)/.configured: $(WHICH_DIR)/.unpacked
+       (cd $(WHICH_DIR); rm -rf config.cache; \
+               $(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \
+               CFLAGS="$(TARGET_CFLAGS)" \
+               ./configure \
+               --target=$(GNU_TARGET_NAME) \
+               --host=$(GNU_TARGET_NAME) \
+               --build=$(GNU_HOST_NAME) \
+               --prefix=/ \
+       );
+       touch $(WHICH_DIR)/.configured
+
+$(WHICH_DIR)/$(WHICH_BINARY): $(WHICH_DIR)/.configured
+       $(MAKE) CC=$(TARGET_CC) -C $(WHICH_DIR)
+
+$(TARGET_DIR)/$(WHICH_TARGET_BINARY): $(WHICH_DIR)/$(WHICH_BINARY)
+       install -D $(WHICH_DIR)/$(WHICH_BINARY) $(TARGET_DIR)/$(WHICH_TARGET_BINARY)
+
+which: uclibc $(TARGET_DIR)/$(WHICH_TARGET_BINARY)
+
+which-clean:
+       rm -f $(TARGET_DIR)/$(WHICH_TARGET_BINARY)
+       -$(MAKE) -C $(WHICH_DIR) clean
+
+which-dirclean:
+       rm -rf $(WHICH_DIR)