1/* Configuration for GNU C-compiler for VAX.
2   Copyright (C) 1987, 1994, 1995, 1996, 1997, 2001
3   Free Software Foundation, Inc.
4
5This file is part of GNU CC.
6
7GNU CC is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2, or (at your option)
10any later version.
11
12GNU CC is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with GNU CC; see the file COPYING.  If not, write to
19the Free Software Foundation, 59 Temple Place - Suite 330,
20Boston, MA 02111-1307, USA.  */
21
22/* Other configurations get these via autoconfig.  */
23#define STDC_HEADERS 1
24#define HAVE_STDLIB_H 1
25#define HAVE_STRING_H 1
26#ifdef __DECC
27#define HAVE_UNISTD_H 1
28#endif
29
30#if defined(VAXC) || defined(__DECC)
31/* if compiling with VAXC, need to fix problem with <stdio.h>
32   which defines a macro called FILE_TYPE that breaks "tree.h".
33   Fortunately it uses #ifndef to suppress multiple inclusions.
34   Three possible cases:
35	1) <stdio.h> has already been included -- ours will be no-op;
36	2) <stdio.h> will be included after us -- "theirs" will be no-op;
37	3) <stdio.h> isn't needed -- including it here shouldn't hurt.
38   In all three cases, the problem macro will be removed here.  */
39#include <stdio.h>
40#undef FILE_TYPE
41#endif
42
43#define SUCCESS_EXIT_CODE 1
44#define FATAL_EXIT_CODE (44 | 0x10000000)  /* Abort, and no DCL message.  */
45
46/* A couple of conditionals for execution machine are controlled here.  */
47#ifndef VMS
48#define VMS
49#endif
50
51#define GCC_INCLUDE_DIR "///not used with VMS///"	/* nonsense string for now */
52
53/* and define a local equivalent (sort of) for unlink */
54#define unlink remove
55
56/* Under VMS a directory specification can be enclosed either in square
57   brackets or in angle brackets.  Thus we need to check both.  This
58   macro is used to help compare filenames in cp-lex.c.
59
60   We also need to make sure that the names are all lower case, because
61   we must be able to compare filenames to determine if a file implements
62   a class.  */
63
64#define FILE_NAME_NONDIRECTORY(C)				\
65({								\
66   char * pnt_ = (C), * pnt1_;					\
67   pnt1_ = pnt_ - 1;						\
68   while (*++pnt1_)						\
69     if (ISUPPER (*pnt1_)) *pnt1_ = TOLOWER (*pnt1_);		\
70   pnt1_ = strrchr (pnt_, ']'); 				\
71   pnt1_ = (pnt1_ == 0 ? strrchr (pnt_, '>') : pnt1_);		\
72   pnt1_ = (pnt1_ == 0 ? strrchr (pnt_, ':') : pnt1_);		\
73   (pnt1_ == 0 ? pnt_ : pnt1_ + 1);				\
74 })
75
76/* Macro to generate the name of the cross reference file.  The standard
77   one does not work, since it was written assuming that the conventions
78   of a unix style filesystem will work on the host system.  */
79
80#define XREF_FILE_NAME(BUFF, NAME)	\
81  s = FILE_NAME_NONDIRECTORY (NAME);			\
82  if (s == NAME) sprintf(BUFF, "%s_gxref", NAME);	\
83  else {						\
84    strcpy(BUFF, NAME);					\
85    strcat(BUFF, "_gxref");				\
86  }
87
88/* Macro that is used in cp-xref.c to determine whether a file name is
89   absolute or not.  */
90
91#define FILE_NAME_ABSOLUTE_P(NAME)	\
92	(FILE_NAME_NONDIRECTORY (NAME) != (&NAME[1]))
93
94/* FILE_NAME_JOINER is defined to be the characters that are inserted between
95   a directory name and a filename in order to make an absolute file
96   specification.  Under VMS the directory specification contains all of the
97   required characters, so we define this to be a null string.  */
98
99#define FILE_NAME_JOINER ""
100
101/* vprintf() has been available since VMS V4.6.  */
102
103#define HAVE_VPRINTF
104
105/* Early versions of VAX C for VMS do not have putenv.  Comment out
106   the following define if your system doesn't have putenv.  */
107#define HAVE_PUTENV
108
109#ifndef HAVE_PUTENV
110#define putenv(x)
111#endif
112
113#if defined(VAXC) || defined(__DECC)
114
115/* Customizations/kludges for building with DEC's VAX C compiler
116   rather than GCC.  */
117
118#define QSORT_WORKAROUND	/* do not use VAXCRTL's qsort */
119
120/* use ANSI/SYSV style byte manipulation routines instead of BSD ones */
121/* rename all too-long external symbol names to avoid warnings */
122#define check_for_full_enumeration_handling	check_for_full_enum_handling
123#define current_function_contains_functions	curfunc_contains_functions
124#define current_function_epilogue_delay_list	curfunc_epilogue_delay_list
125#define current_function_has_nonlocal_goto	curfunc_has_nonlocal_goto
126#define current_function_has_nonlocal_label	curfunc_has_nonlocal_label
127#define current_function_internal_arg_pointer	curfunc_internal_arg_pointer
128#define current_function_outgoing_args_size	curfunc_outgoing_args_size
129#define current_function_pretend_args_size	curfunc_pretend_args_size
130#define current_function_returns_pcc_struct	curfunc_returns_pcc_struct
131#define current_function_returns_pointer	curfunc_returns_pointer
132#define current_function_uses_const_pool	curfunc_uses_const_pool
133#define current_function_uses_pic_offset_table	curfunc_uses_pic_offset_table
134#define dbxout_resume_previous_source_file	dbxout_resume_previous_src_file
135#define expand_builtin_extract_return_addr	expand_builtin_extract_ret_addr
136#define expand_builtin_set_return_addr_reg	expand_builtin_set_ret_addr_reg
137#define expand_start_loop_continue_elsewhere	expnd_start_loop_cont_elsewhere
138#define flag_schedule_insns_after_reload	flag_sched_insns_after_reload
139#define get_dynamic_handler_chain_libfunc	get_dynamic_hndlr_chain_libfunc
140#define lookup_name_current_level_global	lookup_name_current_level_gbl
141#define maybe_building_objc_message_expr	maybe_building_objc_msg_expr
142#define mesg_implicit_function_declaration	mesg_implicit_func_declaration
143#define output_deferred_addressed_constants	output_deferred_addr_constants
144#define protect_cleanup_actions_with_terminate  protect_cleanup_act_w_terminate
145#define reg_overlap_mentioned_for_reload_p	reg_overlap_mtnd_for_reload_p
146#define reposition_prologue_and_epilogue_notes	repos_prolog_and_epilog_notes
147#define rtx_equal_function_value_matters	rtx_equal_func_value_matters
148#define set_new_first_and_last_label_num	set_new_first_and_last_lbl_num
149#define thread_prologue_and_epilogue_insns	thread_prolog_and_epilog_insns
150#endif
151
152/* We need to avoid the library qsort routine, due to a serious bug
153   in VAXCRTL.  (Sorting anything with size that's not a multiple of 4
154   after having previously sorted something that was a multiple of 4
155   can produce wrong results and result in data corruption.)  We'll
156   use our own substitute (in vax.c) instead.  */
157#ifdef QSORT_WORKAROUND
158#define qsort not_qsort
159#endif
160
161#ifdef __DECC
162/* DECC$SHR doesn't have VAXCRTL's bugs.  */
163#undef QSORT_WORKAROUND
164#undef qsort
165/* Avoid a lot of informational level diagnostics about implicitly
166   declared functions.  */
167#include <stdlib.h>
168#include <string.h>
169/* this is for genopinit.c */
170 #pragma message disable (undefescap)
171#endif
172
173#define HOST_EXECUTABLE_SUFFIX ".exe"
174#define HOST_OBJECT_SUFFIX ".obj"
175