]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Fix 'ar' invocation when cross-compiling and in 64-bit mode on AIX.
authorBruno Haible <bruno@clisp.org>
Tue, 2 Jan 2018 18:38:43 +0000 (19:38 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 2 Jan 2018 18:38:43 +0000 (19:38 +0100)
Reported by Benedikt Morbach <bmorbach@redhat.com>
at <https://savannah.gnu.org/bugs/?43037>.

* gettext-runtime/m4/intl.m4 (AM_INTL_SUBDIR): Require gl_PROG_AR_RANLIB if
available. Otherwise, use AC_PROG_RANLIB and set AR and ARFLAGS.
* gettext-runtime/intl/Makefile.in (AR): Use the value determined through
autoconf.
(ARFLAGS): New variable.
(libintl.a, libgnuintl.a): Use it.
* gettext-runtime/configure.ac: Invoke gl_PROG_AR_RANLIB.
* gettext-runtime/libasprintf/configure.ac: Likewise.
* gettext-tools/configure.ac: Likewise.

gettext-runtime/configure.ac
gettext-runtime/intl/Makefile.in
gettext-runtime/libasprintf/configure.ac
gettext-runtime/m4/intl.m4
gettext-tools/configure.ac

index 71adec3f107a974e0adc93702a0d0a680ba2f601..88d5c98f001afc866b4582f3e54fa066ef7fa5d7 100644 (file)
@@ -1,5 +1,5 @@
 dnl Configuration for the gettext-runtime directory of GNU gettext
-dnl Copyright (C) 1995-2010, 2015-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2010, 2015-2016, 2018 Free Software Foundation, Inc.
 dnl
 dnl This program is free software: you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -59,6 +59,9 @@ dnl Checks for compiler output filename suffixes.
 AC_OBJEXT
 AC_EXEEXT
 
+dnl For a 64-bit build on AIX, AC_PROG_RANLIB is not sufficient.
+gl_PROG_AR_RANLIB
+
 dnl Make sure we see all GNU and Solaris extensions.
 gl_EARLY
 AM_PROG_CC_C_O
index 63a5c87638599fe9d1a2dbc51fc872b522f3742b..44bed9dbf817fa158dc8b312d83bcbbab0c084ca 100644 (file)
@@ -64,7 +64,8 @@ mkdir_p = @mkdir_p@
 
 l = @INTL_LIBTOOL_SUFFIX_PREFIX@
 
-AR = ar
+AR = @AR@
+ARFLAGS = @ARFLAGS@
 CC = @CC@
 LIBTOOL = @LIBTOOL@
 RANLIB = @RANLIB@
@@ -221,7 +222,7 @@ all-no-no:
 
 libintl.a libgnuintl.a: $(OBJECTS)
        $(AM_V_at)rm -f $@
-       $(AM_V_AR)$(AR) cru $@ $(OBJECTS)
+       $(AM_V_AR)$(AR) $(ARFLAGS) $@ $(OBJECTS)
        $(AM_V_at)$(RANLIB) $@
 
 libintl.la libgnuintl.la: $(OBJECTS) $(OBJECTS_RES_@WOE32@)
index 736bf48b241e65cf06e24f232615d7987d5d443e..6df1b337ddfc33548f0c65c6e365b3c4a45321ad 100644 (file)
@@ -1,5 +1,5 @@
 dnl Configuration for the GNU libasprintf library
-dnl Copyright (C) 2002-2011, 2015-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2011, 2015-2016, 2018 Free Software Foundation, Inc.
 dnl
 dnl This program is free software: you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -35,6 +35,9 @@ dnl Checks for compiler output filename suffixes.
 AC_OBJEXT
 AC_EXEEXT
 
+dnl For a 64-bit build on AIX, AC_PROG_RANLIB is not sufficient.
+gl_PROG_AR_RANLIB
+
 dnl Early checks, assembled by gnulib.
 gl_EARLY
 
index 61cd9f63106c932f5d3c9457f3a466702baf6973..0cc18d9ea1c1284c41ce616520e3cc49d4129680 100644 (file)
@@ -1,4 +1,4 @@
-# intl.m4 serial 31 (gettext-0.19.9)
+# intl.m4 serial 32 (gettext-0.19.9)
 dnl Copyright (C) 1995-2014, 2016-2018 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -29,7 +29,6 @@ AC_DEFUN([AM_INTL_SUBDIR],
   AC_REQUIRE([AC_PROG_CC])dnl
   AC_REQUIRE([AC_CANONICAL_HOST])dnl
   AC_REQUIRE([gt_GLIBC2])dnl
-  AC_REQUIRE([AC_PROG_RANLIB])dnl
   AC_REQUIRE([gl_VISIBILITY])dnl
   AC_REQUIRE([gt_INTL_SUBDIR_CORE])dnl
   AC_REQUIRE([AC_TYPE_LONG_LONG_INT])dnl
@@ -46,6 +45,21 @@ AC_DEFUN([AM_INTL_SUBDIR],
   AC_REQUIRE([gt_GL_ATTRIBUTE])dnl
   AC_REQUIRE([AC_C_FLEXIBLE_ARRAY_MEMBER])dnl
 
+  dnl In projects that use gnulib, use gl_PROG_AR_RANLIB.
+  dnl The '][' hides this use from 'aclocal'.
+  m4_ifdef([g][l_PROG_AR_RANLIB],
+    [AC_REQUIRE([g][l_PROG_AR_RANLIB])],
+    [AC_REQUIRE([AC_PROG_RANLIB])
+     dnl Use Automake-documented default values for AR and ARFLAGS, but prefer
+     dnl ${host}-ar over ar (useful for cross-compiling).
+     AC_CHECK_TOOL([AR], [ar], [ar])
+     if test -z "$ARFLAGS"; then
+       ARFLAGS='cr'
+     fi
+     AC_SUBST([AR])
+     AC_SUBST([ARFLAGS])
+    ])
+
   dnl Support for automake's --enable-silent-rules.
   case "$enable_silent_rules" in
     yes) INTL_DEFAULT_VERBOSITY=0;;
index db36ddc065f59599f22e29051ff7a42e9579ebc6..ca6934c21957ad2a0123e12fc43e08edd4a3d739 100644 (file)
@@ -1,5 +1,5 @@
 dnl Configuration for the gettext-tools directory of GNU gettext
-dnl Copyright (C) 1995-2011, 2015-2017 Free Software Foundation, Inc.
+dnl Copyright (C) 1995-2011, 2015-2018 Free Software Foundation, Inc.
 dnl
 dnl This program is free software: you can redistribute it and/or modify
 dnl it under the terms of the GNU General Public License as published by
@@ -74,6 +74,9 @@ dnl Checks for compiler output filename suffixes.
 AC_OBJEXT
 AC_EXEEXT
 
+dnl For a 64-bit build on AIX, AC_PROG_RANLIB is not sufficient.
+gl_PROG_AR_RANLIB
+
 dnl Make sure we see all GNU and Solaris extensions.
 gl_EARLY
 grgl_EARLY