[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem using AC_LANG_PROGRAM with AC_EGREP_CPP
From: |
Allan Caffee |
Subject: |
Re: Problem using AC_LANG_PROGRAM with AC_EGREP_CPP |
Date: |
Mon, 30 Mar 2009 10:12:58 -0400 |
User-agent: |
Mutt/1.5.17+20080114 (2008-01-14) |
On Sat, 28 Mar 2009, Braden McDaniel wrote:
> On Sat, 2009-03-28 at 07:27 -0600, Eric Blake wrote:
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > According to Braden McDaniel on 3/27/2009 11:02 PM:
> > > When I try to use AC_LANG_PROGRAM in conjunction with AC_EGREP_CPP, I'm
> > > seeing this error:
> > >
> > > configure.ac:97: error: possibly undefined macro: AC_LANG_PROGRAM
> > > If this token and others are legitimate, please use
> > > m4_pattern_allow.
> > > See the Autoconf documentation.
> >
> > It sounds like something is overquoted in your configure.ac file.
> >
> > >
> > > My invocation of AC_EGREP_CPP looks like this:
> > >
> > > AC_EGREP_CPP([HAVE_GL_GLU_H], [AC_LANG_PROGRAM([[foo]], [[bar]])],
> > > [OPENVRML_HAVE_GL_GLU_H=1],
> > > [OPENVRML_HAVE_GL_GLU_H=0])
> >
> > In isolation, I don't see any quoting problems with this example. But I'm
> > almost certain you didn't copy and paste from your configure.ac, so maybe
> > in the rewrite for this email, you changed the quoting?
>
> In fact, that was copied and pasted from my configure.ac. (Though it's
> not what my configure.ac looks like now; I've given up on this approach
> for now and I'm using AC_COMPILE_IFELSE instead.)
>
> All I'm trying to do here is see if running a previous macro caused a
> symbol to be AC_DEFINE'd. I tried a number of different invocations of
> AC_LANG_PROGRAM; including using no arguments, using one argument, and
> using an empty first argument.
>
> > > If I have an instance of AC_LANG_PROGRAM usage earlier in the file that
> > > has been working fine. However, the error message will point to it.
> > > Only if I remove the first occurrence does the error message point at
> > > the second invocation (the one mentioned listed above).
> >
> > Can you post a complete configure.ac file that reproduces the problem
> > (preferably trimming to a minimal testcase first), so we can see if
> > something earlier in the file may be impacting how this line is expanded?
>
> I'm having no trouble reproducing this error with a *very* minimal test
> case. It's attached.
FWIW, this seems to work fine for me as:
AC_EGREP_CPP([HAVE_GL_GLU_H], AC_LANG_PROGRAM([[foo]], [[bar]]),
[OPENVRML_HAVE_GL_GLU_H=1],
[OPENVRML_HAVE_GL_GLU_H=0])
I'm no Autoconf expert but isn't the way it was presented before
overquoted? IIRC one layer of quoting is removed for each macro
expansion. Doesn't this mean that quoting AC_LANG_PROGRAM would cause
it to be passed to AC_EGREP_CPP literally? Perhaps I'm
misunderstanding.
~Allan