Author: rinrab
Date: Tue Jun 2 21:51:42 2026
New Revision: 1934907
Log:
Support SASL with the cmake build.
* CMakeLists.txt
(SVN_ENABLE_SASL): Declare option.
(#sasl): Handle dependency; Support both module and pkg-config modes.
(#configsummary): Dump information about if SASL is enabled.
* build/cmake/FindSASL.cmake: New module to look for the library.
* build/generator/gen_cmake.py
(write): Remove sasl from the list of dependencies to ignore.
Added:
subversion/trunk/build/cmake/FindSASL.cmake
Modified:
subversion/trunk/CMakeLists.txt
subversion/trunk/build/generator/gen_cmake.py
Modified: subversion/trunk/CMakeLists.txt
==============================================================================
--- subversion/trunk/CMakeLists.txt Tue Jun 2 20:39:02 2026
(r1934906)
+++ subversion/trunk/CMakeLists.txt Tue Jun 2 21:51:42 2026
(r1934907)
@@ -91,6 +91,7 @@ option(SVN_ENABLE_NLS "Enable gettext fu
option(SVN_ENABLE_TUI "Enable TUI applications (requires ncurses)" OFF)
option(SVN_ENABLE_AUTH_KWALLET "Enable KWallet auth library" OFF)
option(SVN_ENABLE_AUTH_GNOME_KEYRING "Enable GNOME Keyring for auth
credentials" OFF)
+option(SVN_ENABLE_SASL "Enable Cyrus SASL v2" OFF)
cmake_dependent_option(SVN_ENABLE_AUTH_GPG_AGENT "Enable GPG Agent support"
OFF "WIN32" ON)
option(SVN_INSTALL_PRIVATE_H "Install private header files." OFF)
@@ -728,6 +729,24 @@ if (SVN_ENABLE_TUI)
endif()
endif()
+if (SVN_ENABLE_SASL)
+ add_library(external-sasl INTERFACE)
+
+ if(SVN_USE_PKG_CONFIG)
+ pkg_check_modules(libsasl2 REQUIRED IMPORTED_TARGET libsasl2>=2.0.0)
+ target_link_libraries(external-sasl INTERFACE PkgConfig::libsasl2)
+ set(SVN_SASL_LIBS ${libsasl2_LDFLAGS})
+ else()
+ find_package(SASL 2.0.0 REQUIRED)
+ target_link_libraries(external-sasl INTERFACE SASL::SASL)
+ endif()
+
+ add_private_config_definition(
+ "Defined if Cyrus SASL v2 is present on the system"
+ "SVN_HAVE_SASL" "1"
+ )
+endif()
+
if(SVN_ENABLE_SWIG_PERL OR SVN_ENABLE_SWIG_PYTHON OR SVN_ENABLE_SWIG_RUBY)
file(MAKE_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}/subversion/bindings/swig/proxy")
@@ -1095,6 +1114,7 @@ message(STATUS " Auth providers:")
message(STATUS " Enable KWallet integration .... :
${SVN_ENABLE_AUTH_KWALLET}")
message(STATUS " Enable Gnome Keyring .......... :
${SVN_ENABLE_AUTH_GNOME_KEYRING}")
message(STATUS " Enable GPG Agent support ...... :
${SVN_ENABLE_AUTH_GPG_AGENT}")
+message(STATUS " Enable Cyrus SASL v2 .......... : ${SVN_ENABLE_SASL}")
message(STATUS " Optional modules and targets:")
message(STATUS " Build Apache Modules .......... :
${SVN_ENABLE_APACHE_MODULES}")
message(STATUS " Build programs ................ : ${SVN_ENABLE_PROGRAMS}")
Added: subversion/trunk/build/cmake/FindSASL.cmake
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ subversion/trunk/build/cmake/FindSASL.cmake Tue Jun 2 21:51:42 2026
(r1934907)
@@ -0,0 +1,73 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# FindSASL.cmake -- Find the SASL library
+#
+
+find_path(SASL_INCLUDE_DIR
+ NAMES sasl.h
+ PATH_SUFFIXES
+ include
+ include/sasl
+)
+
+find_library(SASL_LIBRARY
+ NAMES sasl2
+ PATH_SUFFIXES lib
+)
+
+mark_as_advanced(
+ SASL_INCLUDE_DIR
+ SASL_LIBRARY
+)
+
+if (SASL_INCLUDE_DIR AND EXISTS ${SASL_INCLUDE_DIR}/sasl.h)
+ file(
+ STRINGS "${SASL_INCLUDE_DIR}/sasl.h" VERSION_STRINGS
+ REGEX "#define (SASL_VERSION_MAJOR|SASL_VERSION_MINOR|SASL_VERSION_STEP)"
+ )
+
+ string(REGEX REPLACE ".*SASL_VERSION_MAJOR +([0-9]+).*" "\\1"
SASL_VERSION_MAJOR ${VERSION_STRINGS})
+ string(REGEX REPLACE ".*SASL_VERSION_MINOR +([0-9]+).*" "\\1"
SASL_VERSION_MINOR ${VERSION_STRINGS})
+ string(REGEX REPLACE ".*SASL_VERSION_STEP +([0-9]+).*" "\\1"
SASL_VERSION_STEP ${VERSION_STRINGS})
+else()
+ # Default version to 1.0.0 if not found.
+ set(SASL_VERSION_MAJOR 1)
+ set(SASL_VERSION_MINOR 0)
+ set(SASL_VERSION_STEP 0)
+endif()
+
+set(SASL_VERSION
"${SASL_VERSION_MAJOR}.${SASL_VERSION_MINOR}.${SASL_VERSION_STEP}")
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(
+ SASL
+ REQUIRED_VARS
+ SASL_LIBRARY
+ SASL_INCLUDE_DIR
+ VERSION_VAR
+ SASL_VERSION
+)
+
+if (SASL_FOUND)
+ add_library(SASL::SASL IMPORTED STATIC)
+ set_target_properties(SASL::SASL PROPERTIES
+ IMPORTED_LOCATION ${SASL_LIBRARY}
+ INTERFACE_INCLUDE_DIRECTORIES ${SASL_INCLUDE_DIR}
+ )
+endif()
Modified: subversion/trunk/build/generator/gen_cmake.py
==============================================================================
--- subversion/trunk/build/generator/gen_cmake.py Tue Jun 2 20:39:02
2026 (r1934906)
+++ subversion/trunk/build/generator/gen_cmake.py Tue Jun 2 21:51:42
2026 (r1934907)
@@ -169,8 +169,7 @@ class Generator(gen_base.GeneratorBase):
"apr_memcache",
"magic",
"macos-plist",
- "macos-keychain",
- "sasl"]:
+ "macos-keychain"]:
# These dependencies are currently ignored
# TODO:
pass