A common xorg idiom is used. The dependencies are auto-detected.
If they are present, the debugger is build.
If any are missing, the debugger is silently skipped.
If --enable-shader-debugger is specified, the configuration
will abort if any of the dependencies is missing.
No user actions is needed, no env variable to set (as it should be)
This will fix a number of problems:
build cannot start due Makefile missing in tarball.
build fails as GEN4ASM variable not available in Makefile.
no binaries are installed, so it cannot be used from a distro.
distcheck is also disturbed.
In the process other minor problems were fixed:
helper target is missing dependencies on evict.h.
too may arguments given to pre_cpp.py but they were ignored.
fills /tmp with temporary files.
Signed-off-by: Gaetan Nadon
---
Makefile.am|8 ++--
configure.ac | 51 +++-
debugger/Makefile.am | 27 +--
debugger/system_routine/.gitignore | 12 -
debugger/system_routine/GNUmakefile.in |3 -
debugger/system_routine/Makefile | 84
debugger/system_routine/Makefile.am| 42
7 files changed, 107 insertions(+), 120 deletions(-)
delete mode 100644 debugger/system_routine/GNUmakefile.in
delete mode 100644 debugger/system_routine/Makefile
create mode 100644 debugger/system_routine/Makefile.am
diff --git a/Makefile.am b/Makefile.am
index c7ae735..e049e3c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -19,11 +19,11 @@
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-if HAVE_SHADER_DEBUGGER
-SHADER_DEBUGGER_SUBDIR = debugger
-endif
+SUBDIRS = lib man tools scripts tests benchmarks
-SUBDIRS = lib man tools scripts tests benchmarks $(SHADER_DEBUGGER_SUBDIR)
+if BUILD_SHADER_DEBUGGER
+SUBDIRS += debugger
+endif
test:
${MAKE} -C tests test
diff --git a/configure.ac b/configure.ac
index b415a97..7265917 100644
--- a/configure.ac
+++ b/configure.ac
@@ -32,6 +32,7 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
+AM_PATH_PYTHON([3],, [:])
AM_MAINTAINER_MODE
# Initialize libtool
@@ -65,22 +66,47 @@ if test "x$HAVE_GLIB" = xyes; then
fi
AM_CONDITIONAL(HAVE_GLIB, [test "x$HAVE_GLIB" = xyes])
-AC_ARG_ENABLE(shader-debugger,
- AS_HELP_STRING([--enable-shader-debugger],
-[Enable shader debugging support [default=no]]),
- [SHADER_DEBUGGER="$enableval"],
- [SHADER_DEBUGGER=no])
-AM_CONDITIONAL(HAVE_SHADER_DEBUGGER, [test "x$SHADER_DEBUGGER" = xyes])
-if test "x$SHADER_DEBUGGER" = xyes; then
- AC_CHECK_PROG([GEN4ASM], intel-gen4asm, intel-gen4asm)
- if test -z "$GEN4ASM"; then
- AC_MSG_ERROR([Cannot find intel-gen4asm in your path; please
set GEN4ASM env variable])
+# -
+# Configuration options
+# -
+# Define a configure option for the shadder debugger
+AC_ARG_ENABLE(shader-debugger, AS_HELP_STRING([--enable-shader-debugger],
+[Enable shader debugging support [autodetected]]),
+[BUILD_SHADER_DEBUGGER="$enableval"], [BUILD_SHADER_DEBUGGER=auto])
+
+# Shadder debugger depends on python3, intel-genasm and objcopy
+if test "x$BUILD_SHADER_DEBUGGER" != xno; then
+# Check Python 3 is installed
+if test "$PYTHON" = ":" ; then
+ if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
+ AC_MSG_ERROR([Shader debugger requested, python version 3 not
found.])
+ else
+ BUILD_SHADER_DEBUGGER=no
+ fi
+fi
+# Check for the Intel Chipset assembler compiler
+AC_PATH_PROGS([GEN4ASM], intel-gen4asm)
+if test -z "$GEN4ASM" ; then
+ if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
+ AC_MSG_ERROR([Shader debugger requested, but intel-gen4asm not
found.])
else
- AC_CONFIG_FILES([debugger/system_routine/GNUmakefile])
- AC_DEFINE(HAVE_SHADER_DEBUGGER, 1, [Have shader debugging
support])
+ BUILD_SHADER_DEBUGGER=no
fi
+fi
+# Check for the objcopy GNU binary utiliy command
+AC_PATH_PROGS([OBJCOPY], objcopy)
+if test -z "$OBJCOPY" ; then
+ if test "x$BUILD_SHADER_DEBUGGER" = xyes; then
+ AC_MSG_ERROR([Shader debugger requested, but objcopy command not
found.])
+ else
+ BUILD_SHADER_DEBUGGER=no
+ fi
+fi
fi
+AM_CONDITIONAL(BUILD_SHADER_DEBUGGER, [test "x$BUILD_SHADER_DEBUGGER" != xno])
+# -
+
AC_CONFIG_FILES([
Makefile
benchmarks/Makefile
@@ -90,5 +116,6 @@ AC_CONFIG_FILES([
tests/Makefile