diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-04-29 01:14:23 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-05-06 16:03:09 +0200 |
commit | 6c2a9a4145ec120c8d86ab42701a00ceb3d254b7 (patch) | |
tree | 771bc1ab0a09b559e8fd7272e891adda13b132ee /recipes/toolchain/gcc.recipe | |
parent | f624a90b19c91bd4eef7ae019aca0208af5df670 (diff) |
toolchain: move recipes to the toolchain folder
Diffstat (limited to 'recipes/toolchain/gcc.recipe')
-rw-r--r-- | recipes/toolchain/gcc.recipe | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/recipes/toolchain/gcc.recipe b/recipes/toolchain/gcc.recipe new file mode 100644 index 00000000..902de4e4 --- /dev/null +++ b/recipes/toolchain/gcc.recipe @@ -0,0 +1,81 @@ +import shutil + +class Recipe(recipe.Recipe): + name = 'gcc' + version = '4.7.2' + licenses = [License.GPLv3] + supports_non_src_build = True + stype = SourceType.CUSTOM + deps = ['mingw-w64', 'winpthreads'] + + files_bins = ['gcc', 'cpp', 'gcov', 'jcf-dump', 'c++', 'gcj', 'g++', + 'gcc-4.7.2', 'gfortran'] + files_gcc = ['%(host)s/include/c++', + '%(host)s/bin/c++%(bext)s', + '%(host)s/bin/g++%(bext)s', + '%(host)s/bin/gfortran%(bext)s', + '%(host)s/bin/gcc%(bext)s', + '%(host)s/lib/libobjc.a', + '%(host)s/lib/libobjc-3.dll', + '%(host)s/lib/libquadmath-0.dll', + '%(host)s/lib/libssp.a', + '%(host)s/lib/libquadmath.dll.a', + '%(host)s/lib/libgfortran-3.dll', + '%(host)s/lib/libgfortran.dll.a', + '%(host)s/lib/libgfortran.la', + '%(host)s/lib/libstdc++.dll.a-gdb.py', + '%(host)s/lib/libssp.la', + '%(host)s/lib/libobjc.la', + '%(host)s/lib/libssp.dll.a', + '%(host)s/lib/libssp_nonshared.a', + '%(host)s/lib/libgcc_s_sjlj-1.dll', + '%(host)s/lib/libstdc++-6.dll', + '%(host)s/lib/libgfortran.spec', + '%(host)s/lib/libstdc++.dll.a', + '%(host)s/lib/libstdc++.a', + '%(host)s/lib/libquadmath.a', + '%(host)s/lib/libsupc++.a', + '%(host)s/lib/libssp-0.dll', + '%(host)s/lib/libssp_nonshared.la', + '%(host)s/lib/libquadmath.la', + '%(host)s/lib/libgfortran.a', + '%(host)s/lib/libgcc_s.a', + '%(host)s/lib/libstdc++.la', + '%(host)s/lib/libobjc.dll.a', + '%(host)s/lib/libsupc++.la', + 'lib/libiberty.a', + ] + files_lib_gcc = ['lib/gcc/%(host)s/4.7.2', + 'libexec/gcc/%(host)s/4.7.2'] + files_lang = ['gcc', 'cpplib'] + + def configure(self): + pass + def do_make(self): + pass + + def prepare(self): + self._remove_steps([BuildSteps.CONFIGURE]) + if self.config.target_arch == Architecture.X86: + self._host = 'i686-w64-mingw32' + else: + self._host = 'x86_64-w64-mingw32' + # Append the host prefix to the binaries + self.files_bins = ['%s-%s' % (self._host, x) for x in self.files_bins] + # Replace host in files + files = [x % {'host': self._host, 'bext': '%(bext)s'} for x in self.files_gcc] + # Add mingw symlink files + files.extend([x % {'host': 'mingw', 'bext': '%(bext)s'} for x in self.files_gcc]) + self.files_gcc = files + # Replace host in lib/gcc and libexec/gcc + self.files_lib_gcc = [x % {'host': self._host} for x in self.files_lib_gcc] + # Add mingw symlink files + self.files_lib_gcc.extend([x % {'host': 'mingw'} for x in self.files_lib_gcc]) + + def post_install(self): + if self.config.target_platform == Platform.WINDOWS: + cpp = os.path.join(self.config.prefix, 'bin', 'cpp.exe') + prefixed_cpp = os.path.join(self.config.prefix, 'bin', '%s-cpp.exe' % self._host) + if os.path.exists(prefixed_cpp): + os.remove(prefixed_cpp) + shutil.move(cpp, prefixed_cpp) |