~ubuntu-branches/ubuntu/trusty/xserver-xorg-video-mach64-lts-xenial/trusty-proposed

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Package Import Robot
  • Author(s): Timo Aaltonen
  • Date: 2016-05-03 14:02:37 UTC
  • Revision ID: package-import@ubuntu.com-20160503140237-y946gbjc7p6fg9fn
Tags: upstream-6.9.5
ImportĀ upstreamĀ versionĀ 6.9.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
23
# Initialize Autoconf
 
24
AC_PREREQ([2.60])
 
25
AC_INIT([xf86-video-mach64],
 
26
        [6.9.5],
 
27
        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
 
28
        [xf86-video-mach64])
 
29
AC_CONFIG_SRCDIR([Makefile.am])
 
30
AC_CONFIG_HEADERS([config.h])
 
31
AC_CONFIG_AUX_DIR(.)
 
32
 
 
33
# Initialize Automake
 
34
AM_INIT_AUTOMAKE([foreign dist-bzip2])
 
35
AM_MAINTAINER_MODE
 
36
 
 
37
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
 
38
m4_ifndef([XORG_MACROS_VERSION],
 
39
          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
 
40
XORG_MACROS_VERSION(1.8)
 
41
XORG_DEFAULT_OPTIONS
 
42
 
 
43
# Initialize libtool
 
44
AC_DISABLE_STATIC
 
45
AC_PROG_LIBTOOL
 
46
 
 
47
AH_TOP([#include "xorg-server.h"])
 
48
 
 
49
# Define a configure option for an alternate module directory
 
50
AC_ARG_WITH(xorg-module-dir,
 
51
            AS_HELP_STRING([--with-xorg-module-dir=DIR],
 
52
                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
 
53
            [moduledir="$withval"],
 
54
            [moduledir="$libdir/xorg/modules"])
 
55
 
 
56
AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri],
 
57
                                  [Disable DRI support [[default=auto]]]),
 
58
              [DRI="$enableval"],
 
59
              [DRI=auto])
 
60
 
 
61
AC_ARG_ENABLE(exa,
 
62
              AS_HELP_STRING([--disable-exa],
 
63
                             [Disable EXA support [[default=enabled]]]),
 
64
              [EXA="$enableval"],
 
65
              [EXA=yes])
 
66
 
 
67
# Store the list of server defined optional extensions in REQUIRED_MODULES
 
68
XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
 
69
XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
 
70
XORG_DRIVER_CHECK_EXT(XV, videoproto)
 
71
XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
72
 
 
73
# Obtain compiler/linker options for the driver dependencies
 
74
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.4 xproto fontsproto $REQUIRED_MODULES])
 
75
PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
 
76
                  HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
 
77
                  HAVE_XEXTPROTO_71="no")
 
78
AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
 
79
sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
 
80
 
 
81
# Checks for libraries.
 
82
 
 
83
if test "$DRI" != no; then
 
84
        AC_CHECK_FILE([${sdkdir}/dri.h],
 
85
                      [have_dri_h="yes"], [have_dri_h="no"])
 
86
        AC_CHECK_FILE([${sdkdir}/sarea.h],
 
87
                      [have_sarea_h="yes"], [have_sarea_h="no"])
 
88
        AC_CHECK_FILE([${sdkdir}/dristruct.h],
 
89
                      [have_dristruct_h="yes"], [have_dristruct_h="no"])
 
90
        AC_CHECK_FILE([${sdkdir}/damage.h],
 
91
                      [have_damage_h="yes"], [have_damage_h="no"])
 
92
fi
 
93
 
 
94
AC_MSG_CHECKING([whether to include DRI support])
 
95
if test x$DRI = xauto; then
 
96
        if test "$have_dri_h" = yes -a \
 
97
                "$have_sarea_h" = yes -a \
 
98
                "$have_dristruct_h" = yes; then
 
99
                DRI="yes"
 
100
        else
 
101
                DRI="no"
 
102
        fi
 
103
fi
 
104
AC_MSG_RESULT([$DRI])
 
105
 
 
106
AM_CONDITIONAL(DRI, test x$DRI = xyes)
 
107
if test "$DRI" = yes; then
 
108
        PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto])
 
109
        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
 
110
        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
 
111
fi
 
112
 
 
113
# Note that this is sort of inverted from drivers/ati/Imakefile in
 
114
# the monolith.  We test for foo, not for !foo (i.e. ATMISC_CPIO, not
 
115
# ATIMISC_AVOID_CPIO), but the defines are negative.  So beware.  Oh yeah,
 
116
# TV_OUT is the special case where it's a positive define, not AVOID_TV_OUT.
 
117
 
 
118
# AVOID_CPIO: Only x86, amd64, and alpha are cool with CPIO.  It needs a
 
119
# little-endian, undirected PIO space of at least 64kB.
 
120
# AVOID_DGA: ???
 
121
# ATI_TV_OUT: This only works on x86.
 
122
 
 
123
ATIMISC_CPIO=no
 
124
ATIMISC_DGA=yes
 
125
ATIMISC_TV_OUT=no
 
126
 
 
127
case $host_cpu in
 
128
  i*86)
 
129
    ATIMISC_TV_OUT=yes
 
130
    ATIMISC_CPIO=yes
 
131
    ;;
 
132
  x86_64|amd64|alpha|ia64)
 
133
    ATIMISC_CPIO=yes
 
134
    ;;
 
135
  sparc)
 
136
    ATIMISC_DGA=no
 
137
    ;;
 
138
  *)
 
139
    ;;
 
140
esac
 
141
 
 
142
AC_MSG_CHECKING([whether to include PIO support])
 
143
AM_CONDITIONAL(ATIMISC_CPIO, test "x$ATIMISC_CPIO" = xyes)
 
144
if test "x$ATIMISC_CPIO" = xyes; then
 
145
        AC_MSG_RESULT([yes, PIO])
 
146
else
 
147
        AC_DEFINE(AVOID_CPIO, 1, [Avoid PIO and use MMIO for atimisc.])
 
148
        AC_MSG_RESULT([no, MMIO])
 
149
fi
 
150
 
 
151
AC_MSG_CHECKING([whether to include DGA support])
 
152
AC_MSG_RESULT([$ATIMISC_DGA])
 
153
AM_CONDITIONAL(ATIMISC_DGA, test "x$ATIMISC_DGA" = xyes)
 
154
if ! test "x$ATIMISC_DGA" = xyes; then
 
155
        AC_DEFINE(AVOID_DGA, 1, [Do not build DGA support.])
 
156
fi
 
157
 
 
158
AC_MSG_CHECKING([whether to include TV Out support])
 
159
AC_MSG_RESULT([$ATIMISC_TV_OUT])
 
160
AM_CONDITIONAL(ATIMISC_TV_OUT, test "x$ATIMISC_TV_OUT" = xyes)
 
161
if test "x$ATIMISC_TV_OUT" = xyes; then
 
162
        AC_DEFINE(TV_OUT, 1, [Build TV-Out support for atimisc.])
 
163
fi
 
164
 
 
165
# Properly handle EXA.
 
166
AC_MSG_CHECKING([whether to enable EXA support])
 
167
if test "x$EXA" = xyes; then
 
168
        AC_MSG_RESULT(yes)
 
169
 
 
170
        SAVE_CPPFLAGS="$CPPFLAGS"
 
171
        CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
 
172
        AC_CHECK_HEADER(exa.h,
 
173
                       [have_exa_h="yes"], [have_exa_h="no"])
 
174
        CPPFLAGS="$SAVE_CPPFLAGS"
 
175
else
 
176
        AC_MSG_RESULT(no)
 
177
fi 
 
178
 
 
179
SAVE_CPPFLAGS="$CPPFLAGS"
 
180
CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
 
181
if test "x$have_exa_h" = xyes; then
 
182
        AC_MSG_CHECKING([whether EXA version is at least 2.0.0])
 
183
        AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
 
184
#include "exa.h"
 
185
#if EXA_VERSION_MAJOR < 2
 
186
#error OLD EXA!
 
187
#endif
 
188
                          ]])],
 
189
                          [USE_EXA=yes],
 
190
                          [USE_EXA=no])
 
191
        AC_MSG_RESULT($USE_EXA)
 
192
 
 
193
        if test "x$USE_EXA" = xyes; then
 
194
                AC_DEFINE(USE_EXA, 1, [Build support for Exa])
 
195
        fi
 
196
fi
 
197
 
 
198
AC_ARG_ENABLE(xaa,
 
199
              AS_HELP_STRING([--enable-xaa],
 
200
                             [Enable legacy X Acceleration Architecture (XAA) [default=auto]]),
 
201
              [XAA="$enableval"],
 
202
              [XAA=auto])
 
203
if test "x$XAA" != xno; then
 
204
        save_CFLAGS=$CFLAGS
 
205
        save_CPPFLAGS=$CPPFLAGS
 
206
        CFLAGS=$XORG_CFLAGS
 
207
        CPPFLAGS="$XORG_CFLAGS"
 
208
        AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no)
 
209
        CFLAGS=$save_CFLAGS
 
210
        CPPFLAGS=$save_CPPFLAGS
 
211
fi
 
212
AC_MSG_CHECKING([whether to include XAA support])
 
213
AM_CONDITIONAL(XAA, test "x$XAA" = xyes)
 
214
if test "x$XAA" = xyes; then
 
215
        AC_DEFINE(USE_XAA, test "x$XAA" = xyes, [Build support for XAA])
 
216
fi
 
217
AC_MSG_RESULT([$XAA])
 
218
 
 
219
AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
 
220
              [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
 
221
              [#include "xorg-server.h"])
 
222
 
 
223
CPPFLAGS="$SAVE_CPPFLAGS"
 
224
 
 
225
AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes)
 
226
 
 
227
if test "x$XSERVER_LIBPCIACCESS" = xyes; then
 
228
    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.12.901])
 
229
    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 
230
fi
 
231
AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
 
232
 
 
233
AC_SUBST([moduledir])
 
234
 
 
235
DRIVER_NAME=mach64
 
236
AC_SUBST([DRIVER_NAME])
 
237
 
 
238
AC_MSG_NOTICE(
 
239
[Please change the Driver line in xorg.conf from "ati" to "mach64"]
 
240
[ or install the ati wrapper as well:]
 
241
[    git://anongit.freedesktop.org/git/xorg/driver/xf86-video-ati]
 
242
)
 
243
 
 
244
AC_CONFIG_FILES([
 
245
                Makefile
 
246
                src/Makefile
 
247
                man/Makefile
 
248
])
 
249
AC_OUTPUT