/[ascend]/trunk/models/johnpye/fprops/SConstruct
ViewVC logotype

Annotation of /trunk/models/johnpye/fprops/SConstruct

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3417 - (hide annotations) (download)
Tue Jul 23 04:58:12 2019 UTC (4 years, 11 months ago) by jpye
File size: 1378 byte(s)
fixing 'WITH_ASCEND' flag for FPROPS (scons WITH_ASCEND=0 works now to suppress libfprops_ascend.so)

1 jpye 2654 #!/usr/bin/env python
2 jpye 1811 # Standalone 'SConstruct' to demonstrate how you can build
3     # this ASCEND external library against an existing copy of
4     # ASCEND installed on your system.
5    
6 jpye 2654 import os, platform, sys
7 jpye 2299
8 jpye 2654 deft = "default"
9     if platform.system()=="Windows":
10     deft = "mingw"
11    
12 jpye 2695 vars = Variables()
13    
14     vars.Add(
15     'CC'
16     ,'C Compiler command'
17     ,"${HOST_PREFIX}gcc"
18     )
19    
20 jpye 2717 vars.Add(
21     'CFLAGS'
22     ,'C compiler flags'
23 jpye 2730 ,["-Wall"]
24 jpye 2717 )
25    
26 jpye 3417 vars.Add(BoolVariable('WITH_ASCEND',"Attempt to include ASCEND support",1))
27 jpye 3414
28 jpye 2662 env = Environment(
29 jpye 2297 toolpath=['scons']
30 jpye 2654 ,tools = [deft ,'substinfile','swig']
31 jpye 3414 ,ENV={"TERM":os.environ.get('TERM'), "PATH":os.environ.get('PATH'), "LD_LIBRARY_PATH":os.environ.get("LD_LIBRARY_PATH")}
32 jpye 2654 ,HOST_PREFIX=os.environ.get('HOST_PREFIX')
33 jpye 2297 )
34 jpye 1811
35 jpye 2695 Help(vars.GenerateHelpText(env))
36     vars.Update(env)
37 jpye 2654
38 jpye 3414 if env['WITH_ASCEND']:
39     if WhereIs('ascend-config'):
40     env.ParseConfig(['ascend-config','--libs','--cppflags'])
41     env['WITH_ASCEND'] = 1
42     else:
43     print "WARNING: no ascend-config in path, won't build ASCEND wrapper"
44     env['WITH_ASCEND'] = 0
45 jpye 2117 else:
46 jpye 3414 print "NOTE: ASCEND support will not be included"
47 jpye 1811
48 jpye 3337 env.AppendUnique(
49 jpye 2664 CFLAGS=['-g','-Wall']
50 jpye 2236 )
51    
52 jpye 3417 print "CPPPATH =",env.get('CPPPATH')
53 jpye 3414
54 jpye 2662 env['EXTLIB_SUFFIX'] = "_ascend" + env.subst("$SHLIBSUFFIX")
55     env['EXTLIB_PREFIX'] = env.subst("$SHLIBPREFIX")
56     env['extfns'] = []
57     env['WITH_PYTHON'] = 1
58 jpye 3414 env['HAVE_CUNIT'] = 0
59 jpye 2215
60 jpye 2662 env.SConscript("SConscript",["env"])
61 jpye 1811

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