]>
Commit | Line | Data |
---|---|---|
af680fe2 | 1 | /* Configuration for GCC for Intel 80386 running DJGPP. |
fbd26352 | 2 | Copyright (C) 1988-2019 Free Software Foundation, Inc. |
1f35756d | 3 | |
af680fe2 | 4 | This file is part of GCC. |
1f35756d | 5 | |
af680fe2 | 6 | GCC is free software; you can redistribute it and/or modify |
1f35756d | 7 | it under the terms of the GNU General Public License as published by |
038d1e19 | 8 | the Free Software Foundation; either version 3, or (at your option) |
1f35756d | 9 | any later version. |
10 | ||
af680fe2 | 11 | GCC is distributed in the hope that it will be useful, |
1f35756d | 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 | |
038d1e19 | 17 | along with GCC; see the file COPYING3. If not see |
18 | <http://www.gnu.org/licenses/>. */ | |
1f35756d | 19 | |
1f35756d | 20 | /* Use semicolons to separate elements of a path. */ |
21 | #define PATH_SEPARATOR ';' | |
ccd8c1fd | 22 | |
10f57222 | 23 | #define HOST_EXECUTABLE_SUFFIX ".exe" |
ccd8c1fd | 24 | |
da024748 | 25 | /* Define standard DJGPP installation paths. */ |
26 | /* We override default /usr or /usr/local part with /dev/env/DJDIR which */ | |
27 | /* points to actual DJGPP installation directory. */ | |
28 | ||
29 | /* Native system include directory */ | |
30 | #undef NATIVE_SYSTEM_HEADER_DIR | |
31 | #define NATIVE_SYSTEM_HEADER_DIR "/dev/env/DJDIR/include/" | |
32 | ||
33 | /* Search for as.exe and ld.exe in DJGPP's binary directory. */ | |
34 | #undef MD_EXEC_PREFIX | |
35 | #define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/" | |
36 | ||
37 | /* Standard DJGPP library and startup files */ | |
38 | #undef STANDARD_STARTFILE_PREFIX_1 | |
39 | #define STANDARD_STARTFILE_PREFIX_1 "/dev/env/DJDIR/lib/" | |
40 | ||
41 | /* Define STANDARD_STARTFILE_PREFIX_2 equal to STANDARD_STARTFILE_PREFIX_1 | |
42 | to avoid gcc.c redefining it to /usr/lib */ | |
43 | #undef STANDARD_STARTFILE_PREFIX_2 | |
44 | #define STANDARD_STARTFILE_PREFIX_1 "/dev/env/DJDIR/lib/" | |
45 | ||
46 | /* Make sure that gcc will not look for .h files in /usr/local/include | |
47 | unless user explicitly requests it. */ | |
48 | #undef LOCAL_INCLUDE_DIR | |
49 | ||
35a3065a | 50 | /* System dependent initialization for collect2 |
3b774709 | 51 | to tell system() to act like Unix. */ |
52 | #define COLLECT2_HOST_INITIALIZATION \ | |
53 | do { __system_flags |= (__system_allow_multiple_cmds \ | |
54 | | __system_emulate_chdir); } while (0) | |
55 | ||
6f933364 | 56 | /* Define a version appropriate for DOS. */ |
57 | #undef XREF_FILE_NAME | |
58 | #define XREF_FILE_NAME(xref_file, file) \ | |
59 | do { \ | |
60 | const char xref_ext[] = ".gxref"; \ | |
61 | strcpy (xref_file, file); \ | |
62 | s = basename (xref_file); \ | |
63 | t = strchr (s, '.'); \ | |
64 | if (t) \ | |
65 | strcpy (t, xref_ext); \ | |
66 | else \ | |
67 | strcat (xref_file, xref_ext); \ | |
afd40440 | 68 | } while (0) |
6f933364 | 69 | |
4e79af62 | 70 | #undef GCC_DRIVER_HOST_INITIALIZATION |
71 | #define GCC_DRIVER_HOST_INITIALIZATION \ | |
72 | do { \ | |
73 | /* If the environment variable DJDIR is not defined, then DJGPP is not \ | |
74 | installed correctly and GCC will quickly become confused with the \ | |
75 | default prefix settings. Report the problem now so the user doesn't \ | |
76 | receive deceptive "file not found" error messages later. */ \ | |
77 | char *djdir = getenv ("DJDIR"); \ | |
78 | if (djdir == NULL) \ | |
79 | { \ | |
80 | /* DJDIR is automatically defined by the DJGPP environment config \ | |
81 | file pointed to by the environment variable DJGPP. Examine DJGPP \ | |
82 | to try and figure out what's wrong. */ \ | |
83 | char *djgpp = getenv ("DJGPP"); \ | |
84 | if (djgpp == NULL) \ | |
da024748 | 85 | fatal_error (UNKNOWN_LOCATION, "environment variable DJGPP not defined"); \ |
4e79af62 | 86 | else if (access (djgpp, R_OK) == 0) \ |
da024748 | 87 | fatal_error (UNKNOWN_LOCATION, "environment variable DJGPP points to missing file '%s'", \ |
4e79af62 | 88 | djgpp); \ |
89 | else \ | |
da024748 | 90 | fatal_error (UNKNOWN_LOCATION, "environment variable DJGPP points to corrupt file '%s'", \ |
4e79af62 | 91 | djgpp); \ |
92 | } \ | |
4e79af62 | 93 | } while (0) |
94 | ||
17b80c08 | 95 | /* Canonicalize paths containing '/dev/env/'; used in prefix.c. |
96 | _fixpath is a djgpp-specific function to canonicalize a path. | |
97 | "/dev/env/DJDIR" evaluates to "c:/djgpp" if DJDIR is "c:/djgpp" for | |
98 | example. It removes any trailing '/', so add it back. */ | |
999e2fe6 | 99 | /* We cannot free PATH below as it can point to string constant */ |
17b80c08 | 100 | #define UPDATE_PATH_HOST_CANONICALIZE(PATH) \ |
101 | if (memcmp ((PATH), "/dev/env/", sizeof("/dev/env/") - 1) == 0) \ | |
102 | { \ | |
103 | static char fixed_path[FILENAME_MAX + 1]; \ | |
104 | \ | |
105 | _fixpath ((PATH), fixed_path); \ | |
106 | strcat (fixed_path, "/"); \ | |
17b80c08 | 107 | (PATH) = xstrdup (fixed_path); \ |
da024748 | 108 | } |
109 | ||
110 | #undef MAX_OFILE_ALIGNMENT | |
111 | #define MAX_OFILE_ALIGNMENT 128 | |
112 | ||
113 | /* DJGPP versions up to current (2.05) have ftw.h but only ftw() not nftw(). | |
114 | Disable use of ftw.h */ | |
115 | #undef HAVE_FTW_H |