Hi guys,

for the past few days I have been having trouble specifying compiler
flags.

It seems that using autoconf 2.13 under Linux that a

AC_CHECK_HEADERS(ggi/gii.h ggi/ggi.h)

works as you'd expect, e.g. it detect /usr/local/include/ggi/ggi.h and
such.

Now, under FreeBSD we only define /usr/include.  So I want to add
something like

case "$host" in
        *-freebsd*)
        CPPFLAGS="-I/usr/local/include"
esac

to configure.in

But this doesn't work and I have no idea why not.

Also, is something like this

case "$host" in
  *-freebsd*)
    OCPPFLAGS="$CPPFLAGS"
    CPPFLAGS="-I/usr/local/include"
    AC_CHECK_HEADER(getopt.h, CFLAGS="$CFLAGS -I/usr/local/include", 
AC_MSG_ERROR(Can't find getopt.h.))
    CPPFLAGS="$OCPPFLAGS";;
esac

the prefered way of writing such a solution?

And also, what's the best way to avoid getting multiple
-I/usr/local/include in my Makefiles due to setting CPPFLAGS to it like
it in the above?

Thanks,

-- 
Jeroen Ruigrok vd Werven/Asmodai    asmodai@[wxs.nl|bart.nl|freebsd.org]
Documentation nutter/B-rated Coder BSD: Technical excellence at its best  
The BSD Programmer's Documentation Project <http://home.wxs.nl/~asmodai>
Religion... Is the opium of the people...

Reply via email to