blob: b71b1005f2f6a1cf93968ed61e0ce012d74e8b36 [file] [log] [blame]
Eric Anholt8c641832009-03-26 17:15:11 -07001# Copyright 2005 Adam Jackson.
2#
3# Permission is hereby granted, free of charge, to any person obtaining a
4# copy of this software and associated documentation files (the "Software"),
5# to deal in the Software without restriction, including without limitation
6# on the rights to use, copy, modify, merge, publish, distribute, sub
7# license, and/or sell copies of the Software, and to permit persons to whom
8# the Software is furnished to do so, subject to the following conditions:
9#
10# The above copyright notice and this permission notice (including the next
11# paragraph) shall be included in all copies or substantial portions of the
12# Software.
13#
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17# ADAM JACKSON BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20#
21# Process this file with autoconf to produce a configure script
22
Gaetan Nadond63a1f62012-01-03 21:12:25 -050023AC_PREREQ([2.60])
Eric Anholt1eabfa92009-03-27 16:03:12 -070024AC_INIT([intel-gpu-tools],
Rodrigo Vivia0950722014-03-13 07:52:47 -030025 [1.6],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -080026 [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
27 [intel-gpu-tools])
Eric Anholt8c641832009-03-26 17:15:11 -070028
29AC_CONFIG_SRCDIR([Makefile.am])
Javier Jardón68b64f12011-02-08 22:33:12 +000030AC_CONFIG_HEADERS([config.h])
31AC_CONFIG_MACRO_DIR([m4])
32AC_CONFIG_AUX_DIR([build-aux])
Alan Coopersmith504c4fa2012-01-06 15:45:29 -080033AC_USE_SYSTEM_EXTENSIONS
Chris Wilsond364c282012-03-14 10:59:51 +000034AC_SYS_LARGEFILE
Ben Widawsky8af53e02012-03-24 19:03:38 -070035AC_GNU_SOURCE
Daniel Vetter831a4712013-12-10 09:23:44 +010036AC_CANONICAL_HOST
Eric Anholt8c641832009-03-26 17:15:11 -070037
Gaetan Nadond63a1f62012-01-03 21:12:25 -050038AM_INIT_AUTOMAKE([foreign dist-bzip2])
Gaetan Nadon4768adf2012-01-10 17:25:24 -050039AM_PATH_PYTHON([3],, [:])
Eric Anholt8c641832009-03-26 17:15:11 -070040
Damien Lespiau191c8592013-01-14 23:21:21 +000041AC_PROG_CC
42AM_PROG_LEX
43AC_PROG_YACC
44
Thomas Wood14ea2a02014-03-11 16:04:28 +000045# check for gtk-doc
46m4_ifdef([GTK_DOC_CHECK], [
47GTK_DOC_CHECK([1.14],[--flavour no-tmpl])
48],[
49AM_CONDITIONAL([ENABLE_GTK_DOC], false)
Damien Lespiauc196c142014-03-21 14:36:54 +000050enable_gtk_doc=no
Thomas Wood14ea2a02014-03-11 16:04:28 +000051])
52
53
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080054# Checks for functions, headers, structures, etc.
Damien Lespiau191c8592013-01-14 23:21:21 +000055AC_HEADER_STDC
Alan Coopersmithf73dddc2012-01-06 14:37:17 -080056AC_CHECK_HEADERS([termios.h])
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080057AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
Ben Widawsky90f0b3d2013-01-31 13:04:18 -080058 #include <sys/sysinfo.h>
59 ])
Alan Coopersmithfbae1382012-01-23 20:13:49 -080060AC_CHECK_FUNCS([swapctl])
Ben Widawsky8af53e02012-03-24 19:03:38 -070061AC_CHECK_FUNCS([asprintf])
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080062
Javier Jardón68b64f12011-02-08 22:33:12 +000063# Initialize libtool
Gaetan Nadon65db78f2012-01-03 21:13:39 -050064AC_DISABLE_STATIC
65AC_PROG_LIBTOOL
Javier Jardón68b64f12011-02-08 22:33:12 +000066
Alan Coopersmith504c4fa2012-01-06 15:45:29 -080067# Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
Gaetan Nadon1722b782012-01-03 21:12:22 -050068m4_ifndef([XORG_MACROS_VERSION],
Gaetan Nadon4768adf2012-01-10 17:25:24 -050069 [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
Alan Coopersmith504c4fa2012-01-06 15:45:29 -080070XORG_MACROS_VERSION(1.16)
Gaetan Nadon1722b782012-01-03 21:12:22 -050071XORG_DEFAULT_OPTIONS
72
Damien Lespiau191c8592013-01-14 23:21:21 +000073# warning flags for the assembler. We can't quite use CWARNFLAGS for it yet as
Damien Lespiau54ec3cb2013-07-19 16:03:29 +010074# it generates waaaay too many warnings.
Damien Lespiau191c8592013-01-14 23:21:21 +000075ASSEMBLER_WARN_CFLAGS=""
76if test "x$GCC" = "xyes"; then
Damien Lespiau7902f2c2013-01-19 23:25:22 +000077 ASSEMBLER_WARN_CFLAGS="-Wall -Wstrict-prototypes \
Damien Lespiau191c8592013-01-14 23:21:21 +000078 -Wmissing-prototypes -Wmissing-declarations \
79 -Wnested-externs -fno-strict-aliasing"
80fi
81AC_SUBST(ASSEMBLER_WARN_CFLAGS)
82
Daniel Vetter02a32702014-03-07 09:23:58 +010083PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
Eric Anholt8c641832009-03-26 17:15:11 -070084PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
Chris Wilson34e47802013-08-18 21:10:26 +010085PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
86PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib], enable_overlay_xlib=yes, enable_overlay_xlib=no)
Chris Wilsonf9a50de2013-08-17 11:12:07 +010087
Chris Wilson34e47802013-08-18 21:10:26 +010088AM_CONDITIONAL(BUILD_OVERLAY_XVLIB, [test "x$enable_overlay_xvlib" = xyes])
89AM_CONDITIONAL(BUILD_OVERLAY_XLIB, [test "x$enable_overlay_xlib" = xyes])
90AM_CONDITIONAL(BUILD_OVERLAY, [test "x$enable_overlay_xlib" = xyes -o "x$enable_overlay_xvlib"])
91if test x$enable_overlay_xvlib = xyes; then
92 AC_DEFINE(HAVE_OVERLAY_XVLIB, 1, [Enable XV backend])
Ben Widawskybc888c22013-10-05 16:21:11 -070093 PKG_CHECK_MODULES(DRI2PROTO, [dri2proto >= 2.6])
Chris Wilson34e47802013-08-18 21:10:26 +010094fi
95if test x$enable_overlay_xlib = xyes; then
96 AC_DEFINE(HAVE_OVERLAY_XLIB, 1, [Enable X backend])
Ben Widawskybc888c22013-10-05 16:21:11 -070097 PKG_CHECK_MODULES(DRI2PROTO, [dri2proto >= 2.6])
Chris Wilson34e47802013-08-18 21:10:26 +010098fi
Chris Wilsonddcd1b22013-08-27 14:25:38 +010099PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXrandr]), [have_xrandr=no])
Eric Anholt8c641832009-03-26 17:15:11 -0700100
Daniel Vetter08ccec12012-01-19 13:01:03 +0100101# for testdisplay
Damien Lespiau0193b692013-07-17 16:25:29 +0100102PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
Daniel Vetterfa461202012-01-24 11:28:25 +0100103PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no])
104if test x"$udev" = xyes; then
105 AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
106fi
Daniel Vetter08ccec12012-01-19 13:01:03 +0100107PKG_CHECK_MODULES(GLIB, glib-2.0)
Jesse Barnes5406c632010-12-21 09:38:23 -0800108
Damien Lespiau54357082013-01-21 23:02:36 +0000109# can we build the assembler?
110AS_IF([test x"$LEX" != "x:" -a x"$YACC" != xyacc],
111 [enable_assembler=yes],
112 [enable_assembler=no])
113AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes])
114
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500115# -----------------------------------------------------------------------------
116# Configuration options
117# -----------------------------------------------------------------------------
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800118# for dma-buf tests
119AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
Matt Turnercd460f12013-10-10 20:54:25 -0700120 [Enable use of nouveau API for prime tests (default: auto)]),
121 [NOUVEAU=$enableval], [NOUVEAU=auto])
122if test "x$NOUVEAU" = xauto; then
123 PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no])
124fi
Ben Widawsky66ec9bd2013-02-07 08:29:24 -0800125if test "x$NOUVEAU" = xyes; then
126 PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
127 AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])
128fi
129AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
130
Ben Widawsky1cce7eb2013-02-07 08:28:14 -0800131#Configure options for the python quick-dumper
132AC_ARG_ENABLE(dumper,
133 AS_HELP_STRING([--disable-dumper],
134 [Disable the python based register dumper (default: enabled)]),
Damien Lespiaubbce3192013-07-19 16:03:49 +0100135 [DUMPER=$enableval], [DUMPER=yes])
Ben Widawsky1cce7eb2013-02-07 08:28:14 -0800136if test "x$DUMPER" == xyes; then
137 AC_DEFINE(HAVE_DUMPER, 1, [Have dumper support])
138 # SWIG configuration
139 AX_PKG_SWIG(2.0.0, [], [ AC_MSG_ERROR([SWIG 2.0.0 or higher is required to build..]) ])
140 AX_PYTHON_DEVEL([>= '3.0'])
141 AX_SWIG_PYTHON
142fi
143AM_CONDITIONAL(HAVE_DUMPER, [test "x$DUMPER" = xyes])
144
Ben Widawsky94b2b862013-12-20 21:15:16 -0800145# Define a configure option for the shader debugger
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500146AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800147 [Enable shader debugging support [autodetected]]),
148 [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto])
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500149
Ben Widawsky94b2b862013-12-20 21:15:16 -0800150# Shader debugger depends on python3, intel-genasm and objcopy
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500151if test "x$BUILD_SHADER_DEBUGGER" != xno; then
Ben Widawsky94b2b862013-12-20 21:15:16 -0800152 # Check that the assembler is built
Ben Widawsky9d6cfa62013-12-30 10:41:43 -0800153 if test "x$enable_assembler" = xno; then
Ben Widawsky01eeab92014-01-02 19:33:57 -1000154 BUILD_SHADER_DEBUGGER=no
Ben Widawsky9d6cfa62013-12-30 10:41:43 -0800155 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
156 AC_MSG_ERROR([Shader debugger requested, but assembler not enabled.])
157 fi
Ben Widawsky94b2b862013-12-20 21:15:16 -0800158 fi
159
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800160 # Check Python 3 is installed
161 if test "$PYTHON" = ":" ; then
162 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
163 AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
164 else
165 BUILD_SHADER_DEBUGGER=no
166 fi
Ben Widawsky15830ea2011-10-31 13:36:50 -0700167 fi
Ben Widawsky94b2b862013-12-20 21:15:16 -0800168
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800169 # Check for the objcopy GNU binary utiliy command
170 AC_PATH_PROGS([OBJCOPY], objcopy)
171 if test -z "$OBJCOPY" ; then
172 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
173 AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
174 else
175 BUILD_SHADER_DEBUGGER=no
176 fi
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500177 fi
Ben Widawsky62873792011-06-24 11:42:03 -0700178fi
179
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500180AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
Damien Lespiau764b9e52013-03-04 15:59:00 +0000181AS_IF([test "x$BUILD_SHADER_DEBUGGER" != xno],
Damien Lespiau5d526892013-01-22 08:35:15 +0000182 [enable_debugger=yes], [enable_debugger=no])
183
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500184# -----------------------------------------------------------------------------
185
Alan Coopersmith504c4fa2012-01-06 15:45:29 -0800186# To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
187XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt])
188AC_SUBST([THREAD_CFLAGS])
189
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200190AC_ARG_ENABLE(tests,
191 AS_HELP_STRING([--disable-tests],
192 [Disable tests build (default: enabled)]),
193 [BUILD_TESTS=$enableval], [BUILD_TESTS="yes"])
194if test "x$BUILD_TESTS" = xyes; then
195 AC_DEFINE(BUILD_TESTS, 1, [Build tests])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200196fi
197AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes])
Daniel Vetter831a4712013-12-10 09:23:44 +0100198AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200199
Javier Jardón68b64f12011-02-08 22:33:12 +0000200AC_CONFIG_FILES([
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800201 Makefile
202 benchmarks/Makefile
203 demos/Makefile
Thomas Wood14ea2a02014-03-11 16:04:28 +0000204 docs/Makefile
205 docs/reference/Makefile
206 docs/reference/intel-gpu-tools/Makefile
207 docs/reference/intel-gpu-tools/version.xml
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800208 lib/Makefile
209 man/Makefile
210 scripts/Makefile
Ben Widawsky3a752a32013-02-07 10:30:03 -0800211 tests/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800212 tools/Makefile
Ben Widawskyac1634e2012-09-19 22:08:46 -0700213 tools/quick_dump/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800214 debugger/Makefile
215 debugger/system_routine/Makefile
Damien Lespiau191c8592013-01-14 23:21:21 +0000216 assembler/Makefile
217 assembler/doc/Makefile
218 assembler/test/Makefile
219 assembler/intel-gen4asm.pc
Chris Wilsonf9a50de2013-08-17 11:12:07 +0100220 overlay/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800221 ])
Javier Jardón68b64f12011-02-08 22:33:12 +0000222AC_OUTPUT
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800223
Damien Lespiau54357082013-01-21 23:02:36 +0000224# Print a summary of the compilation
225echo ""
226echo "Intel GPU tools"
227
228echo ""
Damien Lespiau94444ae2013-07-19 16:08:11 +0100229echo " • Tests:"
230echo " Build tests : ${BUILD_TESTS}"
231echo " Compile prime tests: ${NOUVEAU}"
232echo ""
Damien Lespiau54357082013-01-21 23:02:36 +0000233echo " • Tools:"
Damien Lespiau94444ae2013-07-19 16:08:11 +0100234echo " Assembler : ${enable_assembler}"
235echo " Debugger : ${enable_debugger}"
236echo " Python dumper : ${DUMPER}"
Damien Lespiaub5acc102013-08-20 14:18:58 +0100237echo " Overlay : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}"
Damien Lespiau54357082013-01-21 23:02:36 +0000238echo ""
Daniel Vettera90846a2014-03-11 21:03:39 +0100239echo " • API-Documentation : ${enable_gtk_doc}"
240echo ""
Damien Lespiau54357082013-01-21 23:02:36 +0000241
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800242# vim: set ft=config ts=8 sw=8 tw=0 noet :