From c5715172d9b6f6c1fcb5b9ddca6962492380fe86 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Tue, 19 Jun 2018 11:31:36 +1000 Subject: gdb: Add a gdb-common configuration and have gdb-7-1 include it. Updates #3460 --- source-builder/config/gdb-7-1.cfg | 143 +------------------------------ source-builder/config/gdb-8-1.cfg | 7 ++ source-builder/config/gdb-common-1.cfg | 148 +++++++++++++++++++++++++++++++++ 3 files changed, 156 insertions(+), 142 deletions(-) create mode 100644 source-builder/config/gdb-8-1.cfg create mode 100644 source-builder/config/gdb-common-1.cfg diff --git a/source-builder/config/gdb-7-1.cfg b/source-builder/config/gdb-7-1.cfg index d13d536..a415f51 100644 --- a/source-builder/config/gdb-7-1.cfg +++ b/source-builder/config/gdb-7-1.cfg @@ -4,145 +4,4 @@ # This configuration file configure's, make's and install's gdb. # -# -# See if the simulator has been disabled for Windows. -# -# Build using the system's readline, it is in better shape -# than GDB's one with MSYS2. -# -%if %{_host_os} == win32 - %if %{defined win32-gdb-disable-sim} - %define gdb-disable-sim 1 - %endif - %define with_system_readline 1 -%endif - -# -# Default to building simulators. -# -%ifn %{defined gdb-disable-sim} - %define gdb-disable-sim 0 -%else - %undefine gdb-sim-options -%endif - -%include %{_configdir}/checks.cfg - -# -# Select Snapshot Macro Maps -# -%select gdb-snapshot -%select expat-snapshot - -# -# The description. -# -Name: %{_target}-gdb-%{gdb_version}-%{_host}-%{release} -Summary: GDB v%{gdb_version} for target %{_target} on host %{_host} -Version: %{gdb_version} -Release: %{release} -URL: http://www.gnu.org/software/gdb/ -BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) - -# -# GDB has changed it default extension. -# -%ifn %{defined gdb_src_ext} - %define gdb_src_ext gz -%endif - -# -# Source -# -%source set gdb http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.%{gdb_src_ext} - -# -# Disable Python on Cxc builds for now. -# -%if "%{_build}" != "%{_host}" - %define without_python -%endif - -# -# The --with-python option is either the default which is auto or the path to -# the specific python to be used. -# -%if %{defined with_python_path} - %define with_python_option --with-python=%{with_python_path} -%else - %define with_python_option --with-python -%endif - -# -# -# Prepare the source code. -# -%prep - build_top=$(pwd) - - gdb_source=%{?gdb_external:%{gdb_expand_name}}%{!?gdb_external:"gdb-%{gdb_version}"} - - source_dir_gdb=${gdb_source} - %source setup gdb -q -n ${gdb_source} - %patch setup gdb -p1 - - cd ${build_top} - -%build - build_top=$(pwd) - - %{build_directory} - - mkdir -p ${build_dir} - cd ${build_dir} - - %{host_build_flags} - - if test "%{_build}" != "%{_host}" ; then - GDB_LIBS_STATIC="-lexpat" - else - GDB_LIBS_STATIC="-lexpat" - GDB_LIBS="%{_forced_static}" - fi - - LIBS_STATIC=${GDB_LIBS_STATIC} \ - LIBS=${GDB_LIBS} \ - ../${source_dir_gdb}/configure \ - --build=%{_build} --host=%{_host} \ - --target=%{_target} \ - --verbose --disable-nls \ - --disable-gas --disable-binutils --disable-ld --disable-gold --disable-gprof \ - %{?with_system_readline:--with-system-readline} \ - --without-included-gettext \ - --disable-win32-registry \ - --disable-werror \ - %{!?gdb-disable-sim:--enable-sim}%{?gdb-disable-sim:--disable-sim} \ - %{?gdb-sim-options:%{gdb-sim-options}} \ - --without-zlib \ - --with-expat \ - --with-guile=no \ - %{!?without_python:%{with_python_option}} \ - --prefix=%{_prefix} --bindir=%{_bindir} \ - --exec-prefix=%{_exec_prefix} \ - --includedir=%{_includedir} --libdir=%{_libdir} \ - --mandir=%{_mandir} --infodir=%{_infodir} - - %{__make} %{?_smp_mflags} all - - cd ${build_top} - -%install - build_top=$(pwd) - - %{__rmdir} $SB_BUILD_ROOT - - cd ${build_dir} - %{__make} DESTDIR=$SB_BUILD_ROOT install - - # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it. - %{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info* - - %{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir - touch $SB_BUILD_ROOT%{_infodir}/dir - - cd ${build_top} +%include %{_configdir}/gdb-common-1.cfg diff --git a/source-builder/config/gdb-8-1.cfg b/source-builder/config/gdb-8-1.cfg new file mode 100644 index 0000000..dfbe439 --- /dev/null +++ b/source-builder/config/gdb-8-1.cfg @@ -0,0 +1,7 @@ +# +# GDB 8.xx Version 1. +# +# This configuration file configure's, make's and install's gdb. +# + +%include %{_configdir}/gdb-common-1.cfg diff --git a/source-builder/config/gdb-common-1.cfg b/source-builder/config/gdb-common-1.cfg new file mode 100644 index 0000000..fe4dbaf --- /dev/null +++ b/source-builder/config/gdb-common-1.cfg @@ -0,0 +1,148 @@ +# +# GDB Common Version 1. +# +# This configuration file configure's, make's and install's gdb. +# + +# +# See if the simulator has been disabled for Windows. +# +# Build using the system's readline, it is in better shape +# than GDB's one with MSYS2. +# +%if %{_host_os} == win32 + %if %{defined win32-gdb-disable-sim} + %define gdb-disable-sim 1 + %endif + %define with_system_readline 1 +%endif + +# +# Default to building simulators. +# +%ifn %{defined gdb-disable-sim} + %define gdb-disable-sim 0 +%else + %undefine gdb-sim-options +%endif + +%include %{_configdir}/checks.cfg + +# +# Select Snapshot Macro Maps +# +%select gdb-snapshot +%select expat-snapshot + +# +# The description. +# +Name: %{_target}-gdb-%{gdb_version}-%{_host}-%{release} +Summary: GDB v%{gdb_version} for target %{_target} on host %{_host} +Version: %{gdb_version} +Release: %{release} +URL: http://www.gnu.org/software/gdb/ +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) + +# +# GDB has changed it default extension. +# +%ifn %{defined gdb_src_ext} + %define gdb_src_ext gz +%endif + +# +# Source +# +%source set gdb http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.%{gdb_src_ext} + +# +# Disable Python on Cxc builds for now. +# +%if "%{_build}" != "%{_host}" + %define without_python +%endif + +# +# The --with-python option is either the default which is auto or the path to +# the specific python to be used. +# +%if %{defined with_python_path} + %define with_python_option --with-python=%{with_python_path} +%else + %define with_python_option --with-python +%endif + +# +# +# Prepare the source code. +# +%prep + build_top=$(pwd) + + gdb_source=%{?gdb_external:%{gdb_expand_name}}%{!?gdb_external:"gdb-%{gdb_version}"} + + source_dir_gdb=${gdb_source} + %source setup gdb -q -n ${gdb_source} + %patch setup gdb -p1 + + cd ${build_top} + +%build + build_top=$(pwd) + + %{build_directory} + + mkdir -p ${build_dir} + cd ${build_dir} + + %{host_build_flags} + + if test "%{_build}" != "%{_host}" ; then + GDB_LIBS_STATIC="-lexpat" + else + GDB_LIBS_STATIC="-lexpat" + GDB_LIBS="%{_forced_static}" + fi + + LIBS_STATIC=${GDB_LIBS_STATIC} \ + LIBS=${GDB_LIBS} \ + ../${source_dir_gdb}/configure \ + --build=%{_build} --host=%{_host} \ + --target=%{_target} \ + --verbose --disable-nls \ + --disable-gas --disable-binutils --disable-ld --disable-gold --disable-gprof \ + %{?with_system_readline:--with-system-readline} \ + --without-included-gettext \ + --disable-win32-registry \ + --disable-werror \ + %{!?gdb-disable-sim:--enable-sim}%{?gdb-disable-sim:--disable-sim} \ + %{?gdb-sim-options:%{gdb-sim-options}} \ + --without-zlib \ + --with-expat \ + --with-guile=no \ + %{!?without_python:%{with_python_option}} \ + --prefix=%{_prefix} --bindir=%{_bindir} \ + --exec-prefix=%{_exec_prefix} \ + --includedir=%{_includedir} --libdir=%{_libdir} \ + --mandir=%{_mandir} --infodir=%{_infodir} + + %{__make} %{?_smp_mflags} all + + cd ${build_top} + +%install + build_top=$(pwd) + + %{__rmdir} $SB_BUILD_ROOT + + cd ${build_dir} + %{__make} DESTDIR=$SB_BUILD_ROOT install + + # Dropped in FSF-binutils-2.9.5, but Cygwin still ships it. + %{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info* + + %{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir + touch $SB_BUILD_ROOT%{_infodir}/dir + + cd ${build_top} -- cgit v1.2.3