From 5e7d299177c8648f3af1c4c22db3c55b4fcee537 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Fri, 24 Jun 2022 21:29:10 +0200 Subject: [PATCH] - move autotools env/opts to pkg_autotools.mk --- make/environment-build.mk | 93 -------------------------------------- package/pkg-autotools.mk | 95 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+), 93 deletions(-) diff --git a/make/environment-build.mk b/make/environment-build.mk index dd71112d..64930ea8 100644 --- a/make/environment-build.mk +++ b/make/environment-build.mk @@ -214,99 +214,6 @@ TARGET_MAKE_OPTS = \ # ----------------------------------------------------------------------------- -HOST_CONFIGURE_ENV = \ - $(HOST_MAKE_OPTS) \ - CFLAGS="$(HOST_CFLAGS)" \ - CPPFLAGS="$(HOST_CPPFLAGS)" \ - CXXFLAGS="$(HOST_CXXFLAGS)" \ - LDFLAGS="$(HOST_LDFLAGS)" - -HOST_CONFIGURE_ENV += \ - PKG_CONFIG=/usr/bin/pkg-config \ - PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig" - -HOST_CONFIGURE_ENV += \ - $($(PKG)_CONF_ENV) - -HOST_CONFIGURE_OPTS = \ - --prefix=$(HOST_DIR) \ - --sysconfdir=$(HOST_DIR)/etc - -HOST_CONFIGURE_OPTS += \ - $($(PKG)_CONF_OPTS) - -TARGET_CONFIGURE_ENV = \ - $(TARGET_MAKE_OPTS) \ - CFLAGS="$(TARGET_CFLAGS)" \ - CPPFLAGS="$(TARGET_CPPFLAGS)" \ - CXXFLAGS="$(TARGET_CXXFLAGS)" \ - LDFLAGS="$(TARGET_LDFLAGS)" - -TARGET_CONFIGURE_ENV += \ - PKG_CONFIG=$(PKG_CONFIG) \ - PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" \ - PKG_CONFIG_SYSROOT_DIR=$(PKG_CONFIG_SYSROOT_DIR) - -TARGET_CONFIGURE_ENV += \ - $($(PKG)_CONF_ENV) - -TARGET_CONFIGURE_OPTS = \ - --build=$(GNU_HOST_NAME) \ - --host=$(TARGET) \ - --target=$(TARGET) \ - \ - --program-prefix="" \ - --program-suffix="" \ - \ - --prefix=$(prefix) \ - --exec_prefix=$(exec_prefix) \ - --sysconfdir=$(sysconfdir) \ - --localstatedir=$(localstatedir) \ - \ - --mandir=$(REMOVE_mandir) \ - --infodir=$(REMOVE_infodir) - -TARGET_CONFIGURE_OPTS += \ - $($(PKG)_CONF_OPTS) - -define AUTORECONF_HOOK - $(Q)( \ - if [ "$($(PKG)_AUTORECONF)" == "YES" ]; then \ - $(call MESSAGE,"Autoreconfiguring"); \ - $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ - $($(PKG)_AUTORECONF_ENV) autoreconf -fi $($(PKG)_AUTORECONF_OPTS); \ - fi; \ - ) -endef - -define HOST_CONFIGURE - @$(call MESSAGE,"Configuring") - $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep)) - $(call AUTORECONF_HOOK) - $(Q)( \ - $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ - test -f ./configure || ./autogen.sh && \ - CONFIG_SITE=/dev/null \ - $(HOST_CONFIGURE_ENV) ./configure $(HOST_CONFIGURE_OPTS); \ - ) - $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) -endef - -define TARGET_CONFIGURE - @$(call MESSAGE,"Configuring") - $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep)) - $(call AUTORECONF_HOOK) - $(Q)( \ - $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ - test -f ./configure || ./autogen.sh && \ - CONFIG_SITE=/dev/null \ - $(TARGET_CONFIGURE_ENV) ./configure $(TARGET_CONFIGURE_OPTS); \ - ) - $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) -endef - -# ----------------------------------------------------------------------------- - define meson-cross-config # (dest dir) $(INSTALL) -d $(1) ( \ diff --git a/package/pkg-autotools.mk b/package/pkg-autotools.mk index 656aaee5..5b26afac 100644 --- a/package/pkg-autotools.mk +++ b/package/pkg-autotools.mk @@ -4,6 +4,65 @@ # ################################################################################ +define AUTORECONF_HOOK + $(Q)( \ + if [ "$($(PKG)_AUTORECONF)" == "YES" ]; then \ + $(call MESSAGE,"Autoreconfiguring"); \ + $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ + $($(PKG)_AUTORECONF_ENV) autoreconf -fi $($(PKG)_AUTORECONF_OPTS); \ + fi; \ + ) +endef + +# ----------------------------------------------------------------------------- + +TARGET_CONFIGURE_ENV = \ + $(TARGET_MAKE_OPTS) \ + CFLAGS="$(TARGET_CFLAGS)" \ + CPPFLAGS="$(TARGET_CPPFLAGS)" \ + CXXFLAGS="$(TARGET_CXXFLAGS)" \ + LDFLAGS="$(TARGET_LDFLAGS)" + +TARGET_CONFIGURE_ENV += \ + PKG_CONFIG=$(PKG_CONFIG) \ + PKG_CONFIG_PATH="$(PKG_CONFIG_PATH)" \ + PKG_CONFIG_SYSROOT_DIR=$(PKG_CONFIG_SYSROOT_DIR) + +TARGET_CONFIGURE_ENV += \ + $($(PKG)_CONF_ENV) + +TARGET_CONFIGURE_OPTS = \ + --build=$(GNU_HOST_NAME) \ + --host=$(TARGET) \ + --target=$(TARGET) \ + \ + --program-prefix="" \ + --program-suffix="" \ + \ + --prefix=$(prefix) \ + --exec_prefix=$(exec_prefix) \ + --sysconfdir=$(sysconfdir) \ + --localstatedir=$(localstatedir) \ + \ + --mandir=$(REMOVE_mandir) \ + --infodir=$(REMOVE_infodir) + +TARGET_CONFIGURE_OPTS += \ + $($(PKG)_CONF_OPTS) + +define TARGET_CONFIGURE + @$(call MESSAGE,"Configuring") + $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep)) + $(call AUTORECONF_HOOK) + $(Q)( \ + $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ + test -f ./configure || ./autogen.sh && \ + CONFIG_SITE=/dev/null \ + $(TARGET_CONFIGURE_ENV) ./configure $(TARGET_CONFIGURE_OPTS); \ + ) + $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) +endef + define autotools-package $(call PREPARE) $(call TARGET_CONFIGURE) @@ -13,6 +72,42 @@ define autotools-package $(call TARGET_FOLLOWUP) endef +# ----------------------------------------------------------------------------- + +HOST_CONFIGURE_ENV = \ + $(HOST_MAKE_OPTS) \ + CFLAGS="$(HOST_CFLAGS)" \ + CPPFLAGS="$(HOST_CPPFLAGS)" \ + CXXFLAGS="$(HOST_CXXFLAGS)" \ + LDFLAGS="$(HOST_LDFLAGS)" + +HOST_CONFIGURE_ENV += \ + PKG_CONFIG=/usr/bin/pkg-config \ + PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig" + +HOST_CONFIGURE_ENV += \ + $($(PKG)_CONF_ENV) + +HOST_CONFIGURE_OPTS = \ + --prefix=$(HOST_DIR) \ + --sysconfdir=$(HOST_DIR)/etc + +HOST_CONFIGURE_OPTS += \ + $($(PKG)_CONF_OPTS) + +define HOST_CONFIGURE + @$(call MESSAGE,"Configuring") + $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep)) + $(call AUTORECONF_HOOK) + $(Q)( \ + $(CHDIR)/$($(PKG)_DIR)/$($(PKG)_SUBDIR); \ + test -f ./configure || ./autogen.sh && \ + CONFIG_SITE=/dev/null \ + $(HOST_CONFIGURE_ENV) ./configure $(HOST_CONFIGURE_OPTS); \ + ) + $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep)) +endef + define host-autotools-package $(call PREPARE) $(call HOST_CONFIGURE)