diff options
author | Damien Lespiau <damien.lespiau@gmail.com> | 2009-02-24 00:39:22 +0000 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@gmail.com> | 2009-02-24 00:48:10 +0000 |
commit | b5105072748ae32f460742732914f35a29715520 (patch) | |
tree | 0cec46493b47ac23ac0c39e333f899ea70327e5e | |
parent | 5afa0e79af44e18cb890113048c922ede68b3f43 (diff) |
Allow the user to define shave's default behaviour
SHAVE_INIT has now a second (optional) parameter that allow people to
enable shave by default.
SHAVE_INIT([path], [quiet]) means that running configure without any shave
related argument will actually enable it. Of course you can still give
the --disable-shave option to disable it.
Signed-off-by: Damien Lespiau <damien.lespiau@gmail.com>
-rw-r--r-- | shave/shave.m4 | 22 | ||||
-rw-r--r-- | test-cxx/configure.ac | 2 | ||||
-rw-r--r-- | test/configure.ac | 2 |
3 files changed, 18 insertions, 8 deletions
diff --git a/shave/shave.m4 b/shave/shave.m4 index a49806b..668c098 100644 --- a/shave/shave.m4 +++ b/shave/shave.m4 @@ -1,9 +1,12 @@ dnl Make automake/libtool output more friendly to humans dnl -dnl SHAVE_INIT([shavedir]) +dnl SHAVE_INIT([shavedir],[default_mode]) dnl dnl shavedir: the directory where the shave scripts are, it defaults to dnl $(top_builddir) +dnl default_mode: (quiet|verbose) default shave mode. This parameter controls +dnl the behaviour of shave when no option has been given to +dnl configure. It defaults to verbose (ie shave disabled) dnl dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and @@ -11,13 +14,20 @@ dnl LIBTOOL, you don't want the configure tests to have these variables dnl re-defined. dnl * This macro requires GNU make's -s option. -AC_DEFUN([SHAVE_INIT], +AC_DEFUN([_SHAVE_ARG_ENABLE], [ - dnl enable/disable shave AC_ARG_ENABLE([shave], - AS_HELP_STRING([--enable-shave], - [use shave to make the build pretty [[default=no]]]),, - [enable_shave=no]) + AS_HELP_STRING( + [--enable-shave], + [use shave to make the build pretty [[default=$1]]]),, + [enable_shave=$1] + ) +]) + +AC_DEFUN([SHAVE_INIT], +[ + dnl you can tweak the default value of enable_shave + m4_if([$2], [quiet], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)]) if test x"$enable_shave" = xyes; then dnl where can we find the shave scripts? diff --git a/test-cxx/configure.ac b/test-cxx/configure.ac index 6eac7d7..0f69064 100644 --- a/test-cxx/configure.ac +++ b/test-cxx/configure.ac @@ -5,7 +5,7 @@ AC_CONFIG_HEADERS([config.h]) AC_PROG_LIBTOOL AC_PROG_CC AC_PROG_CXX -SHAVE_INIT([../shave]) +SHAVE_INIT([../shave], [verbose]) AC_CONFIG_FILES([ ../shave/shave ../shave/shave-libtool diff --git a/test/configure.ac b/test/configure.ac index c58762b..c9b8143 100644 --- a/test/configure.ac +++ b/test/configure.ac @@ -4,7 +4,7 @@ AC_CONFIG_MACRO_DIR([../shave]) AC_CONFIG_HEADERS([config.h]) AC_PROG_LIBTOOL AC_PROG_CC -SHAVE_INIT([../shave]) +SHAVE_INIT([../shave], [quiet]) AC_CONFIG_FILES([ ../shave/shave ../shave/shave-libtool |