[Mesa-stable] [Mesa-dev] [PATCH] configure.ac: use pkg-config for libelf

Michel Dänzer michel at daenzer.net
Tue Nov 24 01:00:58 PST 2015


On 23.11.2015 23:06, Emil Velikov wrote:
> On 23 November 2015 at 03:24, Jonathan Gray <jsg at jsg.id.au> wrote:
>> Use PKG_CHECK_MODULES to get the flags to link libelf.
>>
>> Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
>> Cc: "11.0 11.1" <mesa-stable at lists.freedesktop.org>
>> ---
>>  configure.ac                           | 4 +---
>>  src/gallium/drivers/radeon/Makefile.am | 2 +-
>>  src/gallium/targets/opencl/Makefile.am | 2 +-
>>  3 files changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/configure.ac b/configure.ac
>> index 72a2ec1..afee3ed 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -1712,7 +1712,7 @@ AC_ARG_WITH([clang-libdir],
>>     [CLANG_LIBDIR=''])
>>
>>  PKG_CHECK_EXISTS([libclc], [have_libclc=yes], [have_libclc=no])
>> -AC_CHECK_LIB([elf], [elf_memory], [have_libelf=yes;ELF_LIB=-lelf])
>> +PKG_CHECK_MODULES([LIBELF], [libelf], [have_libelf=yes], [have_libelf=no])
>>
> There are (at least) two providers/projects for libelf one of which
> iirc does not provide a .pc file. We might need to keep the check_lib
> as a fall back. Don't know which one is required/compatible with
> radeon and opencl.

Either works for that, but AFAICT libelf (which ships a .pc file) has
been basically dead upstream for years, whereas elfutils (which doesn't
ship a .pc file) is being actively developed. So I'm afraid we do need
the non-pkg-config path at least as a fallback, at least until somebody
makes elfutils ship a .pc file as well.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the mesa-stable mailing list