[cig-commits] commit: Updating PETScExt.

Mercurial hg at geodynamics.org
Mon Nov 24 11:22:56 PST 2008


changeset:   57:8c81dd6fc088
user:        LukeHodkinson
date:        Thu Mar 27 23:21:04 2008 +0000
files:       config/SConfig/packages/PETScExt.py
description:
Updating PETScExt.


diff -r 38577596fde8 -r 8c81dd6fc088 config/SConfig/packages/PETScExt.py
--- a/config/SConfig/packages/PETScExt.py	Thu Mar 27 23:19:17 2008 +0000
+++ b/config/SConfig/packages/PETScExt.py	Thu Mar 27 23:21:04 2008 +0000
@@ -2,9 +2,9 @@ import SConfig
 import SConfig
 
 class PETScExt(SConfig.Package):
-    def __init__(self, scons_env, scons_opts, required=False):
+    def __init__(self, env, options):
         SConfig.Package.__init__(self, env, options)
-        self.petsc = self.dependency(SConfig.packages.PETSc)
+        self.pkg_petsc = self.dependency(SConfig.packages.PETSc)
         self.base_patterns = ['petscext*', 'PETSCEXT*', 'PETScExt*']
         self.header_sub_dir = 'petsc'
         self.headers = [['petscext.h',
@@ -14,27 +14,28 @@ class PETScExt(SConfig.Package):
                            'petscext_mat', 'petscext_vec',
                            'petscext_utils']]
         self.require_shared = True
+        self.use_rpath = True
+        self.have_define = 'HAVE_PETSCEXT'
 
-    def generate_locations(self):
-        for loc in SConfig.Package.generate_locations(self):
-            # Just use whatever architecture PETSc uses.
-            arch = self.pkg_petsc.arch
-            self.arch = arch
+    def validate_location(self, location):
+        # Just use whatever architecture PETSc uses.
+        arch = self.pkg_petsc.arch
+        self.arch = arch
 
-            # Add the bmake/arch include directory.
-            hdr_dir = os.path.join('bmake', arch)
-            if not os.path.exists(os.path.join(location[0], hdr_dir)):
-                continue
-            if hdr_dir not in location[1]:
-                location[1] += [hdr_dir]
+        # Add the bmake/arch include directory.
+        hdr_dir = os.path.join('bmake', arch)
+        if not os.path.exists(os.path.join(location[0], hdr_dir)):
+            return [0, '', 'No bmake/<arch> directory.']
+        if hdr_dir not in location[1]:
+            location[1] += [hdr_dir]
 
-            # Add the lib/arch library directory.
-            if 'lib' in location[2]:
-                location[2].remove('lib')
-            lib_dir = os.path.join('lib', arch)
-            if not os.path.exists(os.path.join(location[0], lib_dir)):
-                continue
-            if lib_dir not in location[2]:
-                location[2] += [lib_dir]
+        # Add the lib/arch library directory.
+        if 'lib' in location[2]:
+            location[2].remove('lib')
+        lib_dir = os.path.join('lib', arch)
+        if not os.path.exists(os.path.join(location[0], lib_dir)):
+            return [0, '', 'No lib/<arch> directory.']
+        if lib_dir not in location[2]:
+            location[2] += [lib_dir]
 
-            yield loc
+        return [1, '', '']



More information about the CIG-COMMITS mailing list