[Top][All Lists]

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

Re: problems with AC_CHECK_HEADERS

From: Braden McDaniel
Subject: Re: problems with AC_CHECK_HEADERS
Date: Fri, 31 Dec 2004 04:16:03 -0500

On Fri, 2004-12-31 at 07:48 +0200, address@hidden wrote:
> Hi all!
> I am reading the autoconf manual and I
> try to understand where AC_CHECK_HEADERS
> searches to find the headers.
> ***Yes it does search. But WHERE and how can I change the
>    default search location???***

The "default" is whatever your compiler knows about. The normal way to
add to this is to add -I flags to CPPFLAGS:

        $ ./configure CPPFLAGS="-I/your/include/dir"

You can, of course, modify the CPPFLAGS variable in before
invoking the AC_CHECK_HEADERS macro. But you should not do that

> I have problems running configure
> and stuff like that in my FreeBSD.
> While it is working fine under SuSE
> it cannot find GL/glut.h in checkheaders
> AC_CHECK_HEADERS(GL/glut,, e.t.c)
> in Linux it can find it easily!
> It is located in /usr/include/GL/glut.h
> In FreeBSD it is located in 
> /usr/X11R6/include/GL/glut.h

I suspect the AC_PATH_XTRA macro would help you; among other things it
does, it should make available whatever -I flags you need for X11
headers in the X_CFLAGS output variable.

It sounds like you might benefit even more from the GL detection macros
I contributed to the Autoconf Macro Archive:


> Can you please help me with that?
> Can anybody give me a sample for the following
> case where I:
> 1:) want to include some system libraries which are
>      not in the same directories for different OS.
>      e.g. Suppose I use FreeBSD and Linux but
>      the opengl libraries are located in different
>      directories. What macros should I add in configure
>      such it searches for that libraries and when it finds
>      them it automatically adds -L/dir/ -llib1, -llib2...
> 2:) how can I do the same for headeer files?

You can look at the implementation of AC_PATH_X and AC_PATH_XTRA. The
machinations there are not pretty. Fortunately, there is usually a
Better Way.

Braden McDaniel                           e-mail: <address@hidden>
<>                    Jabber: <address@hidden>

reply via email to

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