summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2014-11-26 19:36:47 +0000
committerGary V. Vaughan <gary@gnu.org>2014-11-26 19:47:43 +0000
commit1acee63da4b98fecdb59b3ce4b67a4d5fbd21323 (patch)
tree1ac0737f2e190a7278e2ee2a9670fd4ce43cb5eb
parent845ff0b76837a630eb54d23eb66912339b589a65 (diff)
downloadlibtool-1acee63da4b98fecdb59b3ce4b67a4d5fbd21323.tar.gz
ltdl: fix a long standing duplicate `-ldl' bug in the link line.
* m4/ltdl.m4 (LT_LIB_DLLOAD): Save contents of LIBS before calling AC_SEARCH_LIBS, which prepends to LIBS by default, and restore afterwards. We set LIBADD_DLOPEN and LIBADD_SHL_LOAD so that dynamic loader libraries can be added selectively only where they are needed. * NEWS: Update. Signed-off-by: Gary V. Vaughan <gary@gnu.org>
-rw-r--r--NEWS11
-rw-r--r--m4/ltdl.m42
2 files changed, 13 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 75da6ea0..2782511c 100644
--- a/NEWS
+++ b/NEWS
@@ -12,10 +12,21 @@ NEWS - list of user-visible changes between releases of GNU Libtool
- Installation of 'libtoolize' once again obeys '--program-prefix',
'--program-suffix' and '--program-transform-name' configure options.
+
- `libtoolize` doesn't remove any files that it can't reinstall,
including old versions of the snippet directory, and gnulib's
version of the argz module and supporting files.
+** Important incompatible changes:
+
+ - LT_LIB_DLLOAD no longer prepends -ldl or -ldld to LIBS, causing
+ duplicate occurrences in libltdl link lines. If you need to
+ add a library for dlopen() or shl_load() in your Makefile, then
+ use $(LIBADD_DLOPEN) or $(LIBADD_SHL_LOAD) respectively. If you
+ are using libltdl, this all happens automatically, and the only
+ difference you'll see is no more duplicated library names in the
+ verbose link line.
+
** Changes in supported systems or compilers:
- Preliminary support for tcc on linux*. Although it already worked
diff --git a/m4/ltdl.m4 b/m4/ltdl.m4
index eeb37ac4..41198441 100644
--- a/m4/ltdl.m4
+++ b/m4/ltdl.m4
@@ -651,6 +651,7 @@ LT_DLLOADERS=
AC_SUBST([LT_DLLOADERS])
AC_LANG_PUSH([C])
+lt_dlload_save_LIBS=$LIBS
LIBADD_DLOPEN=
AC_SEARCH_LIBS([dlopen], [dl],
@@ -734,6 +735,7 @@ dnl This isn't used anymore, but set it for backwards compatibility
LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
AC_SUBST([LIBADD_DL])
+LIBS=$lt_dlload_save_LIBS
AC_LANG_POP
])# LT_LIB_DLLOAD