libdwarf: compile locally if not present

Change-Id: I70d1f653f4fc4ee4daeaa2c9c6bdbf1416e43c9b
This commit is contained in:
Balazs Gerofi
2019-11-07 15:14:51 +09:00
committed by Masamichi Takagi
parent 0f8f6d298e
commit 39780917af
8 changed files with 612 additions and 2 deletions

View File

@@ -4,7 +4,7 @@ if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build type: Debug Release..." FORCE)
endif (NOT CMAKE_BUILD_TYPE)
enable_language(C ASM)
enable_language(C ASM CXX)
project(mckernel C ASM)
set(MCKERNEL_VERSION "1.7.0")
@@ -34,6 +34,7 @@ include(GNUInstallDirs)
include(CMakeParseArguments)
include(Kbuild)
include(CheckCCompilerFlag)
include(AutoconfHelper)
CHECK_C_COMPILER_FLAG(-Wno-implicit-fallthrough IMPLICIT_FALLTHROUGH)
if(IMPLICIT_FALLTHROUGH)
@@ -135,6 +136,17 @@ if (NOT LIBIBERTY)
message(FATAL_ERROR "error: couldn't find libiberty")
endif()
# ignore libdwarf installed by libdwarf-devel-*.rpm because dwarf.h is located in /usr/include/libdwarf
execute_process(COMMAND bash -c "[[ -f /usr/include/libdwarf/dwarf.h ]] && echo YES" OUTPUT_VARIABLE BAD_DWARF_H OUTPUT_STRIP_TRAILING_WHITESPACE)
if (BAD_DWARF_H STREQUAL "YES")
message("WARNING: ignoring libdwarf installed by libdwarf-devel-*.rpm")
else()
find_library(LIBDWARF dwarf)
endif()
if (NOT LIBDWARF)
message("WARNING: libdwarf will be compiled locally")
endif()
if (ENABLE_QLMPI)
find_package(MPI REQUIRED)
endif()