summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2007-12-10 15:43:52 +1000
committerDave Airlie <airlied@linux.ie>2007-12-10 15:43:52 +1000
commit2818e2b02ca90c9dfa50905b5311b2ae83ac3b0c (patch)
tree71b5fb1d94a98ef5c11726f9031db2f3e6b84407 /configure.ac
parentcc3c36100986f9d8060bc2d433373d4806f8e730 (diff)
add more to configure.ac for using out-of-tree mode src
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac63
1 files changed, 47 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 71e5e45..b5c694c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,11 @@ AC_ARG_ENABLE(exa,
[EXA="$enableval"],
[EXA=yes])
+AC_ARG_WITH(xserver-source,AC_HELP_STRING([--with-xserver-source=XSERVER_SOURCE],
+ [Path to X server source tree]),
+ [ XSERVER_SOURCE="$withval" ],
+ [ XSERVER_SOURCE="" ])
+
# Checks for extensions
XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
@@ -116,22 +121,6 @@ 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
- AC_MSG_NOTICE([X server has new mode code])
- AC_DEFINE(XMODES, 1,[X server has built-in mode code])
- XMODES_CFLAGS=
-else
- if test -f src/modes/xf86Modes.h -a -f src/parser/xf86Parser.h; then
- AC_MSG_NOTICE([X server is missing new mode code, using local copy])
- else
- 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 -I$(top_srcdir)/src/modes -I$(top_srcdir)/src/parser'
-fi
-
-AC_SUBST([XMODES_CFLAGS])
-
# Note that this is sort of inverted from drivers/ati/Imakefile in
# the monolith. We test for foo, not for !foo (i.e. ATMISC_CPIO, not
# ATIMISC_AVOID_CPIO), but the defines are negative. So beware. Oh yeah,
@@ -228,6 +217,48 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
[#include "xorg-server.h"])
+AM_CONDITIONAL(XMODES, test "x$XMODES" = xno)
+
+if test "x$XSERVER_SOURCE" = x; then
+ if test -d ../../xserver; then
+ XSERVER_SOURCE="`cd ../../xserver && pwd`"
+ fi
+fi
+
+if test -d "$XSERVER_SOURCE"; then
+ case "$XSERVER_SOURCE" in
+ /*)
+ ;;
+ *)
+ XSERVER_SOURCE="`cd $XSERVER_SOURCE && pwd`"
+ esac
+ if test -f src/modes/xf86Modes.h; then
+ :
+ else
+ ln -sf $XSERVER_SOURCE/hw/xfree86/modes src/modes
+ fi
+
+ if test -f src/parser/xf86Parser.h; then
+ :
+ else
+ ln -sf $XSERVER_SOURCE/hw/xfree86/parser src/parser
+ fi
+fi
+if test "x$XMODES" = xyes; then
+ AC_MSG_NOTICE([X server has new mode code])
+ AC_DEFINE(XMODES, 1,[X server has built-in mode code])
+ XMODES_CFLAGS=
+else
+ if test -f src/modes/xf86Modes.h -a -f src/parser/xf86Parser.h; then
+ AC_MSG_NOTICE([X server is missing new mode code, using local copy])
+ else
+ 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 -I$(top_srcdir)/src/modes -I$(top_srcdir)/src/parser'
+fi
+
+AC_SUBST([XMODES_CFLAGS])
+
CPPFLAGS="$SAVE_CPPFLAGS"
AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes)