Browse Source

made --with-pythonpath more friendly with older versions of automake: don't
use AM_PYTHON_CHECK_VERSION.
with additional cleanup: stop hardcoding a particular version number in
configuration variables.


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@1622 e5f2f494-b856-4b98-b285-d166d9295462

JINMEI Tatuya 15 years ago
parent
commit
7dc2abf503
1 changed files with 8 additions and 4 deletions
  1. 8 4
      configure.ac

+ 8 - 4
configure.ac

@@ -23,22 +23,26 @@ AC_HELP_STRING([--with-pythonpath=PATH],
 if test "$python_path" = auto; then
 	AM_PATH_PYTHON([3.1])
 else
+	# Older versions of automake can't handle python3 well.  This is an
+	# in-house workaround for them.
 	PYTHON=$python_path
 	AC_SUBST(PYTHON)
 	PYTHON_PREFIX='${prefix}'
 	AC_SUBST(PYTHON_PREFIX)
 	PYTHON_EXEC_PREFIX='$(exec_prefix)'
 	AC_SUBST(PYTHON_EXEC_PREFIX)
-	PYTHON_VERSION=[`$PYTHON -c "import sys; print(sys.version[:3])"`]
+	PYTHON_VERSION=[`$PYTHON -c "import sys; sys.stdout.write(sys.version[:3])"`]
+	if test `echo "$PYTHON_VERSION >= 3.1" | bc` != 1 ; then
+		AC_MSG_ERROR(["Python version too old: $PYTHON_VERSION, need 3.1 or higher"])
+	fi
 	AC_SUBST(PYTHON_VERSION)
-	AM_PYTHON_CHECK_VERSION([$PYTHON], [3.1], [], [AC_MSG_ERROR(["Python version too old: $PYTHON_VERSION, need 3.1 or higher"])])
 	PYTHON_PLATFORM=`$PYTHON -c "import sys; print(sys.platform)"`
 	AC_SUBST(PYTHON_PLATFORM)
-	pythondir='${prefix}/lib/python3.1/site-packages'
+	pythondir='${prefix}/lib/python'$PYTHON_VERSION'/site-packages'
 	AC_SUBST(pythondir)
 	pkgpythondir='${pythondir}/'$PACKAGE
 	AC_SUBST(pkgpythondir)
-	pyexecdir='${exec_prefix}/lib/python3.1/site-packages'
+	pyexecdir='${exec_prefix}/lib/python'$PYTHON_VERSION'/site-packages'
 	AC_SUBST(pyexecdir)
 	pkgpyexecdir='${pyexecdir}/'$PACKAGE
 	AC_SUBST(pkgpyexecdir)