summaryrefslogtreecommitdiff
path: root/mk/os.mk
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-10 16:35:59 +0000
committerRoy Marples <roy@marples.name>2008-01-10 16:35:59 +0000
commit43147845209873b0776bd75d363913fe25611f49 (patch)
treeab3295c30664476d8d05b0fe5fe9ace702ade5ea /mk/os.mk
parent2643f2e605f102d2c2fa098d0cf5400d3795ed4a (diff)
downloadopenrc-43147845209873b0776bd75d363913fe25611f49.tar.gz
openrc-43147845209873b0776bd75d363913fe25611f49.tar.bz2
openrc-43147845209873b0776bd75d363913fe25611f49.tar.xz
Allow for OS and SUBOS folders so we can introduce NetBSD scripts whilst keeping BSD for all BSD's.
Diffstat (limited to 'mk/os.mk')
-rw-r--r--mk/os.mk31
1 files changed, 31 insertions, 0 deletions
diff --git a/mk/os.mk b/mk/os.mk
new file mode 100644
index 0000000..aca062c
--- /dev/null
+++ b/mk/os.mk
@@ -0,0 +1,31 @@
+# Copyright 2008 Roy Marples
+
+# Generic definitions
+
+_OS_SH_= uname -s
+_OS!= ${_OS_SH}
+OS?= ${_OS}$(shell ${_OS_SH})
+
+_SUBOS_SH= case `uname -s` in \
+ *BSD|DragonFly) echo "BSD";; \
+ *) echo "";; \
+ esac
+_SUBOS!= ${_SUBOS_SH}
+SUBOS?= ${_SUBOS}$(shell ${_SUBOS_SH})
+
+_LIBNAME_SH= l=`readlink /lib`; case "$$l" in /lib64|lib64) echo "lib64";; *) echo "lib";; esac
+_LIBNAME!= ${_LIBNAME_SH}
+LIBNAME?= ${_LIBNAME}$(shell ${_LIBNAME_SH})
+RC_LIB= /$(LIBNAME)/rc
+
+_DEF_SH= case `uname -s` in Linux) echo "-D_XOPEN_SOURCE=600 -D_BSD_SOURCE";; *) echo;; esac
+_DEF!= ${_DEF_SH}
+CFLAGS+= ${_DEF}$(shell ${_DEF_SH})
+
+_LIBDL_SH= case `uname -s` in Linux) echo "-Wl,-Bdynamic -ldl";; *) echo;; esac
+_LIBDL!= ${_LIBDL_SH}
+LIBDL?= ${_LIBDL}$(shell ${_LIBDL_SH})
+
+_LIBKVM_SH= case `uname -s` in *BSD) echo "-lkvm";; *) echo;; esac
+_LIBKVM!= ${_LIBKVM_SH}
+LIBKVM?= ${_LIBKVM}$(shell ${_LIBKVM_SH})