[svn-commits] dlee: trunk r390352 - in /trunk: ./ include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Jun 3 10:57:44 CDT 2013


Author: dlee
Date: Mon Jun  3 10:57:42 2013
New Revision: 390352

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390352
Log:
Correct autoconf script for finding UUID support.

The library that provides UUID support varies greatly from system to
system. On most Linux distros, it's in libuuid. On OpenBSD, it's in
libe2fs-uuid. On OS X, it is in libsystem.

This patch plays hide-and-seek with UUID support, looking for it in the
three places we know about. It also corrects the Makefile so that it uses
the configured library name and include path.

(closes issue ASTERISK-21816)
Reported by: Brad Latus (snuffy)
Tested by: Brad Latus (snuffy)

Modified:
    trunk/configure
    trunk/configure.ac
    trunk/include/asterisk/autoconfig.h.in
    trunk/main/Makefile
    trunk/makeopts.in

Modified: trunk/configure.ac
URL: http://svnview.digium.com/svn/asterisk/trunk/configure.ac?view=diff&rev=390352&r1=390351&r2=390352
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Mon Jun  3 10:57:42 2013
@@ -497,8 +497,6 @@
 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
-AST_EXT_LIB_CHECK([UUID], [uuid], [uuid_generate_random], [uuid/uuid.h], [-luuid])
-AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_dumps], [jansson.h])
 
 EDITLINE_LIB=""
 if test "x$TERMCAP_LIB" != "x" ; then
@@ -514,9 +512,31 @@
 fi
 AC_SUBST(EDITLINE_LIB)
 
-if test "x$UUID_LIB" == "x"; then
+# Find required UUID support.
+#  * -luuid on Linux
+#  * -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)])
 fi
+AC_SUBST(UUID_INCLUDE)
+AC_SUBST(UUID_LIB)
+
+# Find required JSON support.
+AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_dumps], [jansson.h])
 
 if test "x$JANSSON_LIB" == "x"; then
   AC_MSG_ERROR([*** JSON support not found (this typically means the libjansson development package is missing)])

Modified: trunk/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/trunk/include/asterisk/autoconfig.h.in?view=diff&rev=390352&r1=390351&r2=390352
==============================================================================
--- trunk/include/asterisk/autoconfig.h.in (original)
+++ trunk/include/asterisk/autoconfig.h.in Mon Jun  3 10:57:42 2013
@@ -1021,6 +1021,9 @@
 
 /* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
 #undef HAVE_UTIME_NULL
+
+/* Define to 1 if you have the `uuid_generate_random' function. */
+#undef HAVE_UUID_GENERATE_RANDOM
 
 /* Define to 1 if your system can support larger than default select bitmasks.
    */

Modified: trunk/main/Makefile
URL: http://svnview.digium.com/svn/asterisk/trunk/main/Makefile?view=diff&rev=390352&r1=390351&r2=390352
==============================================================================
--- trunk/main/Makefile (original)
+++ trunk/main/Makefile Mon Jun  3 10:57:42 2013
@@ -36,6 +36,7 @@
 AST_LIBS+=$(SQLITE3_LIB)
 AST_LIBS+=$(ASTSSL_LIBS)
 AST_LIBS+=$(JANSSON_LIB)
+AST_LIBS+=$(UUID_LIB)
 
 ifneq ($(findstring $(OSARCH), linux-gnu uclinux linux-uclibc kfreebsd-gnu),)
   ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
@@ -44,7 +45,7 @@
   ifneq (x$(CAP_LIB),x)
     AST_LIBS+=$(CAP_LIB)
   endif
-  AST_LIBS+=-lpthread $(EDITLINE_LIB) -lm -lresolv -luuid
+  AST_LIBS+=-lpthread $(EDITLINE_LIB) -lm -lresolv
 else
   AST_LIBS+=$(EDITLINE_LIB) -lm
 endif
@@ -152,6 +153,7 @@
 asterisk.o: _ASTCFLAGS+=$(LIBEDIT_INCLUDE)
 cli.o: _ASTCFLAGS+=$(LIBEDIT_INCLUDE)
 json.o: _ASTCFLAGS+=$(JANSSON_INCLUDE)
+uuid.o: _ASTCFLAGS+=$(UUID_INCLUDE)
 
 ifneq ($(findstring ENABLE_UPLOADS,$(MENUSELECT_CFLAGS)),)
 http.o: _ASTCFLAGS+=$(GMIME_INCLUDE)

Modified: trunk/makeopts.in
URL: http://svnview.digium.com/svn/asterisk/trunk/makeopts.in?view=diff&rev=390352&r1=390351&r2=390352
==============================================================================
--- trunk/makeopts.in (original)
+++ trunk/makeopts.in Mon Jun  3 10:57:42 2013
@@ -290,6 +290,9 @@
 UNIXODBC_INCLUDE=@UNIXODBC_INCLUDE@
 UNIXODBC_LIB=@UNIXODBC_LIB@
 
+UUID_INCLUDE=@UUID_INCLUDE@
+UUID_LIB=@UUID_LIB@
+
 VORBIS_INCLUDE=@VORBIS_INCLUDE@
 VORBIS_LIB=@VORBIS_LIB@
 




More information about the svn-commits mailing list