diff options
author | David M. Lee <dlee@digium.com> | 2013-06-03 15:57:42 +0000 |
---|---|---|
committer | David M. Lee <dlee@digium.com> | 2013-06-03 15:57:42 +0000 |
commit | 6d805dc04ba180f531cabe780b1187352609395f (patch) | |
tree | 147928c28af1261eb5ee98e19dacee5d7ead15ce /configure.ac | |
parent | 1458a20e47fc1cab9a22a961bff0745f7368b447 (diff) |
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)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@390352 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 339f7946d..7a9881074 100644 --- a/configure.ac +++ b/configure.ac @@ -497,8 +497,6 @@ AST_EXT_LIB_CHECK([TERMCAP], [termcap], [tgetent], []) 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 @@ else 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)]) |