aboutsummaryrefslogtreecommitdiff
path: root/mk/os.mk
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-02-28 11:08:49 +0000
committerRoy Marples <roy@marples.name>2008-02-28 11:08:49 +0000
commitf092045650faad778d25d000d80b3128664d2e2a (patch)
tree89188e92a4d01423ee59e33e5eaf5355fa14d103 /mk/os.mk
parentaabf3976db5ffb41f8f8bbd47f5015b4158e095a (diff)
Support the use of PREFIX and PKG_PREFIX.
Diffstat (limited to 'mk/os.mk')
-rw-r--r--mk/os.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/mk/os.mk b/mk/os.mk
index c99f8b6e..e4f3c76f 100644
--- a/mk/os.mk
+++ b/mk/os.mk
@@ -29,3 +29,11 @@ LIBDL?= ${_LIBDL}$(shell ${_LIBDL_SH})
_LIBKVM_SH= case `uname -s` in *BSD) echo "-lkvm";; *) echo;; esac
_LIBKVM!= ${_LIBKVM_SH}
LIBKVM?= ${_LIBKVM}$(shell ${_LIBKVM_SH})
+
+_PREFIX_SH= if test -n "${PREFIX}" && test "${PREFIX}" != "/"; then echo "-DPREFIX=\\\"${PREFIX}\\\""; else echo ""; fi
+_PREFIX!= ${_PREFIX_SH}
+CFLAGS+= ${_PREFIX}$(shell ${_PREFIX_SH})
+
+_PKG_PREFIX_SH= if test -n "${PKG_PREFIX}" && test "${PKG_PREFIX}" != "/"; then echo "-DPKG_PREFIX=\\\"${PKG_PREFIX}\\\""; else echo ""; fi
+_PKG_PREFIX!= ${_PKG_PREFIX_SH}
+CFLAGS+= ${_PKG_PREFIX}$(shell ${_PKG_PREFIX_SH})