OpenPKG CVS Repository
  http://www.openpkg.org/cvsweb/cvsweb.cgi
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   09-Aug-2002 20:32:48
  Branch: HEAD                             Handle: 2002080919324800

  Modified files:
    openpkg-src/gcc         gcc.sh

  Log:
    more accurate binutils check

  Summary:
    Revision    Changes     Path
    1.2         +26 -11     openpkg-src/gcc/gcc.sh
  ____________________________________________________________________________

  Index: openpkg-src/gcc/gcc.sh
  ============================================================
  $ cvs diff -u -r1.1 -r1.2 gcc.sh
  --- openpkg-src/gcc/gcc.sh    8 Aug 2002 15:57:00 -0000       1.1
  +++ openpkg-src/gcc/gcc.sh    9 Aug 2002 18:32:48 -0000       1.2
  @@ -14,7 +14,8 @@
            shift
            case $target in
               *-linux* )
  -                v=unknown
  +                #   under Linux the vendor ld is GNU binutils,
  +                #   but make sure it is GNU binutils >= 2.12
                   if [ -f /etc/debian_version ]; then
                       v=`/usr/bin/dpkg -l binutils | grep binutils | awk '{ print $3; 
}'`
                   elif [ -f /etc/redhat-release ]; then
  @@ -22,23 +23,37 @@
                   elif [ -f /etc/SuSE-release ]; then
                       v=`/bin/rpm -q --qf '%{VERSION}' binutils`
                   else
  -                    v=`(ld --version | grep 'GNU ld' | sed -e 
's;^[^0-9]*\([0-9].[0-9.]*\).*;\1;') 2>/dev/null`
  +                    v=`(/usr/bin/ld --version | grep 'GNU ld' | sed -e 
's;^[^0-9]*\([0-9].[0-9.]*\).*;\1;') 2>/dev/null`
                   fi
  -                #   require GNU binutils >= 2.12
  +                case "$v" in
  +                    2.1[2-9] | 2.1[2-9].* ) ;;
  +                    * ) require="yes" ;;
  +                esac
  +                ;;
  +             *-freebsd* )
  +                #   under FreeBSD the vendor ld is GNU binutils,
  +                #   but make sure it is GNU binutils >= 2.12
  +                v=`(/usr/bin/ld --version | grep 'GNU ld' | sed -e 
's;^[^0-9]*\([0-9].[0-9.]*\).*;\1;') 2>/dev/null`
                   case "$v" in
                       2.1[2-9] | 2.1[2-9].* ) ;;
                       * ) require="yes" ;;
                   esac
                   ;;
                * )
  -                if [ ".`(ld --version) 2>/dev/null | grep 'GNU ld'`" != . ]; then
  -                    v=`(ld --version | grep 'GNU ld' | sed -e 
's;^[^0-9]*\([0-9].[0-9.]*\).*;\1;') 2>/dev/null`
  -                    #   require GNU binutils >= 2.12
  -                    case "$v" in
  -                        2.1[2-9] | 2.1[2-9].* ) ;;
  -                        * ) require="yes" ;;
  -                    esac
  -                fi
  +                #   under other OS the vendor ld is usually not GNU binutils,
  +                #   but if it is, make sure it is GNU binutils >= 2.12
  +                for dir in /bin /usr/bin /usr/ccs/bin /sbin /usr/sbin 
/usr/ccs/sbin; do
  +                    if [ -f "$dir/ld" ]; then
  +                        if [ ".`($dir/ld --version) 2>/dev/null | grep 'GNU ld'`" 
!= . ]; then
  +                            v=`($dir/ld --version | grep 'GNU ld' | sed -e 
's;^[^0-9]*\([0-9].[0-9.]*\).*;\1;') 2>/dev/null`
  +                            #   require GNU binutils >= 2.12
  +                            case "$v" in
  +                                2.1[2-9] | 2.1[2-9].* ) ;;
  +                                * ) require="yes"; break ;;
  +                            esac
  +                        fi
  +                    fi
  +                done
                   ;;
            esac
            echo "$require" | awk '{ printf("%s", $1); }'
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to