* [WireGuard] [PATCH] tools: allow better build system configuration
@ 2016-11-02 10:31 Marc-Antoine Perennou
2016-11-02 10:36 ` Jason A. Donenfeld
0 siblings, 1 reply; 6+ messages in thread
From: Marc-Antoine Perennou @ 2016-11-02 10:31 UTC (permalink / raw)
To: wireguard
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [WireGuard] [PATCH] tools: allow better build system configuration
2016-11-02 10:31 [WireGuard] [PATCH] tools: allow better build system configuration Marc-Antoine Perennou
@ 2016-11-02 10:36 ` Jason A. Donenfeld
2016-11-02 10:41 ` Marc-Antoine Perennou
0 siblings, 1 reply; 6+ messages in thread
From: Jason A. Donenfeld @ 2016-11-02 10:36 UTC (permalink / raw)
To: Marc-Antoine Perennou; +Cc: WireGuard mailing list
Hi Marc,
What is the motivation for making -s overrideable? Do different
install versions use different options? Or do you simply want the
ability to not strip?
Jason
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [WireGuard] [PATCH] tools: allow better build system configuration
2016-11-02 10:36 ` Jason A. Donenfeld
@ 2016-11-02 10:41 ` Marc-Antoine Perennou
2016-11-02 10:42 ` Jason A. Donenfeld
0 siblings, 1 reply; 6+ messages in thread
From: Marc-Antoine Perennou @ 2016-11-02 10:41 UTC (permalink / raw)
To: Jason A. Donenfeld; +Cc: WireGuard mailing list
Hi,
On 2 November 2016 at 11:36, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> Hi Marc,
>
> What is the motivation for making -s overrideable? Do different
> install versions use different options? Or do you simply want the
> ability to not strip?
>
> Jason
My patch is missing a little background indeed.
Some build environments do not allow the build system to do the
stripping, and want
to do it after the uild system has finished, so it's the latter.
I can split and/or rework that part if needed.
Marc-Antoine
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [WireGuard] [PATCH] tools: allow better build system configuration
2016-11-02 10:41 ` Marc-Antoine Perennou
@ 2016-11-02 10:42 ` Jason A. Donenfeld
2016-11-02 10:45 ` Marc-Antoine Perennou
0 siblings, 1 reply; 6+ messages in thread
From: Jason A. Donenfeld @ 2016-11-02 10:42 UTC (permalink / raw)
To: Marc-Antoine Perennou; +Cc: WireGuard mailing list
Okay, I thought that might be the case. That's the situation on Gentoo too.
Secondly, why the pkg-config abstraction? When is it not called
pkg-config and when is it not in PATH?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [WireGuard] [PATCH] tools: allow better build system configuration
2016-11-02 10:42 ` Jason A. Donenfeld
@ 2016-11-02 10:45 ` Marc-Antoine Perennou
2016-11-02 10:52 ` Jason A. Donenfeld
0 siblings, 1 reply; 6+ messages in thread
From: Marc-Antoine Perennou @ 2016-11-02 10:45 UTC (permalink / raw)
To: Jason A. Donenfeld; +Cc: WireGuard mailing list
On 2 November 2016 at 11:42, Jason A. Donenfeld <Jason@zx2c4.com> wrote:
> Okay, I thought that might be the case. That's the situation on Gentoo too.
>
> Secondly, why the pkg-config abstraction? When is it not called
> pkg-config and when is it not in PATH?
On exherbo, everything (including the main arch) is cross compiled, so
unprefixed
toolchain is blacklisted, we use e.g. x86_64-pc-linux-gnu-pkg-config
Supporting PKG_CONFIG env var seems like something quite common, as that(s
how the pkg-config autotools integration works, for example.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-02 10:51 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-02 10:31 [WireGuard] [PATCH] tools: allow better build system configuration Marc-Antoine Perennou
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
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).