bug-libtool
[Top][All Lists]
Advanced

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

bug#36214: Linking problem with AC_LIB_HAVE_LINKFLAGS


From: Bruno Haible
Subject: bug#36214: Linking problem with AC_LIB_HAVE_LINKFLAGS
Date: Fri, 14 Jun 2019 22:50:19 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-145-generic; KDE/5.18.0; x86_64; ; )

[CCing bug-libtool]

Mohammad Akhlaghi wrote:
> Upon further inspection, I noticed that because `AC_LIB_HAVE_LINKFLAGS' 
> actually returns the absolute address of the shared libraries, there is 
> also no reference to the GSL library (often linked with `-lgsl 
> -lgslcblas') in the `dependency_libs' variable of the created and 
> installed `libgnuastro.la'.
> 
> The fact that there is no reference to GSL (as a mandatory dependency of 
> libgnuastro) in `libgnuastro.la' is not good, because calls to libtool 
> that use the `.la' files will not know they should link with GSL.

Yes, such a libgnuastro.la file would be incorrect.

Here's the way to make sure libgnuastro.la contains the right dependencies:
  * For libraries that are provided by the same package:
    libgnuastro_la_LDFLAGS = ... ../gsl/libgsl.la ...
  * For libraries that are provided by other packages:
    libgnuastro_la_LDFLAGS = ... -lgsl ...
    Here, if you used AC_LIB_HAVE_LINKFLAGS([gsl], ...), you would use
    libgnuastro_la_LDFLAGS = ... @LTLIBGSL@ ...

To make sure your libgnuastro_la_LDFLAGS are complete, it's a good idea to
add   -lc -no-undefined  at the end:
    libgnuastro_la_LDFLAGS = ... -lc -no-undefined

> Do you know any library that uses `AC_LIB_HAVE_LINKFLAGS'? So far, I 
> have only seen Wget which uses it. I am really curious to see what I am 
> doing wrong, or how they solve all these problems it causes.

There are unit tests in gnulib/tests/havelib/rpathy/ and
gnulib/tests/havelib/rpathz. Also, the following packages use it:
  - gettext, uses $(LTLIBUNISTRING) @LTLIBICONV@ @LTLIBTHREAD@.
  - guile, uses $(LTLIBUNISTRING) $(LTLIBICONV) $(LTLIBINTL) $(LTLIBGMP) 
$(LTLIBLTDL).
  - gawk, uses $(LTLIBINTL).
  - texinfo, uses $(LTLIBICONV).
  - libffcall, uses $(LTLIBTHREAD).
  - recutils, uses $(LTLIBGCRYPT) $(LTLIBINTL) $(LTLIBREADLINE) $(LTLIBTHREAD).
  - gdbm, uses @LTLIBINTL@.
  - taler, uses $(LTLIBINTL).
  - and surely more.

Bruno






reply via email to

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