changeset 4654:de5d2e65cc32

Use AS_HELP_STRING() macro for prettifying --help output where applicable.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 16 Jun 2008 14:15:36 +0300
parents 5f80f9d0e7ee
children 60910362ecf2
files acinclude.m4 configure.ac
diffstat 2 files changed, 19 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/acinclude.m4	Mon Jun 16 07:49:28 2008 +0300
+++ b/acinclude.m4	Mon Jun 16 14:15:36 2008 +0300
@@ -48,8 +48,9 @@
 dnl ** Simple wrapper for AC_ARG_ENABLE
 dnl ** AUD_ARG_ENABLE([name], [default value], [help string], [if enabled], [if disabled])
 AC_DEFUN([AUD_ARG_ENABLE], [dnl
-    define([Name], [translit([$1], [./-], [___])])
-    AC_ARG_ENABLE([$1], [$3],, [enable_[]Name=$2])
+# _A_ARG_ENABLE($1, $2, $3, $4, $5)
+    define([Name], [translit([$1], [./-], [___])])dnl
+    AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], [$3])],, [enable_[]Name=$2])
     if test "x${enable_[]Name}" = "xyes"; then
         m4_ifvaln([$4], [$4], [:])dnl
         m4_ifvaln([$5], [else $5])dnl
@@ -58,8 +59,9 @@
 
 
 AC_DEFUN([AUD_ARG_SIMPLE], [dnl
-    define([Name], [translit([$1], [./-], [___])])
-    AC_ARG_ENABLE([$1], [$3],, [enable_[]Name=$2])
+# _A_ARG_SIMPLE($1, $2, $3, $4, $5, $6)
+    define([Name], [translit([$1], [./-], [___])])dnl
+    AC_ARG_ENABLE([$1], [AS_HELP_STRING([ifelse([$2],[yes],[--disable-$1],[--enable-$1])], [$3])],, [enable_[]Name=$2])
     if test "x${enable_[]Name}" = "xyes"; then
         AC_DEFINE([$4], [$5], [$6])
     fi
@@ -97,12 +99,12 @@
     else
         AC_MSG_ERROR([** GNU make not found. If it is installed, try setting MAKE environment variable. **])
     fi
-    AC_SUBST([MAKE])
-])
+    AC_SUBST([MAKE])dnl
+])dnl
 
 
 dnl *** Define plugin directories
-AC_DEFUN([AUD_DEFINE_PLUGIN_DIR],[
+AC_DEFUN([AUD_DEFINE_PLUGIN_DIR],[dnl
 define([Name], [translit([$1], [a-z], [A-Z])])dnl
 if test "x$enable_one_plugin_dir" = "xyes"; then
 ifdef([aud_plugin_dirs_defined],[],
@@ -121,7 +123,7 @@
 
 
 dnl *** Get plugin directories
-AC_DEFUN([AUD_GET_PLUGIN_DIR],[
+AC_DEFUN([AUD_GET_PLUGIN_DIR],[dnl
 define([Name], [translit([$1_plugin_dir], [A-Z], [a-z])])dnl
 define([BigName], [translit([$1], [a-z], [A-Z])])dnl
 ifdef([aud_get_plugin_dirs_defined],
@@ -188,7 +190,7 @@
 dnl SSE2 support
 dnl ============
 AUD_ARG_ENABLE([sse2], [yes],
-[  --disable-sse2               Disable SSE2 support (def: enabled)],
+[Disable SSE2 support (def: enabled)],
 [
     AC_MSG_CHECKING([SSE2 support])
     aud_my_save_CFLAGS="$CFLAGS"
@@ -215,7 +217,7 @@
 dnl AltiVec support 
 dnl ===============
 AUD_ARG_ENABLE([altivec], [yes],
-[  --disable-altivec            Disable AltiVec support (def: enabled)],
+[Disable AltiVec support (def: enabled)],
 [
     AC_CHECK_HEADERS([altivec.h],
     [
--- a/configure.ac	Mon Jun 16 07:49:28 2008 +0300
+++ b/configure.ac	Mon Jun 16 14:15:36 2008 +0300
@@ -76,7 +76,7 @@
 AC_PATH_PROG([AUDACIOUS_PATH], [audacious], [no])
 
 AUD_ARG_ENABLE([user-plugin-dir], [yes],
-[  --disable-user-plugin-dir    Disable per-user plugin dir (def: enabled)])
+[Disable per-user plugin dir (def: enabled)])
 
 if test "x$enable_user_plugin_dir" = "xno"; then
     AC_DEFINE([DISABLE_USER_PLUGIN_DIR], 1, [Define to disable per user plugin directory])
@@ -87,7 +87,7 @@
 dnl Chardet support
 dnl ===============
 AUD_ARG_ENABLE([chardet], [yes],
-[  --disable-chardet            Disable charset detection support (def: enabled)],
+[Disable charset detection support (def: enabled)],
 [
     AC_DEFINE([USE_CHARDET], 1, [Define if character set detection enabled])
     AC_CHECK_LIB([udet_c], [detectCharset], [
@@ -103,7 +103,7 @@
 dnl D-Bus support
 dnl =============
 AUD_ARG_ENABLE([dbus], [yes],
-[  --enable-dbus                Enable D-Bus support (def: enabled)],
+[Enable D-Bus support (def: enabled)],
 [
     PKG_CHECK_MODULES([DBUS], [dbus-1 >= 0.60 dbus-glib-1 >= 0.60 gthread-2.0],
         [enable_dbus=yes],
@@ -134,7 +134,7 @@
 dnl libsamplerate support
 dnl =====================
 AUD_ARG_ENABLE([samplerate], [no],
-[  --enable-samplerate          Enable libsamplerate support (def: disabled)],
+[Enable libsamplerate support (def: disabled)],
 [
     AUD_CHECK_MODULE([SAMPLERATE], [samplerate],, [libsamplerate])
     aud_save_LIBS="$LIBS"
@@ -155,7 +155,7 @@
 dnl xspf playlist support
 dnl =====================
 AUD_ARG_ENABLE([xspf], [yes],
-[  --disable-xspf               Disable XSPF support (def: enabled)],
+[Disable XSPF support (def: enabled)],
 [
     AM_PATH_XML2([2.0.0],, [
        AC_MSG_WARN([*** libxml2 is not installed. XSPF playlist support will not be built. ***])
@@ -173,7 +173,7 @@
 REGEX_LIBS=
 REGEX_CFLAGS=
 AC_ARG_WITH([regexlib],
-[[  --with-regexlib[=gnu/oniguruma/pcre]   use the chosen regex library (def: gnu)]],
+[AS_HELP_STRING([--with-regexlib[=gnu/oniguruma/pcre]],[Use the chosen regex library (def: gnu)])],
 [
 case $withval in
   pcre)
@@ -209,7 +209,7 @@
 AC_DEFINE_UNQUOTED([AUDACIOUS_DESKTOP_FILE], "${desktop_file}", [Location of the desktop file])
 
 AUD_ARG_ENABLE([sm], [yes],
-[  --disable-sm                 Disable session management (def: enabled)],
+[Disable session management (def: enabled)],
 [
     PKG_CHECK_MODULES([SM], [sm >= 1.0], [
         AC_DEFINE([USE_EGGSM], 1, [Define if session management should be used.])