automake
[Top][All Lists]
Advanced

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

Re: include files and statically linked libraries


From: Tom Tromey
Subject: Re: include files and statically linked libraries
Date: 20 Oct 2002 12:40:42 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

>>>>> "Eric" == Eric Anderson <address@hidden> writes:

Eric> I am guessing this is what is causing them to get installed

Yes.

Eric> My gut feeling is to stick these files up in the hotwayd_SOURCES
Eric> directive

Perfect.

Eric> What is the proper way to specify internal .h files in Automake?

Simplest is to put them in _SOURCES.  This is a convenience feature.
Next simplest is to list then in EXTRA_DIST.

Eric> hotwayd_LDADD = \
Eric>   libghttp-1.0.9-mod/ghttp.c \
Eric>   libghttp-1.0.9-mod/http_date.c \
Eric>   libghttp-1.0.9-mod/http_hdrs.c \
Eric>   libghttp-1.0.9-mod/http_req.c \
Eric>   libghttp-1.0.9-mod/http_resp.c \
Eric>   libghttp-1.0.9-mod/http_trans.c \
Eric>   libghttp-1.0.9-mod/http_uri.c \
Eric>   libghttp-1.0.9-mod/http_base64.c \
Eric>   libghttp-1.0.9-mod/http_digest.c \
Eric>   libghttp-1.0.9-mod/md5c.c

Don't do this!  This means all those files will be recompiled every
time the program is linked.

Eric> libghttp also uses Automake so I was wondering if this would be
Eric> better done using the SUBDIRS directive and then having
Eric> something like the following:
Eric> hotwayd_LDADD = libghttp-1.0.9-mod/libghttp.a

Yes, this would be better.

Eric> But I was not exactly sure how to specify this. When I tried to
Eric> put a SUBDIRS directive in the Makefile.am, and add
Eric> libghttp-1.0.9-mod/Makefile to the output list in the configure
Eric> file (I also had to change the configure file to check for
Eric> libtool) it gave me the below error when I tried to "make":

This approach should work ok.

Does libghttp have its own configure script?
If so it is probably even cleaner to run that.  Put this in
configure.in:

    AC_CONFIG_SUBDIRS(libghttp-1.0.9-mod)

Then put this in your Makefile.am:

    SUBDIRS = libghttp-1.0.9-mod

This is a better approach because it is more modular.  Your Makefile
won't need to know very much about the library at all.  This means
that upgrading the library probably won't introduce maintenance
problems for your code.

Why your approach failed, I don't know.  I assume you re-ran autoconf,
automake, and configure?

Tom




reply via email to

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