/[ascend]/trunk/base/generic/solver/SConscript
ViewVC logotype

Diff of /trunk/base/generic/solver/SConscript

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

revision 1750 by jpye, Sun Feb 10 03:42:42 2008 UTC revision 1751 by jpye, Mon Feb 11 05:27:18 2008 UTC
# Line 10  csrcs = Split(""" Line 10  csrcs = Split("""
10  """)  """)
11  # slv9, slv3 and slv8 moved to external packages (dynamically loaded)  # slv9, slv3 and slv8 moved to external packages (dynamically loaded)
12    
 solver_env = libascend_env.Copy()  
   
13  objs = []  objs = []
14    
15  import re  import re
16  def c_escape(str):  def c_escape(str):
17          return re.sub("\\\\","/",str)          return re.sub("\\\\","/",str)
18    
19    
20    solver_env = libascend_env.Copy()
21    
22    solver_env['SUBST_DICT'] = {
23        '@ASC_WITH_CONOPT@':str(int(libascend_env['WITH_CONOPT']))
24        ,'@ASC_LINKED_CONOPT@':str(int(libascend_env['CONOPT_LINKED']))
25        ,'@ASC_CONOPT_LIB@': '"%s"' % libascend_env.get('CONOPT_LIB')
26        ,'@ASC_CONOPT_ENVVAR@': '"%s"' % libascend_env.get('CONOPT_ENVVAR')
27        ,'@ASC_CONOPT_DLPATH@': '"%s"' % c_escape(libascend_env.subst("$CONOPT_DLPATH"))
28    }
29    
30    solverconfig = solver_env.SubstInFile('conoptconfig.h.in')
31    
32  if libascend_env.get('WITH_CONOPT'):  if libascend_env.get('WITH_CONOPT'):
33      conopt_env = solver_env.Copy()      conopt_env = solver_env.Copy()
34    
     conopt_env.AppendUnique(  
         CPPDEFINES=['ASC_WITH_CONOPT']  
         ,CPPPATH=[solver_env.get('CONOPT_CPPPATH')]  
     )  
     print "CONOPT CPPPATH=%s" % solver_env.get('CPPPATH')  
   
35      if libascend_env.get('CONOPT_LINKED'):      if libascend_env.get('CONOPT_LINKED'):
36          # and then we must give the ldflags back to libascend for linking.          # and then we must give the ldflags back to libascend for linking.
37          libascend_env.AppendUnique(          libascend_env.AppendUnique(
38              LIBPATH=[solver_env.get('CONOPT_LIBPATH')]              LIBPATH=[solver_env.get('CONOPT_LIBPATH')]
39              , LIBS=[solver_env.get('CONOPT_LIB')]              , LIBS=[solver_env.get('CONOPT_LIB')]
40          )          )
         conopt_env.AppendUnique(  
             CPPDEFINES=['ASC_LINKED_CONOPT']  
         )  
     else:  
         conopt_env.AppendUnique(  
             CPPDEFINES=[  
                 'ASC_CONOPT_LIB=\\"%s\\"' % libascend_env.get('CONOPT_LIB')  
                 ,'ASC_CONOPT_ENVVAR=\\"%s\\"' % libascend_env.get('CONOPT_ENVVAR')  
                 ,'ASC_CONOPT_DLPATH=\\"%s\\"' % c_escape(libascend_env.subst("$CONOPT_DLPATH"))  
             ]  
         )  
41    
42      objs += conopt_env.SharedObject('conopt_dl.c')      conoptdl = conopt_env.SharedObject('conopt_dl.c')
43        conopt_env.Depends(conoptdl,solverconfig)
44        
45        objs += conoptdl
46    
47  for c in csrcs:  for c in csrcs:
48      objs += solver_env.SharedObject(c)      objs += solver_env.SharedObject(c)

Legend:
Removed from v.1750  
changed lines
  Added in v.1751

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