config.gcc: For a FreeBSD target...
authorCraig Rodrigues <rodrigc@gcc.gnu.org>
Tue, 23 Oct 2007 23:53:31 +0000 (23:53 +0000)
committerCraig Rodrigues <rodrigc@gcc.gnu.org>
Tue, 23 Oct 2007 23:53:31 +0000 (23:53 +0000)
* config.gcc: For a FreeBSD target, parse the value of ${target}
to determine the value of FBSD_MAJOR, instead of adding an
explicit check for every possible FreeBSD major version.

From-SVN: r129590

gcc/ChangeLog
gcc/config.gcc

index 3fb2fef9ccd062064f3097ec280fa01544742a4d..410bcbd75e10973a5432cde5bcffe2aac14a581b 100644 (file)
@@ -1,3 +1,9 @@
+2007-10-23  Craig Rodrigues  <rodrigc@gcc.gnu.org>
+
+       * config.gcc: For a FreeBSD target, parse the value of ${target}
+       to determine the value of FBSD_MAJOR, instead of adding an
+       explicit check for every possible FreeBSD major version.
+
 2007-10-23  Uros Bizjak  <ubizjak@gmail.com>
 
        PR rtl-optimization/33846
index 2195b51088fcad0b559910d5f78bcc9f8a2fb198..3c23c257e4f1b58195b497243804cd95e50cf9b2 100644 (file)
@@ -430,26 +430,8 @@ case ${target} in
   gas=yes
   gnu_ld=yes
   extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
-  case ${target} in
-    *-*-freebsd3 | *-*-freebsd[3].*)
-      tm_defines="${tm_defines} FBSD_MAJOR=3" ;;
-    *-*-freebsd4 | *-*-freebsd[4].*)
-      tm_defines="${tm_defines} FBSD_MAJOR=4" ;;
-    *-*-freebsd5 | *-*-freebsd[5].*)
-      tm_defines="${tm_defines} FBSD_MAJOR=5" ;;
-    *-*-freebsd6 | *-*-freebsd[6].*)
-      tm_defines="${tm_defines} FBSD_MAJOR=6" ;;
-    *-*-freebsd7 | *-*-freebsd[7].*)
-      tm_defines="${tm_defines} FBSD_MAJOR=7" ;;
-    *-*-freebsd8 | *-*-freebsd[8].*)
-      tm_defines="${tm_defines} FBSD_MAJOR=8" ;;
-    *-*-freebsd9 | *-*-freebsd[9].*)
-      tm_defines="${tm_defines} FBSD_MAJOR=9" ;;
-    *)
-      echo 'Please update *-*-freebsd* in gcc/config.gcc'
-      exit 1
-      ;;
-  esac
+  fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
+  tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
   tmake_file="t-slibgcc-elf-ver t-freebsd"
   case ${enable_threads} in
     no)