More reliable detection of libbfd.
This commit is contained in:
parent
a2f1db27db
commit
4126a53406
|
@ -23,59 +23,61 @@
|
|||
OUTPUT_VARIABLE LD_MESSAGE
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
string(REGEX REPLACE "GNU ld version ([^ ]+) .*" "\\1" BINUTILS_VERSION ${LD_MESSAGE} )
|
||||
message("-- Using system specific BFD library: " ${BINUTILS_VERSION})
|
||||
if(RETURN_CODE EQUAL 0)
|
||||
string(REGEX REPLACE "GNU ld version ([^ ]+) .*" "\\1" BINUTILS_VERSION ${LD_MESSAGE} )
|
||||
message("-- Using system specific BFD library: " ${BINUTILS_VERSION})
|
||||
|
||||
find_path(LIBBFD_INCLUDE_DIRS NAMES bfd.h
|
||||
dis-asm.h
|
||||
PATHS /usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/opt/include
|
||||
ENV CPATH)
|
||||
find_path(LIBBFD_INCLUDE_DIRS NAMES bfd.h
|
||||
dis-asm.h
|
||||
PATHS /usr/include
|
||||
/usr/local/include
|
||||
/opt/local/include
|
||||
/opt/include
|
||||
ENV CPATH)
|
||||
|
||||
# Ugly, yes ugly...
|
||||
find_library(LIBBFD_BFD_LIBRARY NAMES bfd-${BINUTILS_VERSION} bfd
|
||||
PATHS /usr/lib
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/include
|
||||
/opt/local/lib
|
||||
/opt/usr/lib64
|
||||
ENV LIBRARY_PATH
|
||||
ENV LD_LIBRARY_PATH)
|
||||
|
||||
#find_library (LIBBFD_IBERTY_LIBRARY NAMES iberty
|
||||
# PATHS /usr/lib
|
||||
# /usr/lib64
|
||||
# /usr/local/lib
|
||||
# /usr/local/lib64
|
||||
# /usr/include
|
||||
# /opt/local/lib
|
||||
# /opt/usr/lib64
|
||||
# ENV LIBRARY_PATH
|
||||
# ENV LD_LIBRARY_PATH)
|
||||
|
||||
#find_library (LIBBFD_OPCODES_LIBRARY NAMES opcodes
|
||||
# PATHS /usr/lib
|
||||
# /usr/lib64
|
||||
# /usr/local/lib
|
||||
# /usr/local/lib64
|
||||
# /usr/include
|
||||
# /opt/local/lib
|
||||
# /opt/usr/lib64
|
||||
# ENV LIBRARY_PATH
|
||||
# ENV LD_LIBRARY_PATH)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(LIBBFD DEFAULT_MSG
|
||||
LIBBFD_BFD_LIBRARY
|
||||
# LIBBFD_IBERTY_LIBRARY
|
||||
# LIBBFD_OPCODES_LIBRARY
|
||||
LIBBFD_INCLUDE_DIRS)
|
||||
|
||||
# Ugly, yes ugly...
|
||||
find_library(LIBBFD_BFD_LIBRARY NAMES bfd-${BINUTILS_VERSION} bfd
|
||||
PATHS /usr/lib
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/include
|
||||
/opt/local/lib
|
||||
/opt/usr/lib64
|
||||
ENV LIBRARY_PATH
|
||||
ENV LD_LIBRARY_PATH)
|
||||
|
||||
#find_library (LIBBFD_IBERTY_LIBRARY NAMES iberty
|
||||
# PATHS /usr/lib
|
||||
# /usr/lib64
|
||||
# /usr/local/lib
|
||||
# /usr/local/lib64
|
||||
# /usr/include
|
||||
# /opt/local/lib
|
||||
# /opt/usr/lib64
|
||||
# ENV LIBRARY_PATH
|
||||
# ENV LD_LIBRARY_PATH)
|
||||
|
||||
#find_library (LIBBFD_OPCODES_LIBRARY NAMES opcodes
|
||||
# PATHS /usr/lib
|
||||
# /usr/lib64
|
||||
# /usr/local/lib
|
||||
# /usr/local/lib64
|
||||
# /usr/include
|
||||
# /opt/local/lib
|
||||
# /opt/usr/lib64
|
||||
# ENV LIBRARY_PATH
|
||||
# ENV LD_LIBRARY_PATH)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
find_package_handle_standard_args(LIBBFD DEFAULT_MSG
|
||||
LIBBFD_BFD_LIBRARY
|
||||
# LIBBFD_IBERTY_LIBRARY
|
||||
# LIBBFD_OPCODES_LIBRARY
|
||||
LIBBFD_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
if(LIBBFD_FOUND)
|
||||
add_definitions(-DHAVE_LIBBFD)
|
||||
endif()
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue