0003-Makefile-allow-passing-custom-CFLAGS-CPPFLAGS.patch 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. From 014a8e04a0fa775b2ade78e5f7655a1453375884 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Wed, 10 Feb 2016 23:31:12 +0100
  4. Subject: [PATCH] Makefile: allow passing custom CFLAGS/CPPFLAGS
  5. vpnc's Makefile specifies some CFLAGS and CPPFLAGS value, but it may
  6. be needed to pass additional custom flags on the make command line. To
  7. make this possible, we switch from a plain += operator to the
  8. "override ... +=" operator.
  9. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  10. ---
  11. Makefile | 8 ++++----
  12. 1 file changed, 4 insertions(+), 4 deletions(-)
  13. diff --git a/Makefile b/Makefile
  14. index e80ef17..7ac225a 100644
  15. --- a/Makefile
  16. +++ b/Makefile
  17. @@ -62,9 +62,9 @@ RELEASE_VERSION := $(shell cat VERSION)
  18. CC ?= gcc
  19. CFLAGS ?= -O3 -g
  20. -CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
  21. -CFLAGS += $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
  22. -CPPFLAGS += -DVERSION=\"$(VERSION)\"
  23. +override CFLAGS += -W -Wall -Wmissing-declarations -Wwrite-strings
  24. +override CFLAGS += $(shell libgcrypt-config --cflags) $(CRYPTO_CFLAGS)
  25. +override CPPFLAGS += -DVERSION=\"$(VERSION)\"
  26. LDFLAGS ?= -g
  27. LIBS += $(shell libgcrypt-config --libs) $(CRYPTO_LDADD)
  28. @@ -73,7 +73,7 @@ LIBS += -lnsl -lresolv -lsocket
  29. endif
  30. ifneq (,$(findstring Apple,$(shell $(CC) --version)))
  31. # enabled in FSF GCC, disabled by default in Apple GCC
  32. -CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
  33. +override CFLAGS += -fstrict-aliasing -freorder-blocks -fsched-interblock
  34. endif
  35. all : $(BINS) vpnc.8
  36. --
  37. 2.6.4