Merge lp:~adrien-saladin/ptools/bug532472 into lp:ptools

Proposed by Adrien Saladin on 2010-04-23
Status: Merged
Merged at revision: 436
Proposed branch: lp:~adrien-saladin/ptools/bug532472
Merge into: lp:ptools
Diff against target: 124 lines (+51/-40)
1 file modified
SConstruct (+51/-40)
To merge this branch: bzr merge lp:~adrien-saladin/ptools/bug532472
Reviewer Review Type Date Requested Status
Pierre Poulain 2010-04-23 Approve on 2010-04-23
Review via email: mp+23999@code.launchpad.net
To post a comment you must log in.
Pierre Poulain (pierrepo) wrote :

All compilations and tests went fine.

To merge are the followings OK ?
1/ go in my "trunk" directory
2/ bzr merge lp:~adrien-saladin/ptools/bug532472
3/ bzr push

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'SConstruct'
2--- SConstruct 2010-03-18 20:18:52 +0000
3+++ SConstruct 2010-04-23 10:50:28 +0000
4@@ -106,7 +106,7 @@
5 FORTRANPROG="gfortran -O2 -g -fPIC"
6 gfortranlib=FIND_HEADER(["libgfortran.a", "libgfortran.la",\
7 "libgfortran.so", "libgfortran.so.3"], [user_path_libg2cgfortran,"/usr/lib","/usr/lib64","/sw/lib",\
8- "/usr/lib/gcc/x86_64-redhat-linux/3.4.6/","/usr/lib64/gcc/x86_64-suse-linux/4.1.2/"], True)
9+ "/usr/lib/gcc/x86_64-redhat-linux/3.4.6/","/usr/lib64/gcc/x86_64-suse-linux/4.1.2/","/opt/local/lib/gcc43/"], True)
10 if gfortranlib is not None:
11 print "libgfortran found here: ", gfortranlib
12 LIB_PATH.append(gfortranlib)
13@@ -139,7 +139,7 @@
14
15
16 boostdir=FIND_HEADER(["boost/shared_array.hpp"], [user_path_boost,"/usr/include", \
17-"/sw/include/boost-1_33_1"] )
18+"/sw/include/boost-1_33_1", "/opt/local/include"] )
19
20 if boostdir is None:
21 print "cannot locate Boost hearders directory, still trying to compile..."
22@@ -147,40 +147,50 @@
23 print "boost directory found here: ", boostdir
24 COMMON_CPPPATH.append(boostdir)
25
26-python24dir=FIND_HEADER(["Python.h"], ["/usr/include/python2.4", \
27-"/sw/include/python2.4"])
28-
29-if python24dir is not None:
30- print "python2.4 found, configuring path and libs"
31- PYTHON_CPPPATH=[python24dir]
32- PYTHON_LIBS=["python2.4"]
33-
34-
35-if python24dir is None:
36- print "cannot locate python2.4, tying with python2.5:"
37- python25dir = FIND_HEADER(["Python.h"], ["/usr/include/python2.5/",
38- "/sw/include/python2.5/"])
39- if python25dir is None:
40- print "cannot locate Python2.5, the library may not compile..."
41- print "trying to locate Python 2.6:"
42- python26dir = FIND_HEADER(["Python.h"], ["/usr/include/python2.6/",
43- "/sw/include/python2.6/"])
44- if python26dir is not None:
45- print "Python 2.6 found!"
46- PYTHON_CPPPATH=[python26dir]
47- PYTHON_LIBS=["python2.6"]
48- else:
49- PYTHON_CPPPATH=[python25dir]
50- PYTHON_LIBS=["python2.5"]
51-
52-
53-
54+PYTHON_CPPPATH = ""
55+PYTHON_LIBS = ""
56 PYTHON_CPP=[]
57-import fnmatch
58-import os
59-for file in os.listdir("Pybindings"):
60- if fnmatch.fnmatch(file, "*.cpp"):
61- PYTHON_CPP.append("Pybindings/%s"%file)
62+
63+if 'python' in COMMAND_LINE_TARGETS or len(COMMAND_LINE_TARGETS)==0:
64+ python_target = True
65+else:
66+ python_target = False
67+
68+if python_target:
69+ python24dir=FIND_HEADER(["Python.h"], ["/usr/include/python2.4", \
70+ "/sw/include/python2.4"])
71+
72+ if python24dir is not None:
73+ print "python2.4 found, configuring path and libs"
74+ PYTHON_CPPPATH=[python24dir]
75+ PYTHON_LIBS=["python2.4"]
76+
77+
78+ if python24dir is None:
79+ print "cannot locate python2.4, tying with python2.5:"
80+ python25dir = FIND_HEADER(["Python.h"], ["/usr/include/python2.5/",
81+ "/sw/include/python2.5/"])
82+ if python25dir is None:
83+ print "cannot locate Python2.5, the library may not compile..."
84+ print "trying to locate Python 2.6:"
85+ python26dir = FIND_HEADER(["Python.h"], ["/usr/include/python2.6/",
86+ "/sw/include/python2.6/"])
87+ if python26dir is not None:
88+ print "Python 2.6 found!"
89+ PYTHON_CPPPATH=[python26dir]
90+ PYTHON_LIBS=["python2.6"]
91+ else:
92+ PYTHON_CPPPATH=[python25dir]
93+ PYTHON_LIBS=["python2.5"]
94+
95+
96+
97+ PYTHON_CPP=[]
98+ import fnmatch
99+ import os
100+ for file in os.listdir("Pybindings"):
101+ if fnmatch.fnmatch(file, "*.cpp"):
102+ PYTHON_CPP.append("Pybindings/%s"%file)
103
104
105
106@@ -228,12 +238,13 @@
107
108
109 #check python header file:
110-conf = Configure(python)
111-if not conf.CheckCHeader('Python.h'):
112- print "you must install either python2.4-dev or python2.5-dev"
113- Exit(1)
114+if python_target:
115+ conf = Configure(python)
116+ if not conf.CheckCHeader('Python.h'):
117+ print "you must install either python2.4-dev or python2.5-dev"
118+ Exit(1)
119
120-env = conf.Finish()
121+ env = conf.Finish()
122
123
124 print "using CPPPATH =", python['CPPPATH']

Subscribers

People subscribed via source and target branches

to all changes: