diff mbox

[i-g-t,v2] configure.ac: Disable chamelium by default and add enable argument

Message ID 20170726081154.16936-1-paul.kocialkowski@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paul Kocialkowki July 26, 2017, 8:11 a.m. UTC
Since the chamelium is not a very usual piece of hardware and requires
pulling-in lots of specific dependencies, it makes sense to keep it
disabled by default.

An explicit --enable-chamelium argument is provided to enable it when
necessary. This also leads to more predictable results than
automatically enabling it when its dependencies are met.

Finally, whether chamelium support is enabled is printed by the
information summary at end of the configure run.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
---
 configure.ac | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

Comments

Lyude Paul July 26, 2017, 4:02 p.m. UTC | #1
r-b'd and pushed, thanks!

On Wed, 2017-07-26 at 11:11 +0300, Paul Kocialkowski wrote:
> Since the chamelium is not a very usual piece of hardware and
> requires
> pulling-in lots of specific dependencies, it makes sense to keep it
> disabled by default.
> 
> An explicit --enable-chamelium argument is provided to enable it when
> necessary. This also leads to more predictable results than
> automatically enabling it when its dependencies are met.
> 
> Finally, whether chamelium support is enabled is printed by the
> information summary at end of the configure run.
> 
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
> ---
>  configure.ac | 18 ++++++++++--------
>  1 file changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index a6ab9e4a..6d3db878 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -185,23 +185,24 @@ PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes],
> [gsl=no])
>  AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
>  
>  # for chamelium
> -AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--disable-chamelium],
> -	      [Enable building of chamelium libraries and tests
> (default: yes)]),
> -	      [enable_chamelium=no], [enable_chamelium=yes])
> +AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--enable-chamelium],
> +	      [Enable building of chamelium libraries and tests
> (default: no)]),
> +	      [if test x$enableval = xyes; then
> enable_chamelium=yes; fi],
> +	      [enable_chamelium=no])
>  AM_CONDITIONAL(HAVE_CHAMELIUM, [test "x$enable_chamelium" = xyes])
>  if test "x$enable_chamelium" = xyes; then
>  	PKG_CHECK_MODULES(XMLRPC, xmlrpc xmlrpc_util xmlrpc_client,
> [],
> -			  [AC_MSG_ERROR([Failed to find xmlrpc,
> required by chamelium. Use --disable-chamelium to disable chamelium
> support.])])
> +			  [AC_MSG_ERROR([Failed to find xmlrpc,
> required by chamelium.])])
>  	PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
> -			  [AC_MSG_ERROR([Failed to find pixman,
> required by chamelium. Use --disable-chamelium to disable chamelium
> support.])])
> +			  [AC_MSG_ERROR([Failed to find pixman,
> required by chamelium.])])
>  	if test x"$udev" != xyes; then
> -		AC_MSG_ERROR([Failed to find udev, required by
> chamelium. Use --disable-chamelium to disable chamelium support.])
> +		AC_MSG_ERROR([Failed to find udev, required by
> chamelium.])
>  	fi
>  	if test x"$glib" != xyes; then
> -		AC_MSG_ERROR([Failed to find glib, required by
> chamelium. Use --disable-chamelium to disable chamelium support.])
> +		AC_MSG_ERROR([Failed to find glib, required by
> chamelium.])
>  	fi
>  	if test x"$gsl" != xyes; then
> -		AC_MSG_ERROR([Failed to find gsl, required by
> chamelium. Use --disable-chamelium to disable chamelium support.])
> +		AC_MSG_ERROR([Failed to find gsl, required by
> chamelium.])
>  	fi
>  
>  	AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support])
> @@ -404,6 +405,7 @@ echo "Intel GPU tools"
>  echo ""
>  echo " • Tests:"
>  echo "       Build tests        : ${BUILD_TESTS}"
> +echo "       Chamelium tests    : ${enable_chamelium}"
>  echo "       Compile prime tests: ${NOUVEAU}"
>  echo "       Print stack traces : ${with_libunwind}"
>  echo "       Debug flags        : ${DEBUG_CFLAGS}"
diff mbox

Patch

diff --git a/configure.ac b/configure.ac
index a6ab9e4a..6d3db878 100644
--- a/configure.ac
+++ b/configure.ac
@@ -185,23 +185,24 @@  PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
 AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
 
 # for chamelium
-AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--disable-chamelium],
-	      [Enable building of chamelium libraries and tests (default: yes)]),
-	      [enable_chamelium=no], [enable_chamelium=yes])
+AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--enable-chamelium],
+	      [Enable building of chamelium libraries and tests (default: no)]),
+	      [if test x$enableval = xyes; then enable_chamelium=yes; fi],
+	      [enable_chamelium=no])
 AM_CONDITIONAL(HAVE_CHAMELIUM, [test "x$enable_chamelium" = xyes])
 if test "x$enable_chamelium" = xyes; then
 	PKG_CHECK_MODULES(XMLRPC, xmlrpc xmlrpc_util xmlrpc_client, [],
-			  [AC_MSG_ERROR([Failed to find xmlrpc, required by chamelium. Use --disable-chamelium to disable chamelium support.])])
+			  [AC_MSG_ERROR([Failed to find xmlrpc, required by chamelium.])])
 	PKG_CHECK_MODULES(PIXMAN, pixman-1, [],
-			  [AC_MSG_ERROR([Failed to find pixman, required by chamelium. Use --disable-chamelium to disable chamelium support.])])
+			  [AC_MSG_ERROR([Failed to find pixman, required by chamelium.])])
 	if test x"$udev" != xyes; then
-		AC_MSG_ERROR([Failed to find udev, required by chamelium. Use --disable-chamelium to disable chamelium support.])
+		AC_MSG_ERROR([Failed to find udev, required by chamelium.])
 	fi
 	if test x"$glib" != xyes; then
-		AC_MSG_ERROR([Failed to find glib, required by chamelium. Use --disable-chamelium to disable chamelium support.])
+		AC_MSG_ERROR([Failed to find glib, required by chamelium.])
 	fi
 	if test x"$gsl" != xyes; then
-		AC_MSG_ERROR([Failed to find gsl, required by chamelium. Use --disable-chamelium to disable chamelium support.])
+		AC_MSG_ERROR([Failed to find gsl, required by chamelium.])
 	fi
 
 	AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support])
@@ -404,6 +405,7 @@  echo "Intel GPU tools"
 echo ""
 echo " • Tests:"
 echo "       Build tests        : ${BUILD_TESTS}"
+echo "       Chamelium tests    : ${enable_chamelium}"
 echo "       Compile prime tests: ${NOUVEAU}"
 echo "       Print stack traces : ${with_libunwind}"
 echo "       Debug flags        : ${DEBUG_CFLAGS}"