Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Link libintl in case of Alpine (#5731)
Browse files Browse the repository at this point in the history
This delta detects Alpine Linux by using `uname -v` (kernel version)
and add the `libintl` in the linker list. This is because `gettext` is
not part of (per-installed in) Alpine Linux but available via the
package manager. To build CoreCLR, `gettext-dev` is one unlisted
per-requisite.
  • Loading branch information
Peter Jas authored and janvorli committed Jun 14, 2016
1 parent 7f7d827 commit 11a5971
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/pal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ cmake_minimum_required(VERSION 2.8.12.2)

include_directories(SYSTEM /usr/local/include)

# set kernel version to detect Alpine
EXEC_PROGRAM(uname ARGS -v OUTPUT_VARIABLE CMAKE_SYSTEM_KERNEL_VERSION)
string(FIND "${CMAKE_SYSTEM_KERNEL_VERSION}" "Alpine" PAL_SYSTEM_ALPINE)
if(PAL_SYSTEM_ALPINE EQUAL -1)
unset(PAL_SYSTEM_ALPINE)
endif()

include(configure.cmake)

project(coreclrpal)
Expand Down Expand Up @@ -245,6 +252,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
find_library(UNWIND_ARCH NAMES unwind-x86_64)
endif()

if(PAL_SYSTEM_ALPINE)
find_library(INTL intl)
endif()

find_library(UNWIND NAMES unwind)
find_library(UNWIND_GENERIC NAMES unwind-generic)

Expand All @@ -270,6 +281,10 @@ if(CMAKE_SYSTEM_NAME STREQUAL Linux)
target_link_libraries(coreclrpal ${UNWIND_ARCH})
endif(NOT UNWIND_ARCH STREQUAL UNWIND_ARCH-NOTFOUND)

if(NOT INTL STREQUAL INTL-NOTFOUND)
target_link_libraries(coreclrpal ${INTL})
endif(NOT INTL STREQUAL INTL-NOTFOUND)

endif(CMAKE_SYSTEM_NAME STREQUAL Linux)

if(CMAKE_SYSTEM_NAME STREQUAL NetBSD)
Expand Down

0 comments on commit 11a5971

Please sign in to comment.