configure.ac revision c582b7e3
1c582b7e3Smrg#  Copyright 2005 Adam Jackson.
2c582b7e3Smrg#
3c582b7e3Smrg#  Permission is hereby granted, free of charge, to any person obtaining a
4c582b7e3Smrg#  copy of this software and associated documentation files (the "Software"),
5c582b7e3Smrg#  to deal in the Software without restriction, including without limitation
6c582b7e3Smrg#  on the rights to use, copy, modify, merge, publish, distribute, sub
7c582b7e3Smrg#  license, and/or sell copies of the Software, and to permit persons to whom
8c582b7e3Smrg#  the Software is furnished to do so, subject to the following conditions:
9c582b7e3Smrg#
10c582b7e3Smrg#  The above copyright notice and this permission notice (including the next
11c582b7e3Smrg#  paragraph) shall be included in all copies or substantial portions of the
12c582b7e3Smrg#  Software.
13c582b7e3Smrg#
14c582b7e3Smrg#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15c582b7e3Smrg#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16c582b7e3Smrg#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
17c582b7e3Smrg#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18c582b7e3Smrg#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19c582b7e3Smrg#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20c582b7e3Smrg#
21c582b7e3Smrg# Process this file with autoconf to produce a configure script
22c582b7e3Smrg
23c582b7e3SmrgAC_PREREQ(2.57)
24c582b7e3SmrgAC_INIT([xf86-video-r128],
25c582b7e3Smrg        6.8.0,
26c582b7e3Smrg        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
27c582b7e3Smrg        xf86-video-r128)
28c582b7e3Smrg
29c582b7e3SmrgAC_CONFIG_SRCDIR([Makefile.am])
30c582b7e3SmrgAM_CONFIG_HEADER([config.h])
31c582b7e3SmrgAC_CONFIG_AUX_DIR(.)
32c582b7e3Smrg
33c582b7e3SmrgAM_INIT_AUTOMAKE([dist-bzip2])
34c582b7e3Smrg
35c582b7e3SmrgAM_MAINTAINER_MODE
36c582b7e3Smrg
37c582b7e3Smrg# Checks for programs.
38c582b7e3SmrgAC_DISABLE_STATIC
39c582b7e3SmrgAC_PROG_LIBTOOL
40c582b7e3SmrgAC_PROG_CC
41c582b7e3Smrg
42c582b7e3Smrgif test "x$GCC" = "xyes"; then
43c582b7e3Smrg	CPPFLAGS="$CPPFLAGS -Wall"
44c582b7e3Smrgfi
45c582b7e3Smrg
46c582b7e3SmrgAH_TOP([#include "xorg-server.h"])
47c582b7e3Smrg
48c582b7e3SmrgAC_ARG_WITH(xorg-module-dir,
49c582b7e3Smrg            AC_HELP_STRING([--with-xorg-module-dir=DIR],
50c582b7e3Smrg                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
51c582b7e3Smrg            [moduledir="$withval"],
52c582b7e3Smrg            [moduledir="$libdir/xorg/modules"])
53c582b7e3Smrg
54c582b7e3SmrgAC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
55c582b7e3Smrg                                  [Disable DRI support [[default=auto]]]),
56c582b7e3Smrg              [DRI="$enableval"],
57c582b7e3Smrg              [DRI=auto])
58c582b7e3Smrg
59c582b7e3Smrg# Checks for extensions
60c582b7e3SmrgXORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)
61c582b7e3SmrgXORG_DRIVER_CHECK_EXT(RANDR, randrproto)
62c582b7e3SmrgXORG_DRIVER_CHECK_EXT(RENDER, renderproto)
63c582b7e3SmrgXORG_DRIVER_CHECK_EXT(XV, videoproto)
64c582b7e3SmrgXORG_DRIVER_CHECK_EXT(XF86MISC, xf86miscproto)
65c582b7e3SmrgXORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
66c582b7e3Smrg
67c582b7e3Smrg# Checks for pkg-config packages
68c582b7e3SmrgPKG_CHECK_MODULES(XORG, [xorg-server >= 1.2 xproto fontsproto $REQUIRED_MODULES])
69c582b7e3Smrgsdkdir=$(pkg-config --variable=sdkdir xorg-server)
70c582b7e3Smrg
71c582b7e3Smrg# Checks for libraries.
72c582b7e3Smrg
73c582b7e3Smrg# Checks for header files.
74c582b7e3SmrgAC_HEADER_STDC
75c582b7e3Smrg
76c582b7e3Smrgif test "$DRI" != no; then
77c582b7e3Smrg	AC_CHECK_FILE([${sdkdir}/dri.h],
78c582b7e3Smrg                      [have_dri_h="yes"], [have_dri_h="no"])
79c582b7e3Smrg	AC_CHECK_FILE([${sdkdir}/sarea.h],
80c582b7e3Smrg                      [have_sarea_h="yes"], [have_sarea_h="no"])
81c582b7e3Smrg	AC_CHECK_FILE([${sdkdir}/dristruct.h],
82c582b7e3Smrg                      [have_dristruct_h="yes"], [have_dristruct_h="no"])
83c582b7e3Smrg	AC_CHECK_FILE([${sdkdir}/damage.h],
84c582b7e3Smrg                      [have_damage_h="yes"], [have_damage_h="no"])
85c582b7e3Smrgfi
86c582b7e3Smrg
87c582b7e3SmrgAC_MSG_CHECKING([whether to include DRI support])
88c582b7e3Smrgif test x$DRI = xauto; then
89c582b7e3Smrg	if test "$have_dri_h" = yes -a \
90c582b7e3Smrg                "$have_sarea_h" = yes -a \
91c582b7e3Smrg                "$have_dristruct_h" = yes; then
92c582b7e3Smrg		DRI="yes"
93c582b7e3Smrg	else
94c582b7e3Smrg		DRI="no"
95c582b7e3Smrg	fi
96c582b7e3Smrgfi
97c582b7e3SmrgAC_MSG_RESULT([$DRI])
98c582b7e3Smrg
99c582b7e3SmrgAM_CONDITIONAL(DRI, test x$DRI = xyes)
100c582b7e3Smrgif test "$DRI" = yes; then
101c582b7e3Smrg	PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
102c582b7e3Smrg        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
103c582b7e3Smrg        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
104c582b7e3Smrgfi
105c582b7e3Smrg
106c582b7e3SmrgSAVE_CPPFLAGS="$CPPFLAGS"
107c582b7e3SmrgCPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
108c582b7e3SmrgAC_CHECK_DECL(XSERVER_LIBPCIACCESS,
109c582b7e3Smrg	      [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
110c582b7e3Smrg	      [#include "xorg-server.h"])
111c582b7e3SmrgCPPFLAGS="$SAVE_CPPFLAGS"
112c582b7e3Smrg
113c582b7e3SmrgAM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes)
114c582b7e3Smrg
115c582b7e3Smrgif test "x$XSERVER_LIBPCIACCESS" = xyes; then
116c582b7e3Smrg    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
117c582b7e3Smrg    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
118c582b7e3Smrgfi
119c582b7e3SmrgAM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
120c582b7e3Smrg
121c582b7e3SmrgAC_SUBST([XORG_CFLAGS])
122c582b7e3SmrgAC_SUBST([DRI_CFLAGS])
123c582b7e3SmrgAC_SUBST([moduledir])
124c582b7e3Smrg
125c582b7e3SmrgDRIVER_NAME=r128
126c582b7e3SmrgAC_SUBST([DRIVER_NAME])
127c582b7e3Smrg
128c582b7e3SmrgXORG_MANPAGE_SECTIONS
129c582b7e3SmrgXORG_RELEASE_VERSION
130c582b7e3SmrgXORG_CHECK_LINUXDOC
131c582b7e3Smrg
132c582b7e3SmrgAC_MSG_NOTICE(
133c582b7e3Smrg[Please change the Driver line in xorg.conf from "ati" to "r128" or install]
134c582b7e3Smrg[the ati wrapper as well:]
135c582b7e3Smrg[    git://anongit.freedesktop.org/git/xorg/driver/xf86-video-ati]
136c582b7e3Smrg)
137c582b7e3Smrg
138c582b7e3SmrgAC_OUTPUT([
139c582b7e3Smrg	Makefile
140c582b7e3Smrg	src/Makefile
141c582b7e3Smrg	man/Makefile
142c582b7e3Smrg])
143