summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-11-02 19:00:35 -0800
committerKeith Packard <keithp@neko.keithp.com>2006-11-02 19:00:35 -0800
commit543b397277d1f03b8091e44812010abcd5d80102 (patch)
tree7bfaa1e22b798a126a2f06d94d29efbd9a5e9458 /configure.ac
parent4056e6e79a4e37101d298ae29139c83d3816368b (diff)
parent645d0576205532a3610ae351267d5b84d76236bd (diff)
Merge branch 'origin' into randr-1.2
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac45
1 files changed, 43 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 4a848ca84..195211cb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,8 @@ dnl xwin-config.h covers the XWin DDX.
AC_CONFIG_HEADERS(include/xwin-config.h)
dnl kdrive-config.h covers the kdrive DDX
AC_CONFIG_HEADERS(include/kdrive-config.h)
-
+dnl libdrm now needs 64-bit file offsets
+AC_CONFIG_HEADERS(include/libdrm-config.h)
AC_PROG_CC
AM_PROG_AS
@@ -62,6 +63,7 @@ AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
AC_PROG_LEX
AC_PROG_YACC
+AC_SYS_LARGEFILE
XORG_PROG_RAWCPP
AC_HEADER_DIRENT
@@ -873,9 +875,46 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS}"
XSERVER_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} -lm"
-AC_SUBST([XSERVER_LIBS])
AC_SUBST([SYS_LIBS])
+AC_CHECK_FUNCS([clock_gettime], [have_clock_gettime=yes],
+ [AC_CHECK_LIB([rt], [clock_gettime], [have_clock_gettime=-lrt],
+ [have_clock_gettime=no])])
+
+AC_MSG_CHECKING([for a useful monotonic clock ...])
+
+if ! test "x$have_clock_gettime" = xno; then
+ if ! test "x$have_clock_gettime" = xyes; then
+ LIBS="$have_clock_gettime"
+ else
+ LIBS=""
+ fi
+
+ AC_RUN_IFELSE([
+#define _POSIX_C_SOURCE 199309L
+#include <time.h>
+
+int main(int argc, char *argv[]) {
+ struct timespec tp;
+
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0)
+ return 0;
+ else
+ return 1;
+}
+ ], [MONOTONIC_CLOCK=yes], [MONOTONIC_CLOCK=no],
+ [MONOTONIC_CLOCK="cross compiling"])
+else
+ MONOTONIC_CLOCK=no
+fi
+
+AC_MSG_RESULT([$MONOTONIC_CLOCK])
+
+if test "x$MONOTONIC_CLOCK" = xyes; then
+ AC_DEFINE(MONOTONIC_CLOCK, 1, [Have monotonic clock from clock_gettime()])
+ XSERVER_LIBS="$XSERVER_LIBS $LIBS"
+fi
+
dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so
dnl we need to replicate that here until those can all be fixed
AC_MSG_CHECKING([if SVR4 needs to be defined])
@@ -890,6 +929,8 @@ AC_MSG_RESULT([yes])], AC_MSG_RESULT([no]))
XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC"
AC_DEFINE_UNQUOTED(X_BYTE_ORDER,[$ENDIAN],[Endian order])
+AC_SUBST([XSERVER_LIBS])
+
dnl ---------------------------------------------------------------------------
dnl DDX section.
dnl ---------------------------------------------------------------------------