diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2022-07-28 16:09:45 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-08-26 10:29:51 -0400 |
commit | 4fd404c298db4e19dbf87331d3b02f451af4c5cd (patch) | |
tree | f840716f84831a2a2e679a0788c55d1432db5b8d /gdbsupport | |
parent | 3055522ab17ac7c6781a3507ebac0fab1c3aa5a4 (diff) | |
download | gdb-4fd404c298db4e19dbf87331d3b02f451af4c5cd.zip gdb-4fd404c298db4e19dbf87331d3b02f451af4c5cd.tar.gz gdb-4fd404c298db4e19dbf87331d3b02f451af4c5cd.tar.bz2 |
gdb, gdbsupport: configure: factor out yes/no/auto value checking
Factor out the code that checks that a value is yes/no or yes/no/auto.
Add two macros to gdbsupport/common.m4 and use them in gdb/configure.ac
I inspected the changes to configure. Other than whitespace changes, we
have some benign changes to the error messages (one of them had an error
actually). There are changes to the --enable-source-highlight and
--enable-libbacktrace handling, but setting enable_source_highlight /
enable_libbacktrace was not really useful anyway, they already had the
right value.
Change-Id: I92587aec36874309e1605e2d60244649f09a757a
Diffstat (limited to 'gdbsupport')
-rw-r--r-- | gdbsupport/common.m4 | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gdbsupport/common.m4 b/gdbsupport/common.m4 index d3e9ecb..0fed186 100644 --- a/gdbsupport/common.m4 +++ b/gdbsupport/common.m4 @@ -216,3 +216,31 @@ AC_DEFUN([GDB_AC_COMMON], [ BFD_HAVE_SYS_PROCFS_TYPE(elf_fpregset_t) fi ]) + +dnl Check that the provided value ($1) is either "yes" or "no". If not, +dnl emit an error message mentionning the configure option $2, and abort +dnl the script. +AC_DEFUN([GDB_CHECK_YES_NO_VAL], + [ + case $1 in + yes | no) + ;; + *) + AC_MSG_ERROR([bad value $1 for $2]) + ;; + esac + ]) + +dnl Check that the provided value ($1) is either "yes", "no" or "auto". If not, +dnl emit an error message mentionning the configure option $2, and abort +dnl the script. +AC_DEFUN([GDB_CHECK_YES_NO_AUTO_VAL], + [ + case $1 in + yes | no | auto) + ;; + *) + AC_MSG_ERROR([bad value $1 for $2]) + ;; + esac + ]) |