[PATCHES] Enable building using GNU Automake 1.13, 1.14

Christian Aistleitner christian at quelltextlich.at
Thu Aug 22 09:53:17 CEST 2013


Hi,

the attached patches [1] enable building GnuPG and its dependencies
using GNU automake 1.13, and 1.14.

The attachments are named like
  PROJECT_BRANCH_PATCH
and are essentially three patches:

* 0001-Switch-to-non-deprecated-form-of-GNU-Automake-initia.patch

Some projects still used a deprecated variant of AM_INIT_AUTOMAKE,
which makes updating to GNU automake 1.13+ cumbersome. In order to not
mangle different things into a single patch, I put the switch to a not
deprecated form of AM_INIT_AUTOMAKE into separate patches.

* 0002-Fix-building-with-GNU-Automake-1.13.patch

GNU automake 1.13+ defaults to parallel_tests, which fails for our
tests. So we force “serial_tests” for new enough GNU automakes.

* 0003-Fix-building-with-GNU-Automake-1.14.patch

GNU automake 1.14 made the compile script mandatory for packages
compiling C code. So we add the compile script where necessary.


Have fun,
Christian


P.S.: The patches have been tested against:
*  automake (GNU automake) 1.11.6
*  automake (GNU automake) 1.12.2
*  automake (GNU automake) 1.13.4
*  automake (GNU automake) 1.14



[1] Yes, sending more than one patch per email is not too nice, but
they are essentially the same three patches against different
projects/branches. Hence, comments to some patch would likely also
apply to the other formulations of the patch as well. And splitting
the patches into ten separate emails would rather complicate
commenting on the patches :-/

If you nevertheless prefer to receive the patches as separate emails,
please let me know.



-- 
---- quelltextlich e.U. ---- \\ ---- Christian Aistleitner ----
                           Companies' registry: 360296y in Linz
Christian Aistleitner
Gruendbergstrasze 65a        Email:  christian at quelltextlich.at
4040 Linz, Austria           Phone:          +43 732 / 26 95 63
                             Fax:            +43 732 / 26 95 63
                             Homepage: http://quelltextlich.at/
---------------------------------------------------------------
-------------- next part --------------
From c83f37c0b24671b3afd558f37b0da3b22e35ceef Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Sun, 14 Jul 2013 13:00:19 +0200
Subject: [PATCH] Fix building with GNU Automake 1.13+

* configure.ac: Force serial tests for GNU Automake 1.13+.
(serial_tests): New.
--

GNU Automake switched the default test harness to parallel beginning
with GNU Automake 1.13. Until we upgrade our tests, we force
serial-tests beginning with GNU Automake 1.13.

This commit is a minor adaption of libguestfs's (GPLv2+) commit
a1c89bf03dd432f0e4c8c26fe01fd9b2a50df97e by Richard W.M. Jones.

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 configure.ac | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 01530e0..88cb4d8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,9 +66,27 @@ VERSION=$PACKAGE_VERSION
 AC_CONFIG_AUX_DIR([scripts])
 AC_CONFIG_SRCDIR([sm/gpgsm.c])
 AC_CONFIG_HEADER([config.h])
-# Note: For automake 1.13 add the option
-#          serial-tests
-AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip])
+
+dnl Initialize automake.  automake < 1.12 didn't have serial-tests and
+dnl gives an error if it sees this, but for automake >= 1.13
+dnl serial-tests is required so we have to include it.  Solution is to
+dnl test for the version of automake (by running an external command)
+dnl and provide it if necessary.  Note we have to do this entirely using
+dnl m4 macros since automake queries this macro by running
+dnl 'autoconf --trace'.
+m4_define([serial_tests], [
+    m4_esyscmd([automake --version | awk 'NR==1 {
+                       split ($NF, V_ARR, ".");
+                       V_INT=1000000*V_ARR[1]+1000*V_ARR[2]+V_ARR[3]
+                       if (V_INT >= 1013000)
+                         # GNU Automake is version 1.13 or newer
+                         print "serial-tests";
+                     }'
+    ])
+])
+
+dnl As we need expansion of the serial_tests macro, do not [quote] it.
+AM_INIT_AUTOMAKE([dist-bzip2 no-dist-gzip] serial_tests)
 AC_CANONICAL_HOST
 AB_INIT
 
-- 
1.8.1.5

-------------- next part --------------
From 1af21fbe6956a6c05a384f5e8a01976e5d2e47e0 Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Sun, 14 Jul 2013 21:51:23 +0200
Subject: [PATCH 1/2] Switch to non-deprecated form of GNU Automake
 initialization

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 702b8d3..f5748a9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,7 +63,7 @@ VERSION=$PACKAGE_VERSION
 AC_CONFIG_AUX_DIR(scripts)
 AC_CONFIG_SRCDIR(sm/gpgsm.c)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AM_INIT_AUTOMAKE
 AC_CANONICAL_HOST
 AB_INIT
 
-- 
1.8.1.5

-------------- next part --------------
From 57c304a4531b08986e508bc632380869788318bb Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Sun, 14 Jul 2013 21:53:27 +0200
Subject: [PATCH 2/2] Fix building with GNU Automake 1.13+

* configure.ac: Force serial tests for GNU Automake 1.13+.
(serial_tests): New.
--

GNU Automake switched the default test harness to parallel beginning
with GNU Automake 1.13. Until we upgrade our tests, we force
serial-tests beginning with GNU Automake 1.13.

This commit is a minor adaption of libguestfs's (GPLv2+) commit
a1c89bf03dd432f0e4c8c26fe01fd9b2a50df97e by Richard W.M. Jones.

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 configure.ac | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index f5748a9..2ac92ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -63,7 +63,27 @@ VERSION=$PACKAGE_VERSION
 AC_CONFIG_AUX_DIR(scripts)
 AC_CONFIG_SRCDIR(sm/gpgsm.c)
 AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE
+
+dnl Initialize automake.  automake < 1.12 didn't have serial-tests and
+dnl gives an error if it sees this, but for automake >= 1.13
+dnl serial-tests is required so we have to include it.  Solution is to
+dnl test for the version of automake (by running an external command)
+dnl and provide it if necessary.  Note we have to do this entirely using
+dnl m4 macros since automake queries this macro by running
+dnl 'autoconf --trace'.
+m4_define([serial_tests], [
+    m4_esyscmd([automake --version | awk 'NR==1 {
+                       split ($NF, V_ARR, ".");
+                       V_INT=1000000*V_ARR[1]+1000*V_ARR[2]+V_ARR[3]
+                       if (V_INT >= 1013000)
+                         # GNU Automake is version 1.13 or newer
+                         print "serial-tests";
+                     }'
+    ])
+])
+
+dnl As we need expansion of the serial_tests macro, do not [quote] it.
+AM_INIT_AUTOMAKE(serial_tests)
 AC_CANONICAL_HOST
 AB_INIT
 
-- 
1.8.1.5

-------------- next part --------------
From 6008bd6661379722fa021ff0ec70dc74d45ebd4e Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Sun, 14 Jul 2013 12:36:00 +0200
Subject: [PATCH] Fix building with GNU Automake 1.13+

* configure.ac: Force serial tests for GNU Automake 1.13+.
(serial_tests): New.
--

GNU Automake switched the default test harness to parallel beginning
with GNU Automake 1.13. Until we upgrade our tests, we force
serial-tests beginning with GNU Automake 1.13.

This commit is a minor adaption of libguestfs's (GPLv2+) commit
a1c89bf03dd432f0e4c8c26fe01fd9b2a50df97e by Richard W.M. Jones.

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 configure.ac | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index de2347f..381fd67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,26 @@ AC_SUBST(LIBASSUAN_LT_REVISION)
 PACKAGE=$PACKAGE_NAME
 VERSION=$PACKAGE_VERSION
 
-AM_INIT_AUTOMAKE
+dnl Initialize automake.  automake < 1.12 didn't have serial-tests and
+dnl gives an error if it sees this, but for automake >= 1.13
+dnl serial-tests is required so we have to include it.  Solution is to
+dnl test for the version of automake (by running an external command)
+dnl and provide it if necessary.  Note we have to do this entirely using
+dnl m4 macros since automake queries this macro by running
+dnl 'autoconf --trace'.
+m4_define([serial_tests], [
+    m4_esyscmd([automake --version | awk 'NR==1 {
+                       split ($NF, V_ARR, ".");
+                       V_INT=1000000*V_ARR[1]+1000*V_ARR[2]+V_ARR[3]
+                       if (V_INT >= 1013000)
+                         # GNU Automake is version 1.13 or newer
+                         print "serial-tests";
+                     }'
+    ])
+])
+
+dnl As we need expansion of the serial_tests macro, do not [quote] it.
+AM_INIT_AUTOMAKE(serial_tests)
 AM_MAINTAINER_MODE
 AC_CONFIG_SRCDIR(src/assuan.h.in)
 AC_CONFIG_MACRO_DIR(m4)
-- 
1.8.1.5

-------------- next part --------------
From e8e37f6be871d84069658d0c48979d7a12395171 Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Sun, 14 Jul 2013 12:50:07 +0200
Subject: [PATCH] Fix building with GNU Automake 1.13+

* configure.ac: Force serial tests for GNU Automake 1.13+.
(serial_tests): New.
--

GNU Automake switched the default test harness to parallel beginning
with GNU Automake 1.13. Until we upgrade our tests, we force
serial-tests beginning with GNU Automake 1.13.

This commit is a minor adaption of libguestfs's (GPLv2+) commit
a1c89bf03dd432f0e4c8c26fe01fd9b2a50df97e by Richard W.M. Jones.

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 configure.ac | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 13541bb..59f8281 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,7 +73,27 @@ PACKAGE=$PACKAGE_NAME
 VERSION=$PACKAGE_VERSION
 
 AC_CONFIG_SRCDIR([src/libgcrypt.vers])
-AM_INIT_AUTOMAKE
+
+dnl Initialize automake.  automake < 1.12 didn't have serial-tests and
+dnl gives an error if it sees this, but for automake >= 1.13
+dnl serial-tests is required so we have to include it.  Solution is to
+dnl test for the version of automake (by running an external command)
+dnl and provide it if necessary.  Note we have to do this entirely using
+dnl m4 macros since automake queries this macro by running
+dnl 'autoconf --trace'.
+m4_define([serial_tests], [
+    m4_esyscmd([automake --version | awk 'NR==1 {
+                       split ($NF, V_ARR, ".");
+                       V_INT=1000000*V_ARR[1]+1000*V_ARR[2]+V_ARR[3]
+                       if (V_INT >= 1013000)
+                         # GNU Automake is version 1.13 or newer
+                         print "serial-tests";
+                     }'
+    ])
+])
+
+dnl As we need expansion of the serial_tests macro, do not [quote] it.
+AM_INIT_AUTOMAKE(serial_tests)
 AC_CONFIG_HEADER(config.h)
 AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_LIBOBJ_DIR([compat])
-- 
1.8.1.5

-------------- next part --------------
From cf3a3a6e255aee259e5a4a36efad071994460fa3 Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Sat, 13 Jul 2013 11:49:43 +0200
Subject: [PATCH] Fix building with GNU Automake 1.13+

* configure.ac: Force serial tests for GNU Automake 1.13+.
(serial_tests): New.
--

GNU Automake switched the default test harness to parallel beginning
with GNU Automake 1.13. Until we upgrade our tests, we force
serial-tests beginning with GNU Automake 1.13.

This commit is a minor adaption of libguestfs's (GPLv2+) commit
a1c89bf03dd432f0e4c8c26fe01fd9b2a50df97e by Richard W.M. Jones.

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 configure.ac | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 04e259b..01e7635 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,7 +64,26 @@ VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x00" mym4_version_major \
                           mym4_version_minor)
 AC_SUBST(VERSION_NUMBER)
 
-AM_INIT_AUTOMAKE
+dnl Initialize automake.  automake < 1.12 didn't have serial-tests and
+dnl gives an error if it sees this, but for automake >= 1.13
+dnl serial-tests is required so we have to include it.  Solution is to
+dnl test for the version of automake (by running an external command)
+dnl and provide it if necessary.  Note we have to do this entirely using
+dnl m4 macros since automake queries this macro by running
+dnl 'autoconf --trace'.
+m4_define([serial_tests], [
+    m4_esyscmd([automake --version | awk 'NR==1 {
+                       split ($NF, V_ARR, ".");
+                       V_INT=1000000*V_ARR[1]+1000*V_ARR[2]+V_ARR[3]
+                       if (V_INT >= 1013000)
+                         # GNU Automake is version 1.13 or newer
+                         print "serial-tests";
+                     }'
+    ])
+])
+
+dnl As we need expansion of the serial_tests macro, do not [quote] it.
+AM_INIT_AUTOMAKE(serial_tests)
 AM_MAINTAINER_MODE
 AC_CONFIG_SRCDIR([src/err-sources.h.in])
 AC_CONFIG_HEADER([config.h])
-- 
1.8.1.5

-------------- next part --------------
From bfb43b855fa2023a24a3b045c613274eef6bfd9d Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Sun, 14 Jul 2013 12:26:36 +0200
Subject: [PATCH 1/2] Switch to non-deprecated form of GNU Automake
 initialization

--

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index bd650c7..cbb63f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,7 +73,7 @@ VERSION=$PACKAGE_VERSION
 AC_CONFIG_SRCDIR([src/npth.c])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
+AM_INIT_AUTOMAKE
 AM_MAINTAINER_MODE
 AC_CANONICAL_HOST
 
-- 
1.8.1.5

-------------- next part --------------
From 13f3b8ec618d027b83b99bc1678394f26e32bac0 Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Sun, 14 Jul 2013 12:31:03 +0200
Subject: [PATCH 2/2]  Fix building with GNU Automake 1.13+

* configure.ac: Force serial tests for GNU Automake 1.13+.
(serial_tests): New.
--

GNU Automake switched the default test harness to parallel beginning
with GNU Automake 1.13. Until we upgrade our tests, we force
serial-tests beginning with GNU Automake 1.13.

This commit is a minor adaption of libguestfs's (GPLv2+) commit
a1c89bf03dd432f0e4c8c26fe01fd9b2a50df97e by Richard W.M. Jones.

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 configure.ac | 22 +++++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index cbb63f4..9cf8f59 100644
--- a/configure.ac
+++ b/configure.ac
@@ -73,7 +73,27 @@ VERSION=$PACKAGE_VERSION
 AC_CONFIG_SRCDIR([src/npth.c])
 AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE
+
+dnl Initialize automake.  automake < 1.12 didn't have serial-tests and
+dnl gives an error if it sees this, but for automake >= 1.13
+dnl serial-tests is required so we have to include it.  Solution is to
+dnl test for the version of automake (by running an external command)
+dnl and provide it if necessary.  Note we have to do this entirely using
+dnl m4 macros since automake queries this macro by running
+dnl 'autoconf --trace'.
+m4_define([serial_tests], [
+    m4_esyscmd([automake --version | awk 'NR==1 {
+                       split ($NF, V_ARR, ".");
+                       V_INT=1000000*V_ARR[1]+1000*V_ARR[2]+V_ARR[3]
+                       if (V_INT >= 1013000)
+                         # GNU Automake is version 1.13 or newer
+                         print "serial-tests";
+                     }'
+    ])
+])
+
+dnl As we need expansion of the serial_tests macro, do not [quote] it.
+AM_INIT_AUTOMAKE(serial_tests)
 AM_MAINTAINER_MODE
 AC_CANONICAL_HOST
 
-- 
1.8.1.5

-------------- next part --------------
From 290c6c8e956aa948276f6257964b575518fa4a9b Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Wed, 21 Aug 2013 14:56:25 +0200
Subject: [PATCH] Fix building with GNU Automake 1.14

* compile: New. Taken from GNU Automake 1.14.
--

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 compile | 347 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 347 insertions(+)
 create mode 100755 compile

diff --git a/compile b/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
-- 
1.8.1.5

-------------- next part --------------
From 290c6c8e956aa948276f6257964b575518fa4a9b Mon Sep 17 00:00:00 2001
From: Christian Aistleitner <christian at quelltextlich.at>
Date: Wed, 21 Aug 2013 14:56:25 +0200
Subject: [PATCH] Fix building with GNU Automake 1.14

* compile: New. Taken from GNU Automake 1.14.
--

Signed-off-by: Christian Aistleitner <christian at quelltextlich.at>
---
 compile | 347 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 347 insertions(+)
 create mode 100755 compile

diff --git a/compile b/compile
new file mode 100755
index 0000000..531136b
--- /dev/null
+++ b/compile
@@ -0,0 +1,347 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand '-c -o'.
+
+scriptversion=2012-10-14.11; # UTC
+
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent tools from complaining about whitespace usage.
+IFS=" ""	$nl"
+
+file_conv=
+
+# func_file_conv build_file lazy
+# Convert a $build file to $host form and store it in $file
+# Currently only supports Windows hosts. If the determined conversion
+# type is listed in (the comma separated) LAZY, no conversion will
+# take place.
+func_file_conv ()
+{
+  file=$1
+  case $file in
+    / | /[!/]*) # absolute file, and not a UNC file
+      if test -z "$file_conv"; then
+	# lazily determine how to convert abs files
+	case `uname -s` in
+	  MINGW*)
+	    file_conv=mingw
+	    ;;
+	  CYGWIN*)
+	    file_conv=cygwin
+	    ;;
+	  *)
+	    file_conv=wine
+	    ;;
+	esac
+      fi
+      case $file_conv/,$2, in
+	*,$file_conv,*)
+	  ;;
+	mingw/*)
+	  file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
+	  ;;
+	cygwin/*)
+	  file=`cygpath -m "$file" || echo "$file"`
+	  ;;
+	wine/*)
+	  file=`winepath -w "$file" || echo "$file"`
+	  ;;
+      esac
+      ;;
+  esac
+}
+
+# func_cl_dashL linkdir
+# Make cl look for libraries in LINKDIR
+func_cl_dashL ()
+{
+  func_file_conv "$1"
+  if test -z "$lib_path"; then
+    lib_path=$file
+  else
+    lib_path="$lib_path;$file"
+  fi
+  linker_opts="$linker_opts -LIBPATH:$file"
+}
+
+# func_cl_dashl library
+# Do a library search-path lookup for cl
+func_cl_dashl ()
+{
+  lib=$1
+  found=no
+  save_IFS=$IFS
+  IFS=';'
+  for dir in $lib_path $LIB
+  do
+    IFS=$save_IFS
+    if $shared && test -f "$dir/$lib.dll.lib"; then
+      found=yes
+      lib=$dir/$lib.dll.lib
+      break
+    fi
+    if test -f "$dir/$lib.lib"; then
+      found=yes
+      lib=$dir/$lib.lib
+      break
+    fi
+    if test -f "$dir/lib$lib.a"; then
+      found=yes
+      lib=$dir/lib$lib.a
+      break
+    fi
+  done
+  IFS=$save_IFS
+
+  if test "$found" != yes; then
+    lib=$lib.lib
+  fi
+}
+
+# func_cl_wrapper cl arg...
+# Adjust compile command to suit cl
+func_cl_wrapper ()
+{
+  # Assume a capable shell
+  lib_path=
+  shared=:
+  linker_opts=
+  for arg
+  do
+    if test -n "$eat"; then
+      eat=
+    else
+      case $1 in
+	-o)
+	  # configure might choose to run compile as 'compile cc -o foo foo.c'.
+	  eat=1
+	  case $2 in
+	    *.o | *.[oO][bB][jJ])
+	      func_file_conv "$2"
+	      set x "$@" -Fo"$file"
+	      shift
+	      ;;
+	    *)
+	      func_file_conv "$2"
+	      set x "$@" -Fe"$file"
+	      shift
+	      ;;
+	  esac
+	  ;;
+	-I)
+	  eat=1
+	  func_file_conv "$2" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-I*)
+	  func_file_conv "${1#-I}" mingw
+	  set x "$@" -I"$file"
+	  shift
+	  ;;
+	-l)
+	  eat=1
+	  func_cl_dashl "$2"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-l*)
+	  func_cl_dashl "${1#-l}"
+	  set x "$@" "$lib"
+	  shift
+	  ;;
+	-L)
+	  eat=1
+	  func_cl_dashL "$2"
+	  ;;
+	-L*)
+	  func_cl_dashL "${1#-L}"
+	  ;;
+	-static)
+	  shared=false
+	  ;;
+	-Wl,*)
+	  arg=${1#-Wl,}
+	  save_ifs="$IFS"; IFS=','
+	  for flag in $arg; do
+	    IFS="$save_ifs"
+	    linker_opts="$linker_opts $flag"
+	  done
+	  IFS="$save_ifs"
+	  ;;
+	-Xlinker)
+	  eat=1
+	  linker_opts="$linker_opts $2"
+	  ;;
+	-*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+	*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
+	  func_file_conv "$1"
+	  set x "$@" -Tp"$file"
+	  shift
+	  ;;
+	*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
+	  func_file_conv "$1" mingw
+	  set x "$@" "$file"
+	  shift
+	  ;;
+	*)
+	  set x "$@" "$1"
+	  shift
+	  ;;
+      esac
+    fi
+    shift
+  done
+  if test -n "$linker_opts"; then
+    linker_opts="-link$linker_opts"
+  fi
+  exec "$@" $linker_opts
+  exit 1
+}
+
+eat=
+
+case $1 in
+  '')
+     echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand '-c -o'.
+Remove '-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file 'INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+  cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
+    func_cl_wrapper "$@"      # Doesn't return...
+    ;;
+esac
+
+ofile=
+cfile=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as 'compile cc -o foo foo.c'.
+	# So we strip '-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no '-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # '.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use '[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
-- 
1.8.1.5

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: </pipermail/attachments/20130822/46fc0548/attachment-0001.sig>


More information about the Gnupg-devel mailing list