Changeset abd98a2 in rtems-source-builder


Ignore:
Timestamp:
Mar 3, 2020, 12:11:17 AM (4 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
5, master
Children:
b9a2f8b
Parents:
96d55ab
git-author:
Chris Johns <chrisj@…> (03/03/20 00:11:17)
git-committer:
Chris Johns <chrisj@…> (03/03/20 00:18:05)
Message:

rtems/bsps: Fix building 3rd party packages with various options

  • Fix locating valid tools and BSP. If either is found in the staging area use that else use the specific --with-* option and if not present use the --prefix.
  • Locate the tools by checking if the arch's C compiler is a valid file. No other checks are made on the tools.
  • Locate a BSB by checking for a valid pkgconfig file for the BSP.
  • Only filter flags if the BSP is in the staging area

Closes #3893

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtems/config/rtems-bsp.cfg

    r96d55ab rabd98a2  
    1111# to the tools lets the tools version vary independently.
    1212#
    13 # Provide the path to the RTEMS tools is not in the prefix with the
     13# Provide the path to the RTEMS tools if not in the prefix with the
    1414# --with-tools option. If --with-tools is not provided use the prefix.
    1515#
    16 # Provide the path to the installed RTEMS kernel is not in the prefix with the
     16# Provide the path to the installed RTEMS kernel if not in the prefix with the
    1717# --with-rtems option. If --with-rtems is not provided use the prefix.
    1818#
     
    3333
    3434#
     35# Set up how we manage pkgconfig. Enable support when crosscompiling,
     36# and filter specific optimisation and warning from the flags that
     37# RTEMS exports.
     38#
     39%{pkgconfig crosscompile yes}
     40%{pkgconfig filter-flags yes}
     41
     42#
    3543# We need a host from the user to specifiy the RTEMS architecture and major
    3644# version. It can be defined in rtems_host.
     
    6169#
    6270%ifn %{defined with_tools}
    63  %if %{install_mode} == staging
     71 %if %{install_mode} == staging && \
     72      %{path check isfile %{stagingroot}/bin/%{_host}-%{_host_cc}}
     73  %define rtems_tools_staged 1
    6474  %define with_tools %{stagingroot}
    6575  %define rtems_waf_tools --rtems-tools=%{with_tools}
    6676 %else
     77  %define rtems_tools_staged 1
    6778  %define with_tools %{_prefix}
    6879  %define rtems_waf_tools %{nil}
     
    7283%endif
    7384
     85%define rtems_host_cc_valid \
     86         %{path check isfile %{with_tools}/bin/%{_host}-%{_host_cc}}
     87%if !%{rtems_host_cc_valid} && %{rtems_bsp_error} && !%{_rsb_getting_source}
     88 %error RTEMS tools not found (%{_host}-%{_host_cc}) found; Please check the --with-tools option or --prefix.
     89%endif
     90
    7491%ifn %{defined with_rtems}
    75  %if %{install_mode} == staging
     92 %{pkgconfig prefix %{stagingroot}/lib/pkgconfig}
     93 %if %{install_mode} == staging && %{pkgconfig check %{_host}-%{rtems_bsp}}
     94  %define rtems_bsp_staged 1
    7695  %define with_rtems %{stagingroot}
    7796  %define rtems_waf_rtems --rtems=%{with_rtems}
    7897 %else
     98  %define rtems_bsp_staged 0
    7999  %define with_rtems %{_prefix}
    80100  %define rtems_waf_rtems %{nil}
     
    82102%else
    83103 %define rtems_waf_rtems --rtems=%{with_rtems}
     104%endif
     105
     106#
     107# Set the pkgconfig prefix path to the RTEMS prefix.
     108#
     109%{pkgconfig prefix %{with_rtems}/lib/pkgconfig}
     110
     111#
     112# Check we can find the BSP's pkgconfig file.
     113#
     114%if !%{pkgconfig check %{_host}-%{rtems_bsp}} && %{rtems_bsp_error} && !%{_rsb_getting_source}
     115 %error RTEMS BSP not found (%{_host}-%{rtems_bsp}.pc); Please check the --with-rtems option or --prefix.
    84116%endif
    85117
     
    113145
    114146#
    115 # Set up how we manage pkgconfig. Set the prefix path to the RTEMS prefix,
    116 # enable support when crosscompiling, and filter specific optimisation and
    117 # warning from the flags that RTEMS exports.
    118 #
    119 %{pkgconfig prefix %{with_rtems}/lib/pkgconfig}
    120 %{pkgconfig crosscompile yes}
    121 %{pkgconfig filter-flags yes}
    122 
    123 #
    124147# The RTEMS BSP Flags
    125148#
     
    156179#
    157180# Filter the flags converting any prefix to the staging path if this is a
    158 # staging build.
    159 #
    160 %if %{install_mode} == staging
     181# staging build of the BSP.
     182#
     183%if %{rtems_bsp_staged}
    161184 %define staging_filter sed -e 's|%{_prefix}|%{stagingroot}|g'
    162185 %define rtems_bsp_prefix     $(echo %{rtems_bsp_prefix}   | %{staging_filter})
Note: See TracChangeset for help on using the changeset viewer.