subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1449422 - /subversion/trunk/build/generator/gen_win.py
Date Sat, 23 Feb 2013 22:50:42 GMT
Author: rhuijben
Date: Sat Feb 23 22:50:41 2013
New Revision: 1449422

URL: http://svn.apache.org/r1449422
Log:
On Windows, use similar version checks for serf, apr, aprutil and sqlite
instead of many slightly different checks.

Also print the version numbers found to allow easy access on the buildbot.

Note that this bumps required versions of several dependencies to what
they already are on the unix builds.

* build/generator/gen_win.py
  (_find_serf): Require serf 1.2.0 or later
  (_find_apr): Require apr 0.9.0 or later
  (_find_apr_util): Require aprutil 0.9.0 or later
  (_find_sqlite): Require sqlite 3.7.12 or later.
  (_find_zlib): Print version in the same format.

Modified:
    subversion/trunk/build/generator/gen_win.py

Modified: subversion/trunk/build/generator/gen_win.py
URL: http://svn.apache.org/viewvc/subversion/trunk/build/generator/gen_win.py?rev=1449422&r1=1449421&r2=1449422&view=diff
==============================================================================
--- subversion/trunk/build/generator/gen_win.py (original)
+++ subversion/trunk/build/generator/gen_win.py Sat Feb 23 22:50:41 2013
@@ -1433,7 +1433,7 @@ class WinGeneratorBase(GeneratorBase):
   def _find_serf(self):
     "Check if serf and its dependencies are available"
 
-    minimal_serf_version = (0, 3, 0)
+    minimal_serf_version = (1, 2, 0)
     self.serf_lib = None
     if self.serf_path and os.path.exists(self.serf_path):
       if self.openssl_path and os.path.exists(self.openssl_path):
@@ -1441,7 +1441,7 @@ class WinGeneratorBase(GeneratorBase):
         version = self._get_serf_version()
         if None in version:
           msg = 'Unknown serf version found; but, will try to build ' \
-                'ra_serf.\n'
+                'ra_serf.'
         else:
           self.serf_ver = '.'.join(str(v) for v in version)
           if version < minimal_serf_version:
@@ -1449,7 +1449,7 @@ class WinGeneratorBase(GeneratorBase):
             msg = 'Found serf %s, but >= %s is required. ra_serf will not be built.\n'
% \
                   (self.serf_ver, '.'.join(str(v) for v in minimal_serf_version))
           else:
-            msg = 'Found serf version %s\n' % self.serf_ver
+            msg = 'Found serf %s' % self.serf_ver
         print(msg)
       else:
         print('openssl not found, ra_serf will not be built\n')
@@ -1458,6 +1458,8 @@ class WinGeneratorBase(GeneratorBase):
 
   def _find_apr(self):
     "Find the APR library and version"
+    
+    minimal_apr_version = (0, 9, 0)
 
     version_file_path = os.path.join(self.apr_path, 'include',
                                      'apr_version.h')
@@ -1470,22 +1472,41 @@ class WinGeneratorBase(GeneratorBase):
     fp = open(version_file_path)
     txt = fp.read()
     fp.close()
+    
     vermatch = re.search(r'^\s*#define\s+APR_MAJOR_VERSION\s+(\d+)', txt, re.M)
-
-    major_ver = int(vermatch.group(1))
+    major = int(vermatch.group(1))
+    
+    vermatch = re.search(r'^\s*#define\s+APR_MINOR_VERSION\s+(\d+)', txt, re.M)
+    minor = int(vermatch.group(1))
+    
+    vermatch = re.search(r'^\s*#define\s+APR_PATCH_VERSION\s+(\d+)', txt, re.M)
+    patch = int(vermatch.group(1))
+    
+    version = (major, minor, patch)
+    self.apr_version = '%d.%d.%d' % version
 
     suffix = ''
-    if major_ver > 0:
-        suffix = '-%d' % major_ver
+    if major > 0:
+        suffix = '-%d' % major
 
     if self.static_apr:
       self.apr_lib = 'apr%s.lib' % suffix
     else:
       self.apr_lib = 'libapr%s.lib' % suffix
+      
+    if version < minimal_apr_version:
+      sys.stderr.write("ERROR: apr %s or higher is required "
+                       "(%s found)\n" % (
+                          '.'.join(str(v) for v in minimal_apr_version),
+                          self.apr_version))
+      sys.exit(1)
+    else:
+      print('Found apr %s' % self.apr_version)
 
   def _find_apr_util(self):
     "Find the APR-util library and version"
 
+    minimal_aprutil_version = (0, 9, 0)
     version_file_path = os.path.join(self.apr_util_path, 'include',
                                      'apu_version.h')
 
@@ -1497,22 +1518,42 @@ class WinGeneratorBase(GeneratorBase):
     fp = open(version_file_path)
     txt = fp.read()
     fp.close()
+    
     vermatch = re.search(r'^\s*#define\s+APU_MAJOR_VERSION\s+(\d+)', txt, re.M)
-
-    major_ver = int(vermatch.group(1))
+    major = int(vermatch.group(1))
+    
+    vermatch = re.search(r'^\s*#define\s+APU_MINOR_VERSION\s+(\d+)', txt, re.M)
+    minor = int(vermatch.group(1))
+    
+    vermatch = re.search(r'^\s*#define\s+APU_PATCH_VERSION\s+(\d+)', txt, re.M)
+    patch = int(vermatch.group(1))
+   
+    version = (major, minor, patch)
+    self.aprutil_version = '%d.%d.%d' % version
 
     suffix = ''
-    if major_ver > 0:
-        suffix = '-%d' % major_ver
+    if major > 0:
+        suffix = '-%d' % major
 
     if self.static_apr:
       self.aprutil_lib = 'aprutil%s.lib' % suffix
     else:
       self.aprutil_lib = 'libaprutil%s.lib' % suffix
+      
+    if version < minimal_aprutil_version:
+      sys.stderr.write("ERROR: aprutil %s or higher is required "
+                       "(%s found)\n" % (
+                          '.'.join(str(v) for v in minimal_aprutil_version),
+                          self.aprutil_version))
+      sys.exit(1)
+    else:
+      print('Found aprutil %s' % self.aprutil_version)
 
   def _find_sqlite(self):
     "Find the Sqlite library and version"
 
+    minimal_sqlite_version = (3, 7, 12)
+
     header_file = os.path.join(self.sqlite_path, 'inc', 'sqlite3.h')
 
     # First check for compiled version of SQLite.
@@ -1544,16 +1585,14 @@ class WinGeneratorBase(GeneratorBase):
 
     self.sqlite_version = '%d.%d.%d' % version
 
-    msg = 'Found SQLite version %s\n'
-
-    major, minor, patch = version
-    if major < 3 or (major == 3 and minor < 6) \
-                 or (major == 3 and minor == 6 and patch < 18):
-      sys.stderr.write("ERROR: SQLite 3.6.18 or higher is required "
-                       "(%s found)\n" % self.sqlite_version);
+    if version < minimal_sqlite_version:
+      sys.stderr.write("ERROR: aprutil %s or higher is required "
+                       "(%s found)\n" % (
+                          '.'.join(str(v) for v in minimal_sqlite_version),
+                          self.sqlite_version))
       sys.exit(1)
     else:
-      print(msg % self.sqlite_version)
+      print('Found SQLite %s' % self.sqlite_version)
 
   def _find_zlib(self):
     "Find the ZLib library and version"
@@ -1577,9 +1616,7 @@ class WinGeneratorBase(GeneratorBase):
 
     self.zlib_version = '%d.%d.%d' % version
 
-    msg = 'Found ZLib version %s\n'
-
-    print(msg % self.zlib_version)
+    print('Found ZLib %s' % self.zlib_version)
 
 class ProjectItem:
   "A generic item class for holding sources info, config info, etc for a project"



Mime
View raw message