[rtems-source-builder commit] gdb: Update common to the master version

Chris Johns chrisj at rtems.org
Tue Jan 25 05:58:35 UTC 2022


Module:    rtems-source-builder
Branch:    4.11
Commit:    e827cc29c02350b191cc40e0d107f4bf2534d01f
Changeset: http://git.rtems.org/rtems-source-builder/commit/?id=e827cc29c02350b191cc40e0d107f4bf2534d01f

Author:    Chris Johns <chrisj at rtems.org>
Date:      Tue Jan 25 02:32:59 2022 +0000

gdb: Update common to the master version

---

 source-builder/config/gdb-common-1.cfg | 145 ++++++++++++++++-----------------
 1 file changed, 70 insertions(+), 75 deletions(-)

diff --git a/source-builder/config/gdb-common-1.cfg b/source-builder/config/gdb-common-1.cfg
index cfddf53..397d44d 100644
--- a/source-builder/config/gdb-common-1.cfg
+++ b/source-builder/config/gdb-common-1.cfg
@@ -44,85 +44,83 @@
 #
 # 3. Search for 'python2' and if not found search for 'python3'.
 #
-%if !%{defined without_python}
-  %if %{defined gdb-python2}
-    %define gdb-enable-python %{gdb_python2}
+%if %{defined gdb-python2}
+  %define gdb-enable-python %{gdb_python2}
+%else
+  %if %{defined gdb-python3}
+    %define gdb-enable-python %{gdb_python3}
   %else
-    %if %{defined gdb-python3}
-      %define gdb-enable-python %{gdb_python3}
+    %if %{defined gdb-python-version}
+      %define gdb-enable-python %(command -v %{gdb-python-version} || true)
     %else
-      %if %{defined gdb-python-version}
-        %define gdb-enable-python %(command -v %{gdb-python-version} || true)
-      %else
-        %define gdb-enable-python %(command -v python2 || true)
-        %if %{gdb-enable-python} == %{nil}
-          %define gdb-enable-python %(command -v python3 || true)
-        %endif
-        %if %{gdb-enable-python} == %{nil}
-          %define gdb-enable-python %(command -v python || true})
-        %endif
+      %define gdb-enable-python %(command -v python2 || true)
+      %if %{gdb-enable-python} == %{nil}
+        %define gdb-enable-python %(command -v python3 || true)
       %endif
       %if %{gdb-enable-python} == %{nil}
-        %error "gdb: python: no valid version of python found"
+          %define gdb-enable-python %(command -v python || true})
       %endif
     %endif
+    %if %{gdb-enable-python} == %{nil}
+      %error "gdb: python: no valid version of python found"
+    %endif
   %endif
+%endif
 
-  #
-  # Get the Python's major and minor version from the python
-  # command. The headers and libraries are installed under a major/minor
-  # (mm) version path and name.
-  #
-  # The library file name can vary across the hosts so wildcard the search.
-  #
-  %if %{!defined gdb-python-config}
-    %define gdb-python-config %{nil}
-  %endif
-  %if %{gdb-python-config} == %{nil}
-   %define gdb-python-config %(command -v %{gdb-enable-python}-config || true)
-  %endif
-  %define gdb-python-ver-mm %(%{gdb-enable-python} --version 2>&1 | sed -e 's/.* //g' | rev | cut -d'.' -f2- | rev)
-  %define gdb-python-header Python.h
-  %define gdb-python-ver-header python%{gdb-python-ver-mm}/%{gdb-python-header}
-  %define gdb-python-ver-lib libpython%{gdb-python-ver-mm}.*
-  %if %{host_includes} == %{nil}
-    %define gdb-host-incs %{nil}
+#
+# Get the Python's major and minor version from the python
+# command. The headers and libraries are installed under a major/minor
+# (mm) version path and name.
+#
+# The library file name can vary across the hosts so wildcard the search.
+#
+%if %{!defined gdb-python-config}
+  %define gdb-python-config %{nil}
+%endif
+%if %{gdb-python-config} == %{nil}
+ %define gdb-python-config %(command -v %{gdb-enable-python}-config || true)
+%endif
+%define gdb-python-ver-mm %(%{gdb-enable-python} --version 2>&1 | sed -e 's/.* //g' | rev | cut -d'.' -f2- | rev)
+%define gdb-python-header Python.h
+%define gdb-python-ver-header python%{gdb-python-ver-mm}/%{gdb-python-header}
+%define gdb-python-ver-lib libpython%{gdb-python-ver-mm}.*
+%if %{host_includes} == %{nil}
+  %define gdb-host-incs %{nil}
+%else
+  %define gdb-host-incs -I '%{host_includes}'
+%endif
+%if %{gdb-python-config} != %{nil}
+  %define gdb-python-config-incs -I '%(%{gdb-python-config} --includes)'
+  %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} %{gdb-python-config-incs} -H %{gdb-python-header})
+%else
+  %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} -H %{gdb-python-ver-header})
+%endif
+%if %{gdb-python-header-check} == not-found && !%{_rsb_getting_source}
+  %error "gdb: python: header file not found: %{gdb-python-ver-header}, please install"
+%endif
+#
+# Too hard to find on MacOS (darwin), the header is good enough.
+#
+%ifnos darwin
+  %if %{host_ldflags} == %{nil}
+    %define gdb-host-libs %{nil}
   %else
-    %define gdb-host-incs -I '%{host_includes}'
+    %define gdb-host-libs -L '%{host_ldflags}'
   %endif
   %if %{gdb-python-config} != %{nil}
-    %define gdb-python-config-incs -I '%(%{gdb-python-config} --includes)'
-    %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} %{gdb-python-config-incs} -H %{gdb-python-header})
-  %else
-    %define gdb-python-header-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-incs} -H %{gdb-python-ver-header})
-  %endif
-  %if %{gdb-python-header-check} == not-found && !%{_rsb_getting_source}
-    %error "gdb: python: header file not found: %{gdb-python-ver-header}, please install"
-  %endif
-  #
-  # Too hard to find on MacOS (darwin), the header is good enough.
-  #
-  %ifnos darwin
-    %if %{host_ldflags} == %{nil}
-      %define gdb-host-libs %{nil}
-    %else
-      %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)"*";}'
-      %if %{gdb-python-ver-mm} < 3.8
-          %define gdb-python-config-lib-check-flags --ldflags
-      %else
-          %define gdb-python-config-lib-check-flags --ldflags --embed
-      %endif
-      %define gdb-python-config-libs %(%{gdb-python-config} %{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter})
-      %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-config-libs})
+    %define gdb-python-lib-filter awk 'BEGIN{FS=" "}/python/{for(i=1;i<NF;++i)if(match($i,".*lpython.*")) print "lib"substr($i,3)"*";}'
+    %if %{gdb-python-ver-mm} < 3.8
+        %define gdb-python-config-lib-check-flags --ldflags
     %else
-      %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -l %{gdb-python-ver-lib})
-    %endif
-    %if %{gdb-python-lib-check} == not-found && !%{_rsb_getting_source}
-      %error "gdb: python: library file not found: %{gdb-python-ver-lib}, please install"
+        %define gdb-python-config-lib-check-flags --ldflags --embed
     %endif
+    %define gdb-python-config-libs %(%{gdb-python-config} %{gdb-python-config-lib-check-flags} | %{gdb-python-lib-filter})
+    %define gdb-python-lib-check %(%{_sbdir}/sb/rtems-build-dep -c %{__cc} %{gdb-host-libs} -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
+  %if %{gdb-python-lib-check} == not-found && !%{_rsb_getting_source}
+    %error "gdb: python: library file not found: %{gdb-python-ver-lib}, please install"
   %endif
 %endif
 
@@ -188,15 +186,13 @@ URL:       http://www.gnu.org/software/gdb/
 # The --with-python option is either the default which is auto or the path to
 # the specific python to be used.
 #
-%if !%{defined without_python}
-  %if %{defined with_python_path}
-    %define with_python_option --with-python=%{with_python_path}
+%if %{defined with_python_path}
+  %define with_python_option --with-python=%{with_python_path}
+%else
+  %if %{defined gdb-enable-python}
+    %define with_python_option --with-python=%{gdb-enable-python}
   %else
-    %if %{defined gdb-enable-python}
-      %define with_python_option --with-python=%{gdb-enable-python}
-    %else
-      %define with_python_option --with-python
-    %endif
+    %define with_python_option --with-python
   %endif
 %endif
 
@@ -258,7 +254,6 @@ URL:       http://www.gnu.org/software/gdb/
     --with-expat \
     --with-guile=no \
     %{iconv_opts} \
-    %{?without_python:--without-python} \
     %{!?without_python:%{with_python_option}} \
     --prefix=%{_prefix} --bindir=%{_bindir} \
     --exec-prefix=%{_exec_prefix} \



More information about the vc mailing list