aboutsummaryrefslogtreecommitdiff
path: root/config/enable.m4
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2005-09-23 17:28:31 +0000
committerTom Tromey <tromey@redhat.com>2005-09-23 17:28:31 +0000
commit11c94d12ff151555656d15f6ddbacedf9939d0d0 (patch)
treec841a84be7f715c538bfb01e4cf5cc5d9d12c1e0 /config/enable.m4
parentd785c760909278f14459ba4da0e3ea29821c16e9 (diff)
downloadgdb-11c94d12ff151555656d15f6ddbacedf9939d0d0.zip
gdb-11c94d12ff151555656d15f6ddbacedf9939d0d0.tar.gz
gdb-11c94d12ff151555656d15f6ddbacedf9939d0d0.tar.bz2
* enable.m4: New file.
* tls.m4: New file.
Diffstat (limited to 'config/enable.m4')
-rw-r--r--config/enable.m438
1 files changed, 38 insertions, 0 deletions
diff --git a/config/enable.m4 b/config/enable.m4
new file mode 100644
index 0000000..88b29b8
--- /dev/null
+++ b/config/enable.m4
@@ -0,0 +1,38 @@
+dnl ----------------------------------------------------------------------
+dnl This whole bit snagged from libstdc++-v3.
+
+dnl
+dnl GCC_ENABLE
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING)
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
+dnl (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
+dnl
+dnl See docs/html/17_intro/configury.html#enable for documentation.
+dnl
+AC_DEFUN([GCC_ENABLE],[dnl
+m4_define([_g_switch],[--enable-$1])dnl
+m4_define([_g_help],[AC_HELP_STRING(_g_switch$3,[$4 @<:@default=$2@:>@])])dnl
+ AC_ARG_ENABLE($1,_g_help,
+ m4_bmatch([$5],
+ [^permit ],
+ [[
+ case "$enableval" in
+ m4_bpatsubst([$5],[permit ])) ;;
+ *) AC_MSG_ERROR(Unknown argument to enable/disable $1) ;;
+ dnl Idea for future: generate a URL pointing to
+ dnl "onlinedocs/configopts.html#whatever"
+ esac
+ ]],
+ [^$],
+ [[
+ case "$enableval" in
+ yes|no) ;;
+ *) AC_MSG_ERROR(Argument to enable/disable $1 must be yes or no) ;;
+ esac
+ ]],
+ [[$5]]),
+ [enable_]m4_bpatsubst([$1],-,_)[=][$2])
+m4_undefine([_g_switch])dnl
+m4_undefine([_g_help])dnl
+])
+