[Asterisk-code-review] BuildSystem: Re-check for another UUID library only when pre... (asterisk[15])

Joshua Colp asteriskteam at digium.com
Tue Mar 13 18:23:32 CDT 2018


Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/8476 )

Change subject: BuildSystem: Re-check for another UUID library only when previous check failed.
......................................................................

BuildSystem: Re-check for another UUID library only when previous check failed.

As a side-effect, this avoids the ambiguous output:
 checking for uuid_generate_random... no
which was printed always previously.

ASTERISK-25586
Reported by: John Nemeth

Change-Id: I6d541dfcf453932a9856c5e251aa22e0e6c233c9
---
M configure
M configure.ac
2 files changed, 29 insertions(+), 23 deletions(-)

Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  George Joseph: Looks good to me, approved



diff --git a/configure b/configure
index 2456b0c..4ca42d4 100755
--- a/configure
+++ b/configure
@@ -13846,6 +13846,10 @@
 fi
 
 
+if test "x$LIBUUID_LIB" != "x" ; then
+  UUID_INCLUDE="$LIBUUID_INCLUDE"
+  UUID_LIB="$LIBUUID_LIB"
+else
 
 if test "x${PBX_E2FSUUID}" != "x1" -a "${USE_E2FSUUID}" != "no"; then
    pbxlibdir=""
@@ -13942,7 +13946,11 @@
 fi
 
 
-for ac_func in uuid_generate_random
+  if test "x$E2FSUUID_LIB" != "x" ; then
+    UUID_INCLUDE="$E2FSUUID_INCLUDE"
+    UUID_LIB="$E2FSUUID_LIB"
+  else
+    for ac_func in uuid_generate_random
 do :
   ac_fn_c_check_func "$LINENO" "uuid_generate_random" "ac_cv_func_uuid_generate_random"
 if test "x$ac_cv_func_uuid_generate_random" = xyes; then :
@@ -13955,18 +13963,13 @@
 fi
 done
 
-
-if test "x$LIBUUID_LIB" != "x" ; then
-  UUID_INCLUDE="$LIBUUID_INCLUDE"
-  UUID_LIB="$LIBUUID_LIB"
-elif test "x$E2FSUUID_LIB" != "x" ; then
-  UUID_INCLUDE="$E2FSUUID_INCLUDE"
-  UUID_LIB="$E2FSUUID_LIB"
-elif test "x$SYSUUID" != "x" ; then
-  UUID_INCLUDE=""
-  UUID_LIB=""
-else
-  as_fn_error $? "*** uuid support not found (this typically means the uuid development package is missing)" "$LINENO" 5
+    if test "x$SYSUUID" != "x" ; then
+      UUID_INCLUDE=""
+      UUID_LIB=""
+    else
+      as_fn_error $? "*** uuid support not found (this typically means the uuid development package is missing)" "$LINENO" 5
+    fi
+  fi
 fi
 
 
diff --git a/configure.ac b/configure.ac
index 571987c..7e80b1a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -637,20 +637,23 @@
 #  * -le2fs-uuid on OpenBSD
 #  * in libsystem on OS X
 AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h], [])
-AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h], [])
-AC_CHECK_FUNCS([uuid_generate_random], [SYSUUID=true], [SYSUUID=""])
-
 if test "x$LIBUUID_LIB" != "x" ; then
   UUID_INCLUDE="$LIBUUID_INCLUDE"
   UUID_LIB="$LIBUUID_LIB"
-elif test "x$E2FSUUID_LIB" != "x" ; then
-  UUID_INCLUDE="$E2FSUUID_INCLUDE"
-  UUID_LIB="$E2FSUUID_LIB"
-elif test "x$SYSUUID" != "x" ; then
-  UUID_INCLUDE=""
-  UUID_LIB=""
 else
-  AC_MSG_ERROR([*** uuid support not found (this typically means the uuid development package is missing)])
+  AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h], [])
+  if test "x$E2FSUUID_LIB" != "x" ; then
+    UUID_INCLUDE="$E2FSUUID_INCLUDE"
+    UUID_LIB="$E2FSUUID_LIB"
+  else
+    AC_CHECK_FUNCS([uuid_generate_random], [SYSUUID=true], [SYSUUID=""])
+    if test "x$SYSUUID" != "x" ; then
+      UUID_INCLUDE=""
+      UUID_LIB=""
+    else
+      AC_MSG_ERROR([*** uuid support not found (this typically means the uuid development package is missing)])
+    fi
+  fi
 fi
 AC_SUBST(UUID_INCLUDE)
 AC_SUBST(UUID_LIB)

-- 
To view, visit https://gerrit.asterisk.org/8476
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 15
Gerrit-MessageType: merged
Gerrit-Change-Id: I6d541dfcf453932a9856c5e251aa22e0e6c233c9
Gerrit-Change-Number: 8476
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180313/149ecc8b/attachment-0001.html>


More information about the asterisk-code-review mailing list