From 75499d02c4da14cffd2631b5d5fd26fa6492d38b Mon Sep 17 00:00:00 2001 From: Brian Barrett Date: Wed, 24 Dec 2003 01:49:07 +0000 Subject: [PATCH] * Make autogen.sh look for glibtoolize if libtoolize doesn't seem to be what we want (such as on OS X) This commit was SVN r14. --- autogen.sh | 42 +++++++++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/autogen.sh b/autogen.sh index 02fdba6d0e..b05143f450 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # # Copyright (c) 2003 The Trustees of Indiana University. # All rights reserved. @@ -7,7 +7,7 @@ # information, see the LICENSE file in the top level directory of the # LAM/MPI source distribution. # -# $Id: autogen.sh,v 1.2 2003/11/22 16:40:48 jsquyres Exp $ +# $Id: autogen.sh,v 1.3 2003/12/24 01:49:07 brbarret Exp $ # # This script is run on developer copies of LAM/MPI -- *not* # distribution tarballs. @@ -18,10 +18,30 @@ # # Subroutine to check for the existence of various standard GNU tools # +# First argument: variable name to set +# Other arguments: list of programs to look for +# test_for_existence() { - tfe_prog="$1" - tfe_foo="`$tfe_prog --version`" - if test "$?" != 0; then + local tfe_foo_set=0 + local tfe_found=0 + local tfe_output=0 + tfe_name="$1" + + for i in $* ; do + if [ $tfe_foo_set = 0 ]; then + tfe_foo_set=1 + continue + fi + + tfe_output="`$i --version 2>&1`" + if [ $? == 0 ]; then + tfe_found=1 + eval "$tfe_name=$i" + break + fi + done + + if test $tfe_found = 0; then cat <