summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndoni Morales Alastruey <ylatuya@gmail.com>2012-05-03 17:26:38 +0200
committerAndoni Morales Alastruey <ylatuya@gmail.com>2012-11-21 14:41:55 +0100
commita4acba0582549548c4137ba5e5e1c09df1c9aefb (patch)
treea4019242b48396c377fed1974a3fdde59642f920
parent93229540713e6205293e67d4147b0d8e0c180f7b (diff)
Fix recipes for the mingw-w64 toolchain
Add confoguration files for compiling the mingw-w64 toolchain too.
-rw-r--r--config/mingw-w32-lin.cbc7
-rw-r--r--config/mingw-w32-win.cbc11
-rw-r--r--config/mingw-w64-lin.cbc7
-rw-r--r--config/mingw-w64-win.cbc11
-rw-r--r--recipes/gcc-core.recipe18
-rw-r--r--recipes/gmp.recipe2
-rw-r--r--recipes/mingw-w64.recipe5
7 files changed, 54 insertions, 7 deletions
diff --git a/config/mingw-w32-lin.cbc b/config/mingw-w32-lin.cbc
new file mode 100644
index 0000000..aa4e1cd
--- /dev/null
+++ b/config/mingw-w32-lin.cbc
@@ -0,0 +1,7 @@
+import os
+from cerbero.config import Platform, Architecture, Distro, DistroVersion
+
+target_arch=Architecture.X86
+cache_file='mingw-w32-lin'
+prefix=os.path.expanduser('~/mingw/linux/w32')
+sources=os.path.expanduser('~/cerbero/sources/mingw-w32-lin')
diff --git a/config/mingw-w32-win.cbc b/config/mingw-w32-win.cbc
new file mode 100644
index 0000000..b88fb24
--- /dev/null
+++ b/config/mingw-w32-win.cbc
@@ -0,0 +1,11 @@
+import os
+from cerbero.config import Platform, Architecture, Distro, DistroVersion
+
+target_platform=Platform.WINDOWS
+target_distro=Distro.WINDOWS
+target_distro_version=DistroVersion.WINDOWS_7
+target_arch=Architecture.X86
+cache_file='mingw-w32-win'
+prefix=os.path.expanduser('~/mingw/windows/w32')
+sources=os.path.expanduser('~/cerbero/sources/mingw-w32-win')
+toolchain_prefix=os.path.expanduser('~/mingw/linux/w32/')
diff --git a/config/mingw-w64-lin.cbc b/config/mingw-w64-lin.cbc
new file mode 100644
index 0000000..c05b3e9
--- /dev/null
+++ b/config/mingw-w64-lin.cbc
@@ -0,0 +1,7 @@
+import os
+from cerbero.config import Platform, Architecture, Distro, DistroVersion
+
+target_arch=Architecture.X86_64
+cache_file='mingw-w64-lin'
+prefix=os.path.expanduser('~/mingw/linux/w64')
+sources=os.path.expanduser('~/cerbero/sources/mingw-w64-lin')
diff --git a/config/mingw-w64-win.cbc b/config/mingw-w64-win.cbc
new file mode 100644
index 0000000..1735605
--- /dev/null
+++ b/config/mingw-w64-win.cbc
@@ -0,0 +1,11 @@
+import os
+from cerbero.config import Platform, Architecture, Distro, DistroVersion
+
+target_platform=Platform.WINDOWS
+target_distro=Distro.WINDOWS
+target_distro_version=DistroVersion.WINDOWS_7
+target_arch=Architecture.X86_64
+cache_file='mingw-w64-win'
+prefix=os.path.expanduser('~/mingw/windows/w64')
+sources=os.path.expanduser('~/cerbero/sources/mingw-w64-win')
+toolchain_prefix=os.path.expanduser('~/mingw/linux/w64/')
diff --git a/recipes/gcc-core.recipe b/recipes/gcc-core.recipe
index 0b5b391..6ad33cc 100644
--- a/recipes/gcc-core.recipe
+++ b/recipes/gcc-core.recipe
@@ -2,12 +2,14 @@ class Recipe(recipe.Recipe):
name = 'gcc-core'
version = '4.6.2'
licenses = [License.GPLv3]
- configure_options = '--disable-multilib --enable-fully-dynamic-string'
+ configure_options = '--disable-multilib --enable-fully-dynamic-string '\
+ '--with-sysroot=$CERBERO_PREFIX '
make = 'make all-gcc'
make_install = 'make install-gcc'
use_system_libs = True
supports_non_src_build = True
deps = ['mingw-w64-headers', 'gmp', 'mpfr', 'mpc']
+ new_env = {'CPP': None}
def prepare(self):
self.remotes = {'origin': '%s/%s' %
@@ -19,10 +21,12 @@ class Recipe(recipe.Recipe):
self.srcdir))
if self.config.target_arch == Architecture.X86:
- target = 'i686-w64-mingw32'
+ self._target = 'i686-w64-mingw32'
else:
- target = 'x86_64-w64-mingw32'
- self.configure_options += ' --target=%s' % target
+ self._target = 'x86_64-w64-mingw32'
+ self.configure_options += ' --target=%s' % self._target
+ self.configure_options += '--oldincludedir=%s/%s/include ' % \
+ (self.config.prefix, self._target)
if self.config.target_platform == Platform.WINDOWS:
self.allow_parallel_build = False
@@ -36,4 +40,10 @@ class Recipe(recipe.Recipe):
shell.call('ln -s %s/%s/include include' %
(self.config.toolchain_prefix, self.config.host), winsup,
fail=False)
+ try:
+ shell.call('ln -s %s %s' % (
+ os.path.join(self.config.prefix, 'bin', 'cpp.exe'),
+ os.path.join(self.config.prefix, 'bin', '%s-cpp.exe' % self._target)))
+ except:
+ pass
super(Recipe, self).configure()
diff --git a/recipes/gmp.recipe b/recipes/gmp.recipe
index c0b4376..0f3f036 100644
--- a/recipes/gmp.recipe
+++ b/recipes/gmp.recipe
@@ -16,4 +16,4 @@ class Recipe(recipe.Recipe):
# On windows this project cannot build a static and a shared library at
# the same time, so we need to force the build of shared libraries
if self.config.target_platform == Platform.WINDOWS:
- self.configure_options += '--enable-cxx --disable-static --enable-shared'
+ self.configure_options += '--enable-cxx --build=x86_64-pc-linux --disable-static --enable-shared'
diff --git a/recipes/mingw-w64.recipe b/recipes/mingw-w64.recipe
index 848b417..4c7b998 100644
--- a/recipes/mingw-w64.recipe
+++ b/recipes/mingw-w64.recipe
@@ -2,8 +2,9 @@ class Recipe(recipe.Recipe):
name = 'mingw-w64'
version = 'v2.0.2'
licenses = [License.LGPL]
- configure_options = '--without-headers --with-tools=gendef --with-sysroot=$CERBERO_PREFIX'
- add_host_build_target = True
+ configure_options = '--without-headers --with-tools=gendef '\
+ '--with-sysroot=$CERBERO_PREFIX '
+ add_host_build_target = False
deps = ['mingw-w64-headers', 'binutils', 'gcc-core']
def prepare(self):