Changeset 257c926 in rtems-source-builder


Ignore:
Timestamp:
Dec 18, 2018, 4:09:37 AM (6 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
40ae056
Parents:
c2d2338
git-author:
Chris Johns <chrisj@…> (12/18/18 04:09:37)
git-committer:
Chris Johns <chrisj@…> (12/24/18 23:15:55)
Message:

gdb/python: Use python-config for the configuration if found.

  • Do not assume the installed paths for the header and library. Ask python-config if found.

Close #3537.

Location:
source-builder
Files:
2 edited

Legend:

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

    rc2d2338 r257c926  
    5252  %else
    5353    %if %{defined gdb-python-version}
    54       %define gdb-enable-python %(command -v %{gdb-python-version || true})
     54      %define gdb-enable-python %(command -v %{gdb-python-version} || true)
    5555    %else
    5656      %define gdb-enable-python %(command -v python2 || true)
     
    7575# The library file name can vary across the hosts so wildcard the search.
    7676#
     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
    7783%define gdb-python-ver-mm %(%{gdb-enable-python} --version 2>&1 | sed -e 's/.* //g' | rev | cut -d'.' -f2- | rev)
    78 %define gdb-python-ver-header python%{gdb-python-ver-mm}/Python.h
     84%define gdb-python-header Python.h
     85%define gdb-python-ver-header python%{gdb-python-ver-mm}/%{gdb-python-header}
    7986%define gdb-python-ver-lib libpython%{gdb-python-ver-mm}.*
    8087%if %{host_includes} == %{nil}
     
    8390  %define gdb-host-incs -I '%{host_includes}'
    8491%endif
    85 %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} -H %{gdb-python-ver-header})
     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
    8698%if %{gdb-python-header-check} == not-found
    8799  %error "gdb: python: header file not found: %{gdb-python-ver-header}, please install"
     
    96108    %define gdb-host-libs -L '%{host_ldflags}'
    97109  %endif
    98   %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-ver-lib})
     110  %if %{gdb-python-config} != %{nil}
     111    %define gdb-python-config-libs -l '%(%{gdb-python-config} --ldflags)'
     112    %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} %{gdb-python-config-libs})
     113  %else
     114    %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-ver-lib})
     115  %endif
    99116  %if %{gdb-python-lib-check} == not-found
    100117    %error "gdb: python: library file not found: %{gdb-python-ver-lib}, please install"
  • source-builder/sb/rtems-build-dep

    rc2d2338 r257c926  
    7373                exit 2
    7474            fi
    75             includes="$2"; shift;
     75            includes="${includes} $2"; shift;
    7676            shift;;
    7777        -l)
Note: See TracChangeset for help on using the changeset viewer.