OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / config / freebsd-spec.h
index 2f4261b..b3f18e2 100644 (file)
@@ -1,22 +1,22 @@
 /* Base configuration file for all FreeBSD targets.
-   Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc.
 
-This file is part of GNU CC.
+This file is part of GCC.
 
-GNU CC is free software; you can redistribute it and/or modify
+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)
 any later version.
 
-GNU CC is distributed in the hope that it will be useful,
+GCC is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GNU CC; 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 COPYING.  If not, write to
+the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 /* Common FreeBSD configuration. 
    All FreeBSD architectures should include this file, which will specify
@@ -51,16 +51,7 @@ Boston, MA 02111-1307, USA.  */
 #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");                                 \
@@ -70,7 +61,7 @@ Boston, MA 02111-1307, USA.  */
     }                                                                  \
   while (0)
 
-/* Define the default FreeBSD-specific per-CPU hook code. */
+/* Define the default FreeBSD-specific per-CPU hook code.  */
 #define FBSD_TARGET_CPU_CPP_BUILTINS() do {} while (0)
 
 /* Provide a CPP_SPEC appropriate for FreeBSD.  We just deal with the GCC 
@@ -78,7 +69,7 @@ Boston, MA 02111-1307, USA.  */
 
 #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
@@ -107,18 +98,18 @@ Boston, MA 02111-1307, USA.  */
    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 "                                                        \
@@ -129,13 +120,7 @@ is built with the --enable-threads configure-time option.}         \
     %{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:                                                             \
@@ -145,5 +130,17 @@ is built with the --enable-threads configure-time option.}         \
       %{!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
+
+#if FBSD_MAJOR < 6
+#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
+#else
+#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
 #endif