mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Automtically build the Autotools to bootstrap RTEMS.
This changes adds support to build the autotools if the host installed version is not a suitable version. Autoconf and automake have hard coded references to the install prefix and host tools and this makes it impossible to relocate, that is use in any path other than the install prefix. To bootstrap automake you need to first build a suitable autoconf and with that you can built automake for the install prefix. The other complication is not referencing the install prefix in the path when building in the RSB. Having the install prefix in the path can result in strange issues appearing such as gcc using a new assembler feature not present in an older assember installed under the install prefix. The process is to build the autotools using an install prefix to an internal path inside the RSB temporary path and to use that autoconf to build the version for the install prefix. The internal install prefix version is also used to bootstrap RTEMS.
This commit is contained in:
parent
c2effc143b
commit
ebf8a1f0f8
@ -31,6 +31,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
23
rtems/config/4.11/rtems-autotools-base.bset
Normal file
23
rtems/config/4.11/rtems-autotools-base.bset
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#
|
||||||
|
# Tools Set for RTEMS 4.11 Internal Autotools Stable
|
||||||
|
#
|
||||||
|
|
||||||
|
%define release 1
|
||||||
|
|
||||||
|
%define rtems_arch none
|
||||||
|
|
||||||
|
#
|
||||||
|
# The RTEMS 4.11 base defines.
|
||||||
|
#
|
||||||
|
%include rtems-4.11-base.bset
|
||||||
|
|
||||||
|
#
|
||||||
|
# The autotools package.
|
||||||
|
#
|
||||||
|
package: rtems-%{rtems_version}-autotools-%{release}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Tools configuration.
|
||||||
|
#
|
||||||
|
tools/rtems-autoconf-2.69-1
|
||||||
|
tools/rtems-automake-1.12.6-1
|
13
rtems/config/4.11/rtems-autotools-internal.bset
Normal file
13
rtems/config/4.11/rtems-autotools-internal.bset
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#
|
||||||
|
# Tools Set for RTEMS 4.11 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 4.11/rtems-autotools-base.bset
|
@ -1,23 +1,22 @@
|
|||||||
#
|
#
|
||||||
# Tools Set for RTEMS 4.11 Autotools Stable
|
# Tools Set for RTEMS 4.11 Autotools Stable
|
||||||
#
|
#
|
||||||
|
# Autoconf and automake are not relocatable and cannot be cross-compiled.
|
||||||
%define release 1
|
# RTEMS uses autoconf and automake and building RTEMS in the RSB requires
|
||||||
|
# bootstrapping and this requires a current autoconf and automake. The RSB
|
||||||
%define rtems_arch none
|
# provides to support by:
|
||||||
|
#
|
||||||
|
# 1. Building and installing autoconf and automake with a prefix to a
|
||||||
|
# temporary internal path.
|
||||||
|
# 2. Using the temporary internal build, build and install another copy
|
||||||
|
# using the final prefix location.
|
||||||
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# The RTEMS 4.11 base defines.
|
# A magic internal path that would break if changes in the defaults.mc
|
||||||
|
# macro file are made.
|
||||||
#
|
#
|
||||||
%include rtems-4.11-base.bset
|
%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN}
|
||||||
|
|
||||||
#
|
4.11/rtems-autotools-internal
|
||||||
# The autotoolspackage.
|
4.11/rtems-autotools-base
|
||||||
#
|
|
||||||
package: rtems-%{rtems_version}-autotools-%{release}
|
|
||||||
|
|
||||||
#
|
|
||||||
# Tools configuration.
|
|
||||||
#
|
|
||||||
devel/autoconf-2.69-1
|
|
||||||
devel/automake-1.12.6-1
|
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -24,6 +24,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.5.3-newlib-2.0.0-1
|
tools/rtems-gcc-4.5.3-newlib-2.0.0-1
|
||||||
|
@ -34,6 +34,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
devel/dtc-1.2.0
|
devel/dtc-1.2.0
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-nios2-binutils-2.20-1
|
tools/rtems-nios2-binutils-2.20-1
|
||||||
tools/rtems-nios2-gcc-4.1-newlib-1.19.0-1
|
tools/rtems-nios2-gcc-4.1-newlib-1.19.0-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#
|
#
|
||||||
# Tools configuration.
|
# Tools configuration.
|
||||||
#
|
#
|
||||||
|
4.11/rtems-autotools
|
||||||
devel/expat-2.1.0-1
|
devel/expat-2.1.0-1
|
||||||
tools/rtems-binutils-2.23.2-1
|
tools/rtems-binutils-2.23.2-1
|
||||||
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
tools/rtems-gcc-4.8.1-newlib-cvs-1
|
||||||
|
19
rtems/config/tools/rtems-autoconf-2.69-1.cfg
Normal file
19
rtems/config/tools/rtems-autoconf-2.69-1.cfg
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Autoconf 2.69.
|
||||||
|
#
|
||||||
|
|
||||||
|
%include %{_configdir}/checks.cfg
|
||||||
|
%include %{_configdir}/base.cfg
|
||||||
|
%include %{_configdir}/versions.cfg
|
||||||
|
|
||||||
|
%define rtems_autoconf_version 2.69
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check the version of autoconf in the path.
|
||||||
|
#
|
||||||
|
%if %{__autoconf_ver} < %{rtems_autoconf_version}
|
||||||
|
#
|
||||||
|
# Tools configuration.
|
||||||
|
#
|
||||||
|
%include %{_configdir}/devel/autoconf-2.69-1.cfg
|
||||||
|
%endif
|
19
rtems/config/tools/rtems-automake-1.12.6-1.cfg
Normal file
19
rtems/config/tools/rtems-automake-1.12.6-1.cfg
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#
|
||||||
|
# Automake 1.12.6
|
||||||
|
#
|
||||||
|
|
||||||
|
%include %{_configdir}/checks.cfg
|
||||||
|
%include %{_configdir}/base.cfg
|
||||||
|
%include %{_configdir}/versions.cfg
|
||||||
|
|
||||||
|
%define rtems_automake_version 1.12.6
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check the version of automake in the path.
|
||||||
|
#
|
||||||
|
%if %{__automake_ver} < %{rtems_automake_version}
|
||||||
|
#
|
||||||
|
# Tools configuration.
|
||||||
|
#
|
||||||
|
%include %{_configdir}/devel/automake-1.12.6-1.cfg
|
||||||
|
%endif
|
@ -74,6 +74,9 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
|||||||
%{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
|
%{?patch8:%patch8 %{?patch8_opts:%{patch8_opts}}%{!?patch8_opts:-p1}}
|
||||||
%{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
|
%{?patch9:%patch9 %{?patch9_opts:%{patch9_opts}}%{!?patch9_opts:-p1}}
|
||||||
%if %{rtems_bootstrap}
|
%if %{rtems_bootstrap}
|
||||||
|
%if %{defined _internal_autotools_path}
|
||||||
|
export PATH="%{_internal_autotools_path}/bin:${PATH}"
|
||||||
|
%endif
|
||||||
./bootstrap -c
|
./bootstrap -c
|
||||||
%{_sbdir}/sb-bootstrap --preinstall
|
%{_sbdir}/sb-bootstrap --preinstall
|
||||||
%{_sbdir}/sb-bootstrap
|
%{_sbdir}/sb-bootstrap
|
||||||
|
@ -9,12 +9,19 @@
|
|||||||
%define rtems_kernel_version 4.11
|
%define rtems_kernel_version 4.11
|
||||||
|
|
||||||
#
|
#
|
||||||
# Check the version of autoconf.
|
# Check the version of autoconf. Check autoreconf as it is used.
|
||||||
#
|
#
|
||||||
%if %{__autoconf_ver} <= 2.68
|
%if %{__autoreconf_ver} <= 2.68
|
||||||
%error Autoconf version 2.69 or higher is needed.
|
%if %{__autoreconf_bindir_ver} <= 2.68
|
||||||
|
%error Autoconf (autoreconf) version 2.69 or higher is needed.
|
||||||
|
%endif
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
#
|
||||||
|
# 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}
|
||||||
#
|
#
|
||||||
# Pull the latest changes from git each build. Override if this is not what you
|
# Pull the latest changes from git each build. Override if this is not what you
|
||||||
# want.
|
# want.
|
||||||
|
@ -31,16 +31,14 @@ VersionControl0: git clone git://git.sv.gnu.org/autoconf
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%build
|
%build
|
||||||
if test "%{_internal_autotools}" == "yes"; then
|
%if %{defined _internal_autotools_path}
|
||||||
export PATH="%{_bindir}:${PATH}"
|
export PATH="%{_internal_autotools_path}/bin:${PATH}"
|
||||||
else
|
%endif
|
||||||
export PATH=$SB_ORIG_PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd autoconf-%{autoconf_version}
|
cd autoconf-%{autoconf_version}
|
||||||
|
|
||||||
if test "%{_internal_autotools}" == "yes"; then
|
if test "%{_internal_autotools}" == "yes"; then
|
||||||
ac_prefix=$SB_TMPPREFIX
|
ac_prefix=%{_internal_autotools_path}
|
||||||
else
|
else
|
||||||
ac_prefix=%{_prefix}
|
ac_prefix=%{_prefix}
|
||||||
fi
|
fi
|
||||||
@ -65,11 +63,11 @@ VersionControl0: git clone git://git.sv.gnu.org/autoconf
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
export PATH="%{_bindir}:${PATH}"
|
export PATH="%{_bindir}:${PATH}"
|
||||||
rm -rf $SB_BUILD_ROOT
|
%{__rmdir} $SB_BUILD_ROOT
|
||||||
|
|
||||||
cd autoconf-%{autoconf_version}
|
cd autoconf-%{autoconf_version}
|
||||||
|
|
||||||
if "%{_internal_autotools}" == "yes"; then
|
if test "%{_internal_autotools}" == "yes"; then
|
||||||
%{__make} install
|
%{__make} install
|
||||||
else
|
else
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
||||||
|
@ -31,22 +31,20 @@ VersionControl0: git clone git://git.savannah.gnu.org/automake.git
|
|||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
%build
|
%build
|
||||||
if test "%{_internal_autotools}" == "yes"; then
|
%if %{defined _internal_autotools_path}
|
||||||
export PATH="%{_bindir}:${PATH}"
|
export PATH="%{_internal_autotools_path}/bin:${PATH}"
|
||||||
else
|
%endif
|
||||||
export PATH=$SB_ORIG_PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
cd automake-%{automake_version}
|
cd automake-%{automake_version}
|
||||||
|
|
||||||
if test "%{_internal_autotools}" == "yes"; then
|
if test "%{_internal_autotools}" == "yes"; then
|
||||||
am_prefix=$SB_TMPPREFIX
|
am_prefix=%{_internal_autotools_path}
|
||||||
else
|
else
|
||||||
am_prefix=%{_prefix}
|
am_prefix=%{_prefix}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "%{_build}" != "%{_host}" ; then
|
if test "%{_build}" != "%{_host}" ; then
|
||||||
CFLAGS_FOR_BUILD="-g -O2 -Wall"
|
CFLAGS_FOR_BUILD="-g -O2 -Wall"
|
||||||
fi
|
fi
|
||||||
export CFLAGS CFLAGS_FOR_BUILD CC
|
export CFLAGS CFLAGS_FOR_BUILD CC
|
||||||
|
|
||||||
@ -64,11 +62,11 @@ VersionControl0: git clone git://git.savannah.gnu.org/automake.git
|
|||||||
|
|
||||||
%install
|
%install
|
||||||
export PATH="%{_bindir}:${PATH}"
|
export PATH="%{_bindir}:${PATH}"
|
||||||
rm -rf $SB_BUILD_ROOT
|
%{__rmdir} $SB_BUILD_ROOT
|
||||||
|
|
||||||
cd automake-%{automake_version}
|
cd automake-%{automake_version}
|
||||||
|
|
||||||
if "%{_internal_autotools}" == "yes"; then
|
if test "%{_internal_autotools}" == "yes"; then
|
||||||
%{__make} install
|
%{__make} install
|
||||||
else
|
else
|
||||||
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
%{__make} DESTDIR=$SB_BUILD_ROOT install
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
# Generate version strings.
|
# Generate version strings.
|
||||||
|
|
||||||
%define __makeinfo_ver %(%{__makeinfo} --version | %{__awk} 'NR==1 {print $NF}')
|
%define __makeinfo_ver %(test -x %{__makeinfo} && %{__makeinfo} --version | %{__awk} 'NR==1 {print $NF}' || echo "0")
|
||||||
%define __autoconf_ver %(%{__autoconf} --version | %{__awk} 'NR==1 {print $NF}')
|
%define __autoconf_ver %(test -x %{__autoconf} && %{__autoconf} --version | %{__awk} 'NR==1 {print $NF}' || echo "0")
|
||||||
%define __automake_ver %(%{__automake} --version | %{__awk} 'NR==1 {print $NF}')
|
%define __autoconf_bindir_ver %(test -x %{_bindir}/autoconf && %{_bindir}/autoconf --version | %{__awk} 'NR==1 {print $NF}' || echo "0")
|
||||||
|
%define __autoreconf_ver %(test -x %{__autoreconf} && %{__autoreconf} --version | %{__awk} 'NR==1 {print $NF}' || echo "0")
|
||||||
|
%define __autoreconf_bindir_ver %(test -x %{_bindir}/autoreconf && %{_bindir}/autoreconf --version | %{__awk} 'NR==1 {print $NF}' || echo "0")
|
||||||
|
%define __automake_ver %(test -x %{__automake} && %{__automake} --version | %{__awk} 'NR==1 {print $NF}' || echo "0")
|
||||||
|
%define __automake_bindir_ver %(test -x %{_bindir}/automake && %{_bindir}/automake --version | %{__awk} 'NR==1 {print $NF}' || echo "0")
|
||||||
|
@ -106,9 +106,10 @@ __aclocal: exe, optional, 'aclocal'
|
|||||||
__ar: exe, required, 'ar'
|
__ar: exe, required, 'ar'
|
||||||
__arch_install_post: exe, none, '%{nil}'
|
__arch_install_post: exe, none, '%{nil}'
|
||||||
__as: exe, required, 'as'
|
__as: exe, required, 'as'
|
||||||
__autoconf: exe, required, 'autoconf'
|
__autoconf: exe, optional, 'autoconf'
|
||||||
__autoheader: exe, required, 'autoheader'
|
__autoheader: exe, optional, 'autoheader'
|
||||||
__automake: exe, required, 'automake'
|
__automake: exe, optional, 'automake'
|
||||||
|
__autoreconf: exe, optional, 'autoreconf'
|
||||||
__awk: exe, required, 'awk'
|
__awk: exe, required, 'awk'
|
||||||
__bash: exe, optional, '/bin/bash'
|
__bash: exe, optional, '/bin/bash'
|
||||||
__bison: exe, required, '/usr/bin/bison'
|
__bison: exe, required, '/usr/bin/bison'
|
||||||
|
@ -273,14 +273,15 @@ class build:
|
|||||||
def prep(self, package):
|
def prep(self, package):
|
||||||
self.script.append('echo "==> %prep:"')
|
self.script.append('echo "==> %prep:"')
|
||||||
_prep = package.prep()
|
_prep = package.prep()
|
||||||
for l in _prep:
|
if _prep:
|
||||||
args = l.split()
|
for l in _prep:
|
||||||
if args[0] == '%setup':
|
args = l.split()
|
||||||
self.setup(package, args)
|
if args[0] == '%setup':
|
||||||
elif args[0].startswith('%patch'):
|
self.setup(package, args)
|
||||||
self.patch(package, args)
|
elif args[0].startswith('%patch'):
|
||||||
else:
|
self.patch(package, args)
|
||||||
self.script.append(' '.join(args))
|
else:
|
||||||
|
self.script.append(' '.join(args))
|
||||||
|
|
||||||
def build(self, package):
|
def build(self, package):
|
||||||
self.script.append('echo "==> clean %{buildroot}: ${SB_BUILD_ROOT}"')
|
self.script.append('echo "==> clean %{buildroot}: ${SB_BUILD_ROOT}"')
|
||||||
@ -290,18 +291,21 @@ class build:
|
|||||||
(self.config.expand('%{__mkdir_p}')))
|
(self.config.expand('%{__mkdir_p}')))
|
||||||
self.script.append('echo "==> %build:"')
|
self.script.append('echo "==> %build:"')
|
||||||
_build = package.build()
|
_build = package.build()
|
||||||
for l in _build:
|
if _build:
|
||||||
self.script.append(l)
|
for l in _build:
|
||||||
|
self.script.append(l)
|
||||||
|
|
||||||
def install(self, package):
|
def install(self, package):
|
||||||
self.script.append('echo "==> %install:"')
|
self.script.append('echo "==> %install:"')
|
||||||
_install = package.install()
|
_install = package.install()
|
||||||
for l in _install:
|
if _install:
|
||||||
args = l.split()
|
for l in _install:
|
||||||
self.script.append(' '.join(args))
|
args = l.split()
|
||||||
|
self.script.append(' '.join(args))
|
||||||
|
|
||||||
def files(self, package):
|
def files(self, package):
|
||||||
if self.create_tar_files:
|
if self.create_tar_files \
|
||||||
|
and not self.macros.get('%{_disable_packaging'):
|
||||||
self.script.append('echo "==> %files:"')
|
self.script.append('echo "==> %files:"')
|
||||||
inpath = path.abspath(self.config.expand('%{buildroot}'))
|
inpath = path.abspath(self.config.expand('%{buildroot}'))
|
||||||
tardir = path.abspath(self.config.expand('%{_tardir}'))
|
tardir = path.abspath(self.config.expand('%{_tardir}'))
|
||||||
@ -335,7 +339,8 @@ class build:
|
|||||||
self.clean(package)
|
self.clean(package)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
if not self.opts.no_clean():
|
package = self.main_package()
|
||||||
|
if not package.disabled() and not self.opts.no_clean():
|
||||||
buildroot = self.config.abspath('buildroot')
|
buildroot = self.config.abspath('buildroot')
|
||||||
builddir = self.config.abspath('_builddir')
|
builddir = self.config.abspath('_builddir')
|
||||||
buildcxcdir = self.config.abspath('_buildcxcdir')
|
buildcxcdir = self.config.abspath('_buildcxcdir')
|
||||||
@ -356,35 +361,43 @@ class build:
|
|||||||
|
|
||||||
def make(self):
|
def make(self):
|
||||||
package = self.main_package()
|
package = self.main_package()
|
||||||
name = package.name()
|
if package.disabled():
|
||||||
if self.canadian_cross():
|
log.notice('package: nothing to build')
|
||||||
log.notice('package: (Cxc) %s' % (name))
|
|
||||||
else:
|
else:
|
||||||
log.notice('package: %s' % (name))
|
name = package.name()
|
||||||
log.trace('---- macro maps %s' % ('-' * 55))
|
|
||||||
log.trace('%s' % (str(self.config.macros)))
|
|
||||||
log.trace('-' * 70)
|
|
||||||
self.script.reset()
|
|
||||||
self.script.append(self.config.expand('%{___build_template}'))
|
|
||||||
self.script.append('echo "=> ' + name + ':"')
|
|
||||||
self.prep(package)
|
|
||||||
self.build_package(package)
|
|
||||||
if not self.opts.dry_run():
|
|
||||||
self.builddir()
|
|
||||||
sn = path.join(self.config.expand('%{_builddir}'), 'doit')
|
|
||||||
log.output('write script: ' + sn)
|
|
||||||
self.script.write(sn)
|
|
||||||
if self.canadian_cross():
|
if self.canadian_cross():
|
||||||
log.notice('building: (Cxc) %s' % (name))
|
log.notice('package: (Cxc) %s' % (name))
|
||||||
else:
|
else:
|
||||||
log.notice('building: %s' % (name))
|
log.notice('package: %s' % (name))
|
||||||
self.run(sn)
|
log.trace('---- macro maps %s' % ('-' * 55))
|
||||||
|
log.trace('%s' % (str(self.config.macros)))
|
||||||
|
log.trace('-' * 70)
|
||||||
|
self.script.reset()
|
||||||
|
self.script.append(self.config.expand('%{___build_template}'))
|
||||||
|
self.script.append('echo "=> ' + name + ':"')
|
||||||
|
self.prep(package)
|
||||||
|
self.build_package(package)
|
||||||
|
if not self.opts.dry_run():
|
||||||
|
self.builddir()
|
||||||
|
sn = path.join(self.config.expand('%{_builddir}'), 'doit')
|
||||||
|
log.output('write script: ' + sn)
|
||||||
|
self.script.write(sn)
|
||||||
|
if self.canadian_cross():
|
||||||
|
log.notice('building: (Cxc) %s' % (name))
|
||||||
|
else:
|
||||||
|
log.notice('building: %s' % (name))
|
||||||
|
self.run(sn)
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
packages = self.config.packages()
|
packages = self.config.packages()
|
||||||
package = packages['main']
|
package = packages['main']
|
||||||
return package.name()
|
return package.name()
|
||||||
|
|
||||||
|
def disabled(self):
|
||||||
|
packages = self.config.packages()
|
||||||
|
package = packages['main']
|
||||||
|
return package.disabled()
|
||||||
|
|
||||||
def get_configs(opts):
|
def get_configs(opts):
|
||||||
|
|
||||||
def _scan(_path, ext):
|
def _scan(_path, ext):
|
||||||
|
@ -203,6 +203,9 @@ class package:
|
|||||||
def long_name(self):
|
def long_name(self):
|
||||||
return self.name()
|
return self.name()
|
||||||
|
|
||||||
|
def disabled(self):
|
||||||
|
return len(self.name()) == 0
|
||||||
|
|
||||||
class file:
|
class file:
|
||||||
"""Parse a config file."""
|
"""Parse a config file."""
|
||||||
|
|
||||||
@ -540,6 +543,11 @@ class file:
|
|||||||
return text
|
return text
|
||||||
if r[1] == '%else':
|
if r[1] == '%else':
|
||||||
in_iftrue = False
|
in_iftrue = False
|
||||||
|
elif r[0] == 'directive':
|
||||||
|
if r[1] == '%include':
|
||||||
|
self.load(r[2][0])
|
||||||
|
else:
|
||||||
|
log.warning("directive not supported in if: '%s'" % (' '.join(r[2])))
|
||||||
elif r[0] == 'data':
|
elif r[0] == 'data':
|
||||||
if this_isvalid:
|
if this_isvalid:
|
||||||
text.extend(r[1])
|
text.extend(r[1])
|
||||||
|
@ -523,6 +523,8 @@ def load(args, optargs = None, defaults = '%{_sbdir}/defaults.mc'):
|
|||||||
o.process()
|
o.process()
|
||||||
o.post_process()
|
o.post_process()
|
||||||
|
|
||||||
|
log.notice(' '.join(args))
|
||||||
|
|
||||||
return o
|
return o
|
||||||
|
|
||||||
def run(args):
|
def run(args):
|
||||||
|
@ -99,7 +99,9 @@ class buildset:
|
|||||||
raise error.general('copying tree: %s' % (str(err)))
|
raise error.general('copying tree: %s' % (str(err)))
|
||||||
|
|
||||||
def report(self, _config, _build):
|
def report(self, _config, _build):
|
||||||
if not _build.opts.get_arg('--no-report') and _build.opts.get_arg('--mail'):
|
if not _build.opts.get_arg('--no-report') \
|
||||||
|
and not _build.macros.get('%{_disable_reporting}') \
|
||||||
|
and _build.opts.get_arg('--mail'):
|
||||||
format = _build.opts.get_arg('--report-format')
|
format = _build.opts.get_arg('--report-format')
|
||||||
if format is None:
|
if format is None:
|
||||||
format = 'html'
|
format = 'html'
|
||||||
@ -172,20 +174,24 @@ class buildset:
|
|||||||
_build.make()
|
_build.make()
|
||||||
for m in macros_to_save:
|
for m in macros_to_save:
|
||||||
_build.config.set_define(m, orig_macros[m])
|
_build.config.set_define(m, orig_macros[m])
|
||||||
self.root_copy(_build.config.expand('%{buildcxcroot}'),
|
if not _build.macros.get('%{_disable_collecting}'):
|
||||||
_build.config.expand('%{_tmpcxcroot}'))
|
self.root_copy(_build.config.expand('%{buildcxcroot}'),
|
||||||
|
_build.config.expand('%{_tmpcxcroot}'))
|
||||||
|
|
||||||
def build_package(self, _config, _build):
|
def build_package(self, _config, _build):
|
||||||
if _build.canadian_cross():
|
if not _build.disabled():
|
||||||
self.canadian_cross(_build)
|
if _build.canadian_cross():
|
||||||
_build.make()
|
self.canadian_cross(_build)
|
||||||
self.report(_config, _build)
|
_build.make()
|
||||||
self.root_copy(_build.config.expand('%{buildroot}'),
|
self.report(_config, _build)
|
||||||
_build.config.expand('%{_tmproot}'))
|
if not _build.macros.get('%{_disable_collecting}'):
|
||||||
|
self.root_copy(_build.config.expand('%{buildroot}'),
|
||||||
|
_build.config.expand('%{_tmproot}'))
|
||||||
|
|
||||||
def bset_tar(self, _build):
|
def bset_tar(self, _build):
|
||||||
tardir = _build.config.expand('%{_tardir}')
|
tardir = _build.config.expand('%{_tardir}')
|
||||||
if self.opts.get_arg('--bset-tar-file'):
|
if self.opts.get_arg('--bset-tar-file') \
|
||||||
|
and not _build.macros.get('%{_disable_packaging}'):
|
||||||
path.mkdir(tardir)
|
path.mkdir(tardir)
|
||||||
tar = path.join(tardir, _build.config.expand('%s.tar.bz2' % (self.bset_pkg)))
|
tar = path.join(tardir, _build.config.expand('%s.tar.bz2' % (self.bset_pkg)))
|
||||||
log.notice('tarball: %s' % (os.path.relpath(path.host(tar))))
|
log.notice('tarball: %s' % (os.path.relpath(path.host(tar))))
|
||||||
@ -306,6 +312,7 @@ class buildset:
|
|||||||
try:
|
try:
|
||||||
builds = []
|
builds = []
|
||||||
for s in range(0, len(configs)):
|
for s in range(0, len(configs)):
|
||||||
|
b = None
|
||||||
try:
|
try:
|
||||||
#
|
#
|
||||||
# Each section of the build set gets a separate set of
|
# Each section of the build set gets a separate set of
|
||||||
@ -334,30 +341,36 @@ class buildset:
|
|||||||
else:
|
else:
|
||||||
raise error.general('invalid config type: %s' % (configs[s]))
|
raise error.general('invalid config type: %s' % (configs[s]))
|
||||||
except error.general, gerr:
|
except error.general, gerr:
|
||||||
if self.build_failure is None:
|
if b is not None:
|
||||||
self.build_failure = b.name()
|
if self.build_failure is None:
|
||||||
self.write_mail_header('')
|
self.build_failure = b.name()
|
||||||
self.write_mail_header('= ' * 40)
|
self.write_mail_header('')
|
||||||
self.write_mail_header('Build FAILED: %s' % (b.name()))
|
self.write_mail_header('= ' * 40)
|
||||||
self.write_mail_header('- ' * 40)
|
self.write_mail_header('Build FAILED: %s' % (b.name()))
|
||||||
self.write_mail_header(str(log.default))
|
self.write_mail_header('- ' * 40)
|
||||||
self.write_mail_header('- ' * 40)
|
self.write_mail_header(str(log.default))
|
||||||
if self.opts.keep_going():
|
self.write_mail_header('- ' * 40)
|
||||||
print gerr
|
if self.opts.keep_going():
|
||||||
if self.opts.always_clean():
|
print gerr
|
||||||
builds += [b]
|
if self.opts.always_clean():
|
||||||
|
builds += [b]
|
||||||
|
else:
|
||||||
|
raise
|
||||||
else:
|
else:
|
||||||
raise
|
raise
|
||||||
if deps is None and not self.opts.no_install():
|
if deps is None and not self.opts.no_install():
|
||||||
for b in builds:
|
for b in builds:
|
||||||
self.install(b.name(),
|
if not b.disabled() \
|
||||||
b.config.expand('%{buildroot}'),
|
and not b.macros.get('%{_disable_installing}'):
|
||||||
b.config.expand('%{_prefix}'))
|
self.install(b.name(),
|
||||||
|
b.config.expand('%{buildroot}'),
|
||||||
|
b.config.expand('%{_prefix}'))
|
||||||
if deps is None and \
|
if deps is None and \
|
||||||
(not self.opts.no_clean() or self.opts.always_clean()):
|
(not self.opts.no_clean() or self.opts.always_clean()):
|
||||||
for b in builds:
|
for b in builds:
|
||||||
log.notice('cleaning: %s' % (b.name()))
|
if not b.disabled():
|
||||||
b.cleanup()
|
log.notice('cleaning: %s' % (b.name()))
|
||||||
|
b.cleanup()
|
||||||
for b in builds:
|
for b in builds:
|
||||||
del b
|
del b
|
||||||
except error.general, gerr:
|
except error.general, gerr:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user