Blame SOURCES/rhbz1128209.patch

fab312
commit aadc1c78eea8969d453341b50baa958dfe18ffe8
fab312
Author: Frank Ch. Eigler <fche@redhat.com>
fab312
Date:   Fri Feb 13 14:39:03 2015 -0500
fab312
fab312
    BZ1128209: add a configure --{enable,disable}-virt option
fab312
    
fab312
    It was desirable that a systemtap rpm be buildable in a predictable
fab312
    manner (in this case, without virthost support), even if prerequisites
fab312
    (libvirt etc.) were accidentally installed.
fab312
fab312
diff --git a/Makefile.am b/Makefile.am
fab312
index 6699894..5adcca4 100644
fab312
--- a/Makefile.am
fab312
+++ b/Makefile.am
fab312
@@ -54,8 +54,7 @@ noinst_HEADERS = sdt_types.h
fab312
 stap_LDADD = @stap_LIBS@ @sqlite3_LIBS@ @LIBINTL@ -lpthread
fab312
 stap_DEPENDENCIES =
fab312
 
fab312
-if HAVE_LIBVIRT
fab312
-if HAVE_LIBXML2
fab312
+if BUILD_VIRT
fab312
 bin_PROGRAMS += stapvirt
fab312
 stapvirt_SOURCES = stapvirt.c
fab312
 stapvirt_CFLAGS = $(AM_CFLAGS)
fab312
@@ -63,7 +62,6 @@ stapvirt_CFLAGS += $(libvirt_CFLAGS) $(libxml2_CFLAGS)
fab312
 stapvirt_LDFLAGS = $(AM_LDFLAGS)
fab312
 stapvirt_LDADD = $(libvirt_LIBS) $(libxml2_LIBS)
fab312
 endif
fab312
-endif
fab312
 
fab312
 endif
fab312
 
fab312
diff --git a/Makefile.in b/Makefile.in
fab312
index f1fe6d6..c59a5ca 100644
fab312
--- a/Makefile.in
fab312
+++ b/Makefile.in
fab312
@@ -91,7 +91,7 @@ bin_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
fab312
 @BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_4 = stap-serverd stap-gen-cert
fab312
 @BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_5 = stap-server
fab312
 @BUILD_SERVER_TRUE@@BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@am__append_6 = stap-start-server stap-stop-server
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@am__append_7 = stapvirt
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@am__append_7 = stapvirt
fab312
 @BUILD_TRANSLATOR_TRUE@@HAVE_AVAHI_TRUE@am__append_8 = $(avahi_CFLAGS)
fab312
 @BUILD_TRANSLATOR_TRUE@@HAVE_AVAHI_TRUE@am__append_9 = $(avahi_CFLAGS)
fab312
 @BUILD_TRANSLATOR_TRUE@@HAVE_AVAHI_TRUE@am__append_10 = $(avahi_LIBS)
fab312
@@ -147,7 +147,8 @@ CONFIG_CLEAN_FILES = includes/sys/sdt-config.h \
fab312
 	staprun/guest/stapsh@.service
fab312
 CONFIG_CLEAN_VPATH_FILES =
fab312
 @BUILD_TRANSLATOR_TRUE@am__EXEEXT_1 = stap$(EXEEXT)
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@am__EXEEXT_2 = stapvirt$(EXEEXT)
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@am__EXEEXT_2 =  \
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@	stapvirt$(EXEEXT)
fab312
 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" \
fab312
 	"$(DESTDIR)$(bindir)" "$(DESTDIR)$(pkglibexecdir)" \
fab312
 	"$(DESTDIR)$(oldincludedir)"
fab312
@@ -250,10 +251,11 @@ stap_sign_module_OBJECTS = $(am_stap_sign_module_OBJECTS)
fab312
 @BUILD_TRANSLATOR_TRUE@@HAVE_NSS_TRUE@	$(am__DEPENDENCIES_1)
fab312
 stap_sign_module_LINK = $(CXXLD) $(stap_sign_module_CXXFLAGS) \
fab312
 	$(CXXFLAGS) $(stap_sign_module_LDFLAGS) $(LDFLAGS) -o $@
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@am_stapvirt_OBJECTS = stapvirt-stapvirt.$(OBJEXT)
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@am_stapvirt_OBJECTS = stapvirt-stapvirt.$(OBJEXT)
fab312
 stapvirt_OBJECTS = $(am_stapvirt_OBJECTS)
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@stapvirt_DEPENDENCIES = $(am__DEPENDENCIES_1) \
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@	$(am__DEPENDENCIES_1)
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@stapvirt_DEPENDENCIES =  \
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@	$(am__DEPENDENCIES_1) \
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@	$(am__DEPENDENCIES_1)
fab312
 stapvirt_LINK = $(CCLD) $(stapvirt_CFLAGS) $(CFLAGS) \
fab312
 	$(stapvirt_LDFLAGS) $(LDFLAGS) -o $@
fab312
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
fab312
@@ -447,8 +449,6 @@ PIECFLAGS = @PIECFLAGS@
fab312
 PIECXXFLAGS = @PIECXXFLAGS@
fab312
 PIELDFLAGS = @PIELDFLAGS@
fab312
 PKG_CONFIG = @PKG_CONFIG@
fab312
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
fab312
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
fab312
 POSUB = @POSUB@
fab312
 PUBLICAN_BRAND = @PUBLICAN_BRAND@
fab312
 RANLIB = @RANLIB@
fab312
@@ -580,12 +580,13 @@ oldinclude_HEADERS = includes/sys/sdt.h includes/sys/sdt-config.h
fab312
 @BUILD_TRANSLATOR_TRUE@	@LIBINTL@ -lpthread $(am__append_10) \
fab312
 @BUILD_TRANSLATOR_TRUE@	$(am__append_15)
fab312
 @BUILD_TRANSLATOR_TRUE@stap_DEPENDENCIES = $(am__append_21)
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@stapvirt_SOURCES = stapvirt.c
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@stapvirt_CFLAGS = $(AM_CFLAGS) \
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@	$(libvirt_CFLAGS) \
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@	$(libxml2_CFLAGS)
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@stapvirt_LDFLAGS = $(AM_LDFLAGS)
fab312
-@BUILD_TRANSLATOR_TRUE@@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@stapvirt_LDADD = $(libvirt_LIBS) $(libxml2_LIBS)
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@stapvirt_SOURCES = stapvirt.c
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@stapvirt_CFLAGS =  \
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@	$(AM_CFLAGS) \
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@	$(libvirt_CFLAGS) \
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@	$(libxml2_CFLAGS)
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@stapvirt_LDFLAGS = $(AM_LDFLAGS)
fab312
+@BUILD_TRANSLATOR_TRUE@@BUILD_VIRT_TRUE@stapvirt_LDADD = $(libvirt_LIBS) $(libxml2_LIBS)
fab312
 
fab312
 # Arrange for git_version.h to be regenerated at every "make".
fab312
 # Code fragment is based upon RadeonHD.am.
fab312
diff --git a/aclocal.m4 b/aclocal.m4
fab312
index be5bd31..c261205 100644
fab312
--- a/aclocal.m4
fab312
+++ b/aclocal.m4
fab312
@@ -20,8 +20,8 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
fab312
 If you have problems, you may need to regenerate the build system entirely.
fab312
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
fab312
 
fab312
-# intlmacosx.m4 serial 5 (gettext-0.18.2)
fab312
-dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
fab312
+# intlmacosx.m4 serial 1 (gettext-0.17)
fab312
+dnl Copyright (C) 2004-2007 Free Software Foundation, Inc.
fab312
 dnl This file is free software; the Free Software Foundation
fab312
 dnl gives unlimited permission to copy and/or distribute it,
fab312
 dnl with or without modifications, as long as this notice is preserved.
fab312
@@ -35,40 +35,35 @@ dnl by the GNU Library General Public License, and the rest of the GNU
fab312
 dnl gettext package package is covered by the GNU General Public License.
fab312
 dnl They are *not* in the public domain.
fab312
 
fab312
-dnl Checks for special options needed on Mac OS X.
fab312
+dnl Checks for special options needed on MacOS X.
fab312
 dnl Defines INTL_MACOSX_LIBS.
fab312
 AC_DEFUN([gt_INTL_MACOSX],
fab312
 [
fab312
-  dnl Check for API introduced in Mac OS X 10.2.
fab312
+  dnl Check for API introduced in MacOS X 10.2.
fab312
   AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
fab312
-    [gt_cv_func_CFPreferencesCopyAppValue],
fab312
+    gt_cv_func_CFPreferencesCopyAppValue,
fab312
     [gt_save_LIBS="$LIBS"
fab312
      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
fab312
-     AC_LINK_IFELSE(
fab312
-       [AC_LANG_PROGRAM(
fab312
-          [[#include <CoreFoundation/CFPreferences.h>]],
fab312
-          [[CFPreferencesCopyAppValue(NULL, NULL)]])],
fab312
+     AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>],
fab312
+       [CFPreferencesCopyAppValue(NULL, NULL)],
fab312
        [gt_cv_func_CFPreferencesCopyAppValue=yes],
fab312
        [gt_cv_func_CFPreferencesCopyAppValue=no])
fab312
      LIBS="$gt_save_LIBS"])
fab312
   if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
fab312
-    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
fab312
-      [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fab312
+    AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1,
fab312
+      [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
fab312
   fi
fab312
-  dnl Check for API introduced in Mac OS X 10.3.
fab312
-  AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
fab312
+  dnl Check for API introduced in MacOS X 10.3.
fab312
+  AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent,
fab312
     [gt_save_LIBS="$LIBS"
fab312
      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
fab312
-     AC_LINK_IFELSE(
fab312
-       [AC_LANG_PROGRAM(
fab312
-          [[#include <CoreFoundation/CFLocale.h>]],
fab312
-          [[CFLocaleCopyCurrent();]])],
fab312
+     AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();],
fab312
        [gt_cv_func_CFLocaleCopyCurrent=yes],
fab312
        [gt_cv_func_CFLocaleCopyCurrent=no])
fab312
      LIBS="$gt_save_LIBS"])
fab312
   if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
fab312
-    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
fab312
-      [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
fab312
+    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1,
fab312
+      [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
fab312
   fi
fab312
   INTL_MACOSX_LIBS=
fab312
   if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
fab312
@@ -78,7 +73,6 @@ AC_DEFUN([gt_INTL_MACOSX],
fab312
 ])
fab312
 
fab312
 # pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
fab312
-# serial 1 (pkg-config-0.24)
fab312
 # 
fab312
 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
fab312
 #
fab312
@@ -105,12 +99,8 @@ AC_DEFUN([gt_INTL_MACOSX],
fab312
 # ----------------------------------
fab312
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
fab312
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
fab312
-m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
fab312
-m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
fab312
-AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
fab312
-AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
fab312
-AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
fab312
-
fab312
+m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
fab312
+AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
fab312
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
fab312
 	AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fab312
 fi
fab312
@@ -123,6 +113,7 @@ if test -n "$PKG_CONFIG"; then
fab312
 		AC_MSG_RESULT([no])
fab312
 		PKG_CONFIG=""
fab312
 	fi
fab312
+		
fab312
 fi[]dnl
fab312
 ])# PKG_PROG_PKG_CONFIG
fab312
 
fab312
@@ -131,20 +122,21 @@ fi[]dnl
fab312
 # Check to see whether a particular set of modules exists.  Similar
fab312
 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
fab312
 #
fab312
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
fab312
-# only at the first occurence in configure.ac, so if the first place
fab312
-# it's called might be skipped (such as if it is within an "if", you
fab312
-# have to call PKG_CHECK_EXISTS manually
fab312
+#
fab312
+# Similar to PKG_CHECK_MODULES, make sure that the first instance of
fab312
+# this or PKG_CHECK_MODULES is called, or make sure to call
fab312
+# PKG_CHECK_EXISTS manually
fab312
 # --------------------------------------------------------------
fab312
 AC_DEFUN([PKG_CHECK_EXISTS],
fab312
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
fab312
 if test -n "$PKG_CONFIG" && \
fab312
     AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
fab312
-  m4_default([$2], [:])
fab312
+  m4_ifval([$2], [$2], [:])
fab312
 m4_ifvaln([$3], [else
fab312
   $3])dnl
fab312
 fi])
fab312
 
fab312
+
fab312
 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
fab312
 # ---------------------------------------------
fab312
 m4_define([_PKG_CONFIG],
fab312
@@ -152,8 +144,7 @@ m4_define([_PKG_CONFIG],
fab312
     pkg_cv_[]$1="$$1"
fab312
  elif test -n "$PKG_CONFIG"; then
fab312
     PKG_CHECK_EXISTS([$3],
fab312
-                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes ],
fab312
+                     [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
fab312
 		     [pkg_failed=yes])
fab312
  else
fab312
     pkg_failed=untried
fab312
@@ -198,17 +189,16 @@ and $1[]_LIBS to avoid the need to call pkg-config.
fab312
 See the pkg-config man page for more details.])
fab312
 
fab312
 if test $pkg_failed = yes; then
fab312
-   	AC_MSG_RESULT([no])
fab312
         _PKG_SHORT_ERRORS_SUPPORTED
fab312
         if test $_pkg_short_errors_supported = yes; then
fab312
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
fab312
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
fab312
         else 
fab312
-	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fab312
+	        $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
fab312
         fi
fab312
 	# Put the nasty error message in config.log where it belongs
fab312
 	echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
fab312
 
fab312
-	m4_default([$4], [AC_MSG_ERROR(
fab312
+	ifelse([$4], , [AC_MSG_ERROR(dnl
fab312
 [Package requirements ($2) were not met:
fab312
 
fab312
 $$1_PKG_ERRORS
fab312
@@ -216,67 +206,28 @@ $$1_PKG_ERRORS
fab312
 Consider adjusting the PKG_CONFIG_PATH environment variable if you
fab312
 installed software in a non-standard prefix.
fab312
 
fab312
-_PKG_TEXT])[]dnl
fab312
-        ])
fab312
+_PKG_TEXT
fab312
+])],
fab312
+		[AC_MSG_RESULT([no])
fab312
+                $4])
fab312
 elif test $pkg_failed = untried; then
fab312
-     	AC_MSG_RESULT([no])
fab312
-	m4_default([$4], [AC_MSG_FAILURE(
fab312
+	ifelse([$4], , [AC_MSG_FAILURE(dnl
fab312
 [The pkg-config script could not be found or is too old.  Make sure it
fab312
 is in your PATH or set the PKG_CONFIG environment variable to the full
fab312
 path to pkg-config.
fab312
 
fab312
 _PKG_TEXT
fab312
 
fab312
-To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
fab312
-        ])
fab312
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
fab312
+		[$4])
fab312
 else
fab312
 	$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
fab312
 	$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
fab312
         AC_MSG_RESULT([yes])
fab312
-	$3
fab312
+	ifelse([$3], , :, [$3])
fab312
 fi[]dnl
fab312
 ])# PKG_CHECK_MODULES
fab312
 
fab312
-
fab312
-# PKG_INSTALLDIR(DIRECTORY)
fab312
-# -------------------------
fab312
-# Substitutes the variable pkgconfigdir as the location where a module
fab312
-# should install pkg-config .pc files. By default the directory is
fab312
-# $libdir/pkgconfig, but the default can be changed by passing
fab312
-# DIRECTORY. The user can override through the --with-pkgconfigdir
fab312
-# parameter.
fab312
-AC_DEFUN([PKG_INSTALLDIR],
fab312
-[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
fab312
-m4_pushdef([pkg_description],
fab312
-    [pkg-config installation directory @<:@]pkg_default[@:>@])
fab312
-AC_ARG_WITH([pkgconfigdir],
fab312
-    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
fab312
-    [with_pkgconfigdir=]pkg_default)
fab312
-AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
fab312
-m4_popdef([pkg_default])
fab312
-m4_popdef([pkg_description])
fab312
-]) dnl PKG_INSTALLDIR
fab312
-
fab312
-
fab312
-# PKG_NOARCH_INSTALLDIR(DIRECTORY)
fab312
-# -------------------------
fab312
-# Substitutes the variable noarch_pkgconfigdir as the location where a
fab312
-# module should install arch-independent pkg-config .pc files. By
fab312
-# default the directory is $datadir/pkgconfig, but the default can be
fab312
-# changed by passing DIRECTORY. The user can override through the
fab312
-# --with-noarch-pkgconfigdir parameter.
fab312
-AC_DEFUN([PKG_NOARCH_INSTALLDIR],
fab312
-[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
fab312
-m4_pushdef([pkg_description],
fab312
-    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
fab312
-AC_ARG_WITH([noarch-pkgconfigdir],
fab312
-    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
fab312
-    [with_noarch_pkgconfigdir=]pkg_default)
fab312
-AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
fab312
-m4_popdef([pkg_default])
fab312
-m4_popdef([pkg_description])
fab312
-]) dnl PKG_NOARCH_INSTALLDIR
fab312
-
fab312
 # Copyright (C) 2002-2013 Free Software Foundation, Inc.
fab312
 #
fab312
 # This file is free software; the Free Software Foundation
fab312
diff --git a/configure b/configure
fab312
index e6f0d2d..567a5d3 100755
fab312
--- a/configure
fab312
+++ b/configure
fab312
@@ -642,6 +642,8 @@ HAVE_SELINUX_TRUE
fab312
 selinux_LIBS
fab312
 selinux_CFLAGS
fab312
 support_section_question
fab312
+BUILD_VIRT_FALSE
fab312
+BUILD_VIRT_TRUE
fab312
 HAVE_LIBXML2_FALSE
fab312
 HAVE_LIBXML2_TRUE
fab312
 libxml2_LIBS
fab312
@@ -671,8 +673,6 @@ HAVE_NSS_FALSE
fab312
 HAVE_NSS_TRUE
fab312
 nss_LIBS
fab312
 nss_CFLAGS
fab312
-PKG_CONFIG_LIBDIR
fab312
-PKG_CONFIG_PATH
fab312
 PKG_CONFIG
fab312
 BUILD_PDFREFDOCS_FALSE
fab312
 BUILD_PDFREFDOCS_TRUE
fab312
@@ -860,6 +860,7 @@ with_avahi
fab312
 with_rpm
fab312
 with_elfutils
fab312
 with_dyninst
fab312
+enable_virt
fab312
 with_selinux
fab312
 with_java
fab312
 with_extra_version
fab312
@@ -877,8 +878,6 @@ CXX
fab312
 CXXFLAGS
fab312
 CCC
fab312
 PKG_CONFIG
fab312
-PKG_CONFIG_PATH
fab312
-PKG_CONFIG_LIBDIR
fab312
 nss_CFLAGS
fab312
 nss_LIBS
fab312
 avahi_CFLAGS
fab312
@@ -1541,6 +1540,8 @@ Optional Features:
fab312
                           if xmlto etc. found and other documentation built).
fab312
   --enable-server         enable building of stap-server (default on if nss
fab312
                           etc. found).
fab312
+  --enable-virt           enable building of stapvirt support (default on if
fab312
+                          libvirt etc. found).
fab312
 
fab312
 Optional Packages:
fab312
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
fab312
@@ -1578,10 +1579,6 @@ Some influential environment variables:
fab312
   CXX         C++ compiler command
fab312
   CXXFLAGS    C++ compiler flags
fab312
   PKG_CONFIG  path to pkg-config utility
fab312
-  PKG_CONFIG_PATH
fab312
-              directories to add to pkg-config's search path
fab312
-  PKG_CONFIG_LIBDIR
fab312
-              path overriding pkg-config's built-in search path
fab312
   nss_CFLAGS  C compiler flags for nss, overriding pkg-config
fab312
   nss_LIBS    linker flags for nss, overriding pkg-config
fab312
   avahi_CFLAGS
fab312
@@ -9913,11 +9910,6 @@ fi
fab312
 
fab312
 
fab312
 
fab312
-
fab312
-
fab312
-
fab312
-
fab312
-
fab312
 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
fab312
 	if test -n "$ac_tool_prefix"; then
fab312
   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
fab312
@@ -10030,6 +10022,7 @@ $as_echo "yes" >&6; }
fab312
 $as_echo "no" >&6; }
fab312
 		PKG_CONFIG=""
fab312
 	fi
fab312
+
fab312
 fi
fab312
 if test "x$with_nss" != "xno"; then :
fab312
 
fab312
@@ -10048,7 +10041,6 @@ if test -n "$nss_CFLAGS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_nss_CFLAGS=`$PKG_CONFIG --cflags "nss >= 3" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -10065,7 +10057,6 @@ if test -n "$nss_LIBS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_nss_LIBS=`$PKG_CONFIG --libs "nss >= 3" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -10076,8 +10067,6 @@ fi
fab312
 
fab312
 
fab312
 if test $pkg_failed = yes; then
fab312
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
-$as_echo "no" >&6; }
fab312
 
fab312
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
fab312
         _pkg_short_errors_supported=yes
fab312
@@ -10085,17 +10074,17 @@ else
fab312
         _pkg_short_errors_supported=no
fab312
 fi
fab312
         if test $_pkg_short_errors_supported = yes; then
fab312
-	        nss_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "nss >= 3" 2>&1`
fab312
+	        nss_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "nss >= 3" 2>&1`
fab312
         else
fab312
-	        nss_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "nss >= 3" 2>&1`
fab312
+	        nss_PKG_ERRORS=`$PKG_CONFIG --print-errors "nss >= 3" 2>&1`
fab312
         fi
fab312
 	# Put the nasty error message in config.log where it belongs
fab312
 	echo "$nss_PKG_ERRORS" >&5
fab312
 
fab312
-	have_nss=no
fab312
-elif test $pkg_failed = untried; then
fab312
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
 $as_echo "no" >&6; }
fab312
+                have_nss=no
fab312
+elif test $pkg_failed = untried; then
fab312
 	have_nss=no
fab312
 else
fab312
 	nss_CFLAGS=$pkg_cv_nss_CFLAGS
fab312
@@ -10174,7 +10163,6 @@ if test -n "$avahi_CFLAGS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_avahi_CFLAGS=`$PKG_CONFIG --cflags "avahi-client" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -10191,7 +10179,6 @@ if test -n "$avahi_LIBS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_avahi_LIBS=`$PKG_CONFIG --libs "avahi-client" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -10202,8 +10189,6 @@ fi
fab312
 
fab312
 
fab312
 if test $pkg_failed = yes; then
fab312
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
-$as_echo "no" >&6; }
fab312
 
fab312
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
fab312
         _pkg_short_errors_supported=yes
fab312
@@ -10211,17 +10196,17 @@ else
fab312
         _pkg_short_errors_supported=no
fab312
 fi
fab312
         if test $_pkg_short_errors_supported = yes; then
fab312
-	        avahi_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "avahi-client" 2>&1`
fab312
+	        avahi_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "avahi-client" 2>&1`
fab312
         else
fab312
-	        avahi_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "avahi-client" 2>&1`
fab312
+	        avahi_PKG_ERRORS=`$PKG_CONFIG --print-errors "avahi-client" 2>&1`
fab312
         fi
fab312
 	# Put the nasty error message in config.log where it belongs
fab312
 	echo "$avahi_PKG_ERRORS" >&5
fab312
 
fab312
-	have_avahi=no
fab312
-elif test $pkg_failed = untried; then
fab312
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
 $as_echo "no" >&6; }
fab312
+                have_avahi=no
fab312
+elif test $pkg_failed = untried; then
fab312
 	have_avahi=no
fab312
 else
fab312
 	avahi_CFLAGS=$pkg_cv_avahi_CFLAGS
fab312
@@ -10889,6 +10874,15 @@ fi
fab312
 
fab312
 
fab312
 
fab312
+# Check whether --enable-virt was given.
fab312
+if test "${enable_virt+set}" = set; then :
fab312
+  enableval=$enable_virt; enable_virt=$enableval
fab312
+else
fab312
+  enable_virt="check"
fab312
+fi
fab312
+
fab312
+
fab312
+
fab312
 pkg_failed=no
fab312
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libvirt" >&5
fab312
 $as_echo_n "checking for libvirt... " >&6; }
fab312
@@ -10903,7 +10897,6 @@ if test -n "$libvirt_CFLAGS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_libvirt_CFLAGS=`$PKG_CONFIG --cflags "libvirt >= 1.0.2" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -10920,7 +10913,6 @@ if test -n "$libvirt_LIBS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_libvirt_LIBS=`$PKG_CONFIG --libs "libvirt >= 1.0.2" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -10931,8 +10923,6 @@ fi
fab312
 
fab312
 
fab312
 if test $pkg_failed = yes; then
fab312
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
-$as_echo "no" >&6; }
fab312
 
fab312
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
fab312
         _pkg_short_errors_supported=yes
fab312
@@ -10940,17 +10930,17 @@ else
fab312
         _pkg_short_errors_supported=no
fab312
 fi
fab312
         if test $_pkg_short_errors_supported = yes; then
fab312
-	        libvirt_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libvirt >= 1.0.2" 2>&1`
fab312
+	        libvirt_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libvirt >= 1.0.2" 2>&1`
fab312
         else
fab312
-	        libvirt_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libvirt >= 1.0.2" 2>&1`
fab312
+	        libvirt_PKG_ERRORS=`$PKG_CONFIG --print-errors "libvirt >= 1.0.2" 2>&1`
fab312
         fi
fab312
 	# Put the nasty error message in config.log where it belongs
fab312
 	echo "$libvirt_PKG_ERRORS" >&5
fab312
 
fab312
-	have_libvirt=no
fab312
-elif test $pkg_failed = untried; then
fab312
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
 $as_echo "no" >&6; }
fab312
+                have_libvirt=no
fab312
+elif test $pkg_failed = untried; then
fab312
 	have_libvirt=no
fab312
 else
fab312
 	libvirt_CFLAGS=$pkg_cv_libvirt_CFLAGS
fab312
@@ -10987,7 +10977,6 @@ if test -n "$libxml2_CFLAGS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_libxml2_CFLAGS=`$PKG_CONFIG --cflags "libxml-2.0" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -11004,7 +10993,6 @@ if test -n "$libxml2_LIBS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_libxml2_LIBS=`$PKG_CONFIG --libs "libxml-2.0" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -11015,8 +11003,6 @@ fi
fab312
 
fab312
 
fab312
 if test $pkg_failed = yes; then
fab312
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
-$as_echo "no" >&6; }
fab312
 
fab312
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
fab312
         _pkg_short_errors_supported=yes
fab312
@@ -11024,17 +11010,17 @@ else
fab312
         _pkg_short_errors_supported=no
fab312
 fi
fab312
         if test $_pkg_short_errors_supported = yes; then
fab312
-	        libxml2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libxml-2.0" 2>&1`
fab312
+	        libxml2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libxml-2.0" 2>&1`
fab312
         else
fab312
-	        libxml2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libxml-2.0" 2>&1`
fab312
+	        libxml2_PKG_ERRORS=`$PKG_CONFIG --print-errors "libxml-2.0" 2>&1`
fab312
         fi
fab312
 	# Put the nasty error message in config.log where it belongs
fab312
 	echo "$libxml2_PKG_ERRORS" >&5
fab312
 
fab312
-	have_libxml2=no
fab312
-elif test $pkg_failed = untried; then
fab312
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
 $as_echo "no" >&6; }
fab312
+                have_libxml2=no
fab312
+elif test $pkg_failed = untried; then
fab312
 	have_libxml2=no
fab312
 else
fab312
 	libxml2_CFLAGS=$pkg_cv_libxml2_CFLAGS
fab312
@@ -11057,6 +11043,26 @@ else
fab312
 fi
fab312
 
fab312
 
fab312
+if test "$enable_virt" != "no"; then
fab312
+  if test "x${have_libvirt}" != "xyes"; then
fab312
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: will not build systemtap virt support, cannot find libvirt headers" >&5
fab312
+$as_echo "$as_me: WARNING: will not build systemtap virt support, cannot find libvirt headers" >&2;}
fab312
+  fi
fab312
+  if test "x${have_libxml2}" != "xyes"; then
fab312
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: will not build systemtap virt support, cannot find xml2 headers" >&5
fab312
+$as_echo "$as_me: WARNING: will not build systemtap virt support, cannot find xml2 headers" >&2;}
fab312
+  fi
fab312
+fi
fab312
+ if test "${have_libvirt}" == "yes" -a "${have_libxml2}" == "yes" -a "$enable_virt" != "no"; then
fab312
+  BUILD_VIRT_TRUE=
fab312
+  BUILD_VIRT_FALSE='#'
fab312
+else
fab312
+  BUILD_VIRT_TRUE='#'
fab312
+  BUILD_VIRT_FALSE=
fab312
+fi
fab312
+
fab312
+
fab312
+
fab312
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler .section \"?\" flags support" >&5
fab312
 $as_echo_n "checking for assembler .section \"?\" flags support... " >&6; }
fab312
 if ${stap_cv_sectionq+:} false; then :
fab312
@@ -11188,7 +11194,6 @@ if test -n "$selinux_CFLAGS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_selinux_CFLAGS=`$PKG_CONFIG --cflags "libselinux" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -11205,7 +11210,6 @@ if test -n "$selinux_LIBS"; then
fab312
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
fab312
   test $ac_status = 0; }; then
fab312
   pkg_cv_selinux_LIBS=`$PKG_CONFIG --libs "libselinux" 2>/dev/null`
fab312
-		      test "x$?" != "x0" && pkg_failed=yes
fab312
 else
fab312
   pkg_failed=yes
fab312
 fi
fab312
@@ -11216,8 +11220,6 @@ fi
fab312
 
fab312
 
fab312
 if test $pkg_failed = yes; then
fab312
-   	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
-$as_echo "no" >&6; }
fab312
 
fab312
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
fab312
         _pkg_short_errors_supported=yes
fab312
@@ -11225,17 +11227,17 @@ else
fab312
         _pkg_short_errors_supported=no
fab312
 fi
fab312
         if test $_pkg_short_errors_supported = yes; then
fab312
-	        selinux_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libselinux" 2>&1`
fab312
+	        selinux_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "libselinux" 2>&1`
fab312
         else
fab312
-	        selinux_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libselinux" 2>&1`
fab312
+	        selinux_PKG_ERRORS=`$PKG_CONFIG --print-errors "libselinux" 2>&1`
fab312
         fi
fab312
 	# Put the nasty error message in config.log where it belongs
fab312
 	echo "$selinux_PKG_ERRORS" >&5
fab312
 
fab312
-	have_selinux=no
fab312
-elif test $pkg_failed = untried; then
fab312
-     	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
fab312
 $as_echo "no" >&6; }
fab312
+                have_selinux=no
fab312
+elif test $pkg_failed = untried; then
fab312
 	have_selinux=no
fab312
 else
fab312
 	selinux_CFLAGS=$pkg_cv_selinux_CFLAGS
fab312
@@ -11678,6 +11680,10 @@ if test -z "${HAVE_LIBXML2_TRUE}" && test -z "${HAVE_LIBXML2_FALSE}"; then
fab312
   as_fn_error $? "conditional \"HAVE_LIBXML2\" was never defined.
fab312
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fab312
 fi
fab312
+if test -z "${BUILD_VIRT_TRUE}" && test -z "${BUILD_VIRT_FALSE}"; then
fab312
+  as_fn_error $? "conditional \"BUILD_VIRT\" was never defined.
fab312
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
fab312
+fi
fab312
 if test -z "${HAVE_SELINUX_TRUE}" && test -z "${HAVE_SELINUX_FALSE}"; then
fab312
   as_fn_error $? "conditional \"HAVE_SELINUX\" was never defined.
fab312
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fab312
diff --git a/configure.ac b/configure.ac
fab312
index b540354..1778eff 100644
fab312
--- a/configure.ac
fab312
+++ b/configure.ac
fab312
@@ -526,8 +526,15 @@ if test "$with_dyninst" != "no"; then
fab312
 fi
fab312
 AM_CONDITIONAL([HAVE_DYNINST], [test "${have_dyninst}" = "yes"])
fab312
 
fab312
+
fab312
 dnl Check for the libvirt and libxml2 devel packages
fab312
 
fab312
+AC_ARG_ENABLE([virt],
fab312
+  AS_HELP_STRING([--enable-virt],
fab312
+    [enable building of stapvirt support (default on if libvirt etc. found).]),
fab312
+  [enable_virt=$enableval],
fab312
+  [enable_virt="check"])
fab312
+
fab312
 dnl We require libvirt >= 1.0.2 because stapvirt relies on the
fab312
 dnl virDomainOpenChannel function, which was implemented in 1.0.2.
fab312
 PKG_CHECK_MODULES([libvirt], [libvirt >= 1.0.2], [
fab312
@@ -541,6 +548,18 @@ PKG_CHECK_MODULES([libxml2], [libxml-2.0], [
fab312
    ], [have_libxml2=no])
fab312
 AM_CONDITIONAL([HAVE_LIBXML2], [test "${have_libxml2}" = "yes"])
fab312
 
fab312
+if test "$enable_virt" != "no"; then
fab312
+dnl See if we have enough libraries and tools to build the virt server
fab312
+  if test "x${have_libvirt}" != "xyes"; then
fab312
+    AC_MSG_WARN([will not build systemtap virt support, cannot find libvirt headers])
fab312
+  fi		       
fab312
+  if test "x${have_libxml2}" != "xyes"; then
fab312
+    AC_MSG_WARN([will not build systemtap virt support, cannot find xml2 headers])
fab312
+  fi		       
fab312
+fi
fab312
+AM_CONDITIONAL([BUILD_VIRT], [test "${have_libvirt}" == "yes" -a "${have_libxml2}" == "yes" -a "$enable_virt" != "no"])
fab312
+
fab312
+
fab312
 AC_CACHE_CHECK([for assembler .section "?" flags support], stap_cv_sectionq, [
fab312
 old_CFLAGS="$CFLAGS"
fab312
 CFLAGS="$CFLAGS -Wa,--fatal-warnings"
fab312
diff --git a/doc/Makefile.in b/doc/Makefile.in
fab312
index 45521e6..7a070ef 100644
fab312
--- a/doc/Makefile.in
fab312
+++ b/doc/Makefile.in
fab312
@@ -216,8 +216,6 @@ PIECFLAGS = @PIECFLAGS@
fab312
 PIECXXFLAGS = @PIECXXFLAGS@
fab312
 PIELDFLAGS = @PIELDFLAGS@
fab312
 PKG_CONFIG = @PKG_CONFIG@
fab312
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
fab312
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
fab312
 POSUB = @POSUB@
fab312
 PUBLICAN_BRAND = @PUBLICAN_BRAND@
fab312
 RANLIB = @RANLIB@
fab312
diff --git a/doc/SystemTap_Tapset_Reference/Makefile.in b/doc/SystemTap_Tapset_Reference/Makefile.in
fab312
index c2f515a..52b4978 100644
fab312
--- a/doc/SystemTap_Tapset_Reference/Makefile.in
fab312
+++ b/doc/SystemTap_Tapset_Reference/Makefile.in
fab312
@@ -225,8 +225,6 @@ PIECFLAGS = @PIECFLAGS@
fab312
 PIECXXFLAGS = @PIECXXFLAGS@
fab312
 PIELDFLAGS = @PIELDFLAGS@
fab312
 PKG_CONFIG = @PKG_CONFIG@
fab312
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
fab312
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
fab312
 POSUB = @POSUB@
fab312
 PUBLICAN_BRAND = @PUBLICAN_BRAND@
fab312
 RANLIB = @RANLIB@
fab312
diff --git a/doc/beginners/Makefile.in b/doc/beginners/Makefile.in
fab312
index 4eba062..bafb973 100644
fab312
--- a/doc/beginners/Makefile.in
fab312
+++ b/doc/beginners/Makefile.in
fab312
@@ -188,8 +188,6 @@ PIECFLAGS = @PIECFLAGS@
fab312
 PIECXXFLAGS = @PIECXXFLAGS@
fab312
 PIELDFLAGS = @PIELDFLAGS@
fab312
 PKG_CONFIG = @PKG_CONFIG@
fab312
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
fab312
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
fab312
 POSUB = @POSUB@
fab312
 PUBLICAN_BRAND = @PUBLICAN_BRAND@
fab312
 RANLIB = @RANLIB@
fab312
diff --git a/java/Makefile.in b/java/Makefile.in
fab312
index f5eec5a..a881a1e 100644
fab312
--- a/java/Makefile.in
fab312
+++ b/java/Makefile.in
fab312
@@ -271,8 +271,6 @@ PIECFLAGS = @PIECFLAGS@
fab312
 PIECXXFLAGS = @PIECXXFLAGS@
fab312
 PIELDFLAGS = @PIELDFLAGS@
fab312
 PKG_CONFIG = @PKG_CONFIG@
fab312
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
fab312
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
fab312
 POSUB = @POSUB@
fab312
 PUBLICAN_BRAND = @PUBLICAN_BRAND@
fab312
 RANLIB = @RANLIB@
fab312
diff --git a/man/Makefile.am b/man/Makefile.am
fab312
index ef0892e..4116ff5 100644
fab312
--- a/man/Makefile.am
fab312
+++ b/man/Makefile.am
fab312
@@ -28,9 +28,7 @@ man_MANS += stap-server.8
fab312
 endif
fab312
 endif
fab312
 
fab312
-if HAVE_LIBVIRT
fab312
-if HAVE_LIBXML2
fab312
+if BUILD_VIRT
fab312
 man_MANS += stapvirt.1
fab312
 endif
fab312
-endif
fab312
 
fab312
diff --git a/man/Makefile.in b/man/Makefile.in
fab312
index ae68814..2c7493f 100644
fab312
--- a/man/Makefile.in
fab312
+++ b/man/Makefile.in
fab312
@@ -82,7 +82,7 @@ host_triplet = @host@
fab312
 target_triplet = @target@
fab312
 @BUILD_TRANSLATOR_TRUE@am__append_1 = stap.1 stap-prep.1 stap-report.1
fab312
 @BUILD_SERVER_TRUE@@HAVE_NSS_TRUE@am__append_2 = stap-server.8
fab312
-@HAVE_LIBVIRT_TRUE@@HAVE_LIBXML2_TRUE@am__append_3 = stapvirt.1
fab312
+@BUILD_VIRT_TRUE@am__append_3 = stapvirt.1
fab312
 subdir = man
fab312
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
fab312
 	$(srcdir)/stappaths.7.in $(srcdir)/systemtap.8.in
fab312
@@ -221,8 +221,6 @@ PIECFLAGS = @PIECFLAGS@
fab312
 PIECXXFLAGS = @PIECXXFLAGS@
fab312
 PIELDFLAGS = @PIELDFLAGS@
fab312
 PKG_CONFIG = @PKG_CONFIG@
fab312
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
fab312
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
fab312
 POSUB = @POSUB@
fab312
 PUBLICAN_BRAND = @PUBLICAN_BRAND@
fab312
 RANLIB = @RANLIB@
fab312
diff --git a/stapdyn/Makefile.in b/stapdyn/Makefile.in
fab312
index f384d0f..fe85082 100644
fab312
--- a/stapdyn/Makefile.in
fab312
+++ b/stapdyn/Makefile.in
fab312
@@ -280,8 +280,6 @@ PIECFLAGS = @PIECFLAGS@
fab312
 PIECXXFLAGS = @PIECXXFLAGS@
fab312
 PIELDFLAGS = @PIELDFLAGS@
fab312
 PKG_CONFIG = @PKG_CONFIG@
fab312
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
fab312
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
fab312
 POSUB = @POSUB@
fab312
 PUBLICAN_BRAND = @PUBLICAN_BRAND@
fab312
 RANLIB = @RANLIB@
fab312
diff --git a/staprun/Makefile.in b/staprun/Makefile.in
fab312
index 525b9e8..4596c96 100644
fab312
--- a/staprun/Makefile.in
fab312
+++ b/staprun/Makefile.in
fab312
@@ -319,8 +319,6 @@ PIECFLAGS = @PIECFLAGS@
fab312
 PIECXXFLAGS = @PIECXXFLAGS@
fab312
 PIELDFLAGS = @PIELDFLAGS@
fab312
 PKG_CONFIG = @PKG_CONFIG@
fab312
-PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
fab312
-PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
fab312
 POSUB = @POSUB@
fab312
 PUBLICAN_BRAND = @PUBLICAN_BRAND@
fab312
 RANLIB = @RANLIB@
fab312
diff --git a/systemtap.spec b/systemtap.spec
fab312
index f78783e..eded870 100644
fab312
--- a/systemtap.spec
fab312
+++ b/systemtap.spec
fab312
@@ -470,7 +470,13 @@ cd ..
fab312
 %global java_config --without-java
fab312
 %endif
fab312
 
fab312
-%configure %{?elfutils_config} %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{publican_config} %{rpm_config} %{java_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}"
fab312
+%if %{with_virthost}
fab312
+%global virt_config --enable-virt
fab312
+%else
fab312
+%global virt_config --disable-virt
fab312
+%endif
fab312
+
fab312
+%configure %{?elfutils_config} %{dyninst_config} %{sqlite_config} %{crash_config} %{docs_config} %{pie_config} %{publican_config} %{rpm_config} %{java_config} %{virt_config} --disable-silent-rules --with-extra-version="rpm %{version}-%{release}"
fab312
 make %{?_smp_mflags}
fab312
 
fab312
 %if %{with_emacsvim}