diff --git a/contrib/crossrpms/gdb/build.add b/contrib/crossrpms/gdb/build.add index c2309262bf..cb59d3fe4f 100644 --- a/contrib/crossrpms/gdb/build.add +++ b/contrib/crossrpms/gdb/build.add @@ -4,6 +4,9 @@ %endif mkdir -p build cd build +%if "%{_build}" != "%{_host}" + CFLAGS_FOR_BUILD="-g -O2 -Wall" \ +%endif CFLAGS="$RPM_OPT_FLAGS" \ ../gdb-%{gdb_version}/configure \ --build=%_build --host=%_host \ diff --git a/contrib/crossrpms/gdb/gdb.add b/contrib/crossrpms/gdb/gdb.add index 2678b9dd28..140603b16e 100644 --- a/contrib/crossrpms/gdb/gdb.add +++ b/contrib/crossrpms/gdb/gdb.add @@ -10,9 +10,7 @@ License: GPL/LGPL URL: http://sources.redhat.com/gdb BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -%if "%{_build}" != "%{_host}" -BuildRequires: @rpmprefix@%{_host}-gcc -%endif +BuildRequires: %{_host_rpmprefix}gcc %if "%{gdb_version}" >= "6.6" # suse @@ -23,20 +21,25 @@ BuildRequires: libexpat-devel BuildRequires: expat %endif %else -# fedora/redhat -BuildRequires: expat-devel +# fedora/redhat/cygwin +BuildRequires: %{_host_rpmprefix}expat-devel %endif %endif + +%if "%{gdb_version}" < "6.7" +%if "%{_build}" != "%{_host}" +BuildRequires: %{_host_rpmprefix}termcap-devel +%endif +%endif +BuildRequires: %{_host_rpmprefix}readline-devel +BuildRequires: %{_host_rpmprefix}ncurses-devel + %if %build_infos # Required for building the infos BuildRequires: /sbin/install-info BuildRequires: texinfo >= 4.2 %endif -%if "@tool_target@" == "sparc-rtems@rtems_api@" -BuildConflicts: libtermcap-devel termcap-devel -%endif -BuildRequires: readline-devel -BuildRequires: ncurses-devel + %if %build_infos Requires: @rpmprefix@gdb-common diff --git a/contrib/crossrpms/gdb/prep.add b/contrib/crossrpms/gdb/prep.add index 8ceb63ea4a..dedd1d2cbf 100644 --- a/contrib/crossrpms/gdb/prep.add +++ b/contrib/crossrpms/gdb/prep.add @@ -6,3 +6,7 @@ cd gdb-%{gdb_version} %{?PATCH0:%patch0 -p1} cd .. +%if "%{gdb_version}" >= "6.7" +# Force using a system-provided libreadline +rm -f gdb-%{gdb_version}/readline/configure +%endif