automake
[Top][All Lists]
Advanced

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

Re: finding the location of header (.h) files


From: Stefan Puiu
Subject: Re: finding the location of header (.h) files
Date: Fri, 14 Jul 2006 10:15:47 +0300

Hi,

(disclaimer: I wouldn't say I'm an automake/autotools expert, I just
stumbled on a similar problem that you have)

What I've seen other projects do (we needed something similar) was to
provide the user with an option to configure for specifying where
gtkhtml-2.0 is located on their system, and use some sane (as much as
possible) default if none is provided.

For example, BIND 9.3.2's configure script allows you to tell it where
to look for openssl header files and libs, but also has a list of
directories it uses by default.

gaim uses something similar.

So I would suggest something along the lines of:

AC_ARG_WITH(gtkhtml2.0-libdir, [  --with-gtkhtml2.0-libdir=DIR
                         Look for gtkhtml2.0 in DIR], [ac_gtkhtml2_libdir="$
withval"], [ac_gtkhtml2_libdir="no"])

if test "x$ac_gtkhtml2_libdir" == "xno"; then
       GTKHTML2.0_DIR="$ac_gtkhtml2_libdir"
else
       GTKHTML2.0_DIR=<some_default_location>
fi

AC_SUBST(GTKHTML2.0_DIR)

Then the user would have to run ./configure
--with-gtkhtml2.0-libdir=<whatever>.

This sets the GTKHTML2.0_DIR variable so you can use it when linking
with that library; it uses a default value if a user doesn't specify
one. If you want to look in a predefined list of directories, I've
attached the configure.in from BIND-9.3.2, where you have an example -
look for 'openssl'.

Stefan.

On 7/14/06, mick <address@hidden> wrote:
I have an application that depends on gtkhtml-2.0, which seems to be in a
diferent location in almost every linux or BSD distribution.

Currently I have:-
INCLUDES = -I/usr/include/gtkhtml-2.0
in Makefile.am and
AC_CHECK_LIB([gtkhtml-2], [html_document_open_stream],, [AC_MSG_ERROR([BUMMER,
Maybe if you install libgtkhtml-2 & libgtkhtml-2-dev this pig will fly])])
in configure.ac, which works on my system but I need to replace it with a
portable construct to tell autoconf/make etc. to find it and feed its
location into the final Makefile.

Attachment: configure.in
Description: Binary data


reply via email to

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