forked from ntpsec/gpsd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SConstruct
76 lines (61 loc) · 2.3 KB
/
SConstruct
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
""" SCons build recipe for the GPSD project
Important targets:
build - build the software (default)
dist - make distribution tarballs .gz and .xz, plus .zip
zip - make distribution zip
install - install programs, libraries, and manual pages
uninstall - undo an install
check - run regression and unit tests.
audit - run code-auditing tools
testbuild - test-build the code from a tarball
website - refresh the website
release - ship a release
--clean - clean all normal build targets
-c - clean all normal build targets
Useful configuration options:
debug=yes -- Compile and link with debugging options. Turns off
optimizations,
debug_opt=yes -- Compile and link with debugging options. Leaves on
optimizations,
Useful scons options:
--warn=all -- to see scons warnings
Setting the DESTDIR environment variable will prefix the install destinations
without changing the --prefix prefix.
Pretty much all this file does is create the variant_dir, and call SConscript.
"""
# Unfinished items:
# * Coveraging mode: gcc "-coverage" flag requires a hack
# for building the python bindings
# This file is Copyright 2010 by the GPSD project
# SPDX-License-Identifier: BSD-2-clause
#
# This code runs compatibly under Python 2 and 3.x for x >= 2.
# Preserve this property!
from __future__ import print_function
import atexit # for atexit.register()
import os
# gpsd needs Scons version at least 2.3
EnsureSConsVersion(2, 3, 0)
# gpsd needs Python version at least 2.6
EnsurePythonVersion(2, 6)
# package version
gpsd_version = "3.24"
# name 'build' is already taken, put stuff in gpsd-$VERSION
# it makes tar simple
variantdir = 'gpsd-' + gpsd_version
# one touch clean!
# also, for brutal effect, you can do: git clean -dfx
if GetOption('clean'):
# .pages and .public are GitLab "pages".
clean_targets = '%s buildtmp .public .pages testbuild' % variantdir
atexit.register(lambda: os.system('rm -rf ' + clean_targets))
# Not everything respects this chdir()
SConscriptChdir(1)
SConscript('SConscript',
duplicate=1,
exports=['gpsd_version', 'variantdir'],
must_exit=True,
variant_dir=variantdir,
)
# VariantDir('buildtmp', '.')
# SConscript('buildtmp/SConscript', must_exit=True, duplicate=1)