+2010-03-13 Bruno Haible <bruno@clisp.org>
+ and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+ Allow plus signs in AC_ARG_ENABLE and AC_ARG_WITH.
+ * doc/autoconf.texi (External Software): Mention that AC_ARG_WITH
+ accepts packages with a + sign in it.
+ (Package Options): Likewise for AC_ARG_ENABLE.
+ * lib/autoconf/general.m4 (_AC_ENABLE_IF): Also replace '+' with '_'.
+ * tests/base.at (AC_ARG_ENABLE and AC_ARG_WITH): New test.
+ * NEWS: Update.
+
2010-06-14 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Autotest: simplify logic to compute test group result.
@var{action-if-given}. If neither option was given, run shell commands
@var{action-if-not-given}. The name @var{package} indicates another
software package that this program should work with. It should consist
-only of alphanumeric characters, dashes, and dots.
+only of alphanumeric characters, dashes, plus signs, and dots.
The option's argument is available to the shell commands
@var{action-if-given} in the shell variable @code{withval}, which is
shell commands @var{action-if-given}. If neither option was given, run
shell commands @var{action-if-not-given}. The name @var{feature}
indicates an optional user-level facility. It should consist only of
-alphanumeric characters, dashes, and dots.
+alphanumeric characters, dashes, plus signs, and dots.
The option's argument is available to the shell commands
@var{action-if-given} in the shell variable @code{enableval}, which is
AT_CLEANUP
+## ------------------------------ ##
+## AC_ARG_ENABLE and AC_ARG_WITH. ##
+## ------------------------------ ##
+
+AT_SETUP([AC_ARG_ENABLE and AC_ARG_WITH])
+
+AT_DATA_M4SH([configure.ac],
+[[AC_INIT
+# Taken from autoconf.texi:Pretty Help Strings.
+AC_ARG_WITH([foo],
+ [AS_HELP_STRING([--with-foo],
+ [use foo (default is no)])],
+ [use_foo=$withval],
+ [use_foo=no])
+AC_ARG_WITH([c++],
+ [AS_HELP_STRING([--with-c++],
+ [with c++])],
+ [choice_with=$withval])
+AC_ARG_ENABLE([c++],
+ [AS_HELP_STRING([--enable-c++],
+ [enable c++])],
+ [choice_enable=$enableval])
+echo "use_foo: $use_foo"
+echo "with_c++: $with_c__, $choice_with"
+echo "enable_c++: $enable_c__, $choice_enable"
+]])
+
+AT_CHECK_AUTOCONF
+AT_CHECK_CONFIGURE([--help | grep foo], [0],
+[[ --with-foo use foo (default is no)
+]], [ignore])
+AT_CHECK_CONFIGURE([--with-foo=yes --with-c++ --disable-c++],
+ [], [stdout], [ignore])
+AT_CHECK([grep 'use_foo: yes' stdout], [], [ignore])
+AT_CHECK([grep 'with_c++: yes, yes' stdout], [], [ignore])
+AT_CHECK([grep 'enable_c++: no, no' stdout], [], [ignore])
+AT_CHECK([grep 'unrecognized option' stdout], [1])
+AT_CHECK_CONFIGURE([--without-foo --with-c++=no --enable-c++=maybe],
+ [], [stdout], [ignore])
+AT_CHECK([grep 'use_foo: no' stdout], [], [ignore])
+AT_CHECK([grep 'with_c++: no, no' stdout], [], [ignore])
+AT_CHECK([grep 'enable_c++: maybe, maybe' stdout], [], [ignore])
+AT_CHECK([grep 'unrecognized option' stdout], [1])
+AT_CHECK_CONFIGURE([], [], [stdout], [ignore])
+AT_CHECK([grep 'use_foo: no' stdout], [], [ignore])
+AT_CHECK([grep 'with_c++: , $' stdout], [], [ignore])
+AT_CHECK([grep 'enable_c++: , $' stdout], [], [ignore])
+AT_CHECK([grep 'unrecognized option' stdout], [1])
+
+AT_CLEANUP
+
+
## --------------------- ##
## configure directories ##
## --------------------- ##