1#   BAREOS® - Backup Archiving REcovery Open Sourced
2#
3#   Copyright (C) 2017-2020 Bareos GmbH & Co. KG
4#
5#   This program is Free Software; you can redistribute it and/or
6#   modify it under the terms of version three of the GNU Affero General Public
7#   License as published by the Free Software Foundation and included
8#   in the file LICENSE.
9#
10#   This program is distributed in the hope that it will be useful, but
11#   WITHOUT ANY WARRANTY; without even the implied warranty of
12#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13#   Affero General Public License for more details.
14#
15#   You should have received a copy of the GNU Affero General Public License
16#   along with this program; if not, write to the Free Software
17#   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18#   02110-1301, USA.
19include(CMakePushCheckState)
20include(CheckSymbolExists)
21
22check_symbol_exists(__stub_lchmod features.h LCHMOD_IS_A_STUB1)
23check_symbol_exists(__stub___lchmod features_h LCHMOD_IS_A_STUB2)
24
25if("${LCHMOD_IS_A_STUB1}" OR "${LCHMOD_IS_A_STUB2}")
26  message(STATUS " lchmod is a stub, setting HAVE_LCHMOD to 0")
27  set(HAVE_LCHMOD 0)
28endif()
29
30check_symbol_exists(poll poll.h HAVE_POLL)
31
32cmake_push_check_state()
33set(CMAKE_REQUIRED_LIBRARIES ${RADOS_LIBRARIES})
34check_symbol_exists(
35  rados_ioctx_set_namespace rados/librados.h HAVE_RADOS_NAMESPACES
36)
37check_symbol_exists(
38  rados_nobjects_list_open rados/librados.h HAVE_RADOS_NOBJECTS_LIST
39)
40cmake_pop_check_state()
41
42if(HAVE_GLUSTERFS_API_GLFS_H)
43  cmake_push_check_state()
44  set(CMAKE_REQUIRED_LIBRARIES ${GFAPI_LIBRARIES})
45  check_cxx_source_compiles(
46    "
47#include <glusterfs/api/glfs.h>
48int main(void)
49{
50       /* new glfs_ftruncate() passes two additional args */
51       return glfs_ftruncate(NULL, 0, NULL, NULL);
52}
53"
54    GLFS_FTRUNCATE_HAS_FOUR_ARGS
55  )
56
57endif()
58cmake_pop_check_state()
59