configure.ac revision fa225cbc
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-intel], 25 2.9.1, 26 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], 27 xf86-video-intel) 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 37AC_CONFIG_FILES([ 38 shave 39 shave-libtool 40]) 41 42# Checks for programs. 43AC_DISABLE_STATIC 44AC_PROG_LIBTOOL 45DOLT 46AC_PROG_CC 47AM_PROG_CC_C_O 48 49PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.0], [gen4asm=yes], [gen4asm=no]) 50AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes) 51 52AC_CHECK_HEADERS(sys/mman.h) 53AC_CHECK_FUNCS(mprotect) 54 55AH_TOP([#include "xorg-server.h"]) 56 57AC_ARG_WITH(xorg-module-dir, 58 AC_HELP_STRING([--with-xorg-module-dir=DIR], 59 [Default xorg module directory [[default=$libdir/xorg/modules]]]), 60 [moduledir="$withval"], 61 [moduledir="$libdir/xorg/modules"]) 62 63AC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri], 64 [Disable DRI support [[default=auto]]]), 65 [DRI="$enableval"], 66 [DRI=auto]) 67 68AC_ARG_ENABLE(video-debug, AC_HELP_STRING([--enable-video-debug], 69 [Enable video debugging support [[default=no]]]), 70 [VIDEO_DEBUG="$enableval"], 71 [VIDEO_DEBUG=no]) 72 73AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], 74 [Compile with debug support [[default=yes]]])) 75if test "x$enableval" == "xyes" ; then 76 DEBUGFLAGS="-g" 77else 78 DEBUGFLAGS="" 79fi 80 81AC_ARG_ENABLE(xvmc, AC_HELP_STRING([--disable-xvmc], 82 [Disable XvMC support [[default=yes]]]), 83 [XVMC="$enableval"], 84 [XVMC=yes]) 85 86AC_ARG_ENABLE(kms-only, AC_HELP_STRING([--enable-kms-only], 87 [Assume KMS support [[default=no]]]), 88 [KMS_ONLY="$enableval"], 89 [KMS_ONLY=no]) 90 91# Checks for extensions 92XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto) 93XORG_DRIVER_CHECK_EXT(RANDR, randrproto) 94XORG_DRIVER_CHECK_EXT(RENDER, renderproto) 95XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11) 96XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) 97 98# Checks for pkg-config packages 99PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6 xproto fontsproto $REQUIRED_MODULES]) 100PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1], 101 HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]), 102 HAVE_XEXTPROTO_71="no") 103AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) 104 105sdkdir=$(pkg-config --variable=sdkdir xorg-server) 106drm_cflags=$(pkg-config --cflags libdrm) 107 108# Checks for libraries. 109 110# Checks for header files. 111AC_HEADER_STDC 112 113save_CFLAGS="$CFLAGS" 114CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $drm_cflags" 115CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS $drm_cflags" 116AC_MSG_CHECKING([whether to include DRI support]) 117if test x$DRI != xno; then 118 AC_CHECK_FILE([${sdkdir}/dri.h], 119 [have_dri_h="yes"], [have_dri_h="no"]) 120 AC_CHECK_FILE([${sdkdir}/sarea.h], 121 [have_sarea_h="yes"], [have_sarea_h="no"]) 122 AC_CHECK_FILE([${sdkdir}/dristruct.h], 123 [have_dristruct_h="yes"], [have_dristruct_h="no"]) 124fi 125AC_MSG_CHECKING([whether to include DRI support]) 126if test x$DRI = xauto; then 127 if test "$have_dri_h" = yes -a \ 128 "$have_sarea_h" = yes -a \ 129 "$have_dristruct_h" = yes; then 130 DRI="yes" 131 else 132 DRI="no" 133 fi 134fi 135AC_MSG_RESULT([$DRI]) 136CFLAGS="$save_CFLAGS $DEBUGFLAGS" 137 138PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10]) 139 140dnl Use lots of warning flags with GCC 141 142WARN_CFLAGS="" 143 144if test "x$GCC" = "xyes"; then 145 WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \ 146 -Wmissing-prototypes -Wmissing-declarations \ 147 -Wnested-externs -fno-strict-aliasing" 148fi 149 150PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.11]) 151AM_CONDITIONAL(DRI, test x$DRI = xyes) 152if test "$DRI" = yes; then 153 PKG_CHECK_MODULES(DRI, [xf86driproto glproto]) 154 AC_DEFINE(XF86DRI,1,[Enable DRI driver support]) 155 AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support]) 156fi 157 158AM_CONDITIONAL(VIDEO_DEBUG, test x$VIDEO_DEBUG = xyes) 159if test "$VIDEO_DEBUG" = yes; then 160 AC_DEFINE(VIDEO_DEBUG,1,[Enable debug support]) 161fi 162 163if test "$XVMC" = yes; then 164 PKG_CHECK_MODULES(XVMCLIB, [xvmc xext xfixes dri2proto], [XVMC=yes], [XVMC=no]) 165fi 166AC_MSG_CHECKING([whether to include XvMC support]) 167AC_MSG_RESULT([$XVMC]) 168AM_CONDITIONAL(XVMC, test x$XVMC = xyes) 169if test "$XVMC" = yes; then 170 AC_DEFINE(ENABLE_XVMC,1,[Enable XvMC support]) 171 AC_SUBST([XVMCLIB_CFLAGS]) 172fi 173 174AM_CONDITIONAL(KMS_ONLY, test x$KMS_ONLY = xyes) 175if test "$KMS_ONLY" = yes; then 176 AC_DEFINE(KMS_ONLY,1,[Assume KMS support]) 177fi 178 179AC_SUBST([DRI_CFLAGS]) 180AC_SUBST([XORG_CFLAGS]) 181AC_SUBST([WARN_CFLAGS]) 182AC_SUBST([moduledir]) 183 184DRIVER_NAME=intel 185AC_SUBST([DRIVER_NAME]) 186 187m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1.3 or later before running autoconf/autogen])]) 188XORG_MACROS_VERSION(1.1.3) 189XORG_MANPAGE_SECTIONS 190XORG_RELEASE_VERSION 191 192XORG_CHECK_LINUXDOC 193 194SHAVE_INIT([.], [enable]) 195 196AC_OUTPUT([ 197 Makefile 198 uxa/Makefile 199 src/Makefile 200 src/xvmc/Makefile 201 src/xvmc/shader/Makefile 202 src/xvmc/shader/mc/Makefile 203 src/xvmc/shader/vld/Makefile 204 src/bios_reader/Makefile 205 src/ch7017/Makefile 206 src/ch7xxx/Makefile 207 src/ivch/Makefile 208 src/reg_dumper/Makefile 209 src/sil164/Makefile 210 src/tfp410/Makefile 211 man/Makefile 212 src/render_program/Makefile 213]) 214