coreutils: fix build with eglibc
[packages.git] / utils / coreutils / Makefile
index 0df30e0..7103882 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2008 OpenWrt.org
+# Copyright (C) 2008-2010 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -8,12 +8,13 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=coreutils
-PKG_VERSION:=7.2
-PKG_RELEASE:=1
+PKG_VERSION:=8.7
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@GNU/coreutils
-PKG_MD5SUM:=427c2914d3eab956f317c9ec6a45e62a
+PKG_MD5SUM:=3c1ae9531159447083ae8f25ae554b81
+PKG_BUILD_DEPENDS:=libpthread
 
 include $(INCLUDE_DIR)/package.mk
 
@@ -22,18 +23,57 @@ define Package/coreutils
   CATEGORY:=Utilities
   TITLE:=The GNU core utilities
   URL:=http://www.gnu.org/software/coreutils/
+  DEPENDS:= \
+       +coreutils-base64 +coreutils-basename +coreutils-cat \
+       +coreutils-chcon +coreutils-chgrp +coreutils-chmod \
+       +coreutils-chown +coreutils-chroot +coreutils-cksum \
+       +coreutils-comm +coreutils-cp +coreutils-csplit \
+       +coreutils-cut +coreutils-date +coreutils-dd \
+       +coreutils-dir +coreutils-dircolors +coreutils-dirname \
+       +coreutils-du +coreutils-echo +coreutils-env \
+       +coreutils-expand +coreutils-expr +coreutils-factor \
+       +coreutils-false +coreutils-fmt +coreutils-fold \
+       +coreutils-groups +coreutils-head +coreutils-hostid \
+       +coreutils-id +coreutils-install +coreutils-join \
+       +coreutils-kill +coreutils-link +coreutils-ln \
+       +coreutils-logname +coreutils-ls +coreutils-md5sum \
+       +coreutils-mkdir +coreutils-mkfifo +coreutils-mknod \
+       +coreutils-mktemp +coreutils-mv +coreutils-nice +coreutils-nl \
+       +coreutils-nohup +coreutils-od +coreutils-paste +coreutils-pathchk \
+       +coreutils-pinky +coreutils-pr +coreutils-printenv \
+       +coreutils-printf +coreutils-ptx +coreutils-pwd +coreutils-readlink \
+       +coreutils-rm +coreutils-rmdir +coreutils-runcon +coreutils-seq \
+       +coreutils-sha1sum +coreutils-sha224sum +coreutils-sha256sum \
+       +coreutils-sha384sum +coreutils-sha512sum +coreutils-shred \
+       +coreutils-shuf +coreutils-sleep +coreutils-sort +coreutils-split \
+       +coreutils-stat +coreutils-stty +coreutils-su +coreutils-sum \
+       +coreutils-sync +coreutils-tac +coreutils-tail +coreutils-tee \
+       +coreutils-test +coreutils-timeout +coreutils-touch +coreutils-tr \
+       +coreutils-true +coreutils-truncate +coreutils-tsort +coreutils-tty \
+       +coreutils-uname +coreutils-unexpand +coreutils-uniq \
+       +coreutils-unlink +coreutils-uptime +coreutils-users +coreutils-vdir \
+       +coreutils-wc +coreutils-who +coreutils-whoami +coreutils-yes \
+       +coreutils-nproc +coreutils-stdbuf
 endef
-       
+
 define Package/coreutils/description
        Full versions of standard GNU utilities.  Normally, you would not
        use this package, since the functionality in BusyBox is more than
         sufficient and much smaller.
 endef
 
+ifneq ($(CONFIG_USE_UCLIBC),)
+CONFIGURE_VARS += \
+       gl_cv_func_mbrtowc_incomplete_state=yes \
+       gl_cv_func_mbrtowc_retval=yes \
+       gl_cv_func_wcrtomb_retval=yes \
+       ac_cv_type_pthread_spinlock_t=no
+else
 CONFIGURE_VARS += \
        gl_cv_func_mbrtowc_incomplete_state=yes \
        gl_cv_func_mbrtowc_retval=yes \
        gl_cv_func_wcrtomb_retval=yes
+endif
 
 CONFIGURE_ARGS += \
        --enable-install-program=su
@@ -46,8 +86,7 @@ define Build/Compile
 endef
 
 define Package/coreutils/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
+       true
 endef
 
 define Package/coreutils-base64
@@ -896,6 +935,24 @@ define Package/coreutils-nohup/install
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/nohup $(1)/usr/bin/
 endef
 
+define Package/coreutils-nproc
+  SECTION:utils
+  CATEGORY:=Utilities
+  TITLE:=Utility nproc from the GNU core utilites
+  URL:=http://www.gnu.org/software/coreutils/
+endef
+
+define Package/coreutils-nproc/description
+       Full version of standard GNU nproc utility.  Normally, you would not
+       use this package, since the functionality in BusyBox is more than
+       sufficient.
+endef
+
+define Package/coreutils-nproc/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/nproc $(1)/usr/bin/
+endef
+
 define Package/coreutils-od
   SECTION:utils
   CATEGORY:=Utilities
@@ -1295,6 +1352,7 @@ endef
 define Package/coreutils-sort
   SECTION:utils
   CATEGORY:=Utilities
+  DEPENDS:=+libpthread
   TITLE:=Utility sort from the GNU core utilites
   URL:=http://www.gnu.org/software/coreutils/
 endef
@@ -1346,6 +1404,24 @@ define Package/coreutils-stat/install
        $(CP) $(PKG_INSTALL_DIR)/usr/bin/stat $(1)/usr/bin/
 endef
 
+define Package/coreutils-stdbuf
+  SECTION:utils
+  CATEGORY:=Utilities
+  TITLE:=Utility stdbuf from the GNU core utilites
+  URL:=http://www.gnu.org/software/coreutils/
+endef
+
+define Package/coreutils-stdbuf/description
+       Full version of standard GNU stdbuf utility.  Normally, you would not
+       use this package, since the functionality in BusyBox is more than
+       sufficient.
+endef
+
+define Package/coreutils-stdbuf/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/stdbuf $(1)/usr/bin/
+endef
+
 define Package/coreutils-stty
   SECTION:utils
   CATEGORY:=Utilities
@@ -1863,6 +1939,7 @@ $(eval $(call BuildPackage,coreutils-mv))
 $(eval $(call BuildPackage,coreutils-nice))
 $(eval $(call BuildPackage,coreutils-nl))
 $(eval $(call BuildPackage,coreutils-nohup))
+$(eval $(call BuildPackage,coreutils-nproc))
 $(eval $(call BuildPackage,coreutils-od))
 $(eval $(call BuildPackage,coreutils-paste))
 $(eval $(call BuildPackage,coreutils-pathchk))
@@ -1888,6 +1965,7 @@ $(eval $(call BuildPackage,coreutils-sleep))
 $(eval $(call BuildPackage,coreutils-sort))
 $(eval $(call BuildPackage,coreutils-split))
 $(eval $(call BuildPackage,coreutils-stat))
+$(eval $(call BuildPackage,coreutils-stdbuf))
 $(eval $(call BuildPackage,coreutils-stty))
 $(eval $(call BuildPackage,coreutils-su))
 $(eval $(call BuildPackage,coreutils-sum))