1
# Copyright 2005 Adam Jackson.
3
# Permission is hereby granted, free of charge, to any person obtaining a
4
# copy of this software and associated documentation files (the "Software"),
5
# to deal in the Software without restriction, including without limitation
6
# on the rights to use, copy, modify, merge, publish, distribute, sub
7
# license, and/or sell copies of the Software, and to permit persons to whom
8
# the Software is furnished to do so, subject to the following conditions:
10
# The above copyright notice and this permission notice (including the next
11
# paragraph) shall be included in all copies or substantial portions of the
14
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17
# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
# Process this file with autoconf to produce a configure script
25
AC_INIT([xf86-video-openchrome],
27
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
28
[xf86-video-openchrome])
30
AC_DEFINE_UNQUOTED([VIA_MAJOR_VERSION],
31
[$(echo $PACKAGE_VERSION | sed -e 's/^\([[0-9]]*\)\.[[0-9]]*\.[[0-9]]*/\1/')],
33
AC_DEFINE_UNQUOTED([VIA_MINOR_VERSION],
34
[$(echo $PACKAGE_VERSION | sed -e 's/^[[0-9]]*\.\([[0-9]]*\)\.[[0-9]]*/\1/')],
36
AC_DEFINE_UNQUOTED([VIA_PATCHLEVEL],
37
[$(echo $PACKAGE_VERSION | sed -e 's/^[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)/\1/')],
40
AC_CONFIG_SRCDIR([Makefile.am])
41
AC_CONFIG_HEADERS([config.h])
44
AM_INIT_AUTOMAKE([foreign dist-bzip2])
52
AH_TOP([#include "xorg-server.h"])
54
AC_ARG_WITH(xorg-module-dir,
55
AC_HELP_STRING([--with-xorg-module-dir=DIR],
56
[Default xorg module directory [[default=$libdir/xorg/modules]]]),
57
[moduledir="$withval"],
58
[moduledir="$libdir/xorg/modules"])
60
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
61
[Enable debugging support [[default=no]]]),
65
AC_ARG_ENABLE(xv-debug, AC_HELP_STRING([--enable-xv-debug],
66
[Enable XVideo debugging support [[default=no]]]),
67
[XV_DEBUG="$enableval"],
70
AC_ARG_ENABLE(viaregtool, AC_HELP_STRING([--enable-viaregtool],
71
[Enable build of registers dumper tool [[default=no]]]),
75
# Checks for extensions
76
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
77
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
78
XORG_DRIVER_CHECK_EXT(XV, videoproto)
79
XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
80
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
82
# Checks for pkg-config packages
83
PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm glproto $REQUIRED_MODULES])
84
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
85
HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
86
HAVE_XEXTPROTO_71="no")
87
AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
89
# Checks for libraries.
91
# Checks for header files.
94
save_CPPFLAGS="$CPPFLAGS"
95
CPPFLAGS="$XORG_CFLAGS $CPPFLAGS"
96
AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"])
97
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.11.0],
98
HAVE_PCIACCESS="yes"; AC_DEFINE(HAVE_PCIACCESS, 1, [libpciacces available]),
100
AC_SUBST([PCIACCESS_CFLAGS])
101
AC_SUBST([PCIACCESS_LIBS])
103
PKG_CHECK_MODULES(DRI, [libdrm >= 2.4.4 xf86driproto],
104
DRI="yes"; AC_DEFINE(HAVE_DRI, 1, [DRI is available]),
106
AC_MSG_CHECKING([whether to build KMS support])
107
AC_MSG_RESULT([$DRI])
109
AM_CONDITIONAL(DRI, test x$DRI = xyes)
110
if test "$DRI" = yes; then
111
AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
113
AC_CHECK_HEADER([damage.h],
114
[have_damage_h="yes"], [have_damage_h="no"],[-])
115
if test "$have_damage_h" = yes; then
116
AC_DEFINE(DAMAGE,1,[Use Damage extension])
119
PKG_CHECK_MODULES(LIBUDEV, [libudev], [LIBUDEV=yes], [LIBUDEV=no])
120
if test "x$LIBUDEV" = xyes; then
121
AC_DEFINE(HAVE_LIBUDEV, 1,[libudev support])
136
if test "x$XVMC" = xyes; then
137
AC_CHECK_HEADERS(pthread.h sys/ioctl.h sys/time.h time.h,,[XVMC="no"; break],)
138
PKG_CHECK_MODULES(XVMC, [x11 xext xvmc])
141
AC_MSG_CHECKING([whether to build XvMC driver support])
142
AC_MSG_RESULT([$XVMC])
144
AM_CONDITIONAL(XVMC, test x$XVMC = xyes)
146
AM_CONDITIONAL(DEBUG, test x$DEBUG = xyes)
147
if test "$DEBUG" = yes; then
148
AC_DEFINE(HAVE_DEBUG,1,[Enable debug support])
151
AM_CONDITIONAL(XV_DEBUG, test x$XV_DEBUG = xyes)
152
if test "$XV_DEBUG" = yes; then
153
AC_DEFINE(XV_DEBUG,1,[Enable XVideo debug support])
156
AM_CONDITIONAL(TOOLS, test x$TOOLS = xyes)
157
if test "$TOOLS" = yes; then
158
AC_DEFINE(TOOLS,1,[Enable build of registers dumper tool])
161
AC_SUBST([DRI_CFLAGS])
162
AC_SUBST([XORG_CFLAGS])
163
AC_SUBST([moduledir])
165
DRIVER_NAME=openchrome
166
AC_SUBST([DRIVER_NAME])
168
AC_DEFINE(X_USE_LINEARFB,1,[Compatibility define for older Xen])
169
AC_DEFINE(X_USE_REGION_NULL,1,[Compatibility define for older Xen])
170
AC_DEFINE(X_HAVE_XAAGETROP,1,[Compatibility define for older Xen])
171
AC_DEFINE(X_NEED_I2CSTART,1,[Compatibility define for older Xen])
173
DRIVER_MAN_SUFFIX="4"
174
AC_SUBST([DRIVER_MAN_SUFFIX])
176
XORG_MANPAGE_SECTIONS