On Debian <= wheezy, the PIC library is named libiberty_pic.a.
On Debian >= jessie and all RHEL and Fedora, libiberty.a is PIC.
---
cmake/Modules/FindLibIberty.cmake | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/cmake/Modules/FindLibIberty.cmake b/cmake/Modules/FindLibIberty.cmake
index 8352a60332a2..4632d1dc3923 100644
--- a/cmake/Modules/FindLibIberty.cmake
+++ b/cmake/Modules/FindLibIberty.cmake
@@ -2,13 +2,16 @@
# This module finds libiberty.
#
# It sets the following variables:
-# IBERTY_LIBRARY - The JSON-C library to link against.
+# IBERTY_LIBRARY - The libiberty library to link against.
-FIND_LIBRARY( IBERTY_LIBRARY NAMES iberty_pic )
+# For Debian <= wheezy, use libiberty_pic.a from binutils-dev
+# For Debian >= jessie, use libiberty.a from libiberty-dev
+# For all RHEL/Fedora, use libiberty.a from binutils-devel
+FIND_LIBRARY( IBERTY_LIBRARY NAMES iberty_pic iberty )
IF (IBERTY_LIBRARY)
- # show which JSON-C was found only if not quiet
+ # show which libiberty was found only if not quiet
MESSAGE( STATUS "Found libiberty: ${IBERTY_LIBRARY}")
SET(IBERTY_FOUND TRUE)
@@ -18,7 +21,7 @@ ELSE (IBERTY_LIBRARY)
IF ( IBERTY_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find libiberty. Try to install binutil-devel?")
ELSE()
- MESSAGE(STATUS "Could not find libiberty; downloading binutils and building PIC libibierty.")
+ MESSAGE(STATUS "Could not find libiberty; downloading binutils and building PIC libiberty.")
ENDIF (IBERTY_FIND_REQUIRED)
ENDIF (IBERTY_LIBRARY)
--
1.8.5.3
|