diff options
author | Jonathan Gray <[email protected]> | 2015-12-09 16:55:01 +1100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2015-12-17 09:37:24 +0000 |
commit | 7f585a6a98d0553ec0ba48e18b1d9bac1256881a (patch) | |
tree | 42b2a76487dbc136596c0b99245a34b8ea927144 /configure.ac | |
parent | e97b207654a1c0b2c27b6ad6579b5570a83ce8cd (diff) |
configure.ac: use pkg-config for libelf
Use PKG_CHECK_MODULES to get the flags to link libelf
v2: keep AC_CHECK_LIB as a fallback for elfutils provided
libelf that doesn't install a pkg-config file.
Signed-off-by: Jonathan Gray <[email protected]>
Reviewed-by: Michel Dänzer <[email protected]>
Tested-by: Michel Dänzer <[email protected]>
Cc: "11.0 11.1" <[email protected]>
Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index b6680d04fd1..7a3c7cd2faf 100644 --- a/configure.ac +++ b/configure.ac @@ -1712,7 +1712,15 @@ 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]) + +if test "x$have_libelf" = xno; then + LIBELF_LIBS='' + LIBELF_CFLAGS='' + AC_CHECK_LIB([elf], [elf_memory], [have_libelf=yes;LIBELF_LIBS=-lelf], [have_libelf=no]) + AC_SUBST([LIBELF_LIBS]) + AC_SUBST([LIBELF_CFLAGS]) +fi if test "x$enable_opencl" = xyes; then if test -z "$with_gallium_drivers"; then @@ -2299,8 +2307,6 @@ if test "x$USE_VC4_SIMULATOR" = xyes -a "x$HAVE_GALLIUM_ILO" = xyes; then AC_MSG_ERROR([VC4 simulator on x86 replaces i965 driver build, so ilo must be disabled.]) fi -AC_SUBST([ELF_LIB]) - AM_CONDITIONAL(HAVE_LIBDRM, test "x$have_libdrm" = xyes) AM_CONDITIONAL(HAVE_X11_DRIVER, test "x$enable_xlib_glx" = xyes) AM_CONDITIONAL(HAVE_OSMESA, test "x$enable_osmesa" = xyes) |