From 92866521234732bd0266da0ed0483eee919bb345 Mon Sep 17 00:00:00 2001 From: file Date: Mon, 23 Jul 2007 13:46:57 +0000 Subject: 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 --- configure.ac | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'configure.ac') 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 byteswapping macros) +AC_LINK_IFELSE( +AC_LANG_PROGRAM([#include ], [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 byteswapping macros) +AC_LINK_IFELSE( +AC_LANG_PROGRAM([#include ], [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]) -- cgit v1.2.3