[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using mkoctfile with autotools
From: |
Mike Miller |
Subject: |
Re: using mkoctfile with autotools |
Date: |
Fri, 18 Jan 2013 13:55:22 -0500 |
On Fri, Jan 18, 2013 at 9:53 AM, c. wrote:
> Hi,
>
> I am building a standalone program that links to Octave and I'm trying to use
> mkoctfile in an autoconf test to determine appropriate include and link flags,
> for example:
>
> AC_SUBST(OCTAVE_CPP_FLAGS, "$(mkoctfile -p CPPFLAGS)")
>
> the problem is that if a value is given for CPPFLAGS, in an environment
> variable
> or on the configure command line, e.g.
>
> ./configure CPPFLAGS=-I/my_includes_dir
>
> then "mkoctfile -p CPPFLAGS" will return "/my_includes_dir" rather than the
> the
> preprocessor flags needed to include Octave, and similar problems occur with
> other
> variable like CXXFLAGS or CXXPICFLAG and so on …
>
> Is this behaviour of mkoctfile intended? Is there any way I can work around
> it?
Looks intended inasmuch as it treats all variables the same way, and I
think most Forge packages use the environment to override at least
CFLAGS and LFLAGS.
To work around, both of the following work for me:
$(env -i PATH=$PATH mkoctfile -p CPPFLAGS)
$(unset CPPFLAGS; mkoctfile -p CPPFLAGS)
HTH
--
mike