summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew G. Morgan <morgan@kernel.org>2008-10-19 19:37:28 -0700
committerAndrew G. Morgan <morgan@kernel.org>2008-10-19 19:37:28 -0700
commit0a42b493f24035415047ff79ad46e5c27e2ee11e (patch)
tree7300a73ec47e1639bf3dd35b0995af81499e0e0d
parent100d8e3ab0eb44b0def28d6f5e858dbc6398ec6c (diff)
downloadlibcap2-0a42b493f24035415047ff79ad46e5c27e2ee11e.tar.gz
Make programs dynamically linked.
Suggestion from the Slackware folk (Thanks Robby Workman for pointing out Pat's change). Signed-off-by: Andrew G. Morgan <morgan@kernel.org>
-rw-r--r--Make.Rules2
-rw-r--r--progs/Makefile2
2 files changed, 4 insertions, 0 deletions
diff --git a/Make.Rules b/Make.Rules
index 858f182..0fcd8ad 100644
--- a/Make.Rules
+++ b/Make.Rules
@@ -65,6 +65,8 @@ LDFLAGS += -L$(topdir)/libcap
CFLAGS += -Dlinux $(WARNINGS) $(DEBUG) $(IPATH)
PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
INDENT := $(shell if [ -z "$(which ident 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+
# Global cleanup stuff
LOCALCLEAN=rm -f *~ core
diff --git a/progs/Makefile b/progs/Makefile
index 3f66a38..ef8f056 100644
--- a/progs/Makefile
+++ b/progs/Makefile
@@ -7,7 +7,9 @@ include $(topdir)/Make.Rules
PROGS=getpcaps getcap setcap capsh
BUILD=$(PROGS) verify-caps
+ifneq ($(DYNAMIC),yes)
LDFLAGS += --static
+endif
LDLIBS += -lcap
all: $(BUILD)