Make configure hard code path to swig

I've set it up to just try "swig" if configure hasn't been run since
syncing to this change, so users who sync and have no swig issues won't
have to do anything new.

Fixes #1329.
This commit is contained in:
Geoffrey Irving 2016-03-22 16:28:38 -07:00
parent 44e95baf45
commit d782317f55
3 changed files with 20 additions and 1 deletions

10
configure vendored
View File

@ -22,6 +22,16 @@ while true; do
# Retry # Retry
done done
## Find swig path
if [ -z "$SWIG_PATH" ]; then
SWIG_PATH=`type -p swig 2> /dev/null`
fi
if [[ ! -e "$SWIG_PATH" ]]; then
echo "Can't find swig. Ensure swig is in \$PATH or set \$SWIG_PATH."
exit 1
fi
echo "$SWIG_PATH" > tensorflow/tools/swig/swig_path
# Invoke python_config and set up symlinks to python includes # Invoke python_config and set up symlinks to python includes
(./util/python/python_config.sh --setup "$PYTHON_BIN_PATH";) || exit -1 (./util/python/python_config.sh --setup "$PYTHON_BIN_PATH";) || exit -1

1
tensorflow/tools/swig/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
swig_path

View File

@ -14,4 +14,12 @@
# limitations under the License. # limitations under the License.
# ============================================================================== # ==============================================================================
swig "$@" # If possible, read swig path out of "swig_path" generated by configure
SWIG=swig
SWIG_PATH=tensorflow/tools/swig/swig_path
if [ -e $SWIG_PATH ]; then
SWIG=`cat $SWIG_PATH`
fi
# If this line fails, rerun configure to set the path to swig correctly
"$SWIG" "$@"