/* Base configuration file for all FreeBSD targets.
- Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
+the Free Software Foundation; either version 3, or (at your option)
any later version.
GCC is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
-along with GCC; see the file COPYING. If not, write to
-the Free Software Foundation, 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA. */
+along with GCC; see the file COPYING3. If not see
+<http://www.gnu.org/licenses/>. */
/* Common FreeBSD configuration.
All FreeBSD architectures should include this file, which will specify
#define FBSD_TARGET_OS_CPP_BUILTINS() \
do \
{ \
- if (FBSD_MAJOR == 6) \
- builtin_define ("__FreeBSD__=6"); \
- else if (FBSD_MAJOR == 5) \
- builtin_define ("__FreeBSD__=5"); \
- else if (FBSD_MAJOR == 4) \
- builtin_define ("__FreeBSD__=4"); \
- else if (FBSD_MAJOR == 3) \
- builtin_define ("__FreeBSD__=3"); \
- else \
- builtin_define ("__FreeBSD__"); \
+ builtin_define_with_int_value ("__FreeBSD__", FBSD_MAJOR); \
builtin_define_std ("unix"); \
builtin_define ("__KPRINTF_ATTRIBUTE__"); \
builtin_assert ("system=unix"); \
#define FBSD_CPP_SPEC " \
%(cpp_cpu) \
- %{fPIC|fpic|fPIE|fpie:-D__PIC__ -D__pic__} \
+ %(cpp_arch) \
%{posix:-D_POSIX_SOURCE}"
/* Provide a STARTFILE_SPEC appropriate for FreeBSD. Here we add
500016, select the appropriate libc, depending on whether we're
doing profiling or need threads support. At __FreeBSD_version
500016 and later, when threads support is requested include both
- -lc and -lc_r instead of only -lc_r. To make matters interesting,
- we can't actually use __FreeBSD_version provided by <osreldate.h>
- directly since it breaks cross-compiling. As a final twist, make
- it a hard error if -pthread is provided on the command line and gcc
- was configured with --disable-threads (this will help avoid bug
- reports from users complaining about threading when they
+ -lc and the threading lib instead of only -lc_r. To make matters
+ interesting, we can't actually use __FreeBSD_version provided by
+ <osreldate.h> directly since it breaks cross-compiling. As a final
+ twist, make it a hard error if -pthread is provided on the command
+ line and gcc was configured with --disable-threads (this will help
+ avoid bug reports from users complaining about threading when they
misconfigured the gcc bootstrap but are later consulting FreeBSD
manual pages that refer to the mythical -pthread option). */
/* Provide a LIB_SPEC appropriate for FreeBSD. Just select the appropriate
libc, depending on whether we're doing profiling or need threads support.
- (simular to the default, except no -lg, and no -p). */
+ (similar to the default, except no -lg, and no -p). */
#ifdef FBSD_NO_THREADS
#define FBSD_LIB_SPEC " \
%{pg: -lc_p} \
}"
#else
-#if FBSD_MAJOR >= 5
-#define FBSD_LIB_SPEC " \
- %{!shared: \
- %{!pg: %{pthread:-lc_r} -lc} \
- %{pg: %{pthread:-lc_r_p} -lc_p} \
- }"
-#else
+#if FBSD_MAJOR < 5
#define FBSD_LIB_SPEC " \
%{!shared: \
%{!pg: \
%{!pthread:-lc_p} \
%{pthread:-lc_r_p}} \
}"
+#else
+#define FBSD_LIB_SPEC " \
+ %{!shared: \
+ %{!pg: %{pthread:-lpthread} -lc} \
+ %{pg: %{pthread:-lpthread_p} -lc_p} \
+ }"
#endif
#endif