libtool
[Top][All Lists]
Advanced

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

Passing info from subdirs back to main configure


From: Borsenkow Andrej
Subject: Passing info from subdirs back to main configure
Date: 09 May 2002 14:31:16 +0400

The following case:

there is main program which is built always and arbitrarily number of
modules that can be both built statically into main program or as shared
modules or not at all. The goal is to make each module as self-contained
as possible - i.e. it should include all needed configure checks and
ideally adding new module is just untar, possibly run a simple script to
add module directory to configuration and rebuild.

There are two problems:

- is it possible for configure in subdirs access test results of
top-level configure?

- modules may need additional libraries (as determined by configure).
Assuming that module is linked statically, how can it pass this
information to top-level configure so these libraries can be included
when linking main program?

- decision to build module statically or dynamically or to not build at
all happens at configuration (configure) time - in the worst case it is
decided by module itself.

So far I can think of two ways (library problem - not test results):

- using script that build configure.ac from fragments provided by
modules. This means we get one large blob and every time new module is
added (no, it is not expected to happen very often :-) configure.ac is
to be rebuilt

- using AC_CONFIG_SUBDIRS (possibly with some intelligent options
passing) combined with libtool. Am I right that if

 * every modules is built using libtool --mode=link ... -module -lX -lY
... (possibly with or without dynamical linking)
 * and main program is built with libtool --mode=link ... -dlopen
module1 ... -dlopen moduleN

libtool will recognize if moduleX is built statically and links it
statically into main program and will also automatically add any
dependent libraries when linking main program? In this case the only
problem is - how can I pass from top-level configure the information
about static built? I.e. if user wants one particular module to be
linked in statically - how can I pass extra option (--disable-dynamic?)
to configure of this module _only_ from top-level configure.


TIA

-andrej

If you are curious - the program in question is Zsh :-) 





reply via email to

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