[vlc-devel] [PATCH 1/3] m4: Add VLC_ARG_ENABLE function.

Georgi Chorbadzhiyski gf at unixsol.org
Thu Dec 1 17:43:16 CET 2011


It does the same as AC_ARG_ENABLE but checks for if disable_all
variable is set.
---

Somebody with better m4 knowledge should check this function. It
probably could be written better.

 m4/with_pkg.m4 |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/m4/with_pkg.m4 b/m4/with_pkg.m4
index 39439b7..340c695 100644
--- a/m4/with_pkg.m4
+++ b/m4/with_pkg.m4
@@ -31,6 +31,19 @@ dnl Prepare a --with-variable-prefix triggered check for module,
 dnl disable by default.
 dnl
 
+dnl VLC_ARG_ENABLE have same parameters as AC_ARG_ENABLE but checks for disable_all
+AC_DEFUN([VLC_ARG_ENABLE],
+[
+    var=enable_$(echo $1 | tr .+- ___)
+    eval xvar=\$${var}
+    AS_IF(
+      [test x"${disable_all}" = "xyes" -a x"${xvar}" != "xyes" ],
+      [eval ${var}=no
+       AC_MSG_NOTICE([$1 disabled. Enable it with --enable-$1])],
+      [AC_ARG_ENABLE([$1], [$2], [$3])]
+    )
+])
+
 AC_DEFUN([PKG_WITH_MODULES],
 [
 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-- 
1.7.5.1




More information about the vlc-devel mailing list