Submitted By: Uwe Düffert (lfs at uwe-dueffert dot de)
Date: 2005-07-11
Initial Package Version: 3.4.0
Origin: Jim Gifford (3.4.0), adapted to 4.1 (http://www.uwe-dueffert.de/lfs/ownpatches/gcc-4.1-posix-1.patch)
Upstream Status: not reported
Description: use POSIX head and tail syntax

diff -Naur gcc-4.1-20050709.orig/ChangeLog gcc-4.1-20050709/ChangeLog
--- gcc-4.1-20050709.orig/ChangeLog	2005-07-11 21:25:52.000000000 +0200
+++ gcc-4.1-20050709/ChangeLog	2005-07-11 21:29:04.000000000 +0200
@@ -11185,7 +11185,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.1-20050709.orig/config/acx.m4 gcc-4.1-20050709/config/acx.m4
--- gcc-4.1-20050709.orig/config/acx.m4	2005-07-11 21:25:52.000000000 +0200
+++ gcc-4.1-20050709/config/acx.m4	2005-07-11 21:29:04.000000000 +0200
@@ -232,7 +232,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.1-20050709.orig/configure gcc-4.1-20050709/configure
--- gcc-4.1-20050709.orig/configure	2005-07-11 21:25:52.000000000 +0200
+++ gcc-4.1-20050709/configure	2005-07-11 21:29:04.000000000 +0200
@@ -2164,7 +2164,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.1-20050709.orig/contrib/test_summary gcc-4.1-20050709/contrib/test_summary
--- gcc-4.1-20050709.orig/contrib/test_summary	2005-07-11 21:25:52.000000000 +0200
+++ gcc-4.1-20050709/contrib/test_summary	2005-07-11 21:29:04.000000000 +0200
@@ -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.1-20050709.orig/gcc/Makefile.in gcc-4.1-20050709/gcc/Makefile.in
--- gcc-4.1-20050709.orig/gcc/Makefile.in	2005-07-11 21:25:48.000000000 +0200
+++ gcc-4.1-20050709/gcc/Makefile.in	2005-07-11 21:29:04.000000000 +0200
@@ -4182,15 +4182,15 @@
 	    for file in $$dir/*$(objext); do \
 	      case $$file in \
 		./cc*-checksum$(objext) | libgcc/* ) \
-		    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 \
 			 || echo warning: $$file differs || true ) \
 		  ;; \
 		*)  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 \
 			  || echo $$file differs >> .bad_compare) || true; \
 		    ;; \
diff -Naur gcc-4.1-20050709.orig/gcc/configure gcc-4.1-20050709/gcc/configure
--- gcc-4.1-20050709.orig/gcc/configure	2005-07-11 21:25:48.000000000 +0200
+++ gcc-4.1-20050709/gcc/configure	2005-07-11 21:29:04.000000000 +0200
@@ -13803,7 +13803,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.1-20050709.orig/gcc/configure.ac gcc-4.1-20050709/gcc/configure.ac
--- gcc-4.1-20050709.orig/gcc/configure.ac	2005-07-11 21:25:48.000000000 +0200
+++ gcc-4.1-20050709/gcc/configure.ac	2005-07-11 21:29:04.000000000 +0200
@@ -2091,7 +2091,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.1-20050709.orig/gcc/testsuite/ada/acats/run_all.sh gcc-4.1-20050709/gcc/testsuite/ada/acats/run_all.sh
--- gcc-4.1-20050709.orig/gcc/testsuite/ada/acats/run_all.sh	2005-07-11 21:25:49.000000000 +0200
+++ gcc-4.1-20050709/gcc/testsuite/ada/acats/run_all.sh	2005-07-11 21:29:04.000000000 +0200
@@ -229,7 +229,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`
       binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
       echo "BUILD $main" >> $dir/acats.log
       EXTERNAL_OBJECTS=""
diff -Naur gcc-4.1-20050709.orig/libjava/acinclude.m4 gcc-4.1-20050709/libjava/acinclude.m4
--- gcc-4.1-20050709.orig/libjava/acinclude.m4	2005-07-11 21:25:53.000000000 +0200
+++ gcc-4.1-20050709/libjava/acinclude.m4	2005-07-11 21:29:04.000000000 +0200
@@ -17,8 +17,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.1-20050709.orig/libjava/configure gcc-4.1-20050709/libjava/configure
--- gcc-4.1-20050709.orig/libjava/configure	2005-07-11 21:25:53.000000000 +0200
+++ gcc-4.1-20050709/libjava/configure	2005-07-11 21:29:04.000000000 +0200
@@ -5989,8 +5989,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.1-20050709.orig/libstdc++-v3/acinclude.m4 gcc-4.1-20050709/libstdc++-v3/acinclude.m4
--- gcc-4.1-20050709.orig/libstdc++-v3/acinclude.m4	2005-07-11 21:25:54.000000000 +0200
+++ gcc-4.1-20050709/libstdc++-v3/acinclude.m4	2005-07-11 21:29:04.000000000 +0200
@@ -223,7 +223,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([,])
   glibcxx_gnu_ld_version=`echo $ldver | \
diff -Naur gcc-4.1-20050709.orig/libstdc++-v3/configure gcc-4.1-20050709/libstdc++-v3/configure
--- gcc-4.1-20050709.orig/libstdc++-v3/configure	2005-07-11 21:25:54.000000000 +0200
+++ gcc-4.1-20050709/libstdc++-v3/configure	2005-07-11 21:29:04.000000000 +0200
@@ -8182,7 +8182,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -52839,7 +52839,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -74149,7 +74149,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -75629,7 +75629,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -76985,7 +76985,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -79113,7 +79113,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -80422,7 +80422,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -81780,7 +81780,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -83503,7 +83503,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
@@ -85574,7 +85574,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/'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
diff -Naur gcc-4.1-20050709.orig/ltcf-c.sh gcc-4.1-20050709/ltcf-c.sh
--- gcc-4.1-20050709.orig/ltcf-c.sh	2005-07-11 21:25:52.000000000 +0200
+++ gcc-4.1-20050709/ltcf-c.sh	2005-07-11 21:29:04.000000000 +0200
@@ -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.1-20050709.orig/ltcf-gcj.sh gcc-4.1-20050709/ltcf-gcj.sh
--- gcc-4.1-20050709.orig/ltcf-gcj.sh	2005-07-11 21:25:52.000000000 +0200
+++ gcc-4.1-20050709/ltcf-gcj.sh	2005-07-11 21:29:04.000000000 +0200
@@ -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;
