Re: [libvirt] PATCH: Ensure configure.ac is fully quoted

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

 



"Daniel P. Berrange" <berrange@xxxxxxxxxx> wrote:
> As suggested by Jim, this patch goes through the configure script and makes
> sure all args to macros are fully quoted. NB, this applies on top of the
> NUMA/cpu pinning patches I sent the other day, not CVS.
...

Looks fine.  Thanks for doing that!
I confirmed that your change induces no change in configure.

> -  AC_PATH_PROG(MOUNT, [mount], [], [$PATH:/sbin:/usr/sbin])
> -  AC_PATH_PROG(UMOUNT, [umount], [], [$PATH:/sbin:/usr/sbin])
> +  AC_PATH_PROG([MOUNT], [mount], [], [$PATH:/sbin:/usr/sbin])
> +  AC_PATH_PROG([UMOUNT], [umount], [], [$PATH:/sbin:/usr/sbin])
>    if test "$with_storage_fs" = "yes" ; then
>      if test -z "$MOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
>      if test -z "$UMOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi

BTW, I noticed a typo in context: that latter message should say "umount".

Also, in your numactl patch, you can remove the " for security" bit:

  +  AC_DEFINE_UNQUOTED([HAVE_NUMACTL], 1, [whether Numactl is available for security])

Re autoconf quoting, you can quote a few AC_MSG_ERROR arguments
like the two above.  Here's a patch that does a few more, including
each AC_HELP_STRING use.  You're welcome to apply it on top of yours.
The job is probably still incomplete, but that's no big deal...
[still no induced change in configure]

diff --git a/configure.in b/configure.in
index 2f1de92..13c3a8e 100644
--- a/configure.in
+++ b/configure.in
@@ -1,9 +1,9 @@
 dnl Process this file with autoconf to produce a configure script.

-AC_INIT(libvirt, 0.4.2)
-AC_CONFIG_SRCDIR(src/libvirt.c)
-AC_CONFIG_AUX_DIR(build-aux)
-AM_CONFIG_HEADER(config.h)
+AC_INIT([libvirt], [0.4.2])
+AC_CONFIG_SRCDIR([src/libvirt.c])
+AC_CONFIG_AUX_DIR([build-aux])
+AM_CONFIG_HEADER([config.h])
 dnl Make automake keep quiet about wildcards & other GNUmake-isms
 AM_INIT_AUTOMAKE([-Wno-portability])
 AC_CANONICAL_HOST
@@ -49,7 +49,7 @@ AC_C_CONST

 dnl Make sure we have an ANSI compiler
 AM_C_PROTOTYPES
-test "x$U" != "x" && AC_MSG_ERROR(Compiler not ANSI compliant)
+test "x$U" != "x" && AC_MSG_ERROR([Compiler not ANSI compliant])

 dnl Support building Win32 DLLs (must appear *before* AM_PROG_LIBTOOL)
 AC_LIBTOOL_WIN32_DLL
@@ -58,7 +58,7 @@ AM_PROG_LIBTOOL

 AM_PROG_CC_C_O

-LIBVIRT_COMPILE_WARNINGS(maximum)
+LIBVIRT_COMPILE_WARNINGS([maximum])

 dnl Availability of various common functions (non-fatal if missing).
 AC_CHECK_FUNCS([cfmakeraw regexec uname])
@@ -83,10 +83,10 @@ AM_CONDITIONAL([GLIBC_RPCGEN],

 dnl pthread?
 AC_CHECK_HEADER([pthread.h],
-	AC_CHECK_LIB([pthread],[pthread_join],[
+	[AC_CHECK_LIB([pthread],[pthread_join],[
 		AC_DEFINE([HAVE_LIBPTHREAD],[],[Define if pthread (-lpthread)])
 		AC_DEFINE([HAVE_PTHREAD_H],[],[Define if <pthread.h>])
-	]))
+	])])

 dnl Miscellaneous external programs.
 AC_PATH_PROG([RM], [rm], [/bin/rm])
@@ -110,12 +110,12 @@ AC_DEFINE_UNQUOTED([BRCTL],["$BRCTL"],
         [Location or name of the brctl program (see bridge-utils)])

 dnl Specific dir for HTML output ?
-AC_ARG_WITH([html-dir], AC_HELP_STRING([--with-html-dir=path],
-            [path to base html directory, default $datadir/doc/html]),
+AC_ARG_WITH([html-dir], [AC_HELP_STRING([--with-html-dir=path],
+            [path to base html directory, default $datadir/doc/html])],
             [HTML_DIR=$withval], [HTML_DIR='$(datadir)/doc'])

-AC_ARG_WITH([html-subdir], AC_HELP_STRING([--with-html-subdir=path],
-            [directory used under html-dir, default $PACKAGE-$VERSION/html]),
+AC_ARG_WITH([html-subdir], [AC_HELP_STRING([--with-html-subdir=path],
+            [directory used under html-dir, default $PACKAGE-$VERSION/html])],
             [test "x$withval" != "x" && HTML_DIR="$HTML_DIR/$withval"],
             [HTML_DIR="$HTML_DIR/\$(PACKAGE)-\$(VERSION)/html"])
 AC_SUBST([HTML_DIR])
@@ -160,15 +160,15 @@ AC_SUBST([STATIC_BINARIES])

 dnl --enable-debug=(yes|no)
 AC_ARG_ENABLE([debug],
-              AC_HELP_STRING([--enable-debug=no/yes],
-                             [enable debugging output]),[],[enable_debug=yes])
+              [AC_HELP_STRING([--enable-debug=no/yes],
+                             [enable debugging output])],[],[enable_debug=yes])
 if test x"$enable_debug" = x"yes"; then
    AC_DEFINE([ENABLE_DEBUG], [], [whether debugging is enabled])
 fi


 AC_MSG_CHECKING([where to write libvirtd PID file])
-AC_ARG_WITH([remote-pid-file], AC_HELP_STRING([--with-remote-pid-file=[pidfile|none]], [PID file for libvirtd]))
+AC_ARG_WITH([remote-pid-file], [AC_HELP_STRING([--with-remote-pid-file=[pidfile|none]], [PID file for libvirtd])])
 if test "x$with_remote_pid_file" == "x" ; then
    REMOTE_PID_FILE="$localstatedir/run/libvirtd.pid"
 elif test "x$with_remote_pid_file" == "xnone" ; then
@@ -184,8 +184,8 @@ dnl init script flavor
 dnl
 AC_MSG_CHECKING([for init script flavor])
 AC_ARG_WITH([init-script],
-            AC_HELP_STRING([--with-init-scripts=[redhat|auto|none]],
-                           [Style of init scripts to install (defaults to auto)]))
+            [AC_HELP_STRING([--with-init-scripts=[redhat|auto|none]],
+		     [Style of init scripts to install (defaults to auto)])])
 if test "x$with_init_scripts" = "x" -o "x$with_init_scripts" = "xauto"; then
     if test -f /etc/redhat-release ; then
         with_init_scripts=redhat
@@ -201,8 +201,8 @@ dnl ensure that Fedora's system-config-firewall knows
 dnl about libvirt's iptables rules
 dnl
 AC_ARG_ENABLE([iptables-lokkit],
-              AC_HELP_STRING([--enable-iptables-lokkit=no/yes/check],
-                             [enable registering libvirt's iptables rules with Fedora's lokkit]),
+              [AC_HELP_STRING([--enable-iptables-lokkit=no/yes/check],
+	   [enable registering libvirt's iptables rules with Fedora's lokkit])],
                              [],[enable_iptables_lokkit=check])
 if test x"$enable_iptables_lokkit" != x"no"; then
    AC_PATH_PROG([LOKKIT_PATH],[lokkit], [], [/usr/sbin:$PATH])
@@ -224,8 +224,8 @@ dnl
 dnl Specify the xen-distribution directory to be able to compile on a
 dnl non-xenified host
 dnl
-AC_ARG_WITH([xen-distdir], AC_HELP_STRING([--with-xen-distdir=path],
-            [distribution directory of Xen, default /usr]))
+AC_ARG_WITH([xen-distdir], [AC_HELP_STRING([--with-xen-distdir=path],
+            [distribution directory of Xen, default /usr])])
 if test "x$with_xen_distdir" != "x"
 then
 CPPFLAGS="$CPPFLAGS -I$withval/install/usr/include"
@@ -307,7 +307,7 @@ LIBXML_FOUND="no"
 AC_ARG_WITH([libxml], [  --with-libxml=[PFX]       libxml2 location])
 if test "x$with_libxml" = "xno" ; then
     AC_MSG_CHECKING(for libxml2 libraries >= $LIBXML_REQUIRED)
-    AC_MSG_ERROR(libxml2 >= $LIBXML_REQUIRED is required for libvirt)
+    AC_MSG_ERROR([libxml2 >= $LIBXML_REQUIRED is required for libvirt])
 elif test "x$with_libxml" = "x" -a "x$PKG_CONFIG" != "x" ; then
     PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= $LIBXML_REQUIRED, [LIBXML_FOUND=yes], [LIBXML_FOUND=no])
 fi
@@ -317,7 +317,7 @@ if test "$LIBXML_FOUND" = "no" ; then
     fi
     AC_MSG_CHECKING(libxml2 $LIBXML_CONFIG >= $LIBXML_REQUIRED )
     if ! $LIBXML_CONFIG --version > /dev/null 2>&1 ; then
-	AC_MSG_ERROR(Could not find libxml2 anywhere (see config.log for details).)
+	AC_MSG_ERROR([Could not find libxml2 anywhere (see config.log for details).])
     fi
     vers=`$LIBXML_CONFIG --version | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
     minvers=`echo $LIBXML_REQUIRED | awk -F. '{ printf "%d", ($1 * 1000 + $2) * 1000 + $3;}'`
@@ -538,7 +538,7 @@ dnl virsh libraries
 AC_CHECK_HEADERS([readline/readline.h])

 # Check for readline.
-AC_CHECK_LIB(readline, readline,
+AC_CHECK_LIB([readline], [readline],
 	[lv_use_readline=yes; VIRSH_LIBS="$VIRSH_LIBS -lreadline"],
 	[lv_use_readline=no])

@@ -548,7 +548,7 @@ AC_CHECK_LIB(readline, readline,
 if test $lv_use_readline = no; then
     lv_saved_libs=$LIBS
     LIBS=
-    AC_SEARCH_LIBS(tgetent, ncurses curses termcap termlib)
+    AC_SEARCH_LIBS([tgetent], [ncurses curses termcap termlib])
     case $LIBS in
       no*) ;;  # handle "no" and "none required"
       *) # anything else is a -lLIBRARY
@@ -597,8 +597,8 @@ if test "$with_storage_fs" = "yes" -o "$with_storage_fs" = "check"; then
   AC_PATH_PROG([MOUNT], [mount], [], [$PATH:/sbin:/usr/sbin])
   AC_PATH_PROG([UMOUNT], [umount], [], [$PATH:/sbin:/usr/sbin])
   if test "$with_storage_fs" = "yes" ; then
-    if test -z "$MOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
-    if test -z "$UMOUNT" ; then AC_MSG_ERROR(We need mount for FS storage driver) ; fi
+    if test -z "$MOUNT" ; then AC_MSG_ERROR([We need mount for FS storage driver]) ; fi
+    if test -z "$UMOUNT" ; then AC_MSG_ERROR([We need mount for FS storage driver]) ; fi
   else
     if test -z "$MOUNT" ; then with_storage_fs=no ; fi
     if test -z "$UMOUNT" ; then with_storage_fs=no ; fi
@@ -644,16 +644,16 @@ if test "$with_storage_lvm" = "yes" -o "$with_storage_lvm" = "check"; then
   AC_PATH_PROG([LVS], [lvs], [], [$PATH:/sbin:/usr/sbin])

   if test "$with_storage_lvm" = "yes" ; then
-    if test -z "$PVCREATE" ; then AC_MSG_ERROR(We need pvcreate for LVM storage driver) ; fi
-    if test -z "$VGCREATE" ; then AC_MSG_ERROR(We need vgcreate for LVM storage driver) ; fi
-    if test -z "$LVCREATE" ; then AC_MSG_ERROR(We need lvcreate for LVM storage driver) ; fi
-    if test -z "$PVREMOVE" ; then AC_MSG_ERROR(We need pvremove for LVM storage driver) ; fi
-    if test -z "$VGREMOVE" ; then AC_MSG_ERROR(We need vgremove for LVM storage driver) ; fi
-    if test -z "$LVREMOVE" ; then AC_MSG_ERROR(We need lvremove for LVM storage driver) ; fi
-    if test -z "$VGCHANGE" ; then AC_MSG_ERROR(We need vgchange for LVM storage driver) ; fi
-    if test -z "$PVS" ; then AC_MSG_ERROR(We need pvs for LVM storage driver) ; fi
-    if test -z "$VGS" ; then AC_MSG_ERROR(We need vgs for LVM storage driver) ; fi
-    if test -z "$LVS" ; then AC_MSG_ERROR(We need lvs for LVM storage driver) ; fi
+    if test -z "$PVCREATE" ; then AC_MSG_ERROR([We need pvcreate for LVM storage driver]) ; fi
+    if test -z "$VGCREATE" ; then AC_MSG_ERROR([We need vgcreate for LVM storage driver]) ; fi
+    if test -z "$LVCREATE" ; then AC_MSG_ERROR([We need lvcreate for LVM storage driver]) ; fi
+    if test -z "$PVREMOVE" ; then AC_MSG_ERROR([We need pvremove for LVM storage driver]) ; fi
+    if test -z "$VGREMOVE" ; then AC_MSG_ERROR([We need vgremove for LVM storage driver]) ; fi
+    if test -z "$LVREMOVE" ; then AC_MSG_ERROR([We need lvremove for LVM storage driver]) ; fi
+    if test -z "$VGCHANGE" ; then AC_MSG_ERROR([We need vgchange for LVM storage driver]) ; fi
+    if test -z "$PVS" ; then AC_MSG_ERROR([We need pvs for LVM storage driver]) ; fi
+    if test -z "$VGS" ; then AC_MSG_ERROR([We need vgs for LVM storage driver]) ; fi
+    if test -z "$LVS" ; then AC_MSG_ERROR([We need lvs for LVM storage driver]) ; fi
   else
     if test -z "$PVCREATE" ; then with_storage_lvm=no ; fi
     if test -z "$VGCREATE" ; then with_storage_lvm=no ; fi
@@ -690,7 +690,7 @@ AM_CONDITIONAL([WITH_STORAGE_LVM], [test "$with_storage_lvm" = "yes"])
 if test "$with_storage_iscsi" = "yes" -o "$with_storage_iscsi" = "check"; then
   AC_PATH_PROG([ISCSIADM], [iscsiadm], [], [$PATH:/sbin:/usr/sbin])
   if test "$with_storage_iscsi" = "yes" ; then
-    if test -z "$ISCSIADM" ; then AC_MSG_ERROR(We need iscsiadm for iSCSI storage driver) ; fi
+    if test -z "$ISCSIADM" ; then AC_MSG_ERROR([We need iscsiadm for iSCSI storage driver]) ; fi
   else
     if test -z "$ISCSIADM" ; then with_storage_iscsi=no ; fi

@@ -731,7 +731,7 @@ if test "$with_storage_disk" = "yes" -o "$with_storage_disk" = "check"; then

   if test "$PARTED_FOUND" = "no" ; then
     if test "$with_storage_disk" = "yes" ; then
-      AC_MSG_ERROR(We need parted for disk storage driver)
+      AC_MSG_ERROR([We need parted for disk storage driver])
     else
       with_storage_disk=no
     fi

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]