From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-ee0-x22e.google.com ([2a00:1450:4013:c00::22e]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1WZze3-0006NZ-2c for ptxdist@pengutronix.de; Tue, 15 Apr 2014 11:27:30 +0200 Received: by mail-ee0-f46.google.com with SMTP id t10so7487345eei.33 for ; Tue, 15 Apr 2014 02:27:05 -0700 (PDT) Received: from omega (p200300648D3F58B2E2CB4EFFFE1BB546.dip0.t-ipconnect.de. [2003:64:8d3f:58b2:e2cb:4eff:fe1b:b546]) by mx.google.com with ESMTPSA id q49sm47706045eem.34.2014.04.15.02.27.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Apr 2014 02:27:04 -0700 (PDT) Date: Tue, 15 Apr 2014 11:26:59 +0200 From: Alexander Aring Message-ID: <20140415092656.GA20567@omega> References: <1397553565-1144-1-git-send-email-alex.aring@gmail.com> <1397553565-1144-3-git-send-email-alex.aring@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1397553565-1144-3-git-send-email-alex.aring@gmail.com> Subject: Re: [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: , 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 Hi, On Tue, Apr 15, 2014 at 11:19:24AM +0200, Alexander Aring wrote: > 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 some little note here. I know we don't need a switch case here but it's good to handle others python major versions in the future. Then maybe python 4.x is incompatible with python 3.x like the current situation with python 3.x and python 2.x - Alex -- ptxdist mailing list ptxdist@pengutronix.de