]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
libcap: add CPPFLAGS
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 16 Feb 2026 23:28:23 +0000 (00:28 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Tue, 17 Feb 2026 21:25:09 +0000 (22:25 +0100)
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>
package/libs/libcap/Makefile
package/libs/libcap/patches/002-fix-CPPFLAGS.patch [new file with mode: 0644]

index 989209302a489be6be15fbc6d457d00bd2c2905b..1f800867bcf791957f3c0ce1859efb2a5b475efc 100644 (file)
@@ -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 (file)
index 0000000..e8bf42b
--- /dev/null
@@ -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)