summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorriastradh <riastradh@pkgsrc.org>2013-05-10 01:17:32 +0000
committerriastradh <riastradh@pkgsrc.org>2013-05-10 01:17:32 +0000
commit4bf5b7955a9b8e89daf364269466322cb55a6bf4 (patch)
tree41a075f50e5aff1523975e90cafa177c7fbc7685
parent49f8085bdc74f889b045bc5ffb8f65b2130709b2 (diff)
downloadpkgsrc-4bf5b7955a9b8e89daf364269466322cb55a6bf4.tar.gz
Fix zsh cross-build on NetBSD.
Patch it up to use compile-tests rather than run-tests in autoconf for many of its tests (OS-independently). Teach it about the few remaining properties for NetBSD in particular. ok agc
-rw-r--r--shells/zsh/Makefile4
-rw-r--r--shells/zsh/Makefile.common10
-rw-r--r--shells/zsh/distinfo6
-rw-r--r--shells/zsh/patches/patch-ac164
-rw-r--r--shells/zsh/patches/patch-aczsh.m429
-rw-r--r--shells/zsh/patches/patch-configure.ac98
6 files changed, 302 insertions, 9 deletions
diff --git a/shells/zsh/Makefile b/shells/zsh/Makefile
index 7a2597bb86c..53944998c36 100644
--- a/shells/zsh/Makefile
+++ b/shells/zsh/Makefile
@@ -1,7 +1,9 @@
-# $NetBSD: Makefile,v 1.62 2013/04/06 21:07:35 rodent Exp $
+# $NetBSD: Makefile,v 1.63 2013/05/10 01:17:32 riastradh Exp $
.include "../../shells/zsh/Makefile.common"
+PKGREVISION= 1
+
ZSH_VERSION= 5.0.2
ZSH_MAINTAINER= uebayasi@NetBSD.org
diff --git a/shells/zsh/Makefile.common b/shells/zsh/Makefile.common
index d7ad1b044c9..91b38e46d5d 100644
--- a/shells/zsh/Makefile.common
+++ b/shells/zsh/Makefile.common
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.70 2013/03/28 22:26:13 jperkin Exp $
+# $NetBSD: Makefile.common,v 1.71 2013/05/10 01:17:33 riastradh Exp $
# used by shells/zsh/Makefile
# used by shells/zsh-current/Makefile
@@ -31,6 +31,14 @@ PKG_INSTALLATION_TYPES= overwrite pkgviews
INSTALL_UNSTRIPPED= yes
.endif
+.if !empty(USE_CROSS_COMPILE:M[yY][eE][sS]) && ${OPSYS} == "NetBSD"
+# These can't be detected automagically in cross-builds.
+CONFIGURE_ENV+= zsh_cv_shared_environ=yes
+CONFIGURE_ENV+= zsh_cv_shared_tgetent=yes
+CONFIGURE_ENV+= zsh_cv_shared_tigetstr=yes
+CONFIGURE_ENV+= zsh_cv_sys_dynamic_execsyms=yes
+.endif
+
PLIST_VARS+= xattr
.if exists(/usr/include/sys/xattr.h)
PLIST.xattr= yes
diff --git a/shells/zsh/distinfo b/shells/zsh/distinfo
index ff60b7aaddb..421c35452c3 100644
--- a/shells/zsh/distinfo
+++ b/shells/zsh/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.42 2013/02/22 13:40:30 jperkin Exp $
+$NetBSD: distinfo,v 1.43 2013/05/10 01:17:33 riastradh Exp $
SHA1 (zsh-5.0.2.tar.bz2) = 9f55ecaaae7cdc1495f91237ba2ec087777a4ad9
RMD160 (zsh-5.0.2.tar.bz2) = eea2328a28e9f022ab9f49583622a9c3bd6114a7
Size (zsh-5.0.2.tar.bz2) = 3025767 bytes
-SHA1 (patch-ac) = dab5b2181f9a09d31cd20ef8e4b175401f323dc9
+SHA1 (patch-ac) = f83e5f38c262c779f32e0368815ce02308bc3fff
+SHA1 (patch-aczsh.m4) = 36c270d8d7cf727f48787ef889b2bd89cbf065e2
+SHA1 (patch-configure.ac) = a8bcb291482fb1eead071439597662f07020e554
diff --git a/shells/zsh/patches/patch-ac b/shells/zsh/patches/patch-ac
index 03b6c9fc3e1..7ccfb2c9d87 100644
--- a/shells/zsh/patches/patch-ac
+++ b/shells/zsh/patches/patch-ac
@@ -1,17 +1,23 @@
-$NetBSD: patch-ac,v 1.28 2013/02/22 13:40:30 jperkin Exp $
+$NetBSD: patch-ac,v 1.29 2013/05/10 01:17:33 riastradh Exp $
First chunk:
Add support for thread limits.
From Peter Stephenson <Peter.Stephenson@csr.com> on zsh-workers.
+Accepted by Peter Stephenson <p.w.stephenson@ntlworld.com> on
+zsh-workers on 2012-08-16.
+
+Middle chunks:
+Use a compile test, not a run test, for whether various rlimit values
+are equivalent. A compile test is sufficient because zsh uses these
+values in switch cases, so they must be compile-time, if not
+preprocessor-time, constants.
-All other chunks:
+Last chunk:
Make this package build on Interix. Patches provided by Hiramatsu
Yoshifumi in PR pkg/25946.
Last chunk only:
Don't force -Wl,--whole-archive for NetBSD, it breaks the build with
clang, which doesn't have a reason to disable it again.
-
-All chunks:
Accepted by Peter Stephenson <p.w.stephenson@ntlworld.com> on
zsh-workers on 2012-08-16.
@@ -60,7 +66,155 @@ zsh-workers on 2012-08-16.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NOFILE" >&5
$as_echo_n "checking for limit RLIMIT_NOFILE... " >&6; }
if ${zsh_cv_have_RLIMIT_NOFILE+:} false; then :
-@@ -11630,6 +11666,10 @@ $as_echo "$zsh_cv_sys_elf" >&6; }
+@@ -10011,9 +10047,6 @@ $as_echo_n "checking if RLIMIT_VMEM and
+ if ${zsh_cv_rlimit_vmem_is_rss+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+- if test "$cross_compiling" = yes; then :
+- zsh_cv_rlimit_vmem_is_rss=no
+-else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -10022,43 +10055,33 @@ else
+ #include <sys/time.h>
+ #endif
+ #include <sys/resource.h>
+-int main()
++int
++main ()
+ {
+-int ret = 1;
+-#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_RSS)
+-if (RLIMIT_RSS == RLIMIT_VMEM) ret = 0;
+-#endif
+-return ret;
++static char x[(RLIMIT_VMEM == RLIMIT_RSS)? 1 : -1]
++ ;
++ return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
++if ac_fn_c_try_compile "$LINENO"; then :
+ zsh_cv_rlimit_vmem_is_rss=yes
+ else
+ zsh_cv_rlimit_vmem_is_rss=no
+ fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+- conftest.$ac_objext conftest.beam conftest.$ac_ext
+-fi
+-
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_vmem_is_rss" >&5
+ $as_echo "$zsh_cv_rlimit_vmem_is_rss" >&6; }
+-
+ if test x$zsh_cv_rlimit_vmem_is_rss = xyes; then
+ $as_echo "#define RLIMIT_VMEM_IS_RSS 1" >>confdefs.h
+
+ fi
+
+-
+-
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_VMEM and RLIMIT_AS are the same" >&5
+ $as_echo_n "checking if RLIMIT_VMEM and RLIMIT_AS are the same... " >&6; }
+ if ${zsh_cv_rlimit_vmem_is_as+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+- if test "$cross_compiling" = yes; then :
+- zsh_cv_rlimit_vmem_is_as=no
+-else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -10067,43 +10090,33 @@ else
+ #include <sys/time.h>
+ #endif
+ #include <sys/resource.h>
+-int main()
++int
++main ()
+ {
+-int ret = 1;
+-#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_AS)
+-if (RLIMIT_AS == RLIMIT_VMEM) ret = 0;
+-#endif
+-return ret;
++static char x[(RLIMIT_VMEM == RLIMIT_AS)? 1 : -1]
++ ;
++ return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
++if ac_fn_c_try_compile "$LINENO"; then :
+ zsh_cv_rlimit_vmem_is_as=yes
+ else
+ zsh_cv_rlimit_vmem_is_as=no
+ fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+- conftest.$ac_objext conftest.beam conftest.$ac_ext
+-fi
+-
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_vmem_is_as" >&5
+ $as_echo "$zsh_cv_rlimit_vmem_is_as" >&6; }
+-
+ if test x$zsh_cv_rlimit_vmem_is_as = xyes; then
+ $as_echo "#define RLIMIT_VMEM_IS_AS 1" >>confdefs.h
+
+ fi
+
+-
+-
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking if RLIMIT_RSS and RLIMIT_AS are the same" >&5
+ $as_echo_n "checking if RLIMIT_RSS and RLIMIT_AS are the same... " >&6; }
+ if ${zsh_cv_rlimit_rss_is_as+:} false; then :
+ $as_echo_n "(cached) " >&6
+ else
+- if test "$cross_compiling" = yes; then :
+- zsh_cv_rlimit_rss_is_as=no
+-else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h. */
+
+@@ -10112,28 +10125,23 @@ else
+ #include <sys/time.h>
+ #endif
+ #include <sys/resource.h>
+-int main()
++int
++main ()
+ {
+-int ret = 1;
+-#if defined(HAVE_RLIMIT_RSS) && defined(HAVE_RLIMIT_AS)
+-if (RLIMIT_AS == RLIMIT_RSS) ret = 0;
+-#endif
+-return ret;
++static char x[(RLIMIT_RSS == RLIMIT_AS)? 1 : -1]
++ ;
++ return 0;
+ }
+ _ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
++if ac_fn_c_try_compile "$LINENO"; then :
+ zsh_cv_rlimit_rss_is_as=yes
+ else
+ zsh_cv_rlimit_rss_is_as=no
+ fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+- conftest.$ac_objext conftest.beam conftest.$ac_ext
+-fi
+-
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_rlimit_rss_is_as" >&5
+ $as_echo "$zsh_cv_rlimit_rss_is_as" >&6; }
+-
+ if test x$zsh_cv_rlimit_rss_is_as = xyes; then
+ $as_echo "#define RLIMIT_RSS_IS_AS 1" >>confdefs.h
+
+@@ -11630,6 +11638,10 @@ $as_echo "$zsh_cv_sys_elf" >&6; }
DLLD="${DLLD=$CC}"
DLLDARG=""
;;
diff --git a/shells/zsh/patches/patch-aczsh.m4 b/shells/zsh/patches/patch-aczsh.m4
new file mode 100644
index 00000000000..da42b47bca9
--- /dev/null
+++ b/shells/zsh/patches/patch-aczsh.m4
@@ -0,0 +1,29 @@
+$NetBSD: patch-aczsh.m4,v 1.1 2013/05/10 01:17:33 riastradh Exp $
+
+Add a utility for compile tests to compare rlimit keys.
+
+--- aczsh.m4.orig 2009-05-16 12:08:44.000000000 +0000
++++ aczsh.m4
+@@ -688,3 +688,22 @@ if test $zsh_cv_have_$1 = yes; then
+ AC_DEFINE(HAVE_$1)
+ fi])
+
++dnl Check whether rlimit $1, e.g. AS, is the same as rlmit $3, e.g. VMEM.
++dnl $2 is lowercase $1, $4 is lowercase $3.
++AC_DEFUN(zsh_LIMITS_EQUAL,
++[AH_TEMPLATE([RLIMIT_]$1[_IS_]$3,
++[Define to 1 if RLIMIT_]$1[ and RLIMIT_]$3[ both exist and are equal.])
++AC_CACHE_CHECK([if RLIMIT_]$1[ and RLIMIT_]$3[ are the same],
++zsh_cv_rlimit_$2_is_$4,
++[AC_TRY_COMPILE([
++#include <sys/types.h>
++#ifdef HAVE_SYS_TIME_H
++#include <sys/time.h>
++#endif
++#include <sys/resource.h>],
++[static char x[(RLIMIT_$1 == RLIMIT_$3)? 1 : -1]],
++ zsh_cv_rlimit_$2_is_$4=yes,
++ zsh_cv_rlimit_$2_is_$4=no)])
++if test x$zsh_cv_rlimit_$2_is_$4 = xyes; then
++ AC_DEFINE(RLIMIT_$1_IS_$3)
++fi])
diff --git a/shells/zsh/patches/patch-configure.ac b/shells/zsh/patches/patch-configure.ac
new file mode 100644
index 00000000000..cf8db3f0688
--- /dev/null
+++ b/shells/zsh/patches/patch-configure.ac
@@ -0,0 +1,98 @@
+$NetBSD: patch-configure.ac,v 1.3 2013/05/10 01:17:33 riastradh Exp $
+
+Use a compile test, not a run test, for whether various rlimit values
+are equivalent. A compile test is sufficient because zsh uses these
+values in switch cases, so they must be compile-time, if not
+preprocessor-time, constants.
+
+--- configure.ac.orig 2012-09-09 18:26:47.000000000 +0000
++++ configure.ac
+@@ -1812,85 +1812,9 @@ zsh_LIMIT_PRESENT(RLIMIT_MSGQUEUE)
+ zsh_LIMIT_PRESENT(RLIMIT_NICE)
+ zsh_LIMIT_PRESENT(RLIMIT_RTPRIO)
+
+-AH_TEMPLATE([RLIMIT_VMEM_IS_RSS],
+-[Define to 1 if RLIMIT_VMEM and RLIMIT_RSS both exist and are equal.])
+-AC_CACHE_CHECK(if RLIMIT_VMEM and RLIMIT_RSS are the same,
+-zsh_cv_rlimit_vmem_is_rss,
+-[AC_TRY_RUN([
+-#include <sys/types.h>
+-#ifdef HAVE_SYS_TIME_H
+-#include <sys/time.h>
+-#endif
+-#include <sys/resource.h>
+-int main()
+-{
+-int ret = 1;
+-#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_RSS)
+-if (RLIMIT_RSS == RLIMIT_VMEM) ret = 0;
+-#endif
+-return ret;
+-}],
+- zsh_cv_rlimit_vmem_is_rss=yes,
+- zsh_cv_rlimit_vmem_is_rss=no,
+- zsh_cv_rlimit_vmem_is_rss=no)])
+-
+-if test x$zsh_cv_rlimit_vmem_is_rss = xyes; then
+- AC_DEFINE(RLIMIT_VMEM_IS_RSS)
+-fi
+-
+-
+-AH_TEMPLATE([RLIMIT_VMEM_IS_AS],
+-[Define to 1 if RLIMIT_VMEM and RLIMIT_AS both exist and are equal.])
+-AC_CACHE_CHECK(if RLIMIT_VMEM and RLIMIT_AS are the same,
+-zsh_cv_rlimit_vmem_is_as,
+-[AC_TRY_RUN([
+-#include <sys/types.h>
+-#ifdef HAVE_SYS_TIME_H
+-#include <sys/time.h>
+-#endif
+-#include <sys/resource.h>
+-int main()
+-{
+-int ret = 1;
+-#if defined(HAVE_RLIMIT_VMEM) && defined(HAVE_RLIMIT_AS)
+-if (RLIMIT_AS == RLIMIT_VMEM) ret = 0;
+-#endif
+-return ret;
+-}],
+- zsh_cv_rlimit_vmem_is_as=yes,
+- zsh_cv_rlimit_vmem_is_as=no,
+- zsh_cv_rlimit_vmem_is_as=no)])
+-
+-if test x$zsh_cv_rlimit_vmem_is_as = xyes; then
+- AC_DEFINE(RLIMIT_VMEM_IS_AS)
+-fi
+-
+-
+-AH_TEMPLATE([RLIMIT_RSS_IS_AS],
+-[Define to 1 if RLIMIT_RSS and RLIMIT_AS both exist and are equal.])
+-AC_CACHE_CHECK(if RLIMIT_RSS and RLIMIT_AS are the same,
+-zsh_cv_rlimit_rss_is_as,
+-[AC_TRY_RUN([
+-#include <sys/types.h>
+-#ifdef HAVE_SYS_TIME_H
+-#include <sys/time.h>
+-#endif
+-#include <sys/resource.h>
+-int main()
+-{
+-int ret = 1;
+-#if defined(HAVE_RLIMIT_RSS) && defined(HAVE_RLIMIT_AS)
+-if (RLIMIT_AS == RLIMIT_RSS) ret = 0;
+-#endif
+-return ret;
+-}],
+- zsh_cv_rlimit_rss_is_as=yes,
+- zsh_cv_rlimit_rss_is_as=no,
+- zsh_cv_rlimit_rss_is_as=no)])
+-
+-if test x$zsh_cv_rlimit_rss_is_as = xyes; then
+- AC_DEFINE(RLIMIT_RSS_IS_AS)
+-fi
++zsh_LIMITS_EQUAL(VMEM, vmem, RSS, rss)
++zsh_LIMITS_EQUAL(VMEM, vmem, AS, as)
++zsh_LIMITS_EQUAL(RSS, rss, AS, as)
+
+
+ dnl --------------------------------------------