1fa225cbcSrjs#  Copyright 2005 Adam Jackson.
2fa225cbcSrjs#
3fa225cbcSrjs#  Permission is hereby granted, free of charge, to any person obtaining a
4fa225cbcSrjs#  copy of this software and associated documentation files (the "Software"),
5fa225cbcSrjs#  to deal in the Software without restriction, including without limitation
6fa225cbcSrjs#  on the rights to use, copy, modify, merge, publish, distribute, sub
7fa225cbcSrjs#  license, and/or sell copies of the Software, and to permit persons to whom
8fa225cbcSrjs#  the Software is furnished to do so, subject to the following conditions:
9fa225cbcSrjs#
10fa225cbcSrjs#  The above copyright notice and this permission notice (including the next
11fa225cbcSrjs#  paragraph) shall be included in all copies or substantial portions of the
12fa225cbcSrjs#  Software.
13fa225cbcSrjs#
14fa225cbcSrjs#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15fa225cbcSrjs#  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16fa225cbcSrjs#  FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
17fa225cbcSrjs#  ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18fa225cbcSrjs#  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19fa225cbcSrjs#  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20fa225cbcSrjs#
21fa225cbcSrjs# Process this file with autoconf to produce a configure script
22fa225cbcSrjs
23fa225cbcSrjsAC_PREREQ(2.57)
24fa225cbcSrjsAC_INIT([xf86-video-intel],
25fa225cbcSrjs        2.9.1,
26fa225cbcSrjs        [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
27fa225cbcSrjs        xf86-video-intel)
28fa225cbcSrjs
29fa225cbcSrjsAC_CONFIG_SRCDIR([Makefile.am])
30fa225cbcSrjsAM_CONFIG_HEADER([config.h])
31fa225cbcSrjsAC_CONFIG_AUX_DIR(.)
32fa225cbcSrjs
33fa225cbcSrjsAM_INIT_AUTOMAKE([dist-bzip2])
34fa225cbcSrjs
35fa225cbcSrjsAM_MAINTAINER_MODE
36fa225cbcSrjs
37fa225cbcSrjsAC_CONFIG_FILES([
38fa225cbcSrjs	shave
39fa225cbcSrjs	shave-libtool
40fa225cbcSrjs])
41fa225cbcSrjs
42fa225cbcSrjs# Checks for programs.
43fa225cbcSrjsAC_DISABLE_STATIC
44fa225cbcSrjsAC_PROG_LIBTOOL
45fa225cbcSrjsDOLT
46fa225cbcSrjsAC_PROG_CC
47fa225cbcSrjsAM_PROG_CC_C_O
48fa225cbcSrjs
49fa225cbcSrjsPKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.0], [gen4asm=yes], [gen4asm=no])
50fa225cbcSrjsAM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
51fa225cbcSrjs
52fa225cbcSrjsAC_CHECK_HEADERS(sys/mman.h)
53fa225cbcSrjsAC_CHECK_FUNCS(mprotect)
54fa225cbcSrjs
55fa225cbcSrjsAH_TOP([#include "xorg-server.h"])
56fa225cbcSrjs
57fa225cbcSrjsAC_ARG_WITH(xorg-module-dir,
58fa225cbcSrjs            AC_HELP_STRING([--with-xorg-module-dir=DIR],
59fa225cbcSrjs                           [Default xorg module directory [[default=$libdir/xorg/modules]]]),
60fa225cbcSrjs            [moduledir="$withval"],
61fa225cbcSrjs            [moduledir="$libdir/xorg/modules"])
62fa225cbcSrjs
63fa225cbcSrjsAC_ARG_ENABLE(dri, AC_HELP_STRING([--disable-dri],
64fa225cbcSrjs                                  [Disable DRI support [[default=auto]]]),
65fa225cbcSrjs              [DRI="$enableval"],
66fa225cbcSrjs              [DRI=auto])
67fa225cbcSrjs
68fa225cbcSrjsAC_ARG_ENABLE(video-debug, AC_HELP_STRING([--enable-video-debug],
69fa225cbcSrjs                                  [Enable video debugging support [[default=no]]]),
70fa225cbcSrjs              [VIDEO_DEBUG="$enableval"],
71fa225cbcSrjs              [VIDEO_DEBUG=no])
72fa225cbcSrjs
73fa225cbcSrjsAC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
74fa225cbcSrjs				    [Compile with debug support [[default=yes]]]))
75fa225cbcSrjsif test "x$enableval" == "xyes" ; then
76fa225cbcSrjs	DEBUGFLAGS="-g"
77fa225cbcSrjselse
78fa225cbcSrjs	DEBUGFLAGS=""
79fa225cbcSrjsfi
80fa225cbcSrjs
81fa225cbcSrjsAC_ARG_ENABLE(xvmc, AC_HELP_STRING([--disable-xvmc],
82fa225cbcSrjs                                  [Disable XvMC support [[default=yes]]]),
83fa225cbcSrjs              [XVMC="$enableval"],
84fa225cbcSrjs              [XVMC=yes])
85fa225cbcSrjs
86fa225cbcSrjsAC_ARG_ENABLE(kms-only, AC_HELP_STRING([--enable-kms-only],
87fa225cbcSrjs                                  [Assume KMS support [[default=no]]]),
88fa225cbcSrjs              [KMS_ONLY="$enableval"],
89fa225cbcSrjs              [KMS_ONLY=no])
90fa225cbcSrjs
91fa225cbcSrjs# Checks for extensions
92fa225cbcSrjsXORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)
93fa225cbcSrjsXORG_DRIVER_CHECK_EXT(RANDR, randrproto)
94fa225cbcSrjsXORG_DRIVER_CHECK_EXT(RENDER, renderproto)
95fa225cbcSrjsXORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
96fa225cbcSrjsXORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
97fa225cbcSrjs
98fa225cbcSrjs# Checks for pkg-config packages
99fa225cbcSrjsPKG_CHECK_MODULES(XORG, [xorg-server >= 1.6 xproto fontsproto $REQUIRED_MODULES])
100fa225cbcSrjsPKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
101fa225cbcSrjs                  HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
102fa225cbcSrjs                  HAVE_XEXTPROTO_71="no")
103fa225cbcSrjsAM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ])
104fa225cbcSrjs
105fa225cbcSrjssdkdir=$(pkg-config --variable=sdkdir xorg-server)
106fa225cbcSrjsdrm_cflags=$(pkg-config --cflags libdrm)
107fa225cbcSrjs
108fa225cbcSrjs# Checks for libraries.
109fa225cbcSrjs
110fa225cbcSrjs# Checks for header files.
111fa225cbcSrjsAC_HEADER_STDC
112fa225cbcSrjs
113fa225cbcSrjssave_CFLAGS="$CFLAGS"
114fa225cbcSrjsCFLAGS="$XORG_CFLAGS $DRI_CFLAGS $drm_cflags"
115fa225cbcSrjsCPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS $drm_cflags"
116fa225cbcSrjsAC_MSG_CHECKING([whether to include DRI support])
117fa225cbcSrjsif test x$DRI != xno; then
118fa225cbcSrjs        AC_CHECK_FILE([${sdkdir}/dri.h],
119fa225cbcSrjs                      [have_dri_h="yes"], [have_dri_h="no"])
120fa225cbcSrjs        AC_CHECK_FILE([${sdkdir}/sarea.h],
121fa225cbcSrjs                      [have_sarea_h="yes"], [have_sarea_h="no"])
122fa225cbcSrjs        AC_CHECK_FILE([${sdkdir}/dristruct.h],
123fa225cbcSrjs                      [have_dristruct_h="yes"], [have_dristruct_h="no"])
124fa225cbcSrjsfi
125fa225cbcSrjsAC_MSG_CHECKING([whether to include DRI support])
126fa225cbcSrjsif test x$DRI = xauto; then
127fa225cbcSrjs        if test "$have_dri_h" = yes -a \
128fa225cbcSrjs                "$have_sarea_h" = yes -a \
129fa225cbcSrjs                "$have_dristruct_h" = yes; then
130fa225cbcSrjs                DRI="yes"
131fa225cbcSrjs        else
132fa225cbcSrjs                DRI="no"
133fa225cbcSrjs        fi
134fa225cbcSrjsfi
135fa225cbcSrjsAC_MSG_RESULT([$DRI])
136fa225cbcSrjsCFLAGS="$save_CFLAGS $DEBUGFLAGS"
137fa225cbcSrjs
138fa225cbcSrjsPKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
139fa225cbcSrjs
140fa225cbcSrjsdnl Use lots of warning flags with GCC
141fa225cbcSrjs
142fa225cbcSrjsWARN_CFLAGS=""
143fa225cbcSrjs
144fa225cbcSrjsif test "x$GCC" = "xyes"; then
145fa225cbcSrjs	WARN_CFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes \
146fa225cbcSrjs	-Wmissing-prototypes -Wmissing-declarations \
147fa225cbcSrjs	-Wnested-externs -fno-strict-aliasing"
148fa225cbcSrjsfi
149fa225cbcSrjs
150fa225cbcSrjsPKG_CHECK_MODULES(DRM, [libdrm >= 2.4.11])
151fa225cbcSrjsAM_CONDITIONAL(DRI, test x$DRI = xyes)
152fa225cbcSrjsif test "$DRI" = yes; then
153fa225cbcSrjs        PKG_CHECK_MODULES(DRI, [xf86driproto glproto])
154fa225cbcSrjs        AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
155fa225cbcSrjs        AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
156fa225cbcSrjsfi
157fa225cbcSrjs
158fa225cbcSrjsAM_CONDITIONAL(VIDEO_DEBUG, test x$VIDEO_DEBUG = xyes)
159fa225cbcSrjsif test "$VIDEO_DEBUG" = yes; then
160fa225cbcSrjs	AC_DEFINE(VIDEO_DEBUG,1,[Enable debug support])
161fa225cbcSrjsfi
162fa225cbcSrjs
163fa225cbcSrjsif test "$XVMC" = yes; then
164fa225cbcSrjs	PKG_CHECK_MODULES(XVMCLIB, [xvmc xext xfixes dri2proto], [XVMC=yes], [XVMC=no])
165fa225cbcSrjsfi
166fa225cbcSrjsAC_MSG_CHECKING([whether to include XvMC support])
167fa225cbcSrjsAC_MSG_RESULT([$XVMC])
168fa225cbcSrjsAM_CONDITIONAL(XVMC, test x$XVMC = xyes)
169fa225cbcSrjsif test "$XVMC" = yes; then
170fa225cbcSrjs	AC_DEFINE(ENABLE_XVMC,1,[Enable XvMC support])
171fa225cbcSrjs    	AC_SUBST([XVMCLIB_CFLAGS])
172fa225cbcSrjsfi
173fa225cbcSrjs
174fa225cbcSrjsAM_CONDITIONAL(KMS_ONLY, test x$KMS_ONLY = xyes)
175fa225cbcSrjsif test "$KMS_ONLY" = yes; then
176fa225cbcSrjs	AC_DEFINE(KMS_ONLY,1,[Assume KMS support])
177fa225cbcSrjsfi
178fa225cbcSrjs
179fa225cbcSrjsAC_SUBST([DRI_CFLAGS])
180fa225cbcSrjsAC_SUBST([XORG_CFLAGS])
181fa225cbcSrjsAC_SUBST([WARN_CFLAGS])
182fa225cbcSrjsAC_SUBST([moduledir])
183fa225cbcSrjs
184fa225cbcSrjsDRIVER_NAME=intel
185fa225cbcSrjsAC_SUBST([DRIVER_NAME])
186fa225cbcSrjs
187fa225cbcSrjsm4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1.3 or later before running autoconf/autogen])])
188fa225cbcSrjsXORG_MACROS_VERSION(1.1.3)
189fa225cbcSrjsXORG_MANPAGE_SECTIONS
190fa225cbcSrjsXORG_RELEASE_VERSION
191fa225cbcSrjs
192fa225cbcSrjsXORG_CHECK_LINUXDOC
193fa225cbcSrjs
194fa225cbcSrjsSHAVE_INIT([.], [enable])
195fa225cbcSrjs
196fa225cbcSrjsAC_OUTPUT([
197fa225cbcSrjs	Makefile
198fa225cbcSrjs	uxa/Makefile
199fa225cbcSrjs	src/Makefile
200fa225cbcSrjs	src/xvmc/Makefile
201fa225cbcSrjs	src/xvmc/shader/Makefile
202fa225cbcSrjs	src/xvmc/shader/mc/Makefile
203fa225cbcSrjs	src/xvmc/shader/vld/Makefile
204fa225cbcSrjs	src/bios_reader/Makefile
205fa225cbcSrjs	src/ch7017/Makefile
206fa225cbcSrjs	src/ch7xxx/Makefile
207fa225cbcSrjs	src/ivch/Makefile
208fa225cbcSrjs	src/reg_dumper/Makefile
209fa225cbcSrjs	src/sil164/Makefile
210fa225cbcSrjs	src/tfp410/Makefile
211fa225cbcSrjs	man/Makefile
212fa225cbcSrjs	src/render_program/Makefile
213fa225cbcSrjs])
214