1
2# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
3#
4# This program is free software; you can redistribute it and/or modify
5# it under the terms of the GNU General Public License as published by
6# the Free Software Foundation; version 2 of the License.
7#
8# This program is distributed in the hope that it will be useful,
9# but WITHOUT ANY WARRANTY; without even the implied warranty of
10# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11# GNU General Public License for more details.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
16
17# This file includes Linux specific options and quirks, related to system checks
18
19INCLUDE(CheckSymbolExists)
20
21# Something that needs to be set on legacy reasons
22SET(TARGET_OS_LINUX 1)
23SET(HAVE_NPTL 1)
24SET(_GNU_SOURCE 1)
25
26# Fix CMake (< 2.8) flags. -rdynamic exports too many symbols.
27FOREACH(LANG C CXX)
28  STRING(REPLACE "-rdynamic" ""
29  CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS
30  ${CMAKE_SHARED_LIBRARY_LINK_${LANG}_FLAGS}
31  )
32ENDFOREACH()
33
34# Ensure we have clean build for shared libraries
35# without unresolved symbols
36# Not supported with AddressSanitizer
37IF(NOT WITH_ASAN)
38  SET(LINK_FLAG_NO_UNDEFINED "-Wl,--no-undefined")
39ENDIF()
40
41# 64 bit file offset support flag
42SET(_FILE_OFFSET_BITS 64)
43
44# Linux specific HUGETLB /large page support
45CHECK_SYMBOL_EXISTS(SHM_HUGETLB sys/shm.h  HAVE_DECL_SHM_HUGETLB)
46IF(HAVE_DECL_SHM_HUGETLB)
47  SET(HAVE_LARGE_PAGES 1)
48  SET(HUGETLB_USE_PROC_MEMINFO 1)
49  SET(HAVE_LARGE_PAGE_OPTION 1)
50ENDIF()
51