diff options
author | Sergei Trofimovich <slyfox@gentoo.org> | 2019-08-18 00:50:35 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-08-23 19:27:21 -0400 |
commit | cff44d8686c1539ee77d34756d6b7908e120b96a (patch) | |
tree | aefbbe9127a74770466906d62c237c7acc2768b5 /configure.ac | |
parent | 47070144030d85bd510f31ab70006d055a2af151 (diff) | |
download | haskell-cff44d8686c1539ee77d34756d6b7908e120b96a.tar.gz |
configure.ac: fix '--disable-dwarf-debug'
Before the change
./configure --disable-dwarf-debug
enabled DWARF debugging unconditionally.
This happened due to use of 5-argument form of `AC_ARG_ENABLE`
without actually checking the passed `$enableval` parameter:
```
AC_ARG_ENABLE(dwarf-unwind,
[AC_HELP_STRING([--enable-dwarf-unwind],
[Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])],
[AC_CHECK_LIB(dw, dwfl_attach_state,
[UseLibdw=YES],
[AC_MSG_ERROR([Cannot find system libdw (required by --enable-dwarf-unwind)])])]
[UseLibdw=NO]
)
```
Note:
- `[UseLibdw=NO]` is called when `--{enable,disable}-dwarf-unwind`
is not passed at all as a parameter (ok).
- `[AC_CHECK_LIB(dw, dwfl_attach_state, [UseLibdw=YES],` is called
for both:
* `--enable-dwarf-unwind` being passed: `$enableval = "yes"` (ok).
* --disable-dwarf-unwind` being passed: `$enableval = "no"` (bad).
The change is to use 3-argument `AC_ARG_ENABLE` and check for passed
value as `"$enable_dwarf_unwind" = "yes"`.
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index 0524d140b2..6f57d3b5ec 100644 --- a/configure.ac +++ b/configure.ac @@ -1246,12 +1246,13 @@ UseLibdw=NO USE_LIBDW=0 AC_ARG_ENABLE(dwarf-unwind, [AC_HELP_STRING([--enable-dwarf-unwind], - [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])], - [AC_CHECK_LIB(dw, dwfl_attach_state, + [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])]) +if test "$enable_dwarf_unwind" = "yes" ; then + AC_CHECK_LIB(dw, dwfl_attach_state, [UseLibdw=YES], - [AC_MSG_ERROR([Cannot find system libdw (required by --enable-dwarf-unwind)])])], - [UseLibdw=NO] -) + [AC_MSG_ERROR([Cannot find system libdw (required by --enable-dwarf-unwind)])]) +fi + AC_SUBST(UseLibdw) if test $UseLibdw = "YES" ; then USE_LIBDW=1 |