From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ee0-x235.google.com ([2a00:1450:4013:c00::235]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WZzXB-0005Qj-Ob for ptxdist@pengutronix.de; Tue, 15 Apr 2014 11:20:09 +0200 Received: by mail-ee0-f53.google.com with SMTP id b57so7390601eek.26 for ; Tue, 15 Apr 2014 02:20:00 -0700 (PDT) From: Alexander Aring Date: Tue, 15 Apr 2014 11:19:24 +0200 Message-Id: <1397553565-1144-3-git-send-email-alex.aring@gmail.com> In-Reply-To: <1397553565-1144-1-git-send-email-alex.aring@gmail.com> References: <1397553565-1144-1-git-send-email-alex.aring@gmail.com> Subject: [ptxdist] [PATCH v2 2/3] configure.ac: add check for python 2.x version Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Alexander Aring Signed-off-by: Alexander Aring --- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 2a97944..efc67ba 100644 --- a/configure.ac +++ b/configure.ac @@ -304,6 +304,18 @@ AC_ARG_WITH(python, AS_HELP_STRING([--with-python],[name of the python executabl AC_PATH_PROGS(PYTHON, python2.7 python2.6 python) AC_SUBST(PYTHON) ]) + +dnl +dnl Check for python 2.x +dnl +AC_MSG_CHECKING([check for python major version]) +PYTHON_MAJOR_VERSION=`$PYTHON -c "import sys; print(sys.version_info[[0]])" 2> /dev/null` +case "$PYTHON_MAJOR_VERSION" in +2) ;; +*) AC_MSG_ERROR([we need python version 2.x but found $PYTHON_MAJOR_VERSION.x]) ;; +esac +AC_MSG_RESULT([$PYTHON_MAJOR_VERSION]) + dnl dnl We need the Python distutils dnl -- 1.9.2 -- ptxdist mailing list ptxdist@pengutronix.de