Skip to content

Commit

Permalink
m4: handle configuring with PYTHON="/usr/bin/env python" etc
Browse files Browse the repository at this point in the history
It may sometimes be desirable to have the python path determined at
run time, ie by setting PYTHON="/usr/bin/env python" etc.

Unfortunately that currently fails as $ovs_cv_python2 and
$ovs_cv_python3 are not always quoted and therefore fail to parse
correctly if PYTHON / PYTHON2 / PYTHON3 are set to values containing
spaces.

Signed-off-by: Andre McCurdy <[email protected]>
  • Loading branch information
armcc authored and blp committed Oct 3, 2018
1 parent 90ddb3a commit 7837818
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions m4/openvswitch.m4
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ else:
fi
done
done
if test $ovs_cv_python2 != no && test -x "$ovs_cv_python2"; then
if test "$ovs_cv_python2" != no && test -x "$ovs_cv_python2"; then
if ! "$ovs_cv_python2" -c 'import six ; six.moves.range' >&AS_MESSAGE_LOG_FD 2>&1; then
ovs_cv_python2=no
AC_MSG_WARN([Missing Python six library or version too old.])
Expand All @@ -380,7 +380,7 @@ else:
fi])
AC_SUBST([HAVE_PYTHON2])
AM_MISSING_PROG([PYTHON2], [python2])
if test $ovs_cv_python2 != no; then
if test "$ovs_cv_python2" != no; then
PYTHON2=$ovs_cv_python2
HAVE_PYTHON2=yes
else
Expand Down Expand Up @@ -412,7 +412,7 @@ else:
fi
done
done
if test $ovs_cv_python3 != no; then
if test "$ovs_cv_python3" != no; then
if test -x "$ovs_cv_python3" && ! "$ovs_cv_python3" -c 'import six' >/dev/null 2>&1; then
ovs_cv_python3=no
AC_MSG_WARN([Missing Python six library.])
Expand All @@ -421,7 +421,7 @@ else:
fi])
AC_SUBST([HAVE_PYTHON3])
AM_MISSING_PROG([PYTHON3], [python3])
if test $ovs_cv_python3 != no; then
if test "$ovs_cv_python3" != no; then
PYTHON3=$ovs_cv_python3
HAVE_PYTHON3=yes
else
Expand All @@ -439,9 +439,9 @@ AC_DEFUN([OVS_CHECK_PYTHON],
ovs_cv_python=$PYTHON
else
ovs_cv_python=no
if test $ovs_cv_python2 != no; then
if test "$ovs_cv_python2" != no; then
ovs_cv_python=$ovs_cv_python2
elif test $ovs_cv_python3 != no; then
elif test "$ovs_cv_python3" != no; then
ovs_cv_python=$ovs_cv_python3
else
AC_MSG_ERROR([Missing Python.])
Expand Down

0 comments on commit 7837818

Please sign in to comment.