From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
To: wireguard@lists.zx2c4.com
Subject: [WireGuard] [PATCH] tools: allow better build system configuration
Date: Wed, 2 Nov 2016 11:31:58 +0100 [thread overview]
Message-ID: <20161102103158.5305-1-Marc-Antoine@Perennou.com> (raw)
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
---
src/tools/Makefile | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/tools/Makefile b/src/tools/Makefile
index fc0c0f3..92e0528 100644
--- a/src/tools/Makefile
+++ b/src/tools/Makefile
@@ -4,6 +4,8 @@ BINDIR ?= $(PREFIX)/bin
LIBDIR ?= $(PREFIX)/lib
MANDIR ?= $(PREFIX)/share/man
RUNSTATEDIR ?= /var/run
+PKG_CONFIG ?= pkg-config
+INSTALL_STRIP_OPT ?= -s
CFLAGS ?= -O3
CFLAGS += -std=gnu11
@@ -12,8 +14,8 @@ CFLAGS += -MMD -MP
CFLAGS += -DRUNSTATEDIR="\"$(RUNSTATEDIR)\""
LDLIBS += -lresolv
ifeq ($(shell uname -s),Linux)
-LIBMNL_CFLAGS := $(shell pkg-config --cflags libmnl 2>/dev/null)
-LIBMNL_LDLIBS := $(shell pkg-config --libs libmnl 2>/dev/null || echo -lmnl)
+LIBMNL_CFLAGS := $(shell $(PKG_CONFIG) --cflags libmnl 2>/dev/null)
+LIBMNL_LDLIBS := $(shell $(PKG_CONFIG) --libs libmnl 2>/dev/null || echo -lmnl)
CFLAGS += $(LIBMNL_CFLAGS)
LDLIBS += $(LIBMNL_LDLIBS)
endif
@@ -24,7 +26,7 @@ clean:
rm -f wg *.o *.d
install: wg
- install -v -d "$(DESTDIR)$(BINDIR)" && install -s -m 0755 -v wg "$(DESTDIR)$(BINDIR)/wg"
+ install -v -d "$(DESTDIR)$(BINDIR)" && install $(INSTALL_STRIP_OPT) -m 0755 -v wg "$(DESTDIR)$(BINDIR)/wg"
install -v -d "$(DESTDIR)$(MANDIR)/man8" && install -m 0644 -v wg.8 "$(DESTDIR)$(MANDIR)/man8/wg.8"
check: clean
--
2.10.1
next reply other threads:[~2016-11-02 10:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-02 10:31 Marc-Antoine Perennou [this message]
2016-11-02 10:36 ` Jason A. Donenfeld
2016-11-02 10:41 ` Marc-Antoine Perennou
2016-11-02 10:42 ` Jason A. Donenfeld
2016-11-02 10:45 ` Marc-Antoine Perennou
2016-11-02 10:52 ` Jason A. Donenfeld
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161102103158.5305-1-Marc-Antoine@Perennou.com \
--to=marc-antoine@perennou.com \
--cc=wireguard@lists.zx2c4.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).