autoconf
[Top][All Lists]
Advanced

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

Nested AC_CHECK_LIB and AC_CHECK_HEADER need brackets?


From: Tor Lillqvist
Subject: Nested AC_CHECK_LIB and AC_CHECK_HEADER need brackets?
Date: Thu, 4 Oct 2001 01:39:22 +0300 (EEST)

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? 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?

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.)

BTW, the check for iswalnum in -lw in gtk+/configure.in already uses
brackets in a nested call to AC_CHECK_LIB:

AC_CHECK_FUNC(iswalnum,,[AC_CHECK_LIB(w,iswalnum,GDK_WLIBS=-lw)])

--tml




reply via email to

[Prev in Thread] Current Thread [Next in Thread]