1 |
johnpye |
571 |
Import('env') |
2 |
|
|
|
3 |
|
|
srcs = Split(""" |
4 |
|
|
AscBitmaps.c AscPrintTcl.c BrowLogRel_io.c BrowWhen_io.c |
5 |
|
|
BrowserMethod.c BrowserProc.c BrowserQuery.c BrowserRel_io.c |
6 |
|
|
Commands.c DebugProc.c DisplayProc.c |
7 |
|
|
EnvVarProc.c HelpProc.c Integrators.c |
8 |
johnpye |
670 |
LibraryProc.c MtxProc.c ProbeProc.c Qlfdid.c |
9 |
johnpye |
571 |
ScriptProc.c Sensitivity.c SimsProc.c SlvProc.c |
10 |
|
|
SolverProc.c UnitsProc.c UserData.c |
11 |
|
|
tkConsole.c old_utils.c Driver.c |
12 |
|
|
""") |
13 |
|
|
|
14 |
|
|
if env['HAVE_LEX']: |
15 |
|
|
typelexsource = 'typelex.l' |
16 |
|
|
else: |
17 |
|
|
typelexsource = 'typelex_no_flex.c' |
18 |
|
|
|
19 |
|
|
tcl_env = env.Copy() |
20 |
|
|
|
21 |
|
|
typelex = tcl_env.SharedObject(typelexsource |
22 |
johnpye |
629 |
, LEXFLAGS = '-l -Ptyp_' |
23 |
johnpye |
571 |
) |
24 |
|
|
|
25 |
|
|
if tcl_env.get('TCL_CPPPATH'): |
26 |
johnpye |
743 |
tcl_env.AppendUnique(CPPPATH=[tcl_env['TCL_CPPPATH']]) |
27 |
johnpye |
571 |
|
28 |
|
|
if tcl_env.get('TK_CPPPATH'): |
29 |
johnpye |
743 |
tcl_env.AppendUnique(CPPPATH=[tcl_env['TK_CPPPATH']]) |
30 |
johnpye |
571 |
|
31 |
jpye |
1380 |
tcl_env.AppendUnique(LIBS=['ascend']) |
32 |
johnpye |
743 |
tcl_env.AppendUnique(LIBPATH=['#']) |
33 |
johnpye |
571 |
|
34 |
|
|
if tcl_env.get('STATIC_TCLTK'): |
35 |
|
|
print "STATIC TCL/TK PROGRAM LINKAGE" |
36 |
|
|
srcs += ['$TCL_LIB','$TK_LIB','$TKTABLE_LIB'] |
37 |
johnpye |
743 |
tcl_env.AppendUnique(LIBS=[tcl_env['X11_LIB']]) |
38 |
|
|
tcl_env.AppendUnique(LIBPATH=[tcl_env['X11_LIBPATH']]) |
39 |
johnpye |
571 |
|
40 |
|
|
if tcl_env['TKTABLE_LIBPATH']: |
41 |
|
|
tcl_env.Append(LIBPATH=tcl_env['TKTABLE_LIBPATH']) |
42 |
|
|
|
43 |
|
|
tcl_env.Program("ascend4",["main.c"] + srcs) |
44 |
|
|
else: |
45 |
|
|
print "DYNAMIC TCL/TK PROGRAM LINKAGE" |
46 |
|
|
tcl_env.Append(LIBS=tcl_env['TCL_LIB']) |
47 |
|
|
tcl_env.Append(LIBS=tcl_env['TK_LIB']) |
48 |
|
|
|
49 |
|
|
if tcl_env.has_key('TCL_LIBPATH'): |
50 |
johnpye |
743 |
tcl_env.AppendUnique(LIBPATH=[tcl_env['TCL_LIBPATH']]) |
51 |
johnpye |
571 |
if tcl_env.has_key('TK_LIBPATH'): |
52 |
johnpye |
743 |
tcl_env.AppendUnique(LIBPATH=[tcl_env['TK_LIBPATH']]) |
53 |
johnpye |
571 |
|
54 |
|
|
ascendtcllib = tcl_env.SharedLibrary('ascendtcl',srcs+typelex) |
55 |
|
|
|
56 |
|
|
#tcl_so = tcl_env.Command(Copy('$SHLIBPREFIX$TCL_LIB$SHLIBSUFFIX','$TCL_LIBPATH/$SHLIBPREFIX$TCL_LIB$SHLIBSUFFIX')) |
57 |
|
|
#tk_so = tcl_env.Command(Copy('$SHLIBPREFIX$TK_LIB$SHLIBSUFFIX','$TK_LIBPATH/$SHLIBPREFIX$TK_LIB$SHLIBSUFFIX')) |
58 |
|
|
#tktable_so = tcl_env.Command(Copy('$SHLIBPREFIX$TKTABLE_LIB$SHLIBSUFFIX','$TKTABLE_LIBPATH/$SHLIBPREFIX$TKTABLE_LIB$SHLIBSUFFIX')) |
59 |
|
|
|
60 |
johnpye |
743 |
tcl_env.Prepend(LIBPATH=['.']) |
61 |
johnpye |
571 |
|
62 |
|
|
ascendtclprog = tcl_env.Program("ascend4",["main.c"] |
63 |
jpye |
1380 |
, LIBS = tcl_env['LIBS']+['ascendtcl'] |
64 |
johnpye |
571 |
) |
65 |
|
|
|
66 |
|
|
if tcl_env.get('CAN_INSTALL'): |
67 |
jpye |
1436 |
env.InstallProgram(Dir(env.subst("$INSTALL_ROOT$INSTALL_BIN")),ascendtclprog) |
68 |
|
|
env.InstallShared(Dir(env.subst("$INSTALL_ROOT$INSTALL_LIB")),ascendtcllib) |
69 |
johnpye |
571 |
|
70 |
|
|
import glob |
71 |
|
|
|
72 |
jpye |
1436 |
tkdir = Dir(env.subst("$INSTALL_ROOT$INSTALL_ASCDATA/tcltk")) |
73 |
johnpye |
571 |
|
74 |
|
|
import os |
75 |
|
|
import os.path |
76 |
|
|
|
77 |
|
|
cd = os.getcwd() |
78 |
|
|
os.chdir(env.Dir("#tcltk/TK").abspath) |
79 |
|
|
|
80 |
|
|
files = {} |
81 |
|
|
|
82 |
|
|
for root, dirs, files in os.walk("."): |
83 |
|
|
#print root, "..." |
84 |
|
|
dest = os.path.normpath(os.path.join(env.subst(tkdir),root)) |
85 |
|
|
for name in files: |
86 |
johnpye |
629 |
env.InstallShared(env.subst(dest),"#tcltk/TK/"+os.path.join(root, name)) |
87 |
johnpye |
571 |
#print dest,"<---",os.path.join(root, name) |
88 |
|
|
|
89 |
|
|
if 'CVS' in dirs: |
90 |
|
|
dirs.remove('CVS') # don't visit CVS directories |
91 |
|
|
if '.svn' in dirs: |
92 |
|
|
dirs.remove('.svn') # don't visit .svn directories |
93 |
|
|
|
94 |
|
|
os.chdir(cd) |
95 |
johnpye |
811 |
|
96 |
|
|
# vim: set syntax=python: |
97 |
|
|
|