$NetBSD: patch-ac,v 1.26 2012/08/17 10:53:10 wiz Exp $ First chunk: Add support for thread limits. From Peter Stephenson on zsh-workers. All other chunks: 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 on zsh-workers on 2012-08-16. --- configure.orig 2012-06-21 18:36:43.000000000 +0000 +++ configure @@ -9608,6 +9608,42 @@ if test $zsh_cv_have_RLIMIT_NPROC = yes; fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for limit RLIMIT_NTHR" >&5 +$as_echo_n "checking for limit RLIMIT_NTHR... " >&6; } +if ${zsh_cv_have_RLIMIT_NTHR+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +int +main () +{ +RLIMIT_NTHR + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + zsh_cv_have_RLIMIT_NTHR=yes +else + zsh_cv_have_RLIMIT_NTHR=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $zsh_cv_have_RLIMIT_NTHR" >&5 +$as_echo "$zsh_cv_have_RLIMIT_NTHR" >&6; } + +if test $zsh_cv_have_RLIMIT_NTHR = yes; then + $as_echo "#define HAVE_RLIMIT_NTHR 1" >>confdefs.h + +fi + { $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 : @@ -11589,6 +11625,10 @@ $as_echo "$zsh_cv_sys_elf" >&6; } DLLD="${DLLD=$CC}" DLLDARG="" ;; + *interix*) + DLLD="${DLLD=$CC}" + DLLDARG="" + ;; * ) DLLD="${DLLD=ld}" DLLDARG="" @@ -11599,6 +11639,7 @@ $as_echo "$zsh_cv_sys_elf" >&6; } case "$host_os" in hpux*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;; darwin*) DLCFLAGS="${DLCFLAGS=-fno-common}" ;; + interix*) DLCFLAGS="${DLCFLAGS=}" ;; *) DLCFLAGS="${DLCFLAGS=-fPIC}" ;; esac else @@ -11613,10 +11654,9 @@ $as_echo "$zsh_cv_sys_elf" >&6; } fi case "$host_os" in osf*) DLLDFLAGS="${DLLDFLAGS=-shared -expect_unresolved '*'}" ;; - *freebsd*|linux*|irix*|gnu*|dragonfly*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;; + *freebsd*|*netbsd*|linux*|irix*|gnu*|interix*|dragonfly*) DLLDFLAGS="${DLLDFLAGS=-shared}" ;; sunos*) DLLDFLAGS="${DLLDFLAGS=-assert nodefinitions}" ;; sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G $ldflags}" ;; - netbsd*) DLLDFLAGS="${DLLDFLAGS=${DLLDARG}-x -shared --whole-archive}" ;; aix*) DLLDFLAGS="${DLLDFLAGS=-G -bexpall -lc}" ;; solaris*|sysv4*|esix*) DLLDFLAGS="${DLLDFLAGS=-G}" ;; darwin*) DLLDFLAGS="${DLLDFLAGS=-bundle -flat_namespace -undefined suppress}" ;;