Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake build system updates #1823

Merged
merged 10 commits into from
Nov 11, 2022
11 changes: 6 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ jobs:
container: centos:7

steps:
# python2-pip is broken on CentOS so can't upgrade pip or setuptools
# python2-pip is broken on CentOS so can't upgrade pip, setuptools, or wheel
- name: Install external dependencies with yum
run: |
yum update -y
Expand All @@ -195,7 +195,6 @@ jobs:
git \
cppunit-devel
yum clean all
python2 -m pip --no-cache-dir install --upgrade wheel

# Need to use v1 of action as image Git is too old
- name: Clone repository now that Git is available
Expand Down Expand Up @@ -334,10 +333,10 @@ jobs:
run: |
cd ..
cmake \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_INSTALL_PREFIX=/usr/local/ \
-DOPENSSL_SSL_LIBRARY=$(find $(find $(brew --cellar openssl) -type d -iname "lib") -type f -iname "libssl*.dylib") \
-DOPENSSL_CRYPTO_LIBRARY=$(find $(find $(brew --cellar openssl) -type d -iname "lib") -type f -iname "libcrypto*.dylib") \
-DOPENSSL_INCLUDE_DIR=$(find $(brew --cellar openssl) -type d -iname "include") \
-DCMAKE_PREFIX_PATH=/usr/local/opt/openssl@3 \
-DPYTHON_EXECUTABLE=$(command -v python3) \
-DENABLE_TESTS=ON \
-DPIP_OPTIONS="--verbose" \
Expand All @@ -349,6 +348,7 @@ jobs:
--clean-first \
--parallel $(($(sysctl -n hw.ncpu) - 1))
cmake --build build --target install
python3 -m pip install --user build/bindings/python
python3 -m pip list

- name: Verify install
Expand All @@ -358,6 +358,7 @@ jobs:

- name: Verify Python bindings
run: |
export DYLD_LIBRARY_PATH=/usr/local/lib
python3 --version --version
python3 -m pip list
python3 -m pip show xrootd
Expand Down
5 changes: 0 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ set( CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/cmake )

if(NOT (CMAKE_VERSION VERSION_LESS "3.1"))
cmake_policy(SET CMP0054 OLD)
endif()


#-------------------------------------------------------------------------------
# A 'plugins' phony target to simplify building build-tree binaries.
# Plugins are responsible for adding themselves to this target, where
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindCPPUnit.cmake → cmake/FindCppUnit.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ set(CPPUNIT_INCLUDE_DIRS ${CPPUNIT_INCLUDE_DIR})
set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cppunit DEFAULT_MSG CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES)
find_package_handle_standard_args(CppUnit DEFAULT_MSG CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES)
2 changes: 1 addition & 1 deletion cmake/FindKerberos5.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ else()
set( KERBEROS5_LIBRARIES ${KERBEROS5_LIBRARY} ${COM_ERR_LIBRARY} )

find_package_handle_standard_args(
KERBEROS5
Kerberos5
DEFAULT_MSG
KERBEROS5_LIBRARIES KERBEROS5_INCLUDE_DIR )

Expand Down
136 changes: 0 additions & 136 deletions cmake/FindOpenSSL.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/FindReadline.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else( READLINE_INCLUDE_DIR AND READLINE_LIBRARY )
endif()

find_package_handle_standard_args(
READLINE
Readline
DEFAULT_MSG
READLINE_LIBRARY READLINE_INCLUDE_DIR )

Expand Down
4 changes: 2 additions & 2 deletions cmake/FindLibUuid.cmake → cmake/Findlibuuid.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#.rst:
# Finduuid
# Findlibuuid
# -----------
#
# Find libuuid, DCE compatible Universally Unique Identifier library.
Expand Down Expand Up @@ -52,5 +52,5 @@ unset(CMAKE_REQUIRED_INCLUDES)
unset(_uuid_header_only)
unset(_have_libuuid)

find_package_handle_standard_args(uuid DEFAULT_MSG UUID_INCLUDE_DIR)
find_package_handle_standard_args(libuuid DEFAULT_MSG UUID_INCLUDE_DIR)
mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY)
File renamed without changes.
6 changes: 4 additions & 2 deletions cmake/XRootDDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ if( "${CMAKE_BUILD_TYPE}" STREQUAL "" )
endif()
endif()

include( CMakeDependentOption )

define_default( PLUGIN_VERSION 5 )
option( ENABLE_FUSE "Enable the fuse filesystem driver if possible." TRUE )
option( ENABLE_CRYPTO "Enable the OpenSSL cryprography support." TRUE )
Expand All @@ -28,7 +30,7 @@ option( ENABLE_XRDEC "Enable erasure coding component."
option( ENABLE_ASAN "Enable adress sanitizer." FALSE )
option( ENABLE_TSAN "Enable thread sanitizer." FALSE )
option( ENABLE_XRDCLHTTP "Enable xrdcl-http plugin." TRUE )
option( ENABLE_SCITOKENS "Enable SciTokens plugin." TRUE )
option( ENABLE_MACAROONS "Enable Macaroons plugin." TRUE )
cmake_dependent_option( ENABLE_SCITOKENS "Enable SciTokens plugin." TRUE "NOT XRDCL_ONLY" FALSE )
cmake_dependent_option( ENABLE_MACAROONS "Enable Macaroons plugin." TRUE "NOT XRDCL_ONLY" FALSE )
option( FORCE_ENABLED "Fail build if enabled components cannot be built." FALSE )
define_default( XRD_PYTHON_REQ_VERSION 3 )
13 changes: 7 additions & 6 deletions cmake/XRootDFindLibs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#-------------------------------------------------------------------------------
find_package( ZLIB REQUIRED)

find_package( LibUuid REQUIRED )
find_package( libuuid REQUIRED )

if( ENABLE_READLINE )
if( FORCE_ENABLED )
Expand All @@ -30,7 +30,7 @@ if( LIBXML2_FOUND )
add_definitions( -DHAVE_XML2 )
endif()

find_package( Systemd )
find_package( systemd )
if( SYSTEMD_FOUND )
add_definitions( -DHAVE_SYSTEMD )
endif()
Expand All @@ -39,11 +39,12 @@ find_package( CURL )

if( ENABLE_CRYPTO )
if( FORCE_ENABLED )
find_package( OpenSSL REQUIRED )
find_package( OpenSSL 1.0.2 REQUIRED )
amadio marked this conversation as resolved.
Show resolved Hide resolved
else()
find_package( OpenSSL )
find_package( OpenSSL 1.0.2 )
endif()
if( OPENSSL_FOUND )
add_definitions( -DHAVE_DH_PADDED )
amadio marked this conversation as resolved.
Show resolved Hide resolved
add_definitions( -DHAVE_XRDCRYPTO )
add_definitions( -DHAVE_SSL )
set( BUILD_CRYPTO TRUE )
Expand Down Expand Up @@ -82,9 +83,9 @@ endif()

if( ENABLE_TESTS )
if( FORCE_ENABLED )
find_package( CPPUnit REQUIRED )
find_package( CppUnit REQUIRED )
else()
find_package( CPPUnit )
find_package( CppUnit )
endif()
if( CPPUNIT_FOUND )
set( BUILD_TESTS TRUE )
Expand Down
8 changes: 4 additions & 4 deletions genversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ EXP3='^v[0-9]+\.[0-9]+\.[0-9]+\-rc.*$'
function getNumericVersion()
{
VERSION=$1
if test x`echo $VERSION | egrep $EXP2` == x; then
if test x`echo $VERSION | grep -E $EXP2` == x; then
echo "1000000";
return;
fi
Expand All @@ -37,16 +37,16 @@ function getVersionFromRefs()
VERSION="unknown"

for i in ${REFS[@]}; do
if test x`echo $i | egrep $EXP2` != x; then
if test x`echo $i | grep -E $EXP2` != x; then
echo "$i"
return 0
fi

if test x`echo $i | egrep $EXP1` != x; then
if test x`echo $i | grep -E $EXP1` != x; then
VERSION="$i"
fi

if test x`echo $i | egrep $EXP3` != x; then
if test x`echo $i | grep -E $EXP3` != x; then
VERSION="$i"
fi

Expand Down
6 changes: 3 additions & 3 deletions packaging/makesrpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,15 @@ fi
# Deal with release candidates
#-------------------------------------------------------------------------------
RELEASE=1
if test x`echo $VERSION | egrep $RCEXP` != x; then
if test x`echo $VERSION | grep -E $RCEXP` != x; then
RELEASE=0.`echo $VERSION | sed 's/.*-rc/rc/'`
VERSION=`echo $VERSION | sed 's/-rc.*//'`
fi

#-------------------------------------------------------------------------------
# Deal with CERN releases
#-------------------------------------------------------------------------------
if test x`echo $VERSION | egrep $CERNEXP` != x; then
if test x`echo $VERSION | grep -E $CERNEXP` != x; then
RELEASE=`echo $VERSION | sed 's/.*-//'`
VERSION=`echo $VERSION | sed 's/-.*\.CERN//'`
fi
Expand Down Expand Up @@ -281,7 +281,7 @@ gzip -9fn $RPMSOURCES/xrootd.tar
# Check if we need some other versions
#-------------------------------------------------------------------------------
OTHER_VERSIONS=`cat $TEMPDIR/xrootd.spec | \
egrep '^Source[0-9]+:[[:space:]]*xrootd-.*.gz$' |\
grep -E '^Source[0-9]+:[[:space:]]*xrootd-.*.gz$' |\
awk '{ print $2; }'`

for VER in $OTHER_VERSIONS; do
Expand Down
3 changes: 2 additions & 1 deletion src/XrdTls/XrdTlsContext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <openssl/crypto.h>
#include <openssl/err.h>
#include <openssl/ssl.h>
#include <openssl/opensslv.h>
#include <sys/stat.h>

#include "XrdOuc/XrdOucUtils.hh"
Expand Down Expand Up @@ -429,7 +430,7 @@ void Fatal(std::string *eMsg, const char *msg, bool sslmsg=false)

const char *GetTlsMethod(const SSL_METHOD *&meth)
{
#ifdef HAVE_TLS
#if OPENSSL_VERSION_NUMBER > 0x1010000fL /* v1.1.0 */
meth = TLS_method();
#else
meth = SSLv23_method();
Expand Down