Clean up 4.9 build issues.

Add support so 4.9 builds on a recent FreeBSD using clang.
This commit is contained in:
Chris Johns
2016-03-01 14:33:22 +11:00
parent c46f212a89
commit b537e55364
5 changed files with 92 additions and 20 deletions

View File

@@ -1,10 +1,15 @@
#
# GCC 4.7 Version 1.
# GCC 4.3.1 Version 1.
#
# This configuration file configure's, make's and install's gcc. It uses
# newlib, MPFR, MPC, and GMP in a one-tree build configuration.
#
#
# Force the standard of C code for GCC.
#
%define build_cflags %{build_cflags} --std=gnu89
#
# Source
#

View File

@@ -4,6 +4,24 @@
# This configuration file configure's, make's and install's gdb.
#
#
# See if the simulator has been disabled for Windows.
#
%if %{_host_os} == win32
%if %{defined win32-gdb-disable-sim}
%define gdb-disable-sim 1
%endif
%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
Name: %{_target}-gdb-%{gdb_version}-%{_host}-%{release}
@@ -18,31 +36,56 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
#
%source set gdb http://ftp.gnu.org/gnu/gdb/gdb-%{gdb_version}.tar.bz2
#
# Disable Python on Cxc builds for now.
#
%if "%{_build}" != "%{_host}"
%define without_python
%endif
#
# Prepare the source code.
#
%prep
%source setup gdb -q -c -n %{name}-%{version}
cd gdb-%{gdb_version}
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 ..
cd ${build_top}
%build
export PATH="%{_bindir}:${PATH}"
mkdir -p build
cd build
%if "%{_build}" != "%{_host}"
CFLAGS_FOR_BUILD="-g -O2 -Wall" \
%endif
CFLAGS="$SB_CFLAGS" \
../gdb-%{gdb_version}/configure \
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 \
--without-included-gettext \
--disable-win32-registry \
--disable-werror \
--enable-sim \
%{!?gdb-disable-sim:--enable-sim}%{?gdb-disable-sim:--disable-sim} \
%{?gdb-sim-options:%{gdb-sim-options}} \
--without-zlib \
--with-expat \
%{!?without_python:--with-python} \
--prefix=%{_prefix} --bindir=%{_bindir} \
@@ -51,19 +94,21 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
--mandir=%{_mandir} --infodir=%{_infodir}
%{__make} %{?_smp_mflags} all
cd ..
cd ${build_top}
%install
export PATH="%{_bindir}:${PATH}"
rm -rf $SB_BUILD_ROOT
build_top=$(pwd)
cd build
%{__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.
rm -rf $SB_BUILD_ROOT%{_infodir}/configure.info*
%{__rmdir} $SB_BUILD_ROOT%{_infodir}/configure.info*
rm -f $SB_BUILD_ROOT%{_infodir}/dir
%{__rmfile} $SB_BUILD_ROOT%{_infodir}/dir
touch $SB_BUILD_ROOT%{_infodir}/dir
cd ..
cd ${build_top}