OSDN Git Service

gcc/
[pf3gnuchains/gcc-fork.git] / gcc / config / freebsd-spec.h
index 7370547..b3f18e2 100644 (file)
@@ -1,5 +1,5 @@
 /* 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 GCC.
 
@@ -15,8 +15,8 @@ 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.  */
+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");                                 \
@@ -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,6 +130,12 @@ 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