Debian Codegraph @

SConstruct

raw ◀ ▶
Source reconstructed at patch state 1 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 #!/usr/bin/scons
2 #
3 # Replacement Atom-4 build script.
4 #
5 # Configurable parameters: (run with 'cons $VARNAME=$VALUE ...')
6 #
7 # BINDIR=$dir Where to install Atom-4 binaries
8 # COMPILER=$binary Compiler to use (default: g++)
9 # DATADIR=$dir Where data files should be installed
10 # MANDIR=$dir Directory to store manpages
11 # REALDATADIR=$dir Where Atom-4 should look for data files (default
12 # is $DATADIR; this option is mainly for packaging
13 # builds where the build-time dir is different from
14 # the run-time dir)
15 # PROGLIBPATH=$dir Path to prog/lib libraries (default: #../lib)
16 # X11LIBPATH=$dir Where to find X11 libraries (default: /usr/X11R6/lib)
17 # DEBUG=1 Build with debugging symbols
18 # OPTIMIZE=$n Optimize to level $n. Set to 0 to disable.
19 # (Default: 2)
20 # PROFILE=1 Build with profiling code (for development use only)
21 #
22
23 # External configuration (can be overridden by running SCons with the
24 # appropriate X=Y W=Z ... options)
25 datadir = ARGUMENTS.get('DATADIR', '#data')
26 optimize = ARGUMENTS.get('OPTIMIZE', 2)
27 profile = ARGUMENTS.get('PROFILE', 0)
28
29 # Shared files
30 bindir = ARGUMENTS.get('BINDIR', '#bin')
31 incdir = ARGUMENTS.get('INCDIR', '#include')
32 mandir = ARGUMENTS.get('MANDIR', '#man')
33 libdir = '#lib'
34 objdir = '#obj'
35
36 # Locations of required libs
37 proglib = '-lt++'
38 proglibpath = ARGUMENTS.get('PROGLIBPATH', '../lib')
39 ncurseslib = ['-lpanel', '-lncurses']
40 x11lib = ['-lX11', '-lXpm']
41 x11libpath = ARGUMENTS.get('X11LIBPATH', '/usr/X11R6/lib')
42
43 # Global configuration
44 compiler = ARGUMENTS.get('COMPILER', 'g++')
45 realdatadir = ARGUMENTS.get('REALDATADIR', datadir)
46 cflags = [
47 '-pedantic',
48 '-DDATADIR=\\"' + Dir(realdatadir).path + '\\"'
49 ]
50 if ARGUMENTS.get('DEBUG', 0):
51 cflags += ['-g3']
52 if optimize:
53 cflags += ['-O%d' % optimize]
54 if profile:
55 cflags = cflags + [ '-pg', '-DPROFILE' ]
56
57 # Local configuration
58 incpath = [ incdir, proglibpath + '/include' ]
59 libpath = [ proglibpath + '/lib', libdir, x11libpath ]
60 libs = [ proglib, ncurseslib, x11lib, '-latom4', '-lxatom4' ];
61 if profile:
62 libs += '-pg'
63
64 env = Environment(
65 CC = compiler,
66 CFLAGS = cflags,
67 CXXFLAGS = cflags,
68 CPPPATH = incpath,
69 LIBS = libs,
70 LIBPATH = libpath
71 )
72 env.Decider('content')
73
74 Export('env', 'compiler', 'cflags', 'bindir', 'datadir', 'incdir', 'libdir',
75 'objdir', 'proglibpath', 'ncurseslib')
76
77 # Build tree
78 SConscript(Split("""
79 engine/SConscript
80 general/SConscript
81 ncurses/SConscript
82 net/SConscript
83 x/SConscript
84 """))
85
86
87 #
88 # Headers
89 #
90
91 env.Install(incdir, 'interface.h')
92
93
94 #
95 # Main program
96 #
97
98 env.Install(bindir, 'atom4')
99 env.Program('atom4', [
100 'atom4.cc',
101 'interface.cc',
102 objdir + '/event.o',
103 objdir + '/textui.o'
104 ])
105 env.Depends('atom4', Split("""
106 lib/libatom4.a
107 lib/libxatom4.a
108 """))
109
110 #
111 # Auxilliary stuff
112 #
113
114 env.Install(mandir + '/man6', 'atom4.6');
115