]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
We need to link to the right libc if installing in / on NetBSD.
authorRoy Marples <roy@marples.name>
Sat, 5 Jul 2008 18:41:25 +0000 (18:41 +0000)
committerRoy Marples <roy@marples.name>
Sat, 5 Jul 2008 18:41:25 +0000 (18:41 +0000)
mk/prog.mk
mk/sys.mk

index 720233f16fbeb02ccc8a89b7e064c4cca191c6ed..3f763b80eb690ae347fe2e9e5e9fe2befe01d403 100644 (file)
@@ -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 \
index 359a1fdc33ee692d6174c5f4bdcd0178b157f8f9..81882abc49acec9a90b69313596bbf85ab71eda5 100644 (file)
--- 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})