00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "config.h"
00023 #include "system.h"
00024 #include "coretypes.h"
00025 #include "tm.h"
00026 #include <string.h>
00027
00028 void
00029 mingw_scan (int argc ATTRIBUTE_UNUSED,
00030 const char *const *argv,
00031 char **spec_machine)
00032 {
00033 putenv (xstrdup ("GCC_CYGWIN_MINGW=0"));
00034
00035 while (*++argv)
00036 if (strcmp (*argv, "-mno-win32") == 0)
00037 putenv (xstrdup ("GCC_CYGWIN_WIN32=0"));
00038 else if (strcmp (*argv, "-mwin32") == 0)
00039 putenv (xstrdup ("GCC_CYGWIN_WIN32=1"));
00040 else if (strcmp (*argv, "-mno-cygwin") == 0)
00041 {
00042 char *p = strstr (*spec_machine, "-cygwin");
00043 if (p)
00044 {
00045 int len = p - *spec_machine;
00046 char *s = xmalloc (strlen (*spec_machine) + 3);
00047 memcpy (s, *spec_machine, len);
00048 strcpy (s + len, "-mingw32");
00049 *spec_machine = s;
00050 }
00051 putenv (xstrdup ("GCC_CYGWIN_MINGW=1"));
00052 }
00053 return;
00054 }