libcap-2.19-build-system.patch 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. ---
  2. Make.Rules | 15 ++++++++-------
  3. libcap/Makefile | 2 +-
  4. 2 files changed, 9 insertions(+), 8 deletions(-)
  5. Index: libcap-2.19/Make.Rules
  6. ===================================================================
  7. --- libcap-2.19.orig/Make.Rules
  8. +++ libcap-2.19/Make.Rules
  9. @@ -45,24 +45,25 @@
  10. KERNEL_HEADERS := $(topdir)/libcap/include
  11. IPATH += -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
  12. -CC := gcc
  13. -CFLAGS := -O2
  14. -BUILD_CC := $(CC)
  15. -BUILD_CFLAGS := $(CFLAGS) $(IPATH)
  16. -AR := ar
  17. -RANLIB := ranlib
  18. +CC ?= gcc
  19. +CFLAGS ?= -O2
  20. +CC_FOR_BUILD ?= $(CC)
  21. +CFLAGS_FOR_BUILD ?= $(CFLAGS)
  22. +AR ?= ar
  23. +RANLIB ?= ranlib
  24. DEBUG = -g #-DDEBUG
  25. WARNINGS=-fPIC -Wall -Wwrite-strings \
  26. -Wpointer-arith -Wcast-qual -Wcast-align \
  27. -Wstrict-prototypes -Wmissing-prototypes \
  28. -Wnested-externs -Winline -Wshadow
  29. LD=$(CC) -Wl,-x -shared
  30. -LDFLAGS := #-g
  31. +LDFLAGS ?= #-g
  32. SYSTEM_HEADERS = /usr/include
  33. INCS=$(topdir)/libcap/include/sys/capability.h
  34. LDFLAGS += -L$(topdir)/libcap
  35. CFLAGS += -Dlinux $(WARNINGS) $(DEBUG) $(IPATH)
  36. +CFLAGS_FOR_BUILD += $(IPATH)
  37. PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
  38. INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
  39. DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
  40. Index: libcap-2.19/libcap/Makefile
  41. ===================================================================
  42. --- libcap-2.19.orig/libcap/Makefile
  43. +++ libcap-2.19/libcap/Makefile
  44. @@ -33,7 +33,7 @@
  45. endif
  46. _makenames: _makenames.c cap_names.list.h
  47. - $(BUILD_CC) $(BUILD_CFLAGS) $< -o $@
  48. + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $< -o $@
  49. cap_names.h: _makenames
  50. ./_makenames > cap_names.h