]>
git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/config/i386/djgpp.h
1 /* Configuration for an i386 running MS-DOS with DJGPP.
2 Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
4 This file is part of GNU CC.
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)
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.
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. */
24 /* Don't assume anything about the header files. */
25 #define NO_IMPLICIT_EXTERN_C
27 #define HANDLE_SYSV_PRAGMA
29 /* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
30 #define HANDLE_PRAGMA_PACK_PUSH_POP 1
32 #define YES_UNDERSCORES
36 /* Enable alias attribute support. */
38 #define SET_ASM_OP "\t.set"
41 /* Search for as.exe and ld.exe in DJGPP's binary directory. */
42 #define MD_EXEC_PREFIX "$DJDIR/bin/"
44 /* Correctly handle absolute filename detection in cp/xref.c */
45 #define FILE_NAME_ABSOLUTE_P(NAME) \
46 (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
47 (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
52 #define CPP_PREDEFINES "-Dunix -Di386 -DGO32 -DDJGPP=2 -DMSDOS \
53 -Asystem(unix) -Asystem(msdos) -Acpu(i386) -Amachine(i386)"
55 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
56 This cannot be done in LINK_SPECS as that LINK_SPECS is processed
57 before library search directories are known by the linker.
58 This avoids problems when specs file is not available. An alternate way,
59 suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
62 #undef LINK_COMMAND_SPEC
63 #define LINK_COMMAND_SPEC \
65 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \
66 \t%{r} %{s} %{t} %{u*} %{x} %{z} %{Z}\
67 \t%{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
68 \t%{static:} %{L*} %D %o\
69 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
70 \t%{!A:%{!nostdlib:%{!nostartfiles:%E}}}\
71 \t-Tdjgpp.djl %{T*}}}}}}}\n\
72 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
74 /* Make sure that gcc will not look for .h files in /usr/local/include
75 unless user explicitly requests it. */
76 #undef LOCAL_INCLUDE_DIR
79 #define EXTRA_SECTIONS in_ctor, in_dtor
81 #undef EXTRA_SECTION_FUNCTIONS
82 #define EXTRA_SECTION_FUNCTIONS \
83 CTOR_SECTION_FUNCTION \
86 #define CTOR_SECTION_FUNCTION \
90 if (in_section != in_ctor) \
92 fprintf (asm_out_file, "\t.section .ctor\n"); \
93 in_section = in_ctor; \
97 #define DTOR_SECTION_FUNCTION \
101 if (in_section != in_dtor) \
103 fprintf (asm_out_file, "\t.section .dtor\n"); \
104 in_section = in_dtor; \
108 #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
111 fprintf (FILE, "%s\t", ASM_LONG); \
112 assemble_name (FILE, NAME); \
113 fprintf (FILE, "\n"); \
116 /* Allow (eg) __attribute__((section "locked")) to work */
117 #define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)\
119 fprintf (FILE, "\t.section %s\n", NAME); \
122 #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
125 fprintf (FILE, "%s\t", ASM_LONG); \
126 assemble_name (FILE, NAME); \
127 fprintf (FILE, "\n"); \
130 /* Output at beginning of assembler file. */
131 /* The .file command should always begin the output. */
133 #undef ASM_FILE_START
134 #define ASM_FILE_START(FILE) \
136 output_file_directive (FILE, main_input_filename); \
139 /* This is how to output an assembler line
140 that says to advance the location counter
141 to a multiple of 2**LOG bytes. */
143 #undef ASM_OUTPUT_ALIGN
144 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
145 if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
147 /* djgpp has atexit (). */
151 /* djgpp automatically calls its own version of __main, so don't define one
152 in libgcc, nor call one in main(). */
153 #define HAS_INIT_SECTION