Re: [PATCH 1/3] configure: Add test for Perl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dennis Stosberg <dennis@xxxxxxxxxxxx> wrote:

> +	echocheck "for perl"
> +	if test -z "$_perl" ; then
> +		_perl=`which perl`
> +		test "$_perl" || die "cannot find path to perl"
> +	fi
> +	echores "$_perl"

"which" isn't portable. On SunOS 5.9 "which foo" prints error message to
stdout and returns 0.  I use this in my own configure scripts:

path_find()
{
        if test -x "$1"
        then
                echo "$1"
                return 0
        fi
        for i in `echo $PATH | sed 's/:/ /g'`
        do
                if test -x "$i/$1"
                then
                        echo "$i/$1"
                        return 0
                fi
        done
        return 1
}

-- 
http://onion.dynserv.net/~timo/
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]