Make Trick Mac Homebrew friendly

I have /usr/local/bin in my PATH and so I was finding swig there.
Running configure through brew does not include /usr/local/bin.
I changed the test to look for swig in a set of directories we
normally use.

refs #66
This commit is contained in:
Alex Lin 2015-06-17 09:48:08 -05:00
parent 80091454ce
commit 11253dcfcb
2 changed files with 8 additions and 82 deletions

86
configure vendored
View File

@ -644,7 +644,6 @@ GCJ_OPTS
ac_ct_JAVA_CC
JAVA_CC_FLAGS
JAVA_CC
SWIG_LIB
SWIG
PERL
BISON
@ -3578,12 +3577,8 @@ $as_echo "no" >&6; }
fi
# Ubuntu has swig 2.0 as /usr/bin/swig2.0
for ac_prog in swig swig2.0
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
# Extract the first word of "swig", so it can be a program name with args.
set dummy swig; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_SWIG+:} false; then :
@ -3595,7 +3590,8 @@ else
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
as_dummy="path="/bin:/usr/bin:/usr/local/bin:/sw/bin""
for as_dir in $as_dummy
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
@ -3609,6 +3605,7 @@ done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_SWIG" && ac_cv_path_SWIG="swig"
;;
esac
fi
@ -3622,79 +3619,6 @@ $as_echo "no" >&6; }
fi
test -n "$SWIG" && break
done
if test -z "$SWIG" ; then
as_fn_error $? "SWIG is required to build.." "$LINENO" 5
elif test -n "1.3.29" ; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking SWIG version" >&5
$as_echo_n "checking SWIG version... " >&6; }
swig_version=`$SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $swig_version" >&5
$as_echo "$swig_version" >&6; }
if test -n "$swig_version" ; then
# Calculate the required version number components
required=1.3.29
required_major=`echo $required | sed 's/[^0-9].*//'`
if test -z "$required_major" ; then
required_major=0
fi
required=`echo $required | sed 's/[0-9]*[^0-9]//'`
required_minor=`echo $required | sed 's/[^0-9].*//'`
if test -z "$required_minor" ; then
required_minor=0
fi
required=`echo $required | sed 's/[0-9]*[^0-9]//'`
required_patch=`echo $required | sed 's/[^0-9].*//'`
if test -z "$required_patch" ; then
required_patch=0
fi
# Calculate the available version number components
available=$swig_version
available_major=`echo $available | sed 's/[^0-9].*//'`
if test -z "$available_major" ; then
available_major=0
fi
available=`echo $available | sed 's/[0-9]*[^0-9]//'`
available_minor=`echo $available | sed 's/[^0-9].*//'`
if test -z "$available_minor" ; then
available_minor=0
fi
available=`echo $available | sed 's/[0-9]*[^0-9]//'`
available_patch=`echo $available | sed 's/[^0-9].*//'`
if test -z "$available_patch" ; then
available_patch=0
fi
# Convert the version tuple into a single number for easier comparison.
# Using base 100 should be safe since SWIG internally uses BCD values
# to encode its version number.
required_swig_vernum=`expr $required_major \* 10000 \
\+ $required_minor \* 100 \+ $required_patch`
available_swig_vernum=`expr $available_major \* 10000 \
\+ $available_minor \* 100 \+ $available_patch`
if test $available_swig_vernum -lt $required_swig_vernum; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 1.3.29 is required. You have $swig_version." >&5
$as_echo "$as_me: WARNING: SWIG version >= 1.3.29 is required. You have $swig_version." >&2;}
SWIG=''
as_fn_error $? "SWIG is required to build.." "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWIG library" >&5
$as_echo_n "checking for SWIG library... " >&6; }
SWIG_LIB=`$SWIG -swiglib`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG_LIB" >&5
$as_echo "$SWIG_LIB" >&6; }
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot determine SWIG version" >&5
$as_echo "$as_me: WARNING: cannot determine SWIG version" >&2;}
SWIG=''
as_fn_error $? "SWIG is required to build.." "$LINENO" 5
fi
fi
if test -n "$ac_tool_prefix"; then
for ac_prog in javac

View File

@ -104,7 +104,9 @@ AC_PROG_SED
AC_PROG_LEX
AC_PATH_PROG(BISON, bison, bison)
AC_PATH_PROG(PERL, perl, perl)
AX_PKG_SWIG(1.3.29, [], [ AC_MSG_ERROR([SWIG is required to build..]) ])
dnl AX_PKG_SWIG(1.3.29, [], [ AC_MSG_ERROR([SWIG is required to build..]) ])
AC_PATH_PROG(SWIG, swig, swig, path="/bin:/usr/bin:/usr/local/bin:/sw/bin")
AX_PROG_JAVA_CC(javac)
AC_CHECK_LIB(xml2, main,