[openwrt/openwrt] libcap: add CPPFLAGS

LEDE Commits lede-commits at lists.infradead.org
Tue Feb 17 13:32:12 PST 2026


hauke pushed a commit to openwrt/openwrt.git, branch openwrt-25.12:
https://git.openwrt.org/9f88e5c743fd8148474ccef399ca8abdc7843ace

commit 9f88e5c743fd8148474ccef399ca8abdc7843ace
Author: Hauke Mehrtens <hauke at hauke-m.de>
AuthorDate: Tue Feb 17 00:28:23 2026 +0100

    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 at hauke-m.de>
    (cherry picked from commit 53e6935960b807000f90bd2220a7182c366b2af8)
---
 package/libs/libcap/Makefile                       |  1 +
 package/libs/libcap/patches/002-fix-CPPFLAGS.patch | 15 +++++++++++++++
 2 files changed, 16 insertions(+)

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)




More information about the lede-commits mailing list