Search for dwarf.h in configure

Add a --with-dwarf-header argument for supplying the path containing the
dwarf.h header from libdwarf. Either a path must be provided, or a fallback
location of $includedir/libdwarf will be tested.

https://bugs.freedesktop.org/show_bug.cgi?id=94308
tingping/wmclass
David King 2016-02-26 10:43:04 +00:00 committed by Alexander Larsson
parent 87be89a7b8
commit 12d49beb72
1 changed files with 20 additions and 0 deletions

View File

@ -206,6 +206,26 @@ AS_IF([ test $have_libelf = maybe ], [
if test x$have_libelf != xyes; then
AC_MSG_ERROR([libelf not found])
fi
dnl This only checks for the header, not the library.
AC_ARG_WITH([dwarf-header],
[AS_HELP_STRING([--with-dwarf-header],
[path containing dwarf.h])],
[AS_IF([test "x$with_dwarf_header" = "xno"],
[AC_MSG_WARN([either a path containing dwarf.h must be
provided, or it will be searched for in includedir])])],
[with_dwarf_header=yes])
AS_IF([test "x$with_dwarf_header" = "xyes"],
[CPPFLAGS="$CPPFLAGS -I$(eval echo \"$includedir\")/libdwarf"
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])])],
[CPPFLAGS="$CPPFLAGS -I$with_dwarf_header"
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])])])
AC_ARG_ENABLE(documentation,
AC_HELP_STRING([--enable-documentation], [Build documentation]),,
enable_documentation=yes)