bug-gnulib
[Top][All Lists]
Advanced

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

Re: Integrating gnulib into shared library


From: Bruno Haible
Subject: Re: Integrating gnulib into shared library
Date: Sun, 07 Jan 2018 20:34:47 +0100
User-agent: KMail/5.1.3 (Linux/4.4.0-101-generic; KDE/5.18.0; x86_64; ; )

Hi,

> I am currently working on a project that uses the gnulib list utility
> and distrubutes a shared library. My problem is that a static library
> cannot be linked into a shared library, which means that gnulib is not
> compiled into my project.
> 
> Is there an easy way that I can fix this?

The easiest way to fix this consists of two steps:

1) In the gnulib-tool invocation, use the option --libtool.
   Rationale: Libtool libraries *can* be included in shared libraries.

2) Use an Automake *_LIBADD variable to specify that it should be linked
   into your library:
     libfoo_la_LDADD = libgnu.la ...

For an example of this technique, see the libgettextpo:
http://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=gettext-tools/libgettextpo/Makefile.am

Bruno




reply via email to

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