OSDN Git Service

2009-04-21 Kai Tietz <kai.tietz@onevision.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Apr 2009 16:41:14 +0000 (16:41 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Apr 2009 16:41:14 +0000 (16:41 +0000)
        * 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146529 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config.gcc
gcc/config/i386/mingw-w64.h [new file with mode: 0644]
gcc/config/i386/mingw-w64.opt [new file with mode: 0644]
gcc/config/i386/t-mingw-w64 [new file with mode: 0644]
gcc/doc/invoke.texi

index dc53ed3..f59688e 100644 (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):
index a2c7032..d4d3889 100644 (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"
diff --git a/gcc/config/i386/mingw-w64.h b/gcc/config/i386/mingw-w64.h
new file mode 100644 (file)
index 0000000..9a2b32e
--- /dev/null
@@ -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"
diff --git a/gcc/config/i386/mingw-w64.opt b/gcc/config/i386/mingw-w64.opt
new file mode 100644 (file)
index 0000000..965f4c0
--- /dev/null
@@ -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
diff --git a/gcc/config/i386/t-mingw-w64 b/gcc/config/i386/t-mingw-w64
new file mode 100644 (file)
index 0000000..bfe1506
--- /dev/null
@@ -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
index f7ea0ef..5d19e2a 100644 (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