config.gcc: Add additional configuration for i686-w64-mingw* and x86_64-w64-mingw* triplet.

2009-04-21  Kai Tietz  <kai.tietz@onevision.com>

        * config.gcc: Add additional configuration for
        i686-w64-mingw* and x86_64-w64-mingw* triplet.
        * config/i386/mingw-w64.h: New mingw-w64 specific header.
        (CPP_SPEC): Redefine for allowing -municode option.
        (STARTFILE_SPEC): Likewise.
        * config/i386/t-mingw-w64: New.
        * config/i386/mingw-w64.opt: New.
        (municode): Add new target option.
        * doc/invoke.texi (municode): Add documentation for new option.

From-SVN: r146529
This commit is contained in:
Kai Tietz 2009-04-21 16:41:14 +00:00 committed by Kai Tietz
parent 0267afc48d
commit 350916301f
6 changed files with 101 additions and 3 deletions

View File

@ -1,3 +1,15 @@
2009-04-21 Kai Tietz <kai.tietz@onevision.com>
* config.gcc: Add additional configuration for
i686-w64-mingw* and x86_64-w64-mingw* triplet.
* config/i386/mingw-w64.h: New mingw-w64 specific header.
(CPP_SPEC): Redefine for allowing -municode option.
(STARTFILE_SPEC): Likewise.
* config/i386/t-mingw-w64: New.
* config/i386/mingw-w64.opt: New.
(municode): Add new target option.
* doc/invoke.texi (municode): Add documentation for new option.
2009-04-21 Ian Lance Taylor <iant@google.com>
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):

View File

@ -1251,17 +1251,35 @@ i[34567]86-*-pe | i[34567]86-*-cygwin*)
use_gcc_stdint=wrap
;;
i[34567]86-*-mingw* | x86_64-*-mingw*)
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h i386/mingw-stdint.h"
tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h dbxcoff.h i386/cygming.h i386/mingw32.h"
xm_file=i386/xm-mingw32.h
# This makes the logic if mingw's or the w64 feature set has to be used
case ${target} in
*-w64-*)
tm_file="${tm_file} i386/mingw-w64.h"
tmake_file="${tmake_file} i386/t-mingw-w64"
;;
*)
tmake_file="${tmake_file} i386/t-mingw32"
;;
esac
tm_file="${tm_file} i386/mingw-stdint.h"
# This has to match the logic for DWARF2_UNWIND_INFO in gcc/config/i386/cygming.h
if test x$sjlj = x0; then
tmake_eh_file="i386/t-dw2-eh"
else
tmake_eh_file="i386/t-sjlj-eh"
fi
tmake_file="${tmake_file} ${tmake_eh_file} i386/t-cygming i386/t-mingw32"
tmake_file="${tmake_file} ${tmake_eh_file} i386/t-cygming"
target_gtfiles="\$(srcdir)/config/i386/winnt.c"
extra_options="${extra_options} i386/cygming.opt i386/mingw.opt"
case ${target} in
*-w64-*)
extra_options="${extra_options} i386/mingw-w64.opt"
;;
*)
;;
esac
extra_objs="winnt.o winnt-stubs.o"
c_target_objs="${c_target_objs} msformat-c.o"
cxx_target_objs="${cxx_target_objs} winnt-cxx.o msformat-c.o"

View File

@ -0,0 +1,34 @@
/* Operating system specific defines to be used when targeting GCC for
hosting on Windows 32/64 via mingw-w64 runtime, using GNU tools and
the Windows API Library.
Copyright (C) 2009,
2009 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
/* Enable -municode feature. */
#undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} \
%{municode:-DUNICODE}"
#undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
%{!shared:%{!mdll:%{!municode:crt2%O%s}}} \
%{!shared:%{!mdll:%{municode:crt2u%O%s}}} \
%{pg:gcrt2%O%s} \
crtbegin.o%s"

View File

@ -0,0 +1,23 @@
; MinGW-w64-specific options.
; Copyright (C) 2009 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
; GCC is free software; you can redistribute it and/or modify it under
; the terms of the GNU General Public License as published by the Free
; Software Foundation; either version 3, or (at your option) any later
; version.
;
; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
; WARRANTY; without even the implied warranty of MERCHANTABILITY or
; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
; for more details.
;
; You should have received a copy of the GNU General Public License
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
municode
Target
Use unicode startup and define UNICODE macro

View File

@ -0,0 +1,5 @@
# Match SYSTEM_INCLUDE_DIR
NATIVE_SYSTEM_HEADER_DIR = /mingw/include
# MinGW-specific parts of LIB_SPEC
SHLIB_LC = -lmingw32 -lmingwex -lmoldname -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32

View File

@ -828,7 +828,7 @@ See i386 and x86-64 Options.
@emph{i386 and x86-64 Windows Options}
@gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll
-mnop-fun-dllimport -mthread -mwin32 -mwindows}
-mnop-fun-dllimport -mthread -municode -mwin32 -mwindows}
@emph{Xstormy16 Options}
@gccoptlist{-msim}
@ -15616,6 +15616,12 @@ specifies that the dllimport attribute should be ignored.
This option is available for MinGW targets. It specifies
that MinGW-specific thread support is to be used.
@item -municode
@opindex municode
This option is available for mingw-w64 targets. It specifies
that the UNICODE macro is getting pre-defined and that the
unicode capable runtime startup code is choosen.
@item -mwin32
@opindex mwin32
This option is available for Cygwin and MinGW targets. It