Fix build if libdwarf dir missing

I was getting errors from -Werror=missing-include-dirs due to
$includedir/libdwarf not existing when builing in a different
prefix than /usr.
tingping/wmclass
Alexander Larsson 2017-03-27 10:55:40 +02:00
parent 2618a19716
commit 7d5767333a
1 changed files with 10 additions and 1 deletions

View File

@ -271,8 +271,17 @@ AC_ARG_WITH([dwarf-header],
provided, or it will be searched for in includedir])])],
[with_dwarf_header=yes])
# We need to check these exist, because otherwise -Werror=missing-include-dirs errors out
LIBDWARF_INCLUDES=
if test -d $(eval echo \"$includedir\")/libdwarf; then
LIBDWARF_INCLUDES="$LIBDWARF_INCLUDES -I$(eval echo \"$includedir\")/libdwarf"
fi
if test -d /usr/include/libdwarf; then
LIBDWARF_INCLUDES="$LIBDWARF_INCLUDES -I/usr/include/libdwarf"
fi
AS_IF([test "x$with_dwarf_header" = "xyes"],
[CPPFLAGS="$CPPFLAGS -I$(eval echo \"$includedir\")/libdwarf -I/usr/include/libdwarf"
[CPPFLAGS="$CPPFLAGS $LIBDWARF_INCLUDES"
AC_CHECK_HEADER([dwarf.h])
AS_IF([test "x$ac_cv_header_dwarf_h" != "xyes"],
[AC_MSG_ERROR([dwarf.h is required but was not found; locate it using --with-dwarf-header=/path/containing/header])])],