diff options
| author | Hauke Mehrtens | 2026-02-16 23:28:23 +0000 |
|---|---|---|
| committer | Hauke Mehrtens | 2026-02-17 21:30:24 +0000 |
| commit | 9f88e5c743fd8148474ccef399ca8abdc7843ace (patch) | |
| tree | 401abbed881d067b1959c751e26442c34c7a3dc3 | |
| parent | afbcaa45254f8cebcd959cf20c045fafe2c4f479 (diff) | |
| download | openwrt-9f88e5c743fd8148474ccef399ca8abdc7843ace.tar.gz | |
libcap: add CPPFLAGS
Forward the OpenWrt CPPFLAGS to the compile process. This fixes fortify
sources support.
Allow to extend the CPPFLAGS and not only overwrite.
Link: https://github.com/openwrt/openwrt/pull/22056
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
(cherry picked from commit 53e6935960b807000f90bd2220a7182c366b2af8)
| -rw-r--r-- | package/libs/libcap/Makefile | 1 | ||||
| -rw-r--r-- | package/libs/libcap/patches/002-fix-CPPFLAGS.patch | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/package/libs/libcap/Makefile b/package/libs/libcap/Makefile index 989209302a..1f800867bc 100644 --- a/package/libs/libcap/Makefile +++ b/package/libs/libcap/Makefile @@ -66,6 +66,7 @@ MAKE_FLAGS += \ BUILD_CC="$(CC)" \ BUILD_CFLAGS="$(FPIC) -I$(PKG_BUILD_DIR)/libcap/include" \ CFLAGS="$(TARGET_CFLAGS)" \ + TARGET_CPPFLAGS="$(TARGET_CPPFLAGS)" \ LD="$(TARGET_CC) -Wl,-x -shared" \ LDFLAGS="$(TARGET_LDFLAGS)" \ INDENT="| true" \ diff --git a/package/libs/libcap/patches/002-fix-CPPFLAGS.patch b/package/libs/libcap/patches/002-fix-CPPFLAGS.patch new file mode 100644 index 0000000000..e8bf42b155 --- /dev/null +++ b/package/libs/libcap/patches/002-fix-CPPFLAGS.patch @@ -0,0 +1,15 @@ +Add variable to extend the CPPFLAGS. When specifying CPPFLAGS, it will +replace CPPFLAGS. When giving TARGET_CPPFLAGS it is added to the +CPPFLAGS. + +--- a/Make.Rules ++++ b/Make.Rules +@@ -83,7 +83,7 @@ WARNINGS=-Wall -Wwrite-strings -Wpointer + COPTS ?= -O2 + CFLAGS ?= $(COPTS) $(DEBUG) + CFLAGS += $(WARNINGS) +-CPPFLAGS += -Dlinux $(DEFINES) $(LIBCAP_INCLUDES) ++CPPFLAGS += $(TARGET_CPPFLAGS) -Dlinux $(DEFINES) $(LIBCAP_INCLUDES) + LDFLAGS ?= # -g + + BUILD_CC ?= $(CC) |