1 |
johnpye |
683 |
#!@PYTHON@ |
2 |
|
|
from optparse import OptionParser |
3 |
|
|
import sys |
4 |
|
|
|
5 |
|
|
#--------------------- |
6 |
|
|
# This file is generated automatically by SCons and installed in at INSTALL_BIN. |
7 |
|
|
# Use it to query for local configuration of ASCEND on your system for example |
8 |
|
|
# when building external 'plugins' such as external computations and external |
9 |
|
|
# solvers etc. |
10 |
|
|
# |
11 |
|
|
# It's written in python since (because of SCons) we know we have Python on |
12 |
johnpye |
692 |
# this system already but we don't know that about unix shell (eg on Windows). |
13 |
johnpye |
683 |
# |
14 |
|
|
# Note that SCons supports reading of the output from this script, using |
15 |
|
|
# features offered since version 0.96.91 |
16 |
|
|
# |
17 |
|
|
# This file inspired by other software that uses the same approach, eg |
18 |
|
|
# ginac-config, xft-config, cppunit-config. |
19 |
|
|
# |
20 |
|
|
# Type ascend-config --help for usage. |
21 |
|
|
#--------------------- |
22 |
|
|
|
23 |
|
|
|
24 |
|
|
# here are the values passed to us from SCons: |
25 |
|
|
LIB="@INSTALL_LIB@" |
26 |
|
|
BIN="@INSTALL_BIN@" |
27 |
|
|
INCLUDE="@INSTALL_INCLUDE@" |
28 |
|
|
ASCDATA="@INSTALL_ASCDATA@" |
29 |
|
|
|
30 |
|
|
usage = "usage: %prog [--help,...]" |
31 |
|
|
# the rest of this script is about returning those values in the standard way |
32 |
|
|
parser = OptionParser(usage=usage, version="@VERSION@") |
33 |
|
|
|
34 |
|
|
parser.add_option("--libs", action="store_true", dest="libs", help="show linker flags (for ASCEND libraries)") |
35 |
|
|
parser.add_option("--cppflags", action="store_true", dest="cppflags", help="show C pre-processor flags (for ASCEND header files)") |
36 |
|
|
parser.add_option("--data", action="store_true", dest="data", help="show location of ASCEND data files") |
37 |
|
|
|
38 |
|
|
(options, args) = parser.parse_args() |
39 |
|
|
|
40 |
|
|
ok = False |
41 |
|
|
|
42 |
|
|
if options.cppflags: |
43 |
|
|
include = "" |
44 |
|
|
if INCLUDE!="/usr/include": |
45 |
|
|
include=INCLUDE |
46 |
|
|
print "-I"+include |
47 |
|
|
ok = True |
48 |
|
|
|
49 |
|
|
if options.libs: |
50 |
|
|
libs = "" |
51 |
|
|
if LIB!="/usr/lib": |
52 |
|
|
libs = LIB |
53 |
|
|
print "-L"+libs+" -lascend" |
54 |
|
|
ok = True |
55 |
|
|
|
56 |
|
|
if options.data: |
57 |
|
|
print ASCDATA |
58 |
|
|
ok = True |
59 |
|
|
|
60 |
|
|
if not ok: |
61 |
|
|
sys.stderr.write("invalid option (use --help for more info)\n") |
62 |
|
|
sys.exit(1) |