dpio: make dpio reg read/write output like normal reg read/write output
[platform/upstream/intel-gpu-tools.git] / configure.ac
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
23 AC_PREREQ([2.60])
24 AC_INIT([intel-gpu-tools],
25         [1.5],
26         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
27         [intel-gpu-tools])
28
29 AC_CONFIG_SRCDIR([Makefile.am])
30 AC_CONFIG_HEADERS([config.h])
31 AC_CONFIG_MACRO_DIR([m4])
32 AC_CONFIG_AUX_DIR([build-aux])
33 AC_USE_SYSTEM_EXTENSIONS
34 AC_SYS_LARGEFILE
35 AC_GNU_SOURCE
36 AC_CANONICAL_HOST
37
38 AM_INIT_AUTOMAKE([foreign dist-bzip2])
39 AM_PATH_PYTHON([3],, [:])
40
41 AC_PROG_CC
42 AM_PROG_LEX
43 AC_PROG_YACC
44
45 # Checks for functions, headers, structures, etc.
46 AC_HEADER_STDC
47 AC_CHECK_HEADERS([termios.h])
48 AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
49                   #include <sys/sysinfo.h>
50                   ])
51 AC_CHECK_FUNCS([swapctl])
52 AC_CHECK_FUNCS([asprintf])
53
54 # Initialize libtool
55 AC_DISABLE_STATIC
56 AC_PROG_LIBTOOL
57
58 # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
59 m4_ifndef([XORG_MACROS_VERSION],
60           [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
61 XORG_MACROS_VERSION(1.16)
62 XORG_DEFAULT_OPTIONS
63
64 # warning flags for the assembler. We can't quite use CWARNFLAGS for it yet as
65 # it generates waaaay too many warnings.
66 ASSEMBLER_WARN_CFLAGS=""
67 if test "x$GCC" = "xyes"; then
68         ASSEMBLER_WARN_CFLAGS="-Wall -Wstrict-prototypes \
69         -Wmissing-prototypes -Wmissing-declarations \
70         -Wnested-externs -fno-strict-aliasing"
71 fi
72 AC_SUBST(ASSEMBLER_WARN_CFLAGS)
73
74 PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.47 libdrm])
75 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
76 PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
77 PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib], enable_overlay_xlib=yes, enable_overlay_xlib=no)
78
79 AM_CONDITIONAL(BUILD_OVERLAY_XVLIB, [test "x$enable_overlay_xvlib" = xyes])
80 AM_CONDITIONAL(BUILD_OVERLAY_XLIB, [test "x$enable_overlay_xlib" = xyes])
81 AM_CONDITIONAL(BUILD_OVERLAY, [test "x$enable_overlay_xlib" = xyes -o "x$enable_overlay_xvlib"])
82 if test x$enable_overlay_xvlib = xyes; then
83         AC_DEFINE(HAVE_OVERLAY_XVLIB, 1, [Enable XV backend])
84         PKG_CHECK_MODULES(DRI2PROTO, [dri2proto >= 2.6])
85 fi
86 if test x$enable_overlay_xlib = xyes; then
87         AC_DEFINE(HAVE_OVERLAY_XLIB, 1, [Enable X backend])
88         PKG_CHECK_MODULES(DRI2PROTO, [dri2proto >= 2.6])
89 fi
90 PKG_CHECK_MODULES(XRANDR, xrandr >= 1.3, AC_DEFINE(HAVE_XRANDR, 1, [Have libXrandr]), [have_xrandr=no])
91
92 # for testdisplay
93 PKG_CHECK_MODULES(CAIRO, [cairo >= 1.12.0])
94 PKG_CHECK_MODULES(LIBUDEV, [libudev], [udev=yes], [udev=no])
95 if test x"$udev" = xyes; then
96         AC_DEFINE(HAVE_UDEV,1,[Enable udev-based monitor hotplug detection])
97 fi
98 PKG_CHECK_MODULES(GLIB, glib-2.0)
99
100 # can we build the assembler?
101 AS_IF([test x"$LEX" != "x:" -a x"$YACC" != xyacc],
102       [enable_assembler=yes],
103       [enable_assembler=no])
104 AM_CONDITIONAL(BUILD_ASSEMBLER, [test "x$enable_assembler" = xyes])
105
106 # -----------------------------------------------------------------------------
107 #                       Configuration options
108 # -----------------------------------------------------------------------------
109 # for dma-buf tests
110 AC_ARG_ENABLE(nouveau, AS_HELP_STRING([--disable-nouveau],
111               [Enable use of nouveau API for prime tests (default: auto)]),
112               [NOUVEAU=$enableval], [NOUVEAU=auto])
113 if test "x$NOUVEAU" = xauto; then
114         PKG_CHECK_EXISTS([libdrm_nouveau >= 2.4.33], [NOUVEAU=yes], [NOUVEAU=no])
115 fi
116 if test "x$NOUVEAU" = xyes; then
117         PKG_CHECK_MODULES(DRM_NOUVEAU, [libdrm_nouveau >= 2.4.33])
118         AC_DEFINE(HAVE_NOUVEAU, 1, [Have nouveau support])
119 fi
120 AM_CONDITIONAL(HAVE_NOUVEAU, [test "x$NOUVEAU" = xyes])
121
122 #Configure options for the python quick-dumper
123 AC_ARG_ENABLE(dumper,
124               AS_HELP_STRING([--disable-dumper],
125                              [Disable the python based register dumper (default: enabled)]),
126                              [DUMPER=$enableval], [DUMPER=yes])
127 if test "x$DUMPER" == xyes; then
128         AC_DEFINE(HAVE_DUMPER, 1, [Have dumper support])
129         # SWIG configuration
130         AX_PKG_SWIG(2.0.0, [], [ AC_MSG_ERROR([SWIG 2.0.0 or higher is required to build..]) ])
131         AX_PYTHON_DEVEL([>= '3.0'])
132         AX_SWIG_PYTHON
133 fi
134 AM_CONDITIONAL(HAVE_DUMPER, [test "x$DUMPER" = xyes])
135
136 # Define a configure option for the shader debugger
137 AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
138               [Enable shader debugging support [autodetected]]),
139               [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto])
140
141 # Shader debugger depends on python3, intel-genasm and objcopy
142 if test "x$BUILD_SHADER_DEBUGGER" != xno; then
143         # Check that the assembler is built
144         if test "x$enable_assembler" = xno; then
145                 BUILD_SHADER_DEBUGGER=no
146                 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
147                         AC_MSG_ERROR([Shader debugger requested, but assembler not enabled.])
148                 fi
149         fi
150
151         # Check Python 3 is installed
152         if test "$PYTHON" = ":" ; then
153                 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
154                         AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
155                 else
156                         BUILD_SHADER_DEBUGGER=no
157                 fi
158         fi
159
160         # Check for the objcopy GNU binary utiliy command
161         AC_PATH_PROGS([OBJCOPY], objcopy)
162         if test -z "$OBJCOPY" ; then
163                 if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
164                         AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
165                 else
166                         BUILD_SHADER_DEBUGGER=no
167                 fi
168         fi
169 fi
170
171 AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
172 AS_IF([test "x$BUILD_SHADER_DEBUGGER" != xno],
173       [enable_debugger=yes], [enable_debugger=no])
174
175 # -----------------------------------------------------------------------------
176
177 # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
178 XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt])
179 AC_SUBST([THREAD_CFLAGS])
180
181 AC_ARG_ENABLE(tests,
182               AS_HELP_STRING([--disable-tests],
183               [Disable tests build (default: enabled)]),
184               [BUILD_TESTS=$enableval], [BUILD_TESTS="yes"])
185 if test "x$BUILD_TESTS" = xyes; then
186         AC_DEFINE(BUILD_TESTS, 1, [Build tests])
187 fi
188 AM_CONDITIONAL(BUILD_TESTS, [test "x$BUILD_TESTS" = xyes])
189 AC_DEFINE_UNQUOTED(TARGET_CPU_PLATFORM, ["$host_cpu"], [Target platform])
190
191 AC_CONFIG_FILES([
192                  Makefile
193                  benchmarks/Makefile
194                  demos/Makefile
195                  lib/Makefile
196                  man/Makefile
197                  scripts/Makefile
198                  tests/Makefile
199                  tools/Makefile
200                  tools/quick_dump/Makefile
201                  debugger/Makefile
202                  debugger/system_routine/Makefile
203                  assembler/Makefile
204                  assembler/doc/Makefile
205                  assembler/test/Makefile
206                  assembler/intel-gen4asm.pc
207                  overlay/Makefile
208                  ])
209 AC_OUTPUT
210
211 # Print a summary of the compilation
212 echo ""
213 echo "Intel GPU tools"
214
215 echo ""
216 echo " • Tests:"
217 echo "       Build tests        : ${BUILD_TESTS}"
218 echo "       Compile prime tests: ${NOUVEAU}"
219 echo ""
220 echo " • Tools:"
221 echo "       Assembler          : ${enable_assembler}"
222 echo "       Debugger           : ${enable_debugger}"
223 echo "       Python dumper      : ${DUMPER}"
224 echo "       Overlay            : X: ${enable_overlay_xlib}, Xv: ${enable_overlay_xvlib}"
225 echo ""
226
227 # vim: set ft=config ts=8 sw=8 tw=0 noet :