/[ascend]/trunk/SConstruct
ViewVC logotype

Diff of /trunk/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1655 by jpye, Thu Nov 29 11:04:49 2007 UTC revision 1656 by jpye, Thu Nov 29 12:06:25 2007 UTC
# Line 1339  def CheckMath(context): Line 1339  def CheckMath(context):
1339      return is_ok      return is_ok
1340    
1341  #----------------  #----------------
1342    # malloc.h test
1343    
1344    malloc_test_text = """
1345    #include <malloc.h>
1346    int main(){
1347        double *x;
1348        x = malloc(sizeof(double)*5);
1349        x[4] = 3.3;
1350        free(x);
1351    }
1352    """
1353    
1354    def CheckMalloc(context):
1355        context.Message("Checking for malloc...")
1356        is_ok = context.TryLink(malloc_test_text,".c")
1357        context.Result(is_ok)
1358        return is_ok
1359    
1360    #----------------
1361    # dlopen test
1362    
1363    dlopen_test_text = """
1364    #ifdef __WIN32__
1365    # include <windows.h>
1366    #else
1367    # include <dlfcn.h>
1368    #endif
1369    int main(){
1370    #ifdef __WIN32__
1371        HINSTANCE d;
1372        LoadLibrary("imaginary_and_nonexistent.dll");
1373    #else
1374        void *d;
1375        d = dlopen("imaginary_and_nonexistent.so", 1);
1376    #endif
1377        return 0;
1378    }
1379    """
1380    
1381    def CheckDLOpen(context):
1382        context.Message("Checking for ability to load shared libraries at runtime...")
1383        libsave=context.env.get('LIBS');
1384        if platform.system()!="Windows":
1385            context.env.Append(LIBS=['dl'])
1386        is_ok = context.TryLink(dlopen_test_text,".c")
1387        context.Result(is_ok)
1388        context.env['LIBS'] = libsave
1389        return is_ok
1390    
1391    #----------------
1392  # libpython test  # libpython test
1393    
1394  libpython_test_text = """  libpython_test_text = """
# Line 1830  conf = Configure(env Line 1880  conf = Configure(env
1880          , 'CheckCXX' : CheckCXX          , 'CheckCXX' : CheckCXX
1881          , 'CheckF77' : CheckF77          , 'CheckF77' : CheckF77
1882          , 'CheckMath' : CheckMath          , 'CheckMath' : CheckMath
1883            , 'CheckMalloc' : CheckMalloc
1884            , 'CheckDLOpen' : CheckDLOpen
1885          , 'CheckSwigVersion' : CheckSwigVersion          , 'CheckSwigVersion' : CheckSwigVersion
1886          , 'CheckPythonLib' : CheckPythonLib          , 'CheckPythonLib' : CheckPythonLib
1887          , 'CheckCUnit' : CheckCUnit          , 'CheckCUnit' : CheckCUnit
# Line 1924  if need_libm and (conf.CheckMath() is Fa Line 1976  if need_libm and (conf.CheckMath() is Fa
1976      print 'Did not find math library, exiting!'      print 'Did not find math library, exiting!'
1977      Exit(1)      Exit(1)
1978    
1979    # Malloc
1980    
1981    if conf.CheckMalloc() is False:
1982        conf.env['HAVE_MALLOC']=False
1983        print "Did not find functioning 'malloc', exiting!"
1984        Exit(1)
1985    
1986    # dlopen/LoadLibrary
1987    
1988    if conf.CheckDLOpen() is False:
1989        print "Did not find functioning dlopen/LoadLibrary, exiting!"
1990        Exit(1)
1991    
1992  # Where is 'isnan'?  # Where is 'isnan'?
1993    
1994  if conf.CheckFunc('isnan') is False and conf.CheckFunc('_isnan') is False:  if conf.CheckFunc('isnan') is False and conf.CheckFunc('_isnan') is False:
# Line 2008  if not conf.CheckPythonLib(): Line 2073  if not conf.CheckPythonLib():
2073    
2074  # SWIG version  # SWIG version
2075    
2076  if with_python and not conf.CheckSwigVersion():  if with_python and conf.CheckSwigVersion() is False:
2077      without_python_reason = 'SWIG >= 1.3.24 is required'      without_python_reason = 'SWIG >= 1.3.24 is required'
2078      with_python = False      with_python = False
2079      env['WITH_PYTHON']=False      env['WITH_PYTHON']=False

Legend:
Removed from v.1655  
changed lines
  Added in v.1656

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22