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>
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
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