clean up spec file for packaging
[profile/ivi/xorg-x11-drv-intel.git] / configure.ac
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.63])
25 AC_INIT([xf86-video-intel],
26         [2.15.0],
27         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
28         [xf86-video-intel])
29 AC_CONFIG_SRCDIR([Makefile.am])
30 AC_CONFIG_HEADERS([config.h])
31 AC_CONFIG_AUX_DIR([build-aux])
32 AC_CONFIG_MACRO_DIR([m4])
33
34 # Initialize Automake
35 AM_INIT_AUTOMAKE([1.10 foreign dist-bzip2])
36 AM_MAINTAINER_MODE([enable])
37
38 # Support silent build rules, requires at least automake-1.11. Disable
39 # by either passing --disable-silent-rules to configure or passing V=1
40 # to make
41 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
42
43 # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
44 m4_ifndef([XORG_MACROS_VERSION],
45           [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen.
46   Hint: either install from source, git://anongit.freedesktop.org/xorg/util/macros or,
47   depending on you distribution, try package 'xutils-dev' or 'xorg-x11-util-macros'])])
48
49 XORG_MACROS_VERSION(1.8)
50 XORG_DEFAULT_OPTIONS
51
52 # Require X.Org server macros (i.e. XORG_DRIVER_CHECK_EXT) to check for required modules 
53 m4_ifndef([XORG_DRIVER_CHECK_EXT],
54           [m4_fatal([must install xorg-server macros before running autoconf/autogen.
55   Hint: either install from source, git://anongit.freedesktop.org/xorg/xserver or,
56   depending on your distribution, try package 'xserver-xorg-dev' or 'xorg-x11-server-devel'])])
57
58 # Initialize libtool
59 LT_PREREQ([2.2])
60 LT_INIT([disable-static])
61
62 PKG_CHECK_MODULES(GEN4ASM, [intel-gen4asm >= 1.1], [gen4asm=yes], [gen4asm=no])
63 AM_CONDITIONAL(HAVE_GEN4ASM, test x$gen4asm = xyes)
64
65 PKG_CHECK_MODULES(UDEV, [libudev], [udev=yes], [udev=no])
66 if test x"$udev" = xyes; then
67         AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
68 fi
69
70 AH_TOP([#include "xorg-server.h"])
71
72 # Define a configure option for an alternate module directory
73 AC_ARG_WITH(xorg-module-dir,
74             AS_HELP_STRING([--with-xorg-module-dir=DIR],
75                            [Default xorg module directory [[default=$libdir/xorg/modules]]]),
76             [moduledir="$withval"],
77             [moduledir="$libdir/xorg/modules"])
78
79 AC_ARG_ENABLE(dri, AS_HELP_STRING([--disable-dri],
80                                   [Disable DRI support [[default=auto]]]),
81               [DRI="$enableval"],
82               [DRI=auto])
83
84 AC_ARG_ENABLE(xvmc, AS_HELP_STRING([--disable-xvmc],
85                                   [Disable XvMC support [[default=yes]]]),
86               [XVMC="$enableval"],
87               [XVMC=yes])
88
89 AC_ARG_ENABLE(kms-only, AS_HELP_STRING([--enable-kms-only],
90                                   [Assume KMS support [[default=no]]]),
91               [KMS_ONLY="$enableval"],
92               [KMS_ONLY=no])
93
94 AC_ARG_ENABLE(debug,
95               AS_HELP_STRING([--enable-debug],
96                              [Enables internal debugging [[default=yes]]]),
97               [DEBUG="$enableval"],
98               [DEBUG=yes])
99
100 # Store the list of server defined optional extensions in REQUIRED_MODULES
101 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
102 XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
103 XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
104 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
105
106 # Obtain compiler/linker options for the driver dependencies
107 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6 xproto fontsproto $REQUIRED_MODULES])
108 PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.23])
109 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
110
111 sdkdir=`$PKG_CONFIG --variable=sdkdir xorg-server`
112
113 save_CFLAGS="$CFLAGS"
114 CFLAGS="$XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS"
115 CPPFLAGS="$XORG_CFLAGS $DRI_CFLAGS $DRM_CFLAGS"
116 AC_MSG_CHECKING([whether to include DRI support])
117 if 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"])
124 fi
125 AC_MSG_CHECKING([whether to include DRI support])
126 if 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
134 fi
135 AC_MSG_RESULT([$DRI])
136 CFLAGS="$save_CFLAGS $DEBUGFLAGS"
137
138 AM_CONDITIONAL(DRI, test x$DRI = xyes)
139 if test "$DRI" = yes; then
140         PKG_CHECK_MODULES(DRI, [xf86driproto])
141         AC_DEFINE(XF86DRI,1,[Enable DRI driver support])
142         AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
143 fi
144
145 if test "$XVMC" = yes; then
146         PKG_CHECK_MODULES(XVMCLIB,
147                           [xvmc xext xfixes dri2proto x11-xcb xcb-dri2 xcb-aux],
148                           [XVMC=yes], [XVMC=no])
149 fi
150 AC_MSG_CHECKING([whether to include XvMC support])
151 AC_MSG_RESULT([$XVMC])
152 AM_CONDITIONAL(XVMC, test x$XVMC = xyes)
153 if test "x$XVMC" = xyes; then
154         AC_DEFINE(ENABLE_XVMC,1,[Enable XvMC support])
155 fi
156
157 AM_CONDITIONAL(KMS_ONLY, test x$KMS_ONLY = xyes)
158 if test "x$KMS_ONLY" = xyes; then
159         AC_DEFINE(KMS_ONLY,1,[Assume KMS support])
160 fi
161
162 if test "x$DEBUG" = xno; then
163         AC_DEFINE(NDEBUG,1,[Disable internal debugging])
164 fi
165
166 DRIVER_NAME=intel
167 AC_SUBST([DRIVER_NAME])
168 AC_SUBST([moduledir])
169
170 AC_CONFIG_FILES([
171                 Makefile
172                 uxa/Makefile
173                 src/Makefile
174                 src/xvmc/Makefile
175                 src/xvmc/shader/Makefile
176                 src/xvmc/shader/mc/Makefile
177                 src/xvmc/shader/vld/Makefile
178                 src/legacy/Makefile
179                 src/legacy/i810/Makefile
180                 src/legacy/i810/xvmc/Makefile
181                 man/Makefile
182                 src/render_program/Makefile
183 ])
184 AC_OUTPUT