Browse Source

Merge branch 'master' of git+ssh://openadk.org/git/openadk

Waldemar Brodkorb 11 years ago
parent
commit
9e2fdf2375
63 changed files with 1382 additions and 137 deletions
  1. 0 1
      TODO
  2. 1 1
      mk/vars.mk
  3. 1 1
      package/asterisk/Makefile
  4. 12 13
      package/base-files/Makefile
  5. 1 1
      package/base-files/files/inittab.shell
  6. 1 1
      package/base-files/src/etc/ipkg.conf
  7. 0 4
      package/base-files/src/usr/share/udhcpc/default.script
  8. 1 1
      package/ebtables/Makefile
  9. 3 3
      package/ebtables/patches/patch-Makefile
  10. 10 0
      package/ebtables/patches/patch-extensions_ebt_among_c
  11. 10 0
      package/ebtables/patches/patch-extensions_ebt_arpreply_c
  12. 10 0
      package/ebtables/patches/patch-extensions_ebt_ip6_c
  13. 10 0
      package/ebtables/patches/patch-extensions_ebt_limit_c
  14. 10 0
      package/ebtables/patches/patch-extensions_ebt_nat_c
  15. 29 0
      package/ebtables/patches/patch-include_ethernetdb_h
  16. 10 0
      package/ebtables/patches/patch-useful_functions_c
  17. 1 1
      package/ethtool/Makefile
  18. 10 2
      package/ethtool/patches/patch-internal_h
  19. 17 8
      package/findutils/Makefile
  20. 11 0
      package/findutils/patches/patch-configure_ac
  21. 15 0
      package/findutils/patches/patch-gnulib_lib_freadahead_c
  22. 24 0
      package/findutils/patches/patch-gnulib_lib_freadahead_h
  23. 18 0
      package/findutils/patches/patch-gnulib_lib_fseeko_c
  24. 25 0
      package/findutils/patches/patch-gnulib_m4_fflush_m4
  25. 3 3
      package/gkrellm/Makefile
  26. 0 30
      package/gkrellm/patches/patch-server_Makefile
  27. 24 0
      package/gkrellm/patches/patch-server_main_c
  28. 10 0
      package/gkrellm/patches/patch-server_sysdeps-unix_c
  29. 1 1
      package/ipcad/Makefile
  30. 169 0
      package/ipcad/patches/patch-Makefile
  31. 10 1
      package/ipcad/patches/patch-Makefile_in
  32. 60 0
      package/ipcad/patches/patch-cfg_y
  33. 2 0
      package/iptables-snmp/Makefile
  34. 2 2
      package/logrotate/Makefile
  35. 15 42
      package/logrotate/patches/patch-Makefile
  36. 8 0
      package/logrotate/patches/patch-config_c
  37. 8 0
      package/logrotate/patches/patch-logrotate_c
  38. 11 0
      package/logrotate/patches/patch-logrotate_h
  39. 574 0
      package/logrotate/src/queue.h
  40. 3 2
      package/moc/Makefile
  41. 2 2
      package/ntfs-3g/Makefile
  42. 10 0
      package/ntfs-3g/patches/patch-libfuse-lite_fusermount_c
  43. 10 0
      package/ntfs-3g/patches/patch-libfuse-lite_mount_util_c
  44. 1 0
      rules.mk
  45. 206 0
      scripts/gcc-bisect.sh
  46. 1 0
      target/arm/sys-available/cubox-i
  47. 1 0
      target/arm/sys-available/raspberry-pi
  48. 0 1
      target/arm/target.mk
  49. 7 0
      target/config/Config.in.adk
  50. 0 1
      target/m68k/target.mk
  51. 0 1
      target/microblaze/target.mk
  52. 1 0
      target/mips/sys-available/lemote-yeelong
  53. 0 1
      target/mips/target.mk
  54. 0 1
      target/ppc/target.mk
  55. 0 1
      target/ppc64/target.mk
  56. 0 1
      target/sh/target.mk
  57. 0 1
      target/sparc/target.mk
  58. 0 1
      target/sparc64/target.mk
  59. 1 0
      target/x86/sys-available/ibm-x40
  60. 0 1
      target/x86/target.mk
  61. 0 1
      target/x86_64/target.mk
  62. 9 6
      toolchain/musl/Makefile
  63. 3 0
      toolchain/uClibc/Makefile

+ 0 - 1
TODO

@@ -1,4 +1,3 @@
-- ipkg.conf url fixen
 - hash-style=gnu for non-mips and non-musl
 - fix libiberty.a mess
 - check gold for mozilla compile

+ 1 - 1
mk/vars.mk

@@ -127,7 +127,7 @@ ifneq ($(ADK_DEBUG),)
 TARGET_CFLAGS+=		-g3 -fno-omit-frame-pointer
 else
 TARGET_CPPFLAGS+=	-DNDEBUG
-TARGET_CFLAGS+=		-fomit-frame-pointer $(TARGET_OPTIMIZATION)
+TARGET_CFLAGS+=		-fomit-frame-pointer $(ADK_TARGET_CFLAGS_OPT)
 # stop generating eh_frame stuff
 TARGET_CFLAGS+=		-fno-unwind-tables -fno-asynchronous-unwind-tables
 # always add debug information

+ 1 - 1
package/asterisk/Makefile

@@ -105,7 +105,7 @@ TARGET_LDFLAGS+=	-lm -ltinfo -ldl -lpthread
 MAKE_ENV=		ASTCFLAGS="${TARGET_CPPFLAGS} -DHAVE_STRTOQ" \
 			ASTLDFLAGS="${TARGET_LDFLAGS}"
 MAKE_FLAGS+=		DESTDIR="$(WRKINST)" \
-			OPTIMIZE="${TARGET_OPTIMIZATION}" \
+			OPTIMIZE="${TARGET_CFLAGS}" \
 			NOISY_BUILD=1
 ALL_TARGET:=		all install samples
 

+ 12 - 13
package/base-files/Makefile

@@ -6,7 +6,7 @@ include $(TOPDIR)/mk/rootfs.mk
 
 PKG_NAME:=		base-files
 PKG_VERSION:=		1.0
-PKG_RELEASE:=		76
+PKG_RELEASE:=		78
 PKG_SECTION:=		base
 PKG_DESCR:=		basic files and scripts
 PKG_BUILDDEP:=		pkgconf-host file-host
@@ -30,6 +30,11 @@ endif
 	$(SED) 's,@ARCH@,$(ADK_TARGET_CPU_ARCH),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
 	$(SED) 's,@SYSTEM@,$(ADK_TARGET_SYSTEM),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
 	$(SED) 's,@LIBC@,$(ADK_TARGET_LIBC),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
+ifneq ($(ADK_TARGET_ABI),)
+	$(SED) 's,@ABI@,_$(ADK_TARGET_ABI),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
+else
+	$(SED) 's,@ABI@,,g' $(IDIR_BASE_FILES)/etc/ipkg.conf
+endif
 	$(SED) 's,@HOST@,$(ADK_HOST),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
 	$(SED) 's,@VENDOR@,$(ADK_VENDOR),g' $(IDIR_BASE_FILES)/etc/ipkg.conf
 	echo /bin/sh >${IDIR_BASE_FILES}/etc/shells
@@ -51,6 +56,7 @@ endif
 	chmod 755 $(IDIR_BASE_FILES)/lib/mdev/init
 	chmod 600 $(IDIR_BASE_FILES)/etc/shadow
 	chmod 600 $(IDIR_BASE_FILES)/etc/network/interfaces
+	(cd $(IDIR_BASE_FILES)/etc; ln -sf ../tmp/resolv.conf .)
 	chmod 1777 ${IDIR_BASE_FILES}/tmp
 	ln -sf ../proc/mounts $(IDIR_BASE_FILES)/etc/mtab
 	rm -rf $(IDIR_BASE_FILES)/var
@@ -80,23 +86,20 @@ ifneq (${ADK_PACKAGE_CONFIG_IN_ETC},)
 	gzip -9c ${TOPDIR}/.config >$(IDIR_BASE_FILES)/etc/adkconfig.gz
 	chmod 600 $(IDIR_BASE_FILES)/etc/adkconfig.gz
 endif
-ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
-	echo 'export LD_LIBRARY_PATH=/opt/vc/lib' >> $(IDIR_BASE_FILES)/etc/profile
-ifneq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI)$(ADK_TARGET_SYSTEM_IBM_X40)$(ADK_TARGET_SYSTEM_LEMOTE_YEELONG),)
+ifeq ($(ADK_TARGET_WITH_ROOT_RW),y)
 	echo 'export IPKGTMPDIR=/root/.ipkg' >> $(IDIR_BASE_FILES)/etc/profile
 else
-	echo 'export IPKGTMPDIR=/tmp >> $(IDIR_BASE_FILES)/etc/profile
+	echo 'export IPKGTMPDIR=/tmp' >> $(IDIR_BASE_FILES)/etc/profile
 endif
-
+ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI),y)
+	echo 'export LD_LIBRARY_PATH=/opt/vc/lib' >> $(IDIR_BASE_FILES)/etc/profile
 endif
 
 # simple network configuration
 ifneq (${ADK_SIMPLE_NETWORK_CONFIG},)
 	${INSTALL_DIR} ${IDIR_BASE_FILES}/etc/network
-
 	# network config local
 	echo -e "auto lo\niface lo inet loopback" > ${IDIR_BASE_FILES}/etc/network/interfaces
-
 	# network config eth0
 	# configure nic with dhcp
 ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_NIC},y)
@@ -123,12 +126,10 @@ ifeq (${SIMPLE_NETWORK_CONFIG_ETH0_TYPE_BRIDGE_IP},y)
 	echo -e "  broadcast ${SIMPLE_NETWORK_CONFIG_ETH0_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces
 	echo -e "  bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH0_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces
 endif
-
 	# network config wlan0
 ifeq (${SIMPLE_NETWORK_CONFIG_WLAN0_TYPE_NIC},y)
 	echo -e "\nauto wlan0\niface wlan0 inet dhcp" >> ${IDIR_BASE_FILES}/etc/network/interfaces
 endif
-
 	# network config eth1
 	# configure nic with dhcp
 ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_NIC},y)
@@ -155,13 +156,11 @@ ifeq (${SIMPLE_NETWORK_CONFIG_ETH1_TYPE_BRIDGE_IP},y)
 	echo -e "  broadcast ${SIMPLE_NETWORK_CONFIG_ETH1_BC}" >> ${IDIR_BASE_FILES}/etc/network/interfaces
 	echo -e "  bridge-ports ${SIMPLE_NETWORK_CONFIG_ETH1_BRIDGE}" >> ${IDIR_BASE_FILES}/etc/network/interfaces
 endif
-
 	# newline at the end of interfaces file
 	echo -en "\n" >>  ${IDIR_BASE_FILES}/etc/network/interfaces
-
 	# resolver config
+	rm ${IDIR_BASE_FILES}/etc/resolv.conf
 	echo -e "nameserver ${SIMPLE_NETWORK_CONFIG_RESOLV}" > ${IDIR_BASE_FILES}/etc/resolv.conf
 endif
 
-
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 1 - 1
package/base-files/files/inittab.shell

@@ -1 +1 @@
-::askfirst:/bin/sh
+::askfirst:-/bin/sh

+ 1 - 1
package/base-files/src/etc/ipkg.conf

@@ -1,3 +1,3 @@
-src @VENDOR@ http://@HOST@/@SYSTEM@_@ARCH@_@LIBC@/packages
+src @VENDOR@ http://@HOST@/pkg/@SYSTEM@_@ARCH@_@LIBC@@ABI@/packages
 dest root /
 dest ram /tmp

+ 0 - 4
package/base-files/src/usr/share/udhcpc/default.script

@@ -23,16 +23,12 @@ case $1 in
 			ip route add to default via $i
 		done
 	fi
-
-	touch /tmp/resolv.conf
-	ln -sf /tmp/resolv.conf $RESOLV_CONF
 	echo -n >$RESOLV_CONF
 	${domain:+echo search $domain} >>$RESOLV_CONF
 	for i in $dns; do
 		echo "adding dns $i"
 		echo "nameserver $i" >>$RESOLV_CONF
 	done
-
 	# user rules
 	[ -f /etc/udhcpc.user ] && . /etc/udhcpc.user
 ;;

+ 1 - 1
package/ebtables/Makefile

@@ -21,7 +21,7 @@ $(eval $(call PKG_template,EBTABLES,ebtables,${PKG_VERSION}-${PKG_RELEASE},${PKG
 
 CONFIG_STYLE:=		manual
 
-post-install:
+ebtables-install:
 	${INSTALL_DIR} ${IDIR_EBTABLES}/etc
 	${INSTALL_DIR} ${IDIR_EBTABLES}/usr/sbin ${IDIR_EBTABLES}/usr/lib
 	${INSTALL_DATA} ${WRKINST}/etc/ethertypes ${IDIR_EBTABLES}/etc

+ 3 - 3
package/ebtables/patches/patch-Makefile

@@ -1,6 +1,6 @@
---- ebtables-v2.0.10-3.orig/Makefile	2011-12-04 10:46:26.000000000 +0100
-+++ ebtables-v2.0.10-3/Makefile	2011-12-11 16:35:34.619464748 +0100
-@@ -10,16 +10,16 @@ LOCKDIR:=$(shell echo $(LOCKFILE) | sed 
+--- ebtables-v2.0.10-4.orig/Makefile	2011-12-15 21:02:47.000000000 +0100
++++ ebtables-v2.0.10-4/Makefile	2014-03-23 15:46:20.000000000 +0100
+@@ -10,16 +10,16 @@ LOCKDIR:=$(shell echo $(LOCKFILE) | sed
  
  # default paths
  LIBDIR:=/usr/lib

+ 10 - 0
package/ebtables/patches/patch-extensions_ebt_among_c

@@ -0,0 +1,10 @@
+--- ebtables-v2.0.10-4.orig/extensions/ebt_among.c	2011-12-15 21:02:47.000000000 +0100
++++ ebtables-v2.0.10-4/extensions/ebt_among.c	2014-03-23 15:51:29.000000000 +0100
+@@ -13,7 +13,6 @@
+ #include <ctype.h>
+ #include <unistd.h>
+ #include "../include/ebtables_u.h"
+-#include <netinet/ether.h>
+ #include "../include/ethernetdb.h"
+ #include <linux/if_ether.h>
+ #include <linux/netfilter_bridge/ebt_among.h>

+ 10 - 0
package/ebtables/patches/patch-extensions_ebt_arpreply_c

@@ -0,0 +1,10 @@
+--- ebtables-v2.0.10-4.orig/extensions/ebt_arpreply.c	2011-12-15 21:02:47.000000000 +0100
++++ ebtables-v2.0.10-4/extensions/ebt_arpreply.c	2014-03-23 15:50:38.000000000 +0100
+@@ -12,7 +12,6 @@
+ #include <string.h>
+ #include <getopt.h>
+ #include "../include/ebtables_u.h"
+-#include <netinet/ether.h>
+ #include <linux/netfilter_bridge/ebt_arpreply.h>
+ 
+ static int mac_supplied;

+ 10 - 0
package/ebtables/patches/patch-extensions_ebt_ip6_c

@@ -0,0 +1,10 @@
+--- ebtables-v2.0.10-4.orig/extensions/ebt_ip6.c	2011-12-15 21:02:47.000000000 +0100
++++ ebtables-v2.0.10-4/extensions/ebt_ip6.c	2014-03-23 15:51:09.000000000 +0100
+@@ -11,6 +11,7 @@
+  *
+  */
+ 
++#include <sys/types.h>
+ #include <errno.h>
+ #include <inttypes.h>
+ #include <limits.h>

+ 10 - 0
package/ebtables/patches/patch-extensions_ebt_limit_c

@@ -0,0 +1,10 @@
+--- ebtables-v2.0.10-4.orig/extensions/ebt_limit.c	2011-12-15 21:02:47.000000000 +0100
++++ ebtables-v2.0.10-4/extensions/ebt_limit.c	2014-03-23 15:52:04.000000000 +0100
+@@ -8,6 +8,7 @@
+  * September, 2003
+  */
+ 
++#include <sys/types.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>

+ 10 - 0
package/ebtables/patches/patch-extensions_ebt_nat_c

@@ -0,0 +1,10 @@
+--- ebtables-v2.0.10-4.orig/extensions/ebt_nat.c	2011-12-15 21:02:47.000000000 +0100
++++ ebtables-v2.0.10-4/extensions/ebt_nat.c	2014-03-23 15:50:13.000000000 +0100
+@@ -11,7 +11,6 @@
+ #include <string.h>
+ #include <getopt.h>
+ #include "../include/ebtables_u.h"
+-#include <netinet/ether.h>
+ #include <linux/netfilter_bridge/ebt_nat.h>
+ 
+ static int to_source_supplied, to_dest_supplied;

+ 29 - 0
package/ebtables/patches/patch-include_ethernetdb_h

@@ -0,0 +1,29 @@
+--- ebtables-v2.0.10-4.orig/include/ethernetdb.h	2011-12-15 21:02:47.000000000 +0100
++++ ebtables-v2.0.10-4/include/ethernetdb.h	2014-03-23 15:47:35.000000000 +0100
+@@ -38,21 +38,20 @@ struct ethertypeent {
+ 
+ /* Open ethertype data base files and mark them as staying open even
+    after a later search if STAY_OPEN is non-zero.  */
+-extern void setethertypeent(int __stay_open) __THROW;
++extern void setethertypeent(int __stay_open);
+ 
+ /* Close ethertype data base files and clear `stay open' flag.  */
+-extern void endethertypeent(void) __THROW;
++extern void endethertypeent(void);
+ 
+ /* Get next entry from ethertype data base file.  Open data base if
+    necessary.  */
+-extern struct ethertypeent *getethertypeent(void) __THROW;
++extern struct ethertypeent *getethertypeent(void);
+ 
+ /* Return entry from ethertype data base for network with NAME.  */
+-extern struct ethertypeent *getethertypebyname(__const char *__name)
+-    __THROW;
++extern struct ethertypeent *getethertypebyname(__const char *__name);
+ 
+ /* Return entry from ethertype data base which number is PROTO.  */
+-extern struct ethertypeent *getethertypebynumber(int __ethertype) __THROW;
++extern struct ethertypeent *getethertypebynumber(int __ethertype);
+ 
+ 
+ #endif				/* ethernetdb.h */

+ 10 - 0
package/ebtables/patches/patch-useful_functions_c

@@ -0,0 +1,10 @@
+--- ebtables-v2.0.10-4.orig/useful_functions.c	2011-12-15 21:02:47.000000000 +0100
++++ ebtables-v2.0.10-4/useful_functions.c	2014-03-23 15:49:15.000000000 +0100
+@@ -25,7 +25,6 @@
+ #include "include/ebtables_u.h"
+ #include "include/ethernetdb.h"
+ #include <stdio.h>
+-#include <netinet/ether.h>
+ #include <string.h>
+ #include <stdlib.h>
+ #include <getopt.h>

+ 1 - 1
package/ethtool/Makefile

@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		ethtool
 PKG_VERSION:=		3.13
-PKG_RELEASE:=		1
+PKG_RELEASE:=		2
 PKG_MD5SUM:=		dcb8f345d44ee79108282e7d0bdf5013
 PKG_DESCR:=		display or change ethernet card settings
 PKG_SECTION:=		net

+ 10 - 2
package/ethtool/patches/patch-internal_h

@@ -1,6 +1,14 @@
 --- ethtool-3.13.orig/internal.h	2014-01-27 02:27:14.000000000 +0100
-+++ ethtool-3.13/internal.h	2014-03-22 20:49:34.000000000 +0100
-@@ -17,16 +17,16 @@
++++ ethtool-3.13/internal.h	2014-03-23 13:47:54.000000000 +0100
+@@ -7,6 +7,7 @@
+ #include "ethtool-config.h"
+ #endif
+ #include <stdio.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <sys/types.h>
+@@ -17,16 +18,16 @@
  
  /* ethtool.h expects these to be defined by <linux/types.h> */
  #ifndef HAVE_BE_TYPES

+ 17 - 8
package/findutils/Makefile

@@ -5,29 +5,38 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		findutils
 PKG_VERSION:=		4.4.2
-PKG_RELEASE:=		2
+PKG_RELEASE:=		4
 PKG_MD5SUM:=		351cc4adb07d54877fa15f75fb77d39f
 PKG_DESCR:=		GNU utilities for finding files
 PKG_SECTION:=		utils
 PKG_DEPENDS:=		libpthread
+PKG_BUILDDEP:=		autotool
 PKG_URL:=		http://www.gnu.org/software/findutils/
 PKG_SITES:=		http://ftp.gnu.org/pub/gnu/findutils/
 
-PKG_SUBPKGS:=		FINDUTILS LOCATE
-PKGSD_LOCATE:=		Locate utility
+PKG_SUBPKGS:=		FIND XARGS LOCATE
+PKGSD_LOCATE:=		locate utility
+PKGSD_XARGS:=		xargs utility
 
 include $(TOPDIR)/mk/package.mk
 
-$(eval $(call PKG_template,FINDUTILS,findutils,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+$(eval $(call PKG_template,FIND,find,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+$(eval $(call PKG_template,XARGS,xargs,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_XARGS},${PKG_SECTION}))
 $(eval $(call PKG_template,LOCATE,locate,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKGSD_LOCATE},${PKG_SECTION}))
 
+AUTOTOOL_STYLE:=	autoreconf
 CONFIGURE_ENV+=		gl_cv_func_wcwidth_works=yes \
 			ac_cv_func_working_mktime=yes
 
-findutils-install:
-	$(INSTALL_DIR) $(IDIR_FINDUTILS)/usr/bin
-	$(INSTALL_BIN) $(WRKINST)/usr/bin/{find,oldfind,xargs} \
-		 $(IDIR_FINDUTILS)/usr/bin
+find-install:
+	$(INSTALL_DIR) $(IDIR_FIND)/usr/bin
+	$(INSTALL_BIN) $(WRKINST)/usr/bin/find \
+		 $(IDIR_FIND)/usr/bin
+
+xargs-install:
+	$(INSTALL_DIR) $(IDIR_XARGS)/usr/bin
+	$(INSTALL_BIN) $(WRKINST)/usr/bin/xargs \
+		 $(IDIR_XARGS)/usr/bin
 
 locate-install:
 	${INSTALL_DIR} ${IDIR_LOCATE}/usr/{bin,libexec}

+ 11 - 0
package/findutils/patches/patch-configure_ac

@@ -0,0 +1,11 @@
+--- findutils-4.4.2.orig/configure.ac	2009-05-16 17:27:39.000000000 +0200
++++ findutils-4.4.2/configure.ac	2014-03-23 19:39:22.000000000 +0100
+@@ -77,8 +77,6 @@ AC_PROG_CPP
+ dnl for gnulib
+ gl_EARLY
+ 
+-AM_C_PROTOTYPES
+-
+ AC_PROG_INSTALL
+ AC_PROG_RANLIB
+ dnl AC_PROG_LIBTOOL

+ 15 - 0
package/findutils/patches/patch-gnulib_lib_freadahead_c

@@ -0,0 +1,15 @@
+--- findutils-4.4.2.orig/gnulib/lib/freadahead.c	2009-05-10 23:23:57.000000000 +0200
++++ findutils-4.4.2/gnulib/lib/freadahead.c	2014-03-23 16:27:43.000000000 +0100
+@@ -19,6 +19,7 @@
+ /* Specification.  */
+ #include "freadahead.h"
+ 
++#ifndef HAVE___FREADAHEAD
+ size_t
+ freadahead (FILE *fp)
+ {
+@@ -64,3 +65,4 @@ freadahead (FILE *fp)
+  #error "Please port gnulib freadahead.c to your platform! Look at the definition of fflush, fread on your system, then report this to bug-gnulib."
+ #endif
+ }
++#endif

+ 24 - 0
package/findutils/patches/patch-gnulib_lib_freadahead_h

@@ -0,0 +1,24 @@
+--- findutils-4.4.2.orig/gnulib/lib/freadahead.h	2009-05-10 23:23:57.000000000 +0200
++++ findutils-4.4.2/gnulib/lib/freadahead.h	2014-03-23 16:27:43.000000000 +0100
+@@ -29,8 +29,21 @@ extern "C" {
+ 
+    STREAM must not be wide-character oriented.  */
+ 
++#if HAVE___FREADAHEAD || (defined(__linux__) && !defined(__GLIBC__) && !defined(__UCLIBC__)) /* musl libc */
++
++#ifndef HAVE___FREADAHEAD
++#define HAVE___FREADAHEAD 1
++#endif
++
++# include <stdio_ext.h>
++# define freadahead(stream) __freadahead (stream)
++
++#else
++
+ extern size_t freadahead (FILE *stream);
+ 
++#endif
++
+ #ifdef __cplusplus
+ }
+ #endif

+ 18 - 0
package/findutils/patches/patch-gnulib_lib_fseeko_c

@@ -0,0 +1,18 @@
+--- findutils-4.4.2.orig/gnulib/lib/fseeko.c	2009-05-10 23:25:10.000000000 +0200
++++ findutils-4.4.2/gnulib/lib/fseeko.c	2014-03-23 16:35:34.000000000 +0100
+@@ -94,8 +94,14 @@ rpl_fseeko (FILE *fp, off_t offset, int
+   if ((fp->_Mode & _MWRITE ? fp->_Next == fp->_Buf : fp->_Next == fp->_Rend)
+       && fp->_Rback == fp->_Back + sizeof (fp->_Back)
+       && fp->_Rsave == NULL)
++#elif FUNC_FFLUSH_STDIN < 0 && 200809 <= _POSIX_VERSION
++  /* Cross-compiling to some other system advertising conformance to
++     POSIX.1-2008 or later.  Assume fseeko and fflush work as advertised.
++     If this assumption is incorrect, please report the bug to
++     bug-gnulib.  */
++  if (0)
+ #else
+-  #error "Please port gnulib fseeko.c to your platform! Look at the code in fpurge.c, then report this to bug-gnulib."
++  #error "Please port gnulib fseeko.c to your platform! Look at the code in fseeko.c, then report this to bug-gnulib."
+ #endif
+     {
+       off_t pos = lseek (fileno (fp), offset, whence);

+ 25 - 0
package/findutils/patches/patch-gnulib_m4_fflush_m4

@@ -0,0 +1,25 @@
+--- findutils-4.4.2.orig/gnulib/m4/fflush.m4	2009-05-10 23:23:57.000000000 +0200
++++ findutils-4.4.2/gnulib/m4/fflush.m4	2014-03-23 18:40:09.000000000 +0100
+@@ -32,12 +32,18 @@ AC_DEFUN([gl_FUNC_FFLUSH],
+ 	   return 4;
+ 	 return !(lseek (fd, 0, SEEK_CUR) == 5);
+        ]])], [gl_cv_func_fflush_stdin=yes], [gl_cv_func_fflush_stdin=no],
+-     [dnl Pessimistically assume fflush is broken.  This is wrong for
+-      dnl at least glibc and cygwin; but lib/fflush.c takes this into account.
+-      gl_cv_func_fflush_stdin=no])
++	[gl_cv_func_fflush_stdin=cross])
+      rm conftest.txt
+     ])
+-  if test $gl_cv_func_fflush_stdin = no; then
++  case $gl_cv_func_fflush_stdin in
++    yes) gl_func_fflush_stdin=1 ;;
++    no)  gl_func_fflush_stdin=0 ;;
++    *)   gl_func_fflush_stdin='(-1)' ;;
++  esac
++  AC_DEFINE_UNQUOTED([FUNC_FFLUSH_STDIN], [$gl_func_fflush_stdin],
++    [Define to 1 if fflush is known to work on stdin as per POSIX.1-2008,
++     0 if fflush is known to not work, -1 if unknown.])
++  if test $gl_cv_func_fflush_stdin != yes; then
+     gl_REPLACE_FFLUSH
+   fi
+ ])

+ 3 - 3
package/gkrellm/Makefile

@@ -4,10 +4,10 @@
 include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		gkrellm
-PKG_VERSION:=		2.3.4
+PKG_VERSION:=		2.3.5
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		600f4daa395112ed19a3633deb0829ff
-PKG_DESCR:=		The GNU Krell Monitors Server
+PKG_MD5SUM:=		05d00fa8d6376038b0c7e967583c0b8d
+PKG_DESCR:=		GNU krell monitors server
 PKG_SECTION:=		net/misc
 PKG_DEPENDS:=		glib libpthread
 PKG_BUILDDEP:=		glib

+ 0 - 30
package/gkrellm/patches/patch-server_Makefile

@@ -1,30 +0,0 @@
---- gkrellm-2.3.4.orig/server/Makefile	2008-10-03 23:52:48.000000000 +0200
-+++ gkrellm-2.3.4/server/Makefile	2011-05-17 11:34:14.926610183 +0200
-@@ -26,7 +26,7 @@ SMANDIR ?= $(INSTALLROOT)/share/man/man1
- MANMODE ?= 644
- MANDIRMODE ?= 755
- INSTALL ?= install
--LINK_FLAGS ?= -Wl,-E
-+LINK_FLAGS ?= -Wl,-E $(LDFLAGS)
- EXTRAOBJS =
- 
- SHARED_PATH = ../shared
-@@ -109,15 +109,15 @@ endif
- 
- override CC += -Wall $(FLAGS)
- 
--OS_NAME=$(shell uname -s)
--OS_RELEASE=$(shell uname -r)
-+OS_NAME=Linux
-+OS_RELEASE=2.6
- 
- OBJS = main.o monitor.o mail.o plugins.o glib.o utils.o sysdeps-unix.o log.o
- 
- all:	gkrellmd
- 
- gkrellmd: $(OBJS) $(EXTRAOBJS)
--	$(CC) $(OBJS) $(EXTRAOBJS) -o gkrellmd $(LIBS) $(LINK_FLAGS)
-+	$(CC) $(OBJS) $(EXTRAOBJS) -o gkrellmd $(LINK_FLAGS) $(LIBS)
- 
- static: $(OBJS) $(EXTRAOBJS)
- 	$(CC) $(OBJS) $(EXTRAOBJS) -o gkrellmd.static -static \

+ 24 - 0
package/gkrellm/patches/patch-server_main_c

@@ -0,0 +1,24 @@
+--- gkrellm-2.3.5.orig/server/main.c	2010-10-02 18:13:29.000000000 +0200
++++ gkrellm-2.3.5/server/main.c	2014-03-23 16:06:59.000000000 +0100
+@@ -39,21 +39,6 @@
+ 	#include <syslog.h>
+ #endif // !WIN32
+ 
+-// win32 defines addrinfo but only supports getaddrinfo call on winxp or newer
+-#if !defined(HAVE_GETADDRINFO) && !defined(WIN32)
+-struct addrinfo
+-	{
+-	int		ai_flags;		/* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */
+-	int		ai_family;		/* PF_xxx */
+-	int		ai_socktype;	/* SOCK_xxx */
+-	int		ai_protocol;	/* 0 or IPPROTO_xxx for IPv4 and IPv6 */
+-	size_t	ai_addrlen;		/* length of ai_addr */
+-	char	*ai_canonname;	/* canonical name for hostname */
+-	struct	sockaddr *ai_addr;	/* binary address */
+-	struct	addrinfo *ai_next;	/* next structure in linked list */
+-	};
+-#endif // !HAVE_GETADDRINFO
+-
+ #if !defined(IPV6_V6ONLY) && defined(IPV6_BINDV6ONLY)
+ #define	IPV6_V6ONLY	IPV6_BINDV6ONLY
+ #endif

+ 10 - 0
package/gkrellm/patches/patch-server_sysdeps-unix_c

@@ -0,0 +1,10 @@
+--- gkrellm-2.3.5.orig/server/sysdeps-unix.c	2010-09-14 18:34:34.000000000 +0200
++++ gkrellm-2.3.5/server/sysdeps-unix.c	2014-03-23 16:13:57.000000000 +0100
+@@ -145,6 +145,7 @@ gkrellm_sensors_linux_name_fix(gchar *id
+ #endif
+ 	}
+ 
++#define HAVE_GETADDRINFO 1
+ #ifdef SENSORS_COMMON
+ gint
+ gkrellm_connect_to(gchar *server, gint server_port)

+ 1 - 1
package/ipcad/Makefile

@@ -5,7 +5,7 @@ include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		ipcad
 PKG_VERSION:=		3.7.3
-PKG_RELEASE:=		1
+PKG_RELEASE:=		2
 PKG_MD5SUM:=		125605249958894148ec26d3c88189f5
 PKG_DESCR:=		IP Cisco Accounting Daemon
 PKG_SECTION:=		net

+ 169 - 0
package/ipcad/patches/patch-Makefile

@@ -0,0 +1,169 @@
+--- ipcad-3.7.3.orig/Makefile	2007-04-22 10:08:45.000000000 +0200
++++ ipcad-3.7.3/Makefile	2014-03-23 17:59:56.000000000 +0100
+@@ -1,4 +1,163 @@
+-all: bootstrap
+ 
+-bootstrap:
+-	./configure && make
++prefix= /usr
++exec_prefix= ${prefix}
++bindir= /usr/bin
++sysconfdir= /etc
++datadir= /usr/share
++
++CC= /home/wbx/hudson/toolchain_x86_64-linux-gnu/usr/bin/arm-openadk-linux-muslgnueabihf-gcc
++LDFLAGS= -L/home/wbx/hudson/target_arm_musl_eabihf/lib -L/home/wbx/hudson/target_arm_musl_eabihf/usr/lib -Wl,-O1 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/home/wbx/hudson/target_arm_musl_eabihf/usr/lib -Wl,-z,relro,-z,now
++LIBS= -lpcap 
++CFLAGS= -march=armv6 -mtune=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables -g3 -DHAVE_CONFIG_H -W -Wall
++CPPFLAGS=-DIPCAD_VERSION=\"3.7.3\"
++CPPFLAGS+=-DCONFIG_FILE=\"${sysconfdir}/ipcad.conf\"
++CPPFLAGS+=-DHAVE_CONFIG_H -D_REENTRANT -D_THREAD_SAFE
++CPPFLAGS+=-DPSRC_pcap -DIFST_linux
++
++YACC=bison -y
++LEX=flex
++INSTALL=/usr/bin/install -c
++
++MANROOT=/usr/share/man/man
++MAN8=${MANROOT}8
++MAN5=${MANROOT}5
++
++NROFF= groff -Tascii -mandoc
++
++PACKAGE=ipcad
++TARGETS=ipcad
++VERSION=3.7.3
++
++IPCAD_OBJS= main.o process.o pps.o disp.o storage.o usage.o cfgy.o cfglex.o cfgread.o cfgvar.o dump.o import.o nflow.o cshelly.o cslex.o csparse.o service.o rw.o servers.o opt.o pidfile.o sf_lite.o
++IPCAD_OBJS+= ifst_linux.o		# Interface statistics
++IPCAD_OBJS+= ifs_list.o			# Interface statistics
++IPCAD_OBJS+= loop-pcap.o		# Method of capturing
++IPCAD_OBJS+= loop-file.o		# Method of capturing
++IPCAD_OBJS+= loop-divert.o		# Method of capturing
++IPCAD_OBJS+= loop-dynamic.o		# Method of capturing
++IPCAD_OBJS+= loop-ulog.o loop-ipq.o	# Methods of capturing
++IPCAD_OBJS+= psrc.o psrc-pcap.o	# Initialize capturers
++IPCAD_OBJS+= psrc-ipq.o psrc-ulog.o	# Initialize capturers
++IPCAD_OBJS+= psrc-file.o		# Initialize capturers
++IPCAD_OBJS+= psrc-dynamic.o		# Initialize capturers
++IPCAD_OBJS+= psrc-divert.o		# Initialize capturers
++IPCAD_OBJS+= wrap_oclose.o		# Special file descriptors cache
++IPCAD_OBJS+= genhash.o			# General hashing
++
++all: ${TARGETS} man
++
++ipcad: ${IPCAD_OBJS}
++	${CC} ${CFLAGS} -o $@ ${IPCAD_OBJS} ${LDFLAGS} ${LIBS}
++
++.SUFFIXES:
++.SUFFIXES: .o .c .0 .8 .5
++
++.c.o:
++	${CC} ${CPPFLAGS} ${CFLAGS} -o $@ -c $<
++
++.8.0:
++	${NROFF} $< > $@
++
++.5.0:
++	${NROFF} $< > $@
++
++cfgy.h cfgy.c: cfg.y
++	${YACC} -p ipcacfg -d cfg.y
++	@mv y.tab.c cfgy.c
++	@mv y.tab.h cfgy.h
++
++cshelly.h cshelly.c: cshell.y
++	${YACC} -p CS -d cshell.y
++	@mv y.tab.c cshelly.c
++	@mv y.tab.h cshelly.h
++
++cslex.c: cslex.l
++	${LEX} -s -p -Cem -ocslex.c -PCS cslex.l
++
++cfglex.c: cfglex.l
++	${LEX} -s -p -Cem -ocfglex.c -Pipcacfg cfglex.l
++
++
++man: ipcad.8 ipcad.conf.5
++
++distdir = $(PACKAGE)-$(VERSION)
++distdir:
++	rm -rf $(distdir)
++	mkdir $(distdir)
++	cp *.c *.h $(distdir)
++	cp ipcad.8 ipcad.conf.5 $(distdir)
++	cp *.y *.l $(distdir)
++	cp *.in configure install-sh $(distdir)
++	cp ipcad.conf.default $(distdir)
++	cp ipcad.conf.simple $(distdir)
++	cp ipcad.spec.in $(distdir)
++	cp Makefile.in Makefile $(distdir)
++	cp ChangeLog INSTALL README TODO BUGS AUTHORS COPYING FAQ $(distdir)
++	cd $(distdir) && make distclean
++
++dist: distdir
++	tar chof - $(distdir) | GZIP="--best" gzip -c > $(distdir).tar.gz
++	rm -rf $(distdir)
++
++clean:
++	rm -f *.o ${TARGETS} *.core 1
++	rm -f *.0
++
++distclean: clean
++	rm -f config.h
++	rm -f config.cache config.log config.status
++	rm -f Makefile
++	rm -f $(distdir).tar.gz
++	rm -f ipcad.spec
++	(echo "all: bootstrap"; echo; echo "bootstrap:"; \
++		echo "	./configure && make") > Makefile
++
++maintainer-clean: distclean
++	@echo "This command is intended for maintainers to use; it"
++	@echo "deletes files that may need special tools to rebuild."
++	rm -f Makefile
++	rm -f *.tab.* cfgy.? *lex.c
++	rm -f config.h.in configure
++
++install: all install-bin install-conf
++
++install-bin:
++	@${INSTALL} -d $(DESTDIR)${bindir}
++	${INSTALL} ipcad $(DESTDIR)${bindir}
++
++install-man: man
++	${INSTALL} -m 444 ipcad.8 $(DESTDIR)${MAN8}/ipcad.8
++	${INSTALL} -m 444 ipcad.conf.5 $(DESTDIR)${MAN5}/ipcad.conf.5
++
++install-conf:
++	@${INSTALL} -d $(DESTDIR)${sysconfdir}
++	${INSTALL} -m 644 ipcad.conf.simple $(DESTDIR)${sysconfdir}/ipcad.conf.simple
++	-@diff ${sysconfdir}/ipcad.conf					\
++	      ${sysconfdir}/ipcad.conf.default >/dev/null 2>&1;		\
++	if [ "$$?" -eq 0 ] || [ ! -f ${sysconfdir}/ipcad.conf ]; then	\
++	echo ${INSTALL} -m 644 ipcad.conf.default $(DESTDIR)${sysconfdir}/ipcad.conf.default; \
++	${INSTALL} -m 644 ipcad.conf.default $(DESTDIR)${sysconfdir}/ipcad.conf.default; \
++	echo ${INSTALL} -m 644 ipcad.conf.default $(DESTDIR)${sysconfdir}/ipcad.conf;	\
++	${INSTALL} -m 644 ipcad.conf.default $(DESTDIR)${sysconfdir}/ipcad.conf;	\
++	echo "**********************************************";		\
++	echo "* Please customize ${sysconfdir}/ipcad.conf *";		\
++	echo "**********************************************";		\
++	else								\
++	echo ${INSTALL} -m 644 ipcad.conf.default $(DESTDIR)${sysconfdir}/ipcad.conf.default; \
++	${INSTALL} -m 644 ipcad.conf.default $(DESTDIR)${sysconfdir}/ipcad.conf.default; \
++	echo "*********************************************";		\
++	echo "* Updated ${sysconfdir}/ipcad.conf.default *";		\
++	echo "*********************************************";		\
++	fi
++	@echo ""
++	@echo "Now you might want to 'make install-man'"
++	@echo ""
++
++
++uninstall:
++	rm -f ${bindir}/ipcad
++	rm -f ${sysconfdir}/ipcad.conf.default
++	rm -f ${sysconfdir}/ipcad.conf.simple
++	rm -f ${MAN8}/ipcad.8
++	rm -f ${MAN5}/ipcad.conf.5
++

+ 10 - 1
package/ipcad/patches/patch-Makefile_in

@@ -1,5 +1,5 @@
 --- ipcad-3.7.3.orig/Makefile.in	2007-04-22 10:08:45.000000000 +0200
-+++ ipcad-3.7.3/Makefile.in	2011-01-11 17:16:15.000000000 +0100
++++ ipcad-3.7.3/Makefile.in	2014-03-23 17:58:49.000000000 +0100
 @@ -6,10 +6,10 @@ sysconfdir= @sysconfdir@
  datadir= @datadir@
  
@@ -15,3 +15,12 @@
  CPPFLAGS+=-DCONFIG_FILE=\"${sysconfdir}/ipcad.conf\"
  CPPFLAGS+=@DEFS@ -D_REENTRANT -D_THREAD_SAFE
  CPPFLAGS+=-DPSRC_@PSRC@ -DIFST_@IFST@
+@@ -28,7 +28,7 @@ PACKAGE=ipcad
+ TARGETS=ipcad
+ VERSION=@IPCAD_VERSION@
+ 
+-IPCAD_OBJS= main.o process.o pps.o disp.o storage.o usage.o cfgy.o cfglex.o cfgread.o cfgvar.o rsh.o rshp.o dump.o import.o nflow.o cshelly.o cslex.o csparse.o service.o rw.o servers.o opt.o pidfile.o sf_lite.o
++IPCAD_OBJS= main.o process.o pps.o disp.o storage.o usage.o cfgy.o cfglex.o cfgread.o cfgvar.o dump.o import.o nflow.o cshelly.o cslex.o csparse.o service.o rw.o servers.o opt.o pidfile.o sf_lite.o
+ IPCAD_OBJS+= ifst_@IFST@.o		# Interface statistics
+ IPCAD_OBJS+= ifs_list.o			# Interface statistics
+ IPCAD_OBJS+= loop-@PSRC@.o		# Method of capturing

+ 60 - 0
package/ipcad/patches/patch-cfg_y

@@ -0,0 +1,60 @@
+--- ipcad-3.7.3.orig/cfg.y	2007-04-22 10:08:45.000000000 +0200
++++ ipcad-3.7.3/cfg.y	2014-03-23 18:03:07.000000000 +0100
+@@ -3,7 +3,6 @@
+ #include "headers.h"
+ #include "cfgvar.h"
+ #include "servers.h"
+-#include "rsh.h"
+ #include "opt.h"
+ #include "storage.h"
+ 
+@@ -214,49 +213,6 @@ block:
+ 	| CAPTURE_PORTS DENY {
+ 		conf->capture_ports = 0;
+ 	}
+-	| RSH ALLOW at_ip {
+-		if(add_server(rsh_server, "RSH Server", &($3), 514))
+-			return yyerror("Failed to install RSH server");
+-		fprintf(stderr, "Configured RSH Server listening at %s\n",
+-			inet_ntoa($3));
+-	}
+-	| RSH DENY at_ip {
+-		fprintf(stderr, "Warning: Option at line %d has no effect\n",
+-			ipcacfglineno);
+-	}
+-	| RSH TIMEOUT EQ TOK_STRING {
+-		int to_ms;
+-		to_ms = atoi($4);
+-		free($4);
+-		if(to_ms < 0)
+-			to_ms = -1;	/* INFTIM */
+-		else
+-			to_ms = to_ms * 1000;
+-		rsh_rw_timeout = to_ms;
+-	}
+-	| RSH TOK_STRING privlevel {
+-		cfg_add_rsh_host("", $2, $3);
+-		free($2);
+-	}
+-	| RSH AT TOK_STRING privlevel {
+-		cfg_add_rsh_host("", $3, $4);
+-		free($3);
+-	}
+-	| RSH TOK_STRING AT TOK_STRING privlevel {
+-		cfg_add_rsh_host($2, $4, $5);
+-		free($2); free($4);
+-	}
+-	| RSH TTL EQ TOK_STRING {
+-		conf->rsh_ttl = atoi($4);
+-		free($4);
+-	}
+-	| TTL EQ TOK_STRING {
+-		fprintf(stderr, "WARNING: \"ttl = %s;\" at line %d: "
+-			"Obsolete syntax. Please use \"rsh ttl = %s;\"\n",
+-			$3, ipcacfglineno, $3);
+-		conf->rsh_ttl = atoi($3);
+-		free($3);
+-	}
+ 	| NetFlow
+ 	| CHROOT EQ TOK_STRING {
+ 		if(conf->chroot_to)

+ 2 - 0
package/iptables-snmp/Makefile

@@ -13,6 +13,8 @@ PKG_BUILDDEP:=		net-snmp
 PKG_URL:=		http://www.nobiscuit.com/iptables-snmp/
 PKG_SITES:=		http://www.nobiscuit.com/iptables-snmp/
 
+PKG_LIBC_DEPENDS:=	uclibc glibc
+
 include $(TOPDIR)/mk/package.mk
 
 $(eval $(call PKG_template,IPTABLES_SNMP,iptables-snmp,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))

+ 2 - 2
package/logrotate/Makefile

@@ -4,9 +4,9 @@
 include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		logrotate
-PKG_VERSION:=		3.7.8
+PKG_VERSION:=		3.8.7
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		b3589bea6d8d5afc8a84134fddaae973
+PKG_MD5SUM:=		99e08503ef24c3e2e3ff74cc5f3be213
 PKG_DESCR:=		logfile rotation utility
 PKG_SECTION:=		misc
 PKG_DEPENDS:=		libpopt

+ 15 - 42
package/logrotate/patches/patch-Makefile

@@ -1,60 +1,33 @@
---- logrotate-3.7.8.orig/Makefile	2008-05-19 12:25:54.000000000 +0200
-+++ logrotate-3.7.8/Makefile	2011-01-15 23:45:59.000000000 +0100
-@@ -1,10 +1,10 @@
+--- logrotate-3.8.7.orig/Makefile	2013-06-10 13:29:16.000000000 +0200
++++ logrotate-3.8.7/Makefile	2014-03-23 15:16:09.000000000 +0100
+@@ -1,11 +1,11 @@
  VERSION = $(shell awk '/Version:/ { print $$2 }' logrotate.spec)
 -OS_NAME = $(shell uname -s)
 +OS_NAME = Linux
  LFS = $(shell echo `getconf LFS_CFLAGS 2>/dev/null`)
--CFLAGS = -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
-+CFLAGS ?= -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
+ CFLAGS = -Wall -D_GNU_SOURCE -D$(OS_NAME) -DVERSION=\"$(VERSION)\" $(RPM_OPT_FLAGS) $(LFS)
  PROG = logrotate
  MAN = logrotate.8
+ MAN5 = logrotate.conf.5
 -LOADLIBES = -lpopt
 +LIBS = -lpopt
  SVNURL= svn+ssh://svn.fedorahosted.org/svn/logrotate
  SVNPUBURL = http://svn.fedorahosted.org/svn/logrotate
  SVNTAG = r$(subst .,-,$(VERSION))
-@@ -68,10 +68,7 @@ MANDIR = $(BASEDIR)/man
- OBJS = logrotate.o log.o config.o basenames.o
- SOURCES = $(subst .o,.c,$(OBJS) $(LIBOBJS))
+@@ -64,7 +64,7 @@ endif
+ # Red Hat Linux
+ ifeq ($(OS_NAME),Linux)
+     INSTALL = install
+-    BASEDIR = /usr
++    BASEDIR = $(DESTDIR)/usr
+ endif
  
--ifeq ($(RPM_OPT_FLAGS),)
--CFLAGS += -g
--LDFLAGS = -g
--endif
-+LDFLAGS ?=
- 
- ifeq (.depend,$(wildcard .depend))
- TARGET=$(PROG)
-@@ -84,6 +81,7 @@ RCSVERSION = $(subst .,-,$(VERSION))
- all: $(TARGET)
+ # FreeBSD
+@@ -117,6 +117,7 @@ RCSVERSION = $(subst .,-,$(VERSION))
+ all: $(TARGET) pretest
  
  $(PROG): $(OBJS)
 +	$(CC) $(LDFLAGS) -o $(PROG) $^ $(LIBS)
  
  clean:
  	rm -f $(OBJS) $(PROG) core* .depend
-@@ -96,16 +94,16 @@ test: $(TARGET)
- 	(cd test; ./test)
- 
- install:
--	[ -d $(PREFIX)/$(BINDIR) ] || mkdir -p $(PREFIX)/$(BINDIR)
--	[ -d $(PREFIX)/$(MANDIR) ] || mkdir -p $(PREFIX)/$(MANDIR)
--	[ -d $(PREFIX)/$(MANDIR)/man8 ] || mkdir -p $(PREFIX)/$(MANDIR)/man8
-+	[ -d $(DESTDIR)/$(BINDIR) ] || mkdir -p $(DESTDIR)/$(BINDIR)
-+	[ -d $(DESTDIR)/$(MANDIR) ] || mkdir -p $(DESTDIR)/$(MANDIR)
-+	[ -d $(DESTDIR)/$(MANDIR)/man8 ] || mkdir -p $(DESTDIR)/$(MANDIR)/man8
- 
- 	if [ "$(OS_NAME)" = HP-UX ]; then \
--	$(INSTALL) $(PROG) $(PREFIX)/$(BINDIR) 0755 bin bin; \
--	$(INSTALL) $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"` 0644 bin bin; \
-+	$(INSTALL) $(PROG) $(DESTDIR)/$(BINDIR) 0755 bin bin; \
-+	$(INSTALL) $(MAN) $(DESTDIR)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"` 0644 bin bin; \
- 	else \
--	$(INSTALL) -m 755 $(PROG) $(PREFIX)/$(BINDIR); \
--	$(INSTALL) -m 644 $(MAN) $(PREFIX)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
-+	$(INSTALL) -m 755 $(PROG) $(DESTDIR)/$(BINDIR); \
-+	$(INSTALL) -m 644 $(MAN) $(DESTDIR)/$(MANDIR)/man`echo $(MAN) | sed "s/.*\.//"`/$(MAN); \
- 	fi
- 
- co:

+ 8 - 0
package/logrotate/patches/patch-config_c

@@ -0,0 +1,8 @@
+--- logrotate-3.8.7.orig/config.c	2013-07-31 13:34:31.000000000 +0200
++++ logrotate-3.8.7/config.c	2014-03-23 15:11:39.000000000 +0100
+@@ -1,4 +1,4 @@
+-#include <sys/queue.h>
++#include "queue.h"
+ /* Alloca is defined in stdlib.h in NetBSD */
+ #ifndef __NetBSD__
+ #include <alloca.h>

+ 8 - 0
package/logrotate/patches/patch-logrotate_c

@@ -0,0 +1,8 @@
+--- logrotate-3.8.7.orig/logrotate.c	2013-10-10 10:43:36.000000000 +0200
++++ logrotate-3.8.7/logrotate.c	2014-03-23 15:10:21.000000000 +0100
+@@ -1,4 +1,4 @@
+-#include <sys/queue.h>
++#include "queue.h"
+ /* alloca() is defined in stdlib.h in NetBSD */
+ #ifndef __NetBSD__
+ #include <alloca.h>

+ 11 - 0
package/logrotate/patches/patch-logrotate_h

@@ -0,0 +1,11 @@
+--- logrotate-3.8.7.orig/logrotate.h	2013-06-10 13:29:16.000000000 +0200
++++ logrotate-3.8.7/logrotate.h	2014-03-23 15:11:06.000000000 +0100
+@@ -2,7 +2,7 @@
+ #define H_LOGROTATE
+ 
+ #include <sys/types.h>
+-#include <sys/queue.h>
++#include "queue.h"
+ #include <glob.h>
+ 
+ #include "config.h"

+ 574 - 0
package/logrotate/src/queue.h

@@ -0,0 +1,574 @@
+/*
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ *	@(#)queue.h	8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef	_SYS_QUEUE_H_
+#define	_SYS_QUEUE_H_
+
+/*
+ * This file defines five types of data structures: singly-linked lists,
+ * lists, simple queues, tail queues, and circular queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The
+ * elements are singly linked for minimum space and pointer manipulation
+ * overhead at the expense of O(n) removal for arbitrary elements. New
+ * elements can be added to the list after an existing element or at the
+ * head of the list.  Elements being removed from the head of the list
+ * should use the explicit macro for this purpose for optimum
+ * efficiency. A singly-linked list may only be traversed in the forward
+ * direction.  Singly-linked lists are ideal for applications with large
+ * datasets and few or no removals or for implementing a LIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A simple queue is headed by a pair of pointers, one the head of the
+ * list and the other to the tail of the list. The elements are singly
+ * linked to save space, so elements can only be removed from the
+ * head of the list. New elements can be added to the list after
+ * an existing element, at the head of the list, or at the end of the
+ * list. A simple queue may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * List definitions.
+ */
+#define	LIST_HEAD(name, type)						\
+struct name {								\
+	struct type *lh_first;	/* first element */			\
+}
+
+#define	LIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	LIST_ENTRY(type)						\
+struct {								\
+	struct type *le_next;	/* next element */			\
+	struct type **le_prev;	/* address of previous next element */	\
+}
+
+/*
+ * List functions.
+ */
+#define	LIST_INIT(head) do {						\
+	(head)->lh_first = NULL;					\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
+	if (((elm)->field.le_next = (listelm)->field.le_next) != NULL)	\
+		(listelm)->field.le_next->field.le_prev =		\
+		    &(elm)->field.le_next;				\
+	(listelm)->field.le_next = (elm);				\
+	(elm)->field.le_prev = &(listelm)->field.le_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.le_prev = (listelm)->field.le_prev;		\
+	(elm)->field.le_next = (listelm);				\
+	*(listelm)->field.le_prev = (elm);				\
+	(listelm)->field.le_prev = &(elm)->field.le_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_INSERT_HEAD(head, elm, field) do {				\
+	if (((elm)->field.le_next = (head)->lh_first) != NULL)		\
+		(head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+	(head)->lh_first = (elm);					\
+	(elm)->field.le_prev = &(head)->lh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_REMOVE(elm, field) do {					\
+	if ((elm)->field.le_next != NULL)				\
+		(elm)->field.le_next->field.le_prev = 			\
+		    (elm)->field.le_prev;				\
+	*(elm)->field.le_prev = (elm)->field.le_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	LIST_FOREACH(var, head, field)					\
+	for ((var) = ((head)->lh_first);				\
+		(var);							\
+		(var) = ((var)->field.le_next))
+
+/*
+ * List access methods.
+ */
+#define	LIST_EMPTY(head)		((head)->lh_first == NULL)
+#define	LIST_FIRST(head)		((head)->lh_first)
+#define	LIST_NEXT(elm, field)		((elm)->field.le_next)
+
+
+/*
+ * Singly-linked List definitions.
+ */
+#define	SLIST_HEAD(name, type)						\
+struct name {								\
+	struct type *slh_first;	/* first element */			\
+}
+
+#define	SLIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	SLIST_ENTRY(type)						\
+struct {								\
+	struct type *sle_next;	/* next element */			\
+}
+
+/*
+ * Singly-linked List functions.
+ */
+#define	SLIST_INIT(head) do {						\
+	(head)->slh_first = NULL;					\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
+	(elm)->field.sle_next = (slistelm)->field.sle_next;		\
+	(slistelm)->field.sle_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
+	(elm)->field.sle_next = (head)->slh_first;			\
+	(head)->slh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_REMOVE_HEAD(head, field) do {				\
+	(head)->slh_first = (head)->slh_first->field.sle_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_REMOVE(head, elm, type, field) do {			\
+	if ((head)->slh_first == (elm)) {				\
+		SLIST_REMOVE_HEAD((head), field);			\
+	}								\
+	else {								\
+		struct type *curelm = (head)->slh_first;		\
+		while(curelm->field.sle_next != (elm))			\
+			curelm = curelm->field.sle_next;		\
+		curelm->field.sle_next =				\
+		    curelm->field.sle_next->field.sle_next;		\
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	SLIST_FOREACH(var, head, field)					\
+	for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
+
+/*
+ * Singly-linked List access methods.
+ */
+#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
+#define	SLIST_FIRST(head)	((head)->slh_first)
+#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
+
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define	STAILQ_HEAD(name, type)					\
+struct name {								\
+	struct type *stqh_first;	/* first element */			\
+	struct type **stqh_last;	/* addr of last next element */		\
+}
+
+#define	STAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).stqh_first }
+
+#define	STAILQ_ENTRY(type)						\
+struct {								\
+	struct type *stqe_next;	/* next element */			\
+}
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define	STAILQ_INIT(head) do {						\
+	(head)->stqh_first = NULL;					\
+	(head)->stqh_last = &(head)->stqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.stqe_next = (head)->stqh_first) == NULL)	\
+		(head)->stqh_last = &(elm)->field.stqe_next;		\
+	(head)->stqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.stqe_next = NULL;					\
+	*(head)->stqh_last = (elm);					\
+	(head)->stqh_last = &(elm)->field.stqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\
+		(head)->stqh_last = &(elm)->field.stqe_next;		\
+	(listelm)->field.stqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_REMOVE_HEAD(head, field) do {				\
+	if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \
+		(head)->stqh_last = &(head)->stqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_REMOVE(head, elm, type, field) do {			\
+	if ((head)->stqh_first == (elm)) {				\
+		STAILQ_REMOVE_HEAD((head), field);			\
+	} else {							\
+		struct type *curelm = (head)->stqh_first;		\
+		while (curelm->field.stqe_next != (elm))			\
+			curelm = curelm->field.stqe_next;		\
+		if ((curelm->field.stqe_next =				\
+			curelm->field.stqe_next->field.stqe_next) == NULL) \
+			    (head)->stqh_last = &(curelm)->field.stqe_next; \
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	STAILQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->stqh_first);				\
+		(var);							\
+		(var) = ((var)->field.stqe_next))
+
+#define	STAILQ_CONCAT(head1, head2) do {				\
+	if (!STAILQ_EMPTY((head2))) {					\
+		*(head1)->stqh_last = (head2)->stqh_first;		\
+		(head1)->stqh_last = (head2)->stqh_last;		\
+		STAILQ_INIT((head2));					\
+	}								\
+} while (/*CONSTCOND*/0)
+
+/*
+ * Singly-linked Tail queue access methods.
+ */
+#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
+#define	STAILQ_FIRST(head)	((head)->stqh_first)
+#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
+
+
+/*
+ * Simple queue definitions.
+ */
+#define	SIMPLEQ_HEAD(name, type)					\
+struct name {								\
+	struct type *sqh_first;	/* first element */			\
+	struct type **sqh_last;	/* addr of last next element */		\
+}
+
+#define	SIMPLEQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).sqh_first }
+
+#define	SIMPLEQ_ENTRY(type)						\
+struct {								\
+	struct type *sqe_next;	/* next element */			\
+}
+
+/*
+ * Simple queue functions.
+ */
+#define	SIMPLEQ_INIT(head) do {						\
+	(head)->sqh_first = NULL;					\
+	(head)->sqh_last = &(head)->sqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.sqe_next = (head)->sqh_first) == NULL)	\
+		(head)->sqh_last = &(elm)->field.sqe_next;		\
+	(head)->sqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.sqe_next = NULL;					\
+	*(head)->sqh_last = (elm);					\
+	(head)->sqh_last = &(elm)->field.sqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\
+		(head)->sqh_last = &(elm)->field.sqe_next;		\
+	(listelm)->field.sqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_REMOVE_HEAD(head, field) do {				\
+	if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \
+		(head)->sqh_last = &(head)->sqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_REMOVE(head, elm, type, field) do {			\
+	if ((head)->sqh_first == (elm)) {				\
+		SIMPLEQ_REMOVE_HEAD((head), field);			\
+	} else {							\
+		struct type *curelm = (head)->sqh_first;		\
+		while (curelm->field.sqe_next != (elm))			\
+			curelm = curelm->field.sqe_next;		\
+		if ((curelm->field.sqe_next =				\
+			curelm->field.sqe_next->field.sqe_next) == NULL) \
+			    (head)->sqh_last = &(curelm)->field.sqe_next; \
+	}								\
+} while (/*CONSTCOND*/0)
+
+#define	SIMPLEQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->sqh_first);				\
+		(var);							\
+		(var) = ((var)->field.sqe_next))
+
+/*
+ * Simple queue access methods.
+ */
+#define	SIMPLEQ_EMPTY(head)		((head)->sqh_first == NULL)
+#define	SIMPLEQ_FIRST(head)		((head)->sqh_first)
+#define	SIMPLEQ_NEXT(elm, field)	((elm)->field.sqe_next)
+
+
+/*
+ * Tail queue definitions.
+ */
+#define	_TAILQ_HEAD(name, type, qual)					\
+struct name {								\
+	qual type *tqh_first;		/* first element */		\
+	qual type *qual *tqh_last;	/* addr of last next element */	\
+}
+#define TAILQ_HEAD(name, type)	_TAILQ_HEAD(name, struct type,)
+
+#define	TAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).tqh_first }
+
+#define	_TAILQ_ENTRY(type, qual)					\
+struct {								\
+	qual type *tqe_next;		/* next element */		\
+	qual type *qual *tqe_prev;	/* address of previous next element */\
+}
+#define TAILQ_ENTRY(type)	_TAILQ_ENTRY(struct type,)
+
+/*
+ * Tail queue functions.
+ */
+#define	TAILQ_INIT(head) do {						\
+	(head)->tqh_first = NULL;					\
+	(head)->tqh_last = &(head)->tqh_first;				\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if (((elm)->field.tqe_next = (head)->tqh_first) != NULL)	\
+		(head)->tqh_first->field.tqe_prev =			\
+		    &(elm)->field.tqe_next;				\
+	else								\
+		(head)->tqh_last = &(elm)->field.tqe_next;		\
+	(head)->tqh_first = (elm);					\
+	(elm)->field.tqe_prev = &(head)->tqh_first;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.tqe_next = NULL;					\
+	(elm)->field.tqe_prev = (head)->tqh_last;			\
+	*(head)->tqh_last = (elm);					\
+	(head)->tqh_last = &(elm)->field.tqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+		(elm)->field.tqe_next->field.tqe_prev = 		\
+		    &(elm)->field.tqe_next;				\
+	else								\
+		(head)->tqh_last = &(elm)->field.tqe_next;		\
+	(listelm)->field.tqe_next = (elm);				\
+	(elm)->field.tqe_prev = &(listelm)->field.tqe_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
+	(elm)->field.tqe_next = (listelm);				\
+	*(listelm)->field.tqe_prev = (elm);				\
+	(listelm)->field.tqe_prev = &(elm)->field.tqe_next;		\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_REMOVE(head, elm, field) do {				\
+	if (((elm)->field.tqe_next) != NULL)				\
+		(elm)->field.tqe_next->field.tqe_prev = 		\
+		    (elm)->field.tqe_prev;				\
+	else								\
+		(head)->tqh_last = (elm)->field.tqe_prev;		\
+	*(elm)->field.tqe_prev = (elm)->field.tqe_next;			\
+} while (/*CONSTCOND*/0)
+
+#define	TAILQ_FOREACH(var, head, field)					\
+	for ((var) = ((head)->tqh_first);				\
+		(var);							\
+		(var) = ((var)->field.tqe_next))
+
+#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
+	for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));	\
+		(var);							\
+		(var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last)))
+
+#define	TAILQ_CONCAT(head1, head2, field) do {				\
+	if (!TAILQ_EMPTY(head2)) {					\
+		*(head1)->tqh_last = (head2)->tqh_first;		\
+		(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	\
+		(head1)->tqh_last = (head2)->tqh_last;			\
+		TAILQ_INIT((head2));					\
+	}								\
+} while (/*CONSTCOND*/0)
+
+/*
+ * Tail queue access methods.
+ */
+#define	TAILQ_EMPTY(head)		((head)->tqh_first == NULL)
+#define	TAILQ_FIRST(head)		((head)->tqh_first)
+#define	TAILQ_NEXT(elm, field)		((elm)->field.tqe_next)
+
+#define	TAILQ_LAST(head, headname) \
+	(*(((struct headname *)((head)->tqh_last))->tqh_last))
+#define	TAILQ_PREV(elm, headname, field) \
+	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+
+/*
+ * Circular queue definitions.
+ */
+#define	CIRCLEQ_HEAD(name, type)					\
+struct name {								\
+	struct type *cqh_first;		/* first element */		\
+	struct type *cqh_last;		/* last element */		\
+}
+
+#define	CIRCLEQ_HEAD_INITIALIZER(head)					\
+	{ (void *)&head, (void *)&head }
+
+#define	CIRCLEQ_ENTRY(type)						\
+struct {								\
+	struct type *cqe_next;		/* next element */		\
+	struct type *cqe_prev;		/* previous element */		\
+}
+
+/*
+ * Circular queue functions.
+ */
+#define	CIRCLEQ_INIT(head) do {						\
+	(head)->cqh_first = (void *)(head);				\
+	(head)->cqh_last = (void *)(head);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	(elm)->field.cqe_next = (listelm)->field.cqe_next;		\
+	(elm)->field.cqe_prev = (listelm);				\
+	if ((listelm)->field.cqe_next == (void *)(head))		\
+		(head)->cqh_last = (elm);				\
+	else								\
+		(listelm)->field.cqe_next->field.cqe_prev = (elm);	\
+	(listelm)->field.cqe_next = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do {		\
+	(elm)->field.cqe_next = (listelm);				\
+	(elm)->field.cqe_prev = (listelm)->field.cqe_prev;		\
+	if ((listelm)->field.cqe_prev == (void *)(head))		\
+		(head)->cqh_first = (elm);				\
+	else								\
+		(listelm)->field.cqe_prev->field.cqe_next = (elm);	\
+	(listelm)->field.cqe_prev = (elm);				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_HEAD(head, elm, field) do {			\
+	(elm)->field.cqe_next = (head)->cqh_first;			\
+	(elm)->field.cqe_prev = (void *)(head);				\
+	if ((head)->cqh_last == (void *)(head))				\
+		(head)->cqh_last = (elm);				\
+	else								\
+		(head)->cqh_first->field.cqe_prev = (elm);		\
+	(head)->cqh_first = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_INSERT_TAIL(head, elm, field) do {			\
+	(elm)->field.cqe_next = (void *)(head);				\
+	(elm)->field.cqe_prev = (head)->cqh_last;			\
+	if ((head)->cqh_first == (void *)(head))			\
+		(head)->cqh_first = (elm);				\
+	else								\
+		(head)->cqh_last->field.cqe_next = (elm);		\
+	(head)->cqh_last = (elm);					\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_REMOVE(head, elm, field) do {				\
+	if ((elm)->field.cqe_next == (void *)(head))			\
+		(head)->cqh_last = (elm)->field.cqe_prev;		\
+	else								\
+		(elm)->field.cqe_next->field.cqe_prev =			\
+		    (elm)->field.cqe_prev;				\
+	if ((elm)->field.cqe_prev == (void *)(head))			\
+		(head)->cqh_first = (elm)->field.cqe_next;		\
+	else								\
+		(elm)->field.cqe_prev->field.cqe_next =			\
+		    (elm)->field.cqe_next;				\
+} while (/*CONSTCOND*/0)
+
+#define	CIRCLEQ_FOREACH(var, head, field)				\
+	for ((var) = ((head)->cqh_first);				\
+		(var) != (const void *)(head);				\
+		(var) = ((var)->field.cqe_next))
+
+#define	CIRCLEQ_FOREACH_REVERSE(var, head, field)			\
+	for ((var) = ((head)->cqh_last);				\
+		(var) != (const void *)(head);				\
+		(var) = ((var)->field.cqe_prev))
+
+/*
+ * Circular queue access methods.
+ */
+#define	CIRCLEQ_EMPTY(head)		((head)->cqh_first == (void *)(head))
+#define	CIRCLEQ_FIRST(head)		((head)->cqh_first)
+#define	CIRCLEQ_LAST(head)		((head)->cqh_last)
+#define	CIRCLEQ_NEXT(elm, field)	((elm)->field.cqe_next)
+#define	CIRCLEQ_PREV(elm, field)	((elm)->field.cqe_prev)
+
+#define CIRCLEQ_LOOP_NEXT(head, elm, field)				\
+	(((elm)->field.cqe_next == (void *)(head))			\
+	    ? ((head)->cqh_first)					\
+	    : (elm->field.cqe_next))
+#define CIRCLEQ_LOOP_PREV(head, elm, field)				\
+	(((elm)->field.cqe_prev == (void *)(head))			\
+	    ? ((head)->cqh_last)					\
+	    : (elm->field.cqe_prev))
+
+#endif	/* sys/queue.h */

+ 3 - 2
package/moc/Makefile

@@ -4,9 +4,9 @@
 include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		moc
-PKG_VERSION:=		2.5.0-beta1
+PKG_VERSION:=		2.5.0-beta2
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		795ecba86847e082aa2f21937cc04804
+PKG_MD5SUM:=		da87b90b57934234589b63e347921458
 PKG_DESCR:=		console music player
 PKG_SECTION:=		multimedia
 PKG_DEPENDS:=		libmad libvorbis libcurl libflac
@@ -22,6 +22,7 @@ include ${TOPDIR}/mk/package.mk
 
 $(eval $(call PKG_template,MOC,moc,${PKG_VERSION}-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 
+TARGET_CPPFLAGS+=	-D_GNU_SOURCE -D_POSIX_SOURCE
 TARGET_LDFLAGS+=	-ltinfo
 CONFIGURE_ARGS+=	--without-jack \
 			--without-oss \

+ 2 - 2
package/ntfs-3g/Makefile

@@ -4,9 +4,9 @@
 include ${TOPDIR}/rules.mk
 
 PKG_NAME:=		ntfs-3g
-PKG_VERSION:=		2013.1.13
+PKG_VERSION:=		2014.2.15
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		2d6fb47ddf62b51733227126fe9227fe
+PKG_MD5SUM:=		f11d563816249d730a00498983485f3a
 PKG_DESCR:=		ntfs filesystem driver
 PKG_SECTION:=		fs
 PKG_DEPENDS:=		kmod-fuse-fs

+ 10 - 0
package/ntfs-3g/patches/patch-libfuse-lite_fusermount_c

@@ -0,0 +1,10 @@
+--- ntfs-3g_ntfsprogs-2014.2.15.orig/libfuse-lite/fusermount.c	2014-02-15 15:07:52.000000000 +0100
++++ ntfs-3g_ntfsprogs-2014.2.15/libfuse-lite/fusermount.c	2014-03-23 09:53:10.000000000 +0100
+@@ -18,6 +18,7 @@
+ #include <getopt.h>
+ #include <errno.h>
+ #include <fcntl.h>
++#include <paths.h>
+ #include <pwd.h>
+ 
+ #ifdef __SOLARIS__

+ 10 - 0
package/ntfs-3g/patches/patch-libfuse-lite_mount_util_c

@@ -0,0 +1,10 @@
+--- ntfs-3g_ntfsprogs-2014.2.15.orig/libfuse-lite/mount_util.c	2014-02-15 15:07:52.000000000 +0100
++++ ntfs-3g_ntfsprogs-2014.2.15/libfuse-lite/mount_util.c	2014-03-23 09:54:19.000000000 +0100
+@@ -12,6 +12,7 @@
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <paths.h>
+ #include <dirent.h>
+ #include <errno.h>
+ #include <limits.h>

+ 1 - 0
rules.mk

@@ -36,6 +36,7 @@ ADK_TARGET_FPU:=			$(strip $(subst ",, $(ADK_TARGET_FPU)))
 ADK_TARGET_ARM_MODE:=			$(strip $(subst ",, $(ADK_TARGET_ARM_MODE)))
 ADK_TARGET_CPU_ARCH:=			$(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
 ADK_TARGET_CFLAGS:=			$(strip $(subst ",, $(ADK_TARGET_CFLAGS)))
+ADK_TARGET_CFLAGS_OPT:=			$(strip $(subst ",, $(ADK_TARGET_CFLAGS_OPT)))
 ADK_TARGET_ABI_CFLAGS:=			$(strip $(subst ",, $(ADK_TARGET_ABI_CFLAGS)))
 ADK_TARGET_ABI:=			$(strip $(subst ",, $(ADK_TARGET_ABI)))
 ADK_TARGET_MIPS_ABI:=			$(strip $(subst ",, $(ADK_TARGET_MIPS_ABI)))

+ 206 - 0
scripts/gcc-bisect.sh

@@ -0,0 +1,206 @@
+#!/bin/sh
+rm -rf host_x86_64-linux-gnu target_sparc_glibc
+rm -rf gcc-*
+mkdir host_x86_64-linux-gnu
+mkdir target_sparc_glibc
+
+tar xvf binutils-2.24.tar.bz2
+cd binutils-2.24
+./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--target=sparc-openadk-linux-gnu \
+		--with-sysroot=/home/wbx/smoke/target_sparc_glibc \
+		--disable-dependency-tracking \
+		--disable-libtool-lock \
+		--disable-nls \
+		--disable-werror \
+		--disable-plugins \
+		--disable-libssp --disable-multilib
+make -j4 all
+make install
+cd ..
+
+tar xvf gmp-5.1.3.tar.xz
+cd gmp-5.1.3
+cp configfsf.guess config.guess
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/usr/bin:$PATH" \
+		./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--with-pic \
+		--disable-shared \
+		--enable-static
+make -j4 all
+make install
+cd ..
+
+tar xvf mpfr-3.1.2.tar.xz
+cd mpfr-3.1.2
+./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--with-gmp-build=/home/wbx/smoke/gmp-5.1.3 \
+		--disable-shared \
+		--enable-static
+make -j4 all
+make install
+cd ..
+
+tar xvf mpc-0.8.2.tar.gz
+cd mpc-0.8.2
+./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--disable-shared \
+		--enable-static
+make -j4 all
+make install
+make install
+cd ..
+
+tar xvf libelf-0.8.13.tar.gz
+cd libelf-0.8.13
+./configure \
+		--prefix=/home/wbx/smoke/host_x86_64-linux-gnu \
+		--disable-nls \
+		--disable-shared \
+		--enable-static
+make -j4 all
+make install
+cd ..
+
+rm -rf host_x86_64-linux-gnu/sparc-openadk-linux-gnu/{lib,sys-include}
+cd host_x86_64-linux-gnu/sparc-openadk-linux-gnu/
+ln -sf ../../target_sparc_glibc/usr/include sys-include
+ln -sf ../../target_sparc_glibc/lib lib
+cd -
+
+mkdir gcc-minimal
+cd gcc-minimal
+CFLAGS="-O0 -g0" \
+CXXFLAGS="-O0 -g0" \
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" \
+../gcc/configure \
+	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
+			--enable-languages=c \
+			--disable-multilib \
+			--disable-lto \
+			--disable-libssp \
+			--disable-shared \
+			--without-headers
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make -j4 all-gcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install-gcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+
+cd linux-3.13.6
+make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' INSTALL_HDR_PATH=/home/wbx/smoke/target_sparc_glibc/usr headers_install
+cd ..
+
+cd glibc-2.19-header
+libc_cv_forced_unwind=yes \
+libc_cv_cc_with_libunwind=yes \
+libc_cv_c_cleanup=yes \
+libc_cv_gnu99_inline=yes \
+libc_cv_initfini_array=yes \
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" ../glibc-2.19/configure \
+	--prefix=/home/wbx/smoke/target_sparc_glibc/usr \
+	--with-sysroot=/home/wbx/smoke/target_sparc_glibc \
+	--build=x86_64-linux-gnu --host=sparc-openadk-linux-gnu --with-headers=/home/wbx/smoke/target_sparc_glibc/usr/include --disable-sanity-checks --disable-nls --without-cvs --disable-profile --disable-debug --without-gd --disable-nscd --with-__thread --with-tls --enable-kernel="2.6.32" --enable-add-ons
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make cross-compiling=yes PARALLELMFLAGS="-j1" install-headers
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+touch target_sparc_glibc/usr/include/gnu/stubs.h
+
+mkdir gcc-initial
+cd gcc-initial
+CFLAGS="-O0 -g0" \
+CXXFLAGS="-O0 -g0" \
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" ../gcc/configure \
+	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
+			 --disable-biarch --disable-multilib --enable-libssp --enable-lto \
+			--enable-languages=c \
+			--disable-shared \
+			--disable-threads \
+			--with-sysroot=/home/wbx/smoke/target_sparc_glibc
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all-gcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all-target-libgcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install-gcc install-target-libgcc
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+
+cd glibc-2.19-final
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" SHELL='/bin/bash' BUILD_CC=cc CFLAGS="-mcpu=v8 -fwrapv -fno-ident -fomit-frame-pointer -O2 -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables -g3" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" CXX="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-g++" AR="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-ar" RANLIB="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-ranlib" libc_cv_forced_unwind=yes libc_cv_cc_with_libunwind=yes libc_cv_c_cleanup=yes libc_cv_gnu99_inline=yes libc_cv_initfini_array=yes  \
+../glibc-2.19/configure \
+	--prefix=/usr \
+	--enable-shared \
+	--enable-stackguard-randomization \
+	--build=x86_64-linux-gnu --host=sparc-openadk-linux-gnu --with-headers=/home/wbx/smoke/target_sparc_glibc/usr/include --disable-sanity-checks --disable-nls --without-cvs --disable-profile --disable-debug --without-gd --disable-nscd --with-__thread --with-tls --enable-kernel="2.6.32" --enable-add-ons 
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make all
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make install_root=/home/wbx/smoke/target_sparc_glibc install
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+
+mkdir gcc-final
+cd gcc-final
+../gcc/configure \
+	--prefix=/home/wbx/smoke/host_x86_64-linux-gnu --with-bugurl="http://www.openadk.org/" --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=sparc-openadk-linux-gnu --with-gmp=/home/wbx/smoke/host_x86_64-linux-gnu --with-mpfr=/home/wbx/smoke/host_x86_64-linux-gnu --with-libelf=/home/wbx/smoke/host_x86_64-linux-gnu --disable-__cxa_atexit --with-gnu-ld --with-gnu-as --enable-tls --disable-libsanitizer --disable-libitm --disable-libmudflap --disable-libgomp --disable-decimal-float --disable-libstdcxx-pch --disable-ppl-version-check --disable-cloog-version-check --without-system-zlib --without-ppl --without-cloog --without-isl --disable-nls --enable-target-optspace \
+			 --disable-biarch --disable-multilib --enable-libssp --enable-lto \
+			--enable-languages=c,c++ \
+			--with-build-sysroot='${prefix}/../target_sparc_glibc' \
+			--with-sysroot='${prefix}/../target_sparc_glibc' \
+			--enable-shared
+make -j4 all
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+make install
+if [ $? -ne 0 ];then
+	echo failed
+	exit
+fi
+cd ..
+
+cd linux-3.13.6/
+cat > mini.config <<EOF
+CONFIG_SPARC=y
+CONFIG_SPARC32=y
+CONFIG_SBUS=y
+CONFIG_SBUSCHAR=y
+CONFIG_PCI=y
+CONFIG_PCI_SYSCALL=y
+CONFIG_PCIC_PCI=y
+CONFIG_OF=y
+CONFIG_NET_VENDOR_AMD=y
+CONFIG_SUNLANCE=y
+CONFIG_SERIAL_CONSOLE=y
+CONFIG_SERIAL_SUNCORE=y
+CONFIG_SERIAL_SUNZILOG=y
+CONFIG_SERIAL_SUNZILOG_CONSOLE=y
+EOF
+
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' KCONFIG_ALLCONFIG=mini.config allnoconfig 
+PATH="/home/wbx/smoke/host_x86_64-linux-gnu/bin:$PATH" make V=1 ARCH=sparc CROSS_COMPILE="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-" CC="/home/wbx/smoke/host_x86_64-linux-gnu/bin/sparc-openadk-linux-gnu-gcc" HOSTCC="cc" CONFIG_SHELL='/bin/bash' HOSTCFLAGS='-O2 -Wall' -j4 zImage

+ 1 - 0
target/arm/sys-available/cubox-i

@@ -12,6 +12,7 @@ config ADK_TARGET_SYSTEM_CUBOX_I
 	select ADK_TARGET_WITH_USB
 	select ADK_TARGET_WITH_INPUT
 	select ADK_TARGET_KERNEL_ZIMAGE
+	select ADK_TARGET_WITH_ROOT_RW
 	select ADK_PACKAGE_U_BOOT_CUBOX_I
 	help
 	  Cubox-i

+ 1 - 0
target/arm/sys-available/raspberry-pi

@@ -12,6 +12,7 @@ config ADK_TARGET_SYSTEM_RASPBERRY_PI
 	select ADK_TARGET_WITH_USB
 	select ADK_TARGET_WITH_INPUT
 	select ADK_PACKAGE_BCM2835_BOOTLOADER
+	select ADK_TARGET_WITH_ROOT_RW
 	select ADK_TARGET_KERNEL_ZIMAGE
 	help
 	  Raspberry PI

+ 0 - 1
target/arm/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			arm
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 7 - 0
target/config/Config.in.adk

@@ -19,6 +19,13 @@ config ADK_DL_DIR
 	  Configure the download directory for all source packages.
 	  Use an absolute path.
 
+config ADK_TARGET_CFLAGS_OPT
+	string "optimization flags for compiler"
+	default "-Os -pipe"
+	help
+	  Compilation is only verfied with optimization for code size (Os).
+	  Other stuff (O2) might break. Will not be used when ADK_DEBUG is on.
+
 config ADK_DEBUG
 	bool "Compile applications with debug support by default"
 	default n

+ 0 - 1
target/m68k/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			m68k
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/microblaze/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			microblaze
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 1 - 0
target/mips/sys-available/lemote-yeelong

@@ -12,6 +12,7 @@ config ADK_TARGET_SYSTEM_LEMOTE_YEELONG
 	select ADK_TARGET_WITH_RTC
 	select ADK_TARGET_WITH_HDD
 	select ADK_TARGET_WITH_PCI
+	select ADK_TARGET_WITH_ROOT_RW
 	select ADK_TARGET_KERNEL_VMLINUZ
 	help
          System profile for Lemote Yeelong laptop.

+ 0 - 1
target/mips/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			mips
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/ppc/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			powerpc
 CPU_ARCH:=		ppc
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=	$(ADK_TARGET_CFLAGS) -Wl,--secure-plt

+ 0 - 1
target/ppc64/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			powerpc
 CPU_ARCH:=		ppc64
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=	$(ADK_TARGET_CFLAGS)

+ 0 - 1
target/sh/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			sh
 CPU_ARCH:=		$(ADK_TARGET_CPU_ARCH)
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/sparc/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			sparc
 CPU_ARCH:=		sparc
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 0 - 1
target/sparc64/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			sparc
 CPU_ARCH:=		sparc64
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 1 - 0
target/x86/sys-available/ibm-x40

@@ -20,6 +20,7 @@ config ADK_TARGET_SYSTEM_IBM_X40
 	select ADK_TARGET_WITH_ACPI
 	# with docking station 
 	select ADK_TARGET_WITH_PP
+	select ADK_TARGET_WITH_ROOT_RW
 	select ADK_TARGET_KERNEL_BZIMAGE
 	help
          System profile for IBM X40 laptop.

+ 0 - 1
target/x86/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			x86
 CPU_ARCH:=		$(strip $(subst ",, $(ADK_TARGET_CPU_ARCH)))
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=	$(ADK_TARGET_CFLAGS)

+ 0 - 1
target/x86_64/target.mk

@@ -1,5 +1,4 @@
 include $(TOPDIR)/mk/kernel-ver.mk
 ARCH:=			x86
 CPU_ARCH:=		x86_64
-TARGET_OPTIMIZATION:=	-Os -pipe
 TARGET_CFLAGS_ARCH:=    $(ADK_TARGET_CFLAGS)

+ 9 - 6
toolchain/musl/Makefile

@@ -12,6 +12,7 @@ endif
 
 $(WRKBUILD)/.headers:
 	(cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
+		CFLAGS='$(TARGET_CFLAGS)' \
 		./configure --prefix=/usr \
 		--target=$(GNU_TARGET_NAME) \
 		--disable-gcc-wrapper \
@@ -22,29 +23,31 @@ $(WRKBUILD)/.headers:
 
 $(WRKBUILD)/.compiled:
 	# reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
-	$(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
+	$(MAKE) -C $(WRKBUILD) clean
 	(cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
+		CFLAGS='$(TARGET_CFLAGS)' \
 		./configure --prefix=/usr \
 		--target=$(GNU_TARGET_NAME) \
 		--disable-gcc-wrapper \
 	)
-	$(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
+	$(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' all
 	touch $@
 
 $(WRKBUILD)/.installed: $(WRKBUILD)/.compiled
-	$(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
+	$(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' DESTDIR=$(STAGING_TARGET_DIR) install
 	touch $@
 
 $(WRKBUILD)/.fixup:
 	# reconfigure musl, otherwise linking with libgcc or libgcc_eh is disabled
-	$(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) clean
+	$(MAKE) -C $(WRKBUILD) clean
 	(cd $(WRKBUILD); CC='$(TARGET_CC)' CROSS_COMPILE='$(TARGET_CROSS)' \
+		CFLAGS='$(TARGET_CFLAGS)' \
 		./configure --prefix=/usr \
 		--target=$(GNU_TARGET_NAME) \
 		--disable-gcc-wrapper \
 	)
-	$(MAKE) CFLAGS='$(TARGET_CFLAGS)' -C $(WRKBUILD) all
-	$(MAKE) -C $(WRKBUILD) DESTDIR=$(STAGING_TARGET_DIR) install
+	$(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' all
+	$(MAKE) -C $(WRKBUILD) CFLAGS='$(TARGET_CFLAGS)' DESTDIR=$(STAGING_TARGET_DIR) install
 	# cleanup toolchain
 	-find $(STAGING_TARGET_DIR) $(STAGING_HOST_DIR) -name \*.la -delete
 ifeq ($(ADK_TOOLCHAIN),y)

+ 3 - 0
toolchain/uClibc/Makefile

@@ -105,7 +105,10 @@ $(WRKBUILD)/.installed: $(WRKBUILD)/.install_headers
 
 $(WRKBUILD)/.fixup:
 	# DOSTRIP kills x86 target (ld.so can not map libc.so.0), always use DODEBUG
+	# DODEBUG compile failure linking with libgcc_eh.a on arm hf
+ifneq ($(ADK_LINUX_ARM),y)
 	$(SED) 's,DOSTRIP,DODEBUG,' ${WRKBUILD}/.config
+endif
 	$(MAKE) -C $(WRKBUILD) \
 		PREFIX=$(STAGING_TARGET_DIR) \
 		DEVEL_PREFIX=/usr/ \