/[escript]/branches/4.0fordebian/site_scons/extractdebbuild.py
ViewVC logotype

Contents of /branches/4.0fordebian/site_scons/extractdebbuild.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5577 - (show annotations)
Fri Apr 3 05:26:15 2015 UTC (4 years, 2 months ago) by jfenwick
File MIME type: text/x-python
File size: 1992 byte(s)
Fixes to make us more lintian compliant (copied across from private git)
1
2 ##############################################################################
3 #
4 # Copyright (c) 2015 by University of Queensland
5 # http://www.uq.edu.au
6 #
7 # Primary Business: Queensland, Australia
8 # Licensed under the Open Software License version 3.0
9 # http://www.opensource.org/licenses/osl-3.0.php
10 #
11 # Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 # Development 2012-2013 by School of Earth Sciences
13 # Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 #
15 ##############################################################################
16
17 __copyright__="""Copyright (c) 2015 by University of Queensland
18 http://www.uq.edu.au
19 Primary Business: Queensland, Australia"""
20 __license__="""Licensed under the Open Software License version 3.0
21 http://www.opensource.org/licenses/osl-3.0.php"""
22 __url__="https://launchpad.net/escript-finley"
23
24
25 #Extracts Debian build options
26
27 import subprocess
28 import sys
29
30 def getdebbuildflags():
31 print("Starting getflags")
32 usedflags={'CFLAGS':None, 'CPPFLAGS':'cpp_flags', 'CXXFLAGS':'cxx_extra', 'LDFLAGS':'ld_extra'}
33 ignoreflags=['FFLAGS','FCFLAGS', 'GCJFLAGS','OBJCFLAGS','OBJCXXFLAGS']
34 mycflags=None
35 mycxxflags=None
36 try:
37 deps=subprocess.check_output("dpkg-buildflags")
38 except OSError:
39 return []
40 res=[]
41 deps=deps.split("\n")
42 for line in deps:
43 ind=line.find("=")
44 if ind==-1:
45 continue
46 key=line[:ind]
47 val=line[ind+1:]
48 if key in ignoreflags:
49 continue
50 if key not in usedflags:
51 raise RuntimeError("Unknown key ("+key+") in dpkg-buildflags")
52 if key=="CFLAGS":
53 mycflags=val
54 if key=="CXXFLAGS":
55 mycxxflags=val
56 if mycflags is not None and mycxxflags is not None and mycflags!=mycxxflags:
57 raise RuntimeError("We do not current support different different dpkg-buildflags for C vs C++")
58 if usedflags[key] is None:
59 continue
60 res.append([usedflags[key],val])
61 print("Ending getflags")
62 return res

  ViewVC Help
Powered by ViewVC 1.1.26