blob: 301ea11feaa91e07e8e58c8ae65f111035df880d [file] [log] [blame]
Eric Anholt8c641832009-03-26 17:15:11 -07001# 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
Gaetan Nadond63a1f62012-01-03 21:12:25 -050023AC_PREREQ([2.60])
Eric Anholt1eabfa92009-03-27 16:03:12 -070024AC_INIT([intel-gpu-tools],
Rodrigo Vivi32bb5d92014-06-09 11:30:15 -070025 [1.7],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -080026 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
27 [intel-gpu-tools])
Eric Anholt8c641832009-03-26 17:15:11 -070028
29AC_CONFIG_SRCDIR([Makefile.am])
Javier Jardón68b64f12011-02-08 22:33:12 +000030AC_CONFIG_HEADERS([config.h])
31AC_CONFIG_MACRO_DIR([m4])
32AC_CONFIG_AUX_DIR([build-aux])
Alan Coopersmith504c4fa2012-01-06 15:45:29 -080033AC_USE_SYSTEM_EXTENSIONS
Chris Wilsond364c282012-03-14 10:59:51 +000034AC_SYS_LARGEFILE
Ben Widawsky8af53e02012-03-24 19:03:38 -070035AC_GNU_SOURCE
Daniel Vetter831a4712013-12-10 09:23:44 +010036AC_CANONICAL_HOST
Eric Anholt8c641832009-03-26 17:15:11 -070037
Gaetan Nadond63a1f62012-01-03 21:12:25 -050038AM_INIT_AUTOMAKE([foreign dist-bzip2])
Gaetan Nadon4768adf2012-01-10 17:25:24 -050039AM_PATH_PYTHON([3],, [:])
Eric Anholt8c641832009-03-26 17:15:11 -070040
Damien Lespiau191c8592013-01-14 23:21:21 +000041AC_PROG_CC
42AM_PROG_LEX
43AC_PROG_YACC
44
Thomas Wood14ea2a02014-03-11 16:04:28 +000045# check for gtk-doc
46m4_ifdef([GTK_DOC_CHECK], [
47GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
48],[
49AM_CONDITIONAL([ENABLE_GTK_DOC], false)
Damien Lespiauc196c142014-03-21 14:36:54 +000050enable_gtk_doc=no
Thomas Wood14ea2a02014-03-11 16:04:28 +000051])
52
53
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080054# Checks for functions, headers, structures, etc.
Damien Lespiau191c8592013-01-14 23:21:21 +000055AC_HEADER_STDC
Alan Coopersmithf73dddc2012-01-06 14:37:17 -080056AC_CHECK_HEADERS([termios.h])
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080057AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
Ben Widawsky90f0b3d2013-01-31 13:04:18 -080058 #include <sys/sysinfo.h>
59 ])
Alan Coopersmithfbae1382012-01-23 20:13:49 -080060AC_CHECK_FUNCS([swapctl])
Ben Widawsky8af53e02012-03-24 19:03:38 -070061AC_CHECK_FUNCS([asprintf])
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080062
Javier Jardón68b64f12011-02-08 22:33:12 +000063# Initialize libtool
Gaetan Nadon65db78f2012-01-03 21:13:39 -050064AC_DISABLE_STATIC
65AC_PROG_LIBTOOL
Javier Jardón68b64f12011-02-08 22:33:12 +000066
Alan Coopersmith504c4fa2012-01-06 15:45:29 -080067# Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
Gaetan Nadon1722b782012-01-03 21:12:22 -050068m4_ifndef([XORG_MACROS_VERSION],
Gaetan Nadon4768adf2012-01-10 17:25:24 -050069 [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
Alan Coopersmith504c4fa2012-01-06 15:45:29 -080070XORG_MACROS_VERSION(1.16)
Gaetan Nadon1722b782012-01-03 21:12:22 -050071XORG_DEFAULT_OPTIONS
72
Damien Lespiau191c8592013-01-14 23:21:21 +000073# warning flags for the assembler. We can't quite use CWARNFLAGS for it yet as
Damien Lespiau54ec3cb2013-07-19 16:03:29 +010074# it generates waaaay too many warnings.
Damien Lespiau191c8592013-01-14 23:21:21 +000075ASSEMBLER_WARN_CFLAGS=""
76if test "x$GCC" = "xyes"; then
Damien Lespiau7902f2c2013-01-19 23:25:22 +000077 ASSEMBLER_WARN_CFLAGS="-Wall -Wstrict-prototypes \
Damien Lespiau191c8592013-01-14 23:21:21 +000078 -Wmissing-prototypes -Wmissing-declarations \
79 -Wnested-externs -fno-strict-aliasing"
80fi
81AC_SUBST(ASSEMBLER_WARN_CFLAGS)
82
Daniel Vetter02a32702014-03-07 09:23:58 +010083PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
Eric Anholt8c641832009-03-26 17:15:11 -070084PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
Chris Wilsoncfc69222014-07-11 20:38:30 +010085PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
86PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
Chris Wilsonf9a50de2013-08-17 11:12:07 +010087
Chris Wilson34e47802013-08-18 21:10:26 +010088AM_CONDITIONAL(BUILD_OVERLAY_XVLIB, [test "x$enable_overlay_xvlib" = xyes])
89AM_CONDITIONAL(BUILD_OVERLAY_XLIB, [test "x$enable_overlay_xlib" = xyes])
90AM_CONDITIONAL(BUILD_OVERLAY, [test "x$enable_overlay_xlib" = xyes -o "x$enable_overlay_xvlib"])
91if test x$enable_overlay_xvlib = xyes; then
92 AC_DEFINE(HAVE_OVERLAY_XVLIB, 1, [Enable XV backend])
93fi
94if test x$enable_overlay_xlib = xyes; then
95 AC_DEFINE(HAVE_OVERLAY_XLIB, 1, [Enable X backend])
96fi
Chris Wilsonddcd1b22013-08-27 14:25:38 +010097PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXrandr]), [have_xrandr=no])
Eric Anholt8c641832009-03-26 17:15:11 -070098
Daniel Vetter08ccec12012-01-19 13:01:03 +010099# for testdisplay
Damien Lespiau0193b692013-07-17 16:25:29 +0100100PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
Daniel Vetterfa461202012-01-24 11:28:25 +0100101PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no])
102if test x"$udev" = xyes; then
103 AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
104fi
Daniel Vetter08ccec12012-01-19 13:01:03 +0100105PKG_CHECK_MODULES(GLIB, glib-2.0)
Jesse Barnes5406c632010-12-21 09:38:23 -0800106
Damien Lespiau54357082013-01-21 23:02:36 +0000107# can we build the assembler?
108AS_IF([test x"$LEX" != "x:" -a x"$YACC" != xyacc],
109 [enable_assembler=yes],
110 [enable_assembler=no])
111AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes])
112
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500113# -----------------------------------------------------------------------------
114# Configuration options
115# -----------------------------------------------------------------------------
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800116# for dma-buf tests
117AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
Matt Turnercd460f12013-10-10 20:54:25 -0700118 [Enable use of nouveau API for prime tests (default: auto)]),
119 [NOUVEAU=$enableval], [NOUVEAU=auto])
120if test "x$NOUVEAU" = xauto; then
121 PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no])
122fi
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800123if test "x$NOUVEAU" = xyes; then
124 PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
125 AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])
126fi
127AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
128
Ben Widawsky1cce7eb2013-02-07 08:28:14 -0800129#Configure options for the python quick-dumper
130AC_ARG_ENABLE(dumper,
131 AS_HELP_STRING([--disable-dumper],
132 [Disable the python based register dumper (default: enabled)]),
Damien Lespiau707c8392014-05-28 14:18:34 +0100133 [DUMPER=$enableval], [DUMPER=auto])
134if test "x$DUMPER" = xauto; then
135 # AX_PYTHON_DEVEL/AX_SWIG_PYTHON are not super friendly and don't
136 # easily allow us to introspect the result of their checks. So if we
137 # find SWING on the system, that's enough to try compiling the dumper.
138 AX_PKG_SWIG(2.0.0, [DUMPER=yes], [DUMPER=no])
139fi
Ben Widawsky1cce7eb2013-02-07 08:28:14 -0800140if test "x$DUMPER" == xyes; then
141 AC_DEFINE(HAVE_DUMPER, 1, [Have dumper support])
142 # SWIG configuration
143 AX_PKG_SWIG(2.0.0, [], [ AC_MSG_ERROR([SWIG 2.0.0 or higher is required to build..]) ])
144 AX_PYTHON_DEVEL([>= '3.0'])
145 AX_SWIG_PYTHON
146fi
147AM_CONDITIONAL(HAVE_DUMPER, [test "x$DUMPER" = xyes])
148
Ben Widawsky94b2b862013-12-20 21:15:16 -0800149# Define a configure option for the shader debugger
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500150AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800151 [Enable shader debugging support [autodetected]]),
152 [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto])
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500153
Ben Widawsky94b2b862013-12-20 21:15:16 -0800154# Shader debugger depends on python3, intel-genasm and objcopy
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500155if test "x$BUILD_SHADER_DEBUGGER" != xno; then
Ben Widawsky94b2b862013-12-20 21:15:16 -0800156 # Check that the assembler is built
Ben Widawsky9d6cfa62013-12-30 10:41:43 -0800157 if test "x$enable_assembler" = xno; then
Ben Widawsky01eeab92014-01-02 19:33:57 -1000158 BUILD_SHADER_DEBUGGER=no
Ben Widawsky9d6cfa62013-12-30 10:41:43 -0800159 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
160 AC_MSG_ERROR([Shader debugger requested, but assembler not enabled.])
161 fi
Ben Widawsky94b2b862013-12-20 21:15:16 -0800162 fi
163
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800164 # Check Python 3 is installed
165 if test "$PYTHON" = ":" ; then
166 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
167 AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
168 else
169 BUILD_SHADER_DEBUGGER=no
170 fi
Ben Widawsky15830ea2011-10-31 13:36:50 -0700171 fi
Ben Widawsky94b2b862013-12-20 21:15:16 -0800172
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800173 # Check for the objcopy GNU binary utiliy command
174 AC_PATH_PROGS([OBJCOPY], objcopy)
175 if test -z "$OBJCOPY" ; then
176 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
177 AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
178 else
179 BUILD_SHADER_DEBUGGER=no
180 fi
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500181 fi
Ben Widawsky62873792011-06-24 11:42:03 -0700182fi
183
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500184AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
Damien Lespiau764b9e52013-03-04 15:59:00 +0000185AS_IF([test "x$BUILD_SHADER_DEBUGGER" != xno],
Damien Lespiau5d526892013-01-22 08:35:15 +0000186 [enable_debugger=yes], [enable_debugger=no])
187
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500188# -----------------------------------------------------------------------------
189
Alan Coopersmith504c4fa2012-01-06 15:45:29 -0800190# To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
191XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt])
192AC_SUBST([THREAD_CFLAGS])
193
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200194AC_ARG_ENABLE(tests,
195 AS_HELP_STRING([--disable-tests],
196 [Disable tests build (default: enabled)]),
197 [BUILD_TESTS=$enableval], [BUILD_TESTS="yes"])
198if test "x$BUILD_TESTS" = xyes; then
199 AC_DEFINE(BUILD_TESTS, 1, [Build tests])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200200fi
201AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes])
Daniel Vetter831a4712013-12-10 09:23:44 +0100202AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200203
Thomas Woodc54ee982014-06-06 15:28:50 +0100204files="broadwell cherryview haswell ivybridge sandybridge valleyview"
205for file in $files; do
206 QUICK_DUMP_EXTRA_DIST+="$file `tr '\n' ' ' < tools/quick_dump/$file`"
207done
208AC_SUBST(QUICK_DUMP_EXTRA_DIST)
209
Javier Jardón68b64f12011-02-08 22:33:12 +0000210AC_CONFIG_FILES([
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800211 Makefile
212 benchmarks/Makefile
213 demos/Makefile
Thomas Wood14ea2a02014-03-11 16:04:28 +0000214 docs/Makefile
215 docs/reference/Makefile
216 docs/reference/intel-gpu-tools/Makefile
217 docs/reference/intel-gpu-tools/version.xml
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800218 lib/Makefile
219 man/Makefile
220 scripts/Makefile
Ben Widawsky3a752a32013-02-07 10:30:03 -0800221 tests/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800222 tools/Makefile
Ben Widawskyac1634e2012-09-19 22:08:46 -0700223 tools/quick_dump/Makefile
Mika Kuoppalad60d4c82014-04-10 15:15:13 +0300224 tools/null_state_gen/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800225 debugger/Makefile
226 debugger/system_routine/Makefile
Damien Lespiau191c8592013-01-14 23:21:21 +0000227 assembler/Makefile
228 assembler/doc/Makefile
229 assembler/test/Makefile
230 assembler/intel-gen4asm.pc
Chris Wilsonf9a50de2013-08-17 11:12:07 +0100231 overlay/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800232 ])
Javier Jardón68b64f12011-02-08 22:33:12 +0000233AC_OUTPUT
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800234
Damien Lespiau54357082013-01-21 23:02:36 +0000235# Print a summary of the compilation
236echo ""
237echo "Intel GPU tools"
238
239echo ""
Damien Lespiau94444ae2013-07-19 16:08:11 +0100240echo " • Tests:"
241echo " Build tests : ${BUILD_TESTS}"
242echo " Compile prime tests: ${NOUVEAU}"
243echo ""
Damien Lespiau54357082013-01-21 23:02:36 +0000244echo " • Tools:"
Damien Lespiau94444ae2013-07-19 16:08:11 +0100245echo " Assembler : ${enable_assembler}"
246echo " Debugger : ${enable_debugger}"
247echo " Python dumper : ${DUMPER}"
Damien Lespiaub5acc102013-08-20 14:18:58 +0100248echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}"
Damien Lespiau54357082013-01-21 23:02:36 +0000249echo ""
Daniel Vettera90846a2014-03-11 21:03:39 +0100250echo " • API-Documentation : ${enable_gtk_doc}"
251echo ""
Damien Lespiau54357082013-01-21 23:02:36 +0000252
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800253# vim: set ft=config ts=8 sw=8 tw=0 noet :