+Thu Dec 6 11:23:31 CET 2007 Daniel Veillard <veillard@redhat.com>
+
+ * configure.in src/Makefile.am src/virsh.c: fix compilation problems
+ when readline headers were found but not the library
+
Wed Dec 5 23:57:53 CET 2007 Jim Meyering <meyering@redhat.com>
Accommodate developers using autoconf-2.59.
AC_SUBST(AVAHI_LIBS)
dnl virsh libraries
+USE_READLINE=
+READLINE_CFLAGS=
AC_CHECK_HEADERS([readline/readline.h])
AC_CHECK_LIB(readline, main,
- [VIRSH_LIBS="$VIRSH_LIBS -lreadline"],
- [AC_MSG_WARN([readline library not found])],
+ [USE_READLINE=yes],
+ [USE_READLINE=no],
[$VIRSH_LIBS])
+if test "$USE_READLINE" = "yes" ; then
+ VIRSH_LIBS="$VIRSH_LIBS -lreadline"
+ AC_DEFINE_UNQUOTED(USE_READLINE, 1, [whether virsh use readline])
+ READLINE_CFLAGS="-DUSE_READLINE"
+else
+ AC_MSG_WARN([readline library not found])
+fi
+AC_SUBST(READLINE_CFLAGS)
AC_SUBST(VIRSH_LIBS)
# end of if with_depends
AC_MSG_NOTICE([Miscellaneous])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ Debug: $enable_debug])
+AC_MSG_NOTICE([ Readline: $USE_READLINE])
AC_MSG_NOTICE([])
virsh_LDFLAGS = $(WARN_CFLAGS) $(COVERAGE_LDFLAGS)
virsh_DEPENDENCIES = $(DEPS)
virsh_LDADD = $(LDADDS) $(VIRSH_LIBS)
-virsh_CFLAGS = $(COVERAGE_CFLAGS)
+virsh_CFLAGS = $(COVERAGE_CFLAGS) $(READLINE_CFLAGS)
#
# target to ease building test programs
}
}
-#ifdef HAVE_READLINE_READLINE_H
+#ifdef USE_READLINE
/* -----------------
* Readline stuff
return readline (prompt);
}
-#else /* !HAVE_READLINE_READLINE_H */
+#else /* !USE_READLINE */
static void
vshReadlineInit (void)
return vshStrdup (ctl, r);
}
-#endif /* !HAVE_READLINE_READLINE_H */
+#endif /* !USE_READLINE */
/*
* Deinitliaze virsh
if (ctl->cmdstr == NULL)
break; /* EOF */
if (*ctl->cmdstr) {
-#if HAVE_READLINE_READLINE_H
+#if USE_READLINE
add_history(ctl->cmdstr);
#endif
if (vshCommandParse(ctl, ctl->cmdstr))