lkml.org 
[lkml]   [2011]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] Use the environment variable PYTHON if defined
* On Thu, Mar 31, 2011 at 03:29:12PM -0500, Michael Witten <mfwitten@gmail.com> wrote:
>On Thu, Mar 31, 2011 at 14:15, Raghavendra D Prabhu <rprabhu@wnohang.net> 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@wnohang.net>
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@wnohang.net>
---
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
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2011-04-02 22:49    [W:0.045 / U:6.152 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site