freebsd.h revision 58469
1/* Base configuration file for all FreeBSD targets.
2   Copyright (C) 1999 Free Software Foundation, Inc.
3
4This file is part of GNU CC.
5
6GNU CC is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
8the Free Software Foundation; either version 2, or (at your option)
9any later version.
10
11GNU CC is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU CC; see the file COPYING.  If not, write to
18the Free Software Foundation, 59 Temple Place - Suite 330,
19Boston, MA 02111-1307, USA.  */
20
21/* Common FreeBSD configuration.
22   All FreeBSD architectures should include this file, which will specify
23   their commonalities.
24   Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h &
25   egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien  */
26
27/* $FreeBSD: head/contrib/gcc/config/freebsd.h 58469 2000-03-23 01:20:46Z obrien $ */
28
29
30/* Don't assume anything about the header files.  */
31#undef NO_IMPLICIT_EXTERN_C
32#define NO_IMPLICIT_EXTERN_C
33
34/* This defines which switch letters take arguments.  On FreeBSD, most of
35   the normal cases (defined in gcc.c) apply, and we also have -h* and
36   -z* options (for the linker) (comming from svr4).
37   We also have -R (alias --rpath), no -z, --soname (-h), --assert etc.  */
38
39#define FBSD_SWITCH_TAKES_ARG(CHAR) \
40  (DEFAULT_SWITCH_TAKES_ARG (CHAR) \
41   || (CHAR) == 'h' \
42   || (CHAR) == 'z' /* ignored by ld */ \
43   || (CHAR) == 'R')
44
45#undef SWITCH_TAKES_ARG
46#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR))
47
48#define FBSD_WORD_SWITCH_TAKES_ARG(STR)					\
49  (DEFAULT_WORD_SWITCH_TAKES_ARG (STR)					\
50   || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link")		\
51   || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") 		\
52   || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker"))
53
54#undef WORD_SWITCH_TAKES_ARG
55#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR))
56
57/* Place spaces around this string.  We depend on string splicing to produce
58   the final CPP_PREDEFINES value.  */
59#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__=5 -D__FreeBSD_cc_version=500001 -Asystem(unix) -Asystem(FreeBSD) "
60
61#define FBSD_CPP_SPEC "\
62  %(cpp_cpu) \
63  %{!maout: -D__ELF__} \
64  %{munderscores: -D__UNDERSCORES__} \
65  %{maout: %{!mno-underscores: -D__UNDERSCORES__}} \
66  %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} \
67  %{posix:-D_POSIX_SOURCE}"
68
69#undef CPP_SPEC
70#define CPP_SPEC FBSD_CPP_SPEC
71
72/* Provide a LIB_SPEC appropriate for FreeBSD.  Just select the appropriate
73   libc, depending on whether we're doing profiling.
74   (like the default, except no -lg, and no -p).  */
75#undef LIB_SPEC
76#define LIB_SPEC "%{!shared:%{!pg:%{!pthread:%{!kthread:-lc}%{kthread:-lpthread -lc}}%{pthread:-lc_r}}%{pg:%{!pthread:%{!kthread:-lc_p}%{kthread:-lpthread_p -lc_p}}%{pthread:-lc_r_p}}}"
77
78
79/* Code generation parameters.  */
80
81/* Don't default to pcc-struct-return, because gcc is the only compiler, and
82   we want to retain compatibility with older gcc versions
83   (even though the svr4 ABI for the i386 says that records and unions are
84   returned in memory).  */
85#undef DEFAULT_PCC_STRUCT_RETURN
86#define DEFAULT_PCC_STRUCT_RETURN 0
87
88/* Ensure we the configuration knows our system correctly so we can link with
89   libraries compiled with the native cc.  */
90#undef NO_DOLLAR_IN_LABEL
91
92/* Do not use ``thunks'' to implement C++ vtables.  This method still has
93   fatal bugs.  Also, GCC 3.0 will have a new C++ ABI that may not even
94   support `thunks'.  */
95#undef DEFAULT_VTABLE_THUNKS
96
97/* This is BSD, so we want the DBX format.  */
98#define DBX_DEBUGGING_INFO
99
100/* Use stabs instead of DWARF debug format.  */
101#undef PREFERRED_DEBUGGING_TYPE
102#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
103
104
105/* Miscellaneous parameters.  */
106
107/* Tell libgcc2.c that FreeBSD targets support atexit(3).  */
108#define HAVE_ATEXIT
109