From 27767b945e17aafacd5766aee154013fb11f0b12 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Tue, 19 Jan 1999 23:45:01 +0000 Subject: [PATCH] * mdemo/Makefile.am (mdemo_LDFLAGS, mdemo_LDADD): moved -dlopen flags to LDADD * doc/libtool.texi (Using Automake): how to add -dlopen to LDADD --- ChangeLog | 6 ++++++ doc/libtool.texi | 35 +++++++++++++++++++++++++++++++++-- mdemo/Makefile.am | 8 ++++---- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e96f0fe..91b3cf39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1999-01-19 Alexandre Oliva + + * mdemo/Makefile.am (mdemo_LDFLAGS, mdemo_LDADD): moved -dlopen + flags to LDADD + * doc/libtool.texi (Using Automake): how to add -dlopen to LDADD + 1999-01-19 Gary V. Vaughan From Andrey Slepuhin diff --git a/doc/libtool.texi b/doc/libtool.texi index 1be7d068..0953acc9 100644 --- a/doc/libtool.texi +++ b/doc/libtool.texi @@ -1373,6 +1373,36 @@ hell_debug_LDADD = libhello.la hell_debug_LDFLAGS = -static @end example +The flags @samp{-dlopen} or @samp{-dlpreopen} (@pxref{Link mode}) would +fit better in the @var{program_LDADD} variable. Unfortunately, GNU +automake, up to release 1.4, doesn't accept these flags in a +@var{program_LDADD} variable, so you have the following alternatives: + +@itemize @bullet +@item +add them to @var{program_LDFLAGS}, and optionally list the libraries in +@var{program_DEPENDENCIES}, then wait for a release of GNU automake that +accepts these flags where they belong; + +@item +surround the flags between quotes, but then you must set +@var{program_DEPENDENCIES} too: + +@example +program_LDADD = "-dlopen" libfoo.la +program_DEPENDENCIES = libfoo.la +@end example + +@item +set and @samp{AC_SUBST} variables @var{DLOPEN} and @var{DLPREOPEN} in +@file{configure.in} and use @samp{@@DLOPEN@@} and @samp{@@DLPREOPEN@@} +instead of @samp{-dlopen} and @samp{-dlpreopen} in +@samp{program_LDADD}. Automake will discard @samp{AC_SUBST}ed variables +from dependencies, so it will behave exactly as we expect it to behave +when it accepts these flags in @samp{program_LDADD}. But hey!, this is +ugly! +@end itemize + You may use the @samp{program_LDFLAGS} variable to stuff in any flags you want to pass to libtool while linking @samp{program} (such as @samp{-static} to avoid linking uninstalled shared libtool libraries). @@ -1622,11 +1652,12 @@ and, to @file{Makefile.in} or @file{Makefile.am}: @example LIBTOOL_DEPS = @@LIBTOOL_DEPS@@ libtool: $(LIBTOOL_DEPS) - ./config.status --recheck + $(SHELL) ./config.status --recheck @end example If you are using GNU automake, you can omit the assignment, as automake -will take care of it. +will take care of it. You'll obviously have to create some dependency +on @file{libtool}. @end defmac diff --git a/mdemo/Makefile.am b/mdemo/Makefile.am index 228943c3..31600e7a 100644 --- a/mdemo/Makefile.am +++ b/mdemo/Makefile.am @@ -24,14 +24,14 @@ bin_PROGRAMS = mdemo mdemo.debug # Create a version of mdemo that does dlopen. mdemo_SOURCES = main.c -mdemo_LDADD = ../libltdl/libltdlc.la -mdemo_LDFLAGS = -dlopen foo1.la -dlopen libfoo2.la \ - -export-dynamic ## FIXME: remove this when libtool and libltdl +mdemo_LDFLAGS = -export-dynamic ## FIXME: remove this when libtool and libltdl ## handle dependencies of modules +## The quotes around -dlopen below fool automake into accepting it +mdemo_LDADD = ../libltdl/libltdlc.la "-dlopen" foo1.la "-dlopen" libfoo2.la mdemo_DEPENDENCIES = ../libltdl/libltdlc.la foo1.la libfoo2.la # Create an easier-to-debug version of mdemo. mdemo_debug_SOURCES = $(mdemo_SOURCES) -mdemo_debug_LDADD = $(mdemo_LDADD) mdemo_debug_LDFLAGS = -static $(mdemo_LDFLAGS) +mdemo_debug_LDADD = $(mdemo_LDADD) mdemo_debug_DEPENDENCIES = $(mdemo_DEPENDENCIES)