summaryrefslogtreecommitdiff
path: root/shells/zsh/hacks.mk
diff options
context:
space:
mode:
Diffstat (limited to 'shells/zsh/hacks.mk')
-rw-r--r--shells/zsh/hacks.mk22
1 files changed, 22 insertions, 0 deletions
diff --git a/shells/zsh/hacks.mk b/shells/zsh/hacks.mk
new file mode 100644
index 00000000000..110e21fcacb
--- /dev/null
+++ b/shells/zsh/hacks.mk
@@ -0,0 +1,22 @@
+.if !defined(ZSH_HACKS_MK)
+ZSH_HACKS_MK= defined
+
+### [Sun Dec 21 02:00:19 JST 2008 : uebayasi]
+### 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.
+NETBSD_SHLINKER= /libexec/ld.elf_so # XXX move elsewhere
+NETBSD_SHLIBDIR= /lib # XXX move elsewhere
+.if ${OPSYS} == "NetBSD" && \
+ defined(OBJECT_FMT) && ${OBJECT_FMT} == "ELF" && \
+ defined(MKDYNAMICROOT) && ${MKDYNAMICROOT} != "no" && \
+ defined(NETBSD_SHLINKER) && exists(${NETBSD_SHLINKER}) && \
+ defined(NETBSD_SHLIBDIR) && exists(${NETBSD_SHLIBDIR})
+PKG_HACKS+= static-dynamic
+_ZSH_STATIC.BUILDLINK_PASSTHRU_RPATHDIRS= ${NETBSD_SHLIBDIR}
+_ZSH_STATIC.LDFLAGS= -Wl,-dynamic-linker=${NETBSD_SHLINKER} -Wl,-R${NETBSD_SHLIBDIR}
+.endif
+
+.endif # ZSH_HACKS_MK