libctf: support platforms with separate libintl
authorNick Alcock <nick.alcock@oracle.com>
Mon, 16 Dec 2019 14:17:26 +0000 (14:17 +0000)
committerNick Alcock <nick.alcock@oracle.com>
Fri, 26 Jun 2020 14:56:39 +0000 (15:56 +0100)
We were not using the right configure machinery to spot libintl on
platforms where it was required, leading to the spurious failure of
various configure tests (e.g. for things like ELF support in BFD).

libctf/
* aclocal.m4: Add config/gettext-sister.m4: Shuffle into
alphabetical order.
* configure.ac: Add ZW_GNU_GETTEXT_SISTER_DIR.
* config.h.in: Regenerated.
* Makefile.in: Likewise.
* configure: Likewise.

libctf/ChangeLog
libctf/Makefile.in
libctf/aclocal.m4
libctf/config.h.in
libctf/configure
libctf/configure.ac

index a631d55464bc46daf21bd5e74b30ee228dffaeb9..c69b764fad47e69adb7a6582bb0091495af977da 100644 (file)
@@ -1,3 +1,12 @@
+2020-06-26  Nick Alcock  <nick.alcock@oracle.com>
+
+       * aclocal.m4: Add config/gettext-sister.m4: Shuffle into
+       alphabetical order.
+       * configure.ac: Add ZW_GNU_GETTEXT_SISTER_DIR.
+       * config.h.in: Regenerated.
+       * Makefile.in: Likewise.
+       * configure: Likewise.
+
 2020-06-26  Nick Alcock  <nick.alcock@oracle.com>
 
        * ctf-create.c: Include <unistd.h>.
index 3e8a0172f7970ee51596f28a462d588a5c4897c5..9e6f2551a5606ce0afcb4f12b1731bb13ae2e73a 100644 (file)
@@ -113,6 +113,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
        $(top_srcdir)/../config/acx.m4 \
        $(top_srcdir)/../config/depstand.m4 \
+       $(top_srcdir)/../config/gettext-sister.m4 \
        $(top_srcdir)/../config/lead-dot.m4 \
        $(top_srcdir)/../config/override.m4 \
        $(top_srcdir)/../config/warnings.m4 \
@@ -297,12 +298,15 @@ AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
 BFD_DEPENDENCIES = @BFD_DEPENDENCIES@
 BFD_LIBADD = @BFD_LIBADD@
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
 CYGPATH_W = @CYGPATH_W@
+DATADIRNAME = @DATADIRNAME@
 DEFS = @DEFS@
 DEPDIR = @DEPDIR@
 DSYMUTIL = @DSYMUTIL@
@@ -313,14 +317,20 @@ ECHO_T = @ECHO_T@
 EGREP = @EGREP@
 EXEEXT = @EXEEXT@
 FGREP = @FGREP@
+GENCAT = @GENCAT@
+GMSGFMT = @GMSGFMT@
 GREP = @GREP@
+INCINTL = @INCINTL@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INSTOBJEXT = @INSTOBJEXT@
 LD = @LD@
 LDFLAGS = @LDFLAGS@
+LIBINTL = @LIBINTL@
+LIBINTL_DEP = @LIBINTL_DEP@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
 LIBTOOL = @LIBTOOL@
@@ -344,6 +354,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
 RANLIB = @RANLIB@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
@@ -351,10 +362,12 @@ SHARED_LDFLAGS = @SHARED_LDFLAGS@
 SHARED_LIBADD = @SHARED_LIBADD@
 SHELL = @SHELL@
 STRIP = @STRIP@
+USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 VERSION_FLAGS = @VERSION_FLAGS@
 WARN_PEDANTIC = @WARN_PEDANTIC@
 WERROR = @WERROR@
+XGETTEXT = @XGETTEXT@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
index 15d96cd63e30bcfb18718659f3b8b8e81e30150a..8ae4b5346299c76daece6361db0bfe2c0bccc814 100644 (file)
@@ -1230,6 +1230,7 @@ AC_SUBST([am__untar])
 m4_include([../bfd/acinclude.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
+m4_include([../config/gettext-sister.m4])
 m4_include([../config/lead-dot.m4])
 m4_include([../config/override.m4])
 m4_include([../config/warnings.m4])
index ac0eb3e12f86ded67548dd1fe079d613be5009cc..e663c694d85133361314fe6b28dde1f09c525e12 100644 (file)
@@ -3,6 +3,10 @@
 /* Define if building universal (internal helper macro) */
 #undef AC_APPLE_UNIVERSAL_BUILD
 
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
+
 /* Whether libbfd was configured for an ELF target. */
 #undef HAVE_BFD_ELF
 
index 58263e5632db40cc888c892e1fde96c9e0d7886c..1dc1b65fac31756c38e29268a0f502e1e87f97c5 100755 (executable)
@@ -680,6 +680,18 @@ build_vendor
 build_cpu
 build
 LIBTOOL
+CATOBJEXT
+GENCAT
+INSTOBJEXT
+DATADIRNAME
+CATALOGS
+POSUB
+GMSGFMT
+XGETTEXT
+INCINTL
+LIBINTL_DEP
+LIBINTL
+USE_NLS
 ac_ct_AR
 AR
 RANLIB
@@ -5283,6 +5295,76 @@ unknown)
   ;;
 esac
 
+# If we haven't got the data from the intl directory,
+# assume NLS is disabled.
+USE_NLS=no
+LIBINTL=
+LIBINTL_DEP=
+INCINTL=
+XGETTEXT=
+GMSGFMT=
+POSUB=
+
+if test -f  ../intl/config.intl; then
+  .  ../intl/config.intl
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
+$as_echo_n "checking whether NLS is requested... " >&6; }
+if test x"$USE_NLS" != xyes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define ENABLE_NLS 1" >>confdefs.h
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for catalogs to be installed" >&5
+$as_echo_n "checking for catalogs to be installed... " >&6; }
+  # Look for .po and .gmo files in the source directory.
+  CATALOGS=
+  XLINGUAS=
+  for cat in $srcdir/po/*.gmo $srcdir/po/*.po; do
+    # If there aren't any .gmo files the shell will give us the
+    # literal string "../path/to/srcdir/po/*.gmo" which has to be
+    # weeded out.
+    case "$cat" in *\**)
+      continue;;
+    esac
+    # The quadruple backslash is collapsed to a double backslash
+    # by the backticks, then collapsed again by the double quotes,
+    # leaving us with one backslash in the sed expression (right
+    # before the dot that mustn't act as a wildcard).
+    cat=`echo $cat | sed -e "s!$srcdir/po/!!" -e "s!\\\\.po!.gmo!"`
+    lang=`echo $cat | sed -e "s!\\\\.gmo!!"`
+    # The user is allowed to set LINGUAS to a list of languages to
+    # install catalogs for.  If it's empty that means "all of them."
+    if test "x$LINGUAS" = x; then
+      CATALOGS="$CATALOGS $cat"
+      XLINGUAS="$XLINGUAS $lang"
+    else
+      case "$LINGUAS" in *$lang*)
+        CATALOGS="$CATALOGS $cat"
+        XLINGUAS="$XLINGUAS $lang"
+        ;;
+      esac
+    fi
+  done
+  LINGUAS="$XLINGUAS"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINGUAS" >&5
+$as_echo "$LINGUAS" >&6; }
+
+
+    DATADIRNAME=share
+
+  INSTOBJEXT=.mo
+
+  GENCAT=gencat
+
+  CATOBJEXT=.gmo
+
+fi
 
 # Check whether --enable-shared was given.
 if test "${enable_shared+set}" = set; then :
@@ -11431,7 +11513,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11434 "configure"
+#line 11516 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -11537,7 +11619,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<_LT_EOF
-#line 11540 "configure"
+#line 11622 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
index f7e0cace52cd4bcbf6f33bdc9ac0db067a076e91..f31108c0fade9a9efb2ee895ab5ca342676796fc 100644 (file)
@@ -31,6 +31,7 @@ AC_PROG_MAKE_SET
 AC_PROG_CC
 AC_PROG_RANLIB
 AM_PROG_AR
+ZW_GNU_GETTEXT_SISTER_DIR
 
 dnl Default to a non shared library.  This may be overridden by the
 dnl configure option --enable-shared.