blob: 5b41f333373bc4f9c4dbe7d6f2b9649767ba644b [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],
Petri Latvalad492abf2017-06-09 16:27:11 +030025 [1.19],
Mike Frysingere73e3982016-06-22 07:08:03 -040026 [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=IGT],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -080027 [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
Daniel Stonebccc0ec2016-01-25 18:33:12 +000037AC_CANONICAL_TARGET
Eric Anholt8c641832009-03-26 17:15:11 -070038
Damien Lespiaufd772e32015-06-05 15:51:40 +010039AM_INIT_AUTOMAKE([1.12 foreign subdir-objects dist-bzip2])
Gaetan Nadon4768adf2012-01-10 17:25:24 -050040AM_PATH_PYTHON([3],, [:])
Eric Anholt8c641832009-03-26 17:15:11 -070041
Damien Lespiau191c8592013-01-14 23:21:21 +000042AC_PROG_CC
Tvrtko Ursulind9dcfc32017-05-26 12:11:04 +010043AC_PROG_LEX
Damien Lespiau191c8592013-01-14 23:21:21 +000044AC_PROG_YACC
45
Thomas Wood14ea2a02014-03-11 16:04:28 +000046# check for gtk-doc
47m4_ifdef([GTK_DOC_CHECK], [
48GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
49],[
50AM_CONDITIONAL([ENABLE_GTK_DOC], false)
Damien Lespiauc196c142014-03-21 14:36:54 +000051enable_gtk_doc=no
Thomas Wood14ea2a02014-03-11 16:04:28 +000052])
53
Jani Nikula4650d342015-04-14 22:33:33 +030054# check for rst2man for generating man pages
55AC_CHECK_PROG(RST2MAN, rst2man, yes, no)
56AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = xyes])
Thomas Wood14ea2a02014-03-11 16:04:28 +000057
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080058# Checks for functions, headers, structures, etc.
Damien Lespiau191c8592013-01-14 23:21:21 +000059AC_HEADER_STDC
Thomas Wood80f15532015-07-16 11:41:32 +010060AC_CHECK_HEADERS([termios.h linux/kd.h sys/kd.h libgen.h sys/io.h])
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080061AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
Ben Widawsky90f0b3d2013-01-31 13:04:18 -080062 #include <sys/sysinfo.h>
63 ])
Alan Coopersmith95ea5d52014-12-23 19:07:12 -080064AC_CHECK_TYPES([sighandler_t],[],[],[AC_INCLUDES_DEFAULT
65#include <signal.h>])
Alan Coopersmithfbae1382012-01-23 20:13:49 -080066AC_CHECK_FUNCS([swapctl])
Ben Widawsky8af53e02012-03-24 19:03:38 -070067AC_CHECK_FUNCS([asprintf])
Lyude31811f42016-12-21 14:00:54 -050068AX_GCC_FUNC_ATTRIBUTE([constructor])
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080069
Chris Wilsond5456102016-03-19 13:04:02 +000070dnl Check for POSIX timers
71AC_CHECK_FUNCS(timer_create, [], [
72 AC_CHECK_LIB(rt, timer_create, [
73 AC_DEFINE(HAVE_TIMER_CREATE, 1)
74 TIMER_LIBS="-lrt"
75 ], [
76 AC_CHECK_LIB(pthread, timer_create, [
77 AC_DEFINE(HAVE_TIMER_CREATE, 1)
78 TIMER_LIBS="-lpthread"
79 ])
80 ])
81])
82AC_SUBST(TIMER_LIBS)
83
Chris Wilson545fe0f2016-07-11 12:39:01 +010084dnl Check for CPUID
85cpuid="yes"
86AC_TRY_LINK([
87 #include <cpuid.h>
88 #include <stddef.h>
89 ],
90 [
91 int eax, ebx, ecx, edx;
92 if (__get_cpuid_max(0, NULL) < 4)
93 return 0;
94 __cpuid_count(4, 0, eax, ebx, ecx, edx);
95 ],
96 [cpuid="yes"],
97 [cpuid="no"]
98)
99if test "x$cpuid" = "xyes"; then
100 AC_DEFINE(HAVE_CPUID_H, 1, [Found a useable cpuid.h])
101fi
102
Javier Jardón68b64f12011-02-08 22:33:12 +0000103# Initialize libtool
Gaetan Nadon65db78f2012-01-03 21:13:39 -0500104AC_DISABLE_STATIC
105AC_PROG_LIBTOOL
Javier Jardón68b64f12011-02-08 22:33:12 +0000106
Alan Coopersmith504c4fa2012-01-06 15:45:29 -0800107# Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
Gaetan Nadon1722b782012-01-03 21:12:22 -0500108m4_ifndef([XORG_MACROS_VERSION],
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500109 [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
Alan Coopersmith504c4fa2012-01-06 15:45:29 -0800110XORG_MACROS_VERSION(1.16)
Gaetan Nadon1722b782012-01-03 21:12:22 -0500111XORG_DEFAULT_OPTIONS
112
Damien Lespiau191c8592013-01-14 23:21:21 +0000113# warning flags for the assembler. We can't quite use CWARNFLAGS for it yet as
Damien Lespiau54ec3cb2013-07-19 16:03:29 +0100114# it generates waaaay too many warnings.
Damien Lespiau191c8592013-01-14 23:21:21 +0000115ASSEMBLER_WARN_CFLAGS=""
116if test "x$GCC" = "xyes"; then
Damien Lespiau7902f2c2013-01-19 23:25:22 +0000117 ASSEMBLER_WARN_CFLAGS="-Wall -Wstrict-prototypes \
Damien Lespiau191c8592013-01-14 23:21:21 +0000118 -Wmissing-prototypes -Wmissing-declarations \
119 -Wnested-externs -fno-strict-aliasing"
120fi
121AC_SUBST(ASSEMBLER_WARN_CFLAGS)
122
Robert Foss0fbab812016-07-27 13:17:35 -0400123PKG_CHECK_MODULES(DRM, [libdrm])
Eric Anholt8c641832009-03-26 17:15:11 -0700124PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
Chris Wilson2021ef62016-11-26 16:13:13 +0000125PKG_CHECK_MODULES(KMOD, [libkmod])
Arkadiusz Hilerd7d3f4e2017-04-12 12:24:42 +0200126PKG_CHECK_MODULES(PROCPS, [libprocps], [procps=yes], [procps=no])
127AM_CONDITIONAL(HAVE_PROCPS, [test "x$procps" = xyes])
128if test x"$procps" = xyes; then
129 AC_DEFINE(HAVE_PROCPS,1,[Enable process managment without shelling out])
130fi
Maarten Lankhorstd930b642017-02-09 10:42:01 +0100131PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
132
133if test x$have_valgrind = xyes; then
134 AC_DEFINE(HAVE_VALGRIND, 1, [Enable valgrind annotation support.])
135fi
Daniel Stonebccc0ec2016-01-25 18:33:12 +0000136
137case "$target_cpu" in
Ville Syrjälä764d6682016-10-12 19:03:49 +0300138 x86*|i?86)
Daniel Stonebccc0ec2016-01-25 18:33:12 +0000139 build_x86="yes"
140 ;;
141 *)
142 build_x86="no"
143 ;;
144esac
145
146if test x"$build_x86" = xyes; then
147 PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
148 PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
149 AS_IF([test x"$LEX" != "x:" -a x"$YACC" != xyacc],
150 [enable_assembler=yes],
151 [enable_assembler=no])
152else
153 enable_overlay_xvlib="no"
154 enable_overlay_xlib="no"
155 enable_assembler="no"
156 BUILD_SHADER_DEBUGGER="no"
157fi
158AM_CONDITIONAL(BUILD_X86, [test "x$build_x86" = xyes])
159
160AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes])
Chris Wilsonf9a50de2013-08-17 11:12:07 +0100161
Chris Wilson34e47802013-08-18 21:10:26 +0100162AM_CONDITIONAL(BUILD_OVERLAY_XVLIB, [test "x$enable_overlay_xvlib" = xyes])
163AM_CONDITIONAL(BUILD_OVERLAY_XLIB, [test "x$enable_overlay_xlib" = xyes])
164AM_CONDITIONAL(BUILD_OVERLAY, [test "x$enable_overlay_xlib" = xyes -o "x$enable_overlay_xvlib"])
165if test x$enable_overlay_xvlib = xyes; then
166 AC_DEFINE(HAVE_OVERLAY_XVLIB, 1, [Enable XV backend])
167fi
168if test x$enable_overlay_xlib = xyes; then
169 AC_DEFINE(HAVE_OVERLAY_XLIB, 1, [Enable X backend])
170fi
Chris Wilsonddcd1b22013-08-27 14:25:38 +0100171PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXrandr]), [have_xrandr=no])
Eric Anholt8c641832009-03-26 17:15:11 -0700172
Daniel Vetter08ccec12012-01-19 13:01:03 +0100173# for testdisplay
Damien Lespiau0193b692013-07-17 16:25:29 +0100174PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
Daniel Vetterfa461202012-01-24 11:28:25 +0100175PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no])
Navare, Manasi D9f336972017-01-23 18:48:53 -0800176AM_CONDITIONAL(HAVE_UDEV, [test "x$udev" = xyes])
Daniel Vetterfa461202012-01-24 11:28:25 +0100177if test x"$udev" = xyes; then
178 AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
179fi
Daniel Vetter08ccec12012-01-19 13:01:03 +0100180PKG_CHECK_MODULES(GLIB, glib-2.0)
Jesse Barnes5406c632010-12-21 09:38:23 -0800181
Lyudec99f8b72016-10-18 14:12:09 -0400182# for chamelium
Lyudefd096fc2017-07-17 19:38:32 -0400183AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--disable-chamelium],
184 [Enable building of chamelium libraries and tests (default: yes)]),
185 [enable_chamelium=yes], [enable_chamelium=no])
186AM_CONDITIONAL(HAVE_CHAMELIUM, [test "x$enable_chamelium" = xyes])
187if test "x$enable_chamelium" = xyes; then
188 PKG_CHECK_MODULES(XMLRPC, xmlrpc xmlrpc_util xmlrpc_client, [],
189 [AC_MSG_ERROR([Failed to find xmlrpc, required by chamelium. Use --disable-chamelium to disable chamelium support.])])
190 PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
191 [AC_MSG_ERROR([Failed to find pixman, required by chamelium. Use --disable-chamelium to disable chamelium support.])])
Petri Latvalad8c6cf92017-06-08 10:47:00 +0300192 AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support])
193fi
Lyudec99f8b72016-10-18 14:12:09 -0400194
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500195# -----------------------------------------------------------------------------
196# Configuration options
197# -----------------------------------------------------------------------------
Robert Foss0fbab812016-07-27 13:17:35 -0400198AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel],
199 [Enable building of intel specific parts (default: auto)]),
200 [INTEL=$enableval], [INTEL=auto])
201if test "x$INTEL" = xauto; then
Daniel Vetterb389bdb2017-07-07 13:56:02 +0200202 PKG_CHECK_EXISTS([libdrm_intel >= 2.4.75], [INTEL=yes], [INTEL=no])
Robert Foss0fbab812016-07-27 13:17:35 -0400203fi
204if test "x$INTEL" = xyes; then
Jani Nikulab30ff3b2017-03-01 13:25:52 +0200205 PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.75])
Robert Foss0fbab812016-07-27 13:17:35 -0400206 AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support])
Robert Foss0fbab812016-07-27 13:17:35 -0400207else
Emil Velikov31a00b12016-10-26 17:18:47 +0100208 DRM_INTEL_CFLAGS=-I$\(top_srcdir\)/lib/stubs/drm/
209 DRM_INTEL_LIBS=
Robert Foss0fbab812016-07-27 13:17:35 -0400210fi
Emil Velikov31a00b12016-10-26 17:18:47 +0100211DRM_CFLAGS="$DRM_CFLAGS $DRM_INTEL_CFLAGS"
212DRM_LIBS="$DRM_LIBS $DRM_INTEL_LIBS"
213AC_SUBST([DRM_CFLAGS])
214AC_SUBST([DRM_LIBS])
215
Robert Foss0fbab812016-07-27 13:17:35 -0400216AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes])
217
Chris Wilson36b92e82017-04-22 13:45:18 +0100218AC_ARG_ENABLE(amdgpu, AS_HELP_STRING([--disable-amdgpu],
219 [Enable building of amdgpu tests (default: auto)]),
220 [AMDGPU=$enableval], [AMDGPU=auto])
221if test "x$AMDGPU" = xauto; then
222 PKG_CHECK_EXISTS([libdrm_amdgpu], [AMDGPU=yes], [AMDGPU=no])
223fi
224if test "x$AMDGPU" = xyes; then
Arkadiusz Hiler8cb56562017-07-04 16:28:58 +0300225 PKG_CHECK_MODULES(DRM_AMDGPU, [libdrm_amdgpu >= 2.4.76])
Chris Wilson36b92e82017-04-22 13:45:18 +0100226 AC_DEFINE(HAVE_LIBDRM_AMDGPU, 1, [Have amdgpu support])
227fi
228AM_CONDITIONAL(HAVE_LIBDRM_AMDGPU, [test "x$AMDGPU" = xyes])
229
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800230# for dma-buf tests
231AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
Matt Turnercd460f12013-10-10 20:54:25 -0700232 [Enable use of nouveau API for prime tests (default: auto)]),
233 [NOUVEAU=$enableval], [NOUVEAU=auto])
234if test "x$NOUVEAU" = xauto; then
235 PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no])
236fi
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800237if test "x$NOUVEAU" = xyes; then
238 PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
Robert Foss5bde1482016-07-27 13:17:36 -0400239 AC_DEFINE(HAVE_LIBDRM_NOUVEAU, 1, [Have nouveau support])
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800240fi
Robert Foss5bde1482016-07-27 13:17:36 -0400241AM_CONDITIONAL(HAVE_LIBDRM_NOUVEAU, [test "x$NOUVEAU" = xyes])
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800242
Eric Anholtceca9ef2016-01-25 11:40:15 -0800243AC_ARG_ENABLE(vc4, AS_HELP_STRING([--disable-vc4],
244 [Enable building of vc4 tests (default: auto)]),
245 [VC4=$enableval], [VC4=auto])
246if test "x$VC4" = xauto; then
247 PKG_CHECK_EXISTS([libdrm_vc4], [VC4=yes], [VC4=no])
248fi
249if test "x$VC4" = xyes; then
250 PKG_CHECK_MODULES(DRM_VC4, [libdrm_vc4])
Robert Foss5bde1482016-07-27 13:17:36 -0400251 AC_DEFINE(HAVE_LIBDRM_VC4, 1, [Have vc4 support])
Eric Anholtceca9ef2016-01-25 11:40:15 -0800252fi
Robert Foss5bde1482016-07-27 13:17:36 -0400253AM_CONDITIONAL(HAVE_LIBDRM_VC4, [test "x$VC4" = xyes])
Eric Anholtceca9ef2016-01-25 11:40:15 -0800254
Ben Widawsky94b2b862013-12-20 21:15:16 -0800255# Define a configure option for the shader debugger
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500256AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800257 [Enable shader debugging support [autodetected]]),
Chris Wilson102943d2016-04-25 18:35:49 +0100258 [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=no])
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500259
Ben Widawsky94b2b862013-12-20 21:15:16 -0800260# Shader debugger depends on python3, intel-genasm and objcopy
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500261if test "x$BUILD_SHADER_DEBUGGER" != xno; then
Ben Widawsky94b2b862013-12-20 21:15:16 -0800262 # Check that the assembler is built
Ben Widawsky9d6cfa62013-12-30 10:41:43 -0800263 if test "x$enable_assembler" = xno; then
Ben Widawsky01eeab92014-01-02 19:33:57 -1000264 BUILD_SHADER_DEBUGGER=no
Ben Widawsky9d6cfa62013-12-30 10:41:43 -0800265 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
266 AC_MSG_ERROR([Shader debugger requested, but assembler not enabled.])
267 fi
Ben Widawsky94b2b862013-12-20 21:15:16 -0800268 fi
269
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800270 # Check Python 3 is installed
271 if test "$PYTHON" = ":" ; then
272 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
273 AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
274 else
275 BUILD_SHADER_DEBUGGER=no
276 fi
Ben Widawsky15830ea2011-10-31 13:36:50 -0700277 fi
Ben Widawsky94b2b862013-12-20 21:15:16 -0800278
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800279 # Check for the objcopy GNU binary utiliy command
280 AC_PATH_PROGS([OBJCOPY], objcopy)
281 if test -z "$OBJCOPY" ; then
282 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
283 AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
284 else
285 BUILD_SHADER_DEBUGGER=no
286 fi
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500287 fi
Ben Widawsky62873792011-06-24 11:42:03 -0700288fi
289
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500290AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
Damien Lespiau764b9e52013-03-04 15:59:00 +0000291AS_IF([test "x$BUILD_SHADER_DEBUGGER" != xno],
Damien Lespiau5d526892013-01-22 08:35:15 +0000292 [enable_debugger=yes], [enable_debugger=no])
293
Thomas Wood277ca2b2015-03-13 17:02:12 +0000294AC_ARG_WITH(libunwind,
295 AS_HELP_STRING([--without-libunwind],
296 [Build tests without libunwind support]),
297 [], [with_libunwind=yes])
298if test "x$with_libunwind" = xyes; then
299 PKG_CHECK_MODULES(LIBUNWIND, libunwind, AC_DEFINE(HAVE_LIBUNWIND, 1, [libunwind support]),
300 AC_MSG_ERROR([libunwind not found. Use --without-libunwind to disable libunwind support.]))
301fi
302
Thomas Wood76dad7f2015-03-23 11:46:25 +0000303# enable debug symbols
304AC_ARG_ENABLE(debug,
305 AS_HELP_STRING([--disable-debug],
306 [Build tests without debug symbols]),
307 [], [enable_debug=yes])
308
marius vlad701d8fd2016-05-10 17:32:15 +0300309AC_ARG_ENABLE(werror,
310 AS_HELP_STRING([--enable-werror],
311 [Fail on warnings]),
312 [], [enable_werror=no])
313
Thomas Wood76dad7f2015-03-23 11:46:25 +0000314if test "x$enable_debug" = xyes; then
315 AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"])
316 AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives
317 [DEBUG_CFLAGS+=" -O0"])
318 AC_SUBST([DEBUG_CFLAGS])
319fi
320
marius vlad701d8fd2016-05-10 17:32:15 +0300321if test "x$enable_werror" = xyes; then
322 AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"])
323fi
324
Damien Lespiaue5653d52015-07-01 23:40:36 +0100325# prevent relinking the world on every commit for developers
326AC_ARG_ENABLE(git-hash,
327 AS_HELP_STRING([--disable-git-hash],
328 [Do not use git hash in version]),
329 [git_hash=$enableval], [git_hash=yes])
Damien Lespiauec9e5992015-07-02 14:59:25 +0100330AC_SUBST(GIT_HASH, [$git_hash])
Damien Lespiaue5653d52015-07-01 23:40:36 +0100331
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500332# -----------------------------------------------------------------------------
333
Alan Coopersmith504c4fa2012-01-06 15:45:29 -0800334# To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
335XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt])
336AC_SUBST([THREAD_CFLAGS])
337
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200338AC_ARG_ENABLE(tests,
339 AS_HELP_STRING([--disable-tests],
340 [Disable tests build (default: enabled)]),
341 [BUILD_TESTS=$enableval], [BUILD_TESTS="yes"])
342if test "x$BUILD_TESTS" = xyes; then
343 AC_DEFINE(BUILD_TESTS, 1, [Build tests])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200344fi
345AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes])
Daniel Vetter831a4712013-12-10 09:23:44 +0100346AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200347
Thomas Wood48394472014-10-16 14:23:24 +0100348files="broadwell cherryview haswell ivybridge sandybridge valleyview skylake"
Thomas Woodc54ee982014-06-06 15:28:50 +0100349for file in $files; do
Thomas Wood9ecb50e2015-09-04 14:46:45 +0100350 REGISTER_FILES="$REGISTER_FILES $file `cat $srcdir/tools/registers/$file`"
Thomas Woodc54ee982014-06-06 15:28:50 +0100351done
Thomas Wood9ecb50e2015-09-04 14:46:45 +0100352REGISTER_FILES=`echo $REGISTER_FILES | tr ' ' '\n' | sort -u | tr '\n' ' '`
353AC_SUBST(REGISTER_FILES)
Thomas Woodc54ee982014-06-06 15:28:50 +0100354
Javier Jardón68b64f12011-02-08 22:33:12 +0000355AC_CONFIG_FILES([
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800356 Makefile
357 benchmarks/Makefile
358 demos/Makefile
Thomas Wood14ea2a02014-03-11 16:04:28 +0000359 docs/Makefile
360 docs/reference/Makefile
361 docs/reference/intel-gpu-tools/Makefile
362 docs/reference/intel-gpu-tools/version.xml
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800363 lib/Makefile
Daniel Vetter685e5772014-10-27 15:08:50 +0100364 lib/tests/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800365 man/Makefile
366 scripts/Makefile
Ben Widawsky3a752a32013-02-07 10:30:03 -0800367 tests/Makefile
Petri Latvala86486552017-06-09 14:32:17 +0300368 tests/intel-ci/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800369 tools/Makefile
Mika Kuoppalad60d4c82014-04-10 15:15:13 +0300370 tools/null_state_gen/Makefile
Thomas Woodaf979182015-08-25 11:30:11 +0100371 tools/registers/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800372 debugger/Makefile
373 debugger/system_routine/Makefile
Damien Lespiau191c8592013-01-14 23:21:21 +0000374 assembler/Makefile
375 assembler/doc/Makefile
376 assembler/test/Makefile
377 assembler/intel-gen4asm.pc
Chris Wilsonf9a50de2013-08-17 11:12:07 +0100378 overlay/Makefile
Kristian Høgsberg Kristensen5f9bc982015-08-05 11:55:09 -0700379 ])
380
381AC_CONFIG_FILES([tools/intel_aubdump], [chmod +x tools/intel_aubdump])
Kristian Høgsberg Kristensene6a5d792015-07-29 23:12:16 -0700382
Javier Jardón68b64f12011-02-08 22:33:12 +0000383AC_OUTPUT
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800384
Damien Lespiau54357082013-01-21 23:02:36 +0000385# Print a summary of the compilation
386echo ""
387echo "Intel GPU tools"
388
389echo ""
Damien Lespiau94444ae2013-07-19 16:08:11 +0100390echo " • Tests:"
391echo " Build tests : ${BUILD_TESTS}"
392echo " Compile prime tests: ${NOUVEAU}"
Thomas Wood277ca2b2015-03-13 17:02:12 +0000393echo " Print stack traces : ${with_libunwind}"
Thomas Wood76dad7f2015-03-23 11:46:25 +0000394echo " Debug flags : ${DEBUG_CFLAGS}"
Damien Lespiau94444ae2013-07-19 16:08:11 +0100395echo ""
Damien Lespiau54357082013-01-21 23:02:36 +0000396echo " • Tools:"
Damien Lespiau94444ae2013-07-19 16:08:11 +0100397echo " Assembler : ${enable_assembler}"
398echo " Debugger : ${enable_debugger}"
Damien Lespiaub5acc102013-08-20 14:18:58 +0100399echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}"
Daniel Stonebccc0ec2016-01-25 18:33:12 +0000400echo " x86-specific tools : ${build_x86}"
Damien Lespiau54357082013-01-21 23:02:36 +0000401echo ""
Daniel Vettera90846a2014-03-11 21:03:39 +0100402echo " • API-Documentation : ${enable_gtk_doc}"
Marius Vlad3ce58b62016-05-31 18:33:24 +0300403echo " • Fail on warnings : ${enable_werror}"
Daniel Vettera90846a2014-03-11 21:03:39 +0100404echo ""
Damien Lespiau54357082013-01-21 23:02:36 +0000405
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800406# vim: set ft=config ts=8 sw=8 tw=0 noet :