Firmwarehotplug actually requires a sdcc that supports some targets, Debian lenny...
[openwrt/svn-archive/archive.git] / utils / firmwarehotplug / Makefile
index cf2ddee4ffd75639643fed5b24148fd9399a2fcc..16e5c977439dc373526e28bea8e58d1315148511 100644 (file)
@@ -13,14 +13,15 @@ PKG_RELEASE:=1
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/linux-hotplug
-PKG_MD5SUM:=unknown
-PKG_CAT:=zcat
-
-PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
-PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+PKG_MD5SUM:=e5cf352b172f498e27b160167b981f24
 
 include $(INCLUDE_DIR)/package.mk
 
+# workaround for fedora sdcc naming changes
+ifneq ($(wildcard /usr/libexec/sdcc),)
+  export PATH:=$(PATH):/usr/libexec
+endif
+
 define Package/firmwarehotplug
   SECTION:=utils
   CATEGORY:=Utilities
@@ -31,9 +32,10 @@ endef
 
 define Build/Compile
        $(call Build/Compile/Default, \
+               OPT="$(TARGET_CFLAGS)" \
                -C $(PKG_BUILD_DIR)/ezusb/midi/original \
                DESTDIR="$(PKG_INSTALL_DIR)" \
-                all install
+                all install \
        )
 endef
 
@@ -48,6 +50,16 @@ endef
 
 $(eval $(call BuildPackage,firmwarehotplug))
 
+define Require/working-sdcc
+       sdcc -v | awk '($$$$1 == "SDCC") && ($$$$3 == "mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08") { print "ok" }' | grep ok > /dev/null
+endef
+
 $(eval $(call RequireCommand,sdcc, \
-       $(PKG_NAME) requires sdcc. \
+        $(PKG_NAME) requires the SDCC Cross Compiler (sdcc). \
+))
+
+$(eval $(call Require,working-sdcc, \
+        $(PKG_NAME) requires a SDCC Cross Compiler (sdcc) that supports the following targets : \
+       mcs51/gbz80/z80/avr/ds390/pic16/pic14/TININative/xa51/ds400/hc08. You might consider \
+       installing the non-free version. \
 ))