>>>>> "Jeroen" == Jeroen Ruigrok/Asmodai <[EMAIL PROTECTED]> writes:
Jeroen> Now, under FreeBSD we only define /usr/include. So I want to
Jeroen> add something like
Jeroen> case "$host" in
Jeroen> *-freebsd*)
Jeroen> CPPFLAGS="-I/usr/local/include"
Jeroen> esac
Jeroen> to configure.in
Jeroen> But this doesn't work and I have no idea why not.
Us either. We need more information.
For instance, did you remember to remove config.cache after making
this change?
What does config.log say?
Can you put some debugging prints into configure to see what CPPFLAGS
is when the test is run?
Jeroen> Also, is something like this
Jeroen> case "$host" in
Jeroen> *-freebsd*)
Jeroen> OCPPFLAGS="$CPPFLAGS"
Jeroen> CPPFLAGS="-I/usr/local/include"
Jeroen> AC_CHECK_HEADER(getopt.h, CFLAGS="$CFLAGS -I/usr/local/include",
AC_MSG_ERROR(Can't find getopt.h.))
Jeroen> CPPFLAGS="$OCPPFLAGS";;
Jeroen> esac
Jeroen> the prefered way of writing such a solution?
It seems like you'd want to end up with the -I in the Makefile.
However, note that CFLAGS and CPPFLAGS are user variables. If you
want to add additional flags in your Makefile, use different names.
If you're using automake, use AM_CFLAGS and AM_CPPFLAGS.
Jeroen> And also, what's the best way to avoid getting multiple
Jeroen> -I/usr/local/include in my Makefiles due to setting CPPFLAGS
Jeroen> to it like it in the above?
IMNSHO, the best approach is not to worry about it.
Beyond that, I guess you could loop over the value and eliminate
duplicates
Tom