From: Foster Snowhill Date: Sat, 11 Jul 2026 22:53:09 +0000 (+0200) Subject: mdns-repeater: pass through CFLAGS/LDFLAGS and package version X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=96c6fdb26af92576b67a05990ece682635eff42f;p=openwrt-packages.git mdns-repeater: pass through CFLAGS/LDFLAGS and package version Before the change, the feed Makefile would not rely on the predefined logic of building Makefile-based packages, rather it defined its own `Build/Compile` step that explicitly called `make`. This didn't play along well with the upstream Makefile, which doesn't respect the CFLAGS that come from the environment. The effect of that was that, for example, `CONFIG_PKG_ASLR_PIE_ALL=y` was not respected: a non-PIE binary was generated regardless. Other compiler flags were ignored too in the same manner. Also it would try to determine the mdns-repeater version by calling to git, which wouldn't work, since the build system downloaded a pre-made source tarball without a bundled `.git` directory. The result is an empty version string when calling `mdns-repeater -h`. To address all of the above, switch to the built-in logic for Makefile-type projects. Append to MAKE_FLAGS to completely override upstream CFLAGS/LDFLAGS and pass through the package version. Set a dummy HGVERSION variable value to prevent the upstream Makefile from calling `git` unnecessarily. Signed-off-by: Foster Snowhill --- diff --git a/net/mdns-repeater/Makefile b/net/mdns-repeater/Makefile index e913ac034..2387f1d7c 100644 --- a/net/mdns-repeater/Makefile +++ b/net/mdns-repeater/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mdns-repeater -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_URL:=https://github.com/geekman/mdns-repeater.git PKG_SOURCE_PROTO=git @@ -28,11 +28,10 @@ define Package/mdns-repeater URL:=https://github.com/geekman/mdns-repeater endef -TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include - -define Build/Compile - CFLAGS="$(TARGET_CFLAGS)" CPPFLAGS="$(TARGET_CPPFLAGS)" $(MAKE) -C $(PKG_BUILD_DIR) $(TARGET_CONFIGURE_OPTS) -endef +MAKE_FLAGS += \ + HGVERSION='dummy' \ + CFLAGS='$(TARGET_CFLAGS) $(TARGET_CPPFLAGS) -DHGVERSION="\"$(VERSION)\""' \ + LDFLAGS='$(TARGET_LDFLAGS)' define Package/mdns-repeater/install $(INSTALL_DIR) $(1)/usr/sbin