0001-build-system-fixes-for-cross-compilation.patch 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From d8d70559a279706c206761dfaf665d2197934123 Mon Sep 17 00:00:00 2001
  2. From: Gustavo Zacarias <gustavo@zacarias.com.ar>
  3. Date: Sun, 6 Mar 2016 22:52:02 +0100
  4. Subject: [PATCH] build-system: fixes for cross-compilation
  5. Avoid the libcap buildsys forcing CC/CFLAGS/LDFLAGS/AR/RANLIB
  6. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  7. [yann.morin.1998@free.fr: dont chmod +x the shared lib]
  8. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  9. diff --git a/Make.Rules b/Make.Rules
  10. index 8347b26..8a07a3f 100644
  11. --- a/Make.Rules
  12. +++ b/Make.Rules
  13. @@ -48,26 +48,26 @@ MINOR=25
  14. KERNEL_HEADERS := $(topdir)/libcap/include/uapi
  15. IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include
  16. -CC := gcc
  17. -CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
  18. -BUILD_CC := $(CC)
  19. -BUILD_CFLAGS := $(CFLAGS) $(IPATH)
  20. -AR := ar
  21. -RANLIB := ranlib
  22. +CC ?= gcc
  23. +CFLAGS ?= -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
  24. +BUILD_CC ?= $(CC)
  25. +BUILD_CFLAGS ?= $(CFLAGS) $(IPATH)
  26. +AR ?= ar
  27. +RANLIB ?= ranlib
  28. DEBUG = -g #-DDEBUG
  29. WARNINGS=-Wall -Wwrite-strings \
  30. -Wpointer-arith -Wcast-qual -Wcast-align \
  31. -Wstrict-prototypes -Wmissing-prototypes \
  32. -Wnested-externs -Winline -Wshadow
  33. LD=$(CC) -Wl,-x -shared
  34. -LDFLAGS := #-g
  35. +LDFLAGS ?= #-g
  36. BUILD_GPERF := $(shell which gperf >/dev/null 2>/dev/null && echo yes)
  37. SYSTEM_HEADERS = /usr/include
  38. INCS=$(topdir)/libcap/include/sys/capability.h
  39. LDFLAGS += -L$(topdir)/libcap
  40. CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
  41. -PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
  42. +PAM_CAP = no
  43. INDENT := $(shell if [ -n "$$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
  44. DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
  45. --
  46. 1.9.1