From: Roy Marples Date: Sat, 5 Jul 2008 18:41:25 +0000 (+0000) Subject: We need to link to the right libc if installing in / on NetBSD. X-Git-Tag: v4.0.2~236 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c4b10e90c0f648cd4f7130b326cdfe43761eb38;p=thirdparty%2Fdhcpcd.git We need to link to the right libc if installing in / on NetBSD. --- diff --git a/mk/prog.mk b/mk/prog.mk index 720233f1..3f763b80 100644 --- a/mk/prog.mk +++ b/mk/prog.mk @@ -7,8 +7,18 @@ include ${MK}/cc.mk OBJS+= ${SRCS:.c=.o} -# This is for NetBSD which has two dynamic linkers and we need to -# use the right one. +# This is for NetBSD which has a different libc in /lib which we need +# to link to if installing in / +_RPATH_SH= if test "${PREFIX}" = "" -o "${PREIX}" = "/"; then \ + echo "-Wl,-rpath=${PREFIX}/${LIBNAME}"; \ + else \ + echo ""; \ + fi +_RPATH!= ${_RPATH_SH} +LDFLAGS+= ${_RPATH}$(shell ${_RPATH_SH}) + +# This is for NetBSD which has different dynamic linker in /lib which we need +# to use to if installing in / _DYNLINK_SH= if test "${PREFIX}" = "" -o "${PREFIX}" = "/" && test -e /libexec/ld.elf_so; then \ echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \ else \ diff --git a/mk/sys.mk b/mk/sys.mk index 359a1fdc..81882abc 100644 --- a/mk/sys.mk +++ b/mk/sys.mk @@ -8,3 +8,7 @@ SYSCONFDIR?= ${PREFIX}/etc INSTALL?= install SED?= sed + +_LIBNAME_SH= case `readlink /lib` in "") echo "lib";; *) basename `readlink /lib`;; esac +_LIBNAME!= ${_LIBNAME_SH} +LIBNAME?= ${_LIBNAME}$(shell ${_LIBNAME_SH})