From 56e8d800550c88caa372f8119ec293d8899a35e0 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Tue, 4 Feb 2014 18:38:18 +1100 Subject: [PATCH] config: Add support to build qemu. Qemu requires gettext, glib, libffi, and pixman. DTC is built as a submodule. On Mavrick provide a pkg-config command so avoid needing a pkgconfig. The one here is only just good enough to work. Provide an internal autotools build including libtool so qemu can be built from git. --- .../config/devel/autoconf-internal-2.69-1.cfg | 8 + bare/config/devel/autotools-base.bset | 9 + bare/config/devel/autotools-internal.bset | 13 + bare/config/devel/autotools.bset | 14 + bare/config/devel/dtc.bset | 7 + bare/config/devel/gettext-0.18.3.1-1.cfg | 16 + bare/config/devel/glib-2.39.3-1.cfg | 18 + bare/config/devel/libffi-3.0.13-1.cfg | 16 + bare/config/devel/libtool-2.4.2-1.cfg | 16 + bare/config/devel/pixman-0.32.4-1.cfg | 16 + bare/config/devel/qemu-git-1.cfg | 32 ++ bare/config/devel/qemu.bset | 18 + source-builder/bin/pkg-config | 356 ++++++++++++++++++ source-builder/config/gettext-0-1.cfg | 78 ++++ source-builder/config/glib-2-1.cfg | 84 +++++ source-builder/config/libffi-3-1.cfg | 78 ++++ source-builder/config/libtool-2-1.cfg | 85 +++++ source-builder/config/pixman-0-1.cfg | 79 ++++ source-builder/config/qemu-1-1.cfg | 76 ++++ source-builder/defaults.mc | 9 + 20 files changed, 1028 insertions(+) create mode 100644 bare/config/devel/autoconf-internal-2.69-1.cfg create mode 100644 bare/config/devel/autotools-base.bset create mode 100644 bare/config/devel/autotools-internal.bset create mode 100644 bare/config/devel/autotools.bset create mode 100644 bare/config/devel/dtc.bset create mode 100644 bare/config/devel/gettext-0.18.3.1-1.cfg create mode 100644 bare/config/devel/glib-2.39.3-1.cfg create mode 100644 bare/config/devel/libffi-3.0.13-1.cfg create mode 100644 bare/config/devel/libtool-2.4.2-1.cfg create mode 100644 bare/config/devel/pixman-0.32.4-1.cfg create mode 100644 bare/config/devel/qemu-git-1.cfg create mode 100644 bare/config/devel/qemu.bset create mode 100755 source-builder/bin/pkg-config create mode 100644 source-builder/config/gettext-0-1.cfg create mode 100644 source-builder/config/glib-2-1.cfg create mode 100644 source-builder/config/libffi-3-1.cfg create mode 100644 source-builder/config/libtool-2-1.cfg create mode 100644 source-builder/config/pixman-0-1.cfg create mode 100644 source-builder/config/qemu-1-1.cfg diff --git a/bare/config/devel/autoconf-internal-2.69-1.cfg b/bare/config/devel/autoconf-internal-2.69-1.cfg new file mode 100644 index 0000000..5eb3723 --- /dev/null +++ b/bare/config/devel/autoconf-internal-2.69-1.cfg @@ -0,0 +1,8 @@ +# +# Internal Autoconf 2.69. +# + +%warning This autoconf build is for internal bootstraps, no package created + +%define _internal_autotools yes +%include %{_configdir}/devel/autoconf-2.69-1.cfg diff --git a/bare/config/devel/autotools-base.bset b/bare/config/devel/autotools-base.bset new file mode 100644 index 0000000..22456ed --- /dev/null +++ b/bare/config/devel/autotools-base.bset @@ -0,0 +1,9 @@ +# +# Build set for autoconf, automake, and libtools. +# + +%define release 1 + +devel/autoconf-2.69-1 +devel/automake-1.12.6-1 +devel/libtool-2.4.2-1 diff --git a/bare/config/devel/autotools-internal.bset b/bare/config/devel/autotools-internal.bset new file mode 100644 index 0000000..bad3890 --- /dev/null +++ b/bare/config/devel/autotools-internal.bset @@ -0,0 +1,13 @@ +# +# Tools Set for Internal Autotools Stable +# +# Do not use via the command line. +# + +%define _internal_autotools yes +%define _disable_collecting yes +%define _disable_packaging yes +%define _disable_reporting yes +%define _disable_installing yes + +%include devel/autotools-base.bset diff --git a/bare/config/devel/autotools.bset b/bare/config/devel/autotools.bset new file mode 100644 index 0000000..5fcafa4 --- /dev/null +++ b/bare/config/devel/autotools.bset @@ -0,0 +1,14 @@ +# +# Build set for autoconf, automake, and libtools. +# + +%define release 1 + +# +# A magic internal path that would break if changes in the defaults.mc +# macro file are made. +# +%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN} + +devel/autotools-internal.bset +devel/autotools-base.bset diff --git a/bare/config/devel/dtc.bset b/bare/config/devel/dtc.bset new file mode 100644 index 0000000..d701f93 --- /dev/null +++ b/bare/config/devel/dtc.bset @@ -0,0 +1,7 @@ +# +# Build set for the Device Tree Compiler +# + +%define release 1 + +devel/dtc-1.2.0 diff --git a/bare/config/devel/gettext-0.18.3.1-1.cfg b/bare/config/devel/gettext-0.18.3.1-1.cfg new file mode 100644 index 0000000..d215e67 --- /dev/null +++ b/bare/config/devel/gettext-0.18.3.1-1.cfg @@ -0,0 +1,16 @@ +# +# GetText +# + +%if %{release} == %{nil} +%define release 1 +%endif + +%include %{_configdir}/base.cfg + +%define gettext_version 0.18.3.1 + +# +# The GetText build instructions. We use 0.x.x Release 1. +# +%include %{_configdir}/gettext-0-1.cfg diff --git a/bare/config/devel/glib-2.39.3-1.cfg b/bare/config/devel/glib-2.39.3-1.cfg new file mode 100644 index 0000000..d4bceab --- /dev/null +++ b/bare/config/devel/glib-2.39.3-1.cfg @@ -0,0 +1,18 @@ +# +# GLib +# + +%if %{release} == %{nil} +%define release 1 +%endif + +%include %{_configdir}/base.cfg + +%define glib_version_major 2.39 +%define glib_version_minor 3 +%define glib_version %{glib_version_major}.%{glib_version_minor} + +# +# The GLib build instructions. We use 2.x.x Release 1. +# +%include %{_configdir}/glib-2-1.cfg diff --git a/bare/config/devel/libffi-3.0.13-1.cfg b/bare/config/devel/libffi-3.0.13-1.cfg new file mode 100644 index 0000000..efd5924 --- /dev/null +++ b/bare/config/devel/libffi-3.0.13-1.cfg @@ -0,0 +1,16 @@ +# +# LibFFI +# + +%if %{release} == %{nil} +%define release 1 +%endif + +%include %{_configdir}/base.cfg + +%define libffi_version 3.0.13 + +# +# The LibFFI build instructions. We use 3.x.x Release 1. +# +%include %{_configdir}/libffi-3-1.cfg diff --git a/bare/config/devel/libtool-2.4.2-1.cfg b/bare/config/devel/libtool-2.4.2-1.cfg new file mode 100644 index 0000000..cb72605 --- /dev/null +++ b/bare/config/devel/libtool-2.4.2-1.cfg @@ -0,0 +1,16 @@ +# +# Libtool 2.4.2 +# + +%if %{release} == %{nil} +%define release 1 +%endif + +%include %{_configdir}/base.cfg + +%define libtool_version 2.4.2 + +# +# The libtool build instructions. We use 2.xx Release 1. +# +%include %{_configdir}/libtool-2-1.cfg diff --git a/bare/config/devel/pixman-0.32.4-1.cfg b/bare/config/devel/pixman-0.32.4-1.cfg new file mode 100644 index 0000000..79819be --- /dev/null +++ b/bare/config/devel/pixman-0.32.4-1.cfg @@ -0,0 +1,16 @@ +# +# Pixman +# + +%if %{release} == %{nil} +%define release 1 +%endif + +%include %{_configdir}/base.cfg + +%define pixman_version 0.32.4 + +# +# The Pixman build instructions. We use 0.x.x Release 1. +# +%include %{_configdir}/pixman-0-1.cfg diff --git a/bare/config/devel/qemu-git-1.cfg b/bare/config/devel/qemu-git-1.cfg new file mode 100644 index 0000000..259cc70 --- /dev/null +++ b/bare/config/devel/qemu-git-1.cfg @@ -0,0 +1,32 @@ +# +# Qemu from git +# + +%if %{release} == %{nil} +%define release 1 +%endif + +%include %{_configdir}/base.cfg + +# +# Stable version. Qemu is fast moving. +# +%define qemu_version 97374ce538883af677fd94803b71df2d55a9a4de + +# +# The RTEMS Tools patches. +# +%define rtems_http_git http://git.rtems.org +%define rtems_git_tools %{rtems_http_git}/rtems-tools/plain/tools/ + +# +# Qemu is from GIT. +# +Source0: git://git.qemu-project.org/qemu.git?pull?checkout=%{qemu_version}?submodule=dtc +Patch0: %{rtems_git_tools}/qemu/0001-configure-use-glib-in-glib-pkg-config-check.patch +Patch1: %{rtems_git_tools}/qemu/0001-zynq-Request-qemu-reset-when-PSS_RESET_CTRL-triggere.patch + +# +# The Qemu build instructions. We use 1.x.x Release 1. +# +%include %{_configdir}/qemu-1-1.cfg diff --git a/bare/config/devel/qemu.bset b/bare/config/devel/qemu.bset new file mode 100644 index 0000000..3f50242 --- /dev/null +++ b/bare/config/devel/qemu.bset @@ -0,0 +1,18 @@ +# +# Build set for QEMU +# + +%define release 1 + +# +# A magic internal path that would break if changes in the defaults.mc +# macro file are made. +# +%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN} + +devel/autotools-internal +devel/gettext-0.18.3.1-1 +devel/libffi-3.0.13-1 +devel/pixman-0.32.4-1 +devel/glib-2.39.3-1 +devel/qemu-git-1 diff --git a/source-builder/bin/pkg-config b/source-builder/bin/pkg-config new file mode 100755 index 0000000..1ae1284 --- /dev/null +++ b/source-builder/bin/pkg-config @@ -0,0 +1,356 @@ +#! /usr/bin/env python +# +# RTEMS Tools Project (http://www.rtems.org/) +# Copyright 2014 Chris Johns (chrisj@rtems.org) +# All rights reserved. +# +# This file is part of the RTEMS Tools package in 'rtems-tools'. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +# +# Pkg-config in python. It attempts to provide a few simple features +# provided by the full pkg-config so packages can configure and build. +# +# Pkg-config as a tool is a good idea how-ever the implementation creates a +# range of problems. If it was implemented with all parts included it would be +# portable and I suspect useful to others on platforms other than Linux and +# Unix equivs that come with packaging systems.. +# +# Note: This is used on platforms where pkg-config is not easy to get +# working. +# + +import argparse +import os +import os.path +import re +import sys + +# +# Make trace true to get a file of what happens and what is being asked. +# +trace = True +logfile = 'pc.log' +out = None + +pkg_aliases = { + # Use to add package name aliases eg + # 'package': ['pkg_alias'], +} + +def log(s, lf = True): + global trace, logfile, out + if trace: + if out is None: + if logfile: + out = open(logfile, 'a') + else: + out = sys.stdout + if lf: + print >> out, s + else: + print >> out, s, + +def default_prefix(): + paths = ['/usr', '/usr/local'] + if 'PKG_CONFIG_PATH' in os.environ: + paths += os.environ['PKG_CONFIG_PATH'].split(':') + return paths + +class error(Exception): + def __init__(self, msg): + self.msg = msg + + def __str__(self): + return self.msg + +class package: + def __init__(self, file = None): + self.defines = {} + self.fields = {} + if file: + self.load(file) + + def __str__(self): + s = '' + for d in sorted(self.defines): + s += 'd: %s: %s%s' % (d, self.defines[d], os.linesep) + for f in sorted(self.fields): + s += 'f: %s: %s%s' % (f, self.fields[f], os.linesep) + return s + + def _sysroot(self, s): + if 'PKG_CONFIG_SYSROOT_DIR' in os.environ: + sysroot = os.environ['PKG_CONFIG_SYSROOT_DIR'] + offset = 0 + while True: + dash = s[offset:].find('-') + if dash < 0: + break + if offset + dash + 2 < len(s) and s[offset + dash + 1] in 'LI': + s = s[:offset + dash + 2] + sysroot + s[offset + dash + 2:] + offset += dash + 1 + return s + + def load(self, file): + f = open(file) + tm = False + for l in f.readlines(): + l = l[:-1] + hash = l.find('#') + if hash >= 0: + l = l[:hash] + if len(l): + d = 0 + define = False + eq = l.find('=') + dd = l.find(':') + if eq > 0 and dd > 0: + if eq < dd: + define = True + d = eq + else: + define = False + d = dd + elif eq >= 0: + define = True + d = eq + elif dd >= 0: + define = False + d = dd + if d > 0: + lhs = l[:d].lower() + rhs = l[d + 1:] + + if tm: + print('define: ' + str(define) + ', lhs: ' + lhs + ', ' + rhs) + + if define: + self.defines[lhs] = rhs + else: + self.fields[lhs] = rhs + + def get(self, label): + if label.lower() not in self.fields: + None + mre = re.compile('\$\{[^\}]+\}') + s = self.fields[label.lower()] + expanded = True + tm = False + while expanded: + expanded = False + if tm: + log('pc:get: "' + s + '"') + ms = mre.findall(s) + for m in ms: + mn = m[2:-1] + if mn.lower() in self.defines: + s = s.replace(m, self.defines[mn.lower()]) + expanded = True + return self._sysroot(s) + +def _check_package(lib_check, args, pc_paths): + ec = 1 + pkg = None + ls = lib_check.split() + lib = ls[0] + if len(pc_paths): + for path in pc_paths: + pc = os.path.join(path, '%s.pc' % (lib)) + if os.path.isfile(pc): + pkg = package(file = pc) + if args.dump: + log(pkg) + ec = 0 + break + if ec > 0: + versions = [] + for prefix in args.prefix: + prefix = os.path.join(prefix, 'lib') + if os.path.exists(prefix): + for l in os.listdir(prefix): + if l.startswith(lib + '.'): + versions += [l] + break + if len(versions) > 0: + if len(ls) > 1: + ec = 0 + elif args.exists: + ec = 0 + elif args.exact_version: + ec = 0 + elif args.atleast_version: + ec = 0 + elif args.atleast_version: + ec = 0 + return ec, pkg + +def run(argv): + + class version_action(argparse.Action): + def __call__(self, parser, namespace, values, option_string = None): + parts = values.strip().split('.') + for p in parts: + if not p.isdigit(): + raise error('invalid version value: %s' % (values)) + setattr(namespace, self.dest, '.'.join(parts)) + + ec = 0 + + opts = argparse.ArgumentParser(prog = 'pkg-config', + description = 'Package Configuration.') + opts.add_argument('libraries', metavar='lib', type = str, nargs = '+', + help = 'a library') + opts.add_argument('--modversion', dest = 'modversion', action = 'store', default = None, + help = 'Requests that the version information of the libraries.') + opts.add_argument('--print-errors', dest = 'print_errors', action = 'store_true', + default = False, + help = 'Print any errors.') + opts.add_argument('--short-errors', dest = 'short_errors', action = 'store_true', + default = False, + help = 'Make error messages short.') + opts.add_argument('--silence-errors', dest = 'silence_errors', action = 'store_true', + default = False, + help = 'Do not print any errors.') + opts.add_argument('--errors-to-stdout', dest = 'errors_to_stdout', action = 'store_true', + default = False, + help = 'Print errors to stdout rather than stderr.') + opts.add_argument('--cflags', dest = 'cflags', action = 'store_true', + default = False, + help = 'This prints pre-processor and compile flags required to' \ + ' compile the package(s)') + opts.add_argument('--libs', dest = 'libs', action = 'store_true', + default = False, + help = 'This option is identical to "--cflags", only it prints the' \ + ' link flags.') + opts.add_argument('--libs-only-L', dest = 'libs_only_L', action = 'store_true', + default = False, + help = 'This prints the -L/-R part of "--libs".') + opts.add_argument('--libs-only-l', dest = 'libs_only_l', action = 'store_true', + default = False, + help = 'This prints the -l part of "--libs".') + opts.add_argument('--variable', dest = 'variable', action = 'store', + default = None, + help = 'This returns the value of a variable.') + opts.add_argument('--define-variable', dest = 'define_variable', action = 'store', + default = None, + help = 'This sets a global value for a variable') + opts.add_argument('--uninstalled', dest = 'uninstalled', action = 'store_true', + default = False, + help = 'Ignored') + opts.add_argument('--atleast-pkgconfig-version', dest = 'atleast_pkgconfig_version', action = 'store_true', + default = False, + help = 'Check the version of package config. Always ok.') + opts.add_argument('--exists', dest = 'exists', action = 'store_true', + default = False, + help = 'Test if a library is present') + opts.add_argument('--atleast-version', dest = 'atleast_version', action = version_action, + default = None, + help = 'The package is at least this version.') + opts.add_argument('--exact-version', dest = 'exact_version', action = version_action, + default = None, + help = 'The package is the exact version.') + opts.add_argument('--max-version', dest = 'max_version', action = version_action, + default = None, + help = 'The package is no later than this version.') + opts.add_argument('--msvc-syntax', dest = 'msvc_syntax', action = 'store_true', + default = False, + help = 'Ignored') + opts.add_argument('--dont-define-prefix', dest = 'dont_define_prefix', action = 'store_true', + default = False, + help = 'Ignored') + opts.add_argument('--prefix-variable', dest = 'prefix', action = 'store', + default = default_prefix(), + help = 'Define the prefix.') + opts.add_argument('--static', dest = 'static', action = 'store_true', + default = False, + help = 'Output libraries suitable for static linking') + opts.add_argument('--dump', dest = 'dump', action = 'store_true', + default = False, + help = 'Dump the package if one is found.') + + args = opts.parse_args(argv[1:]) + + if (args.exists and (args.exact_version or args.max_version)) or \ + (args.exact_version and (args.exists or args.max_version)) or \ + (args.max_version and (args.exists or args.exact_version)): + raise error('only one of --exists, --exact-version, or --max-version') + + pc_paths = [] + + if args.prefix: + for prefix in args.prefix: + prefix = os.path.join(prefix, 'lib', 'pkgconfig') + if os.path.exists(prefix): + pc_paths += [prefix] + + if len(pc_paths): + log('pc_paths = %s' % (', '.join(pc_paths))) + else: + log('pc_paths = None') + + exists = False + + ec = 1 + + if args.atleast_pkgconfig_version: + ec = 0 + else: + for lib in args.libraries: + ec, pkg = _check_package(lib, args, pc_paths) + if ec > 0: + for pa in pkg_aliases: + if lib.startswith(pa): + for a in pkg_aliases[pa]: + ec, pkg = _check_package(a, args, pc_paths) + if ec == 0: + break + if ec == 0: + if pkg: + if args.cflags: + cflags = pkg.get('cflags') + print cflags + log('cflags: %s' % (cflags)) + if args.libs: + libs = pkg.get('libs') + print libs + log('libs: %s' % (libs)) + return ec + +try: + log('-' * 40) + log('pkg-config', lf = False) + for a in sys.argv[1:]: + log(' "%s"' % (a), lf = False) + log('') + ec = run(sys.argv) + log('ec = %d' % (ec)) +except ImportError: + print >> sys.stderr, "incorrect package config installation" + sys.exit(1) +except error, e: + print >> sys.stderr, 'error: %s' % (e) + sys.exit(1) +sys.exit(ec) diff --git a/source-builder/config/gettext-0-1.cfg b/source-builder/config/gettext-0-1.cfg new file mode 100644 index 0000000..49940e3 --- /dev/null +++ b/source-builder/config/gettext-0-1.cfg @@ -0,0 +1,78 @@ +# +# GetText 0.x.x Version 1. +# +# This configuration file configure's, make's and install's GetText. +# + +%if %{release} == %{nil} +%define release 1 +%endif + +Name: gettext-%{gettext_version}-%{_host}-%{release} +Summary: GetText offers to programmers, translators, and even users, a well + integrated set of tools and documentation. +Version: %{gettext_version} +Release: %{release} +URL: http://www.gnu.org/software/gettext/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-0.18.3.1.tar.gz + +# +# Prepare the source code. +# +%prep + build_top=$(pwd) + + source_dir_0="gettext-%{gettext_version}" + %setup -q -n gettext-%{gettext_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/glib-2-1.cfg b/source-builder/config/glib-2-1.cfg new file mode 100644 index 0000000..5aca619 --- /dev/null +++ b/source-builder/config/glib-2-1.cfg @@ -0,0 +1,84 @@ +# +# GLib 2.x.x Version 1. +# +# This configuration file configure's, make's and install's GLib. +# + +%if %{release} == %{nil} +%define release 1 +%endif + +Name: glib-%{glib_version}-%{_host}-%{release} +Summary: GLib provides the core application building blocks for + libraries and applications written in C. +Version: %{glib_version} +Release: %{release} +URL: https://developer.gnome.org/glib/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +Source0: http://ftp.gnome.org/pub/gnome/sources/glib/%{glib_version_major}/glib-%{glib_version}.tar.xz + +# +# Prepare the source code. +# +%prep + build_top=$(pwd) + + source_dir_0="glib-%{glib_version}" + %setup -q -n glib-%{glib_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} + + SYSROOT=$SB_TMPPREFIX + + PKG_CONFIG_PATH=$SYSROOT \ + PKG_CONFIG_SYSROOT_DIR=$SB_TMPROOT \ + %{_ld_library_path}=$SYSROOT/lib \ + ../${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} \ + --with-sysroot=$SYSROOT + + %{__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/libffi-3-1.cfg b/source-builder/config/libffi-3-1.cfg new file mode 100644 index 0000000..7316331 --- /dev/null +++ b/source-builder/config/libffi-3-1.cfg @@ -0,0 +1,78 @@ +# +# LibFFI 3.x.x Version 1. +# +# This configuration file configure's, make's and install's LibFFI. +# + +%if %{release} == %{nil} +%define release 1 +%endif + +Name: libffi-%{libffi_version}-%{_host}-%{release} +Summary: LibFFI provides a portable, high level programming interface to + various calling conventions. +Version: %{libffi_version} +Release: %{release} +URL: https://sourceware.org/libffi/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +Source0: ftp://sourceware.org/pub/libffi/libffi-%{libffi_version}.tar.gz + +# +# Prepare the source code. +# +%prep + build_top=$(pwd) + + source_dir_0="libffi-%{libffi_version}" + %setup -q -n libffi-%{libffi_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/libtool-2-1.cfg b/source-builder/config/libtool-2-1.cfg new file mode 100644 index 0000000..e69493b --- /dev/null +++ b/source-builder/config/libtool-2-1.cfg @@ -0,0 +1,85 @@ +# +# Libtool 2.xx Version 1. +# +# This configuration file configure's, make's and install's libtool +# + +%ifn %{defined _internal_autotools} + %define _internal_autotools no + %ifn %{defined _internal_autotools_path} + %define _internal_autotools_path %{nil} + %endif +%endif + +Name: libtool-%{libtool_version}-%{_host}-%{release} +Summary: Libtool v%{libtool_version} for host %{_host} +Version: %{libtool_version} +Release: %{release} +URL: http://www.gnu.org/software/libtool/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +Source0: ftp://ftp.gnu.org/gnu/libtool/libtool-%{libtool_version}.tar.gz +VersionControl0: git clone git://git.sv.gnu.org/libtool + +# +# Prepare the source code. +# +%prep + build_top=$(pwd) + + %setup -q -n libtool-%{libtool_version} + %{?patch0:%patch0 -p1} + + cd ${build_top} + +%build + build_top=$(pwd) + + %if %{defined _internal_autotools_path} + export PATH="%{_internal_autotools_path}/bin:${PATH}" + %endif + + cd libtool-%{libtool_version} + + if test "%{_internal_autotools}" = "yes"; then + ac_prefix=%{_internal_autotools_path} + else + ac_prefix=%{_prefix} + fi + + if test "%{_build}" != "%{_host}" ; then + CFLAGS_FOR_BUILD="-g -O2 -Wall" + fi + export CFLAGS CFLAGS_FOR_BUILD CC + + CFLAGS="$SB_OPT_FLAGS" \ + ./configure \ + --build=%{_build} --host=%{_host} \ + --verbose --disable-nls \ + --without-included-gettext \ + --prefix=${ac_prefix} + + %{__make} %{?_smp_mflags} all + + unset CFLAGS_FOR_BUILD + + cd ${build_top} + +%install + build_top=$(pwd) + + export PATH="%{_bindir}:${PATH}" + %{__rmdir} $SB_BUILD_ROOT + + cd libtool-%{libtool_version} + + if test "%{_internal_autotools}" = "yes"; then + %{__make} install + else + %{__make} DESTDIR=$SB_BUILD_ROOT install + fi + + cd ${build_top} diff --git a/source-builder/config/pixman-0-1.cfg b/source-builder/config/pixman-0-1.cfg new file mode 100644 index 0000000..cf60723 --- /dev/null +++ b/source-builder/config/pixman-0-1.cfg @@ -0,0 +1,79 @@ +# +# Pixman 0.x.x Version 1. +# +# This configuration file configure's, make's and install's Pixman. +# + +%if %{release} == %{nil} +%define release 1 +%endif + +Name: pixman-%{pixman_version}-%{_host}-%{release} +Summary: Pixman is a low-level software library for pixel manipulation, + providing features such as image compositing and trapezoid + rasterization. +Version: %{pixman_version} +Release: %{release} +URL: http://www.pixman.org/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +Source0: http://cairographics.org/releases/pixman-%{pixman_version}.tar.gz + +# +# Prepare the source code. +# +%prep + build_top=$(pwd) + + source_dir_0="pixman-%{pixman_version}" + %setup -q -n pixman-%{pixman_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/qemu-1-1.cfg b/source-builder/config/qemu-1-1.cfg new file mode 100644 index 0000000..4d81074 --- /dev/null +++ b/source-builder/config/qemu-1-1.cfg @@ -0,0 +1,76 @@ +# +# QEMU 1.x.x Version 1. +# +# This configuration file configure's, make's and install's QEMU. +# + +%if %{release} == %{nil} +%define release 1 +%endif + +Name: qemu-%{qemu_version}-%{_host}-%{release} +Summary: Qemu is a simulator of various processors. +Version: %{qemu_version} +Release: %{release} +URL: http://www.qemu.org/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# Source +# +Source0: http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2 + +# +# Prepare the source code. +# +%prep + build_top=$(pwd) + + source_dir_0="qemu-%{qemu_version}" + %setup -q -n qemu-%{qemu_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} + + SYSROOT=$SB_TMPPREFIX + + PKG_CONFIG_PATH=$SYSROOT \ + PKG_CONFIG_SYSROOT_DIR=$SB_TMPROOT \ + %{_ld_library_path}=$SYSROOT/lib \ + ../${source_dir_0}/configure \ + --prefix=%{_prefix} \ + --disable-tools \ + --disable-pie \ + --disable-vnc + + %{__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/defaults.mc b/source-builder/defaults.mc index 3d1a219..1030825 100644 --- a/source-builder/defaults.mc +++ b/source-builder/defaults.mc @@ -57,6 +57,10 @@ _uid: none, convert, '%(%{__id_u} -n)' optflags: none, convert, '-O2 -pipe' optincludes: none, convert, '' +# Extra path a platform can override. +_extra_path: none, none, '' +_ld_library_path: none, none, 'LD_LIBRARY_PATH' + # Paths _host_platform: none, none, '%{_host_cpu}-%{_host_vendor}-%{_host_os}%{?_gnu}' _arch: none, none, '%{_host_arch}' @@ -209,6 +213,8 @@ export SB_TMPROOT SB_TMPPREFIX SB_TMPBINDIR %{?_tmpcxcroot:%{?_prefix:SB_TMPCXCPREFIX="%{_tmpcxcroot}/${SB_PREFIX_CLEAN}"}} %{?_tmpcxcroot:%{?_prefix:SB_TMPCXCBINDIR="%{_tmpcxcroot}/${SB_PREFIX_CLEAN}/bin"}} export SB_TMPCXCROOT SB_TMPCXCPREFIX SB_TMPCXCBINDIR +# Extra path support +%{?_extra_path:SB_EXTRAPATH="%{_extra_path}"} # The compiler flags %{?_targetcflags:CFLAGS_FOR_TARGET="%{_targetcflags}"} %{?_targetcxxflags:CXXFLAGS_FOR_TARGET="%{_targetcxxflags}"} @@ -221,6 +227,9 @@ fi if test -n "${SB_TMPCXCBINDIR}" ; then PATH="${SB_TMPCXCBINDIR}:$PATH" fi +if test -n "${SB_EXTRAPATH}" ; then + PATH="${SB_EXTRAPATH}:$PATH" +fi export PATH # Default environment set up. LANG=C