summaryrefslogtreecommitdiff
path: root/net-p2p/linuxdcpp/files/patch-SConstruct
blob: 89f6a10b8ce48022d1f0b7b3b780ee7772d32795 (plain) (blame)
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
--- SConstruct.orig	Tue Aug  1 13:01:44 2006
+++ SConstruct	Thu Aug  3 12:45:35 2006
@@ -38,28 +38,12 @@
      context.Result(ret)
      return ret
 
-def CheckCXXVersion(context, name, major, minor):
-	context.Message('Checking for %s >= %d.%d...' % (name, major, minor))
-	ret = commands.getoutput('%s -dumpversion' % name)
-
-	retval = 0
-	try:
-		if ((string.atoi(ret[0]) == major and string.atoi(ret[2]) >= minor)
-		or (string.atoi(ret[0]) > major)):
-			retval = 1
-	except ValueError:
-		print "Oops! No C++ compiler found!"
-
-	context.Result(retval)
-	return retval
-
-
 # Initialize the environment and configure variables
 
-env = Environment(ENV = os.environ)
+env = Environment(ENV = os.environ, CC = '%%CC%%', CXX = '%%CXX%%')
 
 conf = Configure(env,
-	custom_tests = {'CheckPKGConfig' : CheckPKGConfig, 'CheckPKG' : CheckPKG, 'CheckCXXVersion' : CheckCXXVersion},
+	custom_tests = {'CheckPKGConfig' : CheckPKGConfig, 'CheckPKG' : CheckPKG},
 	conf_dir = 'build/sconf',
 	log_file = 'build/sconf/config.log')
 
@@ -68,27 +52,6 @@
 
 # Check for dependencies
 
-# This looks up the CXX enviroment variable so that people can specify
-# what g++ to use on the command line (eg. prompt:> CXX=foo scons)
-cxx = conf.env.Dictionary()['CXX']
-if not conf.CheckCXXVersion(cxx, 3, 4):
-	if WhereIs('g++-3.4') != None:
-		print 'Found g++-3.4'
-		cxx = 'g++-3.4'
-	else:
-	     print 'Compiler version check failed. g++ 3.4 or later is needed'
-	     Exit(1)
-
-# Add support for compiler caches to speed-up compilation.
-if os.popen('distcc 2> /dev/null').read():
-	cxx = 'distcc ' + cxx
-	print 'Enabling distcc...'
-if os.popen('ccache 2> /dev/null').read():
-	cxx = 'ccache ' + cxx
-	print 'Enabling ccache...'
-
-conf.env.Replace(CXX = cxx)
-
 if not conf.CheckPKGConfig():
      print 'pkg-config not found.'
      Exit(1)
@@ -120,11 +83,6 @@
 	print 'Can\'t live without it, sorry'
 	Exit(1)
 
-if not conf.CheckLibWithHeader('pthread', 'pthread.h', 'c'):
-	print 'Did not find the pthread library, exiting!'
-	print 'Note: You might have the lib but not the headers'
-	Exit(1)
-
 if not conf.CheckLibWithHeader('z', 'zlib.h', 'c'):
 	print 'Did not find the z library (gzip/z compression)'
 	print 'Can\'t live without it, exiting'
@@ -138,19 +96,19 @@
 	Exit(1)
 
 env = conf.Finish()
-env.Append(CXXFLAGS = ['-I.', '-D_GNU_SOURCE', '-DENABLE_BINRELOC', '-D_FILE_OFFSET_BITS=64'])
+env.Append(CXXFLAGS = ['-I.', '-D_GNU_SOURCE', '-D_FILE_OFFSET_BITS=64'])
 
 
 # Parse command line parameters
 
 debug = ARGUMENTS.get('debug', 0)
 if int(debug):
-	env.Append(CXXFLAGS = '-g -ggdb -D_DEBUG -Wall')
+	env.Append(CXXFLAGS = '%%CXXFLAGS%% -g -ggdb -D_DEBUG -Wall')
 	env.Append(LDFLAGS = '-g -ggdb')
 
 release = ARGUMENTS.get('release', 0)
 if int(release):
-	env.Append(CXXFLAGS = '-O3')
+	env.Append(CXXFLAGS = '%%CXXFLAGS%%')
 
 profile = ARGUMENTS.get('profile', 0)
 if int(profile):