[Top][All Lists]

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

Re: Passing flags to AC_CHECK_HEADER

From: Nick Bowler
Subject: Re: Passing flags to AC_CHECK_HEADER
Date: Tue, 28 Feb 2012 15:00:29 -0500
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Chris,

On 2012-02-28 11:33 -0800, Chris Stankevitz wrote:
> The following command assigns the variable OPENCV_CFLAGS with "-I
> /path/to/opencv/include":
> PKG_CHECK_MODULES(OPENCV, opencv >= 2.3.1,, 

Not directly related to your problem, but you should quote the macro
arguments above, as in:

   PKG_CHECK_MODULES([OPENCV], [opencv >= 2.3.1],, 

Otherwise, the arguments are subject to macro expansion /before/ they are
substituted into the body of PKG_CHECK_MODULES.

> Q1: How to I tell AC_CHECK_HEADER to use the include directory
> specified in OPENCV_CFLAGS?
> Q2: But I thought I wasn't supposed to mess with CPPFLAGS, it was only
> for the user to play with.  Plus I don't want to affect all CPPFLAGS
> for the entire project.  I intend to selectively apply OPENCV_CFLAGS
> where needed.

That is essentially correct, you should allow the user to override
CPPFLAGS.  For tests like the above, though, you can save/restore the
CPPFLAGS (or other similar variables) temporarily.  Something like the
following (untested)

  # do stuff

should do the trick.

Hope that helps,
Nick Bowler, Elliptic Technologies (

reply via email to

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