]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Darwin uses --rpath instead of -Wl,-rpath= - bummer.
authorRoy Marples <roy@marples.name>
Mon, 21 Jul 2008 14:24:18 +0000 (14:24 +0000)
committerRoy Marples <roy@marples.name>
Mon, 21 Jul 2008 14:24:18 +0000 (14:24 +0000)
Makefile
mk/os-Darwin.mk [new file with mode: 0644]
mk/os.mk
mk/prog.mk

index e149a91fb6619ac3900c516f38c5f70a33e6a2d6..fb38fe414e71825422c9cb7ad24b33062ccea517 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -46,6 +46,6 @@ SED_SYS=      -e 's:@SYSCONFDIR@:${SYSCONFDIR}:g'
        ${SED} ${SED_HOOKDIR} ${SED_SCRIPT} ${SED_SYS} $< > $@
 
 MK=            mk
-include ${MK}/os.mk
 include ${MK}/sys.mk
+include ${MK}/os.mk
 include ${MK}/prog.mk
diff --git a/mk/os-Darwin.mk b/mk/os-Darwin.mk
new file mode 100644 (file)
index 0000000..f2c3104
--- /dev/null
@@ -0,0 +1,5 @@
+# Setup OS specific variables
+# Copyright 2008 Roy Marples <roy@marples.name>
+
+include ${MK}/os-BSD.mk
+LINK_RPATH=    --rpath
index f2a83f4017ce8de2542baf0a8ce41cd19f867c45..f3426e48c18af5153d4e48379e2214673aceedf4 100644 (file)
--- a/mk/os.mk
+++ b/mk/os.mk
@@ -1,7 +1,7 @@
 # Setup OS specific variables
 # Copyright 2008 Roy Marples <roy@marples.name>
 
-_OS_SH=        case `uname -s` in Linux) echo "Linux";; *) echo "BSD";; esac
+_OS_SH=        case `uname -s` in Linux) echo "Linux";; Darwin) echo "Darwin";;  *) echo "BSD";; esac
 _OS!=          ${_OS_SH}
 OS=            ${_OS}$(shell ${_OS_SH})
 include ${MK}/os-${OS}.mk
index 3f763b80eb690ae347fe2e9e5e9fe2befe01d403..d970b2d647f7aed4e36918d7fc33df3dfd865c9e 100644 (file)
@@ -7,18 +7,19 @@ include ${MK}/cc.mk
 
 OBJS+=         ${SRCS:.c=.o}
 
-# This is for NetBSD which has a different libc in /lib which we need
-# to link to if installing in /
+# If building for /, ensure we use the libc in / if different from
+# the default one in /usr/lib
+LINK_RPATH?=           -Wl,-rpath
 _RPATH_SH=             if test "${PREFIX}" = "" -o "${PREIX}" = "/"; then \
-                               echo "-Wl,-rpath=${PREFIX}/${LIBNAME}"; \
+                               echo "${LINK_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 /
+# If building for /, ensure we use the linker in /libexec if different from
+# the default one in /usr/libexec
 _DYNLINK_SH=           if test "${PREFIX}" = "" -o "${PREFIX}" = "/" && test -e /libexec/ld.elf_so; then \
                                echo "-Wl,-dynamic-linker=/libexec/ld.elf_so"; \
                        else \