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], |
Marius Vlad | 3ce58b6 | 2016-05-31 18:33:24 +0300 | [diff] [blame] | 25 | [1.15], |
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 |
| 43 | AM_PROG_LEX |
| 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]) |
Alan Coopersmith | 9ebb860 | 2012-01-06 14:37:16 -0800 | [diff] [blame] | 68 | |
Chris Wilson | d545610 | 2016-03-19 13:04:02 +0000 | [diff] [blame] | 69 | dnl Check for POSIX timers |
| 70 | AC_CHECK_FUNCS(timer_create, [], [ |
| 71 | AC_CHECK_LIB(rt, timer_create, [ |
| 72 | AC_DEFINE(HAVE_TIMER_CREATE, 1) |
| 73 | TIMER_LIBS="-lrt" |
| 74 | ], [ |
| 75 | AC_CHECK_LIB(pthread, timer_create, [ |
| 76 | AC_DEFINE(HAVE_TIMER_CREATE, 1) |
| 77 | TIMER_LIBS="-lpthread" |
| 78 | ]) |
| 79 | ]) |
| 80 | ]) |
| 81 | AC_SUBST(TIMER_LIBS) |
| 82 | |
Chris Wilson | 545fe0f | 2016-07-11 12:39:01 +0100 | [diff] [blame] | 83 | dnl Check for CPUID |
| 84 | cpuid="yes" |
| 85 | AC_TRY_LINK([ |
| 86 | #include <cpuid.h> |
| 87 | #include <stddef.h> |
| 88 | ], |
| 89 | [ |
| 90 | int eax, ebx, ecx, edx; |
| 91 | if (__get_cpuid_max(0, NULL) < 4) |
| 92 | return 0; |
| 93 | __cpuid_count(4, 0, eax, ebx, ecx, edx); |
| 94 | ], |
| 95 | [cpuid="yes"], |
| 96 | [cpuid="no"] |
| 97 | ) |
| 98 | if test "x$cpuid" = "xyes"; then |
| 99 | AC_DEFINE(HAVE_CPUID_H, 1, [Found a useable cpuid.h]) |
| 100 | fi |
| 101 | |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 102 | # Initialize libtool |
Gaetan Nadon | 65db78f | 2012-01-03 21:13:39 -0500 | [diff] [blame] | 103 | AC_DISABLE_STATIC |
| 104 | AC_PROG_LIBTOOL |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 105 | |
Alan Coopersmith | 504c4fa | 2012-01-06 15:45:29 -0800 | [diff] [blame] | 106 | # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG |
Gaetan Nadon | 1722b78 | 2012-01-03 21:12:22 -0500 | [diff] [blame] | 107 | m4_ifndef([XORG_MACROS_VERSION], |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 108 | [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] | 109 | XORG_MACROS_VERSION(1.16) |
Gaetan Nadon | 1722b78 | 2012-01-03 21:12:22 -0500 | [diff] [blame] | 110 | XORG_DEFAULT_OPTIONS |
| 111 | |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 112 | # 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] | 113 | # it generates waaaay too many warnings. |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 114 | ASSEMBLER_WARN_CFLAGS="" |
| 115 | if test "x$GCC" = "xyes"; then |
Damien Lespiau | 7902f2c | 2013-01-19 23:25:22 +0000 | [diff] [blame] | 116 | ASSEMBLER_WARN_CFLAGS="-Wall -Wstrict-prototypes \ |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 117 | -Wmissing-prototypes -Wmissing-declarations \ |
| 118 | -Wnested-externs -fno-strict-aliasing" |
| 119 | fi |
| 120 | AC_SUBST(ASSEMBLER_WARN_CFLAGS) |
| 121 | |
Marius Vlad | 360e967 | 2016-07-14 13:24:28 +0300 | [diff] [blame] | 122 | PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.67 libdrm]) |
Eric Anholt | 8c64183 | 2009-03-26 17:15:11 -0700 | [diff] [blame] | 123 | PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10]) |
Daniel Stone | bccc0ec | 2016-01-25 18:33:12 +0000 | [diff] [blame] | 124 | |
| 125 | case "$target_cpu" in |
| 126 | x86*) |
| 127 | build_x86="yes" |
| 128 | ;; |
| 129 | *) |
| 130 | build_x86="no" |
| 131 | ;; |
| 132 | esac |
| 133 | |
| 134 | if test x"$build_x86" = xyes; then |
| 135 | PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no) |
| 136 | PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no) |
| 137 | AS_IF([test x"$LEX" != "x:" -a x"$YACC" != xyacc], |
| 138 | [enable_assembler=yes], |
| 139 | [enable_assembler=no]) |
| 140 | else |
| 141 | enable_overlay_xvlib="no" |
| 142 | enable_overlay_xlib="no" |
| 143 | enable_assembler="no" |
| 144 | BUILD_SHADER_DEBUGGER="no" |
| 145 | fi |
| 146 | AM_CONDITIONAL(BUILD_X86, [test "x$build_x86" = xyes]) |
| 147 | |
| 148 | AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes]) |
Chris Wilson | f9a50de | 2013-08-17 11:12:07 +0100 | [diff] [blame] | 149 | |
Chris Wilson | 34e4780 | 2013-08-18 21:10:26 +0100 | [diff] [blame] | 150 | AM_CONDITIONAL(BUILD_OVERLAY_XVLIB, [test "x$enable_overlay_xvlib" = xyes]) |
| 151 | AM_CONDITIONAL(BUILD_OVERLAY_XLIB, [test "x$enable_overlay_xlib" = xyes]) |
| 152 | AM_CONDITIONAL(BUILD_OVERLAY, [test "x$enable_overlay_xlib" = xyes -o "x$enable_overlay_xvlib"]) |
| 153 | if test x$enable_overlay_xvlib = xyes; then |
| 154 | AC_DEFINE(HAVE_OVERLAY_XVLIB, 1, [Enable XV backend]) |
| 155 | fi |
| 156 | if test x$enable_overlay_xlib = xyes; then |
| 157 | AC_DEFINE(HAVE_OVERLAY_XLIB, 1, [Enable X backend]) |
| 158 | fi |
Chris Wilson | ddcd1b2 | 2013-08-27 14:25:38 +0100 | [diff] [blame] | 159 | 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] | 160 | |
Daniel Vetter | 08ccec1 | 2012-01-19 13:01:03 +0100 | [diff] [blame] | 161 | # for testdisplay |
Damien Lespiau | 0193b69 | 2013-07-17 16:25:29 +0100 | [diff] [blame] | 162 | PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0]) |
Daniel Vetter | fa46120 | 2012-01-24 11:28:25 +0100 | [diff] [blame] | 163 | PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no]) |
| 164 | if test x"$udev" = xyes; then |
| 165 | AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection]) |
| 166 | fi |
Daniel Vetter | 08ccec1 | 2012-01-19 13:01:03 +0100 | [diff] [blame] | 167 | PKG_CHECK_MODULES(GLIB, glib-2.0) |
Jesse Barnes | 5406c63 | 2010-12-21 09:38:23 -0800 | [diff] [blame] | 168 | |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 169 | # ----------------------------------------------------------------------------- |
| 170 | # Configuration options |
| 171 | # ----------------------------------------------------------------------------- |
Ben Widawsky | 66ec9bd | 2013-02-07 08:29:24 -0800 | [diff] [blame] | 172 | # for dma-buf tests |
| 173 | AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau], |
Matt Turner | cd460f1 | 2013-10-10 20:54:25 -0700 | [diff] [blame] | 174 | [Enable use of nouveau API for prime tests (default: auto)]), |
| 175 | [NOUVEAU=$enableval], [NOUVEAU=auto]) |
| 176 | if test "x$NOUVEAU" = xauto; then |
| 177 | PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no]) |
| 178 | fi |
Ben Widawsky | 66ec9bd | 2013-02-07 08:29:24 -0800 | [diff] [blame] | 179 | if test "x$NOUVEAU" = xyes; then |
| 180 | PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33]) |
| 181 | AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support]) |
| 182 | fi |
| 183 | AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes]) |
| 184 | |
Eric Anholt | ceca9ef | 2016-01-25 11:40:15 -0800 | [diff] [blame] | 185 | AC_ARG_ENABLE(vc4, AS_HELP_STRING([--disable-vc4], |
| 186 | [Enable building of vc4 tests (default: auto)]), |
| 187 | [VC4=$enableval], [VC4=auto]) |
| 188 | if test "x$VC4" = xauto; then |
| 189 | PKG_CHECK_EXISTS([libdrm_vc4], [VC4=yes], [VC4=no]) |
| 190 | fi |
| 191 | if test "x$VC4" = xyes; then |
| 192 | PKG_CHECK_MODULES(DRM_VC4, [libdrm_vc4]) |
| 193 | AC_DEFINE(HAVE_VC4, 1, [Have vc4 support]) |
| 194 | fi |
| 195 | AM_CONDITIONAL(HAVE_VC4, [test "x$VC4" = xyes]) |
| 196 | |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 197 | # Define a configure option for the shader debugger |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 198 | AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger], |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 199 | [Enable shader debugging support [autodetected]]), |
Chris Wilson | 102943d | 2016-04-25 18:35:49 +0100 | [diff] [blame] | 200 | [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=no]) |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 201 | |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 202 | # Shader debugger depends on python3, intel-genasm and objcopy |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 203 | if test "x$BUILD_SHADER_DEBUGGER" != xno; then |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 204 | # Check that the assembler is built |
Ben Widawsky | 9d6cfa6 | 2013-12-30 10:41:43 -0800 | [diff] [blame] | 205 | if test "x$enable_assembler" = xno; then |
Ben Widawsky | 01eeab9 | 2014-01-02 19:33:57 -1000 | [diff] [blame] | 206 | BUILD_SHADER_DEBUGGER=no |
Ben Widawsky | 9d6cfa6 | 2013-12-30 10:41:43 -0800 | [diff] [blame] | 207 | if test "x$BUILD_SHADER_DEBUGGER" = xyes; then |
| 208 | AC_MSG_ERROR([Shader debugger requested, but assembler not enabled.]) |
| 209 | fi |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 210 | fi |
| 211 | |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 212 | # Check Python 3 is installed |
| 213 | if test "$PYTHON" = ":" ; then |
| 214 | if test "x$BUILD_SHADER_DEBUGGER" = xyes; then |
| 215 | AC_MSG_ERROR([Shader debugger requested, python version 3 not found.]) |
| 216 | else |
| 217 | BUILD_SHADER_DEBUGGER=no |
| 218 | fi |
Ben Widawsky | 15830ea | 2011-10-31 13:36:50 -0700 | [diff] [blame] | 219 | fi |
Ben Widawsky | 94b2b86 | 2013-12-20 21:15:16 -0800 | [diff] [blame] | 220 | |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 221 | # Check for the objcopy GNU binary utiliy command |
| 222 | AC_PATH_PROGS([OBJCOPY], objcopy) |
| 223 | if test -z "$OBJCOPY" ; then |
| 224 | if test "x$BUILD_SHADER_DEBUGGER" = xyes; then |
| 225 | AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.]) |
| 226 | else |
| 227 | BUILD_SHADER_DEBUGGER=no |
| 228 | fi |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 229 | fi |
Ben Widawsky | 6287379 | 2011-06-24 11:42:03 -0700 | [diff] [blame] | 230 | fi |
| 231 | |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 232 | AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno]) |
Damien Lespiau | 764b9e5 | 2013-03-04 15:59:00 +0000 | [diff] [blame] | 233 | AS_IF([test "x$BUILD_SHADER_DEBUGGER" != xno], |
Damien Lespiau | 5d52689 | 2013-01-22 08:35:15 +0000 | [diff] [blame] | 234 | [enable_debugger=yes], [enable_debugger=no]) |
| 235 | |
Thomas Wood | 277ca2b | 2015-03-13 17:02:12 +0000 | [diff] [blame] | 236 | AC_ARG_WITH(libunwind, |
| 237 | AS_HELP_STRING([--without-libunwind], |
| 238 | [Build tests without libunwind support]), |
| 239 | [], [with_libunwind=yes]) |
| 240 | if test "x$with_libunwind" = xyes; then |
| 241 | PKG_CHECK_MODULES(LIBUNWIND, libunwind, AC_DEFINE(HAVE_LIBUNWIND, 1, [libunwind support]), |
| 242 | AC_MSG_ERROR([libunwind not found. Use --without-libunwind to disable libunwind support.])) |
| 243 | fi |
| 244 | |
Thomas Wood | 76dad7f | 2015-03-23 11:46:25 +0000 | [diff] [blame] | 245 | # enable debug symbols |
| 246 | AC_ARG_ENABLE(debug, |
| 247 | AS_HELP_STRING([--disable-debug], |
| 248 | [Build tests without debug symbols]), |
| 249 | [], [enable_debug=yes]) |
| 250 | |
marius vlad | 701d8fd | 2016-05-10 17:32:15 +0300 | [diff] [blame] | 251 | AC_ARG_ENABLE(werror, |
| 252 | AS_HELP_STRING([--enable-werror], |
| 253 | [Fail on warnings]), |
| 254 | [], [enable_werror=no]) |
| 255 | |
Thomas Wood | 76dad7f | 2015-03-23 11:46:25 +0000 | [diff] [blame] | 256 | if test "x$enable_debug" = xyes; then |
| 257 | AS_COMPILER_FLAG([-g3], [DEBUG_CFLAGS="-g3"], [DEBUG_CFLAGS="-g"]) |
| 258 | AS_COMPILER_FLAG([-Og], [DEBUG_CFLAGS+=" -Og -Wno-maybe-uninitialized"], # disable maybe-uninitialized due to false positives |
| 259 | [DEBUG_CFLAGS+=" -O0"]) |
| 260 | AC_SUBST([DEBUG_CFLAGS]) |
| 261 | fi |
| 262 | |
marius vlad | 701d8fd | 2016-05-10 17:32:15 +0300 | [diff] [blame] | 263 | if test "x$enable_werror" = xyes; then |
| 264 | AS_COMPILER_FLAG([-Werror], [WERROR_CFLAGS="-Werror"]) |
| 265 | fi |
| 266 | |
Damien Lespiau | e5653d5 | 2015-07-01 23:40:36 +0100 | [diff] [blame] | 267 | # prevent relinking the world on every commit for developers |
| 268 | AC_ARG_ENABLE(git-hash, |
| 269 | AS_HELP_STRING([--disable-git-hash], |
| 270 | [Do not use git hash in version]), |
| 271 | [git_hash=$enableval], [git_hash=yes]) |
Damien Lespiau | ec9e599 | 2015-07-02 14:59:25 +0100 | [diff] [blame] | 272 | AC_SUBST(GIT_HASH, [$git_hash]) |
Damien Lespiau | e5653d5 | 2015-07-01 23:40:36 +0100 | [diff] [blame] | 273 | |
Gaetan Nadon | 4768adf | 2012-01-10 17:25:24 -0500 | [diff] [blame] | 274 | # ----------------------------------------------------------------------------- |
| 275 | |
Alan Coopersmith | 504c4fa | 2012-01-06 15:45:29 -0800 | [diff] [blame] | 276 | # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt |
| 277 | XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt]) |
| 278 | AC_SUBST([THREAD_CFLAGS]) |
| 279 | |
Rodrigo Vivi | 7c17072 | 2013-02-05 16:17:54 -0200 | [diff] [blame] | 280 | AC_ARG_ENABLE(tests, |
| 281 | AS_HELP_STRING([--disable-tests], |
| 282 | [Disable tests build (default: enabled)]), |
| 283 | [BUILD_TESTS=$enableval], [BUILD_TESTS="yes"]) |
| 284 | if test "x$BUILD_TESTS" = xyes; then |
| 285 | AC_DEFINE(BUILD_TESTS, 1, [Build tests]) |
Rodrigo Vivi | 7c17072 | 2013-02-05 16:17:54 -0200 | [diff] [blame] | 286 | fi |
| 287 | AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes]) |
Daniel Vetter | 831a471 | 2013-12-10 09:23:44 +0100 | [diff] [blame] | 288 | AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform]) |
Rodrigo Vivi | 7c17072 | 2013-02-05 16:17:54 -0200 | [diff] [blame] | 289 | |
Thomas Wood | 4839447 | 2014-10-16 14:23:24 +0100 | [diff] [blame] | 290 | files="broadwell cherryview haswell ivybridge sandybridge valleyview skylake" |
Thomas Wood | c54ee98 | 2014-06-06 15:28:50 +0100 | [diff] [blame] | 291 | for file in $files; do |
Thomas Wood | 9ecb50e | 2015-09-04 14:46:45 +0100 | [diff] [blame] | 292 | REGISTER_FILES="$REGISTER_FILES $file `cat $srcdir/tools/registers/$file`" |
Thomas Wood | c54ee98 | 2014-06-06 15:28:50 +0100 | [diff] [blame] | 293 | done |
Thomas Wood | 9ecb50e | 2015-09-04 14:46:45 +0100 | [diff] [blame] | 294 | REGISTER_FILES=`echo $REGISTER_FILES | tr ' ' '\n' | sort -u | tr '\n' ' '` |
| 295 | AC_SUBST(REGISTER_FILES) |
Thomas Wood | c54ee98 | 2014-06-06 15:28:50 +0100 | [diff] [blame] | 296 | |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 297 | AC_CONFIG_FILES([ |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 298 | Makefile |
| 299 | benchmarks/Makefile |
| 300 | demos/Makefile |
Thomas Wood | 14ea2a0 | 2014-03-11 16:04:28 +0000 | [diff] [blame] | 301 | docs/Makefile |
| 302 | docs/reference/Makefile |
| 303 | docs/reference/intel-gpu-tools/Makefile |
| 304 | docs/reference/intel-gpu-tools/version.xml |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 305 | lib/Makefile |
Daniel Vetter | 685e577 | 2014-10-27 15:08:50 +0100 | [diff] [blame] | 306 | lib/tests/Makefile |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 307 | man/Makefile |
| 308 | scripts/Makefile |
Ben Widawsky | 3a752a3 | 2013-02-07 10:30:03 -0800 | [diff] [blame] | 309 | tests/Makefile |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 310 | tools/Makefile |
Mika Kuoppala | d60d4c8 | 2014-04-10 15:15:13 +0300 | [diff] [blame] | 311 | tools/null_state_gen/Makefile |
Thomas Wood | af97918 | 2015-08-25 11:30:11 +0100 | [diff] [blame] | 312 | tools/registers/Makefile |
Ben Widawsky | 90f0b3d | 2013-01-31 13:04:18 -0800 | [diff] [blame] | 313 | debugger/Makefile |
| 314 | debugger/system_routine/Makefile |
Damien Lespiau | 191c859 | 2013-01-14 23:21:21 +0000 | [diff] [blame] | 315 | assembler/Makefile |
| 316 | assembler/doc/Makefile |
| 317 | assembler/test/Makefile |
| 318 | assembler/intel-gen4asm.pc |
Chris Wilson | f9a50de | 2013-08-17 11:12:07 +0100 | [diff] [blame] | 319 | overlay/Makefile |
Kristian Høgsberg Kristensen | 5f9bc98 | 2015-08-05 11:55:09 -0700 | [diff] [blame] | 320 | ]) |
| 321 | |
| 322 | 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] | 323 | |
Javier Jardón | 68b64f1 | 2011-02-08 22:33:12 +0000 | [diff] [blame] | 324 | AC_OUTPUT |
Ben Widawsky | c75b8c6 | 2013-01-31 13:06:17 -0800 | [diff] [blame] | 325 | |
Damien Lespiau | 5435708 | 2013-01-21 23:02:36 +0000 | [diff] [blame] | 326 | # Print a summary of the compilation |
| 327 | echo "" |
| 328 | echo "Intel GPU tools" |
| 329 | |
| 330 | echo "" |
Damien Lespiau | 94444ae | 2013-07-19 16:08:11 +0100 | [diff] [blame] | 331 | echo " • Tests:" |
| 332 | echo " Build tests : ${BUILD_TESTS}" |
| 333 | echo " Compile prime tests: ${NOUVEAU}" |
Thomas Wood | 277ca2b | 2015-03-13 17:02:12 +0000 | [diff] [blame] | 334 | echo " Print stack traces : ${with_libunwind}" |
Thomas Wood | 76dad7f | 2015-03-23 11:46:25 +0000 | [diff] [blame] | 335 | echo " Debug flags : ${DEBUG_CFLAGS}" |
Damien Lespiau | 94444ae | 2013-07-19 16:08:11 +0100 | [diff] [blame] | 336 | echo "" |
Damien Lespiau | 5435708 | 2013-01-21 23:02:36 +0000 | [diff] [blame] | 337 | echo " • Tools:" |
Damien Lespiau | 94444ae | 2013-07-19 16:08:11 +0100 | [diff] [blame] | 338 | echo " Assembler : ${enable_assembler}" |
| 339 | echo " Debugger : ${enable_debugger}" |
Damien Lespiau | b5acc10 | 2013-08-20 14:18:58 +0100 | [diff] [blame] | 340 | echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}" |
Daniel Stone | bccc0ec | 2016-01-25 18:33:12 +0000 | [diff] [blame] | 341 | echo " x86-specific tools : ${build_x86}" |
Damien Lespiau | 5435708 | 2013-01-21 23:02:36 +0000 | [diff] [blame] | 342 | echo "" |
Daniel Vetter | a90846a | 2014-03-11 21:03:39 +0100 | [diff] [blame] | 343 | echo " • API-Documentation : ${enable_gtk_doc}" |
Marius Vlad | 3ce58b6 | 2016-05-31 18:33:24 +0300 | [diff] [blame] | 344 | echo " • Fail on warnings : ${enable_werror}" |
Daniel Vetter | a90846a | 2014-03-11 21:03:39 +0100 | [diff] [blame] | 345 | echo "" |
Damien Lespiau | 5435708 | 2013-01-21 23:02:36 +0000 | [diff] [blame] | 346 | |
Ben Widawsky | c75b8c6 | 2013-01-31 13:06:17 -0800 | [diff] [blame] | 347 | # vim: set ft=config ts=8 sw=8 tw=0 noet : |