diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-10 00:13:45 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-09-10 00:13:45 +0000 |
commit | b4e92938be35a3ec6221931a81c32cf5104f4d9a (patch) | |
tree | b74bf3bd5545175b3979483c1c1c71a9d70b8ce9 /configure.ac | |
parent | a35868c2670ebbb59914d610c99bdfb1e20cb6dd (diff) |
Fix Mac OS X build.
This also fixes a rather grievous calculation error for the offset of
ast_fdset, which was masked on Linux and FreeBSD, because these platforms
check the first 256 FDs regardless of the bitmask setting (due to backwards
compatibility).
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@285889 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index e5424da7b..759b94bdb 100644 --- a/configure.ac +++ b/configure.ac @@ -652,6 +652,25 @@ AC_CHECK_HEADER([libkern/OSAtomic.h], [AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])]) AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long long) +AC_COMPUTE_INT([ac_cv_sizeof_fd_set_fds_bits], [sizeof(foo.fds_bits[[0]])], [$ac_includes_default +fd_set foo;]) +# This doesn't actually work; what it does is to use the variable set in the +# previous test as a cached value to set the right output variables. +AC_CHECK_SIZEOF(fd_set.fds_bits) + +# Set a type compatible with the previous. We cannot just use a generic type +# for these bits, because on big-endian systems, the bits won't match up +# correctly if the size is wrong. +if test $ac_cv_sizeof_int = $ac_cv_sizeof_fd_set_fds_bits; then + AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [int], [Define to a type of the same size as fd_set.fds_bits[[0]]]) +else if test $ac_cv_sizeof_long = $ac_cv_sizeof_fd_set_fds_bits; then + AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long], [Define to a type of the same size as fd_set.fds_bits[[0]]]) +else if test $ac_cv_sizeof_long_long = $ac_cv_sizeof_fd_set_fds_bits; then + AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long long], [Define to a type of the same size as fd_set.fds_bits[[0]]]) +fi ; fi ; fi + # do the package library checks now |