This commit was manufactured by cvs2svn to create branch
[official-gcc.git] / gcc / config / i386 / xm-djgpp.h
blob9bb520da8ef09f0189d0bc7ae9ab192b03d8f9ae
1 /* Configuration for GCC for Intel 80386 running DJGPP.
2 Copyright (C) 1988, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC 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.
11 GCC 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.
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Use semicolons to separate elements of a path. */
22 #define PATH_SEPARATOR ';'
24 #define HOST_EXECUTABLE_SUFFIX ".exe"
26 /* System dependent initialization for collect2
27 to tell system() to act like Unix. */
28 #define COLLECT2_HOST_INITIALIZATION \
29 do { __system_flags |= (__system_allow_multiple_cmds \
30 | __system_emulate_chdir); } while (0)
32 /* Define a version appropriate for DOS. */
33 #undef XREF_FILE_NAME
34 #define XREF_FILE_NAME(xref_file, file) \
35 do { \
36 const char xref_ext[] = ".gxref"; \
37 strcpy (xref_file, file); \
38 s = basename (xref_file); \
39 t = strchr (s, '.'); \
40 if (t) \
41 strcpy (t, xref_ext); \
42 else \
43 strcat (xref_file, xref_ext); \
44 } while (0)
46 #undef GCC_DRIVER_HOST_INITIALIZATION
47 #define GCC_DRIVER_HOST_INITIALIZATION \
48 do { \
49 /* If the environment variable DJDIR is not defined, then DJGPP is not \
50 installed correctly and GCC will quickly become confused with the \
51 default prefix settings. Report the problem now so the user doesn't \
52 receive deceptive "file not found" error messages later. */ \
53 char *djdir = getenv ("DJDIR"); \
54 if (djdir == NULL) \
55 { \
56 /* DJDIR is automatically defined by the DJGPP environment config \
57 file pointed to by the environment variable DJGPP. Examine DJGPP \
58 to try and figure out what's wrong. */ \
59 char *djgpp = getenv ("DJGPP"); \
60 if (djgpp == NULL) \
61 fatal ("environment variable DJGPP not defined"); \
62 else if (access (djgpp, R_OK) == 0) \
63 fatal ("environment variable DJGPP points to missing file '%s'", \
64 djgpp); \
65 else \
66 fatal ("environment variable DJGPP points to corrupt file '%s'", \
67 djgpp); \
68 } \
69 } while (0)
71 /* Canonicalize paths containing '/dev/env/'; used in prefix.c.
72 _fixpath is a djgpp-specific function to canonicalize a path.
73 "/dev/env/DJDIR" evaluates to "c:/djgpp" if DJDIR is "c:/djgpp" for
74 example. It removes any trailing '/', so add it back. */
75 /* We cannot free PATH below as it can point to string constant */
76 #define UPDATE_PATH_HOST_CANONICALIZE(PATH) \
77 if (memcmp ((PATH), "/dev/env/", sizeof("/dev/env/") - 1) == 0) \
78 { \
79 static char fixed_path[FILENAME_MAX + 1]; \
81 _fixpath ((PATH), fixed_path); \
82 strcat (fixed_path, "/"); \
83 (PATH) = xstrdup (fixed_path); \