serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1834663 - in /serf/trunk: CMakeLists.txt build/APRCommon.cmake build/FindAPR.cmake build/FindAPRUtil.cmake
Date Fri, 29 Jun 2018 10:14:32 GMT
Author: brane
Date: Fri Jun 29 10:14:32 2018
New Revision: 1834663

URL: http://svn.apache.org/viewvc?rev=1834663&view=rev
Log:
Find (optional) Expat library for linking with static APR-Util.

* CMakeLists.txt: Add option EXPAT.
* build/APRCommon.cmake (_apru_version): Also return the minor version.
* build/FindAPR.cmake: Adjust call to _apru_version.
* build/FindAPRUtil.cmake: Try to find the Expat library appropriate to
   the discovered version of APR-Util.

Modified:
    serf/trunk/CMakeLists.txt
    serf/trunk/build/APRCommon.cmake
    serf/trunk/build/FindAPR.cmake
    serf/trunk/build/FindAPRUtil.cmake

Modified: serf/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/serf/trunk/CMakeLists.txt?rev=1834663&r1=1834662&r2=1834663&view=diff
==============================================================================
--- serf/trunk/CMakeLists.txt (original)
+++ serf/trunk/CMakeLists.txt Fri Jun 29 10:14:32 2018
@@ -43,6 +43,7 @@ option(BROTLI "Path to Brotli's install
 option(DEBUG "Enable debugging info and strict compile warnings" OFF)
 option(DISABLE_LOGGING "Disable the logging framework at compile time" OFF)
 option(ENABLE_SLOW_TESTS "Enable long-running unit tests" OFF)
+option(EXPAT "Windows: optional path to Expat's install area for APR_STATIC" OFF)
 option(APR_STATIC "Windows: Link with static APR/-Util libraries" OFF)
 option(OPENSSL_STATIC "Windows: Link with static OpenSSL libraries" OFF)
 
@@ -143,6 +144,10 @@ if(BROTLI)
   message(WARNING "option BROTLI is not implemented yet")
 endif()
 
+if(EXPAT)
+  set(PC_EXPAT_INCLUDE_DIRS "${EXPAT}/include")
+  set(PC_EXPAT_LIBRARY_DIRS "${EXPAT}/lib")
+endif()
 
 # Find dependencies
 find_package(OpenSSL)

Modified: serf/trunk/build/APRCommon.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/APRCommon.cmake?rev=1834663&r1=1834662&r2=1834663&view=diff
==============================================================================
--- serf/trunk/build/APRCommon.cmake (original)
+++ serf/trunk/build/APRCommon.cmake Fri Jun 29 10:14:32 2018
@@ -47,7 +47,7 @@ function(_apru_config _program _varname
   endif()
 endfunction(_apru_config)
 
-function(_apru_version _version_varname _major_varname _header _prefix)
+function(_apru_version _version_varname _major_varname _minor_varname _header _prefix)
   file(STRINGS ${_header} _apru_major
        REGEX "^ *# *define +${_prefix}_MAJOR_VERSION +[0-9]+.*$")
   file(STRINGS ${_header} _apru_minor
@@ -59,6 +59,7 @@ function(_apru_version _version_varname
   string(REGEX REPLACE "^[^0-9]+([0-9]+).*$" "\\1" _apru_patch ${_apru_patch})
   set(${_version_varname} "${_apru_major}.${_apru_minor}.${_apru_patch}" PARENT_SCOPE)
   set(${_major_varname} ${_apru_major} PARENT_SCOPE)
+  set(${_minor_varname} ${_apru_minor} PARENT_SCOPE)
 endfunction(_apru_version)
 
 function(_apru_find_dll _varname _dllname)

Modified: serf/trunk/build/FindAPR.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPR.cmake?rev=1834663&r1=1834662&r2=1834663&view=diff
==============================================================================
--- serf/trunk/build/FindAPR.cmake (original)
+++ serf/trunk/build/FindAPR.cmake Fri Jun 29 10:14:32 2018
@@ -48,7 +48,7 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Windows
     message(FATAL_ERROR "apr_version.h was not found in ${APR_INCLUDES}")
   endif()
 
-  _apru_version(APR_VERSION _apr_major "${APR_INCLUDES}/apr_version.h" "APR")
+  _apru_version(APR_VERSION _apr_major _apr_minor "${APR_INCLUDES}/apr_version.h" "APR")
   set(_apr_name "apr-${_apr_major}")
 
   find_library(APR_LIBRARIES NAMES "lib${_apr_name}.lib"

Modified: serf/trunk/build/FindAPRUtil.cmake
URL: http://svn.apache.org/viewvc/serf/trunk/build/FindAPRUtil.cmake?rev=1834663&r1=1834662&r2=1834663&view=diff
==============================================================================
--- serf/trunk/build/FindAPRUtil.cmake (original)
+++ serf/trunk/build/FindAPRUtil.cmake Fri Jun 29 10:14:32 2018
@@ -62,15 +62,36 @@ else(APR_CONTAINS_APRUTIL)
       message(FATAL_ERROR "apu_version.h was not found in ${APRUTIL_INCLUDES}")
     endif()
 
-    _apru_version(APRUTIL_VERSION _apu_major "${APRUTIL_INCLUDES}/apu_version.h" "APU")
+    _apru_version(APRUTIL_VERSION _apu_major _apu_minor "${APRUTIL_INCLUDES}/apu_version.h"
"APU")
     set(_apu_name "aprutil-${_apu_major}")
+    
+    if(${_apu_major} GREATER 1 OR (${_apu_major} EQUAL 1 AND ${_apu_minor} GREATER 5))
+      set(_apu_expat_name "expat.lib")
+    else()
+      set(_apu_expat_name "xml.lib")
+    endif()
 
     find_library(APRUTIL_LIBRARIES NAMES "lib${_apu_name}.lib"
                  PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
-    find_library(APRUTIL_STATIC_LIBS NAMES "${_apu_name}.lib"
+    find_library(_apu_static NAMES "${_apu_name}.lib"
+                 PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
+    find_library(_apu_expat NAMES ${_apu_expat_name}
                  PATHS ${APRUTIL_ROOT} NO_DEFAULT_PATH PATH_SUFFIXES "lib")
     _apru_find_dll(APRUTIL_RUNTIME_LIBS "lib${_apu_name}.dll" ${APRUTIL_ROOT})
 
+    if(NOT _apu_expat AND (_apu_expat_name MATCHES "expat"))
+      find_package(EXPAT QUIET)
+      if(EXPAT_FOUND)
+        set(_apu_expat ${EXPAT_LIBRARIES})
+      endif()
+    endif()
+    if(NOT _apu_expat)
+      message(WARNING "Could not find ${_apu_expat_name}"
+                      " for APR-Util static linking.")
+    endif()
+    set(APRUTIL_STATIC_LIBS ${_apu_static} ${_apu_expat}
+        CACHE STRING "APR-Util static libraies.")
+
   else()    # NOT Windows
 
     if(DEFINED APRUTIL_ROOT)



Mime
View raw message