build: fix regression in requiring yajl for new enough qemu

Jonathan Lebon reported an issue to me off-list about his build
failing to use qemu because he failed to install yajl-devel.  But
I recalled specifically tweaking configure.ac to die in that
situation (commits 350583c, ba9c38b).  After a bit more
head-scratching, we found the cause of the regression: commit
654c709 rearranged things so that the qemu version check now
occurs before AC_ARG_WITH has had a chance to set either
$with_qemu or $with_yajl.

Coincidentally, this fix aligns with a documentation patch that
was just posted to the autoconf mailing list :)
http://thread.gmane.org/gmane.comp.sysutils.autoconf.patches/8324

* m4/virt-lib.m4 (LIBVIRT_CHECK_LIB, LIBVIRT_CHECK_LIB_ALT)
(LIBVIRT_CHECK_PKG): Populate defaults earlier.
* configure.ac (AC_ARG_WITH): Likewise for drivers.

Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
Eric Blake
2013-09-05 14:32:25 -06:00
parent ff77742104
commit f92c7e31fc
2 changed files with 42 additions and 42 deletions

View File

@@ -62,10 +62,10 @@ AC_DEFUN([LIBVIRT_CHECK_LIB],[
m4_pushdef([arg_var], [with-]check_name_lc)
m4_pushdef([with_var], [with_]check_name_lc)
m4_divert_text([DEFAULTS], [with_var][=check])
AC_ARG_WITH(check_name_lc,
[AS_HELP_STRING([--arg_var],
[with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])],
[],[with_var][=check])
[with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])])
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
@@ -192,10 +192,10 @@ AC_DEFUN([LIBVIRT_CHECK_LIB_ALT],[
m4_pushdef([config_var_alt], [WITH_]check_name_alt)
m4_pushdef([make_var_alt], [WITH_]check_name_alt)
m4_divert_text([DEFAULTS], [with_var][=check])
AC_ARG_WITH(check_name_lc,
[AS_HELP_STRING([--arg_var],
[with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])],
[],[with_var][=check])
[with lib]]m4_dquote(library_name)[[ support @<:@default=check@:>@])])
old_LIBS=$LIBS
old_CFLAGS=$CFLAGS
@@ -318,10 +318,10 @@ AC_DEFUN([LIBVIRT_CHECK_PKG],[
m4_pushdef([arg_var], [with-]check_name_lc)
m4_pushdef([with_var], [with_]check_name_lc)
m4_divert_text([DEFAULTS], [with_var][=check])
AC_ARG_WITH(check_name_lc,
[AS_HELP_STRING([--arg_var],
[with ]]m4_dquote(pc_name)[[ (>= ]]m4_dquote(pc_version)[[) support @<:@default=check@:>@])],
[],[with_var][=check])
[with ]]m4_dquote(pc_name)[[ (>= ]]m4_dquote(pc_version)[[) support @<:@default=check@:>@])])
fail=0
if test "x$with_var" != "xno" ; then