freebsd.h revision 53179
1133819Stjr/* Base configuration file for all FreeBSD targets. 2133819Stjr Copyright (C) 1999 Free Software Foundation, Inc. 3133819Stjr 4133819StjrThis file is part of GNU CC. 5133819Stjr 6276811SdchaginGNU CC is free software; you can redistribute it and/or modify 7133819Stjrit under the terms of the GNU General Public License as published by 8133819Stjrthe Free Software Foundation; either version 2, or (at your option) 9156875Sruany later version. 10133819Stjr 11133819StjrGNU CC is distributed in the hope that it will be useful, 12133819Stjrbut WITHOUT ANY WARRANTY; without even the implied warranty of 13143198SsobomaxMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14133819StjrGNU General Public License for more details. 15133819Stjr 16133819StjrYou should have received a copy of the GNU General Public License 17133819Stjralong with GNU CC; see the file COPYING. If not, write to 18133819Stjrthe Free Software Foundation, 59 Temple Place - Suite 330, 19133819StjrBoston, MA 02111-1307, USA. */ 20133819Stjr 21143198Ssobomax/* Common FreeBSD configuration. 22209581Skib All FreeBSD architectures should include this file, which will specify 23225618Skmacy their commonalities. 24209581Skib Adapted from /usr/src/contrib/gcc/config/i386/freebsd.h & 25225618Skmacy egcs/gcc/config/i386/freebsd-elf.h version by David O'Brien */ 26225618Skmacy 27209581Skib/* $FreeBSD: head/contrib/gcc/config/freebsd.h 53179 1999-11-15 07:57:13Z obrien $ */ 28225618Skmacy 29209581Skib 30209581Skib/* Don't assume anything about the header files. */ 31209581Skib#undef NO_IMPLICIT_EXTERN_C 32209581Skib#define NO_IMPLICIT_EXTERN_C 33209581Skib 34209581Skib/* This defines which switch letters take arguments. On FreeBSD, most of 35209581Skib the normal cases (defined in gcc.c) apply, and we also have -h* and 36209581Skib -z* options (for the linker) (comming from svr4). 37209581Skib We also have -R (alias --rpath), no -z, --soname (-h), --assert etc. */ 38209581Skib 39209581Skib#define FBSD_SWITCH_TAKES_ARG(CHAR) \ 40209581Skib (DEFAULT_SWITCH_TAKES_ARG (CHAR) \ 41209581Skib || (CHAR) == 'h' \ 42209581Skib || (CHAR) == 'z' /* ignored by ld */ \ 43209581Skib || (CHAR) == 'R') 44209581Skib 45209581Skib#undef SWITCH_TAKES_ARG 46209581Skib#define SWITCH_TAKES_ARG(CHAR) (FBSD_SWITCH_TAKES_ARG(CHAR)) 47209581Skib 48209581Skib#define FBSD_WORD_SWITCH_TAKES_ARG(STR) \ 49209581Skib (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ 50209581Skib || !strcmp ((STR), "rpath") || !strcmp ((STR), "rpath-link") \ 51209581Skib || !strcmp ((STR), "soname") || !strcmp ((STR), "defsym") \ 52209581Skib || !strcmp ((STR), "assert") || !strcmp ((STR), "dynamic-linker")) 53209581Skib 54209581Skib#undef WORD_SWITCH_TAKES_ARG 55209581Skib#define WORD_SWITCH_TAKES_ARG(STR) (FBSD_WORD_SWITCH_TAKES_ARG(STR)) 56209581Skib 57209581Skib/* Place spaces around this string. We depend on string splicing to produce 58225618Skmacy the final CPP_PREDEFINES value. */ 59209581Skib#define CPP_FBSD_PREDEFINES " -Dunix -D__FreeBSD__=4 -D__FreeBSD_cc_version=400003 -Asystem(unix) -Asystem(FreeBSD) " 60209581Skib 61209581Skib/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate 62209581Skib libc, depending on whether we're doing profiling. 63225618Skmacy (like the default, except no -lg, and no -p). */ 64209581Skib#undef LIB_SPEC 65209581Skib#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}}}" 66209581Skib 67209581Skib 68209581Skib/* Code generation parameters. */ 69209581Skib 70209581Skib/* Don't default to pcc-struct-return, because gcc is the only compiler, and 71209581Skib we want to retain compatibility with older gcc versions 72209581Skib (even though the svr4 ABI for the i386 says that records and unions are 73225618Skmacy returned in memory). */ 74209581Skib#undef DEFAULT_PCC_STRUCT_RETURN 75209581Skib#define DEFAULT_PCC_STRUCT_RETURN 0 76209581Skib 77209581Skib/* Ensure we the configuration knows our system correctly so we can link with 78209581Skib libraries compiled with the native cc. */ 79225618Skmacy#undef NO_DOLLAR_IN_LABEL 80209581Skib 81209581Skib/* Use more efficient ``thunks'' to implement C++ vtables. XXX note that 82225618Skmacy this setting is claimed to have a few bugs by the EGCS maintainers. They 83225618Skmacy believe the bugs will be worked out in EGCS 1.2. */ 84209581Skib#undef DEFAULT_VTABLE_THUNKS 85225618Skmacy#define DEFAULT_VTABLE_THUNKS 1 86209581Skib 87225618Skmacy/* This is BSD, so we want the DBX format. */ 88225618Skmacy#define DBX_DEBUGGING_INFO 89209581Skib 90209581Skib/* Use stabs instead of DWARF debug format. */ 91209581Skib#undef PREFERRED_DEBUGGING_TYPE 92209581Skib#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG 93209581Skib 94209581Skib 95209581Skib/* Miscellaneous parameters. */ 96209581Skib 97209581Skib/* Tell libgcc2.c that FreeBSD targets support atexit(3). */ 98209581Skib#define HAVE_ATEXIT 99209581Skib