/[ascend]/trunk/ascend-config.in
ViewVC logotype

Diff of /trunk/ascend-config.in

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

revision 683 by johnpye, Wed Jun 21 13:49:40 2006 UTC revision 922 by johnpye, Wed Nov 8 05:25:37 2006 UTC
# Line 1  Line 1 
1  #!@PYTHON@  #!@PYTHON@
2  from optparse import OptionParser  from optparse import OptionParser
3  import sys  import sys, platform
4    
5  #---------------------  #---------------------
6  # This file is generated automatically by SCons and installed in at INSTALL_BIN.  # This file is generated automatically by SCons and installed in at INSTALL_BIN.
# Line 9  import sys Line 9  import sys
9  # solvers etc.  # solvers etc.
10  #  #
11  # It's written in python since (because of SCons) we know we have Python on  # It's written in python since (because of SCons) we know we have Python on
12  # this system already tut we don't know that about unix shell (eg on Windows).  # this system already but we don't know that about unix shell (eg on Windows).
13  #  #
14  # Note that SCons supports reading of the output from this script, using  # Note that SCons supports reading of the output from this script, using
15  # features offered since version 0.96.91  # features offered since version 0.96.91
# Line 20  import sys Line 20  import sys
20  # Type ascend-config --help for usage.  # Type ascend-config --help for usage.
21  #---------------------  #---------------------
22    
23    if platform.system()=="Windows":
24  # here are the values passed to us from SCons:      import _winreg
25  LIB="@INSTALL_LIB@"      x=_winreg.ConnectRegistry(None,_winreg.HKEY_LOCAL_MACHINE)
26  BIN="@INSTALL_BIN@"      y= _winreg.OpenKey(x,r"SOFTWARE\ASCEND")
27  INCLUDE="@INSTALL_INCLUDE@"      LIB,t = _winreg.QueryValueEx(y,"INSTALL_LIB")
28  ASCDATA="@INSTALL_ASCDATA@"      BIN,t = _winreg.QueryValueEx(y,"INSTALL_BIN")
29        INCLUDE,t = _winreg.QueryValueEx(y,"INSTALL_INCLUDE")
30        ASCDATA,t = _winreg.QueryValueEx(y,"INSTALL_ASCDATA")
31        MODELS,t = _winreg.QueryValueEx(y,"INSTALL_MODELS")
32    
33        _winreg.CloseKey(y)
34        _winreg.CloseKey(x)
35    else:
36        # If we're not in Windows, use the original values passed to us from SCons:
37        LIB="@INSTALL_LIB@"
38        BIN="@INSTALL_BIN@"
39        INCLUDE="@INSTALL_INCLUDE@"
40        ASCDATA="@INSTALL_ASCDATA@"
41        MODELS="@INSTALL_MODELS@"
42    
43  usage = "usage: %prog [--help,...]"  usage = "usage: %prog [--help,...]"
44  # the rest of this script is about returning those values in the standard way  # the rest of this script is about returning those values in the standard way
# Line 34  parser = OptionParser(usage=usage, versi Line 47  parser = OptionParser(usage=usage, versi
47  parser.add_option("--libs", action="store_true", dest="libs", help="show linker flags (for ASCEND libraries)")  parser.add_option("--libs", action="store_true", dest="libs", help="show linker flags (for ASCEND libraries)")
48  parser.add_option("--cppflags", action="store_true", dest="cppflags", help="show C pre-processor flags (for ASCEND header files)")  parser.add_option("--cppflags", action="store_true", dest="cppflags", help="show C pre-processor flags (for ASCEND header files)")
49  parser.add_option("--data", action="store_true", dest="data", help="show location of ASCEND data files")  parser.add_option("--data", action="store_true", dest="data", help="show location of ASCEND data files")
50    parser.add_option("--models", action="store_true", dest="models", help="show location of ASCEND model library")
51    
52  (options, args) = parser.parse_args()  (options, args) = parser.parse_args()
53    
# Line 57  if options.data: Line 71  if options.data:
71      print ASCDATA      print ASCDATA
72      ok = True      ok = True
73    
74    if options.models:
75        print MODELS
76        ok = True
77    
78  if not ok:  if not ok:
79      sys.stderr.write("invalid option (use --help for more info)\n")      sys.stderr.write("invalid option '%s' (use --help for more info)\n" % args)
80      sys.exit(1)      sys.exit(1)
81    

Legend:
Removed from v.683  
changed lines
  Added in v.922

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