On 03/11/2014 08:56 AM, Jim Galarowicz wrote: > > > I'm including a section of m4/ax_libmonitor.m4 where HAVE_LIBMONITOR > code looks like this: > > 52 AC_LINK_IFELSE([AC_LANG_PROGRAM([[ > 53 #include <monitor.h> > 54 ]], [[ > 55 monitor_init_library(); > 56 ]])], [ AC_MSG_RESULT(yes) > 57 > 58 AM_CONDITIONAL(HAVE_LIBMONITOR, true)
Wrong place.
> 59 AC_DEFINE(HAVE_LIBMONITOR, 1, [Define to 1 if you
> have libmonitor.])
> 60
> 61 ], [ AC_MSG_RESULT(no)
> 62
> 63 AM_CONDITIONAL(HAVE_LIBMONITOR, false)
Also wrong.
> 64 LIBMONITOR_CPPFLAGS=""
> 65 LIBMONITOR_LDFLAGS=""
> 66 LIBMONITOR_LIBS=""
> 67 LIBMONITOR_DIR=""
> 68
> 69 ]
> 70 )
>
AM_CONDITIONAL is designed to be called at the top level, outside of
AC_LINK_IFELSE. Try:
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <monitor.h>
]], [[
monitor_init_library();
]])], [ AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_LIBMONITOR, 1, [Define to 1 if you have
libmonitor.])
], [ AC_MSG_RESULT(no)
LIBMONITOR_CPPFLAGS=""
LIBMONITOR_LDFLAGS=""
LIBMONITOR_LIBS=""
LIBMONITOR_DIR=""
]
)
AM_CONDITIONAL([HAVE_LIBMONITOR], [test "$HAVE_LIBMONITOR" = 1"])
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Autoconf mailing list [email protected] https://lists.gnu.org/mailman/listinfo/autoconf
