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

[Xen-changelog] [xen-unstable] autoconf: check for uuid.h or uuid/uuid.h with -luuid



# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
# Date 1331734782 0
# Node ID 165082fcba8d2dc35b726e316497fde64c430a25
# Parent  f5fbbb2918c6739b2eeb82297417ee4829b8eed8
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 (NetBSD). One of this tests has to
succeed to be able to build Xen tools.

Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
Acked-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Committed-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---


diff -r f5fbbb2918c6 -r 165082fcba8d tools/configure
--- a/tools/configure   Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/configure   Wed Mar 14 14:19:42 2012 +0000
@@ -6270,24 +6270,63 @@
 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
 
@@ -6915,53 +6954,6 @@
 
 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 f5fbbb2918c6 -r 165082fcba8d tools/configure.ac
--- a/tools/configure.ac        Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/configure.ac        Wed Mar 14 14:19:42 2012 +0000
@@ -116,8 +116,6 @@
 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 f5fbbb2918c6 -r 165082fcba8d tools/m4/uuid.m4
--- a/tools/m4/uuid.m4  Wed Mar 14 14:10:17 2012 +0000
+++ b/tools/m4/uuid.m4  Wed Mar 14 14:19:42 2012 +0000
@@ -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])
+])
+])

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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