blob: 1c4e1c652035cc758425773e921fad411f51fa08 [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],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -080025 [1.3],
26 [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
Eric Anholt8c641832009-03-26 17:15:11 -070036
Gaetan Nadond63a1f62012-01-03 21:12:25 -050037AM_INIT_AUTOMAKE([foreign dist-bzip2])
Gaetan Nadon4768adf2012-01-10 17:25:24 -050038AM_PATH_PYTHON([3],, [:])
Eric Anholt8c641832009-03-26 17:15:11 -070039
Damien Lespiau191c8592013-01-14 23:21:21 +000040AC_PROG_CC
41AM_PROG_LEX
42AC_PROG_YACC
43
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080044# Checks for functions, headers, structures, etc.
Damien Lespiau191c8592013-01-14 23:21:21 +000045AC_HEADER_STDC
Alan Coopersmithf73dddc2012-01-06 14:37:17 -080046AC_CHECK_HEADERS([termios.h])
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080047AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
Ben Widawsky90f0b3d2013-01-31 13:04:18 -080048 #include <sys/sysinfo.h>
49 ])
Alan Coopersmithfbae1382012-01-23 20:13:49 -080050AC_CHECK_FUNCS([swapctl])
Ben Widawsky8af53e02012-03-24 19:03:38 -070051AC_CHECK_FUNCS([asprintf])
Alan Coopersmith9ebb8602012-01-06 14:37:16 -080052
Javier Jardón68b64f12011-02-08 22:33:12 +000053# Initialize libtool
Gaetan Nadon65db78f2012-01-03 21:13:39 -050054AC_DISABLE_STATIC
55AC_PROG_LIBTOOL
Javier Jardón68b64f12011-02-08 22:33:12 +000056
Alan Coopersmith504c4fa2012-01-06 15:45:29 -080057# Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
Gaetan Nadon1722b782012-01-03 21:12:22 -050058m4_ifndef([XORG_MACROS_VERSION],
Gaetan Nadon4768adf2012-01-10 17:25:24 -050059 [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
Alan Coopersmith504c4fa2012-01-06 15:45:29 -080060XORG_MACROS_VERSION(1.16)
Gaetan Nadon1722b782012-01-03 21:12:22 -050061XORG_DEFAULT_OPTIONS
62
Damien Lespiau191c8592013-01-14 23:21:21 +000063# warning flags for the assembler. We can't quite use CWARNFLAGS for it yet as
64# it generates waaaay to many warnings.
65ASSEMBLER_WARN_CFLAGS=""
66if test "x$GCC" = "xyes"; then
Damien Lespiau7902f2c2013-01-19 23:25:22 +000067 ASSEMBLER_WARN_CFLAGS="-Wall -Wstrict-prototypes \
Damien Lespiau191c8592013-01-14 23:21:21 +000068 -Wmissing-prototypes -Wmissing-declarations \
69 -Wnested-externs -fno-strict-aliasing"
70fi
71AC_SUBST(ASSEMBLER_WARN_CFLAGS)
72
Maarten Lankhorst45200252012-08-13 15:57:57 +020073PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.38 libdrm])
Eric Anholt8c641832009-03-26 17:15:11 -070074PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
75
Daniel Vetter08ccec12012-01-19 13:01:03 +010076# for testdisplay
77PKG_CHECK_MODULES(CAIRO, cairo)
Daniel Vetterfa461202012-01-24 11:28:25 +010078PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no])
79if test x"$udev" = xyes; then
80 AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
81fi
Daniel Vetter08ccec12012-01-19 13:01:03 +010082PKG_CHECK_MODULES(GLIB, glib-2.0)
Jesse Barnes5406c632010-12-21 09:38:23 -080083
Damien Lespiau54357082013-01-21 23:02:36 +000084# can we build the assembler?
85AS_IF([test x"$LEX" != "x:" -a x"$YACC" != xyacc],
86 [enable_assembler=yes],
87 [enable_assembler=no])
88AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes])
89
Gaetan Nadon4768adf2012-01-10 17:25:24 -050090# -----------------------------------------------------------------------------
91# Configuration options
92# -----------------------------------------------------------------------------
Ben Widawsky66ec9bd2013-02-07 08:29:24 -080093# for dma-buf tests
94AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
95 [Enable use of nouveau API for prime tests (default: enabled)]),
96 [NOUVEAU=$enableval], [NOUVEAU=yes])
97if test "x$NOUVEAU" = xyes; then
98 PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
99 AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])
100fi
101AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
102
Ben Widawsky1cce7eb2013-02-07 08:28:14 -0800103#Configure options for the python quick-dumper
104AC_ARG_ENABLE(dumper,
105 AS_HELP_STRING([--disable-dumper],
106 [Disable the python based register dumper (default: enabled)]),
107 DUMPER=$enableval], [DUMPER=yes])
108if test "x$DUMPER" == xyes; then
109 AC_DEFINE(HAVE_DUMPER, 1, [Have dumper support])
110 # SWIG configuration
111 AX_PKG_SWIG(2.0.0, [], [ AC_MSG_ERROR([SWIG 2.0.0 or higher is required to build..]) ])
112 AX_PYTHON_DEVEL([>= '3.0'])
113 AX_SWIG_PYTHON
114fi
115AM_CONDITIONAL(HAVE_DUMPER, [test "x$DUMPER" = xyes])
116
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500117# Define a configure option for the shadder debugger
118AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800119 [Enable shader debugging support [autodetected]]),
120 [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto])
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500121
122# Shadder debugger depends on python3, intel-genasm and objcopy
123if test "x$BUILD_SHADER_DEBUGGER" != xno; then
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800124 # Check Python 3 is installed
125 if test "$PYTHON" = ":" ; then
126 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
127 AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
128 else
129 BUILD_SHADER_DEBUGGER=no
130 fi
Ben Widawsky15830ea2011-10-31 13:36:50 -0700131 fi
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800132 # Check for the Intel Chipset assembler compiler
133 AC_PATH_PROGS([GEN4ASM], intel-gen4asm)
134 if test -z "$GEN4ASM" ; then
135 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
136 AC_MSG_ERROR([Shader debugger requested, but intel-gen4asm not found.])
137 else
138 BUILD_SHADER_DEBUGGER=no
139 fi
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500140 fi
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800141 # Check for the objcopy GNU binary utiliy command
142 AC_PATH_PROGS([OBJCOPY], objcopy)
143 if test -z "$OBJCOPY" ; then
144 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
145 AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
146 else
147 BUILD_SHADER_DEBUGGER=no
148 fi
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500149 fi
Ben Widawsky62873792011-06-24 11:42:03 -0700150fi
151
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500152AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
Damien Lespiau5d526892013-01-22 08:35:15 +0000153AS_IF([test "x$BUILD_SHADER_DEBUGGER" != no],
154 [enable_debugger=yes], [enable_debugger=no])
155
Gaetan Nadon4768adf2012-01-10 17:25:24 -0500156# -----------------------------------------------------------------------------
157
Alan Coopersmith504c4fa2012-01-06 15:45:29 -0800158# To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
159XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt])
160AC_SUBST([THREAD_CFLAGS])
161
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200162AC_ARG_ENABLE(tests,
163 AS_HELP_STRING([--disable-tests],
164 [Disable tests build (default: enabled)]),
165 [BUILD_TESTS=$enableval], [BUILD_TESTS="yes"])
166if test "x$BUILD_TESTS" = xyes; then
167 AC_DEFINE(BUILD_TESTS, 1, [Build tests])
Rodrigo Vivi7c170722013-02-05 16:17:54 -0200168fi
169AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes])
170
Javier Jardón68b64f12011-02-08 22:33:12 +0000171AC_CONFIG_FILES([
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800172 Makefile
173 benchmarks/Makefile
174 demos/Makefile
175 lib/Makefile
176 man/Makefile
177 scripts/Makefile
Ben Widawsky3a752a32013-02-07 10:30:03 -0800178 tests/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800179 tools/Makefile
Ben Widawskyac1634e2012-09-19 22:08:46 -0700180 tools/quick_dump/Makefile
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800181 debugger/Makefile
182 debugger/system_routine/Makefile
Damien Lespiau191c8592013-01-14 23:21:21 +0000183 assembler/Makefile
184 assembler/doc/Makefile
185 assembler/test/Makefile
186 assembler/intel-gen4asm.pc
Ben Widawsky90f0b3d2013-01-31 13:04:18 -0800187 ])
Javier Jardón68b64f12011-02-08 22:33:12 +0000188AC_OUTPUT
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800189
Damien Lespiau54357082013-01-21 23:02:36 +0000190# Print a summary of the compilation
191echo ""
192echo "Intel GPU tools"
193
194echo ""
195echo " • Tools:"
196echo " Assembler: ${enable_assembler}"
Damien Lespiau5d526892013-01-22 08:35:15 +0000197echo " Debugger: ${enable_debugger}"
Damien Lespiau54357082013-01-21 23:02:36 +0000198echo ""
199
Ben Widawskyc75b8c62013-01-31 13:06:17 -0800200# vim: set ft=config ts=8 sw=8 tw=0 noet :