]> git.99rst.org Git - openwrt-packages.git/commitdiff
mdns-repeater: pass through CFLAGS/LDFLAGS and package version
authorFoster Snowhill <redacted>
Sat, 11 Jul 2026 22:53:09 +0000 (00:53 +0200)
committerJosef Schlehofer <redacted>
Thu, 16 Jul 2026 06:46:19 +0000 (08:46 +0200)
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 <redacted>
net/mdns-repeater/Makefile

index e913ac03487392d5b22af2d69f31dbc9b337ded3..2387f1d7cf2aba0946506c8c69d07a4c3355a344 100644 (file)
@@ -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
git clone https://git.99rst.org/PROJECT