Found it! From this tutorial:
M4 arguments are quoted with [ and ]. There is NO WAY to escape these, however, you have several options if you wish to insert ['s or ]'s:
- Use a `Quadrigaph'. @<:@ gives you [ and @>:@ gives you ].
- Balance your quotes. M4 will turn [[]] in to []. Beware of using this in arguments to macros. Sometimes, you need to double quote as well ([[[]]]).
- Change the quoting using: changequote(<<,>>) to change the quoting to << and >>. The autoconf documentation (rightly, in my opinion) warns against the (over) use of this, since it can lead to unexpected results.
- Avoid [ and ] where ever possible. This is my personal choice.
My new code is therefore:
AC_ARG_ENABLE(debug,
AS_HELP_STRING(
[--enable-debug],
[build with debugging symbols @<:@default=no@:>@]),
[enable_debug="$enableval"],
[enable_debug="no"]
)