iputils-20121221-makefile.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. From c66609d2c830d6fe06f48f5d38c54eb5cc6f2975 Mon Sep 17 00:00:00 2001
  2. From: Mike Frysinger <vapier@gentoo.org>
  3. Date: Thu, 24 Jan 2013 23:36:16 -0500
  4. Subject: [PATCH [iputils]] fix handling of CFLAGS
  5. This defaults CFLAGS to -O3 without clobbering settings people have set
  6. up in the environment already.
  7. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  8. ---
  9. Makefile | 13 +++++--------
  10. 1 file changed, 5 insertions(+), 8 deletions(-)
  11. diff --git a/Makefile b/Makefile
  12. index 2c49940..ecabac3 100644
  13. --- a/Makefile
  14. +++ b/Makefile
  15. @@ -2,8 +2,6 @@
  16. # Configuration
  17. #
  18. -# CC
  19. -CC=gcc
  20. # Path to parent kernel include files directory
  21. LIBC_INCLUDE=/usr/include
  22. # Libraries
  23. @@ -48,11 +46,10 @@ ENABLE_RDISC_SERVER=no
  24. # -------------------------------------
  25. # What a pity, all new gccs are buggy and -Werror does not work. Sigh.
  26. -# CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
  27. -CCOPT=-fno-strict-aliasing -Wstrict-prototypes -Wall -g
  28. -CCOPTOPT=-O3
  29. -GLIBCFIX=-D_GNU_SOURCE
  30. -DEFINES=
  31. +# CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall -Werror -g
  32. +CFLAGS?=-O3 -g
  33. +CFLAGS+=-fno-strict-aliasing -Wstrict-prototypes -Wall
  34. +CPPFLAGS+=-D_GNU_SOURCE
  35. LDLIB=
  36. FUNC_LIB = $(if $(filter static,$(1)),$(LDFLAG_STATIC) $(2) $(LDFLAG_DYNAMIC),$(2))
  37. @@ -113,7 +110,6 @@ IPV4_TARGETS=tracepath ping clockdiff rdisc arping tftpd rarpd
  38. IPV6_TARGETS=tracepath6 traceroute6 ping6
  39. TARGETS=$(IPV4_TARGETS) $(IPV6_TARGETS)
  40. -CFLAGS=$(CCOPTOPT) $(CCOPT) $(GLIBCFIX) $(DEFINES)
  41. LDLIBS=$(LDLIB) $(ADDLIB)
  42. UNAME_N:=$(shell uname -n)
  43. @@ -132,6 +128,7 @@ all: $(TARGETS)
  44. $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -S -o $@
  45. %.o: %.c
  46. $(COMPILE.c) $< $(DEF_$(patsubst %.o,%,$@)) -o $@
  47. +LINK.o += $(CFLAGS)
  48. $(TARGETS): %: %.o
  49. $(LINK.o) $^ $(LIB_$@) $(LDLIBS) -o $@
  50. --
  51. 1.8.0.2