Changeset e827cc2 in rtems-source-builder


Ignore:
Timestamp:
01/25/22 02:32:59 (2 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11
Children:
8aee243
Parents:
0f91a26
git-author:
Chris Johns <chrisj@…> (01/25/22 02:32:59)
git-committer:
Chris Johns <chrisj@…> (01/25/22 06:05:36)
Message:

gdb: Update common to the master version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/config/gdb-common-1.cfg

    r0f91a26 re827cc2  
    4545# 3. Search for 'python2' and if not found search for 'python3'.
    4646#
    47 %if !%{defined without_python}
    48   %if %{defined gdb-python2}
    49     %define gdb-enable-python %{gdb_python2}
    50   %else
    51     %if %{defined gdb-python3}
    52       %define gdb-enable-python %{gdb_python3}
     47%if %{defined gdb-python2}
     48  %define gdb-enable-python %{gdb_python2}
     49%else
     50  %if %{defined gdb-python3}
     51    %define gdb-enable-python %{gdb_python3}
     52  %else
     53    %if %{defined gdb-python-version}
     54      %define gdb-enable-python %(command -v %{gdb-python-version} || true)
    5355    %else
    54       %if %{defined gdb-python-version}
    55         %define gdb-enable-python %(command -v %{gdb-python-version} || true)
    56       %else
    57         %define gdb-enable-python %(command -v python2 || true)
    58         %if %{gdb-enable-python} == %{nil}
    59           %define gdb-enable-python %(command -v python3 || true)
    60         %endif
    61         %if %{gdb-enable-python} == %{nil}
    62           %define gdb-enable-python %(command -v python || true})
    63         %endif
     56      %define gdb-enable-python %(command -v python2 || true)
     57      %if %{gdb-enable-python} == %{nil}
     58        %define gdb-enable-python %(command -v python3 || true)
    6459      %endif
    6560      %if %{gdb-enable-python} == %{nil}
    66         %error "gdb: python: no valid version of python found"
     61          %define gdb-enable-python %(command -v python || true})
    6762      %endif
    6863    %endif
    69   %endif
    70 
    71   #
    72   # Get the Python's major and minor version from the python
    73   # command. The headers and libraries are installed under a major/minor
    74   # (mm) version path and name.
    75   #
    76   # The library file name can vary across the hosts so wildcard the search.
    77   #
    78   %if %{!defined gdb-python-config}
    79     %define gdb-python-config %{nil}
    80   %endif
    81   %if %{gdb-python-config} == %{nil}
    82    %define gdb-python-config %(command -v %{gdb-enable-python}-config || true)
    83   %endif
    84   %define gdb-python-ver-mm %(%{gdb-enable-python} --version 2>&1 | sed -e 's/.* //g' | rev | cut -d'.' -f2- | rev)
    85   %define gdb-python-header Python.h
    86   %define gdb-python-ver-header python%{gdb-python-ver-mm}/%{gdb-python-header}
    87   %define gdb-python-ver-lib libpython%{gdb-python-ver-mm}.*
    88   %if %{host_includes} == %{nil}
    89     %define gdb-host-incs %{nil}
    90   %else
    91     %define gdb-host-incs -I '%{host_includes}'
     64    %if %{gdb-enable-python} == %{nil}
     65      %error "gdb: python: no valid version of python found"
     66    %endif
     67  %endif
     68%endif
     69
     70#
     71# Get the Python's major and minor version from the python
     72# command. The headers and libraries are installed under a major/minor
     73# (mm) version path and name.
     74#
     75# The library file name can vary across the hosts so wildcard the search.
     76#
     77%if %{!defined gdb-python-config}
     78  %define gdb-python-config %{nil}
     79%endif
     80%if %{gdb-python-config} == %{nil}
     81 %define gdb-python-config %(command -v %{gdb-enable-python}-config || true)
     82%endif
     83%define gdb-python-ver-mm %(%{gdb-enable-python} --version 2>&1 | sed -e 's/.* //g' | rev | cut -d'.' -f2- | rev)
     84%define gdb-python-header Python.h
     85%define gdb-python-ver-header python%{gdb-python-ver-mm}/%{gdb-python-header}
     86%define gdb-python-ver-lib libpython%{gdb-python-ver-mm}.*
     87%if %{host_includes} == %{nil}
     88  %define gdb-host-incs %{nil}
     89%else
     90  %define gdb-host-incs -I '%{host_includes}'
     91%endif
     92%if %{gdb-python-config} != %{nil}
     93  %define gdb-python-config-incs -I '%(%{gdb-python-config} --includes)'
     94  %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} %{gdb-python-config-incs} -H %{gdb-python-header})
     95%else
     96  %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} -H %{gdb-python-ver-header})
     97%endif
     98%if %{gdb-python-header-check} == not-found && !%{_rsb_getting_source}
     99  %error "gdb: python: header file not found: %{gdb-python-ver-header}, please install"
     100%endif
     101#
     102# Too hard to find on MacOS (darwin), the header is good enough.
     103#
     104%ifnos darwin
     105  %if %{host_ldflags} == %{nil}
     106    %define gdb-host-libs %{nil}
     107  %else
     108    %define gdb-host-libs -L '%{host_ldflags}'
    92109  %endif
    93110  %if %{gdb-python-config} != %{nil}
    94     %define gdb-python-config-incs -I '%(%{gdb-python-config} --includes)'
    95     %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} %{gdb-python-config-incs} -H %{gdb-python-header})
    96   %else
    97     %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} -H %{gdb-python-ver-header})
    98   %endif
    99   %if %{gdb-python-header-check} == not-found && !%{_rsb_getting_source}
    100     %error "gdb: python: header file not found: %{gdb-python-ver-header}, please install"
    101   %endif
    102   #
    103   # Too hard to find on MacOS (darwin), the header is good enough.
    104   #
    105   %ifnos darwin
    106     %if %{host_ldflags} == %{nil}
    107       %define gdb-host-libs %{nil}
     111    %define gdb-python-lib-filter awk 'BEGIN{FS=" "}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print "lib"substr($i,3)"*";}'
     112    %if %{gdb-python-ver-mm} < 3.8
     113        %define gdb-python-config-lib-check-flags --ldflags
    108114    %else
    109       %define gdb-host-libs -L '%{host_ldflags}'
     115        %define gdb-python-config-lib-check-flags --ldflags --embed
    110116    %endif
    111     %if %{gdb-python-config} != %{nil}
    112       %define gdb-python-lib-filter awk 'BEGIN{FS=" "}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print "lib"substr($i,3)"*";}'
    113       %if %{gdb-python-ver-mm} < 3.8
    114           %define gdb-python-config-lib-check-flags --ldflags
    115       %else
    116           %define gdb-python-config-lib-check-flags --ldflags --embed
    117       %endif
    118       %define gdb-python-config-libs %(%{gdb-python-config} %{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter})
    119       %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-config-libs})
    120     %else
    121       %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-ver-lib})
    122     %endif
    123     %if %{gdb-python-lib-check} == not-found && !%{_rsb_getting_source}
    124       %error "gdb: python: library file not found: %{gdb-python-ver-lib}, please install"
    125     %endif
     117    %define gdb-python-config-libs %(%{gdb-python-config} %{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter})
     118    %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-config-libs})
     119  %else
     120    %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-ver-lib})
     121  %endif
     122  %if %{gdb-python-lib-check} == not-found && !%{_rsb_getting_source}
     123    %error "gdb: python: library file not found: %{gdb-python-ver-lib}, please install"
    126124  %endif
    127125%endif
     
    189187# the specific python to be used.
    190188#
    191 %if !%{defined without_python}
    192   %if %{defined with_python_path}
    193     %define with_python_option --with-python=%{with_python_path}
    194   %else
    195     %if %{defined gdb-enable-python}
    196       %define with_python_option --with-python=%{gdb-enable-python}
    197     %else
    198       %define with_python_option --with-python
    199     %endif
     189%if %{defined with_python_path}
     190  %define with_python_option --with-python=%{with_python_path}
     191%else
     192  %if %{defined gdb-enable-python}
     193    %define with_python_option --with-python=%{gdb-enable-python}
     194  %else
     195    %define with_python_option --with-python
    200196  %endif
    201197%endif
     
    259255    --with-guile=no \
    260256    %{iconv_opts} \
    261     %{?without_python:--without-python} \
    262257    %{!?without_python:%{with_python_option}} \
    263258    --prefix=%{_prefix} --bindir=%{_bindir} \
Note: See TracChangeset for help on using the changeset viewer.