[Top][All Lists]

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

Enabling/disabling shared or static libs from

From: Pierre Sarrazin
Subject: Enabling/disabling shared or static libs from
Date: Fri, 8 Jun 2001 10:49:20 -0400
User-agent: Mutt/1.2.5i

I am autoconfiscating a large source tree with Autoconf (2.13),
Automake (1.4) and Libtool (1.3.5) on a GNU/Linux system.

In this tree, there are subtrees that constitute the sources for
shared libraries.  Other subtrees should give static libraries
because they will never be needed in shared form.  Yet other subtrees
define executable commands.

In the files that define the libraries, I specify that
I want to build libtool libraries, e.g.,

One problem is that libtool then compiles every source file twice:
once with position-independent code for a shared library, and once
with position-dependent code for a static library.

None of the libraries need to be created in both shared and static
form.  Thus, compiling twice wastes time and disk space.

I know that I can specify AC_DISABLE_STATIC before AM_PROG_LIBTOOL
in the file.  But then, all libraries are created in
shared form, which is inappropriate in my case.  This solution is
too centralized.

Logically, it is in a file that I would like to ask
that a specific library should be static.

There is one file in which I build two libraries:


libutils should be static, while libmem should be shared.

I tried adding the -static flag to the *_LDFLAGS variable:

    libutils_la_LDFLAGS = -version-info 0:0:0 -no-undefined -static

But the source files are still compiled twice.

Does automake support what I am trying to say?

I would not mind if all source files were compiled as
position-independent code, even for static libraries.

Pierre Sarrazin <sarrazip -at- sympatico -dot- ca>

reply via email to

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