diff options
author | Wez Furlong <wez@messagesystems.com> | 2012-03-24 14:27:02 -0400 |
---|---|---|
committer | Wez Furlong <wez@messagesystems.com> | 2012-03-24 14:27:02 -0400 |
commit | 2ba434759480381e6bb6cc91b5a1461b221fb945 (patch) | |
tree | 217b73ddca02dddcfc8b8f337b27ac6989789865 | |
parent | 49ab3e0dd3256b9887890e7074dea7248e522bf5 (diff) | |
download | ctf-master.tar.gz |
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | libdwarf/dwarf_init.c | 7 |
2 files changed, 15 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 9f76c61..62a311a 100644 --- a/configure.ac +++ b/configure.ac @@ -26,7 +26,15 @@ AC_CHECK_LIB(z, uncompress) AC_CHECK_LIB(elf, gelf_getshdr, [],[ build_gelf=true ]) - build_gelf=true +case $host in + *solaris*) + build_gelf=false + AC_CHECK_HEADERS([gelf.h]) + ;; + *) + build_gelf=true + ;; +esac AM_CONDITIONAL([BUILD_ELF], [test "$build_gelf" = true]) AC_CHECK_LIB(dwarf, dwarf_elf_init, [], [ @@ -36,7 +44,6 @@ AM_CONDITIONAL([BUILD_DWARF], [test "$build_dwarf" = true]) AC_CHECK_LIB(pthread, pthread_create) -#gelf.h \ AC_CHECK_HEADERS([ \ ctype.h \ dwarf.h \ diff --git a/libdwarf/dwarf_init.c b/libdwarf/dwarf_init.c index 7749345..63c03fd 100644 --- a/libdwarf/dwarf_init.c +++ b/libdwarf/dwarf_init.c @@ -610,7 +610,12 @@ dwarf_elf_read(Dwarf_Debug dbg, Dwarf_Error *error) } /* Get the section index to the string table. */ - if (elf_getshdrstrndx(dbg->dbg_elf, &dbg->dbg_stnum) == -1) { +#ifdef sun + i = elf_getshstrndx(dbg->dbg_elf, &dbg->dbg_stnum) == 0; +#else + i = elf_getshdrstrndx(dbg->dbg_elf, &dbg->dbg_stnum) == -1; +#endif + if (i) { DWARF_SET_ELF_ERROR(error, elf_errno()); return DWARF_E_ELF; } |