-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSConscript
More file actions
executable file
·60 lines (52 loc) · 1.39 KB
/
SConscript
File metadata and controls
executable file
·60 lines (52 loc) · 1.39 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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
scons build script for paping
Copyright © 2015 Rob A. Shinn. See COPYRIGHT for license terms.
"""
import platform, sys, os
if sys.maxsize > 2**32:
bits = 64
else:
bits = 32
if 'CCFLAGS' not in os.environ:
ccflags = ['-m%s' % bits]
ccflags.append('-Wall')
ccflags.append('-O3')
else:
ccflags = os.environ['CCFLAGS'].split(' ')
if 'CXX' in os.environ:
cxx = os.environ['CXX']
if sys.platform == 'win32':
ccflags.append('-DWIN32')
bin="paping.exe"
env = Environment(ENV=os.environ,tools=['mingw'])
env.Append(LIBS="wsock32")
else:
if 'CXX' in os.environ:
cxx = os.environ['CXX']
else:
cxx = "g++"
if 'LDFLAGS' in os.environ:
linkflags=os.environ['LDFLAGS']
else:
linkflags=""
env = Environment(CCFLAGS=ccflags,CXX=cxx,LINKFLAGS=linkflags)
if '-DWIN32' in ccflags: # we are doing a cross-compile
bin="paping.exe"
env.Append(LIBS="wsock32")
else:
bin="paping"
all = env.Program(target = bin,
source = [
'src/print.cpp',
'src/stats.cpp',
'src/timer.cpp',
'src/arguments.cpp',
'src/i18n.cpp',
'src/host.cpp',
'src/socket.cpp',
'src/main.cpp',
],
)
Default(all)