aboutsummaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-23 13:46:57 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-07-23 13:46:57 +0000
commit92866521234732bd0266da0ed0483eee919bb345 (patch)
treef546eff309c8edef6b6ee96ee2a96f6591d663d8 /configure.ac
parentc5fd13bbcdc2e31ca024914388b9fe137d2122ec (diff)
Use autoconf logic to determine byte swapping macro presence. This should now also use other macros if present.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@76523 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac18
1 files changed, 18 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 0ccfb7660..7deedc9c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -286,6 +286,24 @@ AC_CHECK_FUNCS([funopen fopencookie])
# some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
AC_CHECK_FUNCS([gethostbyname_r])
+AC_CHECK_HEADER([byteswap.h], [AC_DEFINE_UNQUOTED([HAVE_BYTESWAP_H], 1, [Define to 1 if byteswap.h macros are available.])])
+
+AC_MSG_CHECKING(for __swap16 variant of <sys/endian.h> byteswapping macros)
+AC_LINK_IFELSE(
+AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = __swap16(a);]),
+AC_MSG_RESULT(yes)
+AC_DEFINE([HAVE_SYS_ENDIAN_SWAP16], 1, [Define to 1 if your sys/endian.h header file provides the __swap16 macro.]),
+AC_MSG_RESULT(no)
+)
+
+AC_MSG_CHECKING(for bswap16 variant of <sys/endian.h> byteswapping macros)
+AC_LINK_IFELSE(
+AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = bswap16(a);]),
+AC_MSG_RESULT(yes)
+AC_DEFINE([HAVE_SYS_ENDIAN_BSWAP16], 1, [Define to 1 if your sys/endian.h header file provides the bswap16 macro.]),
+AC_MSG_RESULT(no)
+)
+
AC_CHECK_FILE(/dev/urandom, AC_DEFINE([HAVE_DEV_URANDOM], 1, [Define to 1 if your system has /dev/urandom.]))
AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])