[rtems-source-builder commit] gdb-common: Fix the python-config library parsing

Chris Johns chrisj at rtems.org
Tue Apr 11 22:07:37 UTC 2023


Module:    rtems-source-builder
Branch:    master
Commit:    78913bcbba06b30b0823a4c2152b911cf3c33cd1
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=78913bcbba06b30b0823a4c2152b911cf3c33cd1

Author:    Chris Johns <chrisj at rtems.org>
Date:      Tue Apr 11 05:59:40 2023 +0000

gdb-common: Fix the python-config library parsing

Closes #4894

---

 source-builder/config/gdb-common-1.cfg | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/source-builder/config/gdb-common-1.cfg b/source-builder/config/gdb-common-1.cfg
index a52e64d..0fea334 100644
--- a/source-builder/config/gdb-common-1.cfg
+++ b/source-builder/config/gdb-common-1.cfg
@@ -109,8 +109,8 @@
   %define gdb-host-libs -L '%{host_ldflags}'
 %endif
 %if %{gdb-python-config} != %{nil}
-  %define gdb-python-lib-filter awk 'BEGIN{FS=" "}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print "lib"substr($i,3)"\\*";}'
-  %define gdb-python-libpath-filter awk 'BEGIN{FS=" "}/python/{for(i=1;i<NF;++i)if(match($i,".*L.*")) print substr($i,3);}'
+  %define gdb-python-lib-filter awk '{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print "lib"substr($i,3)"\\*";}'
+  %define gdb-python-libpath-filter awk '{for(i=1;i<NF;++i) if (match($i,"-L.*") == 1) l[substr($i,3)]=1;} END{for(i in l) printf("-L " i " "); printf("\n");}'
   %if %{gdb-python-ver-major} < 3 || \
       %{gdb-python-ver-major} == 3 && %{gdb-python-ver-minor} < 8
       %define gdb-python-config-lib-check-flags --ldflags
@@ -119,7 +119,7 @@
   %endif
   %define gdb-python-config-libs %(%{gdb-python-config} %{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter})
   %define gdb-python-config-libpath %(%{gdb-python-config} %{gdb-python-config-lib-check-flags} | %{gdb-python-libpath-filter} | uniq)
-  %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -L %{gdb-python-config-libpath} -l %{gdb-python-config-libs})
+  %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} %{gdb-python-config-libpath} -l %{gdb-python-config-libs})
 %else
   %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-ver-lib})
 %endif



More information about the vc mailing list