From 12d49beb728eaaa3bfbb278d2b2781fd4144df6a Mon Sep 17 00:00:00 2001 From: David King Date: Fri, 26 Feb 2016 10:43:04 +0000 Subject: 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 --- configure.ac | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 57cf968..66e1cab 100644 --- a/configure.ac +++ b/configure.ac @@ -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) -- cgit v1.2.1