diff options
author | Chris Johns <chrisj@rtems.org> | 2014-04-08 15:11:00 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2014-04-08 15:11:00 +1000 |
commit | f3b549010d814fa5b2404042a687053c575884ac (patch) | |
tree | 2dc7497db20e3700fcdd9939844c23c474b51a3b | |
parent | doc: Updated after GSoC student feedback. (diff) | |
download | rtems-source-builder-f3b549010d814fa5b2404042a687053c575884ac.tar.bz2 |
config,sb: Qemu build updates for FreeBSD and the start of MinG32.
Hack round the FreeBSD iconv support in Freebsd 10. In 10 libc now
supports iconv however iconv.h is present under /usr/local.
Start to add support to build qemu for MinGW via a Cxc. This is a
work in progress and contains lots of hidden traps.
In config.py separate out of the canadian build status.
-rw-r--r-- | bare/config/devel/libiconv-1.14-1.cfg | 20 | ||||
-rw-r--r-- | bare/config/devel/qemu-git-1.cfg | 2 | ||||
-rw-r--r-- | bare/config/devel/qemu.bset | 1 | ||||
-rw-r--r-- | source-builder/config/gettext-0-1.cfg | 7 | ||||
-rw-r--r-- | source-builder/config/glib-2-1.cfg | 2 | ||||
-rw-r--r-- | source-builder/config/libiconv-1-1.cfg | 79 | ||||
-rw-r--r-- | source-builder/config/pixman-0-1.cfg | 3 | ||||
-rw-r--r-- | source-builder/config/qemu-1-1.cfg | 8 | ||||
-rwxr-xr-x | source-builder/mingw32-pkg-config | 3 | ||||
-rwxr-xr-x | source-builder/pkg-config | 36 | ||||
-rw-r--r-- | source-builder/sb/config.py | 60 | ||||
-rw-r--r-- | source-builder/sb/freebsd.py | 7 | ||||
-rwxr-xr-x | source-builder/sb/pkgconfig.py | 24 |
13 files changed, 198 insertions, 54 deletions
diff --git a/bare/config/devel/libiconv-1.14-1.cfg b/bare/config/devel/libiconv-1.14-1.cfg new file mode 100644 index 0000000..d82146f --- /dev/null +++ b/bare/config/devel/libiconv-1.14-1.cfg @@ -0,0 +1,20 @@ +# +# Libiconv +# + +%if %{release} == %{nil} +%define release 1 +%endif + +%include %{_configdir}/base.cfg + +%define libiconv_version 1.14 + +# +# The Libiconv build instructions. We use 0.x.x Release 1. +# +%if %{_host} == mingw32 + %ifn %{check iconv >= %{libiconv_version}} + %include %{_configdir}/libiconv-1-1.cfg + %endif +%endif diff --git a/bare/config/devel/qemu-git-1.cfg b/bare/config/devel/qemu-git-1.cfg index a191e04..da5763c 100644 --- a/bare/config/devel/qemu-git-1.cfg +++ b/bare/config/devel/qemu-git-1.cfg @@ -23,6 +23,8 @@ Source0: git://git.qemu-project.org/qemu.git?pull?checkout=%{qemu_version}?submo # Patch0: pw://patchwork.ozlabs.org/patch/318435/raw/PULL-29-29-arm-zynq-Add-software-system-reset-via-SCLR.patch +Patch5: pw://patchwork.ozlabs.org/patch/99999999/raw/qemu-channel-win32-cdecls.patch + # # The Qemu build instructions. We use 1.x.x Release 1. # diff --git a/bare/config/devel/qemu.bset b/bare/config/devel/qemu.bset index 3f50242..e15339d 100644 --- a/bare/config/devel/qemu.bset +++ b/bare/config/devel/qemu.bset @@ -11,6 +11,7 @@ %define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN} devel/autotools-internal +devel/libiconv-1.14-1 devel/gettext-0.18.3.1-1 devel/libffi-3.0.13-1 devel/pixman-0.32.4-1 diff --git a/source-builder/config/gettext-0-1.cfg b/source-builder/config/gettext-0-1.cfg index 49940e3..9e241cb 100644 --- a/source-builder/config/gettext-0-1.cfg +++ b/source-builder/config/gettext-0-1.cfg @@ -22,6 +22,13 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz # +# Fix the mess iconv is on FreeBSD 10.0. +# +%if %{defined iconv_optincludes} + %define optincludes %{iconv_optincludes} +%endif + +# # Prepare the source code. # %prep diff --git a/source-builder/config/glib-2-1.cfg b/source-builder/config/glib-2-1.cfg index 5b2e5b9..296d24d 100644 --- a/source-builder/config/glib-2-1.cfg +++ b/source-builder/config/glib-2-1.cfg @@ -54,7 +54,7 @@ Source0: http://ftp.gnome.org/pub/gnome/sources/glib/%{glib_version_major}/glib- SYSROOT=$SB_TMPPREFIX - PKG_CONFIG_PATH=$SYSROOT \ + PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \ PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \ %{_ld_library_path}=$SYSROOT/lib \ ../${source_dir_0}/configure \ diff --git a/source-builder/config/libiconv-1-1.cfg b/source-builder/config/libiconv-1-1.cfg new file mode 100644 index 0000000..e8d5d3d --- /dev/null +++ b/source-builder/config/libiconv-1-1.cfg @@ -0,0 +1,79 @@ +# +# Libiconv 1.x.x Version 1. +# +# This configuration file configure's, make's and install's libiconv. +# + +%if %{release} == %{nil} +%define release 1 +%endif + +Name: libiconv-%{libiconv_version}-%{_host}-%{release} +Summary: Provides an iconv() implementation, for use on systems which + do not have one, or whose implementation cannot convert from/to + Unicode. +Version: %{libiconv_version} +Release: %{release} +URL: http://www.gnu.org/software/libiconv/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +Source0: http://ftp.gnu.org/pub/gnu/libiconv/libiconv-%{libiconv_version}.tar.gz + +# +# Prepare the source code. +# +%prep + build_top=$(pwd) + + source_dir_0="libiconv-%{libiconv_version}" + %setup -q -n libiconv-%{libiconv_version} + %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}} + %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}} + %{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}} + %{?patch3:%patch3 %{?patch3_opts:%{patch3_opts}}%{!?patch3_opts:-p1}} + %{?patch4:%patch4 %{?patch4_opts:%{patch4_opts}}%{!?patch4_opts:-p1}} + %{?patch5:%patch5 %{?patch5_opts:%{patch5_opts}}%{!?patch5_opts:-p1}} + %{?patch6:%patch6 %{?patch6_opts:%{patch6_opts}}%{!?patch6_opts:-p1}} + %{?patch7:%patch7 %{?patch7_opts:%{patch7_opts}}%{!?patch7_opts:-p1}} + %{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}} + %{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}} + + cd ${build_top} + +%build + build_top=$(pwd) + + %{build_directory} + + mkdir -p ${build_dir} + cd ${build_dir} + + %{host_build_flags} + + ../${source_dir_0}/configure \ + --prefix=%{_prefix} \ + --bindir=%{_bindir} \ + --exec_prefix=%{_exec_prefix} \ + --includedir=%{_includedir} \ + --libdir=%{_libdir} \ + --libexecdir=%{_libexecdir} \ + --mandir=%{_mandir} \ + --infodir=%{_infodir} \ + --datadir=%{_datadir} \ + --build=%{_build} --host=%{_host} + + %{__make} %{?_smp_mflags} all + + cd ${build_top} + +%install + build_top=$(pwd) + + %{__rmdir} $SB_BUILD_ROOT + + cd ${build_dir} + %{__make} DESTDIR=$SB_BUILD_ROOT install + cd ${build_top} diff --git a/source-builder/config/pixman-0-1.cfg b/source-builder/config/pixman-0-1.cfg index 56ab6bf..552df25 100644 --- a/source-builder/config/pixman-0-1.cfg +++ b/source-builder/config/pixman-0-1.cfg @@ -64,7 +64,8 @@ Source0: http://cairographics.org/releases/pixman-%{pixman_version}.tar.gz --infodir=%{_infodir} \ --datadir=%{_datadir} \ --build=%{_build} --host=%{_host} \ - --disable-gtk + --disable-gtk \ + --disable-libpng %{__make} %{?_smp_mflags} all diff --git a/source-builder/config/qemu-1-1.cfg b/source-builder/config/qemu-1-1.cfg index b671c9e..43c1069 100644 --- a/source-builder/config/qemu-1-1.cfg +++ b/source-builder/config/qemu-1-1.cfg @@ -51,14 +51,20 @@ Source0: http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2 %{host_build_flags} + if test "%{_build}" != "%{_host}" ; then + CROSS_PREFIX_OPTION="--cross-prefix=%{_host}-" + fi + SYSROOT=$SB_TMPPREFIX - PKG_CONFIG_PATH=$SYSROOT \ + PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \ PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \ %{_ld_library_path}=$SYSROOT/lib \ LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib" \ ../${source_dir_0}/configure \ --prefix=%{_prefix} \ + ${CROSS_PREFIX_OPTION} \ + --make=%{__make} \ --disable-werror \ --disable-tools \ --disable-pie \ diff --git a/source-builder/mingw32-pkg-config b/source-builder/mingw32-pkg-config new file mode 100755 index 0000000..111f806 --- /dev/null +++ b/source-builder/mingw32-pkg-config @@ -0,0 +1,3 @@ +#! /bin/sh +base=$(dirname $0) +exec ${base}/pkg-config --dont-define-prefix $* diff --git a/source-builder/pkg-config b/source-builder/pkg-config index 5606f4d..330853e 100755 --- a/source-builder/pkg-config +++ b/source-builder/pkg-config @@ -83,12 +83,12 @@ def log(s, lf = True): print s, print >> out, s, -def _check_package(lib_check, args): +def _check_package(libraries, args): ec = 1 pkg = None flags = { 'cflags': '', 'libs': '' } - libs = pkgconfig.package.splitter(lib_check) + libs = pkgconfig.package.splitter(libraries) for lib in libs: log('pkg: %s' % (lib)) pkg = pkgconfig.package(lib[0], prefix = args.prefix, output = log, src = src) @@ -213,6 +213,9 @@ def run(argv): (args.max_version and (args.exists or args.exact_version)): raise error('only one of --exists, --exact-version, or --max-version') + if args.dont_define_prefix: + args.prefix = pkgconfig.default_prefix(False) + exists = False ec = 1 @@ -220,21 +223,20 @@ def run(argv): if args.atleast_pkgconfig_version: ec = 0 else: - for lib in args.libraries: - ec, pkg, flags = _check_package(lib, args) - if ec == 0: - if args.cflags: - if len(flags['cflags']): - print flags['cflags'] - log('cflags: %s' % (flags['cflags'])) - else: - log('cflags: empty') - if args.libs: - if len(flags['libs']): - print flags['libs'] - log('libs: %s' % (flags['libs'])) - else: - log('libs: empty') + ec, pkg, flags = _check_package(args.libraries, args) + if ec == 0: + if args.cflags: + if len(flags['cflags']): + print flags['cflags'] + log('cflags: %s' % (flags['cflags'])) + else: + log('cflags: empty') + if args.libs: + if len(flags['libs']): + print flags['libs'] + log('libs: %s' % (flags['libs'])) + else: + log('libs: empty') #pkgconfig.package.dump_loaded() diff --git a/source-builder/sb/config.py b/source-builder/sb/config.py index 6426352..5a90a49 100644 --- a/source-builder/sb/config.py +++ b/source-builder/sb/config.py @@ -287,6 +287,18 @@ class file: return name return '%{' + name.lower() + '}' + def _cross_compile(self): + _host = self.expand('%{_host}') + _build = self.expand('%{_build}') + return _host != _build + + def _candian_cross_compile(self): + _host = self.expand('%{_host}') + _build = self.expand('%{_build}') + _target = self.expand('%{_target}') + _alloc_cxc = self.defined('%{allow_cxc}') + return _alloc_cxc and _host != _build and _host != _target + def _macro_split(self, s): '''Split the string (s) up by macros. Only split on the outter level. Nested levels will need to split with futher calls.''' @@ -369,34 +381,36 @@ class file: return line def _pkgconfig_check(self, test): - ts = test.split() ok = False - pkg = pkgconfig.package(ts[0], output = log.output) - if len(ts) != 1 and len(ts) != 3: - self._error('malformed check') - else: - op = '>=' - ver = '0' - if len(ts) == 3: - op = ts[1] - ver = self.macros.expand(ts[2]) - try: - ok = pkg.check(op, ver) - except pkgconfig.error, pe: - self._error('check: %s' % (pe)) - except: - raise error.interal('pkgconfig failure') + if not self._cross_compile(): + ts = test.split() + pkg = pkgconfig.package(ts[0], output = log.output) + if len(ts) != 1 and len(ts) != 3: + self._error('malformed check') + else: + op = '>=' + ver = '0' + if len(ts) == 3: + op = ts[1] + ver = self.macros.expand(ts[2]) + try: + ok = pkg.check(op, ver) + except pkgconfig.error, pe: + self._error('check: %s' % (pe)) + except: + raise error.interal('pkgconfig failure') return ok def _pkgconfig_flags(self, package, flags): pkg_flags = None - pkg = pkgconfig.package(package, output = log.output) - try: - pkg_flags = pkg.get(flags) - except pkgconfig.error, pe: - self._error('flags:%s: %s' % (flags, pe)) - except: - raise error.interal('pkgconfig failure') + if not self._cross_compile(): + pkg = pkgconfig.package(package, output = log.output) + try: + pkg_flags = pkg.get(flags) + except pkgconfig.error, pe: + self._error('flags:%s: %s' % (flags, pe)) + except: + raise error.interal('pkgconfig failure') return pkg_flags def _expand(self, s): diff --git a/source-builder/sb/freebsd.py b/source-builder/sb/freebsd.py index 846cd2f..3099012 100644 --- a/source-builder/sb/freebsd.py +++ b/source-builder/sb/freebsd.py @@ -73,11 +73,16 @@ def load(): defines['_build_alias'] = defines['_host_alias'] defines['_build_arch'] = defines['_host_arch'] - # FreeBSD 10 and above no longer have /usr/bin/cvs, but it can (e.g.) be installed to /usr/local/bin/cvs through the devel/cvs port + # FreeBSD 10 and above no longer have /usr/bin/cvs, but it can (e.g.) be + # installed to /usr/local/bin/cvs through the devel/cvs port if int(float(version)) >= 10: cvs = 'cvs' if check.check_exe(cvs, cvs): defines['__cvs'] = cvs + # + # Fix the mess iconv is on FreeBSD 10.0. + # + defines['iconv_optincludes'] = ('none', 'none', '-I/usr/local/include -L/usr/local/lib') for gv in ['47', '48', '49']: gcc = '%s-portbld-freebsd%s-gcc%s' % (cpu, version, gv) diff --git a/source-builder/sb/pkgconfig.py b/source-builder/sb/pkgconfig.py index 4653a89..aeca58e 100755 --- a/source-builder/sb/pkgconfig.py +++ b/source-builder/sb/pkgconfig.py @@ -40,14 +40,17 @@ import re import shlex import sys -def default_prefix(): +def default_prefix(common = True): paths = [] - defaults = ['/usr', '/usr/share', '/lib', '/lib64', '/usr/lib', '/usr/lib64', '/usr/local'] - for d in defaults: - if os.path.exists(d): - paths += [d] if 'PKG_CONFIG_PATH' in os.environ: paths += os.environ['PKG_CONFIG_PATH'].split(':') + if common: + defaults = ['/usr', '/usr/share', '/lib', '/lib64', '/usr/lib', '/usr/lib64', '/usr/local'] + for d in defaults: + for cp in package.config_prefixes: + prefix = os.path.join(d, cp, 'pkgconfig') + if os.path.exists(prefix): + paths += [prefix] return paths class error(Exception): @@ -79,7 +82,10 @@ class package(object): @staticmethod def splitter(pkg_list): pkgs = [] - pls = package.lib_list_splitter.split(pkg_list) + if type(pkg_list) == list: + pls = pkg_list + else: + pls = package.lib_list_splitter.split(pkg_list) i = 0 while i < len(pls): pkg = [pls[i]] @@ -181,10 +187,8 @@ class package(object): else: raise error('invalid type of prefix: %s' % (type(prefix))) for p in self.prefix: - for d in package.config_prefixes: - prefix = os.path.join(p, d, 'pkgconfig') - if os.path.exists(prefix): - self.paths += [prefix] + if os.path.exists(p): + self.paths += [p] self._log('paths: %s' % (', '.join(self.paths))) if 'sysroot' in self.defines: self._log('sysroot: %s' % (self.defines['sysroot'])) |