tests: make testdisplay non-optional
[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.1],
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
35 AM_INIT_AUTOMAKE([foreign dist-bzip2])
36 AM_PATH_PYTHON([3],, [:])
37 AM_MAINTAINER_MODE
38
39 # Checks for functions, headers, structures, etc.
40 AC_CHECK_HEADERS([termios.h])
41 AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
42 #include <sys/sysinfo.h>
43 ])
44
45 # Initialize libtool
46 AC_DISABLE_STATIC
47 AC_PROG_LIBTOOL
48
49 # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
50 m4_ifndef([XORG_MACROS_VERSION],
51           [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
52 XORG_MACROS_VERSION(1.16)
53 XORG_DEFAULT_OPTIONS
54
55 PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.30 libdrm])
56 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
57
58 # for testdisplay
59 PKG_CHECK_MODULES(CAIRO, cairo)
60 PKG_CHECK_MODULES(LIBUDEV, libudev)
61 PKG_CHECK_MODULES(GLIB, glib-2.0)
62
63 # -----------------------------------------------------------------------------
64 #                       Configuration options
65 # -----------------------------------------------------------------------------
66 # Define a configure option for the shadder debugger
67 AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
68     [Enable shader debugging support [autodetected]]),
69     [BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto])
70
71 # Shadder debugger depends on python3, intel-genasm and objcopy
72 if test "x$BUILD_SHADER_DEBUGGER" != xno; then
73     # Check Python 3 is installed
74     if test "$PYTHON" = ":" ; then
75         if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
76             AC_MSG_ERROR([Shader debugger requested, python version 3 not found.])
77         else
78             BUILD_SHADER_DEBUGGER=no
79         fi
80     fi
81     # Check for the Intel Chipset assembler compiler
82     AC_PATH_PROGS([GEN4ASM], intel-gen4asm)
83     if test -z "$GEN4ASM" ; then
84         if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
85             AC_MSG_ERROR([Shader debugger requested, but intel-gen4asm not found.])
86         else
87             BUILD_SHADER_DEBUGGER=no
88         fi
89     fi
90     # Check for the objcopy GNU binary utiliy command
91     AC_PATH_PROGS([OBJCOPY], objcopy)
92     if test -z "$OBJCOPY" ; then
93         if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
94             AC_MSG_ERROR([Shader debugger requested, but objcopy command not found.])
95         else
96             BUILD_SHADER_DEBUGGER=no
97         fi
98     fi
99 fi
100
101 AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
102 # -----------------------------------------------------------------------------
103
104 # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt
105 XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt])
106 AC_SUBST([THREAD_CFLAGS])
107
108 AC_CONFIG_FILES([
109         Makefile
110         benchmarks/Makefile
111         lib/Makefile
112         man/Makefile
113         scripts/Makefile
114         tests/Makefile
115         tools/Makefile
116         debugger/Makefile
117         debugger/system_routine/Makefile
118 ])
119 AC_OUTPUT