]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make the rpath thing work in projects that use libtool.
authorBruno Haible <bruno@clisp.org>
Thu, 24 Jan 2002 12:34:28 +0000 (12:34 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 21 Jun 2009 23:06:59 +0000 (01:06 +0200)
20 files changed:
ChangeLog
Makefile.am
doc/ChangeLog
doc/gettext.texi
intl/ChangeLog
intl/Makefile.in
lib/ChangeLog
lib/Makefile.am
m4/ChangeLog
m4/gettext.m4
m4/iconv.m4
m4/lib-link.m4
src/ChangeLog
src/Makefile.am
tests/ChangeLog
tests/Makefile.am
tests/lang-c
tests/lang-c++
tests/lang-objc
tests/rpath-2.README

index c4cef8709682b37200492ae737bed3d4b6f1338a..6b78857d1cfb730284fb2a204e7d6d2aba64d161 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-01-24  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am ($(srcdir)/tests/rpathy/aclocal.m4): Fix dependencies.
+
 2002-01-21  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (EXTRA_DIST): Add os2/configure.awk.
index 862aa30edeb8354de9897455c5035917f91aed6b..31b9e2a06df875e8e758ccf9f3e2184ded3e8f74 100644 (file)
@@ -65,7 +65,7 @@ $(srcdir)/tests/rpathx/configure: $(srcdir)/tests/rpathx/configure.in $(srcdir)/
 CONFIGURES_RPATHY = $(srcdir)/tests/rpathy/Makefile.in $(srcdir)/tests/rpathy/aclocal.m4 $(srcdir)/tests/rpathy/configure
 $(srcdir)/tests/rpathy/Makefile.in: $(srcdir)/tests/rpathy/Makefile.am $(srcdir)/tests/rpathy/configure.in
        cd $(srcdir)/tests/rpathy && automake Makefile
-$(srcdir)/tests/rpathy/aclocal.m4: $(srcdir)/tests/rpathy/configure.in
+$(srcdir)/tests/rpathy/aclocal.m4: $(srcdir)/tests/rpathy/configure.in $(srcdir)/m4/lib-link.m4 $(srcdir)/m4/lib-prefix.m4 $(srcdir)/m4/lib-ld.m4
        cd $(srcdir)/tests/rpathy && aclocal -I ../../m4
 $(srcdir)/tests/rpathy/configure: $(srcdir)/tests/rpathy/configure.in $(srcdir)/tests/rpathy/aclocal.m4
        cd $(srcdir)/tests/rpathy && autoconf
index 232cf12fdb7a9919fe35a3f6fbe5e8f9f81bdb7e..3adff334f6694e09024f94e73e0e18bb64e84004 100644 (file)
@@ -1,3 +1,10 @@
+2002-01-24  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.texi (src/Makefile): Recommend @LIBINTL@, @LTLIBINTL@
+       instead of @INTLLIBS@.
+       (AM_GNU_GETTEXT): Likewise.
+       (AM_ICONV): Document variable @LTLIBICONV@.
+
 2002-01-12  Bruno Haible  <bruno@clisp.org>
 
        * gettext.texi: Remove the parentheses around the expansions of N_ and
index 43cff90b19e6278d205db29beed4c07f29666956..031f2962c53a2dfc9c18d24c49d69ad645686d54 100644 (file)
@@ -5521,12 +5521,14 @@ Note that @code{@@datadir@@} defaults to @samp{$(prefix)/share}, thus
 @code{$(localedir)} defaults to @samp{$(prefix)/share/locale}.
 
 @item
-You should ensure that the final linking will use @code{@@INTLLIBS@@} as
-a library.  An easy way to achieve this is to manage that it gets into
-@code{LIBS}, like this:
+You should ensure that the final linking will use @code{@@LIBINTL@@} or
+@code{@@LTLIBINTL@@} as a library.  @code{@@LIBINTL@@} is for use without
+@code{libtool}, @code{@@LTLIBINTL@@} is for use with @code{libtool}. An
+easy way to achieve this is to manage that it gets into @code{LIBS}, like
+this:
 
 @example
-LIBS = @@INTLLIBS@@ @@LIBS@@
+LIBS = @@LIBINTL@@ @@LIBS@@
 @end example
 
 In most packages internationalized with GNU @code{gettext}, one will
@@ -5535,11 +5537,11 @@ functions will be build.  (You need at least the few functions which the
 GNU @code{gettext} Library itself needs.)  However some of the functions
 in the @file{lib/} also give messages to the user which of course should be
 translated, too.  Taking care of this, the support library (say
-@file{libsupport.a}) should be placed before @code{@@INTLLIBS@@} and
+@file{libsupport.a}) should be placed before @code{@@LIBINTL@@} and
 @code{@@LIBS@@} in the above example.  So one has to write this:
 
 @example
-LIBS = ../lib/libsupport.a @@INTLLIBS@@ @@LIBS@@
+LIBS = ../lib/libsupport.a @@LIBINTL@@ @@LIBS@@
 @end example
 
 @item
@@ -5670,10 +5672,12 @@ The @code{AM_GNU_GETTEXT} macro determines whether GNU gettext is
 available and should be used. If so, it sets the @code{USE_NLS} variable
 to @samp{yes}; it defines @code{ENABLE_NLS} to 1 in the autoconf
 generated configuration file (usually called @file{config.h}); it sets
-the variable @code{LIBINTL} to the linker options for use in a Makefile;
-it adds an @samp{-I} option to @code{CPPFLAGS} if necessary.
-In the negative case, it sets @code{USE_NLS} to @samp{no}; it sets
-@code{LIBINTL} to empty and doesn't change @code{CPPFLAGS}.
+the variables @code{LIBINTL} and @code{LTLIBINTL} to the linker options
+for use in a Makefile (@code{LIBINTL} for use without libtool,
+@code{LTLIBINTL} for use with libtool); it adds an @samp{-I} option to
+@code{CPPFLAGS} if necessary. In the negative case, it sets
+@code{USE_NLS} to @samp{no}; it sets @code{LIBINTL} and @code{LTLIBINTL}
+to empty and doesn't change @code{CPPFLAGS}.
 
 The complexities that @code{AM_GNU_GETTEXT} deals with are the following:
 
@@ -5698,14 +5702,14 @@ to the user's locale encoding.
 GNU @code{libintl}, if installed, is not necessarily already in the
 run time library search path. To avoid the need for setting an environment
 variable like @code{LD_LIBRARY_PATH}, the macro adds the appropriate
-run time search path options to the @code{LIBINTL} variable. This works
-on most systems, but not on some operating systems with limited shared
-library support, like SCO.
+run time search path options to the @code{LIBINTL} and @code{LTLIBINTL}
+variables. This works on most systems, but not on some operating systems
+with limited shared library support, like SCO.
 
 @item
 GNU @code{libintl} relies on POSIX @code{iconv}. The macro checks for
 linker options needed to use iconv and appends them to the @code{LIBINTL}
-variable.
+and @code{LTLIBINTL} variables.
 @end itemize
 
 @node AM_ICONV,  , AM_GNU_GETTEXT, autoconf macros
@@ -5718,10 +5722,12 @@ variable to @samp{yes}; it defines @code{HAVE_ICONV} to 1 in the autoconf
 generated configuration file (usually called @file{config.h}); it defines
 @code{ICONV_CONST} to @samp{const} or to empty, depending on whether the
 second argument of @code{iconv()} is of type @samp{const char **} or
-@samp{char **}; it sets the variable @code{LIBICONV} to the linker options
-for use in a Makefile; it adds an @samp{-I} option to @code{CPPFLAGS} if
-necessary. If not found, it sets @code{LIBICONV} to empty and doesn't
-change @code{CPPFLAGS}.
+@samp{char **}; it sets the variables @code{LIBICONV} and
+@code{LTLIBICONV} to the linker options for use in a Makefile
+(@code{LIBICONV} for use without libtool, @code{LTLIBICONV} for use with
+libtool); it adds an @samp{-I} option to @code{CPPFLAGS} if
+necessary. If not found, it sets @code{LIBICONV} and @code{LTLIBICONV} to
+empty and doesn't change @code{CPPFLAGS}.
 
 The complexities that @code{AM_ICONV} deals with are the following:
 
index ddb7823a3b8482b37eb65a0aae32838064a3152a..51b9c9962c0c7079a9a2cb0c6e02b9f6792cf213 100644 (file)
@@ -1,3 +1,7 @@
+2002-01-24  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.in (libintl.la): Use @LTLIBICONV@ instead of @LIBICONV@.
+
 2002-01-10  Andrew Zabolotny  <zap@cobra.ru>
            Bruno Haible  <bruno@clisp.org>
 
index 9a8d294ddeff4823f47f1e4f69a3abcb5a9e0658..a00f92d4359d32c1cec05e3421ee56bfbab170eb 100644 (file)
@@ -119,7 +119,7 @@ libintl.a libgnuintl.a: $(OBJECTS)
 libintl.la libgnuintl.la: $(OBJECTS)
        $(LIBTOOL) --mode=link \
          $(CC) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) $(LDFLAGS) -o $@ \
-         $(OBJECTS) @LIBICONV@ -lc \
+         $(OBJECTS) @LTLIBICONV@ -lc \
          -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE) \
          -rpath $(libdir) \
          -no-undefined
index feda4f4dc344bbc145f7bb2dc742725bd5d9b707..1a9d0c27f8209c21350fe8a091da2e2e54131ffd 100644 (file)
@@ -1,3 +1,8 @@
+2002-01-24  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (libgettextlib_la_LDFLAGS): Use @LTLIBINTL@ instead of
+       @INTLLIBS@, and @LTLIBICONV@ instead of @LIBICONV@.
+
 2002-01-19  Bruno Haible  <bruno@clisp.org>
 
        * xerror.c (multiline_warning): Add a newline if the message doesn't
index fdeb4748b1be031e48e8a26b3c3505785ac8a60f..bb1b0306ad19fe3022b3c43bded8b1776cd00ad4 100644 (file)
@@ -86,11 +86,11 @@ UNUSED_SOURCE = \
 
 libgettextlib_la_LIBADD = @LTALLOCA@ @LTLIBOBJS@
 
-# Need @INTLLIBS@ because many source files use gettext().
-# Need @LIBICONV@ because linebreak.c uses iconv().
+# Need @LTLIBINTL@ because many source files use gettext().
+# Need @LTLIBICONV@ because linebreak.c uses iconv().
 libgettextlib_la_LDFLAGS = \
   -release @VERSION@ \
-  @INTLLIBS@ @LIBICONV@ -lc -no-undefined
+  @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
 
 # Extra files to be installed.
 
index 503c9b26bd33a940738d50fc5fd16893a2adee62..5898de05409a8c2076e8fe0ed9abbc51dd6fe2d7 100644 (file)
@@ -1,3 +1,12 @@
+2002-01-24  Bruno Haible  <bruno@clisp.org>
+
+       * lib-link.m4 (AC_LIB_LINKFLAGS): Also define LTLIB${NAME}.
+       (AC_LIB_HAVE_LINKFLAGS): Likewise.
+       (AC_LIB_LINKFLAGS_BODY): Also define LTLIB${NAME}.
+       * iconv.m4 (AM_ICONV_LINK): Also define LTLIBICONV.
+       * gettext.m4 (AM_GNU_GETTEXT): Define LIBINTL and LTLIBINTL instead
+       of INTLLIBS.
+
 2002-01-20  Bruno Haible  <bruno@clisp.org>
 
        * lib-link.m4 (AC_LIB_LINKFLAGS): Fix quoting so that multiple
index bd83f81d55dc1e43a2ec3fa3b0d38a465f915775..30ea48957514cacf40c50a22cb088a6d74bd25af 100644 (file)
@@ -87,7 +87,8 @@ AC_DEFUN([AM_GNU_GETTEXT],
     BUILD_INCLUDED_LIBINTL=no
     USE_INCLUDED_LIBINTL=no
   ])
-  INTLLIBS=
+  LIBINTL=
+  LTLIBINTL=
   POSUB=
 
   dnl If we use NLS figure out what method
@@ -126,9 +127,10 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
           ifelse(gt_included_intl, yes, , [
             AM_ICONV_LINK
           ])
-          dnl Search for libintl and define LIBINTL and INCINTL accordingly.
-          dnl Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) because that would
-          dnl add "-liconv" to LIBINTL even if libiconv doesn't exist.
+          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+          dnl even if libiconv doesn't exist.
           AC_LIB_LINKFLAGS_BODY([intl])
           AC_CACHE_CHECK([for GNU gettext in libintl],
             gt_cv_func_gnugettext_libintl,
@@ -151,6 +153,7 @@ extern int _nl_msg_cat_cntr;],
                 [bindtextdomain ("", "");
 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
                [LIBINTL="$LIBINTL $LIBICONV"
+                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
                 gt_cv_func_gnugettext_libintl=yes
                ])
             fi
@@ -181,7 +184,8 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
         INTLOBJS="\$(GETTOBJS)"
         BUILD_INCLUDED_LIBINTL=yes
         USE_INCLUDED_LIBINTL=yes
-        INTLLIBS="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
+        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
 
@@ -208,7 +212,6 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
         AC_MSG_CHECKING([how to link with libintl])
         AC_MSG_RESULT([$LIBINTL])
-        INTLLIBS="$LIBINTL"
         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
       fi
 
@@ -257,8 +260,13 @@ return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("",
     AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
   ])
 
-  dnl Make all documented variables known to autoconf.
+  dnl For backward compatibility. Some Makefiles may be using this.
+  INTLLIBS="$LIBINTL"
   AC_SUBST(INTLLIBS)
+
+  dnl Make all documented variables known to autoconf.
+  AC_SUBST(LIBINTL)
+  AC_SUBST(LTLIBINTL)
   AC_SUBST(POSUB)
 ])
 
index 58b8a093d05d2d5e92b43e3edaadddf75e29ad4f..f81e8b995f69122fd2995942dc86fbfdfdd94c6a 100644 (file)
@@ -17,7 +17,8 @@ AC_DEFUN([AM_ICONV_LINK],
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
   AC_REQUIRE([AC_LIB_RPATH])
 
-  dnl Search for libiconv and define LIBICONV and INCICONV accordingly.
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
   AC_LIB_LINKFLAGS_BODY([iconv])
 
   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
@@ -60,8 +61,10 @@ AC_DEFUN([AM_ICONV_LINK],
     dnl either.
     CPPFLAGS="$am_save_CPPFLAGS"
     LIBICONV=
+    LTLIBICONV=
   fi
   AC_SUBST(LIBICONV)
+  AC_SUBST(LTLIBICONV)
 ])
 
 AC_DEFUN([AM_ICONV],
index 77f5114031181fa2e60eeed4152677de4edd66ad..e4633587e9e6e3c39168748e49d89e5190f44b12 100644 (file)
@@ -10,8 +10,8 @@ dnl From Bruno Haible.
 
 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets and AC_SUBSTs the LIB${NAME} variable and augments the CPPFLAGS
-dnl variable.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
 AC_DEFUN([AC_LIB_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
@@ -22,12 +22,15 @@ AC_DEFUN([AC_LIB_LINKFLAGS],
   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
     AC_LIB_LINKFLAGS_BODY([$1], [$2])
     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
   ])
   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
   AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
   dnl results of this search when this library appears as a dependency.
   HAVE_LIB[]NAME=yes
@@ -39,10 +42,10 @@ dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
 dnl searches for libname and the libraries corresponding to explicit and
 dnl implicit dependencies, together with the specified include files and
 dnl the ability to compile and link the specified testcode. If found, it
-dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} variable
-dnl and augments the CPPFLAGS variable, and #defines HAVE_LIB${NAME} to 1.
-dnl Otherwise, it sets and AC_SUBSTs HAVE_LIB${NAME}=no and LIB${NAME} to
-dnl empty.
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
 [
   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
@@ -51,7 +54,8 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
 
-  dnl Search for lib[]Name and define LIB[]NAME and INC[]NAME accordingly.
+  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+  dnl accordingly.
   AC_LIB_LINKFLAGS_BODY([$1], [$2])
 
   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
@@ -77,9 +81,11 @@ AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
     dnl $INC[]NAME either.
     CPPFLAGS="$ac_save_CPPFLAGS"
     LIB[]NAME=
+    LTLIB[]NAME=
   fi
   AC_SUBST([HAVE_LIB]NAME)
   AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
   undefine([Name])
   undefine([NAME])
 ])
@@ -114,7 +120,7 @@ AC_DEFUN([AC_LIB_RPATH],
 
 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
-dnl Sets the INC${NAME} and LIB${NAME} variables.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
 [
   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
@@ -146,8 +152,10 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
   dnl Search the library and its dependencies in $additional_libdir and
   dnl $LDFLAGS. Using breadth-first-seach.
   LIB[]NAME=
+  LTLIB[]NAME=
   INC[]NAME=
   rpathdirs=
+  ltrpathdirs=
   names_already_handled=
   names_next_round='$1 $2'
   while test -n "$names_next_round"; do
@@ -171,6 +179,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
           if test "$value" = yes; then
             eval value=\"\$LIB$uppername\"
             AC_LIB_APPENDTOVAR(LIB[]NAME, [$value])
+            eval value=\"\$LTLIB$uppername\"
+            AC_LIB_APPENDTOVAR(LTLIB[]NAME, [$value])
           else
             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
             dnl that this library doesn't exist. So just drop it.
@@ -178,7 +188,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
           fi
         else
           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
-          dnl and the already constructed $LIBNAME.
+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
           found_dir=
           found_la=
           found_so=
@@ -201,7 +211,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
             fi
           fi
           if test "X$found_dir" = "X"; then
-            for x in $LDFLAGS $LIB[]NAME; do
+            for x in $LDFLAGS $LTLIB[]NAME; do
               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
               case "$x" in
                 -L*)
@@ -230,84 +240,94 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
           fi
           if test "X$found_dir" != "X"; then
             dnl Found the library.
-            dnl Most of the following complexities is not needed when libtool
-            dnl is used.
-            ifdef([AC_PROG_][LIBTOOL], [], [
-              if test "X$found_so" != "X"; then
-                dnl Linking with a shared library. We attempt to hardcode its
-                dnl directory into the executable's runpath, unless it's the
-                dnl standard /usr/lib.
-                if test "X$found_dir" = "X/usr/lib"; then
-                  dnl No hardcoding is needed.
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+              dnl Linking with a shared library. We attempt to hardcode its
+              dnl directory into the executable's runpath, unless it's the
+              dnl standard /usr/lib.
+              if test "X$found_dir" = "X/usr/lib"; then
+                dnl No hardcoding is needed.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+              else
+                dnl Use an explicit option to hardcode DIR into the resulting
+                dnl binary.
+                dnl Potentially add DIR to ltrpathdirs.
+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                dnl The hardcoding into $LIBNAME is system dependent.
+                if test "$hardcode_direct" = yes; then
+                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+                  dnl resulting binary.
                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
                 else
-                  if test "$hardcode_direct" = yes; then
-                    dnl Using DIR/libNAME.so during linking hardcodes DIR into the
-                    dnl resulting binary.
+                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
+                    dnl Use an explicit option to hardcode DIR into the resulting
+                    dnl binary.
                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    dnl Potentially add DIR to rpathdirs.
+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
+                    haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
                   else
-                    if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
-                      dnl Use an explicit option to hardcode DIR into the resulting
-                      dnl binary.
-                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                      dnl Potentially add DIR to rpathdirs.
-                      dnl The rpathdirs will be appended to $LIBNAME at the end.
-                      haveit=
-                      for x in $rpathdirs; do
-                        if test "X$x" = "X$found_dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        rpathdirs="$rpathdirs $found_dir"
+                    dnl Rely on "-L$found_dir".
+                    dnl But don't add it if it's already contained in the LDFLAGS
+                    dnl or the already constructed $LIBNAME
+                    haveit=
+                    for x in $LDFLAGS $LIB[]NAME; do
+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
                       fi
+                    done
+                    if test -z "$haveit"; then
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                    fi
+                    if test "$hardcode_minus_L" != no; then
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
                     else
-                      dnl Rely on "-L$found_dir".
-                      dnl But don't add it if it's already contained in the LDFLAGS
-                      dnl or the already constructed $LIBNAME
-                      haveit=
-                      for x in $LDFLAGS $LIB[]NAME; do
-                        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                        if test "X$x" = "X-L$found_dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
-                      fi
-                      if test "$hardcode_minus_L" != no; then
-                        dnl FIXME: Not sure whether we should use
-                        dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                        dnl here.
-                        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
-                      else
-                        dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
-                        dnl here, because this doesn't fit in flags passed to the
-                        dnl compiler. So give up. No hardcoding.
-                        dnl FIXME: Not sure whether we should use
-                        dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
-                        dnl here.
-                        dnl FIXME: Which systems does this affect?
-                        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
-                      fi
+                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
+                      dnl here, because this doesn't fit in flags passed to the
+                      dnl compiler. So give up. No hardcoding. This affects only
+                      dnl very old systems.
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
                     fi
                   fi
                 fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                dnl Linking with a static library.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
               else
-                if test "X$found_a" != "X"; then
-                  dnl Linking with a static library.
-                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
-                else
-                  dnl We shouldn't come here, but anyway it's good to have a
-                  dnl fallback.
-            ])
-                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
-            ifdef([AC_PROG_][LIBTOOL], [], [
-                fi
+                dnl We shouldn't come here, but anyway it's good to have a
+                dnl fallback.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
               fi
-            ])
+            fi
             dnl Assume the include files are nearby.
             additional_includedir=
             case "$found_dir" in
@@ -320,27 +340,27 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
               dnl Potentially add $additional_includedir to $INCNAME.
               dnl But don't add it
               dnl   1. if it's the standard /usr/include,
-              dnl   2. if it's already present in $CPPFLAGS or the already
+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
+              dnl   3. if it's already present in $CPPFLAGS or the already
               dnl      constructed $INCNAME,
-              dnl   3. if it's /usr/local/include and we are using GCC on Linux,
               dnl   4. if it doesn't exist as a directory.
               if test "X$additional_includedir" != "X/usr/include"; then
                 haveit=
-                for x in $CPPFLAGS $INC[]NAME; do
-                  AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                  if test "X$x" = "X-I$additional_includedir"; then
-                    haveit=yes
-                    break
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux*) haveit=yes;;
+                    esac
                   fi
-                done
+                fi
                 if test -z "$haveit"; then
-                  if test "X$additional_includedir" = "X/usr/local/include"; then
-                    if test -n "$GCC"; then
-                      case $host_os in
-                        linux*) haveit=yes;;
-                      esac
+                  for x in $CPPFLAGS $INC[]NAME; do
+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
                     fi
-                  fi
+                  done
                   if test -z "$haveit"; then
                     if test -d "$additional_includedir"; then
                       dnl Really add $additional_includedir to $INCNAME.
@@ -366,36 +386,51 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                 case "$dep" in
                   -L*)
                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                    dnl Potentially add $additional_libdir to $LIBNAME.
+                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
                     dnl But don't add it
                     dnl   1. if it's the standard /usr/lib,
-                    dnl   2. if it's already present in $LDFLAGS or the already
+                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
+                    dnl   3. if it's already present in $LDFLAGS or the already
                     dnl      constructed $LIBNAME,
-                    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
                     dnl   4. if it doesn't exist as a directory.
                     if test "X$additional_libdir" != "X/usr/lib"; then
                       haveit=
-                      for x in $LDFLAGS $LIB[]NAME; do
-                        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                        if test "X$x" = "X-L$additional_libdir"; then
-                          haveit=yes
-                          break
+                      if test "X$additional_libdir" = "X/usr/local/lib"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux*) haveit=yes;;
+                          esac
                         fi
-                      done
+                      fi
                       if test -z "$haveit"; then
-                        if test "X$additional_libdir" = "X/usr/local/lib"; then
-                          if test -n "$GCC"; then
-                            case $host_os in
-                              linux*) haveit=yes;;
-                            esac
+                        haveit=
+                        for x in $LDFLAGS $LIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
                           fi
-                        fi
+                        done
                         if test -z "$haveit"; then
                           if test -d "$additional_libdir"; then
                             dnl Really add $additional_libdir to $LIBNAME.
                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
                           fi
                         fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
                       fi
                     fi
                     ;;
@@ -412,6 +447,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                   *)
                     dnl Most likely an immediate library name.
                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
                     ;;
                 esac
               done
@@ -422,6 +458,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
             dnl directories known to the linker should also be known to the
             dnl runtime loader, otherwise the system is severely misconfigured.)
             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
           fi
         fi
       fi
@@ -453,6 +490,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
       done
     fi
   fi
+  if test "X$ltrpathdirs" != "X"; then
+    dnl When using libtool, the option that works for both libraries and
+    dnl executables is -R. The -R options are cumulative.
+    for found_dir in $ltrpathdirs; do
+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+    done
+  fi
 ])
 
 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
index 0e0ddaf715152fa23025cf9c481b3f1a2997ad19..cea966f7fb53ae7625bade295e3a14e43f9b7fa5 100644 (file)
@@ -1,3 +1,9 @@
+2002-01-24  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (LDADD): Use @LTLIBINTL@ instead of @INTLLIBS@.
+       (libgettextsrc_la_LDFLAGS): Likewise. Use @LTLIBICONV@ instead of
+       @LIBICONV@.
+
 2002-01-21  Bruno Haible  <bruno@clisp.org>
 
        * msggrep.c (main): On SunOS4, don't pass option "-q" to grep.
index 25a7a326e70f1134e5980299f7ceea509c2c728a..1233ed9099435da3c0ac4c015a1ade7c92e7d656 100644 (file)
@@ -45,7 +45,7 @@ INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/lib -I../intl \
 -I$(top_srcdir)/intl
 DEFS = -DLOCALEDIR=\"$(localedir)\" -DGETTEXTJAR=\"$(jardir)/gettext.jar\" \
 -DLIBDIR=\"$(libdir)\" -DPROJECTSDIR=\"$(projectsdir)\" @DEFS@
-LDADD = ../lib/libgettextlib.la @INTLLIBS@
+LDADD = ../lib/libgettextlib.la @LTLIBINTL@
 
 SED = sed
 YACC = @YACC@ -d
@@ -99,12 +99,12 @@ urlget_SOURCES = urlget.c
 
 # How to build libgettextsrc.la.
 # Need ../lib/libgettextlib.la.
-# Need @INTLLIBS@ because many source files use gettext().
-# Need @LIBICONV@ because po-charset.c, po-lex.c, msgl-iconv.c, write-po.c use
-# iconv().
+# Need @LTLIBINTL@ because many source files use gettext().
+# Need @LTLIBICONV@ because po-charset.c, po-lex.c, msgl-iconv.c, write-po.c
+# use iconv().
 libgettextsrc_la_LDFLAGS = \
   -release @VERSION@ \
-  ../lib/libgettextlib.la @INTLLIBS@ @LIBICONV@ -lc -no-undefined
+  ../lib/libgettextlib.la @LTLIBINTL@ @LTLIBICONV@ -lc -no-undefined
 
 # Link dependencies.
 msgcmp_LDADD = libgettextsrc.la
index 3e4bff3c4315fa5e3f28bd1d302d75f89bd67216..4feac0468920dc2d6523c46f056915a3d7e2a8fe 100644 (file)
@@ -1,3 +1,11 @@
+2002-01-24  Bruno Haible  <bruno@clisp.org>
+
+       * lang-c: Use $LTLIBINTL instead of $INTLLIBS.
+       * lang-c++: Likewise.
+       * lang-objc: Likewise.
+       * Makefile.am (TESTS_ENVIRONMENT): Set LTLIBINTL instead of INTLLIBS.
+       (LDADD_no): Use @LTLIBINTL@ instead of @INTLLIBS@.
+
 2002-01-20  Bruno Haible  <bruno@clisp.org>
 
        * rpathx: New subdirectory.
index 6a13fe18fbd23c0f10d70f16a4b80d51332808af..0dccbcfd8c4d32c1df7ba6b9c1cb9b20cc64f293 100644 (file)
@@ -99,7 +99,7 @@ TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) PATH=.:../src:$$PATH \
                    CC='@CC@' CFLAGS='@CFLAGS@' \
                    CXX='@CXX@' CXXFLAGS='@CXXFLAGS@' \
                    CPPFLAGS='@CPPFLAGS@' LDFLAGS='@LDFLAGS@' \
-                   INTLLIBS='@INTLLIBS@' \
+                   LTLIBINTL='@LTLIBINTL@' \
                    TESTJAVA='@TESTJAVA@' \
                    CONFIG_SHELL='$(SHELL)' \
                    $(SHELL)
@@ -116,7 +116,7 @@ INCLUDES = -I.. -I$(top_srcdir)/lib -I$(top_srcdir)/intl
 DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
 LDADD = $(LDADD_@USE_INCLUDED_LIBINTL@)
 LDADD_yes = ../intl/libintl.la
-LDADD_no = ../intl/libgnuintl.la @INTLLIBS@
+LDADD_no = ../intl/libgnuintl.la @LTLIBINTL@
 noinst_PROGRAMS = tstgettext tstngettext cake
 tstgettext_SOURCES = tstgettext.c setlocale.c
 tstgettext_LDADD = ../lib/libgettextlib.la $(LDADD)
index b99413a3d7bf5bcb1a59875609e0087ee0065ae6..f18a737d6aed1a008eebbb012834c487168c1e26 100755 (executable)
@@ -46,11 +46,11 @@ int main (argc, argv)
 }
 EOF
 
-# Variable needed by INTLLIBS.
+# Variable needed by LTLIBINTL.
 top_builddir=..
 
 tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
-${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.c -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${INTLLIBS} \
+${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.c -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${LTLIBINTL} \
   || exit 1
 
 tmpfiles="$tmpfiles prog.pot"
index cd63a0b850878c4a3f2429c306faa79bd4c21de1..47c07281fd9a584dea0e24a6e7fd2fb18ee231c1 100755 (executable)
@@ -47,11 +47,11 @@ int main (int argc, char *argv[])
 }
 EOF
 
-# Variable needed by INTLLIBS.
+# Variable needed by LTLIBINTL.
 top_builddir=..
 
 tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
-${LIBTOOL} --quiet --mode=link ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.cc -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${INTLLIBS} \
+${LIBTOOL} --quiet --mode=link ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.cc -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${LTLIBINTL} \
   || exit 1
 
 tmpfiles="$tmpfiles prog.pot"
index 9dbd6be77be68e6bda5d59e3da5374ecad8bcc6d..160dc59a78ebf0fcb1dc4643f385696dfeccb4a5 100755 (executable)
@@ -60,11 +60,11 @@ int main (argc, argv)
 }
 EOF
 
-# Variable needed by INTLLIBS.
+# Variable needed by LTLIBINTL.
 top_builddir=..
 
 tmpfiles="$tmpfiles prog.${OBJEXT} prog${EXEEXT}"
-${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.m -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${INTLLIBS} \
+${LIBTOOL} --quiet --mode=link ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} -o prog prog.m -I.. -I$top_srcdir/lib ../lib/libgettextlib.la -I../intl ${LTLIBINTL} \
   || exit 1
 
 tmpfiles="$tmpfiles prog.pot"
index 0a7305b787d7f9ad7ee51f26fa8f570305aa0f08..be2e9c0f1a30b2508a2fd71e68ef7d2106e23ae3 100644 (file)
@@ -17,18 +17,7 @@ rpath-2 u v w
                   AC_LIB_LINKFLAGS argument instead.
 
 The rpath-2* tests are sensitive to
-  - incomplete shared library in the system,
+  - incomplete shared library support in the system,
   - bugs in libtool that creates the shared libraries,
   - bugs in lib-link.m4.
 
-Known failures:
-
-* FreeBSD4: rpath-2bad, rpath-2bbd fail because of a combination of a bug
-  in libtool (the libtool command line for creating librpathy.la contains
-  a -rpath command, but the resulting gcc command line doesn't) and a bug
-  in FreeBSD's runtime loader (it searches for librpathx.so.0 twice, and
-  in the second search it not only ignores the success in the first search
-  but also the rpath given in the executable).
-
-* OSF/1 4.0: rpath-2bbd fails.
-