4 # A script to build GSL (adapted from R.Hatcher's build_pythia6.sh)
6 # Usage: ./build_gsl.sh [version] [--refetch]
8 # Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
14 while [ $# -gt 0 ] ; do
26 major=`awk -v str=$version 'BEGIN {split(str, tk, "."); print tk[1]}'`
27 minor=`awk -v str=$version 'BEGIN {split(str, tk, "."); print tk[2]}'`
29 topdir=`pwd`/v${major}_${minor}
31 echo version $version major $major minor $minor
34 if [ ! -d ${topdir} ] ; then
38 for subdir in stage download ; do
39 if [ ! -d ${subdir} ] ; then
47 # wget or curl for retreiving remote files?
48 # (OS X doesn't generally have wget on it, so fall back on curl in that case)
50 whichfetchit=`which wget | grep -v "no wget in"`
51 if [ ! -z "${whichfetchit}" ] ; then
52 echo use \"wget\" for fetching files
55 whichfetchit=`which curl | grep -v "no curl in"`
56 if [ ! -z "${whichfetchit}" ] ; then
57 # -f = fail without creating dummy, -O output local named like remoteza
58 echo use \"curl -f -O\" for fetching files
61 echo "Neither wget nor curl available -- can't download files"
66 echo "$fetchit ftp://ftp.gnu.org/gnu/gsl/gsl-${major}.${minor}.tar.gz"
67 $fetchit ftp://ftp.gnu.org/gnu/gsl/gsl-${major}.${minor}.tar.gz
69 tar xzvf gsl-${major}.${minor}.tar.gz
70 mv gsl-${major}.${minor} ${topdir}/src
73 ./configure --prefix=${topdir}/stage/