This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Support official CLooG.org versions.
* Andreas Simbuerger wrote on Fri, Sep 10, 2010 at 08:34:50PM CEST:
> On 09/10/2010 07:14 PM, Ralf Wildenhues wrote:
> >> + AC_RUN_IFELSE([CLOOG_CHECK_RT_PROG],
> >> + [AC_MSG_RESULT([yes])],
> >> + [AC_MSG_RESULT([failed at run time]); clooglibs= ; clooginc= ],
> >> + [AC_MSG_RESULT([yes (cross-compile)])])],
> >
> > As far as I can see, there is no way to override this test, say, for
> > cross-compile cases where your guess is wrong. The usual way to allow
> > an override is to use a cache variable, e.g.,
> > AC_CACHE_CHECK([for version 0.14.0 of CLooG],
> > [gcc_cv_cloog_rt_0_14_0],
> > [AC_RUN_IFELSE([...],
> > [gcc_cv_cloog_rt_0_14_0=yes],
> > [gcc_cv_cloog_rt_0_14_0=no],
> > [gcc_cv_cloog_rt_0_14_0="guessing yes"])])
> > if test "$gcc_cv_cloog_rt_0_14_0" = ...
> > or
> > case $gcc_cv_cloog_rt_0_14_0 in
> > ...
> >
> > You can also cache the other tests (using other variable names, of
> > course), but for runtime tests it is the most important. Just be sure
> > that the third argument of AC_CACHE_CHECK doesn't have side effects
> > other than setting the cache variable.
>
> This is something i don't get right now. The testing goes:
> 1) Test the compilation.
> 2) If successful: Test the runtime. If cross-compiling: Ignore the
> runtime check and go on.
>
> What is the advantage of providing an override to a test that is ignored
> anyways when cross-compiling?
Yeah, maybe you're right in that an override is overkill in this case.
(Generally, runtime tests without cache guard trigger a raised eyebrow
because they might get users stuck. I wonder whether we can let
autoconf warn about them.)
Cheers,
Ralf