Changeset View
Changeset View
Standalone View
Standalone View
bin/BuildSystem/AutoToolsBuildSystem.py
1 | # -*- coding: utf-8 -*- | 1 | # -*- coding: utf-8 -*- | ||
---|---|---|---|---|---|
2 | # definitions for the autotools build system | 2 | # definitions for the autotools build system | ||
3 | 3 | | |||
4 | import os | 4 | import os | ||
5 | 5 | | |||
6 | import utils | 6 | import utils | ||
7 | from shells import * | 7 | from shells import * | ||
8 | from BuildSystem.BuildSystemBase import * | 8 | from BuildSystem.BuildSystemBase import * | ||
9 | 9 | | |||
10 | 10 | | |||
11 | class AutoToolsBuildSystem(BuildSystemBase): | 11 | class AutoToolsBuildSystem(BuildSystemBase): | ||
12 | def __init__( self ): | 12 | def __init__( self ): | ||
13 | BuildSystemBase.__init__(self, "autotools") | 13 | BuildSystemBase.__init__(self, "autotools") | ||
14 | self._shell = MSysShell() | 14 | self._shell = MSysShell() | ||
15 | if compiler.isX86(): | 15 | if craftCompiler.isX86(): | ||
16 | self.platform = "--host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 " | 16 | self.platform = "--host=i686-w64-mingw32 --build=i686-w64-mingw32 --target=i686-w64-mingw32 " | ||
17 | else: | 17 | else: | ||
18 | self.platform = "--host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 " | 18 | self.platform = "--host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 " | ||
19 | 19 | | |||
20 | @property | 20 | @property | ||
21 | def makeProgram(self): | 21 | def makeProgram(self): | ||
22 | make = "make " | 22 | make = "make " | ||
23 | if self.subinfo.options.make.supportsMultijob and not compiler.isMSVC(): | 23 | if self.subinfo.options.make.supportsMultijob and not craftCompiler.isMSVC(): | ||
24 | make += " -j%s" % os.getenv("NUMBER_OF_PROCESSORS") | 24 | make += " -j%s" % os.getenv("NUMBER_OF_PROCESSORS") | ||
25 | return make | 25 | return make | ||
26 | 26 | | |||
27 | #make sure shell cant be overwritten | 27 | #make sure shell cant be overwritten | ||
28 | @property | 28 | @property | ||
29 | def shell(self): | 29 | def shell(self): | ||
30 | return self._shell | 30 | return self._shell | ||
31 | 31 | | |||
32 | def configureDefaultDefines( self ): | 32 | def configureDefaultDefines( self ): | ||
33 | 33 | | |||
34 | """defining the default cmake cmd line""" | 34 | """defining the default cmake cmd line""" | ||
35 | return "" | 35 | return "" | ||
36 | 36 | | |||
37 | def configure( self ): | 37 | def configure( self ): | ||
38 | """configure the target""" | 38 | """configure the target""" | ||
39 | if not self.subinfo.options.useShadowBuild: | 39 | if not self.subinfo.options.useShadowBuild: | ||
40 | self.enterSourceDir() | 40 | self.enterSourceDir() | ||
41 | else: | 41 | else: | ||
42 | self.enterBuildDir() | 42 | self.enterBuildDir() | ||
43 | 43 | | |||
44 | configure = os.path.join(self.sourceDir(), "configure") | 44 | configure = os.path.join(self.sourceDir(), "configure") | ||
45 | self.shell.environment[ "CFLAGS" ] = self.subinfo.options.configure.cflags + self.shell.environment[ "CFLAGS" ] | 45 | self.shell.environment[ "CFLAGS" ] = self.subinfo.options.configure.cflags + self.shell.environment[ "CFLAGS" ] | ||
46 | self.shell.environment[ "CXXFLAGS" ] = self.subinfo.options.configure.cxxflags + self.shell.environment[ "CXXFLAGS" ] | 46 | self.shell.environment[ "CXXFLAGS" ] = self.subinfo.options.configure.cxxflags + self.shell.environment[ "CXXFLAGS" ] | ||
47 | self.shell.environment[ "LDFLAGS" ] = self.subinfo.options.configure.ldflags + self.shell.environment[ "LDFLAGS" ] | 47 | self.shell.environment[ "LDFLAGS" ] = self.subinfo.options.configure.ldflags + self.shell.environment[ "LDFLAGS" ] | ||
48 | if compiler.isMSVC() or self.subinfo.options.configure.bootstrap == True: | 48 | if craftCompiler.isMSVC() or self.subinfo.options.configure.bootstrap == True: | ||
49 | autogen = os.path.join(self.sourceDir(), "autogen.sh") | 49 | autogen = os.path.join(self.sourceDir(), "autogen.sh") | ||
50 | if os.path.exists(autogen): | 50 | if os.path.exists(autogen): | ||
51 | self.shell.execute(self.sourceDir(), autogen) | 51 | self.shell.execute(self.sourceDir(), autogen) | ||
52 | else: | 52 | else: | ||
53 | self.shell.execute(self.sourceDir(), "autoreconf -f -i") | 53 | self.shell.execute(self.sourceDir(), "autoreconf -f -i") | ||
54 | 54 | | |||
55 | 55 | | |||
56 | if not self.subinfo.options.useShadowBuild: | 56 | if not self.subinfo.options.useShadowBuild: | ||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |