bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sourceware configure always causes static linking against libintl?


From: Eli Zaretskii
Subject: sourceware configure always causes static linking against libintl?
Date: Mon, 29 Mar 2021 15:32:19 +0300

I'm trying to understand why building GDB on MS-Windows insists on
linking against the static version of libintl (and libiconv) instead
of the corresponding shared libraries.  Can someone please help me
understand that?

This is using mingw.org's MinGW tools.  I have both static libintl.a
and import library libintl.dll.a installed in the default library
search directory, plus libintl-8.dll shared library in the sibling
$prefix/bin directory.  And yet configuring GDB insists on linking
against libintl.a.  Here's the relevant excerpt from int/config.intl:

  USE_NLS='yes'
  LIBINTL='d:/usr/lib/libintl.a d:/usr/lib/libiconv.a'
  LIBINTL_DEP=''
  INCINTL=''

It looks like this is determined by intl/configure, and in particular
it seems like config/gettext.m4 forcefull uses libintl.a, here:

    ifelse(gt_included_intl, yes, [
        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
          dnl GNU gettext is not found in the C library.
          dnl Fall back on included GNU gettext library.
          nls_cv_use_gnu_gettext=yes
        fi
      fi

      if test "$nls_cv_use_gnu_gettext" = "yes"; then
        dnl Mark actions used to generate GNU NLS library.
        BUILD_INCLUDED_LIBINTL=yes
        USE_INCLUDED_LIBINTL=yes
        
LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a
 $LIBICONV"
        
LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a
 $LTLIBICONV"
        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
      fi

Is my understanding correct?  If so, why does the configury do that,
and how can I force it to link against the DLL instead?

I'm asking because linking against the static libraries causes these
warnings from libtool:

  *** Warning: Trying to link with static lib archive d:/usr/lib/libintl.a.
  *** I have the capability to make that library automatically link in when
  *** you link to this library.  But I can only do this if you have a
  *** shared version of the library, which you do not appear to have
  *** because the file extensions .a of this argument makes me believe
  *** that it is just a static archive that I should not use here.

The resulting GDB binary links and works fine, so I think these
warnings are harmless.  But still, I'd like to avoid them if possible,
and I'm mainly surprised by this "preference" for static libraries,
which AFAIU goes against the current trend to link against shared
libraries as much as possible.

TIA



reply via email to

[Prev in Thread] Current Thread [Next in Thread]