Author: brane
Date: Tue Jul  1 02:23:37 2025
New Revision: 1926884

URL: http://svn.apache.org/viewvc?rev=1926884&view=rev
Log:
On the user-defined-authn branch: sync with trunk r1926882.

Added:
    serf/branches/user-defined-authn/test/MockHTTPinC/CMakeLists.txt
      - copied unchanged from r1926883, 
serf/trunk/test/MockHTTPinC/CMakeLists.txt
Modified:
    serf/branches/user-defined-authn/   (props changed)
    serf/branches/user-defined-authn/CMakeLists.txt
    serf/branches/user-defined-authn/README
    serf/branches/user-defined-authn/SConstruct
    serf/branches/user-defined-authn/build/SerfChecks.cmake
    serf/branches/user-defined-authn/build/exports.py
    serf/branches/user-defined-authn/test/CMakeLists.txt

Propchange: serf/branches/user-defined-authn/
------------------------------------------------------------------------------
  Merged /serf/trunk:r1926735-1926883

Modified: serf/branches/user-defined-authn/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/CMakeLists.txt?rev=1926884&r1=1926883&r2=1926884&view=diff
==============================================================================
--- serf/branches/user-defined-authn/CMakeLists.txt (original)
+++ serf/branches/user-defined-authn/CMakeLists.txt Tue Jul  1 02:23:37 2025
@@ -224,7 +224,7 @@ if(SERF_WINDOWS)
       "secur32.lib"
       "ws2_32.lib"
   )
-  add_compile_definitions("SERF_HAVE_SSPI")
+  list(APPEND SERF_C_DEFINES "SERF_HAVE_SSPI")
 endif()
 
 # Process build options for dependency search
@@ -243,6 +243,12 @@ find_package(ZLIB REQUIRED)
 find_package(APR REQUIRED)
 find_package(APRUtil REQUIRED)
 
+# We do not want or need OpenSSL's compatibility macros.
+list(APPEND SERF_C_DEFINES "OPENSSL_NO_DEPRECATED")
+
+# Hide OpenSSL's _fp() API.
+list(APPEND SERF_C_DEFINES "OPENSSL_NO_STDIO")
+
 # Find optional dependencies
 find_package(Brotli)
 if(NOT SERF_WINDOWS)
@@ -261,7 +267,7 @@ if(Brotli_FOUND)
   list(APPEND SERF_PRIVATE_TARGETS Brotli::Decode)
 endif()
 if(GSSAPI_FOUND)
-  add_compile_definitions("SERF_HAVE_GSSAPI")
+  list(APPEND SERF_C_DEFINES "SERF_HAVE_GSSAPI")
   list(APPEND SERF_PRIVATE_TARGETS KRB5::GSSAPI)
 endif()
 
@@ -321,8 +327,7 @@ CheckType("OSSL_HANDSHAKE_STATE" "openss
 if(Brotli_FOUND)
   CheckType("BrotliDecoderResult" "brotli/decode.h" 
"SERF_HAVE_BROTLI_DECODER_RESULT" ${BROTLI_INCLUDES})
   # Check for the function only if the type check succeeded.
-  get_directory_property(_cdef COMPILE_DEFINITIONS)
-  if("SERF_HAVE_BROTLI_DECODER_RESULT" IN_LIST _cdef)
+  if("SERF_HAVE_BROTLI_DECODER_RESULT" IN_LIST SERF_C_DEFINES)
     CheckFunction("BrotliDecoderTakeOutput" "NULL, NULL" "SERF_HAVE_BROTLI"
                   "brotli/decode.h" ${BROTLI_INCLUDES}
                   Brotli::Decode ${SERF_STANDARD_LIBRARIES})
@@ -335,59 +340,59 @@ endif()
 
 # Process other build options
 if(DEBUG)
-  add_compile_definitions("DEBUG" "_DEBUG")
+  list(APPEND SERF_C_DEFINES "DEBUG" "_DEBUG")
 endif()
 
 if(DISABLE_LOGGING)
-  add_compile_definitions("SERF_DISABLE_LOGGING")
+  list(APPEND SERF_C_DEFINES "SERF_DISABLE_LOGGING")
 endif()
 
 if(ENABLE_SLOW_TESTS)
-  add_compile_definitions("SERF_TEST_DEFLATE_4GBPLUS_BUCKETS")
+  list(APPEND SERF_C_DEFINES "SERF_TEST_DEFLATE_4GBPLUS_BUCKETS")
 endif()
 
-# Define OPENSSL_NO_STDIO to prevent using _fp() API.
-add_compile_definitions("OPENSSL_NO_STDIO")
-
 # Set common compiler flags
+set(CMAKE_C_STANDARD 90)        # Use C90. MockHTTP overrides this.
+set(CMAKE_C_EXTENSIONS OFF)
+set(CMAKE_C_STANDARD_REQUIRED TRUE)
+
 if(NOT MSVC)
   if(CC_LIKE_GNUC)
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wdeclaration-after-statement")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-prototypes")
-    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89")
+    list(APPEND SERF_C_WARNINGS "-Wall")
+    list(APPEND SERF_C_WARNINGS "-Wdeclaration-after-statement")
+    list(APPEND SERF_C_WARNINGS "-Wmissing-prototypes")
 
-    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")
+    string(APPEND CMAKE_C_FLAGS_DEBUG " -O0")
 
     if(SERF_MAINTAINER_MODE)
       # Additional warning flags for more pedantic checks
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wimplicit-function-declaration")
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wmissing-variable-declarations")
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wunreachable-code")
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wshorten-64-to-32")
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-system-headers")
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra-tokens")
-      set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wnewline-eof")
+      list(APPEND SERF_C_WARNINGS "-Wimplicit-function-declaration")
+      list(APPEND SERF_C_WARNINGS "-Wmissing-variable-declarations")
+      list(APPEND SERF_C_WARNINGS "-Wunreachable-code")
+      list(APPEND SERF_C_WARNINGS "-Wshorten-64-to-32")
+      list(APPEND SERF_C_WARNINGS "-Wno-system-headers")
+      list(APPEND SERF_C_WARNINGS "-Wextra-tokens")
+      list(APPEND SERF_C_WARNINGS "-Wnewline-eof")
     endif()
   endif()
 else()
   # Warning level 4, no unused argument warnings
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4100")
+  list(APPEND SERF_C_WARNINGS "/W4" "/wd4100")
   # Conditional expression is constant
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4127")
+  list(APPEND SERF_C_WARNINGS "/wd4127")
   # Assignment within conditional expression
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4706")
+  list(APPEND SERF_C_WARNINGS "/wd4706")
   # 'function' undefined; assuming extern returning int
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4013")
+  list(APPEND SERF_C_WARNINGS "/we4013")
 
-  add_compile_definitions(
+  list(APPEND SERF_C_DEFINES
     "WIN32" "WIN32_LEAN_AND_MEAN"
     "NOUSER" "NOGDI" "NONLS" "NOCRYPT"
     "_CRT_SECURE_NO_WARNINGS"
     "_CRT_NONSTDC_NO_WARNINGS"
   )
   if(SERF_WIN64)
-    add_compile_definitions("WIN64")
+    list(APPEND SERF_C_DEFINES "WIN64")
   endif()
 
   set(CMAKE_IMPORT_LIBRARY_PREFIX "${SERF_INSTALL_LIBRARIES}")
@@ -397,7 +402,10 @@ endif(NOT MSVC)
 # Define all targets
 if(NOT SKIP_SHARED)
   add_library(serf_shared SHARED ${SOURCES} ${SHARED_SOURCES})
-  target_compile_options(serf_shared PUBLIC ${APR_CFLAGS})
+  target_compile_options(serf_shared
+                         PUBLIC ${APR_CFLAGS}
+                         PRIVATE ${SERF_C_WARNINGS})
+  target_compile_definitions(serf_shared PRIVATE ${SERF_C_DEFINES})
   target_include_directories(serf_shared PUBLIC ${SERF_SOURCE_DIR})
   target_link_libraries(serf_shared
                         PRIVATE ${SERF_PRIVATE_TARGETS}
@@ -428,7 +436,10 @@ endif()
 
 if(NOT SKIP_STATIC)
   add_library(serf_static STATIC ${SOURCES})
-  target_compile_options(serf_static PUBLIC ${APR_CFLAGS})
+  target_compile_options(serf_static
+                         PUBLIC ${APR_CFLAGS}
+                         PRIVATE ${SERF_C_WARNINGS})
+  target_compile_definitions(serf_static PRIVATE ${SERF_C_DEFINES})
   target_include_directories(serf_static PUBLIC ${SERF_SOURCE_DIR})
   target_link_libraries(serf_static
                         ${SERF_PRIVATE_TARGETS}
@@ -492,6 +503,7 @@ if(NOT SKIP_TESTS)
     message(WARNING "The tests depend on the Serf static library")
     message(STATUS "Skipping tests; to silence this message, either remove")
     message(STATUS "the SKIP_STATIC option or add the SKIP_TESTS option.")
+    set(SKIP_TESTS TRUE)
   else()
     enable_testing()
     add_subdirectory(test)
@@ -521,14 +533,13 @@ if(DOT_CLANGD)
   set(_gen_dot_clangd ON)
 endif()
 
-get_directory_property(_cdef COMPILE_DEFINITIONS)
-if("SERF_HAVE_BROTLI" IN_LIST _cdef)
+if("SERF_HAVE_BROTLI" IN_LIST SERF_C_DEFINES)
   set(_have_brotli ON)
 endif()
-if("SERF_HAVE_GSSAPI" IN_LIST _cdef)
+if("SERF_HAVE_GSSAPI" IN_LIST SERF_C_DEFINES)
   set(_have_gssapi ON)
 endif()
-if("SERF_HAVE_SSPI" IN_LIST _cdef)
+if("SERF_HAVE_SSPI" IN_LIST SERF_C_DEFINES)
   set(_have_sspi ON)
 endif()
 
@@ -539,7 +550,7 @@ message(STATUS "    platform: ..........
 message(STATUS "    target: ................. : ${SERF_TARGET}")
 message(STATUS "    generator: .............. : ${CMAKE_GENERATOR}")
 message(STATUS "    build type .............. : ${CMAKE_BUILD_TYPE}")
-message(STATUS "    shared libraries .... ... : ${_build_shared}")
+message(STATUS "    shared libraries ........ : ${_build_shared}")
 message(STATUS "    static libraries ........ : ${_build_static}")
 message(STATUS "    tests ................... : ${_build_tests}")
 message(STATUS "    generate .clangd ........ : ${_gen_dot_clangd}")

Modified: serf/branches/user-defined-authn/README
URL: 
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/README?rev=1926884&r1=1926883&r2=1926884&view=diff
==============================================================================
--- serf/branches/user-defined-authn/README (original)
+++ serf/branches/user-defined-authn/README Tue Jul  1 02:23:37 2025
@@ -10,15 +10,20 @@ kept to a minimum to provide high perfor
   * Official Git Mirror: https://github.com/apache/serf/
   * Issues: https://issues.apache.org/jira/browse/SERF
   * Mail: dev@serf.apache.org
-  * People: Justin Erenkrantz, Greg Stein 
+  * People: Justin Erenkrantz, Greg Stein
 
 ----
 
 1. INSTALL
 
-1.1. SCons build system
+1.1 Build systems
 
-Apache Serf uses SCons 2.3 for its build system. If it is not installed
+Apache Serf can use either SCons or CMake. Both build systems should offer
+the same features.
+
+1.1.1 SCons build system
+
+You must use at least SCons version 2.3. If it is not installed
 on your system, then you can install it onto your system. If you do not
 have permissions, then you can download and install the "local"
 version into your home directory. When installed privately, simply
@@ -28,11 +33,14 @@ Fetch the scons-local package:
   http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz
 
 
-1.2 Building Apache Serf
+1.1.2 Building Apache Serf using SCons
 
 To build serf:
 
-$ scons APR=/path/to/apr APU=/path/to/apu OPENSSL=/openssl/base 
PREFIX=/path/to/prefix
+$ scons PREFIX=/path/to/prefix \
+        APR=/path/to/apr APU=/path/to/apr-util \
+        OPENSSL=/path/to/openssl ZLIB=/path/to/zlib \
+        BROTLI=/path/to/brotli GSSAPI=/path/to/kerberos
 
 The switches are recorded into .saved_config, so they only need to be
 specified the first time scons is run.
@@ -40,14 +48,31 @@ specified the first time scons is run.
 PREFIX should specify where serf should be installed.  PREFIX defaults to
 /usr/local.
 
-The default for the other three switches (APR, APU, OPENSSL) is /usr.
+The default for the mandatory dependencies (APR, APU, OPENSSL, ZLIB) is /usr.
 
 The build system looks for apr-1-config at $APR/bin/apr-1-config, or
 the path should indicate apr-1-config itself. Similarly for the path
-to apu-1-config.
+to apu-1-config in $APU or $APU/bin/apu-1-config.
+
+OPENSSL should specify the root of the install (e.g., /opt/local). The
+includes will be found $OPENSSL/include/openssl and libraries at $OPENSSL/lib.
+
+OPENSSL should specify the root of the install. The includes will be found
+$ZLIB/include and libraries at $ZLIB/lib.
+
+The BROTLI and GSSAPI dependencies are optional.
+
+BROTLI should be the path to the installation of the Brotli compression
+library; for example, BROTLI=/usr/local. The includes will be found
+in $BROTLI/include/brotli and the libraries in $BROTLI/lib.
+
+GSSAPI should be the path to the installation of a package that provides
+the GSSAPI implementation such as Kerberos5 or Heimdal. SCons will look
+for the configuration program $GSSAPI/bin/krb5-config.
+
+NOTE: Do not use the GSSAPI switch on Windows; it provides the SSPI API
+      which Serf uses by default on that platform.
 
-OPENSSL should specify the root of the install (eg. /opt/local). The
-includes will be found OPENSSL/include and libraries at OPENSSL/lib.
 
 If you wish to use VPATH-style builds (where objects are created in a
 distinct directory from the source), you can use:
@@ -65,12 +90,12 @@ At any point, the current settings can b
 $ scons --help
 
 
-1.3 Running the test suite
+1.1.3 Running the test suite
 
 $ scons check
 
 
-1.4 Installing Apache Serf
+1.1.4 Installing Apache Serf
 
 $ scons install
 
@@ -88,6 +113,121 @@ $ scons PREFIX=/usr/ LIBDIR=/usr/lib64
 $ scons install --install-sandbox=/path/to/buildroot
 
 
-1.4 Cleaning up the build
+1.1.5 Cleaning up the build
 
 $ scons -c
+
+
+1.2.1 CMake build system
+
+
+Get the sources, either a release tarball or by checking out the
+official repository. The CMake build system currently only exists in
+trunk and it will be included in the 1.4 release.
+
+The process for building on Unix and Windows is the same.
+
+    $ cmake -B out [build options]
+    $ cmake --build out
+
+or, with a multi-config generator:
+
+    $ cmake --build out --config Release
+
+"out" in the commands above is the build directory used by CMake.
+
+Build options can be added, for example:
+
+    $ cmake -B out -DCMAKE_INSTALL_PREFIX=/usr/local/serf -DSKIP_TESTS=ON
+
+Build options can be listed using:
+
+    $ cmake -LH
+
+By default, CMake will look for dependencies in ${CMAKE_SEARCH_PREFIX}, which
+you can override on the command line, e.g.::
+
+    $ cmake -DCMAKE_SEARCH_PREFIX=/opt
+
+The search for each the five dependencies can be modified by setting their
+*_ROOT CMake variables:
+
+    $ cmake -DAPR_ROOR=/path/to/apr \
+            -DAPRUtil_ROOT=/path/to/apr-util \
+            -DOPENSSL_ROOT_DIR=/path/to/openssl \
+            -DZLIB_ROOT=/path/to/zlib \
+            -DBrotli_ROOT=/path/to/brotli \
+            -DGSSAPI_ROOT=/path/to/kerberos5
+
+
+1.2.2 MacOS specifics
+
+The CMake build system can search for dependencies from Homebrew or
+MacPorts: use 'cmake -DUSE_HOMEBREW=ON' to search for Homebrew packages,
+or 'cmake -DUSE_MACPORTS=ON' to search installed MacPorts. Just not both.
+
+
+1.2.3 Windows tricks
+
+- Modern versions of Microsoft Visual Studio provide support for
+  CMake projects out-of-box, including intellisense, integrated
+  options editor, test explorer, and more.
+
+  In order to use it for Serf, open the source directory with
+  Visual Studio, and the configuration should start automatically.
+  For editing the cache (options), do right-click to the CMakeLists.txt
+  file and clicking `CMake Settings for Serf` will open the
+  editor. After the required settings are configured, hit `F7` in
+  order to build. For more info, check the article bellow:
+
+      
https://learn.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio
+
+- There is a useful tool for bootstrapping the dependencies,
+  vcpkg. It provides ports for the most of Serf's dependencies,
+  which then could be installed via a single command.
+
+  To start using it, download the registry from GitHub, bootstrap
+  vcpkg, and install the dependencies:
+
+      $ git clone https://github.com/microsoft/vcpkg
+      $ cd vcpkg && .\bootstrap-vcpkg.bat -disableMetrics
+      $ .\vcpkg install apr apr-util [any other dependency]
+
+  After this is done, vcpkg can be integrated into CMake by passing
+  the vcpkg toolchain to CMAKE_TOOLCHAIN_FILE option. In order to do
+  it with Visual Studio, open the CMake cache editor as explained in
+  the previous step, and put the following into `CMake toolchain
+  file` field, where VCPKG_ROOT is the path to vcpkg registry:
+
+      <VCPKG_ROOT>/scripts/buildsystems/vcpkg.cmake
+
+
+1.2.4 Running the test suite
+
+To run the test suite, go to the CMake output directory, then:
+
+    $ ctest
+
+or, with a multi-config generator:
+
+    $ ctest -C Release
+
+This is equivalent to
+
+    $ cmake --build out --target test
+
+or
+
+    $ cmake --build out --config Release --target test
+
+(or, on Windows using the Visual Studio generator, which always has to be
+ special and different for no discernible benefit:
+
+    $ cmake --build out --config Release --target run_tests
+)
+
+
+1.2.5 Installing Apache Serf
+
+    $ cmake --build out --target install
+    $ cmake --build out --config Release --target install

Modified: serf/branches/user-defined-authn/SConstruct
URL: 
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/SConstruct?rev=1926884&r1=1926883&r2=1926884&view=diff
==============================================================================
--- serf/branches/user-defined-authn/SConstruct (original)
+++ serf/branches/user-defined-authn/SConstruct Tue Jul  1 02:23:37 2025
@@ -226,6 +226,24 @@ env.Append(BUILDERS = {
 # Export symbol generator (for Windows DLL, Mach-O and ELF)
 export_generator = build.exports.ExportGenerator()
 if export_generator.target is None:
+  # Detect if the build target is an ELF platform the the
+  # generator doesn't know about.
+  sys.stdout.write("Checking if the build target is ELF ...")
+  conf = Configure(env)  # No custom tests, we want a clean environment.
+  if (conf.TryLink('int main(void) { return 0; }', '.c')):
+    header = conf.lastTarget.get_contents()[:4]
+    if header == b'\x7fELF':    # This is the ELF magic number.
+      print(" yes")
+      elf = build.exports.TARGET_ELF
+      export_generator = build.exports.ExportGenerator(elf)
+    else:
+      print(" no")
+  else:
+    print(" failed")
+  conf.Finish()
+
+# Now try again...
+if export_generator.target is None:
   # Nothing to do on this platform
   export_generator = None
 else:

Modified: serf/branches/user-defined-authn/build/SerfChecks.cmake
URL: 
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/build/SerfChecks.cmake?rev=1926884&r1=1926883&r2=1926884&view=diff
==============================================================================
--- serf/branches/user-defined-authn/build/SerfChecks.cmake (original)
+++ serf/branches/user-defined-authn/build/SerfChecks.cmake Tue Jul  1 02:23:37 
2025
@@ -21,7 +21,10 @@ include(CheckCSourceCompiles)
 include(CheckIncludeFile)
 include(CheckTypeSize)
 
+list(TRANSFORM SERF_C_DEFINES PREPEND "-D" OUTPUT_VARIABLE cdef_)
+
 function(_CheckFunction var_ name_ args_ header_ includes_ libraries_)
+  set(CMAKE_REQUIRED_DEFINITIONS ${cdef_})
   if(libraries_)
     set(CMAKE_REQUIRED_LIBRARIES "${libraries_}")
   else()
@@ -61,13 +64,14 @@ function(_CheckFunction var_ name_ args_
 
   unset(CMAKE_REQUIRED_INCLUDES)
   unset(CMAKE_REQUIRED_LIBRARIES)
+  unset(CMAKE_REQUIRED_DEFINITIONS)
 endfunction(_CheckFunction)
 
 macro(CheckFunction name_ args_ symbol_ header_ includes_)
   _CheckFunction("serf_feature_CheckFunction_${name_}_"
                  "${name_}" "${args_}" "${header_}" "${includes_}" "${ARGN}")
   if("${serf_feature_CheckFunction_${name_}_}")
-    add_compile_definitions("${symbol_}")
+    list(APPEND SERF_C_DEFINES "${symbol_}")
   endif()
 endmacro(CheckFunction)
 
@@ -75,12 +79,13 @@ macro(CheckNotFunction name_ args_ symbo
   _CheckFunction("serf_feature_CheckNotFunction_${name_}_"
                  "${name_}" "${args_}" "${header_}" "${includes_}" "${ARGN}")
   if(NOT "${serf_feature_CheckNotFunction_${name_}_}")
-    add_compile_definitions("${symbol_}")
+    list(APPEND SERF_C_DEFINES "${symbol_}")
   endif()
 endmacro(CheckNotFunction)
 
 
 function(_CheckHeader var_ name_ includes_)
+  set(CMAKE_REQUIRED_DEFINITIONS ${cdef_})
   if(includes_)
     set(CMAKE_REQUIRED_INCLUDES "${includes_}")
   else()
@@ -94,17 +99,19 @@ function(_CheckHeader var_ name_ include
     set("${var_}" FALSE PARENT_SCOPE)
   endif()
   unset(CMAKE_REQUIRED_INCLUDES)
+  unset(CMAKE_REQUIRED_DEFINITIONS)
 endfunction(_CheckHeader)
 
 macro(CheckHeader name_ symbol_)
   _CheckHeader("serf_feature_CheckHeader_${name_}_" "${name_}" "${ARGN}")
   if("${serf_feature_CheckHeader_${name_}_}")
-    add_compile_definitions("${symbol_}")
+    list(APPEND SERF_C_DEFINES "${symbol_}")
   endif()
 endmacro(CheckHeader)
 
 
 function(_CheckType var_ name_ header_ includes_)
+  set(CMAKE_REQUIRED_DEFINITIONS ${cdef_})
   if(includes_)
     set(CMAKE_REQUIRED_INCLUDES "${includes_}")
   else()
@@ -125,11 +132,12 @@ function(_CheckType var_ name_ header_ i
   endif()
   unset(CMAKE_REQUIRED_INCLUDES)
   unset(CMAKE_EXTRA_INCLUDE_FILES)
+  unset(CMAKE_REQUIRED_DEFINITIONS)
 endfunction(_CheckType)
 
 macro(CheckType name_ header_ symbol_)
   _CheckType("serf_feature_CheckType_${name_}_" "${name_}" "${header_}" 
"${ARGN}")
   if("${serf_feature_CheckType_${name_}_}")
-    add_compile_definitions("${symbol_}")
+    list(APPEND SERF_C_DEFINES "${symbol_}")
   endif()
 endmacro(CheckType)

Modified: serf/branches/user-defined-authn/build/exports.py
URL: 
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/build/exports.py?rev=1926884&r1=1926883&r2=1926884&view=diff
==============================================================================
--- serf/branches/user-defined-authn/build/exports.py (original)
+++ serf/branches/user-defined-authn/build/exports.py Tue Jul  1 02:23:37 2025
@@ -108,14 +108,15 @@ class ExportGenerator(object):
       return TARGET_WINDLL
     if sys.platform == 'darwin':
       return TARGET_MACHO
-    if sys.platform.startswith('linux'):
-      return TARGET_ELF
-    if (sys.platform.startswith('freebsd') and int(sys.platform[7:]) >= 4):
-      return TARGET_ELF
-    if (sys.platform.startswith('openbsd') and int(sys.platform[7:]) >= 6):
-      return TARGET_ELF
-    if (sys.platform.startswith('netbsd') and int(sys.platform[6:]) >= 2):
-      return TARGET_ELF
+    # FIXME: SConstruct checks for ELF, these should probably be removed.
+    # if sys.platform.startswith('linux'):
+    #   return TARGET_ELF
+    # if (sys.platform.startswith('freebsd') and int(sys.platform[7:]) >= 4):
+    #   return TARGET_ELF
+    # if (sys.platform.startswith('openbsd') and int(sys.platform[7:]) >= 6):
+    #   return TARGET_ELF
+    # if (sys.platform.startswith('netbsd') and int(sys.platform[6:]) >= 2):
+    #   return TARGET_ELF
     return None
 
   def _gen_win_def(self, stream, symbols):

Modified: serf/branches/user-defined-authn/test/CMakeLists.txt
URL: 
http://svn.apache.org/viewvc/serf/branches/user-defined-authn/test/CMakeLists.txt?rev=1926884&r1=1926883&r2=1926884&view=diff
==============================================================================
--- serf/branches/user-defined-authn/test/CMakeLists.txt (original)
+++ serf/branches/user-defined-authn/test/CMakeLists.txt Tue Jul  1 02:23:37 
2025
@@ -17,6 +17,7 @@
 #   under the License.
 # ===================================================================
 
+add_subdirectory(MockHTTPinC)
 
 set(TEST_ALL_SOURCES
     "test_all.c"
@@ -30,8 +31,6 @@ set(TEST_ALL_SOURCES
     "mock_buckets.c"
     "mock_sock_buckets.c"
     "test_ssl.c"
-    "MockHTTPinC/MockHTTP.c"
-    "MockHTTPinC/MockHTTP_server.c"
 )
 
 set(TEST_ALL_SUITES
@@ -52,22 +51,20 @@ set(SIMPLE_TEST_TARGETS
     "serf_bwtp"
 )
 
-if(CC_LIKE_GNUC)
-  # MockHTTP requires C99 standard, so use it for the test suite.
-  string(REPLACE "-std=c89" "-std=c99" CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
-endif()
-
 foreach(TEST_TARGET ${SIMPLE_TEST_TARGETS})
   add_executable(${TEST_TARGET} "${TEST_TARGET}.c")
   add_dependencies(${TEST_TARGET} serf_static)
+  target_compile_definitions(${TEST_TARGET} PRIVATE ${SERF_C_DEFINES})
+  target_compile_options(${TEST_TARGET} PRIVATE ${SERF_C_WARNINGS})
   target_link_libraries(${TEST_TARGET} serf_static)
 endforeach()
 
 add_executable(test_all ${TEST_ALL_SOURCES})
-add_dependencies(test_all serf_static)
-target_compile_definitions(test_all PRIVATE "-DMOCKHTTP_OPENSSL")
+add_dependencies(test_all serf_static mockhttpinc)
+target_compile_options(test_all PRIVATE ${SERF_C_WARNINGS})
+target_compile_definitions(test_all PRIVATE ${SERF_C_DEFINES})
 target_include_directories(test_all SYSTEM BEFORE PRIVATE 
${SERF_DEPENDENCY_INCLUDES})
-target_link_libraries(test_all serf_static)
+target_link_libraries(test_all serf_static mockhttpinc)
 
 file(GLOB RESPONSE_TEST_CASES 
"${CMAKE_CURRENT_SOURCE_DIR}/testcases/*.response")
 foreach(TEST_CASE ${RESPONSE_TEST_CASES})


Reply via email to