From e9b65d556af7d737433ba3732d2a734c27de63ac Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Fri, 30 Mar 2018 16:43:43 +1100
Subject: move autoreconf check from mxe-conf to autotools

see: http://lists.nongnu.org/archive/html/mingw-cross-env-list/2018-03/msg00006.html
---
 src/autotools.mk | 14 ++++++++++++++
 src/mxe-conf.mk  | 12 ------------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/src/autotools.mk b/src/autotools.mk
index 475f912..0b111d1 100644
--- a/src/autotools.mk
+++ b/src/autotools.mk
@@ -7,3 +7,17 @@ $(PKG)_VERSION  := 1
 $(PKG)_DEPS     := libtool pkgconf
 $(PKG)_TARGETS  := $(BUILD)
 $(PKG)_TYPE     := meta
+
+define $(PKG)_BUILD_$(BUILD)
+    # fail early if autotools can't autoreconf
+    # 1. detect mismatches in installation locations
+    # 2. ???
+    (echo 'AC_INIT([mxe.cc], [1])'; \
+     $(foreach PROG, autoconf automake libtool, \
+         echo 'AC_PATH_PROG([$(call uc,$(PROG))], [$(PROG)])';) \
+     echo 'PKG_PROG_PKG_CONFIG(0.16)'; \
+     echo 'AC_OUTPUT') \
+     > '$(BUILD_DIR)/configure.ac'
+    cd '$(BUILD_DIR)' && autoreconf -fiv
+    cd '$(BUILD_DIR)' && ./configure
+endef
diff --git a/src/mxe-conf.mk b/src/mxe-conf.mk
index f6e285d..d461348 100644
--- a/src/mxe-conf.mk
+++ b/src/mxe-conf.mk
@@ -22,18 +22,6 @@ define $(PKG)_BUILD_$(BUILD)
     mkdir -p '$(PREFIX)/bin'
     $(INSTALL) -m755 '$(EXT_DIR)/config.guess' '$(PREFIX)/bin/'
 
-    # fail early if autotools can't autoreconf
-    # 1. detect mismatches in installation locations
-    # 2. ???
-    (echo 'AC_INIT([mxe.cc], [1])'; \
-     $(foreach PROG, autoconf automake libtool, \
-         echo 'AC_PATH_PROG([$(call uc,$(PROG))], [$(PROG)])';) \
-     echo 'PKG_PROG_PKG_CONFIG(0.16)'; \
-     echo 'AC_OUTPUT') \
-     > '$(1)/configure.ac'
-    cd '$(1)' && autoreconf -fiv
-    cd '$(1)' && ./configure
-
     #create script "wine" in a directory which is in PATH
     mkdir -p '$(PREFIX)/$(BUILD)/bin/'
     (echo '#!/usr/bin/env bash'; \
-- 
cgit v0.12