serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1834045 - in /serf/trunk: SConstruct test/test_ssl.c
Date Thu, 21 Jun 2018 19:00:56 GMT
Author: brane
Date: Thu Jun 21 19:00:56 2018
New Revision: 1834045

URL: http://svn.apache.org/viewvc?rev=1834045&view=rev
Log:
Enable tests with debug OpenSSL 1.1.x.

* SConstruct: Check for openssl/applink.c, which is not available with
   OpenSSL 1.1.x; building a debug OpenSSL is much simpler now anyway.
* tests/test_ssl.c: Only use openssl/applink.c if it exists.

Modified:
    serf/trunk/SConstruct
    serf/trunk/test/test_ssl.c

Modified: serf/trunk/SConstruct
URL: http://svn.apache.org/viewvc/serf/trunk/SConstruct?rev=1834045&r1=1834044&r2=1834045&view=diff
==============================================================================
--- serf/trunk/SConstruct (original)
+++ serf/trunk/SConstruct Thu Jun 21 19:00:56 2018
@@ -351,35 +351,35 @@ if sys.platform == 'win32':
     env.Append(CPPDEFINES=['WIN64'])
 
   # Get the APR-Util version number to check if we need an external Expat
-  use_expat = False
-  apuversion = os.path.join(apu, 'include', 'apu_version.h')
-  if os.path.isfile(apuversion):
-    apu_major = 0
-    apu_minor = 0
-    with open(apuversion, 'r') as vfd:
-      major_rx = re.compile(r'^\s*#\s*define\s+APU_MAJOR_VERSION\s+(\d+)')
-      minor_rx = re.compile(r'^\s*#\s*define\s+APU_MINOR_VERSION\s+(\d+)')
-      for line in vfd:
-        m = major_rx.match(line)
-        if m:
-          apu_major = int(m.group(1))
-          continue
-        m = minor_rx.match(line)
-        if m:
-          apu_minor = int(m.group(1))
-    print('Found APR-Util version %d.%d' % (apu_major, apu_minor))
-    if apu_major >= 2 or apu_major == 1 and apu_minor >= 6:
-      use_expat = True
-  else:
-    print("Warning: Missing header " + apuversion)
+  if expat:
+    expat_lib_name = 'expat.lib'
+  else:    
+    expat_lib_name = 'xml.lib'
+    apuversion = os.path.join(apu, 'include', 'apu_version.h')
+    if os.path.isfile(apuversion):
+      apu_major = 0
+      apu_minor = 0
+      with open(apuversion, 'r') as vfd:
+        major_rx = re.compile(r'^\s*#\s*define\s+APU_MAJOR_VERSION\s+(\d+)')
+        minor_rx = re.compile(r'^\s*#\s*define\s+APU_MINOR_VERSION\s+(\d+)')
+        for line in vfd:
+          m = major_rx.match(line)
+          if m:
+            apu_major = int(m.group(1))
+            continue
+          m = minor_rx.match(line)
+          if m:
+            apu_minor = int(m.group(1))
+      print('Found APR-Util version %d.%d' % (apu_major, apu_minor))
+      if apu_major >= 2 or apu_major == 1 and apu_minor >= 6:
+        expat_lib_name = 'expat.lib'
+    else:
+      print("Warning: Missing header " + apuversion)
 
   if aprstatic:
     apr_libs='apr-1.lib'
     apu_libs='aprutil-1.lib'
-    if use_expat or expat:
-      env.Append(LIBS=['expat.lib'])
-    else:
-      env.Append(LIBS=['shell32.lib', 'xml.lib'])
+    env.Append(LIBS=['shell32.lib', expat_lib_name])
   else:
     apr_libs='libapr-1.lib'
     apu_libs='libaprutil-1.lib'
@@ -498,6 +498,8 @@ else:
 # Check for OpenSSL functions which are only available in some of
 # the versions we support. Also handles forks like LibreSSL.
 conf = Configure(env)
+if conf.CheckCHeader('openssl/applink.c'):
+  env.Append(CPPDEFINES=['SERF_HAVE_OPENSSL_APPLINK_C'])
 if not conf.CheckFunc('BIO_set_init', '#include <openssl/crypto.h>'):
   env.Append(CPPDEFINES=['SERF_NO_SSL_BIO_WRAPPERS'])
 if not conf.CheckFunc('X509_STORE_get0_param', '#include <openssl/crypto.h>'):

Modified: serf/trunk/test/test_ssl.c
URL: http://svn.apache.org/viewvc/serf/trunk/test/test_ssl.c?rev=1834045&r1=1834044&r2=1834045&view=diff
==============================================================================
--- serf/trunk/test/test_ssl.c (original)
+++ serf/trunk/test/test_ssl.c Thu Jun 21 19:00:56 2018
@@ -35,9 +35,9 @@
 #include <openssl/ocsp.h>
 #endif
 
-#if defined(WIN32) && defined(_DEBUG)
+#if defined(WIN32) && defined(_DEBUG) && defined(SERF_HAVE_OPENSSL_APPLINK_C)
 /* Include this file to allow running a Debug build of serf with a Release
-   build of OpenSSL. */
+   build of OpenSSL. Note: his file is not available on OpenSSL 1.1.x. */
 #if defined(_MSC_VER) && _MSC_VER >= 1400
 #pragma warning(push)
 #pragma warning(disable: 4152)



Mime
View raw message