From d3d855a78c971d8f797172a5b5be001af36e93b3 Mon Sep 17 00:00:00 2001 From: tron Date: Fri, 20 Aug 2004 11:48:46 +0000 Subject: Improve handling of "ZSH_STATIC" again: 1.) Only create a dynamically linked "zsh" binary if "MKDYNAMICROOT" is defined and set to "yes". This way people who still use statically linked binaries on their root filesystem will get a static binary. 2.) Link the "zsh" binary so that it use "/libexec/ld.elf_so" and shared libraries from "/lib". It now works without the "/usr" filesystem being mounted. --- shells/zsh/Makefile.common | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'shells') diff --git a/shells/zsh/Makefile.common b/shells/zsh/Makefile.common index 283f867674d..4a7d30e6b81 100644 --- a/shells/zsh/Makefile.common +++ b/shells/zsh/Makefile.common @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.common,v 1.14 2004/08/20 10:36:12 tron Exp $ +# $NetBSD: Makefile.common,v 1.15 2004/08/20 11:48:46 tron Exp $ DISTNAME= zsh-${ZSH_VERSION} CATEGORIES= shells @@ -30,7 +30,20 @@ BUILD_DEFS+= ZSH_STATIC .if defined(ZSH_STATIC) && !empty(ZSH_STATIC:M[Yy][Ee][Ss]) CONFIGURE_ARGS+=--disable-dynamic -. if !(${OPSYS} == "NetBSD" && exists(/libexec/ld.elf_so)) +NETBSD_SHLINKER= /libexec/ld.elf_so + +. if ${OPSYS} == "NetBSD" && \ + defined(MKDYNAMICROOT) && !empty(MKDYNAMICROOT:M[Yy][Ee][Ss]) && \ + ${OBJECT_FMT} == "ELF" && exists(${NETBSD_SHLINKER}) +# +# Built a dynamically linked "zsh" binary on NetBSD systems which use +# dynamically linked binaries on the root filesystem. The binary will +# only depend on the run-time link-editor and shared libraries on the +# root filesystem. We use "-rpath" below by purpose because the +# buildlink 3 framework won't filter it out. +# +LDFLAGS+= -Wl,-dynamic-linker=${NETBSD_SHLINKER} -rpath=/lib +. else LDFLAGS+= -static . endif .else -- cgit v1.2.3