mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Fixes for CVS to work. Add RTEMS build for sparc/sis.
This commit is contained in:
parent
5f44fcdd1b
commit
f077b2b190
@ -6,6 +6,12 @@
|
||||
|
||||
%define rtems_arch sparc
|
||||
|
||||
#
|
||||
# The RTEMS 4.11 BSP to build and test
|
||||
#
|
||||
%define rtems_bsps sis
|
||||
%define rtems_test_bsps sis
|
||||
|
||||
#
|
||||
# The RTEMS 4.11 base defines.
|
||||
#
|
||||
@ -18,3 +24,4 @@ expat-2.1.0-1
|
||||
tools/rtems-binutils-2.23.1-1
|
||||
tools/rtems-gcc-4.7.3-newlib-2.0.0-1
|
||||
tools/rtems-gdb-7.5.1-1
|
||||
tools/rtems-kernel-4.11.cfg
|
||||
|
@ -46,8 +46,9 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
||||
# Prepare the source code.
|
||||
#
|
||||
%prep
|
||||
source_dir_0="rtems-%{rtems_kernel_version}"
|
||||
%setup -q -c -n %{name}-%{version}
|
||||
cd rtems-%{rtems_kernel_version}
|
||||
cd ${source_dir_0}
|
||||
%{?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}}
|
||||
@ -58,24 +59,31 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
||||
%{?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}}
|
||||
%if %{rtems_bootstrap}
|
||||
./bootstrap -c
|
||||
./bootstrap -p
|
||||
./bootstrap
|
||||
%endif
|
||||
cd ..
|
||||
|
||||
%build
|
||||
export PATH="%{_bindir}:${PATH}"
|
||||
mkdir -p build
|
||||
cd build
|
||||
%{?host_force_32bit:HOST_FORCE_32BIT="-m32"}
|
||||
%if "%{_build}" != "%{_host}"
|
||||
CFLAGS_FOR_BUILD="-g -O2 -Wall ${HOST_FORCE_32BIT}" \
|
||||
%endif
|
||||
CFLAGS="$SB_OPT_FLAGS" \
|
||||
../rtems-%{rtems_kernel_version}/configure \
|
||||
# Build directory support.
|
||||
if test "%{_build}" != "%{_host}" ; then
|
||||
build_dir="build-cxc"
|
||||
else
|
||||
build_dir="build"
|
||||
fi
|
||||
mkdir -p ${build_dir}
|
||||
cd ${build_dir}
|
||||
|
||||
../${source_dir_0}/configure \
|
||||
--build=%{_build} --host=%{_host} \
|
||||
--target=%{_target} \
|
||||
%{?rtems_posix:--enable-posix}%{!?rtems_posix:--disable-posix} \
|
||||
%{?rtems_networking:--enable-networking}%{!?rtems_networking:--disable-networking} \
|
||||
%{?rtems_cxx:--enable-cxx}%{!?rtems_cxx:--disable-cxx} \
|
||||
%{rtems_tests_opt} \
|
||||
%{?rtems_bsps:--enable-rtemsbsp=%{rtems_bsps}} \
|
||||
--target=%{_target} \
|
||||
--prefix=%{_prefix} --bindir=%{_bindir} \
|
||||
--exec-prefix=%{_exec_prefix} \
|
||||
@ -86,10 +94,11 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
||||
cd ..
|
||||
|
||||
%install
|
||||
export PATH="%{_bindir}:${PATH}"
|
||||
rm -rf $SB_BUILD_ROOT
|
||||
%{__rmdir} $SB_BUILD_ROOT
|
||||
|
||||
cd build
|
||||
cd ${build_dir}
|
||||
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
||||
|
||||
cd ..
|
||||
|
||||
%testing
|
||||
|
25
rtems/config/tools/rtems-kernel-4.11.cfg
Normal file
25
rtems/config/tools/rtems-kernel-4.11.cfg
Normal file
@ -0,0 +1,25 @@
|
||||
#
|
||||
# RTEMS 4.11
|
||||
#
|
||||
|
||||
%include %{_configdir}/checks.cfg
|
||||
%include %{_configdir}/base.cfg
|
||||
|
||||
%define rtems_kernel_version 4.11
|
||||
|
||||
#
|
||||
# Pull the latest changes from git each build. Override if this is not what you
|
||||
# want.
|
||||
#
|
||||
Source0: git://git.rtems.org/rtems.git?pull
|
||||
|
||||
#
|
||||
# The code in git needs to be bootstrapped. Do each build because we have
|
||||
# no way to change what changes may have happened in the code.
|
||||
#
|
||||
%define rtems_bootstrap
|
||||
|
||||
#
|
||||
# The RTEMS build instructions. We use 4.xx Release 1.
|
||||
#
|
||||
%include tools/rtems-kernel-4-1.cfg
|
@ -131,7 +131,7 @@ class build:
|
||||
source = download.parse_url(url, '_sourcedir', self.config, self.opts)
|
||||
download.get_file(source['url'], source['local'], self.opts, self.config)
|
||||
if 'symlink' in source:
|
||||
source['script'] = '%%{__ln_s} %s ${source_dir_%d}' % (source['local'], source_tag)
|
||||
source['script'] = '%%{__ln_s} %s ${source_dir_%d}' % (source['symlink'], source_tag)
|
||||
elif 'compressed' in source:
|
||||
source['script'] = source['compressed'] + ' ' + \
|
||||
source['local'] + ' | %{__tar_extract} -'
|
||||
|
@ -32,6 +32,16 @@ import path
|
||||
class repo:
|
||||
"""An object to manage a cvs repo."""
|
||||
|
||||
def __init__(self, _path, opts, macros = None, prefix = None):
|
||||
self.path = _path
|
||||
self.opts = opts
|
||||
self.prefix = prefix
|
||||
if macros is None:
|
||||
self.macros = opts.defaults
|
||||
else:
|
||||
self.macros = macros
|
||||
self.cvs = self.macros.expand('%{__cvs}')
|
||||
|
||||
def _cvs_exit_code(self, cmd, ec, output):
|
||||
if ec:
|
||||
log.output(output)
|
||||
@ -53,9 +63,10 @@ class repo:
|
||||
def _run(self, args, check = False, cwd = None):
|
||||
e = execute.capture_execution()
|
||||
if cwd is None:
|
||||
if not path.exists(self.path):
|
||||
raise error.general('cvs path needs to exist: %s' % (self.path))
|
||||
cwd = self.path
|
||||
_path = path.join(self.path, self.prefix)
|
||||
if not path.exists(_path):
|
||||
raise error.general('cvs path needs to exist: %s' % (_path))
|
||||
cwd = _path
|
||||
cmd = [self.cvs, '-q'] + args
|
||||
log.output('cmd: (%s) %s' % (str(cwd), ' '.join(cmd)))
|
||||
exit_code, proc, output = e.spawn(cmd, cwd = cwd)
|
||||
@ -64,16 +75,6 @@ class repo:
|
||||
self._cvs_exit_code(cmd, exit_code, output)
|
||||
return exit_code, output
|
||||
|
||||
def __init__(self, _path, opts, macros = None, prefix = None):
|
||||
self.path = _path
|
||||
self.opts = opts
|
||||
self.prefix = prefix
|
||||
if macros is None:
|
||||
self.macros = opts.defaults
|
||||
else:
|
||||
self.macros = macros
|
||||
self.cvs = self.macros.expand('%{__cvs}')
|
||||
|
||||
def cvs_version(self):
|
||||
ec, output = self._run(['--version'], True)
|
||||
lines = output.split('\n')
|
||||
@ -98,7 +99,7 @@ class repo:
|
||||
ec, output = self._run(cmd, check = True)
|
||||
|
||||
def update(self):
|
||||
ec, output = self._run(['up'])
|
||||
ec, output = self._run(['up'], check = True)
|
||||
|
||||
def reset(self):
|
||||
ec, output = self._run(['up', '-C'], check = True)
|
||||
|
@ -77,8 +77,14 @@ def _cvs_parser(source, config, opts):
|
||||
except:
|
||||
raise error.general('invalid cvs path: %s' % (source['url']))
|
||||
source['local'] = path.join(source['local_prefix'], 'cvs', source['file'])
|
||||
for a in us[1:]:
|
||||
_as = a.split('=')
|
||||
if _as[0] == 'src-prefix':
|
||||
if len(_as) != 2:
|
||||
raise error.general('invalid cvs src-prefix: %s' % (a))
|
||||
source['src_prefix'] = _as[1]
|
||||
if 'src_prefix' in source:
|
||||
source['symlink'] = path.join(source['local'])
|
||||
source['symlink'] = path.join(source['local'], source['src_prefix'])
|
||||
else:
|
||||
source['symlink'] = source['local']
|
||||
|
||||
@ -225,14 +231,14 @@ def _cvs_downloader(url, local, config, opts):
|
||||
date = _as[1]
|
||||
repo = cvs.repo(local, opts, config.macros, src_prefix)
|
||||
if not repo.valid():
|
||||
log.notice('cvs: checkout: %s -> %s' % (us[0], rlp))
|
||||
if not path.isdir(local):
|
||||
log.notice('Creating source directory: %s' % \
|
||||
(os.path.relpath(path.host(local))))
|
||||
log.output('making dir: %s' % (path.host(path.dirname(local))))
|
||||
if not opts.dry_run():
|
||||
path.mkdir(local)
|
||||
repo.checkout(':%s' % (us[0][6:]), module, tag, date)
|
||||
log.notice('cvs: checkout: %s -> %s' % (us[0], rlp))
|
||||
if not opts.dry_run():
|
||||
repo.checkout(':%s' % (us[0][6:]), module, tag, date)
|
||||
for a in us[1:]:
|
||||
_as = a.split('=')
|
||||
if _as[0] == 'update':
|
||||
|
Loading…
x
Reference in New Issue
Block a user