autoconf
[Top][All Lists]
Advanced

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

internally installing helper libraries before using them


From: Alex Rousskov
Subject: internally installing helper libraries before using them
Date: Tue, 10 Feb 2004 10:21:28 -0700 (MST)

Short version:

  What is the best way to configure helper libraries  with a
  --prefix pointing to the core project build directory _and_
  automatically "make install" all helper libraries into the
  build directory after ./configure but before the rest of the
  project is made?


Longer version with details/rationale:

My project uses a set of helper libraries, distributed together with
the core project sources. These helper libraries are small but
independent projects. They have their own directory structure,
configure scripts, etc. They should not be installed when/where the
core project is installed. This situation is not unique, of course.
Apache, for example, has srclib/ directory with apr and other helper
libraries, each with its own ./configure script.

Normally, the helper libraries are built with the rest of the sources
and are just not installed. However, doing that requires the core
package to know the _internal_ location of helper header files and
built libraries. For example, core sources that need H1.h header file
from the helper1 library, would need to find it in:

        $(top_srcdir)/srclib/helper1/src/include/helper1/H1.h

which means core Makefiles would need to have the equivalent of the
following -I option:

        -I $(top_srcdir)/srclib/helper1/src/include

This introduces a dependency on internal helper directory structure
and gets uglier with each helper library added.

Ideally, I would like to avoid referring to internal directory
structure of helper projects. Instead, I would like to build and
_locally_ install helpers before the core project is built. Then, the
core project files will only use public helper interfaces (including
public directory structure).

For example, all helper libraries could be configured with

        --prefix="$(top_builddir)/local"

and core files will refer to $(top_builddir)/local/include and
$(top_builddir)/local/libs to find all helper headers and libraries.

This approach requires running "make install" for each helper
subdirectory before proceeding with "make all" in core subdirectories.
I can manually hack that by introducing a special dependency for the
"all" target in the root Makefile. Is there a better way to do this
with automake and friends?

Thank you,

Alex.

P.S. The simplest solution might be to insert something like
     the following lines into configure script:

        dnl compute builddir
        builddir=....

        cd helpers/helper1
        ./configure --prefix=$builddir/local ...
        make
        make install
        cd ../../

        cd helpers/helper2
        ./configure --prefix=$builddir/local ...
        make
        make install
        cd ../../

        ...

     but this means that helpers are built during ./configure
     time, and that is probably against autoconf style/philosophy.
     Isn't it?




reply via email to

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