configure.ac revision 7e6fb56f
1#  Copyright 2005 Adam Jackson.
2#
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:
9#
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
12#  Software.
13#
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.
20#
21# Process this file with autoconf to produce a configure script
22
23AC_PREREQ(2.57)
24AC_INIT([xf86-video-openchrome],
25        0.2.904,
26        [http://www.openchrome.org/trac/report/1],
27        xf86-video-openchrome)
28
29AC_CONFIG_SRCDIR([Makefile.am])
30AM_CONFIG_HEADER([config.h])
31AC_CONFIG_AUX_DIR(.)
32
33AM_INIT_AUTOMAKE([dist-bzip2])
34
35AM_MAINTAINER_MODE
36
37# Checks for programs.
38AC_DISABLE_STATIC
39AC_PROG_LIBTOOL
40AC_PROG_CC
41
42AH_TOP([#include "xorg-server.h"])
43
44AC_ARG_WITH(xorg-module-dir,
45            AC_HELP_STRING([--with-xorg-module-dir=DIR],
46                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
47            [moduledir="$withval"],
48            [moduledir="$libdir/xorg/modules"])
49
50AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
51                                  [Disable DRI support [[default=auto]]]),
52              [DRI="$enableval"],
53              [DRI=auto])
54
55AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
56				    [Enable debugging support [[default=no]]]),
57              [DEBUG="$enableval"],
58              [DEBUG=no])
59
60AC_ARG_ENABLE(xv-debug, AC_HELP_STRING([--enable-xv-debug],
61				    [Enable XVideo debugging support [[default=no]]]),
62              [XV_DEBUG="$enableval"],
63              [XV_DEBUG=no])
64
65# Checks for extensions
66XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
67XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
68XORG_DRIVER_CHECK_EXT(XV, videoproto)
69XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
70XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
71
72# Checks for pkg-config packages
73PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto libdrm $REQUIRED_MODULES])
74PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
75 HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
76 HAVE_XEXTPROTO_71="no")
77AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
78sdkdir=$(pkg-config --variable=sdkdir xorg-server)
79
80# Checks for libraries.
81
82# Checks for header files.
83AC_HEADER_STDC
84AC_CHECK_HEADER(xf86Modes.h,[XMODES=yes],[XMODES=no],[#include "xorg-server.h"])
85AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
86             [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
87             [#include "xorg/xorg-server.h"])
88
89if test x$XSERVER_LIBPCIACCESS = xyes; then
90       PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
91fi
92
93if test "$DRI" != no; then
94        AC_CHECK_FILE([${sdkdir}/dri.h],
95                      [have_dri_h="yes"], [have_dri_h="no"])
96        AC_CHECK_FILE([${sdkdir}/sarea.h],
97                      [have_sarea_h="yes"], [have_sarea_h="no"])
98        AC_CHECK_FILE([${sdkdir}/dristruct.h],
99                      [have_dristruct_h="yes"], [have_dristruct_h="no"])
100fi
101
102AC_MSG_CHECKING([whether to include DRI support])
103if test x$DRI = xauto; then
104        if test "$have_dri_h" = yes -a \
105                "$have_sarea_h" = yes -a \
106                "$have_dristruct_h" = yes; then
107                DRI="yes"
108        else
109                DRI="no"
110        fi
111fi
112AC_MSG_RESULT([$DRI])
113
114AM_CONDITIONAL(DRI, test x$DRI = xyes)
115if test "$DRI" = yes; then
116        PKG_CHECK_MODULES(DRI, [libdrm xf86driproto])
117        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
118        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
119        case "$host_cpu" in
120            i*86)
121                XVMC=yes ;;
122            amd64*|x86_64*)
123                XVMC=yes ;;
124            *)
125                XVMC=no ;;
126        esac
127else
128        XVMC="no"
129fi
130
131if test "x$XVMC" = xyes; then
132	AC_CHECK_HEADERS(pthread.h sys/ioctl.h sys/time.h time.h,,[XVMC="no"; break],)
133	PKG_CHECK_MODULES(XVMC, [x11 xext xvmc])
134fi
135
136AC_MSG_CHECKING([whether to build XvMC driver support])
137AC_MSG_RESULT([$XVMC])
138
139AM_CONDITIONAL(XVMC, test x$XVMC = xyes)
140
141# Check the ABI_VIDEODRV_VERSION
142SAVE_CFLAGS="$CFLAGS"
143CFLAGS="$CFLAGS $XORG_CFLAGS"
144		
145AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test x$XSERVER_LIBPCIACCESS = xyes)
146if test "$XSERVER_LIBPCIACCESS" = yes; then
147        AC_DEFINE(XSERVER_LIBPCIACCESS,1,[Enable libpciaccess])
148fi
149
150AM_CONDITIONAL(DEBUG, test x$DEBUG = xyes)
151if test "$DEBUG" = yes; then
152        AC_DEFINE(HAVE_DEBUG,1,[Enable debug support])
153fi
154
155AM_CONDITIONAL(XV_DEBUG, test x$XV_DEBUG = xyes)
156if test "$XV_DEBUG" = yes; then
157        AC_DEFINE(XV_DEBUG,1,[Enable XVideo debug support])
158fi
159
160AC_SUBST([DRI_CFLAGS])
161AC_SUBST([XORG_CFLAGS])
162AC_SUBST([moduledir])
163
164DRIVER_NAME=openchrome
165AC_SUBST([DRIVER_NAME])
166
167AC_DEFINE(X_USE_LINEARFB,1,[Compatibility define for older Xen])
168AC_DEFINE(X_USE_REGION_NULL,1,[Compatibility define for older Xen])
169AC_DEFINE(X_HAVE_XAAGETROP,1,[Compatibility define for older Xen])
170AC_DEFINE(X_NEED_I2CSTART,1,[Compatibility define for older Xen])
171
172DRIVER_MAN_SUFFIX="4"
173AC_SUBST([DRIVER_MAN_SUFFIX])
174
175XORG_RELEASE_VERSION
176
177AC_OUTPUT([
178	Makefile
179	libxvmc/Makefile
180	man/Makefile
181	src/Makefile
182])
183