autoconf
[Top][All Lists]
Advanced

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

Integrating a library using autoconf and automake


From: Andy Smith
Subject: Integrating a library using autoconf and automake
Date: Fri, 6 Dec 2002 02:17:39 +0000
User-agent: Mutt/1.5.1i

Hi folks,

Currently I am working on an established application written in C
which uses GNU autoconf and automake.  We have taken many of the
core tasks of this application and put them into a separate library
which also uses autoconf and automake.

The problem now comes when I try to integrate the two together.  At
first, as most people will never have heard of the library, and as
this application is the only thing that uses it we wish to
distribute the library with the application and statically link it.

This suggests a directory structure something like this:

foo/
    README
    INSTALL
    configure
    configure.in
    Makefile.in
    Makefile.am
    doc/
    src/
        Makefile.in
        Makefile.am
        foo.c
        libfoo/
            configure
            configure.in
            Makefile.in
            Makefile.am
            src/
                Makefile.in
                Makefile.am
                libfoo.c
                    
Now, I am aware of how to make configure recurse into a subdirectory
and launch the configure script that is there.  I am aware of how to
use LD_ADD in the top level src/Makefile.am to link in the library
after it has been compiled.

The part that I can't quite grasp right now, is how and where to
install the files from the library?  We do not want them to be
installed system-wide.  The --prefix from the top-level configure is
meant for the application, not the library.  Ideally we want the
library to stay just in the source directory and be statically
linked in without the user being aware that there is a library
involved at all.

To do this would seem to require launching the library's configure
script from the top-level configure script, with a --prefix
generated by a shell script or something.  That sounds very messy.
Does anyone have any better ideas?  Perhaps I have missed something
obvious?

It would be alright if there were a way to indicate that libfoo
should not be installed when the user types "make install" at the
top -- the build stage would put a libfoo.a in src/libfoo/src/.libs/
which I could link against.  However, the way I understand it, once
src/Makefile.am has "SUBDIRS = libfoo" in it then it will do an
install too.

I would be interested in hearing any ideas that anyone has, thanks!

-- 
"SCSI is usually fixed by remembering that it needs three terminations: One at
 each end of the chain. And the goat."
 -- Andrew McDonald, HantsLUG




reply via email to

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