Submitted By: Uwe Düffert (dueffert at uwe-dueffert dot de)
Date: 2006-05-26
Initial Package Version: 3.4.0
Origin: Jim Gifford (3.4.0), adapted to 4.2 (http://www.uwe-dueffert.de/lfs/ownpatches/gcc-4.2-20060520-posix-1.patch)
Upstream Status: not reported
Description: use POSIX head and tail syntax
 
diff -Naur gcc-4.2-20060520.orig/ChangeLog gcc-4.2-20060520/ChangeLog
--- gcc-4.2-20060520.orig/ChangeLog	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/ChangeLog	2006-05-26 13:55:40.000000000 +0000
@@ -11860,7 +11860,7 @@
 	to i386-sco3.2v4.  Set TARGETS and CFLAGS for i386-sco3.2v4.
 	(all-cygnus, native, build-cygnus): Make
 	$(canonhost)-stamp-3stage-done, not $(host)....
-	* test-build.mk (stamp-3stage-compared): Use tail +10c for
+	* test-build.mk (stamp-3stage-compared): Use tail -c +10 for
 	i386-sco3.2v4.  Added else true to if command.
 
 Mon Dec 28 12:08:56 1992  Ken Raeburn  (raeburn@cygnus.com)
diff -Naur gcc-4.2-20060520.orig/config/acx.m4 gcc-4.2-20060520/config/acx.m4
--- gcc-4.2-20060520.orig/config/acx.m4	2006-05-26 13:31:25.000000000 +0000
+++ gcc-4.2-20060520/config/acx.m4	2006-05-26 13:55:40.000000000 +0000
@@ -357,7 +357,7 @@
 [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip,
 [ echo abfoo >t1
   echo cdfoo >t2
-  gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
+  gcc_cv_prog_cmp_skip='tail -c +16 $$f1 > tmp-foo1; tail -c +16 $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
   if cmp t1 t2 2 2 > /dev/null 2>&1; then
     if cmp t1 t2 1 1 > /dev/null 2>&1; then
       :
diff -Naur gcc-4.2-20060520.orig/configure gcc-4.2-20060520/configure
--- gcc-4.2-20060520.orig/configure	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/configure	2006-05-26 13:55:40.000000000 +0000
@@ -2212,7 +2212,7 @@
 else
    echo abfoo >t1
   echo cdfoo >t2
-  gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
+  gcc_cv_prog_cmp_skip='tail -c +16 $$f1 > tmp-foo1; tail -c +16 $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2'
   if cmp t1 t2 2 2 > /dev/null 2>&1; then
     if cmp t1 t2 1 1 > /dev/null 2>&1; then
       :
diff -Naur gcc-4.2-20060520.orig/contrib/test_summary gcc-4.2-20060520/contrib/test_summary
--- gcc-4.2-20060520.orig/contrib/test_summary	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/contrib/test_summary	2006-05-26 13:55:40.000000000 +0000
@@ -106,7 +106,7 @@
     srcdir = configflags;
     sub(/\/configure .*/, "", srcdir);
     printf "LAST_UPDATED: ";
-    system("tail -1 " srcdir "/LAST_UPDATED");
+    system("tail -n 1 " srcdir "/LAST_UPDATED");
     print "";
 
     sub(/^[^ ]*\/configure */, " ", configflags);
diff -Naur gcc-4.2-20060520.orig/gcc/Makefile.in gcc-4.2-20060520/gcc/Makefile.in
--- gcc-4.2-20060520.orig/gcc/Makefile.in	2006-05-26 13:31:19.000000000 +0000
+++ gcc-4.2-20060520/gcc/Makefile.in	2006-05-26 14:07:17.000000000 +0000
@@ -4343,8 +4343,8 @@
 	    for file in $$dir/*$(objext); do \
 	      case "$@" in \
 		slowcompare* ) \
-		  tail +16c ./$$file > tmp-foo1; \
-		  tail +16c stage$$stage/$$file > tmp-foo2; \
+		  tail -c +16 ./$$file > tmp-foo1; \
+		  tail -c +16 stage$$stage/$$file > tmp-foo2; \
 		  cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1; \
 		  cmpret=$$?; \
 		  ;; \
diff -Naur gcc-4.2-20060520.orig/gcc/configure gcc-4.2-20060520/gcc/configure
--- gcc-4.2-20060520.orig/gcc/configure	2006-05-26 13:31:18.000000000 +0000
+++ gcc-4.2-20060520/gcc/configure	2006-05-26 13:55:40.000000000 +0000
@@ -13783,7 +13783,7 @@
   # and we got the correct data, then succeed.
   if test x$gcc_cv_objdump != x \
   && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
-     | tail -3 > conftest.got \
+     | tail -n 3 > conftest.got \
   && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
     || cmp conftest.big conftest.got > /dev/null 2>&1; }
   then
diff -Naur gcc-4.2-20060520.orig/gcc/configure.ac gcc-4.2-20060520/gcc/configure.ac
--- gcc-4.2-20060520.orig/gcc/configure.ac	2006-05-26 13:31:17.000000000 +0000
+++ gcc-4.2-20060520/gcc/configure.ac	2006-05-26 13:55:40.000000000 +0000
@@ -2172,7 +2172,7 @@
   # and we got the correct data, then succeed.
   if test x$gcc_cv_objdump != x \
   && $gcc_cv_objdump -s -j .eh_frame conftest.o 2>/dev/null \
-     | tail -3 > conftest.got \
+     | tail -n 3 > conftest.got \
   && { cmp conftest.lit conftest.got > /dev/null 2>&1 \
     || cmp conftest.big conftest.got > /dev/null 2>&1; }
   then
diff -Naur gcc-4.2-20060520.orig/gcc/testsuite/ada/acats/run_all.sh gcc-4.2-20060520/gcc/testsuite/ada/acats/run_all.sh
--- gcc-4.2-20060520.orig/gcc/testsuite/ada/acats/run_all.sh	2006-05-26 13:31:18.000000000 +0000
+++ gcc-4.2-20060520/gcc/testsuite/ada/acats/run_all.sh	2006-05-26 14:03:44.000000000 +0000
@@ -68,7 +68,7 @@
   ls ${i}?.adb > ${i}.lst 2> /dev/null
   ls ${i}*m.adb >> ${i}.lst 2> /dev/null
   ls ${i}.adb >> ${i}.lst 2> /dev/null
-  main=`tail -1 ${i}.lst`
+  main=`tail -n 1 ${i}.lst`
 }
 
 EXTERNAL_OBJECTS=""
diff -Naur gcc-4.2-20060520.orig/libgomp/acinclude.m4 gcc-4.2-20060520/libgomp/acinclude.m4
--- gcc-4.2-20060520.orig/libgomp/acinclude.m4	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/libgomp/acinclude.m4	2006-05-26 13:57:21.000000000 +0000
@@ -150,7 +150,7 @@
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
   changequote(,)
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
   changequote([,])
   libgomp_gnu_ld_version=`echo $ldver | \
diff -Naur gcc-4.2-20060520.orig/libgomp/configure gcc-4.2-20060520/libgomp/configure
--- gcc-4.2-20060520.orig/libgomp/configure	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/libgomp/configure	2006-05-26 14:05:29.000000000 +0000
@@ -8943,7 +8943,7 @@
   # Start by getting the version number.  I think the libtool test already
   # does some of this, but throws away the result.
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   libgomp_gnu_ld_version=`echo $ldver | \
diff -Naur gcc-4.2-20060520.orig/libjava/classpath/configure gcc-4.2-20060520/libjava/classpath/configure
--- gcc-4.2-20060520.orig/libjava/classpath/configure	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/libjava/classpath/configure	2006-05-26 14:01:16.000000000 +0000
@@ -18355,7 +18355,7 @@
 fi # shortcircut to system "stdint.h"
 # ------------------ PREPARE VARIABLES ------------------------------
 if test "$GCC" = "yes" ; then
-ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1`
+ac_cv_stdint_message="using gnu compiler "`$CC --version | head -n 1`
 else
 ac_cv_stdint_message="using $CC"
 fi
diff -Naur gcc-4.2-20060520.orig/libjava/classpath/ltcf-c.sh gcc-4.2-20060520/libjava/classpath/ltcf-c.sh
--- gcc-4.2-20060520.orig/libjava/classpath/ltcf-c.sh	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/libjava/classpath/ltcf-c.sh	2006-05-26 13:59:44.000000000 +0000
@@ -153,7 +153,7 @@
     # If the export-symbols file already is a .def file (1st line
     # is EXPORTS), use it as is.
     # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+    archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
         cp $export_symbols $output_objdir/$soname-def;
       else
         echo EXPORTS > $output_objdir/$soname-def;
diff -Naur gcc-4.2-20060520.orig/libjava/classpath/ltcf-gcj.sh gcc-4.2-20060520/libjava/classpath/ltcf-gcj.sh
--- gcc-4.2-20060520.orig/libjava/classpath/ltcf-gcj.sh	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/libjava/classpath/ltcf-gcj.sh	2006-05-26 14:00:56.000000000 +0000
@@ -156,7 +156,7 @@
     # If the export-symbols file already is a .def file (1st line
     # is EXPORTS), use it as is.
     # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+    archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
         cp $export_symbols $output_objdir/$soname-def;
       else
         echo EXPORTS > $output_objdir/$soname-def;
diff -Naur gcc-4.2-20060520.orig/libjava/classpath/m4/ax_create_stdint_h.m4 gcc-4.2-20060520/libjava/classpath/m4/ax_create_stdint_h.m4
--- gcc-4.2-20060520.orig/libjava/classpath/m4/ax_create_stdint_h.m4	2006-05-26 13:31:23.000000000 +0000
+++ gcc-4.2-20060520/libjava/classpath/m4/ax_create_stdint_h.m4	2006-05-26 14:01:44.000000000 +0000
@@ -217,7 +217,7 @@
 fi # shortcircut to system "stdint.h"
 # ------------------ PREPARE VARIABLES ------------------------------
 if test "$GCC" = "yes" ; then
-ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1`
+ac_cv_stdint_message="using gnu compiler "`$CC --version | head -n 1`
 else
 ac_cv_stdint_message="using $CC"
 fi
diff -Naur gcc-4.2-20060520.orig/libjava/configure gcc-4.2-20060520/libjava/configure
--- gcc-4.2-20060520.orig/libjava/configure	2006-05-26 13:31:23.000000000 +0000
+++ gcc-4.2-20060520/libjava/configure	2006-05-26 13:55:46.000000000 +0000
@@ -6853,8 +6853,8 @@
 echo $ECHO_N "checking whether 'ld' is at least 2.13... $ECHO_C" >&6
 LD_PROG=`$CC --print-prog-name=ld`
 LD_VERSION=`$LD_PROG --version`
-LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
-LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
+LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
+LD_VERSION_MINOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 2`
 if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
   LD_OK="ok"
 else
diff -Naur gcc-4.2-20060520.orig/libjava/mingwld.m4 gcc-4.2-20060520/libjava/mingwld.m4
--- gcc-4.2-20060520.orig/libjava/mingwld.m4	2006-05-26 13:31:23.000000000 +0000
+++ gcc-4.2-20060520/libjava/mingwld.m4	2006-05-26 13:58:17.000000000 +0000
@@ -3,8 +3,8 @@
 AC_MSG_CHECKING(whether 'ld' is at least 2.13)
 LD_PROG=`$CC --print-prog-name=ld`
 LD_VERSION=`$LD_PROG --version`
-LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
-LD_VERSION_MINOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 2`
+LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
+LD_VERSION_MINOR=`echo "$LD_VERSION" | head -n 1 | cut -d '.' -f 2`
 if expr "$LD_VERSION_MAJOR" \> 2 > /dev/null; then
   LD_OK="ok"
 else
diff -Naur gcc-4.2-20060520.orig/libstdc++-v3/acinclude.m4 gcc-4.2-20060520/libstdc++-v3/acinclude.m4
--- gcc-4.2-20060520.orig/libstdc++-v3/acinclude.m4	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/libstdc++-v3/acinclude.m4	2006-05-26 13:55:46.000000000 +0000
@@ -233,7 +233,7 @@
   # does some of this, but throws away the result.
   AC_MSG_CHECKING([for ld version])
   changequote(,)
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
   changequote([,])
   glibcxx_gnu_ld_version=`echo $ldver | \
diff -Naur gcc-4.2-20060520.orig/libstdc++-v3/configure gcc-4.2-20060520/libstdc++-v3/configure
--- gcc-4.2-20060520.orig/libstdc++-v3/configure	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/libstdc++-v3/configure	2006-05-26 13:55:46.000000000 +0000
@@ -8305,7 +8305,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -54209,7 +54209,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -75569,7 +75569,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -77092,7 +77092,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -78583,7 +78583,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -100386,7 +100386,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -101738,7 +101738,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -103139,7 +103139,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -104932,7 +104932,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -107046,7 +107046,7 @@
   echo "$as_me:$LINENO: checking for ld version" >&5
 echo $ECHO_N "checking for ld version... $ECHO_C" >&6
 
-  ldver=`$LD --version 2>/dev/null | head -1 | \
+  ldver=`$LD --version 2>/dev/null | head -n 1 | \
          sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
diff -Naur gcc-4.2-20060520.orig/ltcf-c.sh gcc-4.2-20060520/ltcf-c.sh
--- gcc-4.2-20060520.orig/ltcf-c.sh	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/ltcf-c.sh	2006-05-26 13:55:46.000000000 +0000
@@ -153,7 +153,7 @@
     # If the export-symbols file already is a .def file (1st line
     # is EXPORTS), use it as is.
     # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+    archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
         cp $export_symbols $output_objdir/$soname-def;
       else
         echo EXPORTS > $output_objdir/$soname-def;
diff -Naur gcc-4.2-20060520.orig/ltcf-gcj.sh gcc-4.2-20060520/ltcf-gcj.sh
--- gcc-4.2-20060520.orig/ltcf-gcj.sh	2006-05-26 13:31:20.000000000 +0000
+++ gcc-4.2-20060520/ltcf-gcj.sh	2006-05-26 13:55:46.000000000 +0000
@@ -156,7 +156,7 @@
     # If the export-symbols file already is a .def file (1st line
     # is EXPORTS), use it as is.
     # If DATA tags from a recent dlltool are present, honour them!
-    archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then
+    archive_expsym_cmds='if test "x`head -n 1 $export_symbols`" = xEXPORTS; then
         cp $export_symbols $output_objdir/$soname-def;
       else
         echo EXPORTS > $output_objdir/$soname-def;
