Changeset 369b60a in rtems-source-builder


Ignore:
Timestamp:
09/30/22 07:09:57 (2 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
5
Children:
3dc0431
Parents:
d592ee8
Message:

rtems/bsps: Optionally support arch/bsp if used

Updates #4717

File:
1 edited

Legend:

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

    rd592ee8 r369b60a  
    4141
    4242#
     43# We need a BSP from the user.
     44#
     45%ifn %{defined with_rtems_bsp}
     46 %if %{rtems_bsp_error}
     47  %error No RTEMS BSP specified: --with-rtems-bsp=bsp
     48 %endif
     49 %define with_rtems_bsp sparc/erc32
     50%endif
     51%define rtems_bsp %{with_rtems_bsp}
     52
     53#
     54# If the BSP(s) have a '/' it is the arch/bsp notation.
     55#
     56%define is_arch_bsp %(echo %{rtems_bsp} | sed -e 's/.*\/.*/yes/g')
     57%if %{is_arch_bsp} == yes
     58 %define rtems_ab_bsps \
     59          %(x=''; \
     60            for b in %{rtems_bsp}; do x="$x "$(echo $b | sed -e 's/.*\///g'); done; \
     61            echo $x)
     62 %define rtems_ab_archs  \
     63          %(x=''; \
     64            for b in %{rtems_bsp}; do x="$x "$(echo $b | sed -e 's/\/.*//g'); done; \
     65            echo $x | tr ' ' '\n' | sort | uniq)
     66 %define rtems_arch_count %(echo %{rtems_ab_archs} | tr ' ' '\n' | wc -l)
     67 %if %{rtems_arch_count} != 1
     68  %error Invalid BSP architecture count
     69 %endif
     70 %define rtems_bsp    %{rtems_ab_bsps}
     71 %define rtems_target %{rtems_ab_archs}-rtems%{rtems_version}
     72 %define rtems_host   %{rtems_target}
     73%endif
     74
     75%define rtems_bsp_count %(echo %{rtems_bsp} | tr ' ' '\n' | wc -l)
     76%if %{rtems_bsp_count} != 1
     77  %error Building packages with more than one BSP is not supported
     78%endif
     79
     80#
    4381# We need a host from the user to specifiy the RTEMS architecture and major
    4482# version. It can be defined in rtems_host.
     
    5290 %endif
    5391%endif
    54 
    55 #
    56 # We need a BSP from the user.
    57 #
    58 %ifn %{defined with_rtems_bsp}
    59  %if %{rtems_bsp_error}
    60   %error No RTEMS BSP specified: --with-rtems-bsp=bsp
    61  %endif
    62  %define with_rtems_bsp sparc/erc32
    63 %endif
    64 %define rtems_bsp %{with_rtems_bsp}
    6592
    6693#
     
    216243# Note: default BSP flags include the standard RTEMS libraries.
    217244#
    218 %define rtems-dep-check %(%{_sbdir}/sb/rtems-build-dep -c %{with_tools}/bin/%{rtems_bsp_cc}
    219 
    220 %define rtems-libbsd %{rtems-dep-check} -L %{rtems_bsp_libpath} -l libbsd.a)
     245%define rtems-dep-check %{_sbdir}/sb/rtems-build-dep -c %{with_tools}/bin/%{rtems_bsp_cc}
     246
     247%define rtems-libbsd %(%{rtems-dep-check} -L %{rtems_bsp_libpath} -l libbsd.a)
    221248%if %{rtems-libbsd} == found
    222249 %define rtems_bsp_libs %{rtems_bsp_libs} -lbsd -lm -lz
    223250%endif
    224251
    225 %define rtems-defaultconfig %{rtems-dep-check} -L %{rtems_bsp_libpath} -l librtemsdefaultconfig.a)
     252%define rtems-defaultconfig %(%{rtems-dep-check} -L %{rtems_bsp_libpath} -l librtemsdefaultconfig.a)
    226253%if %{rtems-defaultconfig} == found
    227254 %define rtems_bsp_libs %{rtems_bsp_libs} -lrtemsdefaultconfig
Note: See TracChangeset for help on using the changeset viewer.