blob: 50aa86b50cee813c7aed987bac538deca5d43258 [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
Dave Airlie0c514b02017-08-14 17:07:05 +1000123PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.82])
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
Paul Kocialkowski4c70d6e2017-07-19 17:58:59 +0300180PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes], [glib=no])
181if test x"$glib" = xyes; then
182 AC_DEFINE(HAVE_GLIB,1,[Enable glib support])
183fi
Paul Kocialkowski8cf32fe2017-07-20 18:13:36 +0300184PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
185AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
Jesse Barnes5406c632010-12-21 09:38:23 -0800186
Lyudec99f8b72016-10-18 14:12:09 -0400187# for chamelium
Paul Kocialkowskif1454752017-07-26 11:11:54 +0300188AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--enable-chamelium],
189 [Enable building of chamelium libraries and tests (default: no)]),
190 [if test x$enableval = xyes; then enable_chamelium=yes; fi],
191 [enable_chamelium=no])
Lyudefd096fc2017-07-17 19:38:32 -0400192AM_CONDITIONAL(HAVE_CHAMELIUM, [test "x$enable_chamelium" = xyes])
193if test "x$enable_chamelium" = xyes; then
Petri Latvala28ed1c42017-08-03 16:34:45 +0300194 PKG_CHECK_MODULES(XMLRPC, xmlrpc xmlrpc_util xmlrpc_client,
195 [xmlrpc=yes], [xmlrpc=no])
196 if test x"$xmlrpc" != xyes; then
197 AC_CHECK_PROG([XMLRPC_C_CONFIG], [xmlrpc-c-config], [yes], [no])
198 if test x"$XMLRPC_C_CONFIG" = xyes; then
199 XMLRPC_CFLAGS=$(xmlrpc-c-config client --cflags)
200 XMLRPC_LIBS=$(xmlrpc-c-config client --libs)
201 AC_SUBST(XMLRPC_CFLAGS)
202 AC_SUBST(XMLRPC_LIBS)
203 else
204 AC_MSG_ERROR([Failed to find xmlrpc, required by chamelium.])
205 fi
206 fi
Lyudefd096fc2017-07-17 19:38:32 -0400207 PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
Paul Kocialkowskif1454752017-07-26 11:11:54 +0300208 [AC_MSG_ERROR([Failed to find pixman, required by chamelium.])])
Paul Kocialkowskicae92702017-07-25 15:48:23 +0300209 if test x"$udev" != xyes; then
Paul Kocialkowskif1454752017-07-26 11:11:54 +0300210 AC_MSG_ERROR([Failed to find udev, required by chamelium.])
Paul Kocialkowskicae92702017-07-25 15:48:23 +0300211 fi
Paul Kocialkowski4c70d6e2017-07-19 17:58:59 +0300212 if test x"$glib" != xyes; then
Paul Kocialkowskif1454752017-07-26 11:11:54 +0300213 AC_MSG_ERROR([Failed to find glib, required by chamelium.])
Paul Kocialkowski4c70d6e2017-07-19 17:58:59 +0300214 fi
Paul Kocialkowskie246ff02017-07-20 18:13:37 +0300215 if test x"$gsl" != xyes; then
Paul Kocialkowskif1454752017-07-26 11:11:54 +0300216 AC_MSG_ERROR([Failed to find gsl, required by chamelium.])
Paul Kocialkowskie246ff02017-07-20 18:13:37 +0300217 fi
218
Petri Latvalad8c6cf92017-06-08 10:47:00 +0300219 AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support])
220fi
Lyudec99f8b72016-10-18 14:12:09 -0400221
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500222# -----------------------------------------------------------------------------
223# Configuration options
224# -----------------------------------------------------------------------------
Robert Foss0fbab812016-07-27 13:17:35 -0400225AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel],
226 [Enable building of intel specific parts (default: auto)]),
227 [INTEL=$enableval], [INTEL=auto])
228if test "x$INTEL" = xauto; then
Daniel Vetterb389bdb2017-07-07 13:56:02 +0200229 PKG_CHECK_EXISTS([libdrm_intel >= 2.4.75], [INTEL=yes], [INTEL=no])
Robert Foss0fbab812016-07-27 13:17:35 -0400230fi
231if test "x$INTEL" = xyes; then
Jani Nikulab30ff3b2017-03-01 13:25:52 +0200232 PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.75])
Robert Foss0fbab812016-07-27 13:17:35 -0400233 AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support])
Robert Foss0fbab812016-07-27 13:17:35 -0400234else
Emil Velikov31a00b12016-10-26 17:18:47 +0100235 DRM_INTEL_CFLAGS=-I$\(top_srcdir\)/lib/stubs/drm/
236 DRM_INTEL_LIBS=
Robert Foss0fbab812016-07-27 13:17:35 -0400237fi
Emil Velikov31a00b12016-10-26 17:18:47 +0100238DRM_CFLAGS="$DRM_CFLAGS $DRM_INTEL_CFLAGS"
239DRM_LIBS="$DRM_LIBS $DRM_INTEL_LIBS"
240AC_SUBST([DRM_CFLAGS])
241AC_SUBST([DRM_LIBS])
242
Robert Foss0fbab812016-07-27 13:17:35 -0400243AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes])
244
Chris Wilson36b92e82017-04-22 13:45:18 +0100245AC_ARG_ENABLE(amdgpu, AS_HELP_STRING([--disable-amdgpu],
246 [Enable building of amdgpu tests (default: auto)]),
247 [AMDGPU=$enableval], [AMDGPU=auto])
248if test "x$AMDGPU" = xauto; then
249 PKG_CHECK_EXISTS([libdrm_amdgpu], [AMDGPU=yes], [AMDGPU=no])
250fi
251if test "x$AMDGPU" = xyes; then
Arkadiusz Hiler8cb56562017-07-04 16:28:58 +0300252 PKG_CHECK_MODULES(DRM_AMDGPU, [libdrm_amdgpu >= 2.4.76])
Chris Wilson36b92e82017-04-22 13:45:18 +0100253 AC_DEFINE(HAVE_LIBDRM_AMDGPU, 1, [Have amdgpu support])
254fi
255AM_CONDITIONAL(HAVE_LIBDRM_AMDGPU, [test "x$AMDGPU" = xyes])
256
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800257# for dma-buf tests
258AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
Matt Turnercd460f12013-10-10 20:54:25 -0700259 [Enable use of nouveau API for prime tests (default: auto)]),
260 [NOUVEAU=$enableval], [NOUVEAU=auto])
261if test "x$NOUVEAU" = xauto; then
262 PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no])
263fi
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800264if test "x$NOUVEAU" = xyes; then
265 PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
Robert Foss5bde1482016-07-27 13:17:36 -0400266 AC_DEFINE(HAVE_LIBDRM_NOUVEAU, 1, [Have nouveau support])
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800267fi
Robert Foss5bde1482016-07-27 13:17:36 -0400268AM_CONDITIONAL(HAVE_LIBDRM_NOUVEAU, [test "x$NOUVEAU" = xyes])
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800269
Eric Anholtceca9ef2016-01-25 11:40:15 -0800270AC_ARG_ENABLE(vc4, AS_HELP_STRING([--disable-vc4],
271 [Enable building of vc4 tests (default: auto)]),
272 [VC4=$enableval], [VC4=auto])
273if test "x$VC4" = xauto; then
274 PKG_CHECK_EXISTS([libdrm_vc4], [VC4=yes], [VC4=no])
275fi
276if test "x$VC4" = xyes; then
277 PKG_CHECK_MODULES(DRM_VC4, [libdrm_vc4])
Robert Foss5bde1482016-07-27 13:17:36 -0400278 AC_DEFINE(HAVE_LIBDRM_VC4, 1, [Have vc4 support])
Eric Anholtceca9ef2016-01-25 11:40:15 -0800279fi
Robert Foss5bde1482016-07-27 13:17:36 -0400280AM_CONDITIONAL(HAVE_LIBDRM_VC4, [test "x$VC4" = xyes])
Eric Anholtceca9ef2016-01-25 11:40:15 -0800281
Ben Widawsky94b2b862013-12-20 21:15:16 -0800282# Define a configure option for the shader debugger
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500283AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800284 [Enable shader debugging support [autodetected]]),
Chris Wilson102943d2016-04-25 18:35:49 +0100285 [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=no])
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500286
Ben Widawsky94b2b862013-12-20 21:15:16 -0800287# Shader debugger depends on python3, intel-genasm and objcopy
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500288if test "x$BUILD_SHADER_DEBUGGER" != xno; then
Ben Widawsky94b2b862013-12-20 21:15:16 -0800289 # Check that the assembler is built
Ben Widawsky9d6cfa62013-12-30 10:41:43 -0800290 if test "x$enable_assembler" = xno; then
Ben Widawsky01eeab92014-01-02 19:33:57 -1000291 BUILD_SHADER_DEBUGGER=no
Ben Widawsky9d6cfa62013-12-30 10:41:43 -0800292 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
293 AC_MSG_ERROR([Shader debugger requested, but assembler not enabled.])
294 fi
Ben Widawsky94b2b862013-12-20 21:15:16 -0800295 fi
296
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800297 # Check Python 3 is installed
298 if test "$PYTHON" = ":" ; then
299 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
300 AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
301 else
302 BUILD_SHADER_DEBUGGER=no
303 fi
Ben Widawsky15830ea2011-10-31 13:36:50 -0700304 fi
Ben Widawsky94b2b862013-12-20 21:15:16 -0800305
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800306 # Check for the objcopy GNU binary utiliy command
307 AC_PATH_PROGS([OBJCOPY], objcopy)
308 if test -z "$OBJCOPY" ; then
309 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
310 AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
311 else
312 BUILD_SHADER_DEBUGGER=no
313 fi
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500314 fi
Ben Widawsky62873792011-06-24 11:42:03 -0700315fi
316
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500317AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
Damien Lespiau764b9e52013-03-04 15:59:00 +0000318AS_IF([test "x$BUILD_SHADER_DEBUGGER" != xno],
Damien Lespiau5d526892013-01-22 08:35:15 +0000319 [enable_debugger=yes], [enable_debugger=no])
320
Thomas Wood277ca2b2015-03-13 17:02:12 +0000321AC_ARG_WITH(libunwind,
322 AS_HELP_STRING([--without-libunwind],
323 [Build tests without libunwind support]),
324 [], [with_libunwind=yes])
325if test "x$with_libunwind" = xyes; then
326 PKG_CHECK_MODULES(LIBUNWIND, libunwind, AC_DEFINE(HAVE_LIBUNWIND, 1, [libunwind support]),
327 AC_MSG_ERROR([libunwind not found. Use --without-libunwind to disable libunwind support.]))
328fi
329
Thomas Wood76dad7f2015-03-23 11:46:25 +0000330# enable debug symbols
331AC_ARG_ENABLE(debug,
332 AS_HELP_STRING([--disable-debug],
333 [Build tests without debug symbols]),
334 [], [enable_debug=yes])
335
marius vlad701d8fd2016-05-10 17:32:15 +0300336AC_ARG_ENABLE(werror,
337 AS_HELP_STRING([--enable-werror],
338 [Fail on warnings]),
339 [], [enable_werror=no])
340
Thomas Wood76dad7f2015-03-23 11:46:25 +0000341if test "x$enable_debug" = xyes; then
342 AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"])
343 AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives
344 [DEBUG_CFLAGS+=" -O0"])
345 AC_SUBST([DEBUG_CFLAGS])
346fi
347
marius vlad701d8fd2016-05-10 17:32:15 +0300348if test "x$enable_werror" = xyes; then
349 AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"])
350fi
351
Damien Lespiaue5653d52015-07-01 23:40:36 +0100352# prevent relinking the world on every commit for developers
353AC_ARG_ENABLE(git-hash,
354 AS_HELP_STRING([--disable-git-hash],
355 [Do not use git hash in version]),
356 [git_hash=$enableval], [git_hash=yes])
Damien Lespiauec9e5992015-07-02 14:59:25 +0100357AC_SUBST(GIT_HASH, [$git_hash])
Damien Lespiaue5653d52015-07-01 23:40:36 +0100358
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500359# -----------------------------------------------------------------------------
360
Alan Coopersmith504c4fa2012-01-06 15:45:29 -0800361# To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
362XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt])
363AC_SUBST([THREAD_CFLAGS])
364
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200365AC_ARG_ENABLE(tests,
366 AS_HELP_STRING([--disable-tests],
367 [Disable tests build (default: enabled)]),
368 [BUILD_TESTS=$enableval], [BUILD_TESTS="yes"])
369if test "x$BUILD_TESTS" = xyes; then
370 AC_DEFINE(BUILD_TESTS, 1, [Build tests])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200371fi
372AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes])
Daniel Vetter831a4712013-12-10 09:23:44 +0100373AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200374
Thomas Wood48394472014-10-16 14:23:24 +0100375files="broadwell cherryview haswell ivybridge sandybridge valleyview skylake"
Thomas Woodc54ee982014-06-06 15:28:50 +0100376for file in $files; do
Thomas Wood9ecb50e2015-09-04 14:46:45 +0100377 REGISTER_FILES="$REGISTER_FILES $file `cat $srcdir/tools/registers/$file`"
Thomas Woodc54ee982014-06-06 15:28:50 +0100378done
Thomas Wood9ecb50e2015-09-04 14:46:45 +0100379REGISTER_FILES=`echo $REGISTER_FILES | tr ' ' '\n' | sort -u | tr '\n' ' '`
380AC_SUBST(REGISTER_FILES)
Thomas Woodc54ee982014-06-06 15:28:50 +0100381
Javier Jardón68b64f12011-02-08 22:33:12 +0000382AC_CONFIG_FILES([
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800383 Makefile
384 benchmarks/Makefile
385 demos/Makefile
Thomas Wood14ea2a02014-03-11 16:04:28 +0000386 docs/Makefile
387 docs/reference/Makefile
388 docs/reference/intel-gpu-tools/Makefile
389 docs/reference/intel-gpu-tools/version.xml
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800390 lib/Makefile
Daniel Vetter685e5772014-10-27 15:08:50 +0100391 lib/tests/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800392 man/Makefile
393 scripts/Makefile
Ben Widawsky3a752a32013-02-07 10:30:03 -0800394 tests/Makefile
Petri Latvala86486552017-06-09 14:32:17 +0300395 tests/intel-ci/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800396 tools/Makefile
Mika Kuoppalad60d4c82014-04-10 15:15:13 +0300397 tools/null_state_gen/Makefile
Thomas Woodaf979182015-08-25 11:30:11 +0100398 tools/registers/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800399 debugger/Makefile
400 debugger/system_routine/Makefile
Damien Lespiau191c8592013-01-14 23:21:21 +0000401 assembler/Makefile
402 assembler/doc/Makefile
403 assembler/test/Makefile
404 assembler/intel-gen4asm.pc
Chris Wilsonf9a50de2013-08-17 11:12:07 +0100405 overlay/Makefile
Kristian Høgsberg Kristensen5f9bc982015-08-05 11:55:09 -0700406 ])
407
408AC_CONFIG_FILES([tools/intel_aubdump], [chmod +x tools/intel_aubdump])
Kristian Høgsberg Kristensene6a5d792015-07-29 23:12:16 -0700409
Javier Jardón68b64f12011-02-08 22:33:12 +0000410AC_OUTPUT
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800411
Damien Lespiau54357082013-01-21 23:02:36 +0000412# Print a summary of the compilation
413echo ""
414echo "Intel GPU tools"
415
416echo ""
Damien Lespiau94444ae2013-07-19 16:08:11 +0100417echo " • Tests:"
418echo " Build tests : ${BUILD_TESTS}"
Paul Kocialkowskif1454752017-07-26 11:11:54 +0300419echo " Chamelium tests : ${enable_chamelium}"
Damien Lespiau94444ae2013-07-19 16:08:11 +0100420echo " Compile prime tests: ${NOUVEAU}"
Thomas Wood277ca2b2015-03-13 17:02:12 +0000421echo " Print stack traces : ${with_libunwind}"
Thomas Wood76dad7f2015-03-23 11:46:25 +0000422echo " Debug flags : ${DEBUG_CFLAGS}"
Damien Lespiau94444ae2013-07-19 16:08:11 +0100423echo ""
Damien Lespiau54357082013-01-21 23:02:36 +0000424echo " • Tools:"
Damien Lespiau94444ae2013-07-19 16:08:11 +0100425echo " Assembler : ${enable_assembler}"
426echo " Debugger : ${enable_debugger}"
Damien Lespiaub5acc102013-08-20 14:18:58 +0100427echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}"
Daniel Stonebccc0ec2016-01-25 18:33:12 +0000428echo " x86-specific tools : ${build_x86}"
Damien Lespiau54357082013-01-21 23:02:36 +0000429echo ""
Daniel Vettera90846a2014-03-11 21:03:39 +0100430echo " • API-Documentation : ${enable_gtk_doc}"
Marius Vlad3ce58b62016-05-31 18:33:24 +0300431echo " • Fail on warnings : ${enable_werror}"
Daniel Vettera90846a2014-03-11 21:03:39 +0100432echo ""
Damien Lespiau54357082013-01-21 23:02:36 +0000433
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800434# vim: set ft=config ts=8 sw=8 tw=0 noet :