diff options
author | Keith Packard <keithp@guitar.keithp.com> | 2007-02-16 02:19:10 -0800 |
---|---|---|
committer | Keith Packard <keithp@guitar.keithp.com> | 2007-02-16 02:19:10 -0800 |
commit | 0ca926e63c7fa9122a8cba1424ce4cdee1c7b215 (patch) | |
tree | 81b26423182b51483ce27ad1dc8d057ea56e55be /configure.ac | |
parent | 972f1109d23c0a3f821fa573e2aa40cd17ce2795 (diff) |
Check for presence of xf86Modes.h file.
xf86Modes.h file signals the availability of the new modes API in the
server; use that instead of counting on X server version numbers.
Also, finish eliminating use of local copies of those header files.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 71 |
1 files changed, 40 insertions, 31 deletions
diff --git a/configure.ac b/configure.ac index e0d828e8..8a81859c 100644 --- a/configure.ac +++ b/configure.ac @@ -76,37 +76,6 @@ AC_ARG_WITH(xserver-source,AC_HELP_STRING([--with-xserver-source=XSERVER_SOURCE] [ XSERVER_SOURCE="" ]) -PKG_CHECK_MODULES(XORG_XSERVER, xorg-server >= 1.2.99, [XMODES=yes], [XMODES=no]) - -AM_CONDITIONAL(XMODES, [test "x$XMODES" = xyes]) - -if test "x$XMODES" = xyes; then - AC_DEFINE(XMODES, 1,[X server as built-in mode code]) -else - if test "x$XSERVER_SOURCE" = x; then - if test -d ../../xserver; then - XSERVER_SOURCE="`cd ../../xserver && pwd`" - fi - fi - - if test "x$XSERVER_SOURCE" = x; then - AC_MSG_ERROR([Must have X server >= 1.3 source tree for mode setting code. Please specify --with-xserver-source]) - fi - - if test -f src/modes/xf86Crtc.h; then - : - else - ln -s $XSERVER_SOURCE/hw/xfree86/modes src/modes - fi - - if test -f src/parser/xf86Parser.h; then - : - else - ln -s $XSERVER_SOURCE/hw/xfree86/parser src/parser - fi - -fi - # Checks for extensions XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto) XORG_DRIVER_CHECK_EXT(RANDR, randrproto) @@ -144,6 +113,46 @@ if test x$DRI = xauto; then fi AC_MSG_RESULT([$DRI]) +save_CFLAGS="$CFLAGS" +CFLAGS="$XORG_CFLAGS" +AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"]) +CFLAGS="$save_CFLAGS" + +AM_CONDITIONAL(XMODES, test "x$XMODES" = xno) + +if test "x$XMODES" = xyes; then + echo built-in mode code + AC_DEFINE(XMODES, 1,[X server has built-in mode code]) + XMODES_CFLAGS= +else + echo symlink mode code + if test "x$XSERVER_SOURCE" = x; then + if test -d ../../xserver; then + XSERVER_SOURCE="`cd ../../xserver && pwd`" + fi + fi + + if test "x$XSERVER_SOURCE" = x; then + AC_MSG_ERROR([Must have X server >= 1.3 source tree for mode setting code. Please specify --with-xserver-source]) + fi + XMODES_CFLAGS='-DXF86_MODES_RENAME -I$(top_srcdir)/src/modes -I$(top_srcdir)/src/parser' +fi + +if test -d "$XSERVER_SOURCE"; then + if test -f src/modes/xf86Modes.h; then + : + else + ln -s $XSERVER_SOURCE/hw/xfree86/modes src/modes + fi + + if test -f src/parser/xf86Parser.h; then + : + else + ln -s $XSERVER_SOURCE/hw/xfree86/parser src/parser + fi +fi +AC_SUBST([XMODES_CFLAGS]) + dnl Use lots of warning flags with GCC WARN_CFLAGS="" |