summaryrefslogtreecommitdiff
path: root/lang/tolua++/files/patch-SConstruct
blob: 7725f9021c2c35d944c72a64a8a61626659669f6 (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
--- SConstruct.orig	2008-04-21 00:05:35 UTC
+++ SConstruct
@@ -7,21 +7,22 @@ if os.name == 'nt':
 
 env = Environment(tools = tools)
 
-options_file = None
+variables_file = None
 if sys.platform == 'linux2':
-	options_file = "linux"
+	variables_file = "linux"
 
 elif 'msvc' in env['TOOLS']:
-	options_file = "msvc"
+	variables_file = "msvc"
 else:
-	options_file = "posix"
+	variables_file = "posix"
 
-opts = Options(["config_"+options_file+".py", "custom.py", "custom_"+options_file+".py"], ARGUMENTS)
+opts = Variables(["config_"+variables_file+".py", "custom.py", "custom_"+variables_file+".py"], ARGUMENTS)
 opts.Add('CC', 'The C compiler.')
 opts.Add('CXX', 'The C++ compiler (for the tests)')
 opts.Add('CCFLAGS', 'Flags for the compiler.', ['-O2', '-Wall'])
 opts.Add('LINK', 'The linker.')
 opts.Add('LINKFLAGS', 'Linker flags.', [])
+opts.Add('SONAME', 'Shared library name.')
 opts.Add('no_cygwin', 'Use -mno-cygwin to build using the mingw compiler on cygwin', 0)
 opts.Add('LIBS', 'libraries', [])
 opts.Add('LIBPATH', 'library path', [])
@@ -65,7 +66,7 @@ def pkg_scan_dep(self, target, source):
 	## TODO: detectar si el archivo existe antes de abrirlo asi nomas
 	pkg = open(source, "rt")
 
-	for linea in pkg.xreadlines():
+	for linea in pkg:
 		dep = re.search("^[\t\w]*\$[cphl]file\s*\"([^\"]+)\"", linea)
 		if dep:
 			self.Depends(target, '#' + dep.groups()[0]);
@@ -145,7 +146,9 @@ Files will be installed on <prefix>/bin, <prefix>/lib 
 ########### end of helper builders
 
 env['CPPPATH'] = '#/include'
-env['LIBPATH'] =  ['#/lib'] + env['LIBPATH']
+env['LIBPATH'] =  ['#/lib'] + env['LIBPATH'].split(" ")
+
+env.Append(SHLINKFLAGS=' -Wl,-soname='+env['SONAME'])
 
 if env['no_cygwin']: