diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 392 |
1 files changed, 0 insertions, 392 deletions
diff --git a/configure.ac b/configure.ac deleted file mode 100644 index 4a8fec1..0000000 --- a/configure.ac +++ /dev/null | |||
@@ -1,392 +0,0 @@ | |||
1 | # Process this file with autoconf to produce a configure script | ||
2 | |||
3 | AC_PREREQ(2.57) | ||
4 | AC_INIT([xf86-video-radeonhd], | ||
5 | 1.3.0, | ||
6 | [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/radeonhd], | ||
7 | xf86-video-radeonhd) | ||
8 | |||
9 | AC_CONFIG_SRCDIR([Makefile.am]) | ||
10 | AM_CONFIG_HEADER([config.h]) | ||
11 | AC_CONFIG_AUX_DIR(.) | ||
12 | |||
13 | AM_INIT_AUTOMAKE([dist-bzip2]) | ||
14 | |||
15 | AM_MAINTAINER_MODE | ||
16 | |||
17 | AC_CONFIG_FILES([shave shave-libtool]) | ||
18 | |||
19 | |||
20 | # Program checks. | ||
21 | AC_DISABLE_STATIC | ||
22 | AC_PROG_CC | ||
23 | |||
24 | dnl Define SED var without requiring AC_PROG_SED (new in autoconf-2.59b) | ||
25 | m4_ifdef([AC_PROG_SED], [AC_PROG_SED], [AC_SUBST([SED], [${SED-sed}])]) | ||
26 | |||
27 | AC_MSG_CHECKING([whether $SED can substitute tabs and newlines for text]) | ||
28 | dnl One tab, a letter and two newlines | ||
29 | cat>sed-test.1<<EOF | ||
30 | y | ||
31 | |||
32 | EOF | ||
33 | echo x | sed 's/x/\ty\n/' > sed-test.2 | ||
34 | if cmp -s sed-test.1 sed-test.2; then | ||
35 | AC_MSG_RESULT([yes]) | ||
36 | else | ||
37 | AC_MSG_RESULT([no]) | ||
38 | fi | ||
39 | AM_CONDITIONAL([HAVE_SED_WITH_REASONABLE_SUBSTITUTION], [cmp -s sed-test.1 sed-test.2]) | ||
40 | rm -f sed-test.1 sed-test.2 | ||
41 | |||
42 | CXX=no | ||
43 | F77=no | ||
44 | AC_PROG_LIBTOOL | ||
45 | |||
46 | |||
47 | AH_TOP([#ifndef _CONFIG_H]) | ||
48 | AH_TOP([# define _CONFIG_H]) | ||
49 | AH_TOP([# include "xorg-server.h"]) | ||
50 | AH_BOTTOM([#endif]) | ||
51 | |||
52 | AC_ARG_WITH(xorg-module-dir, | ||
53 | AC_HELP_STRING([--with-xorg-module-dir=DIR], | ||
54 | [Default xorg module directory (default $libdir/xorg/modules)]), | ||
55 | [moduledir="$withval"], | ||
56 | [moduledir="$libdir/xorg/modules"]) | ||
57 | |||
58 | AC_ARG_ENABLE(exa, | ||
59 | AC_HELP_STRING([--disable-exa], | ||
60 | [Disable EXA support (default enabled)]), | ||
61 | [EXA="$enableval"], | ||
62 | [EXA=yes]) | ||
63 | |||
64 | AC_ARG_ENABLE(dri, | ||
65 | AC_HELP_STRING([--disable-dri], | ||
66 | [Disable DRI support (default enabled)]), | ||
67 | [DRI="$enableval"], | ||
68 | [DRI=yes]) | ||
69 | |||
70 | # Extensions checks. | ||
71 | m4_pattern_forbid([XORG_DRIVER_CHECK_EXT])dnl | ||
72 | XORG_DRIVER_CHECK_EXT(RANDR, randrproto) | ||
73 | XORG_DRIVER_CHECK_EXT(RENDER, renderproto) | ||
74 | XORG_DRIVER_CHECK_EXT(XV, videoproto) | ||
75 | XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) | ||
76 | # @@@@ We don't do DGA any more | ||
77 | |||
78 | # pkg-config packages checks | ||
79 | # @@@@ need to check for the right server version once RandR 1.2 is in. | ||
80 | # @@@ do we really need fontsproto here? | ||
81 | PKG_CHECK_MODULES(XORG, [xorg-server xproto fontsproto $REQUIRED_MODULES]) | ||
82 | PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], | ||
83 | HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]), | ||
84 | HAVE_XEXTPROTO_71="no") | ||
85 | AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) | ||
86 | sdkdir=$(pkg-config --variable=sdkdir xorg-server) | ||
87 | |||
88 | |||
89 | # Header files checks. | ||
90 | AC_HEADER_STDC | ||
91 | |||
92 | PKG_CHECK_MODULES(PCIUTILS, libpci,, | ||
93 | [AC_MSG_WARN([libpci not registered in pkgconfig, will guess instead]) | ||
94 | test "x$PCIUTILS_CFLAGS$PCIUTILS_LIBS" = "x" && PCIUTILS_LIBS="-lpci -lz" | ||
95 | ]) | ||
96 | |||
97 | SAVED_CPPFLAGS="$CPPFLAGS" | ||
98 | SAVED_CFLAGS="$CFLAGS" | ||
99 | CFLAGS="$CFLAGS $PCIUTILS_CFLAGS" | ||
100 | CPPFLAGS="$CPPFLAGS $PCIUTILS_CFLAGS" | ||
101 | AC_CHECK_HEADER([pci/pci.h], | ||
102 | [AC_DEFINE([HAVE_PCI_PCI_H], [1], | ||
103 | [Define to 1 if you have <pci/pci.h>.]) | ||
104 | have_pci_pci_h=yes], | ||
105 | [AC_MSG_WARN([Caution: Will not compile rhd_conntest without pciutils headers.])]) | ||
106 | AM_CONDITIONAL([HAVE_PCI_PCI_H], [test "x$have_pci_pci_h" = "xyes"]) | ||
107 | |||
108 | # Properly handle EXA. | ||
109 | CPPFLAGS="$SAVED_CPPFLAGS $XORG_CFLAGS" | ||
110 | CFLAGS="$SAVED_CFLAGS" | ||
111 | |||
112 | AC_CHECK_DECL(XSERVER_LIBPCIACCESS, | ||
113 | [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no], | ||
114 | [#include "xorg-server.h"]) | ||
115 | if test "x$XSERVER_LIBPCIACCESS" = xyes; then | ||
116 | PKG_CHECK_MODULES([PCIACCESS], [pciaccess]) | ||
117 | XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" | ||
118 | fi | ||
119 | AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes) | ||
120 | |||
121 | # basic exa check. | ||
122 | AC_MSG_CHECKING([whether to enable EXA support]) | ||
123 | if test "x$EXA" = xyes; then | ||
124 | AC_MSG_RESULT(yes) | ||
125 | AC_CHECK_HEADER(exa.h, | ||
126 | [have_exa_h="yes"], [have_exa_h="no"]) | ||
127 | else | ||
128 | AC_MSG_RESULT(no) | ||
129 | fi | ||
130 | |||
131 | # exa version check. | ||
132 | if test "x$have_exa_h" = xyes; then | ||
133 | AC_MSG_CHECKING([whether EXA version is at least 2.0.0]) | ||
134 | AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ | ||
135 | #include "exa.h" | ||
136 | #if EXA_VERSION_MAJOR < 2 | ||
137 | #error OLD EXA! | ||
138 | #endif | ||
139 | ]])], | ||
140 | [USE_EXA=yes], | ||
141 | [USE_EXA=no]) | ||
142 | AC_MSG_RESULT($USE_EXA) | ||
143 | |||
144 | if test "x$USE_EXA" = xyes; then | ||
145 | AC_DEFINE(USE_EXA, 1, [Build support for Exa]) | ||
146 | fi | ||
147 | fi | ||
148 | |||
149 | AM_CONDITIONAL(USE_EXA, test "x$USE_EXA" = xyes) | ||
150 | |||
151 | # Handle RandR1.2 | ||
152 | AC_CHECK_HEADER(xf86RandR12.h, [have_randr12="yes"], [have_randr12="no"], [#include <xf86.h>]) | ||
153 | if test "x$have_randr12" = xyes; then | ||
154 | AC_DEFINE(RANDR_12_SUPPORT, 1, [Build RandR 1.2 Support]) | ||
155 | fi | ||
156 | |||
157 | AC_MSG_CHECKING([whether to enable RandR1.2 support]) | ||
158 | AC_MSG_RESULT($have_randr12) | ||
159 | |||
160 | # Handle DRI | ||
161 | CPPFLAGS="$SAVED_CPPFLAGS $XORG_CFLAGS" | ||
162 | CFLAGS="$SAVED_CFLAGS $XORG_CFLAGS" | ||
163 | |||
164 | # basic dri check. | ||
165 | USE_DRI=no | ||
166 | if test "x$DRI" = xyes; then | ||
167 | USE_DRI="yes" | ||
168 | AC_CHECK_DECL(XF86DRI,, [USE_DRI=no], [#include <xorg-server.h>]) | ||
169 | XORG_CFLAGS="$XORG_CFLAGS $DRI_CFLAGS" | ||
170 | PKG_CHECK_MODULES(DRI, [libdrm >= 2.2 xf86driproto glproto],, [USE_DRI=no]) | ||
171 | fi | ||
172 | |||
173 | AC_MSG_CHECKING([whether to enable DRI support]) | ||
174 | AC_MSG_RESULT($USE_DRI) | ||
175 | AM_CONDITIONAL(USE_DRI, test "x$USE_DRI" = xyes) | ||
176 | |||
177 | if test "x$USE_DRI" = "xyes"; then | ||
178 | AC_DEFINE(USE_DRI, 1, [Build support for DRI]) | ||
179 | CFLAGS="$CFLAGS $DRI_CFLAGS" | ||
180 | CPPFLAGS="$CPPFLAGS $DRI_CFLAGS" | ||
181 | AC_CHECK_HEADER([xf86drmMode.h], | ||
182 | [AC_DEFINE([HAVE_XF86DRMMODE_H], [1], | ||
183 | [Define to 1 if you have xf86drmMode.h])]) | ||
184 | fi | ||
185 | |||
186 | AC_CHECK_FILE([${sdkdir}/damage.h], | ||
187 | [AC_DEFINE(DAMAGE,1,[Use Damage extension])], []) | ||
188 | |||
189 | # check for xf86_ansic.h | ||
190 | CFLAGS="$SAVED_CFLAGS" | ||
191 | CPPFLAGS="$SAVED_CPPFLAGS" | ||
192 | |||
193 | AC_CHECK_HEADER([${sdkdir}/xf86_ansic.h], | ||
194 | [AC_DEFINE([HAVE_XF86_ANSIC_H], [1], | ||
195 | [Define to 1 if you have <${sdkdir}/xf86_ansic.h>.]) | ||
196 | have_xf86_ansic_h=yes]) | ||
197 | AM_CONDITIONAL([HAVE_XF86_ANSIC_H], [test "x$have_xf86_ansic_h" = "xyes"]) | ||
198 | |||
199 | SAVED_CFLAGS="$CFLAGS" | ||
200 | CFLAGS="$CFLAGS $XORG_CFLAGS" | ||
201 | |||
202 | # Check whether MonRec has a reducedblanking member. | ||
203 | AC_CHECK_MEMBER([MonRec.reducedblanking], | ||
204 | [MONREC_HAS_REDUCED=yes], [MONREC_HAS_REDUCED=no], | ||
205 | [#include "${sdkdir}/xf86.h"]) | ||
206 | if test "x$MONREC_HAS_REDUCED" = xyes; then | ||
207 | AC_DEFINE(MONREC_HAS_REDUCED, 1, [MonRec has member reducedblanking]) | ||
208 | fi | ||
209 | |||
210 | # Check whether MonRec has a maxPixClock member. | ||
211 | AC_CHECK_MEMBER([MonRec.maxPixClock], | ||
212 | [MONREC_HAS_BANDWIDTH=yes], [MONREC_HAS_BANDWIDTH=no], | ||
213 | [#include "${sdkdir}/xf86.h"]) | ||
214 | if test "x$MONREC_HAS_BANDWIDTH" = xyes; then | ||
215 | AC_DEFINE(MONREC_HAS_BANDWIDTH, 1, [MonRec has member maxPixClock]) | ||
216 | fi | ||
217 | |||
218 | # Check whether xf86CrtcFuncsRec has a set_mode_major member. | ||
219 | AC_CHECK_MEMBER([xf86CrtcFuncsRec.set_mode_major], | ||
220 | [XF86CRTCFUNCS_HAS_SETMODEMAJOR=yes], [XF86CRTCFUNCS_HAS_SETMODEMAJOR=no], | ||
221 | [#include "${sdkdir}/xorg-server.h" | ||
222 | #include "${sdkdir}/xf86.h" | ||
223 | #include "${sdkdir}/xf86Crtc.h"]) | ||
224 | if test "x$XF86CRTCFUNCS_HAS_SETMODEMAJOR" = xyes; then | ||
225 | AC_DEFINE(XF86CRTCFUNCS_HAS_SETMODEMAJOR, 1, [xf86CrtcFuncsRec has member set_mode_major]) | ||
226 | fi | ||
227 | |||
228 | AC_CHECK_DECL(xf86RotateFreeShadow, | ||
229 | [AC_DEFINE(HAVE_FREE_SHADOW, 1, [have RotateFreeShadow API])], | ||
230 | [], | ||
231 | [#include <xorg-server.h> | ||
232 | #include <windowstr.h> | ||
233 | #include <xf86Crtc.h>]) | ||
234 | |||
235 | AC_CHECK_DECL(pci_device_enable, | ||
236 | [AC_DEFINE(HAVE_PCI_DEVICE_ENABLE, 1, [Have pci_device_enable prototype])], | ||
237 | [], | ||
238 | [#include <pciaccess.h>]) | ||
239 | |||
240 | CFLAGS="$SAVED_CFLAGS" | ||
241 | |||
242 | AC_ARG_ENABLE(atombios, AC_HELP_STRING([--disable-atombios], | ||
243 | [Disable AtomBIOS support [[default=no]]]), | ||
244 | [do_atombios="$enableval"], | ||
245 | [do_atombios=yes]) | ||
246 | |||
247 | AC_ARG_ENABLE(atombios-parser, AC_HELP_STRING([--disable-atombios-parser], | ||
248 | [Disable AtomBIOS parser support [[default=no]]]), | ||
249 | [do_atombios_parser="$enableval"], | ||
250 | [do_atombios_parser=yes]) | ||
251 | |||
252 | AC_CHECK_FILE([${srcdir}/src/AtomBios/includes/atombios.h], | ||
253 | [have_atombios_h="yes"], [have_atombios_h="no"]) | ||
254 | |||
255 | AC_CHECK_FILE([${srcdir}/src/AtomBios/includes/Decoder.h], | ||
256 | [have_atombios_parser="yes"], [have_atombios_parser="no"]) | ||
257 | |||
258 | AC_MSG_CHECKING([whether to include AtomBIOS]) | ||
259 | if test "$have_atombios_h" = yes -a \ | ||
260 | "$do_atombios" = yes; then | ||
261 | support_atombios="yes" | ||
262 | AC_DEFINE(ATOM_BIOS, 1, [Add support for AtomBIOS tables]) | ||
263 | else | ||
264 | support_atombios="no" | ||
265 | fi | ||
266 | |||
267 | AC_MSG_RESULT([$support_atombios]) | ||
268 | |||
269 | AC_MSG_CHECKING([whether to include AtomBIOS parser]) | ||
270 | if test "$support_atombios" = yes -a \ | ||
271 | "$do_atombios_parser" = yes -a \ | ||
272 | "$have_atombios_parser" = yes; then | ||
273 | support_atombios_parser="yes" | ||
274 | AC_DEFINE(ATOM_BIOS_PARSER, 1, [Add support for AtomBIOS code]) | ||
275 | else | ||
276 | support_atombios_parser="no" | ||
277 | fi | ||
278 | |||
279 | AC_MSG_RESULT([$support_atombios_parser]) | ||
280 | |||
281 | AM_CONDITIONAL(ATOM_BIOS, test x$support_atombios = xyes) | ||
282 | |||
283 | AM_CONDITIONAL(ATOM_BIOS_PARSER, test x$support_atombios_parser = xyes) | ||
284 | |||
285 | # libraries checks. | ||
286 | AC_CHECK_LIB([z], [gzopen], [have_zlib=yes], [have_zlib=no]) | ||
287 | AM_CONDITIONAL([HAVE_ZLIB], [test "x$have_zlib" = "xyes"]) | ||
288 | |||
289 | # compiler flags | ||
290 | |||
291 | dnl AC_PROG_CC_FLAG(flag,action-if-found,action-if-not-found) | ||
292 | AC_DEFUN([AC_PROG_CC_FLAG],[ | ||
293 | AC_LANG_CONFTEST([AC_LANG_PROGRAM([[]])]) | ||
294 | AC_MSG_CHECKING([whether $CC supports $1]) | ||
295 | if $CC $1 -c -o /dev/null conftest.c >/dev/null 2>&1 ; then | ||
296 | AC_MSG_RESULT([yes]) | ||
297 | $2 | ||
298 | else | ||
299 | AC_MSG_RESULT([no]) | ||
300 | $3 | ||
301 | fi | ||
302 | ]) | ||
303 | |||
304 | # Extra Warnings | ||
305 | # Due to xorg/os.h: -Wno-variadic-macros | ||
306 | # For testing: make CFLAGS="-O2 -Wshadow -Wunreachable-code -fno-inline-functions" | ||
307 | WARN_CFLAGS="" | ||
308 | for w in \ | ||
309 | -Wall \ | ||
310 | -Wextra -Wno-unused-parameter \ | ||
311 | -Werror-implicit-function-declaration \ | ||
312 | -Wstrict-aliasing -Wstrict-overflow \ | ||
313 | -Wpointer-arith -Woverlength-strings -Wvolatile-register-var \ | ||
314 | -Winit-self -Wbad-function-cast \ | ||
315 | -Wstrict-prototypes -Wold-style-definition \ | ||
316 | -Wnested-externs -Wdisabled-optimization \ | ||
317 | -Wno-unknown-pragmas ; | ||
318 | do | ||
319 | AC_PROG_CC_FLAG($w,[WARN_CFLAGS="$WARN_CFLAGS $w"],) | ||
320 | done | ||
321 | |||
322 | # atombios.h prohibits -std=c99 due to unnamed unions | ||
323 | PEDANTIC_CFLAGS="" | ||
324 | for w in -Wno-long-long -Wno-variadic-macros ; do | ||
325 | AC_PROG_CC_FLAG($w,[PEDANTIC_CFLAGS="$PEDANTIC_CFLAGS $w"],) | ||
326 | done | ||
327 | |||
328 | # AtomBios special flags | ||
329 | ATOMBIOS_CFLAGS="" | ||
330 | for w in -Wno-unknown-pragmas ; do | ||
331 | AC_PROG_CC_FLAG($w,[ATOMBIOS_CFLAGS="$ATOMBIOS_CFLAGS $w"],) | ||
332 | done | ||
333 | |||
334 | # Optimizations | ||
335 | case "x$CFLAGS" in | ||
336 | dnl Automake needs extra escaping | ||
337 | [*-O[2-9]*)] | ||
338 | AC_MSG_NOTICE([Doing optimized build, checking for additional options]) | ||
339 | for w in -finline-functions ; do | ||
340 | AC_PROG_CC_FLAG($w,[CFLAGS="$CFLAGS -finline-functions"],) | ||
341 | done | ||
342 | ;; | ||
343 | esac | ||
344 | |||
345 | # Substitute | ||
346 | |||
347 | AC_SUBST([PCIUTILS_CFLAGS]) | ||
348 | AC_SUBST([PCIUTILS_LIBS]) | ||
349 | AC_SUBST([XORG_CFLAGS]) | ||
350 | AC_SUBST([DRI_CFLAGS]) | ||
351 | AC_SUBST([WARN_CFLAGS]) | ||
352 | AC_SUBST([PEDANTIC_CFLAGS]) | ||
353 | AC_SUBST([ATOMBIOS_CFLAGS]) | ||
354 | AC_SUBST([RANDR_VERSION],[`pkg-config --modversion randrproto`]) | ||
355 | AC_SUBST([moduledir]) | ||
356 | |||
357 | DRIVER_NAME=radeonhd | ||
358 | AC_SUBST([DRIVER_NAME]) | ||
359 | |||
360 | m4_pattern_forbid([XORG_MANPAGE_SECTIONS])dnl | ||
361 | XORG_MANPAGE_SECTIONS | ||
362 | m4_pattern_forbid([XORG_RELEASE_VERSION])dnl | ||
363 | XORG_RELEASE_VERSION | ||
364 | |||
365 | dnl These are also defined in XORG_RELEASE_VERSION since 2006-11-30. | ||
366 | dnl So we check whether XORG_RELEASE_VERSION has already done this | ||
367 | dnl for us. | ||
368 | if test "x$PVM$PVP" = "x"; then | ||
369 | AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], | ||
370 | [$(echo $PACKAGE_VERSION | cut -d . -f 1)], | ||
371 | [Major Version]) | ||
372 | AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MINOR], | ||
373 | [$(echo $PACKAGE_VERSION | cut -d . -f 2)], | ||
374 | [Minor Version]) | ||
375 | AC_DEFINE_UNQUOTED([PACKAGE_VERSION_PATCHLEVEL], | ||
376 | [$(echo $PACKAGE_VERSION | cut -d . -f 3)], | ||
377 | [Patchlevel Version]) | ||
378 | fi | ||
379 | |||
380 | SHAVE_INIT(.,enable) | ||
381 | |||
382 | AC_OUTPUT([ | ||
383 | Makefile | ||
384 | man/Makefile | ||
385 | src/Makefile | ||
386 | utils/conntest/Makefile | ||
387 | ]) | ||
388 | if test "x$USE_DRI" != xyes ; then | ||
389 | echo "" | ||
390 | echo "NOTE: DRI support is disabled" | ||
391 | echo "" | ||
392 | fi | ||