diff options
author | Marius Kintel <marius@kintel.net> | 2013-10-31 03:02:33 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-10-31 03:02:33 (GMT) |
commit | a197e5b22c7c2a6ff9cc8267d813b00c18e4fc4b (patch) | |
tree | 945a23eecafd91b05bb601d452be71973156bb9b /scripts | |
parent | e764c9ad0365c1022ae893af8ef2846779717153 (diff) | |
parent | c6df50759023a49bb8d0ae4c070782e920dc1ddb (diff) |
Merge pull request #524 from pdbogen/master
Use find instead of ls and grep to locate gmp.h (or gmp-blah.h)
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/check-dependencies.sh | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/scripts/check-dependencies.sh b/scripts/check-dependencies.sh index 826a665..120aed9 100755 --- a/scripts/check-dependencies.sh +++ b/scripts/check-dependencies.sh @@ -86,21 +86,16 @@ mpfr_sysver() gmp_sysver() { - # on some systems you have VERSION in gmp-$arch.h not gmp.h. use gmp*.h - if [ -e $1/include/multiarch-x86_64-linux ]; then - subdir=include/multiarch-x86_64-linux - else - subdir=include + gmppaths="`find $1 -name 'gmp.h' -o -name 'gmp-*.h'`" + if [ ! "$gmppaths" ]; then + debug "gmp_sysver no gmp.h beneath $1" + return fi - if [ ! -e $1/$subdir ]; then return; fi - gmppaths=`ls $1/$subdir | grep ^gmp` - if [ ! "$gmppaths" ]; then return; fi for gmpfile in $gmppaths; do - gmppath=$1/$subdir/$gmpfile - if [ "`grep __GNU_MP_VERSION $gmppath`" ]; then - gmpmaj=`grep "define *__GNU_MP_VERSION *[0-9]*" $gmppath | awk '{print $3}'` - gmpmin=`grep "define *__GNU_MP_VERSION_MINOR *[0-9]*" $gmppath | awk '{print $3}'` - gmppat=`grep "define *__GNU_MP_VERSION_PATCHLEVEL *[0-9]*" $gmppath | awk '{print $3}'` + if [ "`grep __GNU_MP_VERSION $gmpfile`" ]; then + gmpmaj=`grep "define *__GNU_MP_VERSION *[0-9]*" $gmpfile | awk '{print $3}'` + gmpmin=`grep "define *__GNU_MP_VERSION_MINOR *[0-9]*" $gmpfile | awk '{print $3}'` + gmppat=`grep "define *__GNU_MP_VERSION_PATCHLEVEL *[0-9]*" $gmpfile | awk '{print $3}'` fi done gmp_sysver_result="$gmpmaj.$gmpmin.$gmppat" |