1 /* Configuration for GCC for Intel 80386 running DJGPP.
2 Copyright (C) 1988-2015 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 3, or (at your option)
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 COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
20 /* Use semicolons to separate elements of a path. */
21 #define PATH_SEPARATOR ';'
23 #define HOST_EXECUTABLE_SUFFIX ".exe"
25 /* System dependent initialization for collect2
26 to tell system() to act like Unix. */
27 #define COLLECT2_HOST_INITIALIZATION \
28 do { __system_flags |= (__system_allow_multiple_cmds \
29 | __system_emulate_chdir); } while (0)
31 /* Define a version appropriate for DOS. */
33 #define XREF_FILE_NAME(xref_file, file) \
35 const char xref_ext[] = ".gxref"; \
36 strcpy (xref_file, file); \
37 s = basename (xref_file); \
38 t = strchr (s, '.'); \
40 strcpy (t, xref_ext); \
42 strcat (xref_file, xref_ext); \
45 #undef GCC_DRIVER_HOST_INITIALIZATION
46 #define GCC_DRIVER_HOST_INITIALIZATION \
48 /* If the environment variable DJDIR is not defined, then DJGPP is not \
49 installed correctly and GCC will quickly become confused with the \
50 default prefix settings. Report the problem now so the user doesn't \
51 receive deceptive "file not found" error messages later. */ \
52 char *djdir = getenv ("DJDIR"); \
55 /* DJDIR is automatically defined by the DJGPP environment config \
56 file pointed to by the environment variable DJGPP. Examine DJGPP \
57 to try and figure out what's wrong. */ \
58 char *djgpp = getenv ("DJGPP"); \
60 fatal ("environment variable DJGPP not defined"); \
61 else if (access (djgpp, R_OK) == 0) \
62 fatal ("environment variable DJGPP points to missing file '%s'", \
65 fatal ("environment variable DJGPP points to corrupt file '%s'", \
70 /* Canonicalize paths containing '/dev/env/'; used in prefix.c.
71 _fixpath is a djgpp-specific function to canonicalize a path.
72 "/dev/env/DJDIR" evaluates to "c:/djgpp" if DJDIR is "c:/djgpp" for
73 example. It removes any trailing '/', so add it back. */
74 /* We cannot free PATH below as it can point to string constant */
75 #define UPDATE_PATH_HOST_CANONICALIZE(PATH) \
76 if (memcmp ((PATH), "/dev/env/", sizeof("/dev/env/") - 1) == 0) \
78 static char fixed_path[FILENAME_MAX + 1]; \
80 _fixpath ((PATH), fixed_path); \
81 strcat (fixed_path, "/"); \
82 (PATH) = xstrdup (fixed_path); \