diff options
author | Joshua Colp <jcolp@digium.com> | 2007-07-23 13:46:57 +0000 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2007-07-23 13:46:57 +0000 |
commit | 91c3d90e8f1205e3087d5ce2c3eeae07893b1c17 (patch) | |
tree | f546eff309c8edef6b6ee96ee2a96f6591d663d8 /configure.ac | |
parent | ed1775bd109f3101df9f94f0fdb9373995a1a471 (diff) |
Use autoconf logic to determine byte swapping macro presence. This should now also use other macros if present.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76523 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 18 |
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]) |