aboutsummaryrefslogtreecommitdiff
path: root/net-p2p/linuxdcpp/files/patch-SConstruct
blob: 20fa13e02dd21710eba04d4501e83381ad73caa9 (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
--- SConstruct.orig	2011-04-18 01:57:09.000000000 +0800
+++ SConstruct	2011-10-19 23:42:24.000000000 +0800
@@ -20,7 +20,7 @@
 BUILD_FLAGS = {
 	'common'  : ['-I#', '-D_GNU_SOURCE', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64', '-D_REENTRANT'],
 	'debug'   : ['-g', '-ggdb', '-Wall', '-D_DEBUG'], 
-	'release' : ['-O3', '-fomit-frame-pointer', '-DNDEBUG']
+	'release' : ['-fomit-frame-pointer', '-DNDEBUG']
 }
 
 # ----------------------------------------------------------------------
@@ -106,6 +106,7 @@
 vars.AddVariables(
 	BoolVariable('debug', 'Compile the program with debug information', 0),
 	BoolVariable('release', 'Compile the program with optimizations', 0),
+	BoolVariable('libnotify', 'Enable notifications through libnotify', 1),
 	BoolVariable('profile', 'Compile the program with profiling information', 0),
 	PathVariable('PREFIX', 'Compile the program with PREFIX as the root for installation', '/usr/local', PathVariable.PathIsDir),
 	('FAKE_ROOT', 'Make scons install the program under a fake root', '')
@@ -131,7 +131,10 @@
 	env['CC'] = os.environ['CC']
 
 if os.environ.has_key('CXXFLAGS'):
-	env['CPPFLAGS'] = env['CXXFLAGS'] = os.environ['CXXFLAGS'].split()
+	env['CXXFLAGS'] = os.environ['CXXFLAGS'].split()
+
+if os.environ.has_key('CPPFLAGS'):
+	env['CPPFLAGS'] = os.environ['CPPFLAGS'].split()
 
 if os.environ.has_key('LDFLAGS'):
 	env['LINKFLAGS'] = os.environ['LDFLAGS'].split()
@@ -139,6 +140,12 @@
 if os.environ.has_key('CFLAGS'):
 	env['CFLAGS'] = os.environ['CFLAGS'].split()
 
+if os.environ.has_key('CPPPATH'):
+	env['CPPPATH'] = os.environ['CPPPATH'].split()
+
+if os.environ.has_key('LIBPATH'):
+	env['LIBPATH'] = os.environ['LIBPATH'].split()
+
 env['CPPDEFINES'] = [] # Initialize as a list so Append doesn't concat strings
 
 env.SConsignFile('build/sconf/.sconsign')
@@ -263,14 +270,15 @@
 		conf.env.Append(CPPDEFINES = 'HAVE_IFADDRS_H')
 
 	# TODO: Implement a plugin system so libnotify doesn't have compile-time dependencies
-	if not conf.CheckPKG('libnotify >= 0.4.1'):
-		print '\tlibnotify >= 0.4.1 not found, disabling notifications.'
-		print '\tNote: You might have the lib but not the headers'
-	else:
-		conf.env.Append(CPPDEFINES = 'HAVE_LIBNOTIFY')
-		conf.env.ParseConfig('pkg-config --libs libnotify')
-		if conf.CheckPKG('libnotify >= 0.7'):
-			conf.env.Append(CPPDEFINES = 'HAVE_LIBNOTIFY_0_7')
+	if conf.env.get('libnotify'):
+		if not conf.CheckPKG('libnotify >= 0.4.1'):
+			print '\tlibnotify >= 0.4.1 not found, disabling notifications.'
+			print '\tNote: You might have the lib but not the headers'
+		else:
+			conf.env.Append(CPPDEFINES = 'HAVE_LIBNOTIFY')
+			conf.env.ParseConfig('pkg-config --libs libnotify')
+			if conf.CheckPKG('libnotify >= 0.7'):
+				conf.env.Append(CPPDEFINES = 'HAVE_LIBNOTIFY_0_7')
 
 	conf.CheckBZRRevision()