From: Bruno Haible Date: Tue, 2 Jan 2018 18:38:43 +0000 (+0100) Subject: Fix 'ar' invocation when cross-compiling and in 64-bit mode on AIX. X-Git-Tag: v0.20~443 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d527cb6e70d82d109c08c331238e63dfa9c36a77;p=thirdparty%2Fgettext.git Fix 'ar' invocation when cross-compiling and in 64-bit mode on AIX. Reported by Benedikt Morbach at . * 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. --- diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index 71adec3f1..88d5c98f0 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -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 diff --git a/gettext-runtime/intl/Makefile.in b/gettext-runtime/intl/Makefile.in index 63a5c8763..44bed9dbf 100644 --- a/gettext-runtime/intl/Makefile.in +++ b/gettext-runtime/intl/Makefile.in @@ -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@) diff --git a/gettext-runtime/libasprintf/configure.ac b/gettext-runtime/libasprintf/configure.ac index 736bf48b2..6df1b337d 100644 --- a/gettext-runtime/libasprintf/configure.ac +++ b/gettext-runtime/libasprintf/configure.ac @@ -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 diff --git a/gettext-runtime/m4/intl.m4 b/gettext-runtime/m4/intl.m4 index 61cd9f631..0cc18d9ea 100644 --- a/gettext-runtime/m4/intl.m4 +++ b/gettext-runtime/m4/intl.m4 @@ -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;; diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index db36ddc06..ca6934c21 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -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