Roger Pau Monne
2012-Feb-22 03:18 UTC
[PATCH 0 of 8 v2] Several fixes for autoconf and Linux init scripts
Fix autoconf under NetBSD and add some tests to Linux xencommons to check for the necessary tools to run hotplug scripts. Changes since v1: * included /lib/lsb/init-functions in xencommons and xend. * Changed `hash` with `type`. * Move python xml check to xend init script.
Roger Pau Monne
2012-Feb-22 03:18 UTC
[PATCH 1 of 8 v2] autoconf: remove (yet another) brctl leftover
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # Date 1329875622 -3600 # Node ID 4081a567e9767efc5460010d71dd07a42ea86666 # Parent a4d93d0e0df2fafe5b3e2dab3e34799498a875e2 autoconf: remove (yet another) brctl leftover Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r a4d93d0e0df2 -r 4081a567e976 config/Tools.mk.in --- a/config/Tools.mk.in Wed Feb 22 14:33:24 2012 +0000 +++ b/config/Tools.mk.in Wed Feb 22 02:53:42 2012 +0100 @@ -11,7 +11,6 @@ FLEX := @FLEX@ PYTHON := @PYTHON@ PYTHON_PATH := @PYTHONPATH@ PERL := @PERL@ -BRCTL := @BRCTL@ IP := @IP@ CURL_CONFIG := @CURL@ XML2_CONFIG := @XML@
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # Date 1330003783 -3600 # Node ID 3aafecc004fd5339e88363615e7e9de727d2a5b9 # Parent 4081a567e9767efc5460010d71dd07a42ea86666 autoconf: remove ip check ip is a run-time dependency, and it is not needed to build Xen tools. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r 4081a567e976 -r 3aafecc004fd config/Tools.mk.in --- a/config/Tools.mk.in Wed Feb 22 02:53:42 2012 +0100 +++ b/config/Tools.mk.in Thu Feb 23 14:29:43 2012 +0100 @@ -11,7 +11,6 @@ FLEX := @FLEX@ PYTHON := @PYTHON@ PYTHON_PATH := @PYTHONPATH@ PERL := @PERL@ -IP := @IP@ CURL_CONFIG := @CURL@ XML2_CONFIG := @XML@ BASH := @BASH@ diff -r 4081a567e976 -r 3aafecc004fd tools/configure --- a/tools/configure Wed Feb 22 02:53:42 2012 +0100 +++ b/tools/configure Thu Feb 23 14:29:43 2012 +0100 @@ -637,7 +637,6 @@ XML CURL FLEX BISON -IP PERL PYTHON APPEND_LIB @@ -739,7 +738,6 @@ APPEND_INCLUDES APPEND_LIB PYTHON PERL -IP BISON FLEX CURL @@ -1394,7 +1392,6 @@ Some influential environment variables: APPEND_LIB List of library folders to append to LDFLAGS (without -L) PYTHON Path to the Python parser PERL Path to Perl parser - IP Path to ip tool BISON Path to Bison parser generator FLEX Path to Flex lexical analyser generator CURL Path to curl-config tool @@ -4158,7 +4155,6 @@ LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPE - # Checks for programs. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } @@ -4949,51 +4945,6 @@ if test x"${PERL}" == x"no" then as_fn_error $? "Unable to find perl, please install perl" "$LINENO" 5 fi -# Extract the first word of "ip", so it can be a program name with args. -set dummy ip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_IP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - case $IP in - [\\/]* | ?:[\\/]*) - ac_cv_path_IP="$IP" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '''' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_IP="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - test -z "$ac_cv_path_IP" && ac_cv_path_IP="no" - ;; -esac -fi -IP=$ac_cv_path_IP -if test -n "$IP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $IP" >&5 -$as_echo "$IP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -if test x"${IP}" == x"no" -then - as_fn_error $? "Unable to find ip, please install ip" "$LINENO" 5 -fi # Extract the first word of "bison", so it can be a program name with args. set dummy bison; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff -r 4081a567e976 -r 3aafecc004fd tools/configure.ac --- a/tools/configure.ac Wed Feb 22 02:53:42 2012 +0100 +++ b/tools/configure.ac Thu Feb 23 14:29:43 2012 +0100 @@ -62,7 +62,6 @@ AX_SET_FLAGS AC_ARG_VAR([PYTHON], [Path to the Python parser]) AC_ARG_VAR([PERL], [Path to Perl parser]) -AC_ARG_VAR([IP], [Path to ip tool]) AC_ARG_VAR([BISON], [Path to Bison parser generator]) AC_ARG_VAR([FLEX], [Path to Flex lexical analyser generator]) AC_ARG_VAR([CURL], [Path to curl-config tool]) @@ -77,7 +76,6 @@ AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_INSTALL AX_PATH_PROG_OR_FAIL([PERL], [perl]) -AX_PATH_PROG_OR_FAIL([IP], [ip]) AX_PATH_PROG_OR_FAIL([BISON], [bison]) AX_PATH_PROG_OR_FAIL([FLEX], [flex]) AS_IF([test "x$xapi" = "xy"], [
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # Date 1329880533 -3600 # Node ID a41d13f080d9fad38fd05ed87696502fe18c281c # Parent 3aafecc004fd5339e88363615e7e9de727d2a5b9 autoconf: remove python xml check Remove the xml module check from autoconf and move it to xend init script (in a later patch), since it''s a run time dependency. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r 3aafecc004fd -r a41d13f080d9 tools/configure --- a/tools/configure Thu Feb 23 14:29:43 2012 +0100 +++ b/tools/configure Wed Feb 22 04:15:33 2012 +0100 @@ -3846,8 +3846,6 @@ case $host_os in *\ *) host_os=`echo "$h - - # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # @@ -6255,18 +6253,6 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python xml.dom.minidom" >&5 -$as_echo_n "checking for python xml.dom.minidom... " >&6; } -`$PYTHON -c ''import xml.dom.minidom''` -if test "$?" != "0" -then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_fn_error $? "Unable to find xml.dom.minidom module" "$LINENO" 5 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python devel" >&5 $as_echo_n "checking for python devel... " >&6; } diff -r 3aafecc004fd -r a41d13f080d9 tools/configure.ac --- a/tools/configure.ac Thu Feb 23 14:29:43 2012 +0100 +++ b/tools/configure.ac Wed Feb 22 04:15:33 2012 +0100 @@ -26,7 +26,6 @@ AC_CANONICAL_HOST m4_include([m4/enable_feature.m4]) m4_include([m4/disable_feature.m4]) m4_include([m4/path_or_fail.m4]) -m4_include([m4/python_xml.m4]) m4_include([m4/python_version.m4]) m4_include([m4/python_devel.m4]) m4_include([m4/ocaml.m4]) @@ -99,7 +98,6 @@ AS_IF([test "x$pythontools" = "xy"], [ [AC_MSG_ERROR([PYTHON specified, but is not an absolute path])]) AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON]) AX_CHECK_PYTHON_VERSION([2], [3]) - AX_CHECK_PYTHON_XML() AX_CHECK_PYTHON_DEVEL() ]) AX_PATH_PROG_OR_FAIL([XGETTEXT], [xgettext]) diff -r 3aafecc004fd -r a41d13f080d9 tools/m4/python_xml.m4 --- a/tools/m4/python_xml.m4 Thu Feb 23 14:29:43 2012 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,10 +0,0 @@ -AC_DEFUN([AX_CHECK_PYTHON_XML], -[AC_MSG_CHECKING([for python xml.dom.minidom]) -`$PYTHON -c ''import xml.dom.minidom''` -if test "$?" != "0" -then - AC_MSG_RESULT([no]) - AC_MSG_ERROR([Unable to find xml.dom.minidom module]) -else - AC_MSG_RESULT([yes]) -fi])
Roger Pau Monne
2012-Feb-22 03:18 UTC
[PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # Date 1330004063 -3600 # Node ID 493ca332d663c3c5ac12fd199d279188642089e6 # Parent a41d13f080d9fad38fd05ed87696502fe18c281c autoconf: run libuuid test under Linux only libuuid is only required to compile Xen tools under Linux. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r a41d13f080d9 -r 493ca332d663 tools/configure --- a/tools/configure Wed Feb 22 04:15:33 2012 +0100 +++ b/tools/configure Thu Feb 23 14:34:23 2012 +0100 @@ -6826,7 +6826,9 @@ if test "x$ac_cv_lib_rt_clock_gettime" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5 +if test "x$host_os" == "xlinux-gnu"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5 $as_echo_n "checking for uuid_clear in -luuid... " >&6; } if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : $as_echo_n "(cached) " >&6 @@ -6873,6 +6875,8 @@ else as_fn_error $? "Could not find libuuid" "$LINENO" 5 fi + +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; } if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then : diff -r a41d13f080d9 -r 493ca332d663 tools/configure.ac --- a/tools/configure.ac Wed Feb 22 04:15:33 2012 +0100 +++ b/tools/configure.ac Thu Feb 23 14:34:23 2012 +0100 @@ -118,8 +118,10 @@ AC_SUBST(libgcrypt) AC_CHECK_LIB([pthread], [pthread_create], [] , [AC_MSG_ERROR([Could not find libpthread])]) AC_CHECK_LIB([rt], [clock_gettime]) -AC_CHECK_LIB([uuid], [uuid_clear], [], - [AC_MSG_ERROR([Could not find libuuid])]) +AS_IF([test "x$host_os" == "xlinux-gnu"], [ + AC_CHECK_LIB([uuid], [uuid_clear], [], + [AC_MSG_ERROR([Could not find libuuid])]) +]) AC_CHECK_LIB([yajl], [yajl_alloc], [], [AC_MSG_ERROR([Could not find yajl])]) AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])])
Roger Pau Monne
2012-Feb-22 03:18 UTC
[PATCH 5 of 8 v2] Linux/init: include init-functions on xencommons and xend
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # Date 1329880534 -3600 # Node ID a74480347d40266afc2f192aeea21819557a483c # Parent 493ca332d663c3c5ac12fd199d279188642089e6 Linux/init: include init-functions on xencommons and xend Try to include /lib/lsb/init-functions on xencommons and xend or fail with and error message. Later patches make use of the functions present on this file. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r 493ca332d663 -r a74480347d40 tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Thu Feb 23 14:34:23 2012 +0100 +++ b/tools/hotplug/Linux/init.d/xencommons Wed Feb 22 04:15:34 2012 +0100 @@ -18,6 +18,15 @@ # Description: Starts and stops the daemons neeeded for xl/xend ### END INIT INFO +# Include init script functions +if test -f /lib/lsb/init-functions +then + . /lib/lsb/init-functions +else + echo "Unable to load /lib/lsb/init-functions" + exit 0 +fi + if [ -d /etc/sysconfig ]; then xencommons_config=/etc/sysconfig else diff -r 493ca332d663 -r a74480347d40 tools/hotplug/Linux/init.d/xend --- a/tools/hotplug/Linux/init.d/xend Thu Feb 23 14:34:23 2012 +0100 +++ b/tools/hotplug/Linux/init.d/xend Wed Feb 22 04:15:34 2012 +0100 @@ -18,6 +18,15 @@ # Description: Starts and stops the Xen control daemon. ### END INIT INFO +# Include init script functions +if test -f /lib/lsb/init-functions +then + . /lib/lsb/init-functions +else + echo "Unable to load /lib/lsb/init-functions" + exit 0 +fi + shopt -s extglob # Wait for Xend to be up
Roger Pau Monne
2012-Feb-22 03:18 UTC
[PATCH 6 of 8 v2] Linux/init: check for brctl and ip at xencommons
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # Date 1329811412 -3600 # Node ID 417702b27ab78ad554062a065fa3f51af091b3b3 # Parent a74480347d40266afc2f192aeea21819557a483c Linux/init: check for brctl and ip at xencommons Check for brctl and ip at xencommons, since hotplug scripts use it. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r a74480347d40 -r 417702b27ab7 tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Wed Feb 22 04:15:34 2012 +0100 +++ b/tools/hotplug/Linux/init.d/xencommons Tue Feb 21 09:03:32 2012 +0100 @@ -27,6 +27,8 @@ else exit 0 fi +servicename="xencommons" + if [ -d /etc/sysconfig ]; then xencommons_config=/etc/sysconfig else @@ -59,6 +61,15 @@ if test -f /proc/xen/capabilities && \ exit 0 fi +# List of tools needed by xen (hotplug scripts) +REQ_TOOLS="brctl ip" + +for tool in $REQ_TOOLS +do + type $tool > /dev/null 2>&1 || \ + log_warning_msg "$servicename: $tool not found" +done + do_start () { local time=0 local timeout=30
Roger Pau Monne
2012-Feb-22 03:19 UTC
[PATCH 7 of 8 v2] Linux/init: check for udev >= 59 at xencommons
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # Date 1329814249 -3600 # Node ID a26c5eadc56fe15af5e40600a3851b4d64be6389 # Parent 417702b27ab78ad554062a065fa3f51af091b3b3 Linux/init: check for udev >= 59 at xencommons Check for udev at xencommons, since hotplug scripts use it. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r 417702b27ab7 -r a26c5eadc56f tools/hotplug/Linux/init.d/xencommons --- a/tools/hotplug/Linux/init.d/xencommons Tue Feb 21 09:03:32 2012 +0100 +++ b/tools/hotplug/Linux/init.d/xencommons Tue Feb 21 09:50:49 2012 +0100 @@ -70,6 +70,28 @@ do log_warning_msg "$servicename: $tool not found" done +# Check for udev >= 59 +if ! type udevadm > /dev/null 2>&1 +then + if ! type udevinfo > /dev/null 2>&1 + then + log_warning_msg "$servicename: unable to find" \ + " udevadm or udevinfo" + else + udevver=`udevinfo -V | awk ''{print $NF}''` + fi +else + udevver=`udevadm info -V | awk ''{print $NF}''` +fi +if test -z "${udevver}" || test "${udevver}" -lt 59 +then + if ! type hotplug > /dev/null 2>&1 + then + log_warning_msg "$servicename: udev is too old," \ + " upgrade to version 59" + fi +fi + do_start () { local time=0 local timeout=30
Roger Pau Monne
2012-Feb-22 03:19 UTC
[PATCH 8 of 8 v2] Linux/init: check for xml.dom.minidom at xend init script
# HG changeset patch # User Roger Pau Monne <roger.pau@entel.upc.edu> # Date 1329880534 -3600 # Node ID e1fdc5509bb4775bb5e35921274103d4ee120d95 # Parent a26c5eadc56fe15af5e40600a3851b4d64be6389 Linux/init: check for xml.dom.minidom at xend init script Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r a26c5eadc56f -r e1fdc5509bb4 tools/hotplug/Linux/init.d/xend --- a/tools/hotplug/Linux/init.d/xend Tue Feb 21 09:50:49 2012 +0100 +++ b/tools/hotplug/Linux/init.d/xend Wed Feb 22 04:15:34 2012 +0100 @@ -27,8 +27,16 @@ else exit 0 fi +servicename="xend" + shopt -s extglob +# Check for python xml +if ! python -c ''import xml.dom.minidom'' > /dev/null 2>&1 +then + log_warning_msg "$servicename: unable to find xml.dom.minidom" +fi + # Wait for Xend to be up function await_daemons_up {
Ian Jackson
2012-Mar-01 16:17 UTC
Re: [PATCH 5 of 8 v2] Linux/init: include init-functions on xencommons and xend
Roger Pau Monne writes ("[Xen-devel] [PATCH 5 of 8 v2] Linux/init: include init-functions on xencommons and xend"):> Linux/init: include init-functions on xencommons and xend > > Try to include /lib/lsb/init-functions on xencommons and xend or fail > with and error message. Later patches make use of the functions > present on this file.Thanks.> +# Include init script functions > +if test -f /lib/lsb/init-functions > +then > + . /lib/lsb/init-functions > +else > + echo "Unable to load /lib/lsb/init-functions" > + exit 0 > +fi > +It''s a shame we''re not using set -e in these scripts, but in any case this should not exit zero if it fails. It should exit nonzero. Thanks, Ian.
Ian Jackson
2012-Mar-01 16:17 UTC
Re: [PATCH 7 of 8 v2] Linux/init: check for udev >= 59 at xencommons
Roger Pau Monne writes ("[Xen-devel] [PATCH 7 of 8 v2] Linux/init: check for udev >= 59 at xencommons"):> Linux/init: check for udev >= 59 at xencommons > > Check for udev at xencommons, since hotplug scripts use it.Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson
2012-Mar-01 16:17 UTC
Re: [PATCH 6 of 8 v2] Linux/init: check for brctl and ip at xencommons
Roger Pau Monne writes ("[Xen-devel] [PATCH 6 of 8 v2] Linux/init: check for brctl and ip at xencommons"):> Linux/init: check for brctl and ip at xencommonsAcked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monne writes ("[Xen-devel] [PATCH 2 of 8 v2] autoconf: remove ip check"):> autoconf: remove ip check > > ip is a run-time dependency, and it is not needed to build Xen tools.Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> (I fixed up a minor conflict.)
Ian Jackson
2012-Mar-01 16:20 UTC
Re: [PATCH 8 of 8 v2] Linux/init: check for xml.dom.minidom at xend init script
Roger Pau Monne writes ("[Xen-devel] [PATCH 8 of 8 v2] Linux/init: check for xml.dom.minidom at xend init script"):> Linux/init: check for xml.dom.minidom at xend init scriptAcked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monne writes ("[Xen-devel] [PATCH 3 of 8 v2] autoconf: remove python xml check"):> autoconf: remove python xml checkThanks for doing this work. Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson
2012-Mar-01 16:24 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
Roger Pau Monne writes ("[Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only"):> autoconf: run libuuid test under Linux only > +AS_IF([test "x$host_os" == "xlinux-gnu"], [ > + AC_CHECK_LIB([uuid], [uuid_clear], [], > + [AC_MSG_ERROR([Could not find libuuid])]) > +])This seems odd to me. Where does this linux-specificity come from ? The point of autoconf is normally to try to avoid this kind of "what OS is this" test, and rather test directly for the required functionality. So why do we not need libuuid other than on Linux ? Ian.
Ian Jackson
2012-Mar-01 16:42 UTC
Re: [PATCH 1 of 8 v2] autoconf: remove (yet another) brctl leftover
Roger Pau Monne writes ("[Xen-devel] [PATCH 1 of 8 v2] autoconf: remove (yet another) brctl leftover"):> autoconf: remove (yet another) brctl leftoverAcked-by: Ian Jackson <ian.jackson@eu.citrix.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monné
2012-Mar-02 09:35 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
2012/3/1 Ian Jackson <Ian.Jackson@eu.citrix.com>:> Roger Pau Monne writes ("[Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only"): >> autoconf: run libuuid test under Linux only >> +AS_IF([test "x$host_os" == "xlinux-gnu"], [ >> + AC_CHECK_LIB([uuid], [uuid_clear], [], >> + [AC_MSG_ERROR([Could not find libuuid])]) >> +]) > > This seems odd to me. Where does this linux-specificity come > from ?-luuid is only used when building under Linux (see tools/libxl/Makefile for example), NetBSD uuid lib is different from linux, and doesn't require the -luuid flag to link, it doesn't even have the same API. Since we already check for different uuid headers in Linux/NetBSD, what about this: 8<-------------------------------------------- autoconf: run libuuid test under Linux only libuuid is only required to compile Xen tools under Linux, move the lib check together with the headers check. Also fixed a couple of hard tabs in tools/m4/uuid.m4. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r a41d13f080d9 tools/configure --- a/tools/configure Wed Feb 22 04:15:33 2012 +0100 +++ b/tools/configure Wed Feb 22 14:54:22 2012 +0100 @@ -6330,6 +6330,53 @@ else fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5 +$as_echo_n "checking for uuid_clear in -luuid... " >&6; } +if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-luuid $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_clear (); +int +main () +{ +return uuid_clear (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_uuid_uuid_clear=yes +else + ac_cv_lib_uuid_uuid_clear=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5 +$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; } +if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUUID 1 +_ACEOF + + LIBS="-luuid $LIBS" + +else + as_fn_error $? "cannot find libuuid" "$LINENO" 5 +fi + else ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default" if test "x$ac_cv_header_uuid_h" = x""yes; then : @@ -6826,53 +6873,6 @@ if test "x$ac_cv_lib_rt_clock_gettime" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5 -$as_echo_n "checking for uuid_clear in -luuid... " >&6; } -if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-luuid $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char uuid_clear (); -int -main () -{ -return uuid_clear (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_uuid_uuid_clear=yes -else - ac_cv_lib_uuid_uuid_clear=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; } -if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUUID 1 -_ACEOF - - LIBS="-luuid $LIBS" - -else - as_fn_error $? "Could not find libuuid" "$LINENO" 5 -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; } if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then : diff -r a41d13f080d9 tools/configure.ac --- a/tools/configure.ac Wed Feb 22 04:15:33 2012 +0100 +++ b/tools/configure.ac Wed Feb 22 14:54:22 2012 +0100 @@ -118,8 +118,6 @@ AC_SUBST(libgcrypt) AC_CHECK_LIB([pthread], [pthread_create], [] , [AC_MSG_ERROR([Could not find libpthread])]) AC_CHECK_LIB([rt], [clock_gettime]) -AC_CHECK_LIB([uuid], [uuid_clear], [], - [AC_MSG_ERROR([Could not find libuuid])]) AC_CHECK_LIB([yajl], [yajl_alloc], [], [AC_MSG_ERROR([Could not find yajl])]) AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])]) diff -r a41d13f080d9 tools/m4/uuid.m4 --- a/tools/m4/uuid.m4 Wed Feb 22 04:15:33 2012 +0100 +++ b/tools/m4/uuid.m4 Wed Feb 22 14:54:22 2012 +0100 @@ -2,9 +2,11 @@ AC_DEFUN([AX_CHECK_UUID], [if test "x$host_os" == "xlinux-gnu" then AC_CHECK_HEADER([uuid/uuid.h],, - [AC_MSG_ERROR([cannot find uuid headers])]) + [AC_MSG_ERROR([cannot find uuid headers])]) + AC_CHECK_LIB([uuid], [uuid_clear], [], + [AC_MSG_ERROR([cannot find libuuid])]) else AC_CHECK_HEADER([uuid.h],, - [AC_MSG_ERROR([cannot find uuid headers])]) + [AC_MSG_ERROR([cannot find uuid headers])]) fi ]) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Ian Campbell
2012-Mar-02 09:48 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
On Fri, 2012-03-02 at 09:35 +0000, Roger Pau Monné wrote:> 2012/3/1 Ian Jackson <Ian.Jackson@eu.citrix.com>: > > Roger Pau Monne writes ("[Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only"): > >> autoconf: run libuuid test under Linux only > >> +AS_IF([test "x$host_os" == "xlinux-gnu"], [ > >> + AC_CHECK_LIB([uuid], [uuid_clear], [], > >> + [AC_MSG_ERROR([Could not find libuuid])]) > >> +]) > > > > This seems odd to me. Where does this linux-specificity come > > from ? > > -luuid is only used when building under Linux (see > tools/libxl/Makefile for example), NetBSD uuid lib is different from > linux, and doesn't require the -luuid flag to link, it doesn't even > have the same API. Since we already check for different uuid headers > in Linux/NetBSD, what about this:Shouldn't this test also be checking for "Linux-like" or "BSD-like" UUID interfaces, rather than checking specifically for those OSes directly. We don't really care what the OS is, just which of the uuid interfaces it happens to provide. Such a change may well propagate to more than the configure script though and your patch seems like a valid fix to the status quo so: Acked-by: Ian Campbell <ian.campbell@citrix.com> (note that IanJ is away until 12 March)> > 8<-------------------------------------------- > > autoconf: run libuuid test under Linux only > > libuuid is only required to compile Xen tools under Linux, move the > lib check together with the headers check. Also fixed a couple of hard > tabs in tools/m4/uuid.m4. > > Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> > > diff -r a41d13f080d9 tools/configure > --- a/tools/configure Wed Feb 22 04:15:33 2012 +0100 > +++ b/tools/configure Wed Feb 22 14:54:22 2012 +0100 > @@ -6330,6 +6330,53 @@ else > fi > > > + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear > in -luuid" >&5 > +$as_echo_n "checking for uuid_clear in -luuid... " >&6; } > +if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : > + $as_echo_n "(cached) " >&6 > +else > + ac_check_lib_save_LIBS=$LIBS > +LIBS="-luuid $LIBS" > +cat confdefs.h - <<_ACEOF >conftest.$ac_ext > +/* end confdefs.h. */ > + > +/* Override any GCC internal prototype to avoid an error. > + Use char because int might match the return type of a GCC > + builtin and then its argument prototype would still apply. */ > +#ifdef __cplusplus > +extern "C" > +#endif > +char uuid_clear (); > +int > +main () > +{ > +return uuid_clear (); > + ; > + return 0; > +} > +_ACEOF > +if ac_fn_c_try_link "$LINENO"; then : > + ac_cv_lib_uuid_uuid_clear=yes > +else > + ac_cv_lib_uuid_uuid_clear=no > +fi > +rm -f core conftest.err conftest.$ac_objext \ > + conftest$ac_exeext conftest.$ac_ext > +LIBS=$ac_check_lib_save_LIBS > +fi > +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: > $ac_cv_lib_uuid_uuid_clear" >&5 > +$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; } > +if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then : > + cat >>confdefs.h <<_ACEOF > +#define HAVE_LIBUUID 1 > +_ACEOF > + > + LIBS="-luuid $LIBS" > + > +else > + as_fn_error $? "cannot find libuuid" "$LINENO" 5 > +fi > + > else > ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" > "ac_cv_header_uuid_h" "$ac_includes_default" > if test "x$ac_cv_header_uuid_h" = x""yes; then : > @@ -6826,53 +6873,6 @@ if test "x$ac_cv_lib_rt_clock_gettime" > > fi > > -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5 > -$as_echo_n "checking for uuid_clear in -luuid... " >&6; } > -if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : > - $as_echo_n "(cached) " >&6 > -else > - ac_check_lib_save_LIBS=$LIBS > -LIBS="-luuid $LIBS" > -cat confdefs.h - <<_ACEOF >conftest.$ac_ext > -/* end confdefs.h. */ > - > -/* Override any GCC internal prototype to avoid an error. > - Use char because int might match the return type of a GCC > - builtin and then its argument prototype would still apply. */ > -#ifdef __cplusplus > -extern "C" > -#endif > -char uuid_clear (); > -int > -main () > -{ > -return uuid_clear (); > - ; > - return 0; > -} > -_ACEOF > -if ac_fn_c_try_link "$LINENO"; then : > - ac_cv_lib_uuid_uuid_clear=yes > -else > - ac_cv_lib_uuid_uuid_clear=no > -fi > -rm -f core conftest.err conftest.$ac_objext \ > - conftest$ac_exeext conftest.$ac_ext > -LIBS=$ac_check_lib_save_LIBS > -fi > -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: > $ac_cv_lib_uuid_uuid_clear" >&5 > -$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; } > -if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then : > - cat >>confdefs.h <<_ACEOF > -#define HAVE_LIBUUID 1 > -_ACEOF > - > - LIBS="-luuid $LIBS" > - > -else > - as_fn_error $? "Could not find libuuid" "$LINENO" 5 > -fi > - > { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5 > $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; } > if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then : > diff -r a41d13f080d9 tools/configure.ac > --- a/tools/configure.ac Wed Feb 22 04:15:33 2012 +0100 > +++ b/tools/configure.ac Wed Feb 22 14:54:22 2012 +0100 > @@ -118,8 +118,6 @@ AC_SUBST(libgcrypt) > AC_CHECK_LIB([pthread], [pthread_create], [] , > [AC_MSG_ERROR([Could not find libpthread])]) > AC_CHECK_LIB([rt], [clock_gettime]) > -AC_CHECK_LIB([uuid], [uuid_clear], [], > - [AC_MSG_ERROR([Could not find libuuid])]) > AC_CHECK_LIB([yajl], [yajl_alloc], [], > [AC_MSG_ERROR([Could not find yajl])]) > AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])]) > diff -r a41d13f080d9 tools/m4/uuid.m4 > --- a/tools/m4/uuid.m4 Wed Feb 22 04:15:33 2012 +0100 > +++ b/tools/m4/uuid.m4 Wed Feb 22 14:54:22 2012 +0100 > @@ -2,9 +2,11 @@ AC_DEFUN([AX_CHECK_UUID], > [if test "x$host_os" == "xlinux-gnu" > then > AC_CHECK_HEADER([uuid/uuid.h],, > - [AC_MSG_ERROR([cannot find uuid headers])]) > + [AC_MSG_ERROR([cannot find uuid headers])]) > + AC_CHECK_LIB([uuid], [uuid_clear], [], > + [AC_MSG_ERROR([cannot find libuuid])]) > else > AC_CHECK_HEADER([uuid.h],, > - [AC_MSG_ERROR([cannot find uuid headers])]) > + [AC_MSG_ERROR([cannot find uuid headers])]) > fi > ]) > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Roger Pau Monné
2012-Mar-02 09:58 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
2012/3/2 Ian Campbell <Ian.Campbell@citrix.com>:> On Fri, 2012-03-02 at 09:35 +0000, Roger Pau Monné wrote: >> 2012/3/1 Ian Jackson <Ian.Jackson@eu.citrix.com>: >> > Roger Pau Monne writes ("[Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only"): >> >> autoconf: run libuuid test under Linux only >> >> +AS_IF([test "x$host_os" == "xlinux-gnu"], [ >> >> + AC_CHECK_LIB([uuid], [uuid_clear], [], >> >> + [AC_MSG_ERROR([Could not find libuuid])]) >> >> +]) >> > >> > This seems odd to me. Where does this linux-specificity come >> > from ? >> >> -luuid is only used when building under Linux (see >> tools/libxl/Makefile for example), NetBSD uuid lib is different from >> linux, and doesn't require the -luuid flag to link, it doesn't even >> have the same API. Since we already check for different uuid headers >> in Linux/NetBSD, what about this: > > Shouldn't this test also be checking for "Linux-like" or "BSD-like" UUID > interfaces, rather than checking specifically for those OSes directly. > We don't really care what the OS is, just which of the uuid interfaces > it happens to provide. > > Such a change may well propagate to more than the configure script > though and your patch seems like a valid fix to the status quo so:Yes, I've been thinking about this after sending the patch and I'm going to change that, we don't care about the OS, we just need to make sure we can use uuid. There's no need to limit the tests depending on the OS, we can run all tests on all OSes.> Acked-by: Ian Campbell <ian.campbell@citrix.com> > > (note that IanJ is away until 12 March) > >> >> 8<-------------------------------------------- >> >> autoconf: run libuuid test under Linux only >> >> libuuid is only required to compile Xen tools under Linux, move the >> lib check together with the headers check. Also fixed a couple of hard >> tabs in tools/m4/uuid.m4. >> >> Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> >> >> diff -r a41d13f080d9 tools/configure >> --- a/tools/configure Wed Feb 22 04:15:33 2012 +0100 >> +++ b/tools/configure Wed Feb 22 14:54:22 2012 +0100 >> @@ -6330,6 +6330,53 @@ else >> fi >> >> >> + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear >> in -luuid" >&5 >> +$as_echo_n "checking for uuid_clear in -luuid... " >&6; } >> +if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : >> + $as_echo_n "(cached) " >&6 >> +else >> + ac_check_lib_save_LIBS=$LIBS >> +LIBS="-luuid $LIBS" >> +cat confdefs.h - <<_ACEOF >conftest.$ac_ext >> +/* end confdefs.h. */ >> + >> +/* Override any GCC internal prototype to avoid an error. >> + Use char because int might match the return type of a GCC >> + builtin and then its argument prototype would still apply. */ >> +#ifdef __cplusplus >> +extern "C" >> +#endif >> +char uuid_clear (); >> +int >> +main () >> +{ >> +return uuid_clear (); >> + ; >> + return 0; >> +} >> +_ACEOF >> +if ac_fn_c_try_link "$LINENO"; then : >> + ac_cv_lib_uuid_uuid_clear=yes >> +else >> + ac_cv_lib_uuid_uuid_clear=no >> +fi >> +rm -f core conftest.err conftest.$ac_objext \ >> + conftest$ac_exeext conftest.$ac_ext >> +LIBS=$ac_check_lib_save_LIBS >> +fi >> +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: >> $ac_cv_lib_uuid_uuid_clear" >&5 >> +$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; } >> +if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then : >> + cat >>confdefs.h <<_ACEOF >> +#define HAVE_LIBUUID 1 >> +_ACEOF >> + >> + LIBS="-luuid $LIBS" >> + >> +else >> + as_fn_error $? "cannot find libuuid" "$LINENO" 5 >> +fi >> + >> else >> ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" >> "ac_cv_header_uuid_h" "$ac_includes_default" >> if test "x$ac_cv_header_uuid_h" = x""yes; then : >> @@ -6826,53 +6873,6 @@ if test "x$ac_cv_lib_rt_clock_gettime" >> >> fi >> >> -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5 >> -$as_echo_n "checking for uuid_clear in -luuid... " >&6; } >> -if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : >> - $as_echo_n "(cached) " >&6 >> -else >> - ac_check_lib_save_LIBS=$LIBS >> -LIBS="-luuid $LIBS" >> -cat confdefs.h - <<_ACEOF >conftest.$ac_ext >> -/* end confdefs.h. */ >> - >> -/* Override any GCC internal prototype to avoid an error. >> - Use char because int might match the return type of a GCC >> - builtin and then its argument prototype would still apply. */ >> -#ifdef __cplusplus >> -extern "C" >> -#endif >> -char uuid_clear (); >> -int >> -main () >> -{ >> -return uuid_clear (); >> - ; >> - return 0; >> -} >> -_ACEOF >> -if ac_fn_c_try_link "$LINENO"; then : >> - ac_cv_lib_uuid_uuid_clear=yes >> -else >> - ac_cv_lib_uuid_uuid_clear=no >> -fi >> -rm -f core conftest.err conftest.$ac_objext \ >> - conftest$ac_exeext conftest.$ac_ext >> -LIBS=$ac_check_lib_save_LIBS >> -fi >> -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: >> $ac_cv_lib_uuid_uuid_clear" >&5 >> -$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; } >> -if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then : >> - cat >>confdefs.h <<_ACEOF >> -#define HAVE_LIBUUID 1 >> -_ACEOF >> - >> - LIBS="-luuid $LIBS" >> - >> -else >> - as_fn_error $? "Could not find libuuid" "$LINENO" 5 >> -fi >> - >> { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5 >> $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; } >> if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then : >> diff -r a41d13f080d9 tools/configure.ac >> --- a/tools/configure.ac Wed Feb 22 04:15:33 2012 +0100 >> +++ b/tools/configure.ac Wed Feb 22 14:54:22 2012 +0100 >> @@ -118,8 +118,6 @@ AC_SUBST(libgcrypt) >> AC_CHECK_LIB([pthread], [pthread_create], [] , >> [AC_MSG_ERROR([Could not find libpthread])]) >> AC_CHECK_LIB([rt], [clock_gettime]) >> -AC_CHECK_LIB([uuid], [uuid_clear], [], >> - [AC_MSG_ERROR([Could not find libuuid])]) >> AC_CHECK_LIB([yajl], [yajl_alloc], [], >> [AC_MSG_ERROR([Could not find yajl])]) >> AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])]) >> diff -r a41d13f080d9 tools/m4/uuid.m4 >> --- a/tools/m4/uuid.m4 Wed Feb 22 04:15:33 2012 +0100 >> +++ b/tools/m4/uuid.m4 Wed Feb 22 14:54:22 2012 +0100 >> @@ -2,9 +2,11 @@ AC_DEFUN([AX_CHECK_UUID], >> [if test "x$host_os" == "xlinux-gnu" >> then >> AC_CHECK_HEADER([uuid/uuid.h],, >> - [AC_MSG_ERROR([cannot find uuid headers])]) >> + [AC_MSG_ERROR([cannot find uuid headers])]) >> + AC_CHECK_LIB([uuid], [uuid_clear], [], >> + [AC_MSG_ERROR([cannot find libuuid])]) >> else >> AC_CHECK_HEADER([uuid.h],, >> - [AC_MSG_ERROR([cannot find uuid headers])]) >> + [AC_MSG_ERROR([cannot find uuid headers])]) >> fi >> ]) >> >> _______________________________________________ >> Xen-devel mailing list >> Xen-devel@lists.xen.org >> http://lists.xen.org/xen-devel > >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
Roger Pau Monné
2012-Mar-02 12:14 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
I think this is a better approach. Now that we have autoconf, we could also get rid of a lot of Makefile and header OS contionals. 8<-------------------------------------------- autoconf: check for uuid.h or uuid/uuid.h with -luuid Check for uuid/uuid.h and if found check for -luuid usability (Linux case), if not, check for uuid.h (NetBSD). One of this tests has to succeed to be able to build Xen tools. Signed-off-by: Roger Pau Monne <roger.pau@entel.upc.edu> diff -r a41d13f080d9 tools/configure --- a/tools/configure Wed Feb 22 04:15:33 2012 +0100 +++ b/tools/configure Wed Feb 22 17:33:26 2012 +0100 @@ -6320,24 +6320,63 @@ if test x"${XGETTEXT}" == x"no" then as_fn_error $? "Unable to find xgettext, please install xgettext" "$LINENO" 5 fi -if test "x$host_os" == "xlinux-gnu" -then - ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" + +ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default" if test "x$ac_cv_header_uuid_uuid_h" = x""yes; then : -else - as_fn_error $? "cannot find uuid headers" "$LINENO" 5 -fi - - -else - ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5 +$as_echo_n "checking for uuid_clear in -luuid... " >&6; } +if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-luuid $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char uuid_clear (); +int +main () +{ +return uuid_clear (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_uuid_uuid_clear=yes +else + ac_cv_lib_uuid_uuid_clear=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5 +$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; } +if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then : + libuuid="y" +fi + + +fi + + +ac_fn_c_check_header_mongrel "$LINENO" "uuid.h" "ac_cv_header_uuid_h" "$ac_includes_default" if test "x$ac_cv_header_uuid_h" = x""yes; then : - -else - as_fn_error $? "cannot find uuid headers" "$LINENO" 5 -fi - + libuuid="y" +fi + + +if test "$libuuid" != "y"; then : + + as_fn_error $? "cannot find a valid uuid library" "$LINENO" 5 fi @@ -6826,53 +6865,6 @@ if test "x$ac_cv_lib_rt_clock_gettime" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_clear in -luuid" >&5 -$as_echo_n "checking for uuid_clear in -luuid... " >&6; } -if test "${ac_cv_lib_uuid_uuid_clear+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-luuid $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char uuid_clear (); -int -main () -{ -return uuid_clear (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_uuid_uuid_clear=yes -else - ac_cv_lib_uuid_uuid_clear=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_clear" >&5 -$as_echo "$ac_cv_lib_uuid_uuid_clear" >&6; } -if test "x$ac_cv_lib_uuid_uuid_clear" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUUID 1 -_ACEOF - - LIBS="-luuid $LIBS" - -else - as_fn_error $? "Could not find libuuid" "$LINENO" 5 -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for yajl_alloc in -lyajl" >&5 $as_echo_n "checking for yajl_alloc in -lyajl... " >&6; } if test "${ac_cv_lib_yajl_yajl_alloc+set}" = set; then : diff -r a41d13f080d9 tools/configure.ac --- a/tools/configure.ac Wed Feb 22 04:15:33 2012 +0100 +++ b/tools/configure.ac Wed Feb 22 17:33:26 2012 +0100 @@ -118,8 +118,6 @@ AC_SUBST(libgcrypt) AC_CHECK_LIB([pthread], [pthread_create], [] , [AC_MSG_ERROR([Could not find libpthread])]) AC_CHECK_LIB([rt], [clock_gettime]) -AC_CHECK_LIB([uuid], [uuid_clear], [], - [AC_MSG_ERROR([Could not find libuuid])]) AC_CHECK_LIB([yajl], [yajl_alloc], [], [AC_MSG_ERROR([Could not find yajl])]) AC_CHECK_LIB([z], [deflateCopy], [], [AC_MSG_ERROR([Could not find zlib])]) diff -r a41d13f080d9 tools/m4/uuid.m4 --- a/tools/m4/uuid.m4 Wed Feb 22 04:15:33 2012 +0100 +++ b/tools/m4/uuid.m4 Wed Feb 22 17:33:26 2012 +0100 @@ -1,10 +1,9 @@ -AC_DEFUN([AX_CHECK_UUID], -[if test "x$host_os" == "xlinux-gnu" -then - AC_CHECK_HEADER([uuid/uuid.h],, - [AC_MSG_ERROR([cannot find uuid headers])]) -else - AC_CHECK_HEADER([uuid.h],, - [AC_MSG_ERROR([cannot find uuid headers])]) -fi +AC_DEFUN([AX_CHECK_UUID], [ +AC_CHECK_HEADER([uuid/uuid.h],[ + AC_CHECK_LIB([uuid], [uuid_clear], [libuuid="y"]) ]) +AC_CHECK_HEADER([uuid.h],[libuuid="y"]) +AS_IF([test "$libuuid" != "y"], [ + AC_MSG_ERROR([cannot find a valid uuid library]) +]) +])
Ian Jackson
2012-Mar-12 10:48 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only"):> -luuid is only used when building under Linux (see > tools/libxl/Makefile for example), NetBSD uuid lib is different from > linux, and doesn''t require the -luuid flag to link, it doesn''t even > have the same API. Since we already check for different uuid headers > in Linux/NetBSD, what about this:I think we should change the existing code:> [if test "x$host_os" == "xlinux-gnu" > then > AC_CHECK_HEADER([uuid/uuid.h],, > - [AC_MSG_ERROR([cannot find uuid headers])]) > + [AC_MSG_ERROR([cannot find uuid headers])]) > + AC_CHECK_LIB([uuid], [uuid_clear], [], > + [AC_MSG_ERROR([cannot find libuuid])])I realise that this is how it was done pre-autoconf, but really I think that all tests on $host_os are wrong in principle. Ian.
Ian Jackson
2012-Mar-12 10:51 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only"):> I think this is a better approach. Now that we have autoconf, we could > also get rid of a lot of Makefile and header OS contionals.Yes. This looks like the right approach to me. Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> (I''ve just got back and won''t be applying anything until I have caught up on my email...) Ian.
Ian Jackson
2012-Mar-14 12:12 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
Roger Pau Monné writes ("Re: [Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only"):> autoconf: check for uuid.h or uuid/uuid.h with -luuid > > Check for uuid/uuid.h and if found check for -luuid usability (Linux > case), if not, check for uuid.h (NetBSD). One of this tests has to > succeed to be able to build Xen tools....> as_fn_error $? "Unable to find xgettext, please install xgettext" > "$LINENO" 5This has been linewrapped. Ian.
Roger Pau Monné
2012-Mar-14 13:47 UTC
Re: [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only
2012/3/14 Ian Jackson <Ian.Jackson@eu.citrix.com>:> Roger Pau Monné writes ("Re: [Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only"): >> autoconf: check for uuid.h or uuid/uuid.h with -luuid >> >> Check for uuid/uuid.h and if found check for -luuid usability (Linux >> case), if not, check for uuid.h (NetBSD). One of this tests has to >> succeed to be able to build Xen tools. > ... >> as_fn_error $? "Unable to find xgettext, please install xgettext" >> "$LINENO" 5 > > This has been linewrapped.Ups sorry, I'm going to resend it.> Ian._______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel
2012/3/1 Ian Jackson <Ian.Jackson@eu.citrix.com>:> Roger Pau Monne writes ("[Xen-devel] [PATCH 2 of 8 v2] autoconf: remove ip check"): >> autoconf: remove ip check >> >> ip is a run-time dependency, and it is not needed to build Xen tools. > > Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> > Committed-by: Ian Jackson <ian.jackson@eu.citrix.com> > > (I fixed up a minor conflict.)I looks like a part of this patch is missing in the xen repository, the config/Tools.mk.in modification was not applied. Olaf Hering submitted a patch to fix it, which I''m going to ack.