mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00

The building of 3rd party packages for an RTEMS BSP requires a valid BSP so the standard method to download the source for releasing does not work. This change adds support to allow this. The RTEMS BSP support will not generate an error is no BSP or tools are provided or found. The change addis logic operators to the %if statement so you can '||' to 'or' and '&&' to 'and' logic expressions. A new %log directive has been added to clean up the messages. A new %{!define ...} has been added to aid checking within logic expressions. All command line --with/--without now appear as macros. Add version.version to get just the RTEMS major and minor version. Some pkg-config issues have been resolved. Closes #2655.
111 lines
3.3 KiB
INI
111 lines
3.3 KiB
INI
#
|
|
# RTEMS BSP Support
|
|
#
|
|
|
|
#
|
|
# The RTEMS BSP support requires the host turple, the RTEMS BSP and the path to
|
|
# the tools. The prefix is set to an installed RTEMS. The built package is
|
|
# installed into the prefix.
|
|
#
|
|
# Keeping the package's installed path in the RTEMS install path and separate
|
|
# to the tools lets the tools version vary independently. If --rtems-tools
|
|
# (--with-tools) is not provided use the prefix.
|
|
#
|
|
|
|
#
|
|
# If a dry-run and with download ignore errors and correct setting for tools
|
|
# and BSPs. Only after the source to download.
|
|
#
|
|
%if %{_dry_run} && %{defined with_download}
|
|
%log BSP configuration errors ignored
|
|
%define rtems_bsp_error 0
|
|
%else
|
|
%define rtems_bsp_error 1
|
|
%endif
|
|
|
|
%if %{_target} == %{nil} && %{rtems_bsp_error}
|
|
%error No RTEMS target specified: --rtems-bsp=arch/bsp (or --target=target)
|
|
%endif
|
|
|
|
%if %{_host} != %{_build}
|
|
%error Canadian cross building for BSP is not supported.
|
|
%endif
|
|
|
|
%ifn %{defined with_rtems_bsp}
|
|
%if %{rtems_bsp_error}
|
|
%error No RTEMS BSP specified: --rtems-bsp=arch/bsp (or --with-rtems-bsp=bsp)
|
|
%endif
|
|
%define with_rtems_bsp sparc/erc32
|
|
%endif
|
|
|
|
%ifn %{defined with_tools}
|
|
%define with_tools %{_prefix}
|
|
%endif
|
|
|
|
#
|
|
# Set the host to the target.
|
|
#
|
|
%define _host %{_target}
|
|
|
|
#
|
|
# Set the path to the tools.
|
|
#
|
|
%{path prepend %{with_tools}/bin}
|
|
|
|
#
|
|
# Set up how we manage pkgconfig. Set the prefix path to the RTEMS prefix,
|
|
# enable support when crosscompiling, and filter specific optimisation and
|
|
# warning from the flags that RTEMS exports.
|
|
#
|
|
%{pkgconfig prefix %{_prefix}/lib/pkgconfig}
|
|
%{pkgconfig crosscompile yes}
|
|
%{pkgconfig filter-flags yes}
|
|
|
|
#
|
|
# The RTEMS BSP Flags
|
|
#
|
|
%define rtems_bsp %{with_rtems_bsp}
|
|
%define rtems_bsp_ccflags %{pkgconfig ccflags %{_host}-%{rtems_bsp}}
|
|
%define rtems_bsp_cflags %{pkgconfig cflags %{_host}-%{rtems_bsp}}
|
|
%define rtems_bsp_ldflags %{pkgconfig ldflags %{_host}-%{rtems_bsp}}
|
|
%define rtems_bsp_libs %{pkgconfig libs %{_host}-%{rtems_bsp}}
|
|
|
|
%if %{rtems_bsp_cflags} == %{nil} && %{rtems_bsp_error}
|
|
%error No RTEMS target CFLAGS found; Please check the --rtems-bsp option.
|
|
%endif
|
|
|
|
%if %{rtems_bsp_ccflags} == %{nil}
|
|
%define rtems_bsp_ccflags %{rtems_bsp_cflags}
|
|
%endif
|
|
|
|
#
|
|
# Map to names used for cross compiling.
|
|
#
|
|
%define host_cflags %{rtems_bsp_cflags}
|
|
%define host_cxxflags %{rtems_bsp_ccflags}
|
|
%define host_ldflags %{rtems_bsp_ldflags}
|
|
%define host_libs %{rtems_bsp_libs}
|
|
|
|
#
|
|
# Update the configure paths to be BSP specific.
|
|
#
|
|
%define rtems_bsp_prefix %{_prefix}/%{_host}/%{rtems_bsp}
|
|
%define _exec_prefix %{rtems_bsp_prefix}
|
|
%define _bindir %{_exec_prefix}/bin
|
|
%define _sbindir %{_exec_prefix}/sbin
|
|
%define _libexecdir %{_exec_prefix}/libexec
|
|
%define _datarootdir %{_exec_prefix}/share
|
|
%define _datadir %{_datarootdir}
|
|
%define _sysconfdir %{_exec_prefix}/etc
|
|
%define _sharedstatedir %{_exec_prefix}/com
|
|
%define _localstatedir %{_exec_prefix}/var
|
|
%define _includedir %{_libdir}/include
|
|
%define _lib lib
|
|
%define _libdir %{_exec_prefix}/%{_lib}
|
|
%define _libexecdir %{_exec_prefix}/libexec
|
|
%define _mandir %{_datarootdir}/man
|
|
%define _infodir %{_datarootdir}/info
|
|
%define _localedir %{_datarootdir}/locale
|
|
%define _localedir %{_datadir}/locale
|
|
%define _localstatedir %{_exec_prefix}/var
|