gdb: Build with system readline and use MinGW compilers.

Select MinGW compilers for Windows builds on Windows.

Use the system readline rather than GDB's which does not
handle cmd.exe correctly.

Closes #2681.
This commit is contained in:
Chris Johns
2016-04-13 09:13:55 +10:00
parent febf4fb7d2
commit 1675a73353
2 changed files with 14 additions and 3 deletions

View File

@@ -7,10 +7,14 @@
# #
# See if the simulator has been disabled for Windows. # 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 %{_host_os} == win32
%if %{defined win32-gdb-disable-sim} %if %{defined win32-gdb-disable-sim}
%define gdb-disable-sim 1 %define gdb-disable-sim 1
%endif %endif
%define with_system_readline 1
%endif %endif
# #
@@ -107,6 +111,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
--build=%{_build} --host=%{_host} \ --build=%{_build} --host=%{_host} \
--target=%{_target} \ --target=%{_target} \
--verbose --disable-nls \ --verbose --disable-nls \
%{?with_system_readline:--with-system-readline} \
--without-included-gettext \ --without-included-gettext \
--disable-win32-registry \ --disable-win32-registry \
--disable-werror \ --disable-werror \

View File

@@ -45,6 +45,10 @@ def load():
uname = 'mingw32' uname = 'mingw32'
machine = 'w%s' % (machsize) machine = 'w%s' % (machsize)
# Set the C/C++ compilers we want to use.
cc = '%s-%s-%s-gcc' % (hosttype, machine, uname)
cxx = '%s-%s-%s-g++' % (hosttype, machine, uname)
# See if this is actually MSYS2/Cygwin Python # See if this is actually MSYS2/Cygwin Python
if os.name == 'posix': if os.name == 'posix':
_uname = os.uname() _uname = os.uname()
@@ -54,6 +58,8 @@ def load():
hosttype = _uname[4] hosttype = _uname[4]
uname = 'cygwin' uname = 'cygwin'
machine = 'pc' machine = 'pc'
cc = 'gcc'
cxx = 'g++'
else: else:
raise error.general('invalid POSIX python for Windows') raise error.general('invalid POSIX python for Windows')
@@ -91,13 +97,13 @@ def load():
'__bzip2': ('exe', 'required', 'bzip2'), '__bzip2': ('exe', 'required', 'bzip2'),
'__bison': ('exe', 'required', 'bison'), '__bison': ('exe', 'required', 'bison'),
'__cat': ('exe', 'required', 'cat'), '__cat': ('exe', 'required', 'cat'),
'__cc': ('exe', 'required', 'gcc'), '__cc': ('exe', 'required', cc),
'__chgrp': ('exe', 'required', 'chgrp'), '__chgrp': ('exe', 'required', 'chgrp'),
'__chmod': ('exe', 'required', 'chmod'), '__chmod': ('exe', 'required', 'chmod'),
'__chown': ('exe', 'required', 'chown'), '__chown': ('exe', 'required', 'chown'),
'__cp': ('exe', 'required', 'cp'), '__cp': ('exe', 'required', 'cp'),
'__cvs': ('exe', 'optional', 'cvs'), '__cvs': ('exe', 'optional', 'cvs'),
'__cxx': ('exe', 'required', 'g++'), '__cxx': ('exe', 'required', cxx),
'__flex': ('exe', 'required', 'flex'), '__flex': ('exe', 'required', 'flex'),
'__git': ('exe', 'required', 'git'), '__git': ('exe', 'required', 'git'),
'__grep': ('exe', 'required', 'grep'), '__grep': ('exe', 'required', 'grep'),