[1/2] update-gnulib.sh: work around aclocal warning with Perl >= 5.16

Message ID 1428513587-8471-2-git-send-email-palves@redhat.com
State New, archived
Headers

Commit Message

Pedro Alves April 8, 2015, 5:19 p.m. UTC
  gdb/ChangeLog:
2015-04-08  Pedro Alves  <palves@redhat.com>

	* gnulib/update-gnulib.sh (aclocal version check): Filter out
	"called too early to check prototype".
---
 gdb/gnulib/update-gnulib.sh | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
 mode change 100644 => 100755 gdb/gnulib/update-gnulib.sh
  

Comments

Yao Qi April 9, 2015, 9:02 a.m. UTC | #1
Pedro Alves <palves@redhat.com> writes:

> +# $ sh ./update-gnulib.sh ~/src/gnulib/src/
> +# Error: Wrong aclocal version: called too early to check prototype at /opt/automake-1.11.1/bin/aclocal line 617.. Aborting.

Yes, I encountered the same error when I run update-gnulib.sh last year,
but I just hacked update-gnulib.sh to workaround it every time :)

Patch is fine by me.
  
Pedro Alves April 9, 2015, 9:39 a.m. UTC | #2
On 04/09/2015 10:02 AM, Yao Qi wrote:
> Pedro Alves <palves@redhat.com> writes:
> 
>> +# $ sh ./update-gnulib.sh ~/src/gnulib/src/
>> +# Error: Wrong aclocal version: called too early to check prototype at /opt/automake-1.11.1/bin/aclocal line 617.. Aborting.
> 
> Yes, I encountered the same error when I run update-gnulib.sh last year,
> but I just hacked update-gnulib.sh to workaround it every time :)

:-)

> 
> Patch is fine by me.
> 

Alright, pushed.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
old mode 100644
new mode 100755
index 5c7238f..957c89a
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -110,7 +110,23 @@  if [ "$ver" != "$AUTOMAKE_VERSION" ]; then
 fi
 
 # Verify that we have the correct version of aclocal.
-ver=`aclocal --version 2>&1 | head -1 | sed 's/.*) //'`
+#
+# The grep below is needed because Perl >= 5.16 dumps a "called too
+# early to check prototype" warning when running aclocal 1.11.1.  This
+# causes trouble below, because the warning is the first line output
+# by aclocal, resulting in:
+#
+# $ sh ./update-gnulib.sh ~/src/gnulib/src/
+# Error: Wrong aclocal version: called too early to check prototype at /opt/automake-1.11.1/bin/aclocal line 617.. Aborting.
+#
+# Some distros carry an automake patch for that:
+#  https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=5;filename=aclocal-function-prototypes.debdiff;att=1;bug=752784
+#
+# But since we prefer pristine FSF versions of autotools, work around
+# the issue here.  This can be removed later when we bump the required
+# automake version.
+#
+ver=`aclocal --version 2>&1 | grep -v "called too early to check prototype" | head -1 | sed 's/.*) //'`
 if [ "$ver" != "$ACLOCAL_VERSION" ]; then
    echo "Error: Wrong aclocal version: $ver. Aborting."
    exit 1