Re: [PATCH] Use the environment variable PYTHON if defined

From: Raghavendra D Prabhu
Date: Sat Apr 02 2011 - 16:46:58 EST


* On Thu, Mar 31, 2011 at 03:29:12PM -0500, Michael Witten <mfwitten@xxxxxxxxx> wrote:
On Thu, Mar 31, 2011 at 14:15, Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx> wrote:
Hi,
   Regarding the point where it warns about python-devel not existing,
it looks like that existing feature test will pass even when python3 is
chosen and fail at a later stage. So I made this little change to feature
test so that it fails when python3 is chosen and perf build succeeds with
the war ning printed rather than failing later.

Good point.

However, try-cc does not run the resulting program after
compiling it, so the test still succeeds.

What you want to do is make the compilation fail;
to do so, move your test here:

#include <Python.h>

#if PY_VERSION_HEX >= 0x03000000
#error "Python 3 is not yet supported; set PYTHON{,_CONFIG}"

int main(void)
...

P.S.
Put your replies below the email quote.
Thanks. I have attached the corrected patch and also have tested it.
--------------------------
Raghavendra Prabhu
GPG ID:D72BE977

From 8c52bc1f2acb16d3bc12ea43c82665ebef93285a Mon Sep 17 00:00:00 2001
From: Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>
Date: Sun, 3 Apr 2011 01:59:12 +0530
Subject: [PATCH] Added a py3k test to feature tests.

Currently, make fails at a later stage when python-devel test succeeds
incorrectly for Py3k. This fixes that.

Signed-off-by: Raghavendra D Prabhu <rprabhu@xxxxxxxxxxx>
---
tools/perf/feature-tests.mak | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/tools/perf/feature-tests.mak b/tools/perf/feature-tests.mak
index b041ca6..8e5d16a 100644
--- a/tools/perf/feature-tests.mak
+++ b/tools/perf/feature-tests.mak
@@ -82,6 +82,10 @@ ifndef NO_LIBPYTHON
define SOURCE_PYTHON_EMBED
#include <Python.h>

+#if PY_VERSION_HEX >= 0x03000000
+ #error "Python 3 is not yet supported; set PYTHON{,_CONFIG}"
+#endif
+
int main(void)
{
Py_Initialize();
--
1.7.4.2

Attachment: pgp00000.pgp
Description: PGP signature