From 391eb656fe512594cd2c3b5fc46c7d805deeef9a Mon Sep 17 00:00:00 2001 From: Georg Sauthoff Date: Fri, 26 Aug 2016 22:59:19 +0200 Subject: [PATCH] link additional Libraries on Solaris --- CMakeLists.txt | 8 +++++++- README.md | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d75bf1..054e821 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,6 +18,12 @@ endif() configure_file(config.h.in config.h) +if(CMAKE_SYSTEM_NAME STREQUAL "SunOS") + find_library(NSL_LIB NAMES nsl) + # prefer the OpenCSW libintl over the one from /usr/lib/64 + find_library(INTL_LIB NAMES intl HINTS /opt/csw/lib/64) +endif() + add_library(mksh STATIC lib/mksh/dosys.cc lib/mksh/globals.cc lib/mksh/i18n.cc lib/mksh/macro.cc lib/mksh/misc.cc lib/mksh/mksh.cc lib/mksh/read.cc @@ -52,7 +58,7 @@ set_property(TARGET ${PROJECT_NAME} mksh vroot PROPERTY INCLUDE_DIRECTORIES ) target_link_libraries(${PROJECT_NAME} - mksh vroot pthread ${BSD_LIBRARIES} + mksh vroot pthread ${BSD_LIBRARIES} ${NSL_LIB} ${INTL_LIB} ) # default install prefix is /usr/local diff --git a/README.md b/README.md index 5cb53e7..c0dec5d 100644 --- a/README.md +++ b/README.md @@ -317,7 +317,7 @@ If you are compiling on a legacy platform with ancient libraries you may need to tweak the cmake call a little bit. For example, to compile with GCC on a Solaris 10 system: - $ CC=gcc CXX=g++ LDFLAGS='-lnsl /opt/csw/lib/libintl.so.8' \ + $ CC=gcc CXX=g++ CFLAGS='-m64' CXXFLAGS='-m64' \ cmake -DCMAKE_BUILD_TYPE=Release ../somake ### Manual Installation