2 changed files with 52 additions and 4 deletions
@ -0,0 +1,47 @@
|
||||
#!/bin/sh |
||||
## |
||||
## gcc.sh -- GCC Package Build Utility |
||||
## Copyright (c) 2002 Ralf S. Engelschall <rse@engelschall.com> |
||||
## |
||||
|
||||
check="$1" |
||||
shift |
||||
case $check in |
||||
require-binutils ) |
||||
# determine whether GNU gcc requires GNU binutils on this platform |
||||
require="no" |
||||
target="$1" |
||||
shift |
||||
case $target in |
||||
*-linux* ) |
||||
v=unknown |
||||
if [ -f /etc/debian_version ]; then |
||||
v=`/usr/bin/dpkg -l binutils | grep binutils | awk '{ print $3; }'` |
||||
elif [ -f /etc/redhat-release ]; then |
||||
v=`/bin/rpm -q --qf '%{VERSION}' binutils` |
||||
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` |
||||
fi |
||||
# require GNU binutils >= 2.12 |
||||
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 |
||||
;; |
||||
esac |
||||
echo "$require" | awk '{ printf("%s", $1); }' |
||||
;; |
||||
esac |
||||
|
||||
Loading…
Reference in new issue