diff options
author | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-05-07 12:12:16 +0200 |
---|---|---|
committer | Andoni Morales Alastruey <ylatuya@gmail.com> | 2013-05-07 12:12:16 +0200 |
commit | 8e14af2117cea65ec9639784bafcfe2495ef50e8 (patch) | |
tree | c2aafe0bc263e40b5d7d42061c9fceb600fe7acc | |
parent | 4a6b2824cc5e51057632834714895613838acf92 (diff) | |
parent | 7e073c94fac5a67c247a5e2404a1db84725d3794 (diff) |
Merge branch 'gcc-4.7.2'
19 files changed, 140 insertions, 74 deletions
diff --git a/cerbero/bootstrap/windows.py b/cerbero/bootstrap/windows.py index 97a0538..fb66ad2 100644 --- a/cerbero/bootstrap/windows.py +++ b/cerbero/bootstrap/windows.py @@ -28,17 +28,15 @@ from cerbero.utils import shell, _, fix_winpath, to_unixpath, git from cerbero.utils import messages as m # Toolchain +GCC_VERSION = '4.7.2' MINGW_DOWNLOAD_SOURCE = 'http://www.freedesktop.org/software/gstreamer-sdk/'\ 'data/packages/2012.5/windows/toolchain' -MINGW_TARBALL_TPL = "mingw-%s-%s-%s.tar.xz" +MINGW_TARBALL_TPL = "mingw-%s-gcc-%s-%s-%s.tar.xz" # Extra dependencies MINGWGET_DEPS = ['msys-wget'] GNOME_FTP = 'http://ftp.gnome.org/pub/gnome/binaries/win32/' WINDOWS_BIN_DEPS = ['intltool/0.40/intltool_0.40.4-1_win32.zip'] -PTHREADS_URL = \ - 'http://downloads.sourceforge.net/project/mingw-w64/External%20binary%20'\ - 'packages%20%28Win64%20hosted%29/pthreads/pthreads-20100604.zip' class WindowsBootstraper(BootstraperBase): @@ -73,7 +71,6 @@ class WindowsBootstraper(BootstraperBase): # After mingw is beeing installed self.install_bin_deps() self.install_python_sdk() - self.install_pthreads() def check_dirs(self): if not os.path.exists(self.prefix): @@ -83,8 +80,8 @@ class WindowsBootstraper(BootstraperBase): os.makedirs(etc_path) def install_mingw(self): - tarball = MINGW_TARBALL_TPL % (self.version, self.platform, - self.arch) + tarball = MINGW_TARBALL_TPL % (self.version, GCC_VERSION, + self.platform, self.arch) tarfile = os.path.join(self.prefix, tarball) tarfile = to_unixpath(os.path.abspath(tarfile)) @@ -100,17 +97,6 @@ class WindowsBootstraper(BootstraperBase): except Exception: pass - def install_pthreads(self): - pthreadszip = os.path.join(self.prefix, 'pthreads.zip') - shell.download(PTHREADS_URL, pthreadszip) - temp = fix_winpath(os.path.abspath(tempfile.mkdtemp())) - # real pthreads stuff is in a zip file inside the previous zip file - # under mingwxx/pthreads-xx.zip - shell.unpack(pthreadszip, temp) - shell.unpack(os.path.join(temp, 'pthreads-20100604', - 'ming%s' % self.version, 'pthreads-%s.zip' % self.version), - self.prefix) - def install_python_sdk(self): m.action(_("Installing Python headers")) temp = tempfile.mkdtemp() diff --git a/cerbero/build/build.py b/cerbero/build/build.py index 615778f..c911ef8 100644 --- a/cerbero/build/build.py +++ b/cerbero/build/build.py @@ -167,7 +167,8 @@ class MakefilesBase (Build): for var, val in new_env.iteritems(): if val is None: - del os.environ[var] + if var in os.environ: + del os.environ[var] else: os.environ[var] = val return self._old_env @@ -179,7 +180,8 @@ class MakefilesBase (Build): for var, val in old_env.iteritems(): if val is None: - del os.environ[var] + if var in os.environ: + del os.environ[var] else: os.environ[var] = val self._old_env = None diff --git a/cerbero/config.py b/cerbero/config.py index eb3ab7e..eb5f6c2 100644 --- a/cerbero/config.py +++ b/cerbero/config.py @@ -213,6 +213,12 @@ class Config (object): ld_library_path = libdir else: ld_library_path = "" + if self.toolchain_prefix is not None: + ld_library_path = self._join_path(ld_library_path, + os.path.join(self.toolchain_prefix, 'lib')) + includedir = self._join_path(includedir, + os.path.join(self.toolchain_prefix, 'include')) + # Most of these variables are extracted from jhbuild env = {'LD_LIBRARY_PATH': ld_library_path, diff --git a/config/linux.config b/config/linux.config index 3f21097..174a512 100644 --- a/config/linux.config +++ b/config/linux.config @@ -11,8 +11,13 @@ for f in ['CFLAGS', 'CCASFLAGS', 'CXXFLAGS', 'LDFLAGS', 'OBJCFLAGS']: if target_arch == Architecture.X86: arch_flags = ' -m32 ' + _host = 'i686-linux-gnu' else: arch_flags = ' -m64 ' + _host = 'x86_64-linux-gnu' + +if host is None and target_arch != arch: + host = _host os.environ['CFLAGS'] += ' -Wall -g -O2' + arch_flags os.environ['CXXFLAGS'] += ' -Wall -g -O2' + arch_flags diff --git a/packages/gstreamer-networking.package b/packages/gstreamer-networking.package index 55945a0..e640e2d 100644 --- a/packages/gstreamer-networking.package +++ b/packages/gstreamer-networking.package @@ -49,6 +49,7 @@ class Package(package.Package): DistroVersion.UBUNTU_ONEIRIC, DistroVersion.UBUNTU_PRECISE, DistroVersion.UBUNTU_QUANTAL, + DistroVersion.UBUNTU_RARING, DistroVersion.FEDORA_16, DistroVersion.FEDORA_17]: self.files += ['gmp:libs', 'gnutls:libs:libs_extra:lang', diff --git a/recipes/dbus.recipe b/recipes/dbus.recipe index eb057cb..fef7cde 100644 --- a/recipes/dbus.recipe +++ b/recipes/dbus.recipe @@ -18,6 +18,7 @@ class Recipe(recipe.Recipe): version = '1.6.4' # either AFLv2.1 or or GPLv2+ licenses = [License.AFLv2_1] + autoreconf = True deps = ['expat'] configure_options = '--disable-xml-docs --disable-doxygen-docs ' \ '--disable-selinux --disable-libaudit ' \ diff --git a/recipes/glib.recipe b/recipes/glib.recipe index 9baf5f6..5808da5 100644 --- a/recipes/glib.recipe +++ b/recipes/glib.recipe @@ -16,7 +16,7 @@ GLIB_CONFIG_UNVERSAL='''\ class Recipe(recipe.Recipe): name = 'glib' - version = '2.34.2' + version = '2.36.1' licenses = [License.LGPLv2Plus] config_sh = 'sh autogen.sh' deps = ['libffi', 'zlib'] diff --git a/recipes/json-glib.recipe b/recipes/json-glib.recipe index ea40a0d..1fcfd80 100644 --- a/recipes/json-glib.recipe +++ b/recipes/json-glib.recipe @@ -9,3 +9,4 @@ class Recipe(recipe.Recipe): files_libs = ['libjson-glib-1.0'] files_devel = ['include/json-glib-1.0', 'lib/pkgconfig/json-glib-1.0.pc'] + autoreconf = True diff --git a/recipes/binutils.recipe b/recipes/toolchain/binutils.recipe index 186c0c1..2a70033 100644 --- a/recipes/binutils.recipe +++ b/recipes/toolchain/binutils.recipe @@ -3,6 +3,7 @@ class Recipe(recipe.Recipe): version = '2.22' licenses = [License.GPL] configure_options = '--with-sysroot=$CERBERO_PREFIX --disable-multilib' + add_host_build_target = False files_bins = ['addr2line', 'ar', 'as', 'c++filt', 'dlltool', 'dllwrap', 'elfedit', 'gprof', 'ld', 'ld.bfd', 'nm', 'objcopy', @@ -40,6 +41,8 @@ class Recipe(recipe.Recipe): else: self.target = 'x86_64-w64-mingw32' self.configure_options += ' --target=%s' % self.target + if self.config.target_platform == Platform.WINDOWS: + self.configure_options += ' --host=%s' % self.target # Append the host prefix to the binaries self.files_bins = ['%s-%s' % (self.target, x) for x in self.files_bins] diff --git a/recipes/gcc-core.recipe b/recipes/toolchain/gcc-core.recipe index 23aacc4..50d8201 100644 --- a/recipes/gcc-core.recipe +++ b/recipes/toolchain/gcc-core.recipe @@ -1,13 +1,21 @@ +from cerbero.utils import shell + + class Recipe(recipe.Recipe): name = 'gcc-core' - version = '4.6.2' + version = '4.7.2' licenses = [License.GPLv3] - configure_options = '--disable-multilib --enable-fully-dynamic-string '\ - '--with-sysroot=$CERBERO_PREFIX --enable-languages=c,c++' + configure_options = '--disable-multilib --enable-fully-dynamic-string ' \ + '--with-sysroot=$CERBERO_PREFIX ' \ + '--enable-threads=posix ' \ + '--enable-languages=c,c++ ' \ + '--enable-sjlj-exceptions ' \ + '--without-dwarf2 ' make = 'make all-gcc' make_install = 'make install-gcc' use_system_libs = True supports_non_src_build = True + add_host_build_target = False deps = ['mingw-w64-headers', 'gmp', 'mpfr', 'mpc'] new_env = {'CPP': None} @@ -25,13 +33,14 @@ class Recipe(recipe.Recipe): else: self._target = 'x86_64-w64-mingw32' self.configure_options += ' --target=%s' % self._target - self.configure_options += '--oldincludedir=%s/%s/include ' % \ + if self.config.target_platform == Platform.WINDOWS: + self.configure_options += ' --host=%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 def configure(self): - from cerbero.utils import shell # Create the winsup directory if self.config.target_platform == Platform.WINDOWS: winsup = os.path.join(self.build_dir, 'gcc', 'winsup', 'mingw') diff --git a/recipes/gcc.recipe b/recipes/toolchain/gcc.recipe index bb70b07..902de4e 100644 --- a/recipes/gcc.recipe +++ b/recipes/toolchain/gcc.recipe @@ -2,14 +2,14 @@ import shutil class Recipe(recipe.Recipe): name = 'gcc' - version = '4.6.2' + version = '4.7.2' licenses = [License.GPLv3] supports_non_src_build = True stype = SourceType.CUSTOM - deps = ['mingw-w64'] + deps = ['mingw-w64', 'winpthreads'] files_bins = ['gcc', 'cpp', 'gcov', 'jcf-dump', 'c++', 'gcj', 'g++', - 'gcc-4.6.2', 'gfortran'] + 'gcc-4.7.2', 'gfortran'] files_gcc = ['%(host)s/include/c++', '%(host)s/bin/c++%(bext)s', '%(host)s/bin/g++%(bext)s', @@ -45,8 +45,8 @@ class Recipe(recipe.Recipe): '%(host)s/lib/libsupc++.la', 'lib/libiberty.a', ] - files_lib_gcc = ['lib/gcc/%(host)s/4.6.2', - 'libexec/gcc/%(host)s/4.6.2'] + files_lib_gcc = ['lib/gcc/%(host)s/4.7.2', + 'libexec/gcc/%(host)s/4.7.2'] files_lang = ['gcc', 'cpplib'] def configure(self): diff --git a/recipes/toolchain/gendef.recipe b/recipes/toolchain/gendef.recipe new file mode 100644 index 0000000..5ee326c --- /dev/null +++ b/recipes/toolchain/gendef.recipe @@ -0,0 +1,17 @@ +class Recipe(recipe.Recipe): + name = 'gendef' + version = 'v2.0.8' + licenses = [License.LGPL] + srcdir = 'mingw-w64-tools/gendef' + files_bin = ['bin/gendef.exe'] + + + def prepare(self): + self.repo_dir = os.path.join(self.config.local_sources, 'mingw-w64') + self.remotes = {'origin': '%s/%s' % + (self.config.git_root, 'mingw-w64')} + if self.config.target_arch == Architecture.X86: + self.host = 'i686-w64-mingw32' + else: + self.host = 'x86_64-w64-mingw32' + self.configure_options += ' --host=%s' % self.host diff --git a/recipes/mingw-w64-headers.recipe b/recipes/toolchain/mingw-w64-headers.recipe index 1e07c3e..965a037 100644 --- a/recipes/mingw-w64-headers.recipe +++ b/recipes/toolchain/mingw-w64-headers.recipe @@ -1,9 +1,9 @@ class Recipe(recipe.Recipe): name = 'mingw-w64-headers' - version = 'v2.0.2' + version = 'v2.0.8' licenses = [License.LGPL] srcdir = 'mingw-w64-headers' - add_host_build_target = True + add_host_build_target = False def prepare(self): self.remotes = {'origin': '%s/%s' % @@ -26,15 +26,10 @@ class Recipe(recipe.Recipe): hostdir = os.path.join(self.host) mingwdir = os.path.join('mingw') - if not os.path.exists(mingwdir): + if not os.path.exists(os.path.join(self.config.prefix, mingwdir)): shell.call('ln -s %s %s' % (hostdir, mingwdir), cmd_dir=self.config.prefix, fail=False, ) - # Create link lib32 -> lib - libdir = os.path.join(hostdir, lib) - archlibdir = os.path.join(hostdir, lib) - shell.call('ln -s %s %s' % (libdir, archlibdir), fail=False) - # Install DirectX headers directx_headers = os.path.join(self.config.prefix, self.host, 'include', 'directx') if not os.path.exists(directx_headers): diff --git a/recipes/mingw-w64.recipe b/recipes/toolchain/mingw-w64.recipe index 4c7b998..3cb9de3 100644 --- a/recipes/mingw-w64.recipe +++ b/recipes/toolchain/mingw-w64.recipe @@ -1,8 +1,8 @@ class Recipe(recipe.Recipe): name = 'mingw-w64' - version = 'v2.0.2' + version = 'v2.0.8' licenses = [License.LGPL] - configure_options = '--without-headers --with-tools=gendef '\ + configure_options = '--without-headers '\ '--with-sysroot=$CERBERO_PREFIX ' add_host_build_target = False deps = ['mingw-w64-headers', 'binutils', 'gcc-core'] @@ -10,14 +10,15 @@ class Recipe(recipe.Recipe): def prepare(self): if self.config.target_arch == Architecture.X86: host = 'i686-w64-mingw32' + self.configure_options += ' --disable-lib64 ' else: host = 'x86_64-w64-mingw32' + self.configure_options += ' --disable-lib32 ' self.configure_options += ' --host=%s' % host files = ['%s/lib/%s' % (host, x) for x in self.files_crt] files.extend(['%s/lib/%s' % ('mingw', x) for x in self.files_crt]) self.files_crt = files - files_gendef = ['bin/gendef.exe'] files_crt = [ 'CRT_fp10.o', 'CRT_fp8.o', 'CRT_glob.o', 'CRT_noglob.o', 'binmode.o', 'crt1.o', 'crt1u.o', 'crt2.o', 'crt2u.o', 'crtbegin.o', 'crtend.o', 'dllcrt1.o', diff --git a/recipes/mpc.recipe b/recipes/toolchain/mpc.recipe index eb0463a..eb0463a 100644 --- a/recipes/mpc.recipe +++ b/recipes/toolchain/mpc.recipe diff --git a/recipes/mpfr.recipe b/recipes/toolchain/mpfr.recipe index 32f4cb8..32f4cb8 100644 --- a/recipes/mpfr.recipe +++ b/recipes/toolchain/mpfr.recipe diff --git a/recipes/toolchain/winpthreads.recipe b/recipes/toolchain/winpthreads.recipe new file mode 100644 index 0000000..5623e93 --- /dev/null +++ b/recipes/toolchain/winpthreads.recipe @@ -0,0 +1,34 @@ +class Recipe(recipe.Recipe): + name = 'winpthreads' + version = 'v2.0.8' + licenses = [License.LGPL] + srcdir = 'mingw-w64-libraries/winpthreads' + configure_options = '--enable-shared --enable-static ' + add_host_build_target = False + autoreconf = True + allow_parallel_build = False + files_all = [ + 'bin/libwinpthread-1.dll', + 'lib/libpthread.a', + 'lib/libpthread.dll.a', + 'lib/libwinpthread.a', + 'lib/libwinpthread.dll.a', + 'lib/libwinpthread.la', + 'include/pthread.h', + 'include/pthread_compat.h', + 'include/pthread_time.h', + 'include/pthread_unistd.h', + 'include/sched.h', + 'include/semaphore.h', + ] + + + def prepare(self): + self.repo_dir = os.path.join(self.config.local_sources, 'mingw-w64') + self.remotes = {'origin': '%s/%s' % + (self.config.git_root, 'mingw-w64')} + if self.config.target_arch == Architecture.X86: + self.host = 'i686-w64-mingw32' + else: + self.host = 'x86_64-w64-mingw32' + self.configure_options += ' --host=%s' % self.host diff --git a/recipes/winpthreads.recipe b/recipes/winpthreads.recipe deleted file mode 100644 index eeb102c..0000000 --- a/recipes/winpthreads.recipe +++ /dev/null @@ -1,32 +0,0 @@ -# -*- Mode: Python -*- vi:si:et:sw=4:sts=4:ts=4:syntax=python - - -class Recipe(recipe.Recipe): - name = 'winpthreads' - version = '20100604' - licenses = [License.LGPL] - btype = BuildType.CUSTOM - stype = SourceType.CUSTOM - - files_libs = [] - files_devel = ['include/pthread.h', 'include/pthreads_win32_config.h', - 'include/sched.h', 'include/semaphore.h'] - - def prepare(self): - if self.config.target_platform != Platform.WINDOWS: - raise InvalidRecipeError() - - if self.config.target_arch == Architecture.X86: - self.libname = 'pthreadGC2-w32' - if self.config.target_arch == Architecture.X86_64: - self.libname = 'pthreadGC2-w64' - self.dllname = self.libname + '.dll' - self.files_libs = [self.libname] - - def install(self): - import shutil - shutil.copy(os.path.join(self.config.toolchain_prefix, 'bin', self.dllname), - os.path.join(self.config.prefix, 'bin', self.dllname)) - for f in self.files_devel: - shutil.copy(os.path.join(self.config.toolchain_prefix, self.config.host, f), - os.path.join(self.config.prefix, f)) diff --git a/tools/build-toolchains.sh b/tools/build-toolchains.sh new file mode 100644 index 0000000..aee0f30 --- /dev/null +++ b/tools/build-toolchains.sh @@ -0,0 +1,37 @@ +#! /bin/sh +# Build the Windows cross and native toolchains for x86 and x86_64 + +WIPE=$1 +CURDIR=`pwd` +set -e + +for a in "w64" "w32" +do + for p in "lin" "win" + do + echo "Building $p-$a toolchain" + if test "x$WIPE" = "x1"; then + ./cerbero-uninstalled -c config/mingw-$a-$p.cbc wipe --force + fi + ./cerbero-uninstalled -c config/mingw-$a-$p.cbc build toolchain + + + if test "x$a" = "xw64"; then + ARCH=x86_64 + else + ARCH=x86 + fi + if test "x$p" = "xwin"; then + PLAT=windows + else + PLAT=linux + fi + TC=mingw-$a-gcc-4.7.2-$PLAT-$ARCH.tar.xz + echo "Creating tarball $TC" + cd ~/mingw/$PLAT/$a + XZ_OPT=-9 tar cJf $CURDIR/$TC * + cd $CURDIR + md5sum $TC | awk '{print $1}' > $TC.md5 + sha1sum $TC | awk '{print $1}' > $TC.sha1 + done +done |