[tools/mklibs] add missing includes ('unistd.h') for mklibs
[openwrt/svn-archive/archive.git] / tools / Makefile
index 29e73335aea889c33268419000bb3570d18ab18e..6635b68e25836bbb5d3b7838c0330cd82d15a1b5 100644 (file)
@@ -25,6 +25,10 @@ tools-y += lzma-old squashfs
 endif
 tools-y += lzma squashfs4
 
+ifneq ($(CONFIG_PACKAGE_firmwarehotplug),)
+tools-y += sdcc
+endif
+
 ifdef CONFIG_GCC_USE_GRAPHITE
   ifeq ($(CONFIG_GCC_USE_SYSTEM_PPL_CLOOG),)
        tools-y += ppl cloog
@@ -47,7 +51,7 @@ $(curdir)/mpc/compile := $(curdir)/mpfr/install $(curdir)/gmp/install
 $(curdir)/mpfr/compile := $(curdir)/gmp/install
 $(curdir)/ppl/compile := $(curdir)/gmp/install
 $(curdir)/cloog/compile := $(curdir)/ppl/install
-$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/install
+$(curdir)/mtd-utils/compile := $(curdir)/e2fsprogs/install $(curdir)/xz/install
 $(curdir)/mkimage/compile := $(curdir)/sed/install
 $(curdir)/qemu/compile := $(curdir)/e2fsprogs/install
 $(curdir)/upslug2/compile := $(curdir)/automake/install
@@ -101,13 +105,23 @@ $(STAGING_DIR_HOST)/bin/$(1): $(STAGING_DIR)/.prepared
 endef
 endif
 
+$(STAGING_DIR_HOST)/bin/stat: $(STAGING_DIR)/.prepared
+       @rm -f $@
+       @if stat --version > /dev/null 2>&1; then \
+               ln -s `which stat` $@; \
+       elif gstat --version > /dev/null 2>&1; then \
+               ln -s `which gstat` $@; \
+       else \
+               echo "GNU stat not found"; \
+               false; \
+       fi
+
 $(eval $(call PrepareCommand,find,gfind find))
 $(eval $(call PrepareCommand,md5sum,md5sum $(SCRIPT_DIR)/md5sum))
 $(eval $(call PrepareCommand,cp,gcp cp))
-$(eval $(call PrepareCommand,stat,gstat stat))
 $(eval $(call PrepareCommand,seq,gseq seq))
 
-$(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,find md5sum cp stat)
+$(curdir)/cmddeps = $(patsubst %,$(STAGING_DIR_HOST)/bin/%,find md5sum cp stat seq)
 $(curdir)//prepare = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)
 $(curdir)//compile = $(STAGING_DIR)/.prepared $(STAGING_DIR_HOST)/.prepared $($(curdir)/cmddeps)