Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / config / i386 / cygwin1.c
blob68b38dc3d5c507bf32a5ef0a8dad227f56114c16
1 /* Helper routines for cygwin-specific command-line parsing.
2 Contributed by Christopher Faylor (cgf@redhat.com)
3 Copyright 2003, 2005 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to
19 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA. */
22 #include "config.h"
23 #include "system.h"
24 #include "coretypes.h"
25 #include "tm.h"
26 #include <string.h>
28 void
29 mingw_scan (int argc ATTRIBUTE_UNUSED,
30 const char *const *argv,
31 char **spec_machine)
33 putenv (xstrdup ("GCC_CYGWIN_MINGW=0"));
35 while (*++argv)
36 if (strcmp (*argv, "-mno-win32") == 0)
37 putenv (xstrdup ("GCC_CYGWIN_WIN32=0"));
38 else if (strcmp (*argv, "-mwin32") == 0)
39 putenv (xstrdup ("GCC_CYGWIN_WIN32=1"));
40 else if (strcmp (*argv, "-mno-cygwin") == 0)
42 char *p = strstr (*spec_machine, "-cygwin");
43 if (p)
45 int len = p - *spec_machine;
46 char *s = xmalloc (strlen (*spec_machine) + 3);
47 memcpy (s, *spec_machine, len);
48 strcpy (s + len, "-mingw32");
49 *spec_machine = s;
51 putenv (xstrdup ("GCC_CYGWIN_MINGW=1"));
53 return;