瀏覽代碼

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

Waldemar Brodkorb 11 年之前
父節點
當前提交
f9907d1324
共有 33 個文件被更改,包括 734 次插入336 次删除
  1. 12 8
      package/corosync/Makefile
  2. 0 11
      package/corosync/patches/patch-Makefile_in
  3. 16 0
      package/corosync/patches/patch-common_lib_Makefile_in
  4. 0 11
      package/corosync/patches/patch-include_corosync_coroipc_ipc_h
  5. 0 26
      package/corosync/patches/patch-tools_corosync-keygen_c
  6. 10 0
      package/gettext/patches/patch-gettext-runtime_gnulib-lib_stdio_in_h
  7. 10 0
      package/gettext/patches/patch-gettext-tools_gnulib-lib_stdio_in_h
  8. 10 0
      package/gettext/patches/patch-gettext-tools_libgettextpo_stdio_in_h
  9. 19 18
      package/glibc/Makefile
  10. 25 0
      package/libqb/Makefile
  11. 6 2
      package/nss/Makefile
  12. 11 0
      package/nss/files/nss.pc
  13. 4 4
      package/pacemaker/Makefile
  14. 8 8
      package/pacemaker/patches/patch-configure
  15. 10 0
      package/pacemaker/patches/patch-mcp_pacemaker_h
  16. 2 2
      package/pam/patches/patch-modules_pam_succeed_if_pam_succeed_if_c
  17. 2 2
      package/pam/patches/patch-modules_pam_time_pam_time_c
  18. 7 7
      package/pam/patches/patch-modules_pam_timestamp_hmacfile
  19. 10 0
      package/pam/patches/patch-modules_pam_unix_pam_unix_acct_c
  20. 374 0
      scripts/create.sh
  21. 1 0
      toolchain/gcc/Makefile
  22. 15 0
      toolchain/gcc/patches/4.6.3/siginfo.patch
  23. 2 2
      toolchain/glibc-ports/Makefile.inc
  24. 6 22
      toolchain/glibc-ports/patches/mips.patch
  25. 1 1
      toolchain/glibc/Makefile
  26. 2 2
      toolchain/glibc/Makefile.inc
  27. 8 11
      toolchain/glibc/patches/gcc_eh.patch
  28. 0 14
      toolchain/glibc/patches/getpagesize.patch
  29. 99 0
      toolchain/glibc/patches/glibc-cross.patch
  30. 4 19
      toolchain/glibc/patches/i686_define_bug.patch
  31. 0 31
      toolchain/glibc/patches/stdio_lim.patch
  32. 60 0
      toolchain/glibc/patches/timezone.patch
  33. 0 135
      toolchain/glibc/patches/tz.patch

+ 12 - 8
package/corosync/Makefile

@@ -4,14 +4,15 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		corosync
-PKG_VERSION:=		1.4.1
+PKG_VERSION:=		2.0.1
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		66231146af210637393748add091021d
+PKG_MD5SUM:=		9e23f3f5594676455ff39ff363658155
 PKG_DESCR:=		Cluster Engine	
 PKG_SECTION:=		ha
-PKG_DEPENDS:=		cluster-glue
+PKG_BUILDDEP:=		libqb nss
+PKG_DEPENDS:=		cluster-glue libqb nss
 PKG_URL:=		http://www.corosync.org/
-PKG_SITES:=		ftp://ftp:downloads@ftp.corosync.org/downloads/corosync-1.4.1/
+PKG_SITES:=		ftp://ftp:downloads@corosync.org/downloads/corosync-2.0.1/
 
 PKG_CFLINE_COROSYNC:=	select ADK_KERNEL_IP_MULTICAST
 
@@ -19,7 +20,10 @@ include $(TOPDIR)/mk/package.mk
 
 $(eval $(call PKG_template,COROSYNC,corosync,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
 
-CONFIGURE_ARGS+=	--disable-nss
+XAKE_FLAGS+=		GCC_HONOUR_COPTS=s
+TARGET_CPPFLAGS+=	-I$(STAGING_DIR)/usr/include/nss \
+			-I$(STAGING_DIR)/usr/include/nspr
+TARGET_LDFLAGS+=	-lssl3 -lsmime3 -lnss3 -lnssutil3
 CONFIGURE_ENV+=		ac_cv_func_fnmatch_works=yes
 
 corosync-install:
@@ -31,8 +35,8 @@ corosync-install:
 	$(INSTALL_DIR) $(IDIR_COROSYNC)/usr/sbin
 	$(CP) $(WRKINST)/usr/sbin/* \
 		$(IDIR_COROSYNC)/usr/sbin
-	$(INSTALL_DIR) $(IDIR_COROSYNC)/usr/libexec
-	$(CP) $(WRKINST)/usr/libexec/* \
-		$(IDIR_COROSYNC)/usr/libexec
+	$(INSTALL_DIR) $(IDIR_COROSYNC)/usr/bin
+	$(CP) $(WRKINST)/usr/bin/* \
+		$(IDIR_COROSYNC)/usr/bin
 
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 0 - 11
package/corosync/patches/patch-Makefile_in

@@ -1,11 +0,0 @@
---- corosync-1.4.1.orig/Makefile.in	2011-07-26 10:13:38.000000000 +0200
-+++ corosync-1.4.1/Makefile.in	2011-10-12 06:02:03.291467847 +0200
-@@ -323,7 +323,7 @@ corosysconf_DATA = conf/corosync.conf.ex
- 			  conf/corosync.conf.example.udpu
- 
- SUBDIRS = include lcr lib exec services tools test pkgconfig \
--			  man init conf
-+			  init conf
- 
- RPMBUILDOPTS = --define "_sourcedir $(abs_builddir)" \
- 		  --define "_specdir $(abs_builddir)" \

+ 16 - 0
package/corosync/patches/patch-common_lib_Makefile_in

@@ -0,0 +1,16 @@
+--- corosync-2.0.1.orig/common_lib/Makefile.in	2012-05-22 08:52:57.000000000 +0200
++++ corosync-2.0.1/common_lib/Makefile.in	2012-08-01 10:17:04.000000000 +0200
+@@ -336,13 +336,6 @@ install-libLIBRARIES: $(lib_LIBRARIES)
+ 	  $(INSTALL_DATA) $$list2 "$(DESTDIR)$(libdir)" || exit $$?; }
+ 	@$(POST_INSTALL)
+ 	@list='$(lib_LIBRARIES)'; test -n "$(libdir)" || list=; \
+-	for p in $$list; do \
+-	  if test -f $$p; then \
+-	    $(am__strip_dir) \
+-	    echo " ( cd '$(DESTDIR)$(libdir)' && $(RANLIB) $$f )"; \
+-	    ( cd "$(DESTDIR)$(libdir)" && $(RANLIB) $$f ) || exit $$?; \
+-	  else :; fi; \
+-	done
+ 
+ uninstall-libLIBRARIES:
+ 	@$(NORMAL_UNINSTALL)

+ 0 - 11
package/corosync/patches/patch-include_corosync_coroipc_ipc_h

@@ -1,11 +0,0 @@
---- corosync-1.3.1.orig/include/corosync/coroipc_ipc.h	2011-04-25 04:37:30.000000000 +0200
-+++ corosync-1.3.1/include/corosync/coroipc_ipc.h	2011-06-26 18:49:29.245183024 +0200
-@@ -44,7 +44,7 @@
-  * Darwin claims to support process shared synchronization
-  * but it really does not.  The unistd.h header file is wrong.
-  */
--#if defined(COROSYNC_DARWIN) || defined(__UCLIBC__)
-+#if defined(COROSYNC_DARWIN)
- #undef _POSIX_THREAD_PROCESS_SHARED
- #define _POSIX_THREAD_PROCESS_SHARED -1
- #endif

+ 0 - 26
package/corosync/patches/patch-tools_corosync-keygen_c

@@ -1,26 +0,0 @@
---- corosync-1.4.1.orig/tools/corosync-keygen.c	2011-07-26 10:08:43.000000000 +0200
-+++ corosync-1.4.1/tools/corosync-keygen.c	2011-10-04 21:03:05.000000000 +0200
-@@ -65,11 +65,11 @@ int main (void) {
- 		}
- 	}
- 
--	printf ("Gathering %lu bits for key from /dev/random.\n", (unsigned long)(sizeof (key) * 8));
-+	printf ("Gathering %lu bits for key from /dev/urandom.\n", (unsigned long)(sizeof (key) * 8));
- 	printf ("Press keys on your keyboard to generate entropy.\n");
--	random_fd = open ("/dev/random", O_RDONLY);
-+	random_fd = open ("/dev/urandom", O_RDONLY);
- 	if (random_fd == -1) {
--		perror ("Is /dev/random present? Opening /dev/random");
-+		perror ("Is /dev/urandom present? Opening /dev/urandom");
- 		exit (errno);
- 	}
- 
-@@ -81,7 +81,7 @@ int main (void) {
- retry_read:
- 	res = read (random_fd, &key[bytes_read], sizeof (key) - bytes_read);
- 	if (res == -1) {
--		perror ("Could not read /dev/random");
-+		perror ("Could not read /dev/urandom");
- 		exit (errno);
- 	}
- 	bytes_read += res;

+ 10 - 0
package/gettext/patches/patch-gettext-runtime_gnulib-lib_stdio_in_h

@@ -0,0 +1,10 @@
+--- gettext-0.18.1.1.orig/gettext-runtime/gnulib-lib/stdio.in.h	2010-05-17 21:56:12.000000000 +0200
++++ gettext-0.18.1.1/gettext-runtime/gnulib-lib/stdio.in.h	2012-07-31 11:28:12.000000000 +0200
+@@ -141,7 +141,6 @@ _GL_WARN_ON_USE (fflush, "fflush is not 
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@

+ 10 - 0
package/gettext/patches/patch-gettext-tools_gnulib-lib_stdio_in_h

@@ -0,0 +1,10 @@
+--- gettext-0.18.1.1.orig/gettext-tools/gnulib-lib/stdio.in.h	2010-05-24 11:42:46.000000000 +0200
++++ gettext-0.18.1.1/gettext-tools/gnulib-lib/stdio.in.h	2012-07-31 11:29:05.000000000 +0200
+@@ -141,7 +141,6 @@ _GL_WARN_ON_USE (fflush, "fflush is not 
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@

+ 10 - 0
package/gettext/patches/patch-gettext-tools_libgettextpo_stdio_in_h

@@ -0,0 +1,10 @@
+--- gettext-0.18.1.1.orig/gettext-tools/libgettextpo/stdio.in.h	2010-05-17 21:58:03.000000000 +0200
++++ gettext-0.18.1.1/gettext-tools/libgettextpo/stdio.in.h	2012-07-31 11:31:22.000000000 +0200
+@@ -141,7 +141,6 @@ _GL_WARN_ON_USE (fflush, "fflush is not 
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@

+ 19 - 18
package/glibc/Makefile

@@ -9,6 +9,7 @@ TARGET_CFLAGS:=	$(filter-out -flto,$(TARGET_CFLAGS))
 include $(TOPDIR)/toolchain/glibc/Makefile.inc
 
 PKG_DESCR:=		GNU C library
+PKG_VER:=		2.16
 PKG_SECTION:=		base
 PKG_OPTS:=		noremove
 PKG_SUBPKGS:=		GLIBC GLIBC_DEV
@@ -30,22 +31,22 @@ INSTALL_STYLE:=		manual
 # compile nothing, glibc is already build in toolchain directory
 do-install:
 	${INSTALL_DIR} $(IDIR_GLIBC)/lib $(IDIR_GLIBC)/etc
-	cd ${STAGING_TARGET_DIR} && for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \
-		test -s usr/share/zoneinfo/"$$f" || continue; \
-		echo usr/share/zoneinfo/"$$f" | \
-		    ${TOOLS_DIR}/cpio -pdu ${IDIR_GLIBC}/; \
-	done
-	tz=; cd ${IDIR_GLIBC}/usr/share/zoneinfo || exit 1; \
-	    for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \
-		test -s "$$f" || continue; \
-		tz=$$f; \
-	done; if test x"$$tz" = x""; then \
-		echo >&2 Error during timezone installation; \
-		exit 1; \
-	else \
-		ln -sf "../usr/share/zoneinfo/$$tz" \
-		    ${IDIR_GLIBC}/etc/localtime; \
-	fi
+	#cd ${STAGING_TARGET_DIR} && for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \
+	#	test -s usr/share/zoneinfo/"$$f" || continue; \
+	#	echo usr/share/zoneinfo/"$$f" | \
+	#	    ${TOOLS_DIR}/cpio -pdu ${IDIR_GLIBC}/; \
+	#done
+	#tz=; cd ${IDIR_GLIBC}/usr/share/zoneinfo || exit 1; \
+	#    for f in UTC ${ADK_RUNTIME_TIMEZONE}; do \
+	#	test -s "$$f" || continue; \
+	#	tz=$$f; \
+	#done; if test x"$$tz" = x""; then \
+	#	echo >&2 Error during timezone installation; \
+	#	exit 1; \
+	#else \
+	#	ln -sf "../usr/share/zoneinfo/$$tz" \
+	#	    ${IDIR_GLIBC}/etc/localtime; \
+	#fi
 	${CP} ${STAGING_TARGET_DIR}/etc/gai.conf ${IDIR_GLIBC}/etc
 	${CP} ${STAGING_TARGET_DIR}/etc/nscd.conf ${IDIR_GLIBC}/etc
 	${CP} ${STAGING_TARGET_DIR}/etc/nsswitch.conf ${IDIR_GLIBC}/etc
@@ -55,7 +56,7 @@ endif
 	$(CP) $(STAGING_TARGET_DIR)/lib/ld*.so* $(IDIR_GLIBC)/lib
 	for file in libc libcrypt libdl libm libnsl libresolv librt libutil libnss_compat libnss_dns libnss_files; do \
 		$(CP) $(STAGING_TARGET_DIR)/lib/$$file.so* $(IDIR_GLIBC)/lib; \
-		$(CP) $(STAGING_TARGET_DIR)/lib/$$file-$(PKG_VERSION).so $(IDIR_GLIBC)/lib; \
+		$(CP) $(STAGING_TARGET_DIR)/lib/$$file-$(PKG_VER).so $(IDIR_GLIBC)/lib; \
 	done
 
 glibc-dev-install:
@@ -66,7 +67,7 @@ glibc-dev-install:
 	${CP} ${STAGING_TARGET_DIR}/usr/lib/crt* ${IDIR_GLIBC_DEV}/usr/lib
 	${CP} ${STAGING_TARGET_DIR}/usr/lib/libc_nonshared.a ${IDIR_GLIBC_DEV}/usr/lib
 	-for file in libcrypt libdl libm libresolv librt libutil; do \
-		cd $(IDIR_GLIBC_DEV)/lib; ln -sf $$file-$(PKG_VERSION).so $$file.so; \
+		cd $(IDIR_GLIBC_DEV)/lib; ln -sf $$file-$(PKG_VER).so $$file.so; \
 	done
 	# header package
 	$(MAKE) -C $(TOOLCHAIN_BUILD_DIR)/w-linux-$(KERNEL_VERSION)-$(KERNEL_RELEASE)/linux-$(KERNEL_VERSION) \

+ 25 - 0
package/libqb/Makefile

@@ -0,0 +1,25 @@
+# This file is part of the OpenADK project. OpenADK is copyrighted
+# material, please see the LICENCE file in the top-level directory.
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=		libqb
+PKG_VERSION:=		0.14.1
+PKG_RELEASE:=		1
+PKG_MD5SUM:=		c144a5e0cd5b69c8d46a051646609f11
+PKG_DESCR:=		high performance client server reusable features
+PKG_SECTION:=		libs
+PKG_URL:=		https://github.com/asalkeld/libqb/wiki#wiki-Releases
+PKG_SITES:=		https://fedorahosted.org/releases/q/u/quarterback/
+
+
+include $(TOPDIR)/mk/package.mk
+
+$(eval $(call PKG_template,LIBQB,libqb,$(PKG_VERSION)-${PKG_RELEASE},${PKG_DEPENDS},${PKG_DESCR},${PKG_SECTION}))
+
+libqb-install:
+	$(INSTALL_DIR) $(IDIR_LIBQB)/usr/lib
+	$(CP) $(WRKINST)/usr/lib/libqb*so* \
+		$(IDIR_LIBQB)/usr/lib
+
+include ${TOPDIR}/mk/pkg-bottom.mk

+ 6 - 2
package/nss/Makefile

@@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=		nss
 PKG_VERSION:=		3.13.3
-PKG_RELEASE:=		1
+PKG_RELEASE:=		2
 PKG_MAJ_VERSION:=	3
 PKG_MIN_VERSION:=	13
 PKG_PATCH_VERSION:=	3
@@ -13,6 +13,7 @@ PKG_MD5SUM:=		006cb82fa900e9e664b4b14a9b7810ca
 PKG_DESCR:=		Network Security Services (NSS) library
 PKG_SECTION:=		libs
 PKG_BUILDDEP:=		nspr zlib
+PKG_DEPENDS:=		nspr
 PKG_URL:=		http://www.mozilla.org/projects/security/pki/nss/
 PKG_SITES:=		ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_13_3_RTM/src/
 PKG_NOPARALLEL:=	1
@@ -53,9 +54,12 @@ post-install:
 	${INSTALL_DIR} ${STAGING_TARGET_DIR}/usr/include/nss
 	${INSTALL_DATA} ${WRKDIST}/mozilla/dist/public/nss/* \
 		${STAGING_TARGET_DIR}/usr/include/nss
-	# needed for firefox 4
+	# needed for firefox
 	${INSTALL_DIR} ${STAGING_TARGET_DIR}/usr/lib
 	$(INSTALL_DATA) ${WRKDIST}/dist/lib/libcrmf.a \
 		${STAGING_TARGET_DIR}/usr/lib
+	# needed for corosync
+	$(INSTALL_DIR) ${WRKINST}/usr/lib/pkgconfig
+	$(CP) ./files/nss.pc ${WRKINST}/usr/lib/pkgconfig
 
 include ${TOPDIR}/mk/pkg-bottom.mk

+ 11 - 0
package/nss/files/nss.pc

@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=/usr/bin
+libdir=${prefix}/lib
+includedir=${prefix}/include/nss3
+
+Name: NSS
+Description: Network Security Services
+Version: 3.12.3
+Requires: sqlite3 nspr >= 4.8
+Libs: -L${libdir} -lssl3 -lsmime3 -lnss3 -lnssutil3
+Cflags: -I${includedir}

+ 4 - 4
package/pacemaker/Makefile

@@ -6,12 +6,12 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=		pacemaker
 PKG_VERSION:=		1.1.7
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		6f87e80f3c9782af5b4d184742c66a3a
+PKG_MD5SUM:=		818682b8d937e6c6a6e5f999528328a5
 PKG_DESCR:=		scalable High-Availability cluster resource manager
 PKG_SECTION:=		ha
-PKG_BUILDDEP:=		resource-agents cluster-glue pam gnutls corosync
-PKG_DEPENDS:=		python2 python2-readline python2-bzip2 cluster-glue
-PKG_DEPENDS+=		bash resource-agents pam libgnutls glib libxslt libxml2
+PKG_BUILDDEP:=		resource-agents cluster-glue pam gnutls corosync libtool
+PKG_DEPENDS:=		python2 python2-readline python2-bzip2 cluster-glue libuuid
+PKG_DEPENDS+=		bash resource-agents pam libgnutls glib libxslt libxml2 libltdl
 PKG_URL:=		http://www.clusterlabs.org/
 PKG_SITES:=		http://openadk.org/distfiles/
 

+ 8 - 8
package/pacemaker/patches/patch-configure

@@ -1,6 +1,6 @@
---- pacemaker-1.0.11.orig/configure	2011-05-24 17:00:37.000000000 +0200
-+++ pacemaker-1.0.11/configure	2011-10-07 12:41:11.000000000 +0200
-@@ -12484,7 +12484,7 @@ $as_echo_n "checking for $2 in $1... " >
+--- pacemaker-1.1.7.orig/configure	2012-07-31 13:24:43.000000000 +0200
++++ pacemaker-1.1.7/configure	2012-07-31 13:27:31.000000000 +0200
+@@ -12965,7 +12965,7 @@ $as_echo_n "checking for $2 in $1... " >
  	  printf "#include <stdio.h>\n" > ${Cfile}.c
  	  printf "#include <%s>\n" $1 >> ${Cfile}.c
  	  printf "int main(int argc, char **argv) { printf(\"%%s\", %s); return 0; }\n" $2 >> ${Cfile}.c
@@ -9,7 +9,7 @@
  	  value=`${Cfile}`
  	  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $value" >&5
  $as_echo "$value" >&6; }
-@@ -12660,7 +12660,7 @@ case $libdir in
+@@ -13208,7 +13208,7 @@ case $libdir in
      *prefix*|NONE)
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking which lib directory to use" >&5
  $as_echo_n "checking which lib directory to use... " >&6; }
@@ -18,7 +18,7 @@
      do
        trydir="${exec_prefix}/${aDir}"
        if
-@@ -12713,33 +12713,11 @@ $as_echo "$as_me: WARNING: $j directory 
+@@ -13261,33 +13261,11 @@ $as_echo "$as_me: WARNING: $j directory 
  done
  
  
@@ -49,11 +49,11 @@
 -esac
 -
 -CFLAGS="$CFLAGS -I${prefix}/include/heartbeat"
-+CFLAGS="$CFLAGS -I@@STAGING_DIR@@/usr/include/heartbeat"
++CFLAGS="$CFLAGS -I/Volumes/adk/openadk/target_i686_eglibc/usr/include/heartbeat"
  
  
- 
-@@ -17159,7 +17137,6 @@ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: Host CPU: $host_cpu" >&5
+@@ -18920,7 +18898,6 @@ else
  
  	# We had to eliminate -Wnested-externs because of libtool changes
          EXTRA_FLAGS="-fgnu89-inline

+ 10 - 0
package/pacemaker/patches/patch-mcp_pacemaker_h

@@ -0,0 +1,10 @@
+--- pacemaker-1.1.7.orig/mcp/pacemaker.h	2012-03-28 08:14:13.000000000 +0200
++++ pacemaker-1.1.7/mcp/pacemaker.h	2012-07-31 13:43:39.000000000 +0200
+@@ -21,6 +21,7 @@
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
++#include <sys/resource.h>
+ 
+ #include <stdint.h>
+ 

+ 2 - 2
package/pam/patches/patch-modules_pam_succeed_if_pam_succeed_if_c

@@ -1,6 +1,6 @@
 --- Linux-PAM-1.1.4.orig/modules/pam_succeed_if/pam_succeed_if.c	2011-06-21 11:04:56.000000000 +0200
-+++ Linux-PAM-1.1.4/modules/pam_succeed_if/pam_succeed_if.c	2011-10-12 14:36:33.843559001 +0200
-@@ -230,6 +230,7 @@ evaluate_notingroup(pam_handle_t *pamh,
++++ Linux-PAM-1.1.4/modules/pam_succeed_if/pam_succeed_if.c	2012-07-31 12:02:24.000000000 +0200
+@@ -230,6 +230,7 @@ evaluate_notingroup(pam_handle_t *pamh, 
  	return PAM_AUTH_ERR;
  }
  /* Return PAM_SUCCESS if the (host,user) is in the netgroup. */

+ 2 - 2
package/pam/patches/patch-modules_pam_time_pam_time_c

@@ -1,6 +1,6 @@
 --- Linux-PAM-1.1.4.orig/modules/pam_time/pam_time.c	2011-06-21 11:04:56.000000000 +0200
-+++ Linux-PAM-1.1.4/modules/pam_time/pam_time.c	2011-10-12 14:43:20.673559001 +0200
-@@ -555,7 +555,9 @@ check_account(pam_handle_t *pamh, const
++++ Linux-PAM-1.1.4/modules/pam_time/pam_time.c	2012-07-31 12:02:24.000000000 +0200
+@@ -555,7 +555,9 @@ check_account(pam_handle_t *pamh, const 
  	  }
  	  /* If buffer starts with @, we are using netgroups */
  	  if (buffer[0] == '@')

+ 7 - 7
package/pam/patches/patch-modules_pam_timestamp_hmacfile

@@ -1,5 +1,5 @@
 --- Linux-PAM-1.1.4.orig/modules/pam_timestamp/hmacfile	2011-06-21 11:37:55.000000000 +0200
-+++ Linux-PAM-1.1.4/modules/pam_timestamp/hmacfile	2011-10-12 14:45:28.323559001 +0200
++++ Linux-PAM-1.1.4/modules/pam_timestamp/hmacfile	2012-07-31 12:03:27.000000000 +0200
 @@ -1,4 +1,4 @@
 -#! /bin/sh
 +#! /bin/bash
@@ -11,7 +11,7 @@
  # Sed substitution that helps us do robust quoting.  It backslashifies
  # metacharacters that are still active within double-quoted strings.
 -Xsed='/bin/sed -e 1s/^X//'
-+Xsed='/home/wbx/adk/perf/scripts/sed -e 1s/^X//'
++Xsed='/Volumes/adk/openadk/scripts/sed -e 1s/^X//'
  sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
  
  # Be Bourne compatible
@@ -20,14 +20,14 @@
  (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
  
 -relink_command=""
-+relink_command="(cd /home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/modules/pam_timestamp; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/home/wbx/adk/perf/scripts:/home/wbx/adk/perf/bin/tools:/home/wbx/adk/perf/host_i586_uclibc/bin:/home/wbx/adk/perf/host_i586_uclibc/usr/bin:/home/wbx/adk/perf/target_i586_uclibc/scripts:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games; export PATH; /home/wbx/adk/perf/host_i586_uclibc/bin/i586-openadk-linux-uclibc-gcc -I../../libpam/include -I../../libpamc/include -march=geode -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/home/wbx/adk/perf/target_i586_uclibc/usr/lib -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -o \$progdir/\$file hmacfile.o hmacsha1.o sha1.o  -L/home/wbx/adk/perf/target_i586_uclibc/lib -L/home/wbx/adk/perf/target_i586_uclibc/usr/lib -L/home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/libpam /home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/libpam/.libs/libpam.so -ldl -Wl,-rpath -Wl,/home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/libpam/.libs -Wl,-rpath -Wl,/lib64)"
++relink_command="(cd /Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/modules/pam_timestamp; { test -z \"\${LIBRARY_PATH+set}\" || unset LIBRARY_PATH || { LIBRARY_PATH=; export LIBRARY_PATH; }; }; { test -z \"\${COMPILER_PATH+set}\" || unset COMPILER_PATH || { COMPILER_PATH=; export COMPILER_PATH; }; }; { test -z \"\${GCC_EXEC_PREFIX+set}\" || unset GCC_EXEC_PREFIX || { GCC_EXEC_PREFIX=; export GCC_EXEC_PREFIX; }; }; { test -z \"\${LD_RUN_PATH+set}\" || unset LD_RUN_PATH || { LD_RUN_PATH=; export LD_RUN_PATH; }; }; { test -z \"\${LD_LIBRARY_PATH+set}\" || unset LD_LIBRARY_PATH || { LD_LIBRARY_PATH=; export LD_LIBRARY_PATH; }; }; PATH=/Volumes/adk/openadk/scripts:/Volumes/adk/openadk/bin/tools:/Volumes/adk/openadk/host_i686_eglibc/bin:/Volumes/adk/openadk/host_i686_eglibc/usr/bin:/Volumes/adk/openadk/target_i686_eglibc/scripts:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/MacGPG2/bin:/usr/X11/bin; export PATH; /Volumes/adk/openadk/host_i686_eglibc/bin/i686-openadk-linux-gnu-gcc -I../../libpam/include -I../../libpamc/include -march=i686 -fwrapv -fno-ident -fhonour-copts -fomit-frame-pointer -Os -pipe -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-declarations -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wstrict-prototypes -Wwrite-strings -Winline -Wshadow -Wl,-O2 -Wl,-rpath -Wl,/usr/lib -Wl,-rpath-link -Wl,/Volumes/adk/openadk/target_i686_eglibc/usr/lib -Wl,--as-needed -Wl,--no-undefined -Wl,-O1 -o \$progdir/\$file hmacfile.o hmacsha1.o sha1.o  -L/Volumes/adk/openadk/target_i686_eglibc/lib -L/Volumes/adk/openadk/target_i686_eglibc/usr/lib -L/Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/libpam /Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/libpam/.libs/libpam.so -ldl -Wl,-rpath -Wl,/Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/libpam/.libs)"
  
  # This environment variable determines our operation mode.
  if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
    # install mode needs the following variables:
    generated_by_libtool_version='2.2.6'
 -  notinst_deplibs=' /data/git/Linux-PAM/libpam/libpam.la'
-+  notinst_deplibs=' /home/wbx/adk/perf/build_pcengines-alix1c_i586_uclibc/w-pam-1.1.4-1/Linux-PAM-1.1.4/libpam/libpam.la'
++  notinst_deplibs=' /Volumes/adk/openadk/build_qemu_i686_eglibc/w-pam-1.1.4-2/Linux-PAM-1.1.4/libpam/libpam.la'
  else
    # When we are sourced in execute mode, $file and $ECHO are already set.
    if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
@@ -45,7 +45,7 @@
  
    # Follow symbolic links until we get to the real thisdir.
 -  file=`ls -ld "$file" | /bin/sed -n 's/.*-> //p'`
-+  file=`ls -ld "$file" | /home/wbx/adk/perf/scripts/sed -n 's/.*-> //p'`
++  file=`ls -ld "$file" | /Volumes/adk/openadk/scripts/sed -n 's/.*-> //p'`
    while test -n "$file"; do
      destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
  
@@ -54,7 +54,7 @@
  
      file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
 -    file=`ls -ld "$thisdir/$file" | /bin/sed -n 's/.*-> //p'`
-+    file=`ls -ld "$thisdir/$file" | /home/wbx/adk/perf/scripts/sed -n 's/.*-> //p'`
++    file=`ls -ld "$thisdir/$file" | /Volumes/adk/openadk/scripts/sed -n 's/.*-> //p'`
    done
  
  
@@ -67,7 +67,7 @@
    progdir="$thisdir/.libs"
  
 +  if test ! -f "$progdir/$program" ||
-+     { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /home/wbx/adk/perf/scripts/sed 1q`; \
++     { file=`ls -1dt "$progdir/$program" "$progdir/../$program" 2>/dev/null | /Volumes/adk/openadk/scripts/sed 1q`; \
 +       test "X$file" != "X$progdir/$program"; }; then
  
 -  if test -f "$progdir/$program"; then

+ 10 - 0
package/pam/patches/patch-modules_pam_unix_pam_unix_acct_c

@@ -0,0 +1,10 @@
+--- Linux-PAM-1.1.4.orig/modules/pam_unix/pam_unix_acct.c	2011-06-21 11:04:56.000000000 +0200
++++ Linux-PAM-1.1.4/modules/pam_unix/pam_unix_acct.c	2012-07-31 13:08:58.000000000 +0200
+@@ -47,6 +47,7 @@
+ #include <time.h>		/* for time() */
+ #include <errno.h>
+ #include <sys/wait.h>
++#include <sys/resource.h>
+ 
+ #include <security/_pam_macros.h>
+ 

+ 374 - 0
scripts/create.sh

@@ -0,0 +1,374 @@
+#!/usr/bin/env bash
+#-
+# Copyright © 2010, 2011
+#	Waldemar Brodkorb <wbx@openadk.org>
+#	Thorsten Glaser <tg@mirbsd.org>
+#
+# Provided that these terms and disclaimer and all copyright notices
+# are retained or reproduced in an accompanying document, permission
+# is granted to deal in this work without restriction, including un‐
+# limited rights to use, publicly perform, distribute, sell, modify,
+# merge, give away, or sublicence.
+#
+# This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to
+# the utmost extent permitted by applicable law, neither express nor
+# implied; without malicious intent or gross negligence. In no event
+# may a licensor, author or contributor be held liable for indirect,
+# direct, other damage, loss, or other issues arising in any way out
+# of dealing in the work, even if advised of the possibility of such
+# damage or existence of a defect, except proven that it results out
+# of said person’s immediate fault when using the work as intended.
+#
+# Alternatively, this work may be distributed under the terms of the
+# General Public License, any version, as published by the Free Soft-
+# ware Foundation.
+#-
+# Prepare a USB stick or CF/SD/MMC card or hard disc for installation
+# of OpenADK:
+# • install a Master Boot Record containing a MirBSD PBR loading GRUB
+# • write GRUB2 core.img just past the MBR
+# • create a root partition with ext2fs and extract the OpenADK image
+#   just built there
+# • create a cfgfs partition
+
+TOPDIR=$(pwd)
+me=$0
+
+case :$PATH: in
+(*:$TOPDIR/bin/tools:*) ;;
+(*) export PATH=$PATH:$TOPDIR/bin/tools ;;
+esac
+
+test -n "$KSH_VERSION" || if ! which mksh >/dev/null 2>&1; then
+	make package=mksh fetch || exit 1
+	df=$(cd package/mksh; TOPDIR="$TOPDIR" gmake show=DISTFILES)
+	mkdir -p build_mksh
+	gzip -dc dl/"$df" | (cd build_mksh; cpio -mid)
+	cd build_mksh/mksh
+	bash Build.sh -r -c lto || exit 1
+	cp mksh "$TOPDIR"/bin/tools/
+	cd "$TOPDIR"
+	rm -rf build_mksh
+fi
+
+test -n "$KSH_VERSION" || exec mksh -x "$me" "$@"
+if test -z "$KSH_VERSION"; then
+	echo >&2 Fatal error: could not run myself with mksh!
+	exit 255
+fi
+
+### run with mksh from here onwards ###
+
+me=${me##*/}
+
+if (( USER_ID )); then
+	print -u2 Installation is only possible as root!
+	exit 1
+fi
+
+TOPDIR=$(realpath .)
+ostype=$(uname -s)
+
+cfgfs=1
+noformat=0
+quiet=0
+serial=0
+speed=115200
+panicreboot=10
+
+function usage {
+cat >&2 <<EOF
+Syntax: $me [-c cfgfssize] [-p panictime] [±q] [-s serialspeed]
+    [±t] -n /dev/sdb image
+Defaults: -c 1 -p 10 -s 115200; -t = enable serial console
+EOF
+	exit $1
+}
+
+while getopts "c:hp:qs:nt" ch; do
+	case $ch {
+	(c)	if (( (cfgfs = OPTARG) < 0 || cfgfs > 5 )); then
+			print -u2 "$me: -c $OPTARG out of bounds"
+			exit 1
+		fi ;;
+	(h)	usage 0 ;;
+	(p)	if (( (panicreboot = OPTARG) < 0 || panicreboot > 300 )); then
+			print -u2 "$me: -p $OPTARG out of bounds"
+			exit 1
+		fi ;;
+	(q)	quiet=1 ;;
+	(+q)	quiet=0 ;;
+	(s)	if [[ $OPTARG != @(96|192|384|576|1152)00 ]]; then
+			print -u2 "$me: serial speed $OPTARG invalid"
+			exit 1
+		fi
+		speed=$OPTARG ;;
+	(n)	noformat=1 ;;
+	(t)	serial=1 ;;
+	(+t)	serial=0 ;;
+	(*)	usage 1 ;;
+	}
+done
+shift $((OPTIND - 1))
+
+(( $# == 2 )) || usage 1
+
+f=0
+tools='genext2fs'
+case $ostype {
+(DragonFly|*BSD*)
+	;;
+(Darwin)
+	tools="$tools fuse-ext2"
+	;;
+(Linux)
+	;;
+(*)
+	print -u2 Sorry, not ported to the OS "'$ostype'" yet.
+	exit 1
+	;;
+}
+for tool in $tools; do
+	print -n Checking if $tool is installed...
+	if whence -p $tool >/dev/null; then
+		print " okay"
+	else
+		print " failed"
+		f=1
+	fi
+done
+(( f )) && exit 1
+
+tgt=$1
+src=$2
+
+if [[ ! -f $src ]]; then
+	print -u2 "'$src' is not a file, exiting"
+	exit 1
+fi
+(( quiet )) || print "Installing $src on $tgt."
+
+qemu-img create -f raw $tgt 524288k
+
+case $ostype {
+(DragonFly|*BSD*)
+	basedev=${tgt%c}
+	tgt=${basedev}c
+	part=${basedev}i
+	match=\'${basedev}\''[a-p]'
+	function mount_ext2fs {
+		mount -t ext2fs "$1" "$2"
+	}
+	;;
+(Darwin)
+	basedev=$tgt
+	part=${basedev}s1
+	match=\'${basedev}\''?(s+([0-9]))'
+	function mount_ext2fs {
+		fuse-ext2 "$1" "$2" -o rw+
+		sleep 3
+	}
+	;;
+(Linux)
+	basedev=$tgt
+	part=${basedev}1
+	match=\'${basedev}\''+([0-9])'
+	function mount_ext2fs {
+		mount -t ext2 "$1" "$2"
+	}
+	;;
+}
+
+if (( !quiet )); then
+	print "WARNING: This will overwrite $basedev - type Yes to continue!"
+	read x
+	[[ $x = Yes ]] || exit 0
+fi
+
+if stat -qs .>/dev/null 2>&1; then
+	statcmd='stat -f %z'	# BSD stat (or so we assume)
+else
+	statcmd='stat -c %s'	# GNU stat
+fi
+
+dksz=$(($($statcmd "$tgt")*2))
+heads=64
+secs=32
+(( cyls = dksz / heads / secs ))
+if (( cyls < (cfgfs + 2) )); then
+	print -u2 "Size of $tgt is $dksz, this looks fishy?"
+	exit 1
+fi
+
+
+if ! T=$(mktemp -d /tmp/openadk.XXXXXXXXXX); then
+	print -u2 Error creating temporary directory.
+	exit 1
+fi
+tar -xOzf "$src" usr/share/grub-bin/core.img >"$T/core.img"
+integer coreimgsz=$($statcmd "$T/core.img")
+if (( coreimgsz < 1024 )); then
+	print -u2 core.img is probably too small: $coreimgsz
+	rm -rf "$T"
+	exit 1
+fi
+if (( coreimgsz > 65024 )); then
+	print -u2 core.img is larger than 64K-512: $coreimgsz
+	rm -rf "$T"
+	exit 1
+fi
+(( coreendsec = (coreimgsz + 511) / 512 ))
+if [[ $basedev = /dev/svnd+([0-9]) ]]; then
+	# BSD svnd0 mode: protect sector #1
+	corestartsec=2
+	(( ++coreendsec ))
+	corepatchofs=$((0x614))
+else
+	corestartsec=1
+	corepatchofs=$((0x414))
+fi
+# partition offset: at least coreendsec+1 but aligned on a multiple of secs
+(( partofs = ((coreendsec / secs) + 1) * secs ))
+
+(( quiet )) || print Preparing MBR and GRUB2...
+dd if=/dev/zero of="$T/firsttrack" count=$partofs 2>/dev/null
+echo $corestartsec $coreendsec | mksh "$TOPDIR/scripts/bootgrub.mksh" \
+    -A -g $((cyls-cfgfs)):$heads:$secs -M 1:0x83 -O $partofs | \
+    dd of="$T/firsttrack" conv=notrunc 2>/dev/null
+dd if="$T/core.img" of="$T/firsttrack" conv=notrunc seek=$corestartsec \
+    2>/dev/null
+# set partition where it can find /boot/grub
+print -n '\0\0\0\0' | \
+    dd of="$T/firsttrack" conv=notrunc bs=1 seek=$corepatchofs 2>/dev/null
+
+# create cfgfs partition (mostly taken from bootgrub.mksh)
+set -A thecode
+typeset -Uui8 thecode
+mbrpno=0
+set -A g_code $cyls $heads $secs
+(( psz = g_code[0] * g_code[1] * g_code[2] ))
+(( pofs = (cyls - cfgfs) * g_code[1] * g_code[2] ))
+set -A o_code	# g_code equivalent for partition offset
+(( o_code[2] = pofs % g_code[2] + 1 ))
+(( o_code[1] = pofs / g_code[2] ))
+(( o_code[0] = o_code[1] / g_code[1] + 1 ))
+(( o_code[1] = o_code[1] % g_code[1] + 1 ))
+# boot flag; C/H/S offset
+thecode[mbrpno++]=0x00
+(( thecode[mbrpno++] = o_code[1] - 1 ))
+(( cylno = o_code[0] > 1024 ? 1023 : o_code[0] - 1 ))
+(( thecode[mbrpno++] = o_code[2] | ((cylno & 0x0300) >> 2) ))
+(( thecode[mbrpno++] = cylno & 0x00FF ))
+# partition type; C/H/S end
+(( thecode[mbrpno++] = 0x88 ))
+(( thecode[mbrpno++] = g_code[1] - 1 ))
+(( cylno = g_code[0] > 1024 ? 1023 : g_code[0] - 1 ))
+(( thecode[mbrpno++] = g_code[2] | ((cylno & 0x0300) >> 2) ))
+(( thecode[mbrpno++] = cylno & 0x00FF ))
+# partition offset, size (LBA)
+(( thecode[mbrpno++] = pofs & 0xFF ))
+(( thecode[mbrpno++] = (pofs >> 8) & 0xFF ))
+(( thecode[mbrpno++] = (pofs >> 16) & 0xFF ))
+(( thecode[mbrpno++] = (pofs >> 24) & 0xFF ))
+(( pssz = psz - pofs ))
+(( thecode[mbrpno++] = pssz & 0xFF ))
+(( thecode[mbrpno++] = (pssz >> 8) & 0xFF ))
+(( thecode[mbrpno++] = (pssz >> 16) & 0xFF ))
+(( thecode[mbrpno++] = (pssz >> 24) & 0xFF ))
+# write partition table entry
+ostr=
+curptr=0
+while (( curptr < 16 )); do
+	ostr=$ostr\\0${thecode[curptr++]#8#}
+done
+print -n "$ostr" | \
+    dd of="$T/firsttrack" conv=notrunc bs=1 seek=$((0x1CE)) 2>/dev/null
+
+(( quiet )) || print Writing MBR and GRUB2 to target device...
+dd if="$T/firsttrack" of="$tgt"
+
+if [[ $basedev = /dev/svnd+([0-9]) ]]; then
+	(( quiet )) || print "Creating BSD disklabel on target device..."
+	# c: whole device (must be so)
+	# i: ext2fs (matching first partition)
+	# j: cfgfs (matching second partition)
+	# p: MBR and GRUB2 area (by tradition)
+	cat >"$T/bsdlabel" <<-EOF
+		type: vnd
+		disk: vnd device
+		label: OpenADK
+		flags:
+		bytes/sector: 512
+		sectors/track: $secs
+		tracks/cylinder: $heads
+		sectors/cylinder: $((heads * secs))
+		cylinders: $cyls
+		total sectors: $((cyls * heads * secs))
+		rpm: 3600
+		interleave: 1
+		trackskew: 0
+		cylinderskew: 0
+		headswitch: 0
+		track-to-track seek: 0
+		drivedata: 0
+
+		16 partitions:
+		c: $((cyls * heads * secs)) 0 unused
+		i: $(((cyls - cfgfs) * heads * secs - partofs)) $partofs ext2fs
+		j: $((cfgfs * heads * secs)) $(((cyls - cfgfs) * heads * secs)) unknown
+		p: $partofs 0 unknown
+EOF
+	disklabel -R ${basedev#/dev/} "$T/bsdlabel"
+fi
+
+(( quiet )) || print "Creating ext2fs on ${part}..."
+
+gzip -dc "$src" | (cd "$T"; tar -xvpf -)
+cd "$T"
+rnddev=/dev/urandom
+[[ -c /dev/arandom ]] && rnddev=/dev/arandom
+dd if=$rnddev bs=16 count=1 >>etc/.rnd 2>/dev/null
+(( quiet )) || print Fixing up permissions...
+chown 0:0 tmp
+chmod 1777 tmp
+chmod 4755 bin/busybox
+[[ -f usr/bin/Xorg ]] && chmod 4755 usr/bin/Xorg
+[[ -f usr/bin/sudo ]] && chmod 4755 usr/bin/sudo
+(( quiet )) || print Configuring GRUB2 bootloader...
+mkdir -p boot/grub
+(
+	print set default=0
+	print set timeout=1
+	if (( serial )); then
+		print serial --unit=0 --speed=$speed
+		print terminal_output serial
+		print terminal_input serial
+		consargs="console=ttyS0,$speed console=tty0"
+	else
+		print terminal_output console
+		print terminal_input console
+		consargs="console=tty0"
+	fi
+	print
+	print 'menuentry "GNU/Linux (OpenADK)" {'
+	linuxargs="root=UUID=$partuuid $consargs"
+	(( panicreboot )) && linuxargs="$linuxargs panic=$panicreboot"
+	print "\tlinux /boot/kernel $linuxargs"
+	print '}'
+) >boot/grub/grub.cfg
+set -A grubfiles
+ngrubfiles=0
+for a in usr/lib/grub/*-pc/{*.mod,efiemu??.o,command.lst,moddep.lst,fs.lst,handler.lst,parttool.lst}; do
+	[[ -e $a ]] && grubfiles[ngrubfiles++]=$a
+done
+cp "${grubfiles[@]}" boot/grub/
+
+genext2fs -q -b 524286 -d $T ${tgt}.new
+
+(( quiet )) || print Finishing up...
+dd if=${tgt}.new of=$tgt seek=65536
+
+cd "$TOPDIR"
+
+rm -rf "$T"
+exit 0

+ 1 - 0
toolchain/gcc/Makefile

@@ -101,6 +101,7 @@ $(GCC_BUILD_DIR_MINIMAL)/.configured:
 	ln -sf ${STAGING_TARGET_DIR}/include $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/sys-include
 	rm -rf ${STAGING_HOST_DIR}/$(REAL_GNU_TARGET_NAME)/lib
 	ln -sf ${STAGING_TARGET_DIR}/lib $(STAGING_HOST_DIR)/$(REAL_GNU_TARGET_NAME)/lib
+	sed -i '/k prot/agcc_cv_libc_provides_ssp=yes' $(WRKBUILD)/gcc/configure
 	cd $(GCC_BUILD_DIR_MINIMAL); PATH='$(TARGET_PATH)' \
 		$(WRKBUILD)/configure \
 			${GCC_CONFOPTS} \

+ 15 - 0
toolchain/gcc/patches/4.6.3/siginfo.patch

@@ -0,0 +1,15 @@
+diff -Nur gcc-4.6.3.orig/gcc/config/i386/linux-unwind.h gcc-4.6.3/gcc/config/i386/linux-unwind.h
+--- gcc-4.6.3.orig/gcc/config/i386/linux-unwind.h	2011-01-03 21:52:22.000000000 +0100
++++ gcc-4.6.3/gcc/config/i386/linux-unwind.h	2012-08-02 11:47:11.000000000 +0200
+@@ -133,9 +133,9 @@
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.

+ 2 - 2
toolchain/glibc-ports/Makefile.inc

@@ -2,7 +2,7 @@
 # material, please see the LICENCE file in the top-level directory.
 
 PKG_NAME:=		glibc-ports
-PKG_VERSION:=		2.14.1
+PKG_VERSION:=		2.16.0
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		2aa77ef5dd15df1d1d6dadd4e158ae33
+PKG_MD5SUM:=		20c689888d89f9c11dd7f91b48ca4f69
 PKG_SITES:=		${MASTER_SITE_GNU:=glibc/}

+ 6 - 22
toolchain/glibc-ports/patches/mips.patch

@@ -1,6 +1,6 @@
-diff -Nur glibc-ports-2.11.orig/sysdeps/mips/mips32/Makefile glibc-ports-2.11/sysdeps/mips/mips32/Makefile
---- glibc-ports-2.11.orig/sysdeps/mips/mips32/Makefile	2009-11-15 21:53:20.000000000 +0100
-+++ glibc-ports-2.11/sysdeps/mips/mips32/Makefile	2010-02-25 05:06:53.093359450 +0100
+diff -Nur glibc-ports-2.16.0.orig/sysdeps/mips/mips32/Makefile glibc-ports-2.16.0/sysdeps/mips/mips32/Makefile
+--- glibc-ports-2.16.0.orig/sysdeps/mips/mips32/Makefile	2012-06-21 19:08:19.000000000 +0200
++++ glibc-ports-2.16.0/sysdeps/mips/mips32/Makefile	2012-08-01 17:45:07.000000000 +0200
 @@ -1,3 +1,3 @@
 -ifeq ($(filter -mabi=32,$(CC)),)
 -CC += -mabi=32
@@ -8,25 +8,9 @@ diff -Nur glibc-ports-2.11.orig/sysdeps/mips/mips32/Makefile glibc-ports-2.11/sy
 +#ifeq ($(filter -mabi=32,$(CC)),)
 +#CC += -mabi=32
 +#endif
-diff -Nur glibc-ports-2.11.orig/sysdeps/mips/nptl/tls.h glibc-ports-2.11/sysdeps/mips/nptl/tls.h
---- glibc-ports-2.11.orig/sysdeps/mips/nptl/tls.h	2009-11-15 21:53:20.000000000 +0100
-+++ glibc-ports-2.11/sysdeps/mips/nptl/tls.h	2010-02-25 19:16:31.338162548 +0100
-@@ -55,12 +55,6 @@
- 	.set	pop
- #endif /* __ASSEMBLER__ */
- 
--
--/* We require TLS support in the tools.  */
--#ifndef HAVE_TLS_SUPPORT
--# error "TLS support is required."
--#endif
--
- /* Signal that TLS support is available.  */
- #define USE_TLS	1
- 
-diff -Nur glibc-ports-2.11.orig/sysdeps/mips/preconfigure glibc-ports-2.11/sysdeps/mips/preconfigure
---- glibc-ports-2.11.orig/sysdeps/mips/preconfigure	2009-11-15 21:53:20.000000000 +0100
-+++ glibc-ports-2.11/sysdeps/mips/preconfigure	2010-02-25 05:07:40.565358364 +0100
+diff -Nur glibc-ports-2.16.0.orig/sysdeps/mips/preconfigure glibc-ports-2.16.0/sysdeps/mips/preconfigure
+--- glibc-ports-2.16.0.orig/sysdeps/mips/preconfigure	2012-06-21 19:08:19.000000000 +0200
++++ glibc-ports-2.16.0/sysdeps/mips/preconfigure	2012-08-01 17:45:07.000000000 +0200
 @@ -19,11 +19,6 @@
  		32) machine=mips/mips32/kern64 ;;
  		esac

+ 1 - 1
toolchain/glibc/Makefile

@@ -23,7 +23,7 @@ endif
 
 GLIBC_MAKEOPTS+=	cross-compiling=yes
 ifeq (${ADK_MAKE_PARALLEL},y)
-GLIBC_MAKEOPTS+=	PARALLELMFLAGS="-j${ADK_MAKE_JOBS}"
+GLIBC_MAKEOPTS+=	PARALLELMFLAGS="-j1"
 endif
 
 GLIBC_BUILD_DIR_INITIAL:=	${WRKDIR}/$(PKG_NAME)-$(PKG_VERSION)-headers

+ 2 - 2
toolchain/glibc/Makefile.inc

@@ -2,9 +2,9 @@
 # material, please see the LICENCE file in the top-level directory.
 
 PKG_NAME:=		glibc
-PKG_VERSION:=		2.14.1
+PKG_VERSION:=		2.16.0
 PKG_RELEASE:=		1
-PKG_MD5SUM:=		f3841fd7812db4713115ff4447b29207
+PKG_MD5SUM:=		b5f786fa7df4ff947bcd240c0e595f98
 PKG_SITES:=		${MASTER_SITE_GNU:=glibc/}
 GLIBC_CONFOPTS:=	--build=$(GNU_HOST_NAME) \
 			--host=$(REAL_GNU_TARGET_NAME) \

+ 8 - 11
toolchain/glibc/patches/gcc_eh.patch

@@ -1,18 +1,15 @@
-diff -Nur glibc-2.10.1.orig/Makeconfig glibc-2.10.1/Makeconfig
---- glibc-2.10.1.orig/Makeconfig	2009-08-20 08:51:54.000000000 +0200
-+++ glibc-2.10.1/Makeconfig	2009-08-21 01:53:59.000000000 +0200
-@@ -525,12 +525,12 @@
-   libunwind = -lunwind
- endif
- ifneq ($(have-as-needed),yes)
-- libgcc_eh := -lgcc_eh $(libunwind)
-+ libgcc_eh := $(libunwind)
+diff -Nur glibc-2.16.0.orig/Makeconfig glibc-2.16.0/Makeconfig
+--- glibc-2.16.0.orig/Makeconfig	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/Makeconfig	2012-08-02 10:18:56.000000000 +0200
+@@ -521,9 +521,9 @@
  else
-  libgcc_eh := -Wl,--as-needed -lgcc_s$(libgcc_s_suffix) $(libunwind) -Wl,--no-as-needed
+   libunwind = -lunwind
  endif
+-libgcc_eh := -Wl,--as-needed -lgcc_s $(libunwind) -Wl,--no-as-needed
++libgcc_eh := -Wl,--as-needed $(libunwind) -Wl,--no-as-needed
  gnulib := -lgcc $(libgcc_eh)
 -static-gnulib := -lgcc -lgcc_eh $(libunwind)
 +static-gnulib := -lgcc $(libunwind)
  libc.so-gnulib := -lgcc
  endif
- ifeq ($(elf),yes)
+ +preinit = $(addprefix $(csu-objpfx),crti.o)

+ 0 - 14
toolchain/glibc/patches/getpagesize.patch

@@ -1,14 +0,0 @@
-	This patch is needed at least on kirkwood. Otherwise DNS-lookups will fail, since
-	GLRO(dl_pagesize) is zero. Solution taken from this resource:
-	http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg228455.html
---- glibc-2.12.1/sysdeps/unix/sysv/linux/getpagesize.c.orig	2011-02-28 03:41:47.870001678 +0100
-+++ glibc-2.12.1/sysdeps/unix/sysv/linux/getpagesize.c	2011-02-28 03:42:16.712993932 +0100
-@@ -28,7 +28,7 @@
- int
- __getpagesize ()
- {
--#ifdef __ASSUME_AT_PAGESIZE
-+#if 0
-   assert (GLRO(dl_pagesize) != 0);
-   return GLRO(dl_pagesize);
- #else

+ 99 - 0
toolchain/glibc/patches/glibc-cross.patch

@@ -0,0 +1,99 @@
+diff -Nur glibc-2.16.0.orig/sunrpc/rpc/types.h glibc-2.16.0/sunrpc/rpc/types.h
+--- glibc-2.16.0.orig/sunrpc/rpc/types.h	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/rpc/types.h	2012-08-01 18:05:49.000000000 +0200
+@@ -69,19 +69,25 @@
+ #include <sys/types.h>
+ #endif
+ 
+-#ifndef __u_char_defined
+-typedef __u_char u_char;
+-typedef __u_short u_short;
+-typedef __u_int u_int;
+-typedef __u_long u_long;
+-typedef __quad_t quad_t;
+-typedef __u_quad_t u_quad_t;
+-typedef __fsid_t fsid_t;
+-# define __u_char_defined
++typedef unsigned char u_char;
++typedef unsigned short u_short;
++typedef unsigned int u_int;
++typedef unsigned long u_long;
++#if __WORDSIZE == 64
++typedef long int quad_t;
++typedef unsigned long int u_quad_t;
++#elif defined __GLIBC_HAVE_LONG_LONG
++typedef long long int quad_t;
++typedef unsigned long long int u_quad_t;
++#endif
++#if defined(_CROSS_RPCGEN_)
++typedef u_quad_t fsid_t;
+ #endif
+-#ifndef __daddr_t_defined
+-typedef __daddr_t daddr_t;
+-typedef __caddr_t caddr_t;
++
++# define __u_char_defined
++#if !defined(__daddr_t_defined) && defined(linux)
++typedef long int daddr_t;
++typedef char *caddr_t;
+ # define __daddr_t_defined
+ #endif
+ 
+diff -Nur glibc-2.16.0.orig/sunrpc/rpc_clntout.c glibc-2.16.0/sunrpc/rpc_clntout.c
+--- glibc-2.16.0.orig/sunrpc/rpc_clntout.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/rpc_clntout.c	2012-08-01 18:05:49.000000000 +0200
+@@ -31,7 +31,7 @@
+  */
+ #include <stdio.h>
+ #include <string.h>
+-#include <rpc/types.h>
++#include "rpc/types.h"
+ #include "rpc_parse.h"
+ #include "rpc_util.h"
+ #include "proto.h"
+diff -Nur glibc-2.16.0.orig/sunrpc/rpc_main.c glibc-2.16.0/sunrpc/rpc_main.c
+--- glibc-2.16.0.orig/sunrpc/rpc_main.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/rpc_main.c	2012-08-01 18:05:49.000000000 +0200
+@@ -38,7 +38,11 @@
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
++#ifdef _CROSS_RPCGEN_
++#define gettext(X) (X)
++#else
+ #include <libintl.h>
++#endif
+ #include <ctype.h>
+ #include <sys/types.h>
+ #include <sys/param.h>
+@@ -958,10 +962,12 @@
+ 	abort ();
+       temp = rindex (cmd->infile, '.');
+       cp = stpcpy (mkfilename, "Makefile.");
+-      if (temp != NULL)
+-	*((char *) stpncpy (cp, cmd->infile, temp - cmd->infile)) = '\0';
+-      else
++      if (temp != NULL) {
++	strncpy (cp, cmd->infile, temp - cmd->infile);
++	cp[temp - cmd->infile - 1] = '\0';
++      } else {
+ 	stpcpy (cp, cmd->infile);
++      }
+ 
+     }
+   else
+diff -Nur glibc-2.16.0.orig/sunrpc/rpc_scan.c glibc-2.16.0/sunrpc/rpc_scan.c
+--- glibc-2.16.0.orig/sunrpc/rpc_scan.c	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sunrpc/rpc_scan.c	2012-08-01 18:05:49.000000000 +0200
+@@ -37,7 +37,11 @@
+ #include <stdio.h>
+ #include <ctype.h>
+ #include <string.h>
++#ifdef _CROSS_RPCGEN_
++#define gettext(X) (X)
++#else
+ #include <libintl.h>
++#endif
+ #include "rpc_scan.h"
+ #include "rpc_parse.h"
+ #include "rpc_util.h"

+ 4 - 19
toolchain/glibc/patches/i686_define_bug.patch

@@ -7,25 +7,10 @@
 	http://bugs.gentoo.org/show_bug.cgi?id=201815. There are lots of duplicates to it, many people are
 	affected, one can find really elaborate reports. And the responsible gentoo developers are too
 	elite to even point to the actual patch fixing the issue.
-diff -Naur glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c
---- glibc-2.11.1-orig/nptl/sysdeps/pthread/pt-initfini.c	2009-12-08 20:10:20.000000000 +0000
-+++ glibc-2.11.1/nptl/sysdeps/pthread/pt-initfini.c	2010-04-17 02:24:02.000000000 +0100
-@@ -45,6 +45,11 @@
- /* Embed an #include to pull in the alignment and .end directives. */
- asm ("\n#include \"defs.h\"");
- 
-+asm ("\n#if defined __i686 && defined __ASSEMBLER__");
-+asm ("\n#undef __i686");
-+asm ("\n#define __i686 __i686");
-+asm ("\n#endif");
-+
- /* The initial common code ends here. */
- asm ("\n/*@HEADER_ENDS*/");
- 
-diff -Naur glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h
---- glibc-2.11.1-orig/sysdeps/unix/sysv/linux/i386/sysdep.h	2009-12-08 20:10:20.000000000 +0000
-+++ glibc-2.11.1/sysdeps/unix/sysv/linux/i386/sysdep.h	2010-04-17 02:24:02.000000000 +0100
-@@ -29,6 +29,10 @@
+diff -Nur glibc-2.16.0.orig/sysdeps/unix/sysv/linux/i386/sysdep.h glibc-2.16.0/sysdeps/unix/sysv/linux/i386/sysdep.h
+--- glibc-2.16.0.orig/sysdeps/unix/sysv/linux/i386/sysdep.h	2012-06-30 21:12:34.000000000 +0200
++++ glibc-2.16.0/sysdeps/unix/sysv/linux/i386/sysdep.h	2012-08-01 17:56:05.000000000 +0200
+@@ -28,6 +28,10 @@
  #include <dl-sysdep.h>
  #include <tls.h>
  

+ 0 - 31
toolchain/glibc/patches/stdio_lim.patch

@@ -1,31 +0,0 @@
-diff -Nur glibc-2.11.orig/stdio-common/Makefile glibc-2.11/stdio-common/Makefile
---- glibc-2.11.orig/stdio-common/Makefile	2009-10-30 18:17:08.000000000 +0100
-+++ glibc-2.11/stdio-common/Makefile	2009-12-30 23:52:08.000000000 +0100
-@@ -21,7 +21,7 @@
- #
- subdir	:= stdio-common
- 
--headers	:= stdio_ext.h printf.h bits/printf-ldbl.h
-+headers	:= stdio_ext.h printf.h bits/printf-ldbl.h bits/stdio_lim.h
- 
- routines	:=							      \
- 	ctermid cuserid							      \
-@@ -40,8 +40,6 @@
- 	isoc99_vsscanf							      \
- 	psiginfo
- 
--install-others = $(inst_includedir)/bits/stdio_lim.h
--
- include ../Makeconfig
- 
- aux	:= errlist siglist printf-parsemb printf-parsewc fxprintf
-@@ -66,9 +64,6 @@
- 
- include ../Rules
- 
--$(inst_includedir)/bits/stdio_lim.h: $(common-objpfx)bits/stdio_lim.h $(+force)
--	$(do-install)
--
- ifeq ($(cross-compiling),no)
- .PHONY: do-tst-unbputc do-tst-printf
- tests: do-tst-unbputc do-tst-printf

+ 60 - 0
toolchain/glibc/patches/timezone.patch

@@ -0,0 +1,60 @@
+--- toolchain_build_i686_eglibc/w-eglibc-2.16-1/eglibc-2.16/libc/timezone/Makefile	2012-07-31 08:58:48.000000000 +0200
++++ toolchain_build_i686_glibc/w-glibc-2.16.0-1/glibc-2.16.0/timezone/Makefile	2012-06-30 21:12:34.000000000 +0200
+@@ -52,16 +52,7 @@
+ include ../Rules
+ 
+ 
+-zic-objs = zic.o ialloc.o scheck.o
+-
+-$(objpfx)zic: $(addprefix $(objpfx), $(zic-objs))
+-
+-$(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
+-	$(BUILD_CC) $< -c $(OUTPUT_OPTION) $(CFLAGS-$*.c) $(CPPFLAGS-$*) \
+-		-DCROSS_ZIC $(compile-mkdep-flags)
+-
+-$(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
+-	$(BUILD_CC) $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@
++$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
+ 
+ tz-cflags = -DTZDIR='"$(zonedir)"' \
+ 	    -DTZDEFAULT='"$(localtime-file)"' \
+@@ -78,17 +69,10 @@
+ # Don't add leapseconds here since test-tz made checks that work only without
+ # leapseconds.
+ testdata = $(objpfx)testdata
+-ifeq (no,$(cross-compiling))
+ define build-testdata
+ GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
+   $(built-program-cmd) -d $(testdata) -y ./yearistype $<
+ endef
+-else
+-define build-testdata
+-LANGUAGE=C LC_ALL=C \
+-  $(objpfx)cross-zic -d $(testdata) -y ./yearistype $<
+-endef
+-endif
+ 
+ $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
+ $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
+@@ -101,11 +85,7 @@
+ tst-timezone-ENV = TZDIR=$(testdata)
+ 
+ # Note this must come second in the deps list for $(built-program-cmd) to work.
+-ifeq (no,$(cross-compiling))
+ zic-deps = $(objpfx)zic $(leapseconds) yearistype
+-else
+-zic-deps = $(objpfx)cross-zic $(objpfx)zic $(leapseconds) yearistype
+-endif
+ 
+ $(testdata)/America/New_York: northamerica $(zic-deps)
+ 	$(build-testdata)
+@@ -127,8 +107,6 @@
+ 
+ $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
+ 	sed -e 's%@KSH@%$(KSH)%g' \
+-	    -e 's%@TZDIR@%$(zonedir)%g' \
+-	    -e 's%@PKGVERSION@%$(PKGVERSION)%g' \
+-	    -e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g' < $< > $@.new
++	    -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
+ 	chmod 555 $@.new
+ 	mv -f $@.new $@

+ 0 - 135
toolchain/glibc/patches/tz.patch

@@ -1,135 +0,0 @@
---- glibc-2.12.1/timezone/Makefile	2010-07-27 13:34:39.000000000 +0200
-+++ glibc-2.12.1.orig/timezone/Makefile	2011-01-10 15:20:02.576150764 +0100
-@@ -69,13 +69,10 @@
- 					 $(addprefix $(inst_zonedir)/, \
- 						     $(posixrules-file)))
- 
--ifeq ($(cross-compiling),no)
--# Don't try to install the zoneinfo files since we can't run zic.
- install-others = $(addprefix $(inst_zonedir)/,$(zonenames) \
- 					      $(zonenames:%=posix/%) \
- 					      $(zonenames:%=right/%)) \
- 		 $(installed-localtime-file) $(installed-posixrules-file)
--endif
- 
- ifeq ($(have-ksh),yes)
- install-others += $(inst_zonedir)/iso3166.tab $(inst_zonedir)/zone.tab
-@@ -106,18 +103,35 @@
- 	   echo '$$(addprefix $$(inst_zonedir)/,$$($*-zones)): \'	    ;\
- 	   echo '$$(foreach t,$$(tzbases),$$(addprefix $$(inst_zonedir)/,$$($$t-zones)))' ;\
- 	 fi								    ;\
--	 echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/right/,$$($*-zones)): \' ;\
--	 echo '$< $$(objpfx)zic leapseconds yearistype'			    ;\
--	 echo '	$$(tzcompile)'						    ;\
--	 echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/posix/,$$($*-zones)): \' ;\
--	 echo '$< $$(objpfx)zic /dev/null yearistype'			    ;\
--	 echo '	$$(tzcompile)'						    ;\
--	 echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/,$$($*-zones)): \' ;\
--	 echo '$< $$(objpfx)zic $$(leapseconds) yearistype'		    ;\
--	 echo '	$$(tzcompile)'						    ;\
-+	 echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/right/,$$($*-zones)): \' ;) > $@.new
-+
-+ifeq (no,$(cross-compiling))
-+	(echo '$< $$(objpfx)zic leapseconds yearistype'			    ;) >> $@.new
-+else
-+	(echo '$< $$(objpfx)cross-zic leapseconds yearistype'		    ;) >> $@.new
-+endif
-+
-+	(echo '	$$(tzcompile)'						    ;\
-+	 echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/posix/,$$($*-zones)): \' ;) >> $@.new
-+
-+ifeq (no,$(cross-compiling))
-+	(echo '$< $$(objpfx)zic /dev/null yearistype'			    ;) >> $@.new
-+else
-+	(echo '$< $$(objpfx)cross-zic /dev/null yearistype'		    ;) >> $@.new
-+endif
-+
-+	(echo '	$$(tzcompile)'						    ;\
-+	 echo '$$(addprefix $$(dir $$(inst_zonedir))zone%/,$$($*-zones)): \' ;) >> $@.new
-+
-+ifeq (no,$(cross-compiling))
-+	(echo '$< $$(objpfx)zic $$(leapseconds) yearistype'		    ;) >> $@.new
-+else
-+	(echo '$< $$(objpfx)cross-zic $$(leapseconds) yearistype'	    ;) >> $@.new
-+endif
-+
-+	(echo '	$$(tzcompile)'						    ;\
- 	 echo 'endif'							    ;\
--	 echo 'zonenames := $$(zonenames) $$($*-zones)'			    ;\
--	) > $@.new
-+	 echo 'zonenames := $$(zonenames) $$($*-zones)'			    ;) >> $@.new
- 	mv $@.new $@
- 
- .PHONY: echo-zonenames
-@@ -128,7 +142,11 @@
- # We have to use `-d $(inst_zonedir)' to explictly tell zic where to
- # place the output files although $(zonedir) is compiled in.  But the
- # user might have set $(install_root) on the command line of `make install'.
-+ifeq (no,$(cross-compiling))
- zic-cmd = $(built-program-cmd) -d $(inst_zonedir)
-+else
-+zic-cmd = $(objpfx)cross-zic -d $(inst_zonedir)
-+endif
- tzcompile = $(zic-cmd)$(target-zone-flavor) -L $(word 3,$^) \
- 	    -y $(dir $(word 4,$^))$(notdir $(word 4,$^)) $<
- 
-@@ -158,8 +176,17 @@
- 	$(zic-cmd) -p $(posixrules)
- endif
- 
-+zic-objs = zic.o ialloc.o scheck.o
-+
-+$(objpfx)zic: $(addprefix $(objpfx), $(zic-objs))
-+
-+$(addprefix $(objpfx)cross-,$(zic-objs)): $(objpfx)cross-%.o: %.c
-+	gcc $< -c $(OUTPUT_OPTION) \
-+		$(filter-out -DHAVE_GETTEXT,$(CFLAGS-$*.c)) \
-+		$(CPPFLAGS-$*) -DCROSS_ZIC $(compile-mkdep-flags)
- 
--$(objpfx)zic: $(objpfx)scheck.o $(objpfx)ialloc.o
-+$(objpfx)cross-zic: $(addprefix $(objpfx)cross-,$(zic-objs))
-+	gcc $(addprefix $(objpfx)cross-,$(zic-objs)) -o $@
- 
- tz-cflags = -DTZDIR='"$(zonedir)"' \
- 	    -DTZDEFAULT='"$(localtime-file)"' \
-@@ -176,10 +203,17 @@
- # Don't add leapseconds here since test-tz made checks that work only without
- # leapseconds.
- testdata = $(objpfx)testdata
-+ifeq (no,$(cross-compiling))
- define build-testdata
- GCONV_PATH=${common-objpfx}iconvdata LANGUAGE=C LC_ALL=C \
-   $(built-program-cmd) -d $(testdata) -y ./yearistype $<
- endef
-+else
-+define build-testdata
-+LANGUAGE=C LC_ALL=C \
-+  $(objpfx)cross-zic -d $(testdata) -y ./yearistype $<
-+endef
-+endif
- 
- $(objpfx)test-tz.out: $(addprefix $(testdata)/, America/New_York Etc/UTC UTC)
- $(objpfx)tst-timezone.out: $(addprefix $(testdata)/, \
-@@ -192,7 +226,11 @@
- tst-timezone-ENV = TZDIR=$(testdata)
- 
- # Note this must come second in the deps list for $(built-program-cmd) to work.
-+ifeq (no,$(cross-compiling))
- zic-deps = $(objpfx)zic $(leapseconds) yearistype
-+else
-+zic-deps = $(objpfx)cross-zic $(objpfx)zic $(leapseconds) yearistype
-+endif
- 
- $(testdata)/America/New_York: northamerica $(zic-deps)
- 	$(build-testdata)
-@@ -214,7 +252,9 @@
- 
- $(objpfx)tzselect: tzselect.ksh $(common-objpfx)config.make
- 	sed -e 's%@KSH@%$(KSH)%g' \
--	    -e 's%@TZDIR@%$(zonedir)%g' < $< > $@.new
-+	    -e 's%@TZDIR@%$(zonedir)%g' \
-+	    -e 's%@PKGVERSION@%$(PKGVERSION)%g' \
-+	    -e 's%@REPORT_BUGS_TO@%$(REPORT_BUGS_TO)%g' < $< > $@.new
- 	chmod 555 $@.new
- 	mv -f $@.new $@
-