summaryrefslogtreecommitdiff
path: root/driver/xf86-video-ati/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'driver/xf86-video-ati/configure.ac')
-rw-r--r--driver/xf86-video-ati/configure.ac196
1 files changed, 110 insertions, 86 deletions
diff --git a/driver/xf86-video-ati/configure.ac b/driver/xf86-video-ati/configure.ac
index 709fb1916..167432cc2 100644
--- a/driver/xf86-video-ati/configure.ac
+++ b/driver/xf86-video-ati/configure.ac
@@ -20,24 +20,36 @@
#
# Process this file with autoconf to produce a configure script
-AC_PREREQ(2.57)
+# Initialize Autoconf
+AC_PREREQ([2.60])
AC_INIT([xf86-video-ati],
- 6.12.2,
+ [6.14.3],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
- xf86-video-ati)
+ [xf86-video-ati])
AC_CONFIG_SRCDIR([Makefile.am])
-AM_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
+
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
+m4_ifndef([XORG_MACROS_VERSION],
+ [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+
AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE([dist-bzip2])
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AC_SYS_LARGEFILE
AM_MAINTAINER_MODE
-# Checks for programs.
+# Initialize libtool
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
-AC_PROG_CC
+
+# Checks for programs.
+AM_PROG_CC_C_O
if test "x$GCC" = "xyes"; then
CPPFLAGS="$CPPFLAGS -Wall"
@@ -45,53 +57,62 @@ fi
AH_TOP([#include "xorg-server.h"])
+# Define a configure option for an alternate module directory
AC_ARG_WITH(xorg-module-dir,
- AC_HELP_STRING([--with-xorg-module-dir=DIR],
+ AS_HELP_STRING([--with-xorg-module-dir=DIR],
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
[moduledir="$withval"],
[moduledir="$libdir/xorg/modules"])
-AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
+AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri],
[Disable DRI support [[default=auto]]]),
[DRI="$enableval"],
[DRI=auto])
AC_ARG_ENABLE(exa,
- AC_HELP_STRING([--disable-exa],
+ AS_HELP_STRING([--disable-exa],
[Disable EXA support [[default=enabled]]]),
[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="" ])
+AC_ARG_ENABLE(kms,
+ AS_HELP_STRING([--disable-kms],
+ [Disable KMS support [[default=enabled]]]),
+ [DRM_MODE="$enableval"],
+ [DRM_MODE=yes])
-# Checks for extensions
-XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)
+# Store the list of server defined optional extensions in REQUIRED_MODULES
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
XORG_DRIVER_CHECK_EXT(XV, videoproto)
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
-# Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.2 xproto fontsproto $REQUIRED_MODULES])
-sdkdir=$(pkg-config --variable=sdkdir xorg-server)
+# Obtain compiler/linker options for the driver dependencies
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.3 xproto fontsproto $REQUIRED_MODULES])
+PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
+ HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
+ HAVE_XEXTPROTO_71="no")
+AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
# Checks for libraries.
-# Checks for header files.
-AC_HEADER_STDC
if test "$DRI" != no; then
- AC_CHECK_FILE([${sdkdir}/dri.h],
- [have_dri_h="yes"], [have_dri_h="no"])
- AC_CHECK_FILE([${sdkdir}/sarea.h],
- [have_sarea_h="yes"], [have_sarea_h="no"])
- AC_CHECK_FILE([${sdkdir}/dristruct.h],
- [have_dristruct_h="yes"], [have_dristruct_h="no"])
- AC_CHECK_FILE([${sdkdir}/damage.h],
- [have_damage_h="yes"], [have_damage_h="no"])
+ PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS"
+ AC_CHECK_HEADER([dri.h],
+ [have_dri_h="yes"], [have_dri_h="no"],[-])
+ AC_CHECK_HEADER([sarea.h],
+ [have_sarea_h="yes"], [have_sarea_h="no"],[-])
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#include <xorg-server.h>
+#include <dristruct.h>
+ ]])],
+ [have_dristruct_h="yes"], [have_dristruct_h="no"],[-])
+ AC_CHECK_HEADER([damage.h],
+ [have_damage_h="yes"], [have_damage_h="no"],[-])
+ CPPFLAGS="$save_CPPFLAGS"
fi
AC_MSG_CHECKING([whether to include DRI support])
@@ -108,18 +129,39 @@ AC_MSG_RESULT([$DRI])
AM_CONDITIONAL(DRI, test x$DRI = xyes)
if test "$DRI" = yes; then
- PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
if test "$have_damage_h" = yes; then
AC_DEFINE(DAMAGE,1,[Use Damage extension])
fi
-fi
-save_CFLAGS="$CFLAGS"
-CFLAGS="$XORG_CFLAGS"
-AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"])
-CFLAGS="$save_CFLAGS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $CFLAGS"
+ if test "$DRM_MODE" = yes; then
+ AC_CHECK_HEADER(xf86drmMode.h,[DRM_MODE=yes],[DRM_MODE=no],[#include <stdint.h>
+#include <stdlib.h>])
+ if test "x$DRM_MODE" = xyes; then
+ PKG_CHECK_MODULES(LIBDRM_RADEON, [xorg-server >= 1.6.2 libdrm_radeon],
+ [LIBDRM_RADEON=yes], [LIBDRM_RADEON=no])
+
+ if test "x$LIBDRM_RADEON" = xyes; then
+ AC_DEFINE(XF86DRM_MODE,1,[DRM kernel modesetting])
+ AC_DEFINE(RADEON_DRI2, 1,[Enable DRI2 code])
+ else
+ DRM_MODE=no
+ fi
+ PKG_CHECK_MODULES(LIBUDEV, [libudev], [LIBUDEV=yes], [LIBUDEV=no])
+ if test "x$LIBUDEV" = xyes; then
+ AC_DEFINE(HAVE_LIBUDEV, 1,[libudev support])
+ fi
+ fi
+ fi
+ CFLAGS="$save_CFLAGS"
+else
+ DRM_MODE=no
+fi
+AM_CONDITIONAL(DRM_MODE, test x$DRM_MODE = xyes)
+AM_CONDITIONAL(LIBUDEV, test x$LIBUDEV = xyes)
AC_DEFINE(USE_XAA, 1, [Build support for XAA])
@@ -191,52 +233,17 @@ 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])
+AC_CHECK_HEADERS([list.h],
+ [], [],
+ [#include <X11/Xdefs.h>
+ #include "xorg-server.h"])
CPPFLAGS="$SAVE_CPPFLAGS"
AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes)
+AM_CONDITIONAL(XF86DRM_MODE, test "x$LIBDRM_RADEON" = xyes)
+
if test "x$XSERVER_LIBPCIACCESS" = xyes; then
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
@@ -308,17 +315,11 @@ case $host_os in
AC_DEFINE(FGL_LINUX, 1, [Use linux pragma pack]) ;;
esac
-AC_SUBST([XORG_CFLAGS])
-AC_SUBST([DRI_CFLAGS])
AC_SUBST([moduledir])
DRIVER_NAME=ati
AC_SUBST([DRIVER_NAME])
-XORG_MANPAGE_SECTIONS
-XORG_RELEASE_VERSION
-XORG_CHECK_LINUXDOC
-
AC_MSG_NOTICE(
[The atimisc sub-driver has been split out to xf86-video-mach64:]
[ git://anongit.freedesktop.org/git/xorg/driver/xf86-video-mach64]
@@ -331,8 +332,31 @@ AC_MSG_NOTICE(
[Please install that driver as well for rage128-based cards.]
)
-AC_OUTPUT([
- Makefile
- src/Makefile
- man/Makefile
+AC_CONFIG_FILES([
+ Makefile
+ src/Makefile
+ man/Makefile
])
+AC_OUTPUT
+
+dnl
+dnl Output some configuration info for the user
+dnl
+echo ""
+echo " prefix: $prefix"
+echo " exec_prefix: $exec_prefix"
+echo " libdir: $libdir"
+echo " includedir: $includedir"
+
+
+echo ""
+echo " Kernel modesetting: $DRM_MODE"
+
+echo ""
+echo " CFLAGS: $CFLAGS"
+echo " CXXFLAGS: $CXXFLAGS"
+echo " Macros: $DEFINES"
+
+echo ""
+echo " Run '${MAKE-make}' to build xf86-video-ati"
+echo ""