Improve libelf configure check

system libelf is not sufficient for glib (lacks elf_getshdrstrndx and
elf_getshdrnum) so let's make sure we don't define HAVE_LIBELF
This commit is contained in:
Matthias Clasen 2012-05-17 00:41:33 -04:00
parent aded15c9d1
commit 431d3adacd

View File

@ -1820,10 +1820,10 @@ PKG_CHECK_MODULES([LIBELF], [libelf], [have_libelf=yes], [have_libelf=maybe])
AS_IF([ test $have_libelf = maybe], [
glib_save_LIBS=$LIBS
AC_CHECK_LIB([elf], [elf_begin], , [have_libelf=no])
AC_CHECK_LIB([elf], [elf_getshdrstrndx], , [have_libelf=no])
AC_CHECK_LIB([elf], [elf_getshdrnum], , [have_libelf=no])
AC_CHECK_HEADER([libelf.h], , [have_libelf=no])
AC_CHECK_LIB([elf], [elf_begin], [:], [have_libelf=no])
AC_CHECK_LIB([elf], [elf_getshdrstrndx], [:], [have_libelf=no])
AC_CHECK_LIB([elf], [elf_getshdrnum], [:], [have_libelf=no])
AC_CHECK_HEADER([libelf.h], [:], [have_libelf=no])
LIBS=$glib_save_LIBS
if test $have_libelf != no; then