summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@apple.com>2011-03-04 12:41:55 -0800
committerJeremy Huddleston <jeremyhu@apple.com>2011-03-04 12:41:55 -0800
commit8c3325f8bbdb1e8975bdb01525a52d6b0f80cfa3 (patch)
treecc0db3bc853819a1a00828d121dec7b5a30fce2b
parentc2e023646298da05e212056fbc6b329e4dd9a100 (diff)
darwin: Don't use poll() when expected to run on darwin10 and prior
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--configure.ac19
1 files changed, 17 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index a8e171b..b8d5471 100644
--- a/configure.ac
+++ b/configure.ac
@@ -131,8 +131,23 @@ AC_PREREQ([2.59c], [], [AC_SUBST([htmldir], [m4_ifset([AC_PACKAGE_TARNAME],
XCB_CHECK_DOXYGEN()
case $host_os in
- # darwin has poll() but can't be used to poll character devices (atleast through SnowLeopard)
- darwin*) ;;
+ # darwin through Snow Leopard has poll() but can't be used to poll character devices.
+ darwin@<:@789@:>@*|darwin10*) ;;
+ darwin*)
+ _ac_xorg_macosx_version_min=""
+ if echo $CPPFLAGS $CFLAGS | grep -q mmacosx-version-min ; then
+ _ac_xorg_macosx_version_min=`echo $CPPFLAGS $CFLAGS | sed 's/^.*-mmacosx-version-min=\(@<:@^ @:>@*\).*$/\1/'`
+ else
+ _ac_xorg_macosx_version_min=$MACOSX_DEPLOYMENT_TARGET
+ fi
+ case $_ac_xorg_macosx_version_min in
+ 10.@<:@0123456@:>@|10.@<:@0123456@:>@.*) ;;
+ *)
+ AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
+ ;;
+ esac
+ unset _ac_xorg_macosx_version_min
+ ;;
*)
AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
;;