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

Re: [Xen-devel] [PATCH 4 of 8 v2] autoconf: run libuuid test under Linux only



2012/3/2 Ian Campbell <Ian.Campbell@xxxxxxxxxx>:
> On Fri, 2012-03-02 at 09:35 +0000, Roger Pau Monnà wrote:
>> 2012/3/1 Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>:
>> > 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@xxxxxxxxxx>
>
> (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@xxxxxxxxxxxxx>
>>
>> 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@xxxxxxxxxxxxx
>> http://lists.xen.org/xen-devel
>
>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.