This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/configure problem


On Thu, Jan 08, 2004 at 11:03:33AM +0100, Andreas Schwab wrote:
> Jim Wilson <wilson@specifixinc.com> writes:
> 
> > Richard Zidlicky wrote:
> >>   head: `-1' option is obsolete; use `-n 1'
> >
> > A known problem, that has been discussed in other threads.
> >
> > It is believed that we can't immediately switch to -n 1 because we still
> > support older systems that don't have it.  Thus we need autoconf tests,
> 
> An alternative would be to use "sed q" instead, which should be supported
> by every old and new system.

works for me, but since sed is already used in that sequence following
would be even faster. No idea how portable that would be, WFM.

--- libstdc++-v3/configure.rz   2004-01-10 23:51:37.000000000 +0100
+++ libstdc++-v3/configure      2004-01-10 23:57:12.000000000 +0100
@@ -8189,8 +8189,8 @@
   # 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 | \
-         sed -e 's/GNU ld version \([0-9.][0-9.]*\).*/\1/'`
+  ldver=`$LD --version 2>/dev/null | \
+         sed -n -e '1 s/GNU ld version \([0-9.][0-9.]*\).*/\1/p'`
 
   glibcxx_gnu_ld_version=`echo $ldver | \
          $AWK -F. '{ if (NF<3) $3=0; print ($1*100+$2)*100+$3 }'`

Richard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]