Eric Anholt | 8c64183 | 2009-03-26 17:15:11 -0700 | [diff] [blame] | 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 | |
Gaetan Nadon | d63a1f6 | 2012-01-03 21:12:25 -0500 | [diff] [blame] | 23 | AC_PREREQ([2.60]) |
Eric Anholt | 1eabfa9 | 2009-03-27 16:03:12 -0700 | [diff] [blame] | 24 | AC_INIT([intel-gpu-tools], |
Petri Latvala | d492abf | 2017-06-09 16:27:11 +0300 | [diff] [blame] | 25 | [1.19], |
Mike Frysinger | e73e398 | 2016-06-22 07:08:03 -0400 | [diff] [blame] | 26 | [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI&component=IGT], |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 27 | [intel-gpu-tools]) |
Eric Anholt | 8c64183 | 2009-03-26 17:15:11 -0700 | [diff] [blame] | 28 | |
| 29 | AC_CONFIG_SRCDIR([Makefile.am]) |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 30 | AC_CONFIG_HEADERS([config.h]) |
| 31 | AC_CONFIG_MACRO_DIR([m4]) |
| 32 | AC_CONFIG_AUX_DIR([build-aux]) |
Alan Coopersmith | 504c4fa | 2012-01-06 15:45:29 -0800 | [diff] [blame] | 33 | AC_USE_SYSTEM_EXTENSIONS |
Chris Wilson | d364c28 | 2012-03-14 10:59:51 +0000 | [diff] [blame] | 34 | AC_SYS_LARGEFILE |
Ben Widawsky | 8af53e0 | 2012-03-24 19:03:38 -0700 | [diff] [blame] | 35 | AC_GNU_SOURCE |
Daniel Vetter | 831a471 | 2013-12-10 09:23:44 +0100 | [diff] [blame] | 36 | AC_CANONICAL_HOST |
Daniel Stone | bccc0ec | 2016-01-25 18:33:12 +0000 | [diff] [blame] | 37 | AC_CANONICAL_TARGET |
Eric Anholt | 8c64183 | 2009-03-26 17:15:11 -0700 | [diff] [blame] | 38 | |
Damien Lespiau | fd772e3 | 2015-06-05 15:51:40 +0100 | [diff] [blame] | 39 | AM_INIT_AUTOMAKE([1.12 foreign subdir-objects dist-bzip2]) |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 40 | AM_PATH_PYTHON([3],, [:]) |
Eric Anholt | 8c64183 | 2009-03-26 17:15:11 -0700 | [diff] [blame] | 41 | |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 42 | AC_PROG_CC |
Tvrtko Ursulin | d9dcfc3 | 2017-05-26 12:11:04 +0100 | [diff] [blame] | 43 | AC_PROG_LEX |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 44 | AC_PROG_YACC |
| 45 | |
Thomas Wood | 14ea2a0 | 2014-03-11 16:04:28 +0000 | [diff] [blame] | 46 | # check for gtk-doc |
| 47 | m4_ifdef([GTK_DOC_CHECK], [ |
| 48 | GTK_DOC_CHECK([1.14],[--flavour no-tmpl]) |
| 49 | ],[ |
| 50 | AM_CONDITIONAL([ENABLE_GTK_DOC], false) |
Damien Lespiau | c196c14 | 2014-03-21 14:36:54 +0000 | [diff] [blame] | 51 | enable_gtk_doc=no |
Thomas Wood | 14ea2a0 | 2014-03-11 16:04:28 +0000 | [diff] [blame] | 52 | ]) |
| 53 | |
Jani Nikula | 4650d34 | 2015-04-14 22:33:33 +0300 | [diff] [blame] | 54 | # check for rst2man for generating man pages |
| 55 | AC_CHECK_PROG(RST2MAN, rst2man, yes, no) |
| 56 | AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = xyes]) |
Thomas Wood | 14ea2a0 | 2014-03-11 16:04:28 +0000 | [diff] [blame] | 57 | |
Alan Coopersmith | 9ebb860 | 2012-01-06 14:37:16 -0800 | [diff] [blame] | 58 | # Checks for functions, headers, structures, etc. |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 59 | AC_HEADER_STDC |
Thomas Wood | 80f1553 | 2015-07-16 11:41:32 +0100 | [diff] [blame] | 60 | AC_CHECK_HEADERS([termios.h linux/kd.h sys/kd.h libgen.h sys/io.h]) |
Alan Coopersmith | 9ebb860 | 2012-01-06 14:37:16 -0800 | [diff] [blame] | 61 | AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 62 | #include <sys/sysinfo.h> |
| 63 | ]) |
Alan Coopersmith | 95ea5d5 | 2014-12-23 19:07:12 -0800 | [diff] [blame] | 64 | AC_CHECK_TYPES([sighandler_t],[],[],[AC_INCLUDES_DEFAULT |
| 65 | #include <signal.h>]) |
Alan Coopersmith | fbae138 | 2012-01-23 20:13:49 -0800 | [diff] [blame] | 66 | AC_CHECK_FUNCS([swapctl]) |
Ben Widawsky | 8af53e0 | 2012-03-24 19:03:38 -0700 | [diff] [blame] | 67 | AC_CHECK_FUNCS([asprintf]) |
Lyude | 31811f4 | 2016-12-21 14:00:54 -0500 | [diff] [blame] | 68 | AX_GCC_FUNC_ATTRIBUTE([constructor]) |
Alan Coopersmith | 9ebb860 | 2012-01-06 14:37:16 -0800 | [diff] [blame] | 69 | |
Chris Wilson | d545610 | 2016-03-19 13:04:02 +0000 | [diff] [blame] | 70 | dnl Check for POSIX timers |
| 71 | AC_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 | ]) |
| 82 | AC_SUBST(TIMER_LIBS) |
| 83 | |
Chris Wilson | 545fe0f | 2016-07-11 12:39:01 +0100 | [diff] [blame] | 84 | dnl Check for CPUID |
| 85 | cpuid="yes" |
| 86 | AC_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 | ) |
| 99 | if test "x$cpuid" = "xyes"; then |
| 100 | AC_DEFINE(HAVE_CPUID_H, 1, [Found a useable cpuid.h]) |
| 101 | fi |
| 102 | |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 103 | # Initialize libtool |
Gaetan Nadon | 65db78f | 2012-01-03 21:13:39 -0500 | [diff] [blame] | 104 | AC_DISABLE_STATIC |
| 105 | AC_PROG_LIBTOOL |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 106 | |
Alan Coopersmith | 504c4fa | 2012-01-06 15:45:29 -0800 | [diff] [blame] | 107 | # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG |
Gaetan Nadon | 1722b78 | 2012-01-03 21:12:22 -0500 | [diff] [blame] | 108 | m4_ifndef([XORG_MACROS_VERSION], |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 109 | [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])]) |
Alan Coopersmith | 504c4fa | 2012-01-06 15:45:29 -0800 | [diff] [blame] | 110 | XORG_MACROS_VERSION(1.16) |
Gaetan Nadon | 1722b78 | 2012-01-03 21:12:22 -0500 | [diff] [blame] | 111 | XORG_DEFAULT_OPTIONS |
| 112 | |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 113 | # warning flags for the assembler. We can't quite use CWARNFLAGS for it yet as |
Damien Lespiau | 54ec3cb | 2013-07-19 16:03:29 +0100 | [diff] [blame] | 114 | # it generates waaaay too many warnings. |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 115 | ASSEMBLER_WARN_CFLAGS="" |
| 116 | if test "x$GCC" = "xyes"; then |
Damien Lespiau | 7902f2c | 2013-01-19 23:25:22 +0000 | [diff] [blame] | 117 | ASSEMBLER_WARN_CFLAGS="-Wall -Wstrict-prototypes \ |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 118 | -Wmissing-prototypes -Wmissing-declarations \ |
| 119 | -Wnested-externs -fno-strict-aliasing" |
| 120 | fi |
| 121 | AC_SUBST(ASSEMBLER_WARN_CFLAGS) |
| 122 | |
Dave Airlie | 0c514b0 | 2017-08-14 17:07:05 +1000 | [diff] [blame] | 123 | PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.82]) |
Eric Anholt | 8c64183 | 2009-03-26 17:15:11 -0700 | [diff] [blame] | 124 | PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) |
Chris Wilson | 2021ef6 | 2016-11-26 16:13:13 +0000 | [diff] [blame] | 125 | PKG_CHECK_MODULES(KMOD, [libkmod]) |
Arkadiusz Hiler | d7d3f4e | 2017-04-12 12:24:42 +0200 | [diff] [blame] | 126 | PKG_CHECK_MODULES(PROCPS, [libprocps], [procps=yes], [procps=no]) |
| 127 | AM_CONDITIONAL(HAVE_PROCPS, [test "x$procps" = xyes]) |
| 128 | if test x"$procps" = xyes; then |
| 129 | AC_DEFINE(HAVE_PROCPS,1,[Enable process managment without shelling out]) |
| 130 | fi |
Maarten Lankhorst | d930b64 | 2017-02-09 10:42:01 +0100 | [diff] [blame] | 131 | PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no]) |
| 132 | |
| 133 | if test x$have_valgrind = xyes; then |
| 134 | AC_DEFINE(HAVE_VALGRIND, 1, [Enable valgrind annotation support.]) |
| 135 | fi |
Daniel Stone | bccc0ec | 2016-01-25 18:33:12 +0000 | [diff] [blame] | 136 | |
| 137 | case "$target_cpu" in |
Ville Syrjälä | 764d668 | 2016-10-12 19:03:49 +0300 | [diff] [blame] | 138 | x86*|i?86) |
Daniel Stone | bccc0ec | 2016-01-25 18:33:12 +0000 | [diff] [blame] | 139 | build_x86="yes" |
| 140 | ;; |
| 141 | *) |
| 142 | build_x86="no" |
| 143 | ;; |
| 144 | esac |
| 145 | |
| 146 | if 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]) |
| 152 | else |
| 153 | enable_overlay_xvlib="no" |
| 154 | enable_overlay_xlib="no" |
| 155 | enable_assembler="no" |
| 156 | BUILD_SHADER_DEBUGGER="no" |
| 157 | fi |
| 158 | AM_CONDITIONAL(BUILD_X86, [test "x$build_x86" = xyes]) |
| 159 | |
| 160 | AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes]) |
Chris Wilson | f9a50de | 2013-08-17 11:12:07 +0100 | [diff] [blame] | 161 | |
Chris Wilson | 34e4780 | 2013-08-18 21:10:26 +0100 | [diff] [blame] | 162 | AM_CONDITIONAL(BUILD_OVERLAY_XVLIB, [test "x$enable_overlay_xvlib" = xyes]) |
| 163 | AM_CONDITIONAL(BUILD_OVERLAY_XLIB, [test "x$enable_overlay_xlib" = xyes]) |
| 164 | AM_CONDITIONAL(BUILD_OVERLAY, [test "x$enable_overlay_xlib" = xyes -o "x$enable_overlay_xvlib"]) |
| 165 | if test x$enable_overlay_xvlib = xyes; then |
| 166 | AC_DEFINE(HAVE_OVERLAY_XVLIB, 1, [Enable XV backend]) |
| 167 | fi |
| 168 | if test x$enable_overlay_xlib = xyes; then |
| 169 | AC_DEFINE(HAVE_OVERLAY_XLIB, 1, [Enable X backend]) |
| 170 | fi |
Chris Wilson | ddcd1b2 | 2013-08-27 14:25:38 +0100 | [diff] [blame] | 171 | PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXrandr]), [have_xrandr=no]) |
Eric Anholt | 8c64183 | 2009-03-26 17:15:11 -0700 | [diff] [blame] | 172 | |
Daniel Vetter | 08ccec1 | 2012-01-19 13:01:03 +0100 | [diff] [blame] | 173 | # for testdisplay |
Damien Lespiau | 0193b69 | 2013-07-17 16:25:29 +0100 | [diff] [blame] | 174 | PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0]) |
Daniel Vetter | fa46120 | 2012-01-24 11:28:25 +0100 | [diff] [blame] | 175 | PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no]) |
Navare, Manasi D | 9f33697 | 2017-01-23 18:48:53 -0800 | [diff] [blame] | 176 | AM_CONDITIONAL(HAVE_UDEV, [test "x$udev" = xyes]) |
Daniel Vetter | fa46120 | 2012-01-24 11:28:25 +0100 | [diff] [blame] | 177 | if test x"$udev" = xyes; then |
| 178 | AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection]) |
| 179 | fi |
Paul Kocialkowski | 4c70d6e | 2017-07-19 17:58:59 +0300 | [diff] [blame] | 180 | PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes], [glib=no]) |
| 181 | if test x"$glib" = xyes; then |
| 182 | AC_DEFINE(HAVE_GLIB,1,[Enable glib support]) |
| 183 | fi |
Paul Kocialkowski | 8cf32fe | 2017-07-20 18:13:36 +0300 | [diff] [blame] | 184 | PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no]) |
| 185 | AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes]) |
Jesse Barnes | 5406c63 | 2010-12-21 09:38:23 -0800 | [diff] [blame] | 186 | |
Lyude | c99f8b7 | 2016-10-18 14:12:09 -0400 | [diff] [blame] | 187 | # for chamelium |
Paul Kocialkowski | f145475 | 2017-07-26 11:11:54 +0300 | [diff] [blame] | 188 | AC_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]) |
Lyude | fd096fc | 2017-07-17 19:38:32 -0400 | [diff] [blame] | 192 | AM_CONDITIONAL(HAVE_CHAMELIUM, [test "x$enable_chamelium" = xyes]) |
| 193 | if test "x$enable_chamelium" = xyes; then |
Petri Latvala | 28ed1c4 | 2017-08-03 16:34:45 +0300 | [diff] [blame] | 194 | 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 |
Lyude | fd096fc | 2017-07-17 19:38:32 -0400 | [diff] [blame] | 207 | PKG_CHECK_MODULES(PIXMAN, pixman-1, [], |
Paul Kocialkowski | f145475 | 2017-07-26 11:11:54 +0300 | [diff] [blame] | 208 | [AC_MSG_ERROR([Failed to find pixman, required by chamelium.])]) |
Paul Kocialkowski | cae9270 | 2017-07-25 15:48:23 +0300 | [diff] [blame] | 209 | if test x"$udev" != xyes; then |
Paul Kocialkowski | f145475 | 2017-07-26 11:11:54 +0300 | [diff] [blame] | 210 | AC_MSG_ERROR([Failed to find udev, required by chamelium.]) |
Paul Kocialkowski | cae9270 | 2017-07-25 15:48:23 +0300 | [diff] [blame] | 211 | fi |
Paul Kocialkowski | 4c70d6e | 2017-07-19 17:58:59 +0300 | [diff] [blame] | 212 | if test x"$glib" != xyes; then |
Paul Kocialkowski | f145475 | 2017-07-26 11:11:54 +0300 | [diff] [blame] | 213 | AC_MSG_ERROR([Failed to find glib, required by chamelium.]) |
Paul Kocialkowski | 4c70d6e | 2017-07-19 17:58:59 +0300 | [diff] [blame] | 214 | fi |
Paul Kocialkowski | e246ff0 | 2017-07-20 18:13:37 +0300 | [diff] [blame] | 215 | if test x"$gsl" != xyes; then |
Paul Kocialkowski | f145475 | 2017-07-26 11:11:54 +0300 | [diff] [blame] | 216 | AC_MSG_ERROR([Failed to find gsl, required by chamelium.]) |
Paul Kocialkowski | e246ff0 | 2017-07-20 18:13:37 +0300 | [diff] [blame] | 217 | fi |
| 218 | |
Petri Latvala | d8c6cf9 | 2017-06-08 10:47:00 +0300 | [diff] [blame] | 219 | AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support]) |
| 220 | fi |
Lyude | c99f8b7 | 2016-10-18 14:12:09 -0400 | [diff] [blame] | 221 | |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 222 | # ----------------------------------------------------------------------------- |
| 223 | # Configuration options |
| 224 | # ----------------------------------------------------------------------------- |
Robert Foss | 0fbab81 | 2016-07-27 13:17:35 -0400 | [diff] [blame] | 225 | AC_ARG_ENABLE(intel, AS_HELP_STRING([--disable-intel], |
| 226 | [Enable building of intel specific parts (default: auto)]), |
| 227 | [INTEL=$enableval], [INTEL=auto]) |
| 228 | if test "x$INTEL" = xauto; then |
Daniel Vetter | b389bdb | 2017-07-07 13:56:02 +0200 | [diff] [blame] | 229 | PKG_CHECK_EXISTS([libdrm_intel >= 2.4.75], [INTEL=yes], [INTEL=no]) |
Robert Foss | 0fbab81 | 2016-07-27 13:17:35 -0400 | [diff] [blame] | 230 | fi |
| 231 | if test "x$INTEL" = xyes; then |
Jani Nikula | b30ff3b | 2017-03-01 13:25:52 +0200 | [diff] [blame] | 232 | PKG_CHECK_MODULES(DRM_INTEL, [libdrm_intel >= 2.4.75]) |
Robert Foss | 0fbab81 | 2016-07-27 13:17:35 -0400 | [diff] [blame] | 233 | AC_DEFINE(HAVE_LIBDRM_INTEL, 1, [Have intel support]) |
Robert Foss | 0fbab81 | 2016-07-27 13:17:35 -0400 | [diff] [blame] | 234 | else |
Emil Velikov | 31a00b1 | 2016-10-26 17:18:47 +0100 | [diff] [blame] | 235 | DRM_INTEL_CFLAGS=-I$\(top_srcdir\)/lib/stubs/drm/ |
| 236 | DRM_INTEL_LIBS= |
Robert Foss | 0fbab81 | 2016-07-27 13:17:35 -0400 | [diff] [blame] | 237 | fi |
Emil Velikov | 31a00b1 | 2016-10-26 17:18:47 +0100 | [diff] [blame] | 238 | DRM_CFLAGS="$DRM_CFLAGS $DRM_INTEL_CFLAGS" |
| 239 | DRM_LIBS="$DRM_LIBS $DRM_INTEL_LIBS" |
| 240 | AC_SUBST([DRM_CFLAGS]) |
| 241 | AC_SUBST([DRM_LIBS]) |
| 242 | |
Robert Foss | 0fbab81 | 2016-07-27 13:17:35 -0400 | [diff] [blame] | 243 | AM_CONDITIONAL(HAVE_LIBDRM_INTEL, [test "x$INTEL" = xyes]) |
| 244 | |
Chris Wilson | 36b92e8 | 2017-04-22 13:45:18 +0100 | [diff] [blame] | 245 | AC_ARG_ENABLE(amdgpu, AS_HELP_STRING([--disable-amdgpu], |
| 246 | [Enable building of amdgpu tests (default: auto)]), |
| 247 | [AMDGPU=$enableval], [AMDGPU=auto]) |
| 248 | if test "x$AMDGPU" = xauto; then |
| 249 | PKG_CHECK_EXISTS([libdrm_amdgpu], [AMDGPU=yes], [AMDGPU=no]) |
| 250 | fi |
| 251 | if test "x$AMDGPU" = xyes; then |
Arkadiusz Hiler | 8cb5656 | 2017-07-04 16:28:58 +0300 | [diff] [blame] | 252 | PKG_CHECK_MODULES(DRM_AMDGPU, [libdrm_amdgpu >= 2.4.76]) |
Chris Wilson | 36b92e8 | 2017-04-22 13:45:18 +0100 | [diff] [blame] | 253 | AC_DEFINE(HAVE_LIBDRM_AMDGPU, 1, [Have amdgpu support]) |
| 254 | fi |
| 255 | AM_CONDITIONAL(HAVE_LIBDRM_AMDGPU, [test "x$AMDGPU" = xyes]) |
| 256 | |
Ben Widawsky | 66ec9bd | 2013-02-07 08:29:24 -0800 | [diff] [blame] | 257 | # for dma-buf tests |
| 258 | AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau], |
Matt Turner | cd460f1 | 2013-10-10 20:54:25 -0700 | [diff] [blame] | 259 | [Enable use of nouveau API for prime tests (default: auto)]), |
| 260 | [NOUVEAU=$enableval], [NOUVEAU=auto]) |
| 261 | if test "x$NOUVEAU" = xauto; then |
| 262 | PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no]) |
| 263 | fi |
Ben Widawsky | 66ec9bd | 2013-02-07 08:29:24 -0800 | [diff] [blame] | 264 | if test "x$NOUVEAU" = xyes; then |
| 265 | PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33]) |
Robert Foss | 5bde148 | 2016-07-27 13:17:36 -0400 | [diff] [blame] | 266 | AC_DEFINE(HAVE_LIBDRM_NOUVEAU, 1, [Have nouveau support]) |
Ben Widawsky | 66ec9bd | 2013-02-07 08:29:24 -0800 | [diff] [blame] | 267 | fi |
Robert Foss | 5bde148 | 2016-07-27 13:17:36 -0400 | [diff] [blame] | 268 | AM_CONDITIONAL(HAVE_LIBDRM_NOUVEAU, [test "x$NOUVEAU" = xyes]) |
Ben Widawsky | 66ec9bd | 2013-02-07 08:29:24 -0800 | [diff] [blame] | 269 | |
Eric Anholt | ceca9ef | 2016-01-25 11:40:15 -0800 | [diff] [blame] | 270 | AC_ARG_ENABLE(vc4, AS_HELP_STRING([--disable-vc4], |
| 271 | [Enable building of vc4 tests (default: auto)]), |
| 272 | [VC4=$enableval], [VC4=auto]) |
| 273 | if test "x$VC4" = xauto; then |
| 274 | PKG_CHECK_EXISTS([libdrm_vc4], [VC4=yes], [VC4=no]) |
| 275 | fi |
| 276 | if test "x$VC4" = xyes; then |
| 277 | PKG_CHECK_MODULES(DRM_VC4, [libdrm_vc4]) |
Robert Foss | 5bde148 | 2016-07-27 13:17:36 -0400 | [diff] [blame] | 278 | AC_DEFINE(HAVE_LIBDRM_VC4, 1, [Have vc4 support]) |
Eric Anholt | ceca9ef | 2016-01-25 11:40:15 -0800 | [diff] [blame] | 279 | fi |
Robert Foss | 5bde148 | 2016-07-27 13:17:36 -0400 | [diff] [blame] | 280 | AM_CONDITIONAL(HAVE_LIBDRM_VC4, [test "x$VC4" = xyes]) |
Eric Anholt | ceca9ef | 2016-01-25 11:40:15 -0800 | [diff] [blame] | 281 | |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 282 | # Define a configure option for the shader debugger |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 283 | AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger], |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 284 | [Enable shader debugging support [autodetected]]), |
Chris Wilson | 102943d | 2016-04-25 18:35:49 +0100 | [diff] [blame] | 285 | [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=no]) |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 286 | |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 287 | # Shader debugger depends on python3, intel-genasm and objcopy |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 288 | if test "x$BUILD_SHADER_DEBUGGER" != xno; then |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 289 | # Check that the assembler is built |
Ben Widawsky | 9d6cfa6 | 2013-12-30 10:41:43 -0800 | [diff] [blame] | 290 | if test "x$enable_assembler" = xno; then |
Ben Widawsky | 01eeab9 | 2014-01-02 19:33:57 -1000 | [diff] [blame] | 291 | BUILD_SHADER_DEBUGGER=no |
Ben Widawsky | 9d6cfa6 | 2013-12-30 10:41:43 -0800 | [diff] [blame] | 292 | if test "x$BUILD_SHADER_DEBUGGER" = xyes; then |
| 293 | AC_MSG_ERROR([Shader debugger requested, but assembler not enabled.]) |
| 294 | fi |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 295 | fi |
| 296 | |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 297 | # 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 Widawsky | 15830ea | 2011-10-31 13:36:50 -0700 | [diff] [blame] | 304 | fi |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 305 | |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 306 | # 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 Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 314 | fi |
Ben Widawsky | 6287379 | 2011-06-24 11:42:03 -0700 | [diff] [blame] | 315 | fi |
| 316 | |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 317 | AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno]) |
Damien Lespiau | 764b9e5 | 2013-03-04 15:59:00 +0000 | [diff] [blame] | 318 | AS_IF([test "x$BUILD_SHADER_DEBUGGER" != xno], |
Damien Lespiau | 5d52689 | 2013-01-22 08:35:15 +0000 | [diff] [blame] | 319 | [enable_debugger=yes], [enable_debugger=no]) |
| 320 | |
Thomas Wood | 277ca2b | 2015-03-13 17:02:12 +0000 | [diff] [blame] | 321 | AC_ARG_WITH(libunwind, |
| 322 | AS_HELP_STRING([--without-libunwind], |
| 323 | [Build tests without libunwind support]), |
| 324 | [], [with_libunwind=yes]) |
| 325 | if 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.])) |
| 328 | fi |
| 329 | |
Thomas Wood | 76dad7f | 2015-03-23 11:46:25 +0000 | [diff] [blame] | 330 | # enable debug symbols |
| 331 | AC_ARG_ENABLE(debug, |
| 332 | AS_HELP_STRING([--disable-debug], |
| 333 | [Build tests without debug symbols]), |
| 334 | [], [enable_debug=yes]) |
| 335 | |
marius vlad | 701d8fd | 2016-05-10 17:32:15 +0300 | [diff] [blame] | 336 | AC_ARG_ENABLE(werror, |
| 337 | AS_HELP_STRING([--enable-werror], |
| 338 | [Fail on warnings]), |
| 339 | [], [enable_werror=no]) |
| 340 | |
Thomas Wood | 76dad7f | 2015-03-23 11:46:25 +0000 | [diff] [blame] | 341 | if 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]) |
| 346 | fi |
| 347 | |
marius vlad | 701d8fd | 2016-05-10 17:32:15 +0300 | [diff] [blame] | 348 | if test "x$enable_werror" = xyes; then |
| 349 | AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"]) |
| 350 | fi |
| 351 | |
Damien Lespiau | e5653d5 | 2015-07-01 23:40:36 +0100 | [diff] [blame] | 352 | # prevent relinking the world on every commit for developers |
| 353 | AC_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 Lespiau | ec9e599 | 2015-07-02 14:59:25 +0100 | [diff] [blame] | 357 | AC_SUBST(GIT_HASH, [$git_hash]) |
Damien Lespiau | e5653d5 | 2015-07-01 23:40:36 +0100 | [diff] [blame] | 358 | |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 359 | # ----------------------------------------------------------------------------- |
| 360 | |
Alan Coopersmith | 504c4fa | 2012-01-06 15:45:29 -0800 | [diff] [blame] | 361 | # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt |
| 362 | XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt]) |
| 363 | AC_SUBST([THREAD_CFLAGS]) |
| 364 | |
Rodrigo Vivi | 7c17072 | 2013-02-05 16:17:54 -0200 | [diff] [blame] | 365 | AC_ARG_ENABLE(tests, |
| 366 | AS_HELP_STRING([--disable-tests], |
| 367 | [Disable tests build (default: enabled)]), |
| 368 | [BUILD_TESTS=$enableval], [BUILD_TESTS="yes"]) |
| 369 | if test "x$BUILD_TESTS" = xyes; then |
| 370 | AC_DEFINE(BUILD_TESTS, 1, [Build tests]) |
Rodrigo Vivi | 7c17072 | 2013-02-05 16:17:54 -0200 | [diff] [blame] | 371 | fi |
| 372 | AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes]) |
Daniel Vetter | 831a471 | 2013-12-10 09:23:44 +0100 | [diff] [blame] | 373 | AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform]) |
Rodrigo Vivi | 7c17072 | 2013-02-05 16:17:54 -0200 | [diff] [blame] | 374 | |
Thomas Wood | 4839447 | 2014-10-16 14:23:24 +0100 | [diff] [blame] | 375 | files="broadwell cherryview haswell ivybridge sandybridge valleyview skylake" |
Thomas Wood | c54ee98 | 2014-06-06 15:28:50 +0100 | [diff] [blame] | 376 | for file in $files; do |
Thomas Wood | 9ecb50e | 2015-09-04 14:46:45 +0100 | [diff] [blame] | 377 | REGISTER_FILES="$REGISTER_FILES $file `cat $srcdir/tools/registers/$file`" |
Thomas Wood | c54ee98 | 2014-06-06 15:28:50 +0100 | [diff] [blame] | 378 | done |
Thomas Wood | 9ecb50e | 2015-09-04 14:46:45 +0100 | [diff] [blame] | 379 | REGISTER_FILES=`echo $REGISTER_FILES | tr ' ' '\n' | sort -u | tr '\n' ' '` |
| 380 | AC_SUBST(REGISTER_FILES) |
Thomas Wood | c54ee98 | 2014-06-06 15:28:50 +0100 | [diff] [blame] | 381 | |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 382 | AC_CONFIG_FILES([ |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 383 | Makefile |
| 384 | benchmarks/Makefile |
| 385 | demos/Makefile |
Thomas Wood | 14ea2a0 | 2014-03-11 16:04:28 +0000 | [diff] [blame] | 386 | docs/Makefile |
| 387 | docs/reference/Makefile |
| 388 | docs/reference/intel-gpu-tools/Makefile |
| 389 | docs/reference/intel-gpu-tools/version.xml |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 390 | lib/Makefile |
Daniel Vetter | 685e577 | 2014-10-27 15:08:50 +0100 | [diff] [blame] | 391 | lib/tests/Makefile |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 392 | man/Makefile |
| 393 | scripts/Makefile |
Ben Widawsky | 3a752a3 | 2013-02-07 10:30:03 -0800 | [diff] [blame] | 394 | tests/Makefile |
Petri Latvala | 8648655 | 2017-06-09 14:32:17 +0300 | [diff] [blame] | 395 | tests/intel-ci/Makefile |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 396 | tools/Makefile |
Mika Kuoppala | d60d4c8 | 2014-04-10 15:15:13 +0300 | [diff] [blame] | 397 | tools/null_state_gen/Makefile |
Thomas Wood | af97918 | 2015-08-25 11:30:11 +0100 | [diff] [blame] | 398 | tools/registers/Makefile |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 399 | debugger/Makefile |
| 400 | debugger/system_routine/Makefile |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 401 | assembler/Makefile |
| 402 | assembler/doc/Makefile |
| 403 | assembler/test/Makefile |
| 404 | assembler/intel-gen4asm.pc |
Chris Wilson | f9a50de | 2013-08-17 11:12:07 +0100 | [diff] [blame] | 405 | overlay/Makefile |
Kristian Høgsberg Kristensen | 5f9bc98 | 2015-08-05 11:55:09 -0700 | [diff] [blame] | 406 | ]) |
| 407 | |
| 408 | AC_CONFIG_FILES([tools/intel_aubdump], [chmod +x tools/intel_aubdump]) |
Kristian Høgsberg Kristensen | e6a5d79 | 2015-07-29 23:12:16 -0700 | [diff] [blame] | 409 | |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 410 | AC_OUTPUT |
Ben Widawsky | c75b8c6 | 2013-01-31 13:06:17 -0800 | [diff] [blame] | 411 | |
Damien Lespiau | 5435708 | 2013-01-21 23:02:36 +0000 | [diff] [blame] | 412 | # Print a summary of the compilation |
| 413 | echo "" |
| 414 | echo "Intel GPU tools" |
| 415 | |
| 416 | echo "" |
Damien Lespiau | 94444ae | 2013-07-19 16:08:11 +0100 | [diff] [blame] | 417 | echo " • Tests:" |
| 418 | echo " Build tests : ${BUILD_TESTS}" |
Paul Kocialkowski | f145475 | 2017-07-26 11:11:54 +0300 | [diff] [blame] | 419 | echo " Chamelium tests : ${enable_chamelium}" |
Damien Lespiau | 94444ae | 2013-07-19 16:08:11 +0100 | [diff] [blame] | 420 | echo " Compile prime tests: ${NOUVEAU}" |
Thomas Wood | 277ca2b | 2015-03-13 17:02:12 +0000 | [diff] [blame] | 421 | echo " Print stack traces : ${with_libunwind}" |
Thomas Wood | 76dad7f | 2015-03-23 11:46:25 +0000 | [diff] [blame] | 422 | echo " Debug flags : ${DEBUG_CFLAGS}" |
Damien Lespiau | 94444ae | 2013-07-19 16:08:11 +0100 | [diff] [blame] | 423 | echo "" |
Damien Lespiau | 5435708 | 2013-01-21 23:02:36 +0000 | [diff] [blame] | 424 | echo " • Tools:" |
Damien Lespiau | 94444ae | 2013-07-19 16:08:11 +0100 | [diff] [blame] | 425 | echo " Assembler : ${enable_assembler}" |
| 426 | echo " Debugger : ${enable_debugger}" |
Damien Lespiau | b5acc10 | 2013-08-20 14:18:58 +0100 | [diff] [blame] | 427 | echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}" |
Daniel Stone | bccc0ec | 2016-01-25 18:33:12 +0000 | [diff] [blame] | 428 | echo " x86-specific tools : ${build_x86}" |
Damien Lespiau | 5435708 | 2013-01-21 23:02:36 +0000 | [diff] [blame] | 429 | echo "" |
Daniel Vetter | a90846a | 2014-03-11 21:03:39 +0100 | [diff] [blame] | 430 | echo " • API-Documentation : ${enable_gtk_doc}" |
Marius Vlad | 3ce58b6 | 2016-05-31 18:33:24 +0300 | [diff] [blame] | 431 | echo " • Fail on warnings : ${enable_werror}" |
Daniel Vetter | a90846a | 2014-03-11 21:03:39 +0100 | [diff] [blame] | 432 | echo "" |
Damien Lespiau | 5435708 | 2013-01-21 23:02:36 +0000 | [diff] [blame] | 433 | |
Ben Widawsky | c75b8c6 | 2013-01-31 13:06:17 -0800 | [diff] [blame] | 434 | # vim: set ft=config ts=8 sw=8 tw=0 noet : |