• Sergei Trofimovich's avatar
    configure.ac: fix '--disable-dwarf-debug' · cff44d86
    Sergei Trofimovich authored
    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:
            [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])],
        [AC_CHECK_LIB(dw, dwfl_attach_state,
          [AC_MSG_ERROR([Cannot find system libdw (required by --enable-dwarf-unwind)])])]
    - `[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: default avatarSergei Trofimovich <slyfox@gentoo.org>
configure.ac 45.8 KB