freebsd.h revision 45135
145135Sobrien/* Base configuration file for all FreeBSD targets.
245135Sobrien   Copyright (C) 1999 Free Software Foundation, Inc.
345135Sobrien
445135SobrienThis file is part of GNU CC.
545135Sobrien
645135SobrienGNU CC is free software; you can redistribute it and/or modify
745135Sobrienit under the terms of the GNU General Public License as published by
845135Sobrienthe Free Software Foundation; either version 2, or (at your option)
945135Sobrienany later version.
1045135Sobrien
1145135SobrienGNU CC is distributed in the hope that it will be useful,
1245135Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of
1345135SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1445135SobrienGNU General Public License for more details.
1545135Sobrien
1645135SobrienYou should have received a copy of the GNU General Public License
1745135Sobrienalong with GNU CC; see the file COPYING.  If not, write to
1845135Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330,
1945135SobrienBoston, MA 02111-1307, USA.  */
2045135Sobrien
2145135Sobrien/* Common FreeBSD configuration.
2245135Sobrien   All FreeBSD architectures should include this file, which will specify
2345135Sobrien   their commonalities.
2445135Sobrien   Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h &
2545135Sobrien   egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien  */
2645135Sobrien
2745135Sobrien
2845135Sobrien/* Don't assume anything about the header files. */
2945135Sobrien#define NO_IMPLICIT_EXTERN_C
3045135Sobrien
3145135Sobrien/* This defines which switch letters take arguments.  On svr4, most of
3245135Sobrien   the normal cases (defined in gcc.c) apply, and we also have -h* and
3345135Sobrien   -z* options (for the linker).  We have a slightly different mix.  We
3445135Sobrien   have -R (alias --rpath), no -z, --soname (-h), --assert etc. */
3545135Sobrien
3645135Sobrien#undef SWITCH_TAKES_ARG
3745135Sobrien#define SWITCH_TAKES_ARG(CHAR) \
3845135Sobrien  (   (CHAR) == 'D' \
3945135Sobrien   || (CHAR) == 'U' \
4045135Sobrien   || (CHAR) == 'o' \
4145135Sobrien   || (CHAR) == 'e' \
4245135Sobrien   || (CHAR) == 'T' \
4345135Sobrien   || (CHAR) == 'u' \
4445135Sobrien   || (CHAR) == 'I' \
4545135Sobrien   || (CHAR) == 'm' \
4645135Sobrien   || (CHAR) == 'x' \
4745135Sobrien   || (CHAR) == 'L' \
4845135Sobrien   || (CHAR) == 'A' \
4945135Sobrien   || (CHAR) == 'V' \
5045135Sobrien   || (CHAR) == 'B' \
5145135Sobrien   || (CHAR) == 'b' \
5245135Sobrien   || (CHAR) == 'h' \
5345135Sobrien   || (CHAR) == 'z' /* ignored by ld */ \
5445135Sobrien   || (CHAR) == 'R')
5545135Sobrien
5645135Sobrien#undef WORD_SWITCH_TAKES_ARG
5745135Sobrien#define WORD_SWITCH_TAKES_ARG(STR)					\
5845135Sobrien  (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)					\
5945135Sobrien   || !strcmp (STR, "rpath") || !strcmp (STR, "rpath-link")		\
6045135Sobrien   || !strcmp (STR, "soname") || !strcmp (STR, "defsym") 		\
6145135Sobrien   || !strcmp (STR, "assert") || !strcmp (STR, "dynamic-linker"))
6245135Sobrien
6345135Sobrien
6445135Sobrien#define CPP_FBSD_PREDEFINES "-Dunix -D__ELF__ -D__FreeBSD__=4 -D__FreeBSD_cc_version=400001 -Asystem(unix) -Asystem(FreeBSD)"
6545135Sobrien
6645135Sobrien
6745135Sobrien/* Code generation parameters.  */
6845135Sobrien
6945135Sobrien/* Don't default to pcc-struct-return, because gcc is the only compiler, and
7045135Sobrien   we want to retain compatibility with older gcc versions.
7145135Sobrien   (even though the svr4 ABI for the i386 says that records and unions are
7245135Sobrien   returned in memory)  */
7345135Sobrien#define DEFAULT_PCC_STRUCT_RETURN 0
7445135Sobrien
7545135Sobrien/* Ensure we the configuration knows our system correctly so we can link with
7645135Sobrien   libraries compiled with the native cc. */
7745135Sobrien#undef NO_DOLLAR_IN_LABEL
7845135Sobrien
7945135Sobrien
8045135Sobrien/* Miscellaneous parameters.  */
8145135Sobrien
8245135Sobrien/* Tell libgcc2.c that FreeBSD targets support atexit(3).  */
8345135Sobrien#define HAVE_ATEXIT
8445135Sobrien
8545135Sobrien
8645135Sobrien/* FREEBSD_NATIVE is defined when gcc is integrated into the FreeBSD
8745135Sobrien   source tree so it can be configured appropriately without using
8845135Sobrien   the GNU configure/build mechanism. */
8945135Sobrien
9045135Sobrien#ifdef FREEBSD_NATIVE
9145135Sobrien
9245135Sobrien/* Look for the include files in the system-defined places.  */
9345135Sobrien
9445135Sobrien#define GPLUSPLUS_INCLUDE_DIR		"/usr/include/g++"
9545135Sobrien#define GCC_INCLUDE_DIR			"/usr/include"
9645135Sobrien
9745135Sobrien/* Now that GCC knows what the include path applies to, put the G++ one first.
9845135Sobrien   C++ can now have include files that override the default C ones.  */
9945135Sobrien#define INCLUDE_DEFAULTS			\
10045135Sobrien  {						\
10145135Sobrien    { GPLUSPLUS_INCLUDE_DIR, "C++", 1, 1 },	\
10245135Sobrien    { GCC_INCLUDE_DIR, "GCC", 0, 0 },		\
10345135Sobrien    { 0, 0, 0, 0 }				\
10445135Sobrien  }
10545135Sobrien
10645135Sobrien/* Under FreeBSD, the normal location of the compiler back ends is the
10745135Sobrien   /usr/libexec directory.  */
10845135Sobrien
10945135Sobrien#define STANDARD_EXEC_PREFIX		"/usr/libexec/"
11045135Sobrien#define TOOLDIR_BASE_PREFIX		"/usr/libexec/"
11145135Sobrien
11245135Sobrien/* Under FreeBSD, the normal location of the various *crt*.o files is the
11345135Sobrien   /usr/lib directory.  */
11445135Sobrien
11545135Sobrien#define STANDARD_STARTFILE_PREFIX	"/usr/lib/"
11645135Sobrien
11745135Sobrien/* FreeBSD is 4.4BSD derived */
11845135Sobrien#define bsd4_4
11945135Sobrien
12045135Sobrien#endif /* FREEBSD_NATIVE */
121