Re: Nested AC_CHECK_LIB and AC_CHECK_HEADER need brackets?



Hi,

Tor Lillqvist <tml iki fi> writes:
> Using CVS autoconf (on Cygwin, if it matters), nesting AC_CHECK_LIB
> and AC_CHECK_HEADER calls cause strange syntax errors in the resulting
> configure script, unless the nested call is put in [brackets]. Is this
> a bug in CVS autoconf? 

No.  See the 'M4 Quotation' chapter in autoconf.info.

> Or was one always supposed to use those brackets, and it has only
> happened to work by luck with earlier autoconfs to leave the
> brackets out?

Basically, yes.
 
> For instance, from gtk+/configure.in:
> 
>     AC_CHECK_LIB(png, png_read_info,
>       AC_CHECK_HEADER(png.h,
>         png_ok=yes,
>         png_ok=no),
>       AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
> 
> generates bad shell code, while
> 
>     AC_CHECK_LIB(png, png_read_info,
>       [AC_CHECK_HEADER(png.h,
>         png_ok=yes,
>         png_ok=no)],
>       AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
> 
> works OK. Please somebody check that this latter also works with
> earlier autoconfs. (The TIFF tests use even more complex nested
> tests.)

It'll work.

- Hari
-- 
Raja R Harinath ------------------------------ harinath cs umn edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]