# HG changeset patch
# Parent e3275538d18c5e568bf2a60f1f3982d0e716e90e
http://sourceforge.net/projects/mingw/files/MinGW/automake/wrapper/automake-4-1/automake-4-1-mingw32-bin.tar.lzma/download

diff --git a/mingw/bin/aclocal b/mingw/bin/aclocal
new file mode 100644
--- /dev/null
+++ b/mingw/bin/aclocal
@@ -0,0 +1,159 @@
+#!/bin/bash
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/sys-devel/automake-wrapper/files/am-wrapper-4.sh,v 1.1 2009/05/17 21:36:04 vapier Exp $
+
+# Based on the am-wrapper.pl script provided by MandrakeSoft
+# Rewritten in bash by Gregorio Guidi
+#
+# Executes the correct automake version.
+#
+# - defaults to newest version available (hopefully automake-1.10)
+# - runs automake-1.9 if:
+#   - envvar WANT_AUTOMAKE is set to `1.9'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.9
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.9
+# - runs automake-1.8 if:
+#   - envvar WANT_AUTOMAKE is set to `1.8'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.8
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.8
+# - runs automake-1.7 if:
+#   - envvar WANT_AUTOMAKE is set to `1.7'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.7
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.7
+# - runs automake-1.6 if:
+#   - envvar WANT_AUTOMAKE is set to `1.6'
+#     -or-
+#   - `Makefile.in'
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.6
+# - runs automake-1.5 if:
+#   - envvar WANT_AUTOMAKE is set to `1.5'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.5
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.5
+# - runs automake-1.4 if:
+#   - envvar WANT_AUTOMAKE is set to `1.4'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.4
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.4
+progname=${0//\\//}
+if [ "${progname##*/}" = "am-wrapper.sh" ] ; then
+	echo "Don't call this script directly." >&2
+	exit 1
+fi
+
+vers="1.11 1.10 1.9 1.8 1.7 1.6 1.5 1.4"
+
+#
+# Export the proper variable/versions and try to locate a usuable
+# default (newer versions are preferred)
+#
+binary=""
+for v in ${vers} ; do
+	eval binary_${v/./_}="${progname}-${v}"
+
+	if [ -z "${binary}" ] && [ -x "${progname}-${v}" ] ; then
+		binary="${progname}-${v}"
+	fi
+done
+if [ -z "${binary}" ] ; then
+	echo "am-wrapper: Unable to locate any usuable version of automake." >&2
+	echo "            I tried these versions: ${vers}" >&2
+	echo "            With a base name of '${progname}'." >&2
+	exit 1
+fi
+
+#
+# Check the WANT_AUTOMAKE setting.  We accept a whitespace delimited
+# list of automake versions.
+#
+if [ -n "${WANT_AUTOMAKE}" ] ; then
+	for v in ${vers} x ; do
+		if [ "${v}" = "x" ] ; then
+			echo "am-wrapper: warning: invalid WANT_AUTOMAKE '${WANT_AUTOMAKE}'; ignoring." >&2
+			unset WANT_AUTOMAKE
+			break
+		fi
+
+		for wx in ${WANT_AUTOMAKE} ; do
+			if [ "${wx}" = "${v}" ] ; then
+				binary="binary_${v/./_}"
+				binary="${!binary}"
+				v="x"
+			fi
+		done
+		[ "${v}" = "x" ] && break
+	done
+fi
+
+#
+# autodetect helpers
+#
+do_awk() {
+	local file=$1 ; shift
+	local arg=$1 ; shift
+	echo $(gawk "{ if (match(\$0, \"$*\", res)) { print res[${arg}]; exit } }" ${file})
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+	if [ -r "Makefile.in" ] ; then
+		confversion_mf=$(do_awk Makefile.in 2 "^# Makefile.in generated (automatically )?by automake ([0-9].[0-9]+)")
+	fi
+	if [ -r "aclocal.m4" ] ; then
+		confversion_ac=$(do_awk aclocal.m4 1 'generated automatically by aclocal ([0-9].[0-9]+)')
+		confversion_am=$(do_awk aclocal.m4 1 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?([0-9].[0-9]+)[^)]*\\]?\\)')
+	fi
+
+	for v in ${vers} ; do
+		if [ "${confversion_mf}" = "${v}" ] \
+		   || [ "${confversion_ac}" = "${v}" ] \
+		   || [ "${confversion_am}" = "${v}" ] ; then
+			binary="binary_${v/./_}"
+			binary="${!binary}"
+			break
+		fi
+	done
+fi
+
+if [ "${WANT_AMWRAPPER_DEBUG}" ] ; then
+	if [ "${WANT_AUTOMAKE}" ] ; then
+		echo "am-wrapper: DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}" >&2
+	fi
+	echo "am-wrapper: DEBUG: will execute <$binary>" >&2
+fi
+
+#
+# for further consistency
+#
+for v in ${vers} ; do
+	mybin="binary_${v/./_}"
+	if [ "${binary}" = "${!mybin}" ] ; then
+		export WANT_AUTOMAKE="${v}"
+	fi
+done
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+	echo "am-wrapper: $binary is missing or not executable." >&2
+	echo "            Please try installing the correct version of automake." >&2
+	exit 1
+fi
+
+exec "$binary" "$@"
+
+echo "am-wrapper: was unable to exec $binary !?" >&2
+exit 1
diff --git a/mingw/bin/automake b/mingw/bin/automake
new file mode 100644
--- /dev/null
+++ b/mingw/bin/automake
@@ -0,0 +1,159 @@
+#!/bin/bash
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/sys-devel/automake-wrapper/files/am-wrapper-4.sh,v 1.1 2009/05/17 21:36:04 vapier Exp $
+
+# Based on the am-wrapper.pl script provided by MandrakeSoft
+# Rewritten in bash by Gregorio Guidi
+#
+# Executes the correct automake version.
+#
+# - defaults to newest version available (hopefully automake-1.10)
+# - runs automake-1.9 if:
+#   - envvar WANT_AUTOMAKE is set to `1.9'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.9
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.9
+# - runs automake-1.8 if:
+#   - envvar WANT_AUTOMAKE is set to `1.8'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.8
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.8
+# - runs automake-1.7 if:
+#   - envvar WANT_AUTOMAKE is set to `1.7'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.7
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.7
+# - runs automake-1.6 if:
+#   - envvar WANT_AUTOMAKE is set to `1.6'
+#     -or-
+#   - `Makefile.in'
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.6
+# - runs automake-1.5 if:
+#   - envvar WANT_AUTOMAKE is set to `1.5'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.5
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.5
+# - runs automake-1.4 if:
+#   - envvar WANT_AUTOMAKE is set to `1.4'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.4
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.4
+progname=${0//\\//}
+if [ "${progname##*/}" = "am-wrapper.sh" ] ; then
+	echo "Don't call this script directly." >&2
+	exit 1
+fi
+
+vers="1.11 1.10 1.9 1.8 1.7 1.6 1.5 1.4"
+
+#
+# Export the proper variable/versions and try to locate a usuable
+# default (newer versions are preferred)
+#
+binary=""
+for v in ${vers} ; do
+	eval binary_${v/./_}="${progname}-${v}"
+
+	if [ -z "${binary}" ] && [ -x "${progname}-${v}" ] ; then
+		binary="${progname}-${v}"
+	fi
+done
+if [ -z "${binary}" ] ; then
+	echo "am-wrapper: Unable to locate any usuable version of automake." >&2
+	echo "            I tried these versions: ${vers}" >&2
+	echo "            With a base name of '${progname}'." >&2
+	exit 1
+fi
+
+#
+# Check the WANT_AUTOMAKE setting.  We accept a whitespace delimited
+# list of automake versions.
+#
+if [ -n "${WANT_AUTOMAKE}" ] ; then
+	for v in ${vers} x ; do
+		if [ "${v}" = "x" ] ; then
+			echo "am-wrapper: warning: invalid WANT_AUTOMAKE '${WANT_AUTOMAKE}'; ignoring." >&2
+			unset WANT_AUTOMAKE
+			break
+		fi
+
+		for wx in ${WANT_AUTOMAKE} ; do
+			if [ "${wx}" = "${v}" ] ; then
+				binary="binary_${v/./_}"
+				binary="${!binary}"
+				v="x"
+			fi
+		done
+		[ "${v}" = "x" ] && break
+	done
+fi
+
+#
+# autodetect helpers
+#
+do_awk() {
+	local file=$1 ; shift
+	local arg=$1 ; shift
+	echo $(gawk "{ if (match(\$0, \"$*\", res)) { print res[${arg}]; exit } }" ${file})
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+	if [ -r "Makefile.in" ] ; then
+		confversion_mf=$(do_awk Makefile.in 2 "^# Makefile.in generated (automatically )?by automake ([0-9].[0-9]+)")
+	fi
+	if [ -r "aclocal.m4" ] ; then
+		confversion_ac=$(do_awk aclocal.m4 1 'generated automatically by aclocal ([0-9].[0-9]+)')
+		confversion_am=$(do_awk aclocal.m4 1 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?([0-9].[0-9]+)[^)]*\\]?\\)')
+	fi
+
+	for v in ${vers} ; do
+		if [ "${confversion_mf}" = "${v}" ] \
+		   || [ "${confversion_ac}" = "${v}" ] \
+		   || [ "${confversion_am}" = "${v}" ] ; then
+			binary="binary_${v/./_}"
+			binary="${!binary}"
+			break
+		fi
+	done
+fi
+
+if [ "${WANT_AMWRAPPER_DEBUG}" ] ; then
+	if [ "${WANT_AUTOMAKE}" ] ; then
+		echo "am-wrapper: DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}" >&2
+	fi
+	echo "am-wrapper: DEBUG: will execute <$binary>" >&2
+fi
+
+#
+# for further consistency
+#
+for v in ${vers} ; do
+	mybin="binary_${v/./_}"
+	if [ "${binary}" = "${!mybin}" ] ; then
+		export WANT_AUTOMAKE="${v}"
+	fi
+done
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+	echo "am-wrapper: $binary is missing or not executable." >&2
+	echo "            Please try installing the correct version of automake." >&2
+	exit 1
+fi
+
+exec "$binary" "$@"
+
+echo "am-wrapper: was unable to exec $binary !?" >&2
+exit 1
diff --git a/mingw/share/autotools/am-wrapper.sh b/mingw/share/autotools/am-wrapper.sh
new file mode 100644
--- /dev/null
+++ b/mingw/share/autotools/am-wrapper.sh
@@ -0,0 +1,159 @@
+#!/bin/bash
+# Copyright 1999-2006 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/www/viewcvs.gentoo.org/raw_cvs/gentoo-x86/sys-devel/automake-wrapper/files/am-wrapper-4.sh,v 1.1 2009/05/17 21:36:04 vapier Exp $
+
+# Based on the am-wrapper.pl script provided by MandrakeSoft
+# Rewritten in bash by Gregorio Guidi
+#
+# Executes the correct automake version.
+#
+# - defaults to newest version available (hopefully automake-1.10)
+# - runs automake-1.9 if:
+#   - envvar WANT_AUTOMAKE is set to `1.9'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.9
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.9
+# - runs automake-1.8 if:
+#   - envvar WANT_AUTOMAKE is set to `1.8'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.8
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.8
+# - runs automake-1.7 if:
+#   - envvar WANT_AUTOMAKE is set to `1.7'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.7
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.7
+# - runs automake-1.6 if:
+#   - envvar WANT_AUTOMAKE is set to `1.6'
+#     -or-
+#   - `Makefile.in'
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.6
+# - runs automake-1.5 if:
+#   - envvar WANT_AUTOMAKE is set to `1.5'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.5
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.5
+# - runs automake-1.4 if:
+#   - envvar WANT_AUTOMAKE is set to `1.4'
+#     -or-
+#   - `Makefile.in' was generated by automake-1.4
+#     -or-
+#   - 'aclocal.m4' contain AM_AUTOMAKE_VERSION, specifying the use of 1.4
+progname=${0//\\//}
+if [ "${progname##*/}" = "am-wrapper.sh" ] ; then
+	echo "Don't call this script directly." >&2
+	exit 1
+fi
+
+vers="1.11 1.10 1.9 1.8 1.7 1.6 1.5 1.4"
+
+#
+# Export the proper variable/versions and try to locate a usuable
+# default (newer versions are preferred)
+#
+binary=""
+for v in ${vers} ; do
+	eval binary_${v/./_}="${progname}-${v}"
+
+	if [ -z "${binary}" ] && [ -x "${progname}-${v}" ] ; then
+		binary="${progname}-${v}"
+	fi
+done
+if [ -z "${binary}" ] ; then
+	echo "am-wrapper: Unable to locate any usuable version of automake." >&2
+	echo "            I tried these versions: ${vers}" >&2
+	echo "            With a base name of '${progname}'." >&2
+	exit 1
+fi
+
+#
+# Check the WANT_AUTOMAKE setting.  We accept a whitespace delimited
+# list of automake versions.
+#
+if [ -n "${WANT_AUTOMAKE}" ] ; then
+	for v in ${vers} x ; do
+		if [ "${v}" = "x" ] ; then
+			echo "am-wrapper: warning: invalid WANT_AUTOMAKE '${WANT_AUTOMAKE}'; ignoring." >&2
+			unset WANT_AUTOMAKE
+			break
+		fi
+
+		for wx in ${WANT_AUTOMAKE} ; do
+			if [ "${wx}" = "${v}" ] ; then
+				binary="binary_${v/./_}"
+				binary="${!binary}"
+				v="x"
+			fi
+		done
+		[ "${v}" = "x" ] && break
+	done
+fi
+
+#
+# autodetect helpers
+#
+do_awk() {
+	local file=$1 ; shift
+	local arg=$1 ; shift
+	echo $(gawk "{ if (match(\$0, \"$*\", res)) { print res[${arg}]; exit } }" ${file})
+}
+
+#
+# autodetect routine
+#
+if [ -z "${WANT_AUTOMAKE}" ] ; then
+	if [ -r "Makefile.in" ] ; then
+		confversion_mf=$(do_awk Makefile.in 2 "^# Makefile.in generated (automatically )?by automake ([0-9].[0-9]+)")
+	fi
+	if [ -r "aclocal.m4" ] ; then
+		confversion_ac=$(do_awk aclocal.m4 1 'generated automatically by aclocal ([0-9].[0-9]+)')
+		confversion_am=$(do_awk aclocal.m4 1 '[[:space:]]*\\[?AM_AUTOMAKE_VERSION\\(\\[?([0-9].[0-9]+)[^)]*\\]?\\)')
+	fi
+
+	for v in ${vers} ; do
+		if [ "${confversion_mf}" = "${v}" ] \
+		   || [ "${confversion_ac}" = "${v}" ] \
+		   || [ "${confversion_am}" = "${v}" ] ; then
+			binary="binary_${v/./_}"
+			binary="${!binary}"
+			break
+		fi
+	done
+fi
+
+if [ "${WANT_AMWRAPPER_DEBUG}" ] ; then
+	if [ "${WANT_AUTOMAKE}" ] ; then
+		echo "am-wrapper: DEBUG: WANT_AUTOMAKE is set to ${WANT_AUTOMAKE}" >&2
+	fi
+	echo "am-wrapper: DEBUG: will execute <$binary>" >&2
+fi
+
+#
+# for further consistency
+#
+for v in ${vers} ; do
+	mybin="binary_${v/./_}"
+	if [ "${binary}" = "${!mybin}" ] ; then
+		export WANT_AUTOMAKE="${v}"
+	fi
+done
+
+#
+# Now try to run the binary
+#
+if [ ! -x "${binary}" ] ; then
+	echo "am-wrapper: $binary is missing or not executable." >&2
+	echo "            Please try installing the correct version of automake." >&2
+	exit 1
+fi
+
+exec "$binary" "$@"
+
+echo "am-wrapper: was unable to exec $binary !?" >&2
+exit 1
diff --git a/mingw/share/doc/MinGW/automake-4-1-mingw32.RELEASE_NOTES b/mingw/share/doc/MinGW/automake-4-1-mingw32.RELEASE_NOTES
new file mode 100644
--- /dev/null
+++ b/mingw/share/doc/MinGW/automake-4-1-mingw32.RELEASE_NOTES
@@ -0,0 +1,95 @@
+mingw automake (wrapper)
+========================================================================
+Wrapper scripts for automake commands. These scripts are packaged to
+work alongside various "automakeX.Y" automatic makefile generator
+packages. Originally developed by the Gentoo distribution, these wrapper
+scripts autodetect which version of automake should be used.  When
+invoked, each wrapper script passes all arguments to the selected
+implementation and invokes it. To override the autodetection mechanism,
+set the shell variable WANT_AUTOMAKE. For instance, to force the use
+of automake1.10:
+  WANT_AUTOMAKE=1.10
+
+Proper operation of this automake wrapper distribution requires a
+working MSYS installation, as well as certain other elements available
+from the MinGW team (http://www.mingw.org/) as listed below.  However,
+this automake distribution was configured as part of the "mingw32"
+subsystem, and should be installed into the /mingw directory (which is
+usually, but not always, C:\MinGW).  Thus, automake is a hybrid: it is
+configured for the "mingw32" subsystem, but unlike most mingw32 elements,
+requires MSYS.  This rather odd situation is necessary for a number of
+reasons (see the References section below).
+
+<<<< FIXME: fill this in after rebuild cycle >>>>
+Runtime requirements
+  MSYS Environment
+    msysCORE-1.0.11-bin.tar.gz (e.g. stock MSYS 1.0.11 installation)
+
+Build requirements (these, or newer)
+  Same as above
+<<<< END FIXME >>>>
+
+Canonical homepage:
+  http://www.gentoo.org/
+
+Canonical download:
+  http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-devel/automake-wrapper/files/
+
+License:
+  GPL
+
+Language:
+  shell
+
+===========================================================
+
+Build instructions:
+  unpack automake-4-1-mingw32-src.tar.gz
+  cd automake-4/mingwPORT
+  ./mingwPORT.sh [--no-cleanup] [--check]
+
+This will create:
+  automake-4-1-mingw32-src.tar.gz
+  automake-4-1-mingw32-bin.tar.gz
+  automake-4-1-mingw32-lic.tar.gz
+
+===========================================================
+
+Test suite results
+No tests.
+
+===========================================================
+References:
+
+For a discussion of the packaging standards used by the MinGW
+project for pre-built components -- especially as related to
+the autotools such as autoconf, automake, and libtool, see:
+
+  here:     http://www.mingw.org/PackageIdentificationHOWTO
+  here:     http://article.gmane.org/gmane.comp.gnu.mingw.devel/3330
+  and here: http://article.gmane.org/gmane.comp.gnu.mingw.devel/3305
+
+If you're REALLY curious, the following threads are quite
+informative, if extremely long, and detail the discussion and
+reasoning behind the current packaging schema. Presented in
+reverse chronological order:
+  
+  "New Packages"
+  2009-06-21 22:38:19 GMT
+  http://thread.gmane.org/gmane.comp.gnu.mingw.devel/3297
+
+  "GCC 4.4.0: Naming conventions"
+  2009-04-18 06:35:28 GMT
+  http://thread.gmane.org/gmane.comp.gnu.mingw.devel/3225
+
+  "Standards for Building MinGW Release Packages"
+  2008-03-27 12:36:25 GMT
+  http://thread.gmane.org/gmane.comp.gnu.mingw.devel/2739
+
+===========================================================
+
+Port Notes:
+
+----------  automake-4-1 -- 2009 Jul 24 -----------
+* First release of automake (wrapper) under the new packaging standard.
+
