[cig-commits] r4389 - in long/3D/Gale/trunk: .
python/BuildSystem/config python/Gale python/Gale/packages
walter at geodynamics.org
walter at geodynamics.org
Fri Aug 18 12:35:32 PDT 2006
Author: walter
Date: 2006-08-18 12:35:32 -0700 (Fri, 18 Aug 2006)
New Revision: 4389
Added:
long/3D/Gale/trunk/python/Gale/packages/C99_functions.py
Modified:
long/3D/Gale/trunk/
long/3D/Gale/trunk/SConstruct.in
long/3D/Gale/trunk/python/BuildSystem/config/compilers.py
long/3D/Gale/trunk/python/Gale/Configure.py
long/3D/Gale/trunk/python/Gale/packages/petsc.py
Log:
r694 at earth: boo | 2006-08-18 12:33:16 -0700
Clean up configure and make it check for C99 constructs
Property changes on: long/3D/Gale/trunk
___________________________________________________________________
Name: svk:merge
- 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:693
+ 3a629746-de10-0410-b17b-fd6ecaaa963e:/cig:694
Modified: long/3D/Gale/trunk/SConstruct.in
===================================================================
--- long/3D/Gale/trunk/SConstruct.in 2006-08-18 19:35:29 UTC (rev 4388)
+++ long/3D/Gale/trunk/SConstruct.in 2006-08-18 19:35:32 UTC (rev 4389)
@@ -25,9 +25,10 @@
env=Environment(CC='@CC@',LINK='@CC@')
-cflags='@CFLAGS@'
-if len(cflags)!=0:
+if '@CFLAGS@':
env.Append(CCFLAGS=Split('@CFLAGS@'))
+if '@C99_DEFINES@':
+ env.Append(CPPFLAGS=Split('@C99_DEFINES@'))
env.Append(CPPPATH=['#/build/include'])
env.Append(CPPPATH=['#/build/include/StGermain'])
Modified: long/3D/Gale/trunk/python/BuildSystem/config/compilers.py
===================================================================
--- long/3D/Gale/trunk/python/BuildSystem/config/compilers.py 2006-08-18 19:35:29 UTC (rev 4388)
+++ long/3D/Gale/trunk/python/BuildSystem/config/compilers.py 2006-08-18 19:35:32 UTC (rev 4389)
@@ -900,10 +900,10 @@
import config.setCompilers
if hasattr(self.setCompilers, 'CC'):
self.isGCC = config.setCompilers.Configure.isGNU(self.setCompilers.CC)
- self.executeTest(self.checkRestrict,['C'])
- self.executeTest(self.checkCFormatting)
- self.executeTest(self.checkCStaticInline)
- self.executeTest(self.checkDynamicLoadFlag)
+# self.executeTest(self.checkRestrict,['C'])
+# self.executeTest(self.checkCFormatting)
+# self.executeTest(self.checkCStaticInline)
+# self.executeTest(self.checkDynamicLoadFlag)
self.executeTest(self.checkCLibraries)
else:
self.isGCC = 0
Modified: long/3D/Gale/trunk/python/Gale/Configure.py
===================================================================
--- long/3D/Gale/trunk/python/Gale/Configure.py 2006-08-18 19:35:29 UTC (rev 4388)
+++ long/3D/Gale/trunk/python/Gale/Configure.py 2006-08-18 19:35:32 UTC (rev 4389)
@@ -44,30 +44,19 @@
config.base.Configure.setupDependencies(self, framework)
self.setCompilers = framework.require('config.setCompilers', self)
self.compilers = framework.require('config.compilers', self)
- self.headers = framework.require('config.headers', self)
- self.functions = framework.require('config.functions', self)
- self.libraries = framework.require('config.libraries', self)
self.libxml2 = framework.require('Gale.packages.libxml2', self)
- self.libxml2 = framework.require('Gale.packages.petsc', self)
+ self.petsc = framework.require('Gale.packages.petsc', self)
+ self.C99 = framework.require('Gale.packages.C99_functions',self)
self.mpi = framework.require('config.packages.MPI', self)
self.compilers.headerPrefix = self.headerPrefix
- self.headers.headerPrefix = self.headerPrefix
- self.functions.headerPrefix = self.headerPrefix
- self.libraries.headerPrefix = self.headerPrefix
- headersC = map(lambda name: name+'.h', ['stdlib'])
- functions = ['rand']
- libraries1 = [(['socket', 'nsl'], 'socket'), (['fpe'], 'handle_sigfpes')]
- self.headers.headers.extend(headersC)
- self.functions.functions.extend(functions)
- self.libraries.libraries.extend(libraries1)
return
def configureDefaults(self):
return
def configureScript(self):
- '''Output a script in the bmake directory which will reproduce the configuration'''
+ '''Output a script reconfigure.py which will reproduce the configuration'''
import nargs
scriptName = 'reconfigure.py'
Added: long/3D/Gale/trunk/python/Gale/packages/C99_functions.py
===================================================================
--- long/3D/Gale/trunk/python/Gale/packages/C99_functions.py 2006-08-18 19:35:29 UTC (rev 4388)
+++ long/3D/Gale/trunk/python/Gale/packages/C99_functions.py 2006-08-18 19:35:32 UTC (rev 4389)
@@ -0,0 +1,64 @@
+#!/usr/bin/env python
+from __future__ import generators
+import user
+import config.autoconf
+import os
+import config.package
+
+class Configure(config.package.Package,config.autoconf.Configure):
+ def __init__(self, framework):
+ config.autoconf.Configure.__init__(self, framework)
+ config.package.Package.__init__(self, framework)
+ self.headerPrefix = ''
+ self.substPrefix = ''
+ return
+
+ def setupDependencies(self, framework):
+ config.package.Package.setupDependencies(self, framework)
+ return
+
+ def configureLibrary(self):
+ '''Checks for va_copy, isnan, isinf, and erf, and set up compiler options for workarounds (e.g. __va_copy).'''
+
+ C99_defines=''
+ if not self.checkLink('#include <stdarg.h>\n',
+ 'va_list ap, apCopy;\nva_copy(apCopy, ap);\n'):
+ if self.checkLink('#include <stdarg.h>\n',
+ 'va_list ap, apCopy;\n__va_copy(apCopy, ap);\n'):
+ C99_defines+="-Dva_copy=__va_copy "
+ else:
+ raise RuntimeError("Can not find an implementation of va-copy");
+
+ if not self.checkLink('#include <math.h>\n',
+ 'isnan(1.0);\n'):
+ if self.checkLink('#include <math.h>\n',
+ '_isnan(1.0);\n'):
+ C99_defines+="-Disnan=_isnan "
+ else:
+ raise RuntimeError("Can not find an implementation of isnan");
+
+ if not self.checkLink('#include <math.h>\n',
+ 'isinf(1.0);\n'):
+ if self.checkLink('#include <math.h>\n',
+ '_finite(1.0);\n'):
+ C99_defines+="-Disinf=!_finite "
+ else:
+ raise RuntimeError("Can not find an implementation of isinf");
+
+ self.addSubstitution('C99_DEFINES', C99_defines)
+ if hasattr(self.framework, 'packages'):
+ self.framework.packages.append(self)
+ return
+
+ def configure(self):
+ self.executeTest(self.configureLibrary)
+ return
+
+if __name__ == '__main__':
+ import config.framework
+ import sys
+ framework = config.framework.Framework(sys.argv[1:])
+ framework.setup()
+ framework.addChild(Configure(framework))
+ framework.configure()
+ framework.dumpSubstitutions()
Property changes on: long/3D/Gale/trunk/python/Gale/packages/C99_functions.py
___________________________________________________________________
Name: svn:mime-type
+ text/script
Modified: long/3D/Gale/trunk/python/Gale/packages/petsc.py
===================================================================
--- long/3D/Gale/trunk/python/Gale/packages/petsc.py 2006-08-18 19:35:29 UTC (rev 4388)
+++ long/3D/Gale/trunk/python/Gale/packages/petsc.py 2006-08-18 19:35:32 UTC (rev 4389)
@@ -67,8 +67,6 @@
packages_libs=''
packages_includes=''
- print "static library",staticLibrary,bmakeDir + '/petscconf',os.path.exists(bmakeDir + '/petscconf')
-
if staticLibrary:
if os.path.exists(bmakeDir + '/petscconf'):
from distutils.sysconfig import parse_config_h, parse_makefile, \
@@ -85,8 +83,6 @@
elif config.setCompilers.Configure.isDarwin():
self.compilers.LIBS += ' -framework vecLib'
- print "packages",packages_libs,packages_includes
-
if not self.checkLink('', testFunction+'();\n'):
foundLibrary = False
self.compilers.LIBS = oldLibs
More information about the cig-commits
mailing list