[Top][All Lists]

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

include files and statically linked libraries

From: Eric Anderson
Subject: include files and statically linked libraries
Date: 20 Oct 2002 10:27:30 -0400

I recently found a nifty little program called hotwayd, which is a
hotmail-pop3 gateway. I noticed when installing it that the internal
include files for the program are installed also. I do not believe that
it should do this (since it is not a library or anything). I looked at
the file and I see the following in it:

include_HEADERS = \
    hotwayd.h \
    httpmail.h \
    ghttp.h \

I am guessing this is what is causing them to get installed so I want to
change this, but I am not exactly sure how. My gut feeling is to stick
these files up in the hotwayd_SOURCES directive but not being an expert
at Automake I wanted to run that by you guys before I made the change.
What is the proper way to specify internal .h files in Automake?

My next question is not really one of correct functionality, but of
style. In this same package a modified version of libghttp is included.
The program simply statically links the library to the hotwayd binary.
It is located in a subdirectory called libghttp-1.0.9-mod/ and is
specified in the file as:

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

libghttp also uses Automake so I was wondering if this would be better
done using the SUBDIRS directive and then having something like the

hotwayd_LDADD = libghttp-1.0.9-mod/libghttp.a

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

Makefile:226: *** missing separator.  Stop.

If I look at the Makefile at line 226 I see the following:


This looks to me like some variable is not getting substituted, but I am
not sure why or how to fix it. Am I making this too hard on myself and
should just leave the SUBDIRS directive out? It seems to me that the
dependencies would be reduced by having it in. Then all hotwayd has to
know is that the libghttp library is in the subdirectory of
libghttp-1.0.9-mod and that the resulting library file is libghttp.a. It
would not have to know the names of all the source files in libghttp
(which might change in future versions). What is the general method of
including a static library in a program (or a modified version of a
standard library)?

Any help is greatly appreciated.

Eric Anderson

reply via email to

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