openbsd-ports/devel/glib2/patches/patch-configure_ac
2012-04-06 10:44:38 +00:00

37 lines
1.2 KiB
Plaintext

$OpenBSD: patch-configure_ac,v 1.2 2012/04/06 10:44:38 ajacoutot Exp $
From 27d95bd81fabd41367cf000566ee2ccf3651652c Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Mon, 02 Apr 2012 12:53:20 +0000
Subject: Rework the libelf configure checks one more time
--- configure.ac.orig Fri Apr 6 12:21:33 2012
+++ configure.ac Fri Apr 6 12:24:01 2012
@@ -1810,12 +1810,23 @@ dnl ************************
dnl *** check for libelf ***
dnl ************************
-AC_CHECK_LIB([elf], [elf_begin], have_libelf=yes, have_libelf=no)
+PKG_CHECK_MODULES([LIBELF], [libelf], [have_libelf=yes], [have_libelf=maybe])
+
+if test $have_libelf = maybe; then
+ 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])
+
+ if test $have_libelf != no; then
+ LIBELF_LIBS=-lelf
+ have_libelf = yes
+ fi
+fi
+
if test $have_libelf = yes; then
AC_DEFINE(HAVE_LIBELF, 1, [Define if libelf is available])
- ELF_LIBS=-lelf
fi
-AC_SUBST(ELF_LIBS)
dnl ****************************************
dnl *** platform dependent source checks ***