More reliable detection of libbfd.

This commit is contained in:
Jean-Paul Chaput 2017-04-13 17:04:35 +02:00
parent a2f1db27db
commit 4126a53406
2 changed files with 55 additions and 51 deletions

View File

@ -23,6 +23,7 @@
OUTPUT_VARIABLE LD_MESSAGE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(RETURN_CODE EQUAL 0)
string(REGEX REPLACE "GNU ld version ([^ ]+) .*" "\\1" BINUTILS_VERSION ${LD_MESSAGE} )
message("-- Using system specific BFD library: " ${BINUTILS_VERSION})
@ -75,6 +76,7 @@
# LIBBFD_IBERTY_LIBRARY
# LIBBFD_OPCODES_LIBRARY
LIBBFD_INCLUDE_DIRS)
endif()
if(LIBBFD_FOUND)
add_definitions(-DHAVE_LIBBFD)

View File

@ -82,6 +82,8 @@
#if (defined __linux__ || defined __FreeBSD__ || defined __APPLE__)
#include <execinfo.h>
#ifdef HAVE_LIBBFD
#define PACKAGE "Hurricane"
#define PACKAGE_VERSION "no_version"
#include <bfd.h>
#endif
#endif