configure.ac revision 8bf5c682
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 24AC_PREREQ([2.60]) 25AC_INIT([xf86-video-ati], 26 [18.0.0], 27 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/Radeon], 28 [xf86-video-ati]) 29 30AC_CONFIG_SRCDIR([Makefile.am]) 31AC_CONFIG_HEADERS([config.h]) 32AC_CONFIG_MACRO_DIRS([m4]) 33 34AC_CONFIG_AUX_DIR(.) 35 36# Initialize Automake 37AM_INIT_AUTOMAKE([foreign dist-bzip2]) 38AC_SYS_LARGEFILE 39 40# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS 41m4_ifndef([XORG_MACROS_VERSION], 42 [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) 43XORG_MACROS_VERSION(1.8) 44XORG_DEFAULT_OPTIONS 45 46# Initialize libtool 47AC_DISABLE_STATIC 48AC_PROG_LIBTOOL 49 50# Checks for programs. 51AM_PROG_CC_C_O 52 53if test "x$GCC" = "xyes"; then 54 CPPFLAGS="$CPPFLAGS -Wall" 55fi 56 57AH_TOP([#include "xorg-server.h"]) 58 59# Define a configure option for an alternate module directory 60AC_ARG_WITH(xorg-module-dir, 61 AS_HELP_STRING([--with-xorg-module-dir=DIR], 62 [Default xorg module directory [[default=$libdir/xorg/modules]]]), 63 [moduledir="$withval"], 64 [moduledir="$libdir/xorg/modules"]) 65 66# Store the list of server defined optional extensions in REQUIRED_MODULES 67XORG_DRIVER_CHECK_EXT(RANDR, randrproto) 68XORG_DRIVER_CHECK_EXT(RENDER, renderproto) 69XORG_DRIVER_CHECK_EXT(XV, videoproto) 70XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) 71 72# Checks for libraries. 73PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.78]) 74PKG_CHECK_MODULES(LIBDRM_RADEON, [libdrm_radeon]) 75 76# Obtain compiler/linker options for the driver dependencies 77PKG_CHECK_MODULES(XORG, [xorg-server >= 1.13 xproto fontsproto xf86driproto $REQUIRED_MODULES]) 78PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], 79 HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]), 80 HAVE_XEXTPROTO_71="no") 81AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) 82 83# Section "OutputClass" is only supported as of xserver 1.16 84PKG_CHECK_EXISTS([xorg-server >= 1.16], 85 [sysconfigdir=`$PKG_CONFIG --variable=sysconfigdir xorg-server`], 86 [sysconfigdir=""]) 87AM_CONDITIONAL(HAS_XORG_CONF_DIR, [test "x$sysconfigdir" != "x"]) 88 89# Define a configure option for an alternate X Server configuration directory 90AC_ARG_WITH(xorg-conf-dir, 91 AS_HELP_STRING([--with-xorg-conf-dir=DIR], 92 [Default xorg.conf.d directory [[default=${prefix}/share/X11/xorg.conf.d]]]), 93 [configdir="$withval"], 94 [configdir='${prefix}/share/X11/xorg.conf.d']) 95AC_SUBST(configdir) 96 97AC_ARG_ENABLE([udev], 98 AS_HELP_STRING([--disable-udev], [Disable libudev support [default=auto]]), 99 [enable_udev="$enableval"], 100 [enable_udev=auto]) 101if test "x$enable_udev" != "xno"; then 102 PKG_CHECK_MODULES(LIBUDEV, [libudev], [LIBUDEV=yes], [LIBUDEV=no]) 103 if test "x$LIBUDEV" = xyes; then 104 AC_DEFINE(HAVE_LIBUDEV, 1,[libudev support]) 105 elif test "x$enable_udev" != "xauto"; then 106 AC_MSG_ERROR([Building with udev requested but libudev not found]) 107 fi 108fi 109AM_CONDITIONAL(LIBUDEV, test x$LIBUDEV = xyes) 110 111SAVE_CPPFLAGS="$CPPFLAGS" 112CPPFLAGS="$CPPFLAGS $XORG_CFLAGS" 113 114AC_MSG_CHECKING([whether to include GLAMOR support]) 115AC_ARG_ENABLE(glamor, 116 AS_HELP_STRING([--disable-glamor], 117 [Disable glamor, a new GL-based acceleration [default=enabled]]), 118 [GLAMOR="$enableval"], 119 [GLAMOR=yes]) 120 121if test "x$GLAMOR" != "xno"; then 122 AC_CHECK_HEADERS([glamor.h], [GLAMOR_H="yes"], [GLAMOR_H="no"], [#include "xorg-server.h"]) 123 124 if test "x$GLAMOR_H" = xyes; then 125 AC_CHECK_DECL(GLAMOR_NO_DRI3, 126 [GLAMOR_XSERVER="yes"], [GLAMOR_XSERVER="no"], 127 [#include "xorg-server.h" 128 #include "glamor.h"]) 129 130 AC_CHECK_DECL(glamor_glyphs_init, 131 [AC_DEFINE(HAVE_GLAMOR_GLYPHS_INIT, 1, 132 [Have glamor_glyphs_init API])], [], 133 [#include "xorg-server.h" 134 #include "glamor.h"]) 135 136 AC_CHECK_DECL(glamor_egl_destroy_textured_pixmap, 137 [AC_DEFINE(HAVE_GLAMOR_EGL_DESTROY_TEXTURED_PIXMAP, 1, 138 [Have glamor_egl_destroy_textured_pixmap API])], [], 139 [#include "xorg-server.h" 140 #include "glamor.h"]) 141 fi 142 143 if test "x$GLAMOR_XSERVER" != xyes; then 144 PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0]) 145 PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl]) 146 fi 147 AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration]) 148else 149 AC_MSG_RESULT([$GLAMOR]) 150fi 151AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno) 152 153AC_CHECK_DECL(RegionDuplicate, 154 [AC_DEFINE(HAVE_REGIONDUPLICATE, 1, 155 [Have RegionDuplicate API])], [], 156 [#include <xorg-server.h> 157 #include <regionstr.h>]) 158 159AC_CHECK_DECL(fbGlyphs, 160 [AC_DEFINE(HAVE_FBGLYPHS, 1, [Have fbGlyphs API])], [], 161 [#include <X11/Xmd.h> 162 #include <X11/Xfuncproto.h> 163 #include <X11/extensions/renderproto.h> 164 #include <xorg-server.h> 165 #include <picture.h> 166 #include <glyphstr.h> 167 #include <fbpict.h>]) 168 169AC_CHECK_DECL(xf86CursorResetCursor, 170 [AC_DEFINE(HAVE_XF86_CURSOR_RESET_CURSOR, 1, 171 [Have xf86CursorResetCursor API])], [], 172 [#include <xorg-server.h> 173 #include <xf86Cursor.h>]) 174 175AC_CHECK_HEADERS([misyncshm.h], [], [], 176 [#include <X11/Xdefs.h> 177 #include <X11/Xfuncproto.h> 178 #include <xorg-server.h> 179 #include <screenint.h>]) 180 181AC_CHECK_HEADERS([present.h], [], [], 182 [#include <X11/Xmd.h> 183 #include <X11/Xproto.h> 184 #include "xorg-server.h" 185 #include <X11/X.h>]) 186 187AC_CHECK_HEADERS([dri3.h], [], [], 188 [#include <X11/Xmd.h> 189 #include <xorg-server.h>]) 190 191CPPFLAGS="$SAVE_CPPFLAGS" 192 193PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0]) 194XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" 195 196# Checks for headers/macros for byte swapping 197# Known variants: 198# <byteswap.h> bswap_16, bswap_32, bswap_64 (glibc) 199# <sys/endian.h> __swap16, __swap32, __swap64 (OpenBSD) 200# <sys/endian.h> bswap16, bswap32, bswap64 (other BSD's) 201# and a fallback to local macros if none of the above are found 202 203# if <byteswap.h> is found, assume it's the correct version 204AC_CHECK_HEADERS([byteswap.h]) 205 206# if <sys/endian.h> is found, have to check which version 207AC_CHECK_HEADER([sys/endian.h], [HAVE_SYS_ENDIAN_H="yes"], [HAVE_SYS_ENDIAN_H="no"]) 208 209if test "x$HAVE_SYS_ENDIAN_H" = "xyes" ; then 210 AC_MSG_CHECKING([for __swap16 variant of <sys/endian.h> byteswapping macros]) 211 AC_LINK_IFELSE([AC_LANG_PROGRAM([ 212#include <sys/types.h> 213#include <sys/endian.h> 214 ], [ 215int a = 1, b; 216b = __swap16(a); 217 ]) 218], [SYS_ENDIAN__SWAP='yes'], [SYS_ENDIAN__SWAP='no']) 219 AC_MSG_RESULT([$SYS_ENDIAN__SWAP]) 220 221 AC_MSG_CHECKING([for bswap16 variant of <sys/endian.h> byteswapping macros]) 222 AC_LINK_IFELSE([AC_LANG_PROGRAM([ 223#include <sys/types.h> 224#include <sys/endian.h> 225 ], [ 226int a = 1, b; 227b = bswap16(a); 228 ]) 229], [SYS_ENDIAN_BSWAP='yes'], [SYS_ENDIAN_BSWAP='no']) 230 AC_MSG_RESULT([$SYS_ENDIAN_BSWAP]) 231 232 if test "$SYS_ENDIAN_BSWAP" = "yes" ; then 233 USE_SYS_ENDIAN_H=yes 234 BSWAP=bswap 235 else 236 if test "$SYS_ENDIAN__SWAP" = "yes" ; then 237 USE_SYS_ENDIAN_H=yes 238 BSWAP=__swap 239 else 240 USE_SYS_ENDIAN_H=no 241 fi 242 fi 243 244 if test "$USE_SYS_ENDIAN_H" = "yes" ; then 245 AC_DEFINE([USE_SYS_ENDIAN_H], 1, 246 [Define to use byteswap macros from <sys/endian.h>]) 247 AC_DEFINE_UNQUOTED([bswap_16], ${BSWAP}16, 248 [Define to 16-bit byteswap macro]) 249 AC_DEFINE_UNQUOTED([bswap_32], ${BSWAP}32, 250 [Define to 32-bit byteswap macro]) 251 AC_DEFINE_UNQUOTED([bswap_64], ${BSWAP}64, 252 [Define to 64-bit byteswap macro]) 253 fi 254fi 255 256AC_SUBST([moduledir]) 257 258DRIVER_NAME=ati 259AC_SUBST([DRIVER_NAME]) 260 261AC_MSG_NOTICE( 262[The atimisc sub-driver has been split out to xf86-video-mach64:] 263[ git://anongit.freedesktop.org/git/xorg/driver/xf86-video-mach64] 264[Please install that driver as well for mach64-based cards.] 265) 266 267AC_MSG_NOTICE( 268[The r128 sub-driver has been split out to xf86-video-r128:] 269[ git://anongit.freedesktop.org/git/xorg/driver/xf86-video-r128] 270[Please install that driver as well for rage128-based cards.] 271) 272 273AC_CONFIG_FILES([ 274 Makefile 275 src/Makefile 276 man/Makefile 277 conf/Makefile 278]) 279AC_OUTPUT 280 281dnl 282dnl Output some configuration info for the user 283dnl 284echo "" 285echo " prefix: $prefix" 286echo " exec_prefix: $exec_prefix" 287echo " libdir: $libdir" 288echo " includedir: $includedir" 289echo " configdir: $configdir" 290 291echo "" 292echo " CFLAGS: $CFLAGS" 293echo " CXXFLAGS: $CXXFLAGS" 294echo " Macros: $DEFINES" 295 296echo "" 297echo " Run '${MAKE-make}' to build xf86-video-ati" 298echo "" 299