Karim Belabas on Sun, 30 Oct 2005 16:41:14 +0100


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

Re: Configure bug when CPPFLAGS is set


* Vincent Lefevre [2005-10-30 15:13]:
> On 2005-10-28 18:29:12 +0200, Karim Belabas wrote:
> > As a temporary workaround, you can presumably get the effect you
> > wanted with
> > 
> >   env LDFLAGS=-L/opt/local/lib CFLAGS=-I/opt/local/include ./Configure
> 
> This doesn't work either. I've edited the get_readline file to output
> more data:
> 
> echo "Path: $pth"
> echo "CFLAGS = $CFLAGS"
>   x=`./locate 'readline.h' '' $pth`
> 
> and I get:
[...]
> ...Found readline header in /usr/include/readline
> 
> i.e. $CFLAGS isn't taken into account to search for the headers.

OK, I had not understood the problem. 

Contrary to autoconf-style AC_CHECK_HEADERS, Configure doesn't trust the
host to have a decent configuration, and e.g. know where its headers and
libraries are. So we actually look for files, instead of compiling small
programs (which gives more robust answers, but fails more often).

I don't want to complicate Configure logic and parse CPPFLAGS (or CFLAGS)
to find a list of extra directories. So, currently, the right way to tackle
this is to

  Configure --with-readline-include=/opt/local/include

    Karim.
-- 
Karim Belabas                  Tel: (+33) (0)5 40 00 26 17
Universite Bordeaux 1          Fax: (+33) (0)5 40 00 69 50
351, cours de la Liberation    http://www.math.u-bordeaux.fr/~belabas/
F-33405 Talence (France)       http://pari.math.u-bordeaux.fr/  [PARI/GP]