OSDN Git Service

* config/i386/i386.c (ix86_expand_setcc): Don't use method 0
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / xm-djgpp.h
1 /* Configuration for GNU C-compiler for Intel 80386 running DJGPP.
2    Copyright (C) 1988, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
3
4 This file is part of GNU CC.
5
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING.  If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* Use semicolons to separate elements of a path.  */
22 #define PATH_SEPARATOR ';'
23
24 #define HOST_EXECUTABLE_SUFFIX ".exe"
25
26 /* Even though we support "/", allow "\" since everybody tests both.  */
27 #define DIR_SEPARATOR '/'
28 #define DIR_SEPARATOR_2 '\\'
29
30 /* Allow test for DOS drive names.  */
31 #define HAVE_DOS_BASED_FILE_SYSTEM
32
33 /* System dependant initialization for collect2
34    to tell system() to act like Unix.  */
35 #define COLLECT2_HOST_INITIALIZATION \
36   do { __system_flags |= (__system_allow_multiple_cmds                  \
37                           | __system_emulate_chdir); } while (0)
38
39 /* Define a version appropriate for DOS.  */
40 #undef XREF_FILE_NAME
41 #define XREF_FILE_NAME(xref_file, file) \
42   do { \
43     const char xref_ext[] = ".gxref"; \
44     strcpy (xref_file, file); \
45     s = basename (xref_file); \
46     t = strchr (s, '.'); \
47     if (t) \
48       strcpy (t, xref_ext); \
49     else \
50       strcat (xref_file, xref_ext); \
51   } while (0)
52
53 /* Change /dev/env/DJDIR/prefix/dir/ to canonical form so gcc_exec_prefix
54    is set properly in 'gcc.c'. It also helps to cut down the number of times
55    the value of the DJGPP environment variable 'DJDIR' is evaluated.  */
56 #undef GCC_DRIVER_HOST_INITIALIZATION
57 #define GCC_DRIVER_HOST_INITIALIZATION \
58   do { \
59     /* If the environment variable DJDIR is not defined, then DJGPP is not \
60        installed correctly and GCC will quickly become confused with the \
61        default prefix settings. Report the problem now so the user doesn't \
62        receive deceptive "file not found" error messages later.  */ \
63     char *djdir = getenv ("DJDIR"); \
64     if (djdir == NULL) \
65       { \
66         /* DJDIR is automatically defined by the DJGPP environment config \
67            file pointed to by the environment variable DJGPP. Examine DJGPP \
68            to try and figure out what's wrong.  */ \
69         char *djgpp = getenv ("DJGPP"); \
70         if (djgpp == NULL) \
71           fatal ("Environment variable DJGPP not defined."); \
72         else if (access (djgpp, R_OK) == 0) \
73           fatal ("Environment variable DJGPP points to missing file '%s'.", \
74                  djgpp); \
75         else \
76           fatal ("Environment variable DJGPP points to corrupt file '%s'.", \
77                   djgpp); \
78       } \
79     standard_exec_prefix = update_path (standard_exec_prefix, NULL); \
80     standard_bindir_prefix = update_path (standard_bindir_prefix, NULL); \
81     standard_startfile_prefix = update_path (standard_startfile_prefix, NULL); \
82     md_exec_prefix = update_path (md_exec_prefix, NULL); \
83   } while (0)
84
85 /* Canonicalize paths containing '/dev/env/', especially those in
86    prefix.c.  */
87 #define UPDATE_PATH_HOST_CANONICALIZE(PATH, KEY) \
88   do { \
89     if (strncmp (PATH, "/dev/env/", sizeof("/dev/env/") - 1) == 0) \
90       { \
91         static char *djdir; \
92         static int djdir_len; \
93         static char fixed_path[FILENAME_MAX + 1]; \
94         char *new_path; \
95         /* The default prefixes all use '/dev/env/DJDIR', so optimize \
96            for this. All other uses of '/dev/env/' go through \
97            libc's canonicalization function.  */ \
98         _fixpath (PATH, fixed_path); \
99         /* _fixpath removes any trailing '/', so add it back.  */ \
100         strcat (fixed_path, "/"); \
101         new_path = xstrdup (fixed_path); \
102         PATH = new_path; \
103         return PATH; \
104       } \
105     /* If DIR_SEPARATOR_2 isn't in PATH, nothing more need be done.  */ \
106     if (strchr (PATH, DIR_SEPARATOR_2) == NULL) \
107       return PATH; \
108   } while (0)