[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Probable m4 quoting problem
From: |
Ralf Wildenhues |
Subject: |
Re: Probable m4 quoting problem |
Date: |
Tue, 22 Jun 2010 07:06:22 +0200 |
User-agent: |
Mutt/1.5.20 (2010-04-22) |
Hello David,
* David Bruce wrote on Tue, Jun 22, 2010 at 06:37:12AM CEST:
> PKG_CHECK_MODULES([SDL_MIXER],
> [SDL_mixer],
> [],
> [AC_CHECK_LIB([SDL_mixer],
> [Mix_OpenAudio],
> [],
> [AC_MSG_ERROR([SDL_mixer not found!
> http://www.libsdl.org/projects/SDL_mixer])])])
>
>
> AC_DEFINE([HAVE_LIBSDL_MIXER],[1],[Define to 1 if you have the
> `SDL_mixer` library])
> CFLAGS="$CFLAGS $SDL_MIXER_CFLAGS"
> LIBS="$LIBS $SDL_MIXER_LIBS"
This looks correctly quoted, and if I stick it between
AC_INIT
AC_PROG_CC
and AC_OUTPUT, there is no warning for me.
> Problem is, I get errors on autoreconf -i such as:
>
> address@hidden:/usr/local/src/git/tuxmath/build$ autoreconf -i ..
> configure.ac:116: error: possibly undefined macro: AC_CHECK_LIB
> If this token and others are legitimate, please use m4_pattern_allow.
> See the Autoconf documentation.
> autoreconf: /usr/bin/autoconf failed with exit status: 1
Well, the quoting bug may be in pkg.m4 not in your code. Mine came from
pkg-config 0.22-1 as packaged by Debian. Which is yours, do you have a
pointer to the exact version?
> If I run autoreconf a second time, it succeeds, so perhaps this
> "error" is actually a warning, but nevertheless I want to get rid of
> it.
That's a caching bug in Autoconf, I think.
> Also, this approach generates somewhat misleading ./configure output,
> as it shows the unsuccessful pkg-config check, followed by the
> successful AC_CHECK_LIB. I've tried adding explanatory "echo"
> statements but have encountered more quoting errors. Is AC_MSG_NOTICE
> better, and if so, how do I group multiple macros within the
> "action_if_not_found" of PKG_CHECK_MODULES.
I think you should show what you tried, preferably with a short but
complete configure.ac file. Generally, you can avoid intertwining
multiple 'checking for ...' with their results by moving the second test
out of the IF-FAILS argument, setting a variable there (you can use a
cache variable for a better recheck experience) and invoking the second
test later conditionally only, wrapped in AS_IF. But I'm not sure
whether this is your issue.
Hope that helps.
Cheers,
Ralf