This repository was archived by the owner on Nov 13, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConstruct
More file actions
131 lines (98 loc) · 3.7 KB
/
SConstruct
File metadata and controls
131 lines (98 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# -*- coding: utf-8 -*-
from checklib import *
vars = Variables('.scons.vars', ARGUMENTS)
vars.AddVariables(
PathVariable("prefix", "Installation prefix", "/usr",
PathVariable.PathAccept),
('AR', "The static archiver to use"),
('RANLIB', "The archive indexer to use"),
('CC', "The C compiler to use"),
('LINK', "The linker to use"),
('SHLINK', "The shared library linker to use"),
('CCFLAGS', "Any additional options to pass in to the C compiler"),
('CPPFLAGS', "Any additional options to pass in to the C preprocessor"),
('LINKFLAGS', "Any additional options to pass in to the linker"),
('SHLINKFLAGS', "Any additional options to pass in to the shared library linker"),
)
root_env = Environment(tools=['default', 'packaging'],
package="libpush",
pkg_version="1.0-dev",
CCFLAGS="-O2",
BINDIR = "$prefix/bin",
DOCDIR = "$prefix/share/doc/$package",
LIBDIR = "$prefix/lib",
INCLUDEDIR = "$prefix/include")
vars.Update(root_env)
vars.Save(".scons.vars", root_env)
root_env.MergeFlags('-g -Wall -Werror')
# An action that can clean up the scons temporary files.
if 'sdist' not in COMMAND_LINE_TARGETS:
root_env.Clean("distclean",
[
".sconf_temp",
".sconsign.dblite",
".scons.vars",
".scons.vars.check",
"config.log",
])
# Only run the configuration steps if we're actually going to build
# something.
if not GetOption('clean') and not GetOption('help'):
conf = root_env.Configure(custom_tests=
{
'CheckLibInPath': CheckLibInPath,
})
if not conf.CheckCC():
print "!! Your compiler and/or environment is not properly configured."
Exit(0)
if not conf.CheckLibInPath("check",
library="check",
call="",
header="#include <check.h>"):
print "!! Cannot find the check library."
Exit(0)
if not conf.CheckLibInPath("libhwm",
library="hwm",
call="hwm_buffer_new()",
header="#include <hwm-buffer.h>"):
print "!! Cannot find the libhwm library."
Exit(0)
root_env = conf.Finish()
# Set up a list of source files for the packaging target later on.
# Each SConscript file is responsible for updating this list.
SOURCE_FILES = []
Export('SOURCE_FILES')
# Add the root scons files to the SOURCES_LIST.
build_files = map(File, \
[
"SConstruct",
"site_scons/checklib.py",
])
SOURCE_FILES.extend(build_files)
# Include the subdirectory SConscripts
Export('root_env')
SConscript([
'doc/SConscript',
'include/SConscript',
'src/SConscript',
'tests/SConscript',
])
# Install documentation files
doc_files = map(File, \
[
"LICENSE.txt",
])
SOURCE_FILES.extend(doc_files)
root_env.Alias("install", root_env.Install("$DOCDIR", doc_files))
# Define packaging targets
license = 'BSD'
summary = 'A push parsing framework'
source_url = 'https://github.com/dcreager/libpush.git'
src = root_env.Package(NAME="$package",
VERSION="${pkg_version}",
PACKAGETYPE='src_targz',
source=SOURCE_FILES)
root_env.Alias("sdist", src)
if GetOption('clean'):
root_env.Default("sdist")
root_env.Clean("sdist", "$package-${pkg_version}")