Closed Stefan-Schmidt closed 6 years ago
It also causes problems in one of you header files. I fixed it for me like this
diff --git a/include/dwarfpp/private/libdwarf.hpp b/include/dwarfpp/private/libdwarf.hpp index dd5dc1a..b21edb7 100644 --- a/include/dwarfpp/private/libdwarf.hpp +++ b/include/dwarfpp/private/libdwarf.hpp @@ -13,7 +13,7 @@ namespace dwarf // HACK: libdwarf.h declares struct Elf opaquely, and we don't // want it in the dwarf::lib namespace, so preprocess this.
#undef Elf
}
// forward decls
Would be more generic if you add the libdwarf include path to your -I during build.
Thanks for this report. Indeed, the autoconf/automake was broken in a few ways. I've just pushed some changes (6bf77e6) which seem to work for me. You can now specify the libdwarf include directory as an argument to the configure script. Does this fix the first problem for you?
I couldn't quite understand the second problem, with the #undef. Can you elaborate?
The second paste was screwed up by github because I did not use the code markers for markdown.
diff --git a/include/dwarfpp/private/libdwarf.hpp b/include/dwarfpp/private/libdwarf.hpp
index dd5dc1a..b21edb7 100644
--- a/include/dwarfpp/private/libdwarf.hpp
+++ b/include/dwarfpp/private/libdwarf.hpp
@@ -13,7 +13,7 @@ namespace dwarf
// HACK: libdwarf.h declares struct Elf opaquely, and we don't
// want it in the dwarf::lib namespace, so preprocess this.
#define Elf Elf_opaque_in_libdwarf
- #include <libdwarf.h>
+ #include <libdwarf/libdwarf.h>
#undef Elf
}
// forward decls
As you can see it really was the same problem with the include dir. The issue is only partially fixed though as configure still fails with the AC_CHECK_HEADERS check which is still looking into the wrong directory.
Ah, silly me for missing that. I've just pushed 91c5508 which tweaks this some more... let me know if that helps.
As mentioned before the AC_CHECK_HEADERS is not able to detect the dwarf header files even when given the correct include path. I have to apply the following (updated to your latest changes) to pass the configure stage:
diff --git a/configure.ac b/configure.ac
index 631c5ac..5140e67 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,10 +24,10 @@ AC_CHECK_TYPES([ptrdiff_t])
AC_PROG_LN_S
AC_PROG_INSTALL
-AC_CHECK_HEADERS([algorithm cassert cstdlib dwarf.h elf.h functional iostream iterator libdwarf.h libelf.h limits map memory queue set stack string strings.h type_traits unistd.h unordered_map unordered_set utility vector], [], [AC_MSG_FAILURE([required standard headers: algorithm cassert cstdlib dwarf.h elf.h functional iostream iterator libdwarf.h libelf.h limits map memory queue set stack string strings.h type_traits unistd.h unordered_map unordered_set utility vector])])
+AC_CHECK_HEADERS([algorithm cassert cstdlib elf.h functional iostream iterator libelf.h limits map memory queue set stack string strings.h type_traits unistd.h unordered_map unordered_set utility vector], [], [AC_MSG_FAILURE([required standard headers: algorithm cassert cstdlib dwarf.h elf.h functional iostream iterator libdwarf.h libelf.h limits map memory queue set stack string strings.h type_traits unistd.h unordered_map unordered_set utility vector])])
AC_CHECK_HEADERS([elf.h libelf.h], [], [AC_MSG_FAILURE([required headers: elf.h libelf.h])])
-AC_CHECK_HEADERS([dwarf.h libdwarf.h], [], [AC_MSG_FAILURE([required headers: dwarf.h libdwarf.h])])
+#AC_CHECK_HEADERS([dwarf.h libdwarf.h], [], [AC_MSG_FAILURE([required headers: dwarf.h libdwarf.h])])
Once coming to the actual compile I'm still facing issue #6.
I believe this is now fixed, or at least sufficiently changed that the problems will be new ones. Please open another issue if you still have problems.
On my Fedora 22 installation libdwarf installs its headers into /usr/include/libdwarf/ which makes the AC_CHECK_HEADERS in your configur fail (pity that libdwarf does not use libtool)
Btw, you are listing elf.h, libelf.h, dwarf.h and libdwarf.h in both AC_CHECK_HEADERS. To me it looks like thy should get removed from the first check.