aboutsummaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2015-07-05 02:27:26 +0200
committerMarc André Tanner <mat@brain-dump.org>2015-07-06 11:28:40 +0200
commit3708502761771e1af941dfb7f6dd44d97274accf (patch)
treefefc25aed6bf89306da1c1a1b4ebd99e7a6850ed /config.mk
parentc449ac2ce4823d03a42bae9357c7937ddbf91b92 (diff)
downloadvis-3708502761771e1af941dfb7f6dd44d97274accf.tar.gz
vis-3708502761771e1af941dfb7f6dd44d97274accf.tar.xz
text: overhaul save implemenation
Try to do an atomic save using rename(2) unless * the file is a symbolic link * the file is a hard link * file ownership can not be preserved * file group can not be preserved * POSXI ACL can not be preserved (if enabled) * SELinux security context can not be preserved (if enabled) in which case the file is overwritten in place. However a failure to do so results in data loss. Closes #47.
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk15
1 files changed, 14 insertions, 1 deletions
diff --git a/config.mk b/config.mk
index 9d37cc3..85ddc17 100644
--- a/config.mk
+++ b/config.mk
@@ -1,3 +1,7 @@
+# optional features
+HAVE_ACL=0
+HAVE_SELINUX=0
+
# vis version
# we have no tags in git, so just use revision count an hash for now
GITREVCOUNT = "$(shell git rev-list --count master 2>/dev/null)"
@@ -18,7 +22,16 @@ LIBS = -lc -lncursesw
OS = $(shell uname)
-ifeq (${OS},Darwin)
+ifeq (${OS},Linux)
+ ifeq (${HAVE_SELINUX},1)
+ CFLAGS += -DHAVE_SELINUX
+ LIBS += -lselinux
+ endif
+ ifeq (${HAVE_ACL},1)
+ CFLAGS += -DHAVE_ACL
+ LIBS += -lacl
+ endif
+else ifeq (${OS},Darwin)
LIBS = -lc -lncurses
CFLAGS += -D_DARWIN_C_SOURCE
else ifeq (${OS},OpenBSD)