On Tue, May 25, 2010 at 2:30 PM, Stefano Lattarini <
stefano.lattar...@gmail.com> wrote:

> At Tuesday 25 May 2010, Alex Farber <alexf.ac...@gmail.com> wrote:
> > ./configure WX_CPP="compiler flags..." WX_LIBS="linker flags..."
> >
> > This doesn't work, because AC_SUBST is done when configure script
> >  is generated, and not when it is executed.
> No, this doesn't work because you are setting the WX_CPP and WX_LIBS
> shell variables unconditionally.
> >  Is there some way to get it working?
> I think that setting WX_CPP and WX_LIBS conditionally should be
> enough; e.g., instead of this:
>   WX_CPP="`wx-config --cppflags`"
>  AC_SUBST(WX_CPP)
> do this:
>  test x${WX_CPP+"set"} = x"set" || WX_CPP="`wx-config --cppflags`"
>  AC_SUBST(WX_CPP)
>
> By the way, it would also be better to quote arguments of autoconf
> macros consistently, i.e. using `AC_SUBST([WX_CPP])' instead of
> `AC_SUBST(WX_CPP)': but this is ortoghonal to the issue we are
> discussing.
>
> HTH,
>    Stefano
>

 test x${WX_CPP+"set"} = x"set" || WX_CPP="`wx-config --cppflags`"
 AC_SUBST(WX_CPP)

Works as expected. Thanks to Stefano Lattarini for this solution.
_______________________________________________
Autoconf mailing list
Autoconf@gnu.org
http://lists.gnu.org/mailman/listinfo/autoconf

Reply via email to