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.
This commit is contained in:
Chris Johns
2014-04-08 15:11:00 +10:00
parent 374ba95354
commit f3b549010d
13 changed files with 198 additions and 54 deletions

View File

@@ -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

View File

@@ -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 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. # The Qemu build instructions. We use 1.x.x Release 1.
# #

View File

@@ -11,6 +11,7 @@
%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN} %define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN}
devel/autotools-internal devel/autotools-internal
devel/libiconv-1.14-1
devel/gettext-0.18.3.1-1 devel/gettext-0.18.3.1-1
devel/libffi-3.0.13-1 devel/libffi-3.0.13-1
devel/pixman-0.32.4-1 devel/pixman-0.32.4-1

View File

@@ -21,6 +21,13 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
# #
Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz 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. # Prepare the source code.
# #

View File

@@ -54,7 +54,7 @@ Source0: http://ftp.gnome.org/pub/gnome/sources/glib/%{glib_version_major}/glib-
SYSROOT=$SB_TMPPREFIX SYSROOT=$SB_TMPPREFIX
PKG_CONFIG_PATH=$SYSROOT \ PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \
PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \ PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \
%{_ld_library_path}=$SYSROOT/lib \ %{_ld_library_path}=$SYSROOT/lib \
../${source_dir_0}/configure \ ../${source_dir_0}/configure \

View File

@@ -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}

View File

@@ -64,7 +64,8 @@ Source0: http://cairographics.org/releases/pixman-%{pixman_version}.tar.gz
--infodir=%{_infodir} \ --infodir=%{_infodir} \
--datadir=%{_datadir} \ --datadir=%{_datadir} \
--build=%{_build} --host=%{_host} \ --build=%{_build} --host=%{_host} \
--disable-gtk --disable-gtk \
--disable-libpng
%{__make} %{?_smp_mflags} all %{__make} %{?_smp_mflags} all

View File

@@ -51,14 +51,20 @@ Source0: http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2
%{host_build_flags} %{host_build_flags}
if test "%{_build}" != "%{_host}" ; then
CROSS_PREFIX_OPTION="--cross-prefix=%{_host}-"
fi
SYSROOT=$SB_TMPPREFIX SYSROOT=$SB_TMPPREFIX
PKG_CONFIG_PATH=$SYSROOT \ PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \
PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \ PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \
%{_ld_library_path}=$SYSROOT/lib \ %{_ld_library_path}=$SYSROOT/lib \
LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib" \ LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib" \
../${source_dir_0}/configure \ ../${source_dir_0}/configure \
--prefix=%{_prefix} \ --prefix=%{_prefix} \
${CROSS_PREFIX_OPTION} \
--make=%{__make} \
--disable-werror \ --disable-werror \
--disable-tools \ --disable-tools \
--disable-pie \ --disable-pie \

View File

@@ -0,0 +1,3 @@
#! /bin/sh
base=$(dirname $0)
exec ${base}/pkg-config --dont-define-prefix $*

View File

@@ -83,12 +83,12 @@ def log(s, lf = True):
print s, print s,
print >> out, s, print >> out, s,
def _check_package(lib_check, args): def _check_package(libraries, args):
ec = 1 ec = 1
pkg = None pkg = None
flags = { 'cflags': '', flags = { 'cflags': '',
'libs': '' } 'libs': '' }
libs = pkgconfig.package.splitter(lib_check) libs = pkgconfig.package.splitter(libraries)
for lib in libs: for lib in libs:
log('pkg: %s' % (lib)) log('pkg: %s' % (lib))
pkg = pkgconfig.package(lib[0], prefix = args.prefix, output = log, src = src) 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)): (args.max_version and (args.exists or args.exact_version)):
raise error('only one of --exists, --exact-version, or --max-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 exists = False
ec = 1 ec = 1
@@ -220,21 +223,20 @@ def run(argv):
if args.atleast_pkgconfig_version: if args.atleast_pkgconfig_version:
ec = 0 ec = 0
else: else:
for lib in args.libraries: ec, pkg, flags = _check_package(args.libraries, args)
ec, pkg, flags = _check_package(lib, args) if ec == 0:
if ec == 0: if args.cflags:
if args.cflags: if len(flags['cflags']):
if len(flags['cflags']): print flags['cflags']
print flags['cflags'] log('cflags: %s' % (flags['cflags']))
log('cflags: %s' % (flags['cflags'])) else:
else: log('cflags: empty')
log('cflags: empty') if args.libs:
if args.libs: if len(flags['libs']):
if len(flags['libs']): print flags['libs']
print flags['libs'] log('libs: %s' % (flags['libs']))
log('libs: %s' % (flags['libs'])) else:
else: log('libs: empty')
log('libs: empty')
#pkgconfig.package.dump_loaded() #pkgconfig.package.dump_loaded()

View File

@@ -287,6 +287,18 @@ class file:
return name return name
return '%{' + name.lower() + '}' 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): def _macro_split(self, s):
'''Split the string (s) up by macros. Only split on the '''Split the string (s) up by macros. Only split on the
outter level. Nested levels will need to split with futher calls.''' outter level. Nested levels will need to split with futher calls.'''
@@ -369,34 +381,36 @@ class file:
return line return line
def _pkgconfig_check(self, test): def _pkgconfig_check(self, test):
ts = test.split()
ok = False ok = False
pkg = pkgconfig.package(ts[0], output = log.output) if not self._cross_compile():
if len(ts) != 1 and len(ts) != 3: ts = test.split()
self._error('malformed check') pkg = pkgconfig.package(ts[0], output = log.output)
else: if len(ts) != 1 and len(ts) != 3:
op = '>=' self._error('malformed check')
ver = '0' else:
if len(ts) == 3: op = '>='
op = ts[1] ver = '0'
ver = self.macros.expand(ts[2]) if len(ts) == 3:
try: op = ts[1]
ok = pkg.check(op, ver) ver = self.macros.expand(ts[2])
except pkgconfig.error, pe: try:
self._error('check: %s' % (pe)) ok = pkg.check(op, ver)
except: except pkgconfig.error, pe:
raise error.interal('pkgconfig failure') self._error('check: %s' % (pe))
except:
raise error.interal('pkgconfig failure')
return ok return ok
def _pkgconfig_flags(self, package, flags): def _pkgconfig_flags(self, package, flags):
pkg_flags = None pkg_flags = None
pkg = pkgconfig.package(package, output = log.output) if not self._cross_compile():
try: pkg = pkgconfig.package(package, output = log.output)
pkg_flags = pkg.get(flags) try:
except pkgconfig.error, pe: pkg_flags = pkg.get(flags)
self._error('flags:%s: %s' % (flags, pe)) except pkgconfig.error, pe:
except: self._error('flags:%s: %s' % (flags, pe))
raise error.interal('pkgconfig failure') except:
raise error.interal('pkgconfig failure')
return pkg_flags return pkg_flags
def _expand(self, s): def _expand(self, s):

View File

@@ -73,11 +73,16 @@ def load():
defines['_build_alias'] = defines['_host_alias'] defines['_build_alias'] = defines['_host_alias']
defines['_build_arch'] = defines['_host_arch'] 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: if int(float(version)) >= 10:
cvs = 'cvs' cvs = 'cvs'
if check.check_exe(cvs, cvs): if check.check_exe(cvs, cvs):
defines['__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']: for gv in ['47', '48', '49']:
gcc = '%s-portbld-freebsd%s-gcc%s' % (cpu, version, gv) gcc = '%s-portbld-freebsd%s-gcc%s' % (cpu, version, gv)

View File

@@ -40,14 +40,17 @@ import re
import shlex import shlex
import sys import sys
def default_prefix(): def default_prefix(common = True):
paths = [] 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: if 'PKG_CONFIG_PATH' in os.environ:
paths += os.environ['PKG_CONFIG_PATH'].split(':') 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 return paths
class error(Exception): class error(Exception):
@@ -79,7 +82,10 @@ class package(object):
@staticmethod @staticmethod
def splitter(pkg_list): def splitter(pkg_list):
pkgs = [] 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 i = 0
while i < len(pls): while i < len(pls):
pkg = [pls[i]] pkg = [pls[i]]
@@ -181,10 +187,8 @@ class package(object):
else: else:
raise error('invalid type of prefix: %s' % (type(prefix))) raise error('invalid type of prefix: %s' % (type(prefix)))
for p in self.prefix: for p in self.prefix:
for d in package.config_prefixes: if os.path.exists(p):
prefix = os.path.join(p, d, 'pkgconfig') self.paths += [p]
if os.path.exists(prefix):
self.paths += [prefix]
self._log('paths: %s' % (', '.join(self.paths))) self._log('paths: %s' % (', '.join(self.paths)))
if 'sysroot' in self.defines: if 'sysroot' in self.defines:
self._log('sysroot: %s' % (self.defines['sysroot'])) self._log('sysroot: %s' % (self.defines['sysroot']))