diff options
author | AaronMatthewBrown <devnull@localhost> | 2009-12-10 14:20:48 +0000 |
---|---|---|
committer | AaronMatthewBrown <devnull@localhost> | 2009-12-10 14:20:48 +0000 |
commit | a067fb27c2843d27f767b691763a5ee5dc200d4d (patch) | |
tree | 0f452a9824d98a289780ac1f7e638e396ff0e5e6 /configure.ac | |
parent | 79e6f229122e78add835073a12cd6f990b664cba (diff) | |
download | iperf3-a067fb27c2843d27f767b691763a5ee5dc200d4d.tar.gz |
Modify auto* scripts to handle the different uuid libraries/headers.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac index ba1e9ce..625ee73 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,7 @@ AC_PROG_RANLIB AC_PROG_LN_S AC_PROG_LIBTOOL + # Sets a conditional makefile variable so that certain Makefile tasks will be # performed only on linux (currently, add -luuid to LD_FLAGS) AM_CONDITIONAL(LINUX, [case $host_os in linux*) true;; *) false;; esac]) @@ -28,8 +29,34 @@ AM_CONDITIONAL(LINUX, [case $host_os in linux*) true;; *) false;; esac]) AC_HEADER_STDC # Check for uuid.h and a valid libuuid -AC_CHECK_HEADER(uuid/uuid.h, ,AC_MSG_ERROR([uuid/uuid.h is not available])) -AC_CHECK_LIB(uuid, uuid_generate, ,AC_MSG_ERROR([libuuid is not available])) +AC_CHECK_FUNC(uuid_create) +if test "${ac_cv_func_uuid_create}" = yes ; then + AC_DEFINE(HAVE_UUID_CREATE, [], "specifies if the uuid_create function defined") + use_uuid_library="no" +else + AC_CHECK_FUNC(uuid_generate) + if test "${ac_cv_func_uuid_generate}" = yes ; then + AC_DEFINE(HAVE_UUID_GENERATE, [], "specifies if the uuid_generate function defined") + use_uuid_library="no" + else + AC_CHECK_LIB(uuid, uuid_generate, , + AC_MSG_ERROR([libuuid is not available])) + AC_DEFINE(HAVE_UUID_GENERATE, [], "specifies if the uuid_generate function defined") + use_uuid_library="yes" + fi +fi + +AM_CONDITIONAL(USE_UUID_LIBRARY, test "${use_uuid_library}" = yes) + +AC_CHECK_HEADER(uuid.h) +if test "${ac_cv_header_uuid_h}" = yes ; then + AC_DEFINE(HAVE_UUID_H, [], "specifies if the uuid.h header exists") +else + AC_CHECK_HEADER(uuid/uuid.h) + if test "${ac_cv_header_uuid_uuid_h}" = yes ; then + AC_DEFINE(HAVE_UUID_UUID_H, [], "specifies if the uuid/uuid.h header exists") + fi +fi # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST |