diff options
author | Gaetan Nadon <memsize@videotron.ca> | 2012-01-10 17:25:24 -0500 |
---|---|---|
committer | Gaetan Nadon <memsize@videotron.ca> | 2012-01-12 09:13:08 -0500 |
commit | 4768adf7d77706fb6c2967695e0afa7d7c7dbb75 (patch) | |
tree | 8ee58940d1d8ad29baeb85af7a2a82384a424ecc /configure.ac | |
parent | 9f8766030463bc0c75506d990831b853f19d7725 (diff) |
Debugger: convert existing makefiles to Automake.
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.
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.
Acked-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 53 |
1 files changed, 40 insertions, 13 deletions
diff --git a/configure.ac b/configure.ac index 350b6012fcc9..3af123e49edf 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,7 @@ AC_CONFIG_AUX_DIR([build-aux]) AC_USE_SYSTEM_EXTENSIONS AM_INIT_AUTOMAKE([foreign dist-bzip2]) +AM_PATH_PYTHON([3],, [:]) AM_MAINTAINER_MODE # Checks for functions, headers, structures, etc. @@ -47,7 +48,7 @@ AC_PROG_LIBTOOL # Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG m4_ifndef([XORG_MACROS_VERSION], - [m4_fatal([must hate install xorg-macros 1.16 or later before running autoconf/autogen])]) + [m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])]) XORG_MACROS_VERSION(1.16) XORG_DEFAULT_OPTIONS @@ -72,22 +73,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]) +# ----------------------------------------------------------------------------- + # To build multithread code, gcc uses -pthread, Solaris Studio cc uses -mt XORG_TESTSET_CFLAG([THREAD_CFLAGS], [-pthread], [-mt]) AC_SUBST([THREAD_CFLAGS]) @@ -101,5 +127,6 @@ AC_CONFIG_FILES([ tests/Makefile tools/Makefile debugger/Makefile + debugger/system_routine/Makefile ]) AC_OUTPUT |