summaryrefslogtreecommitdiffstats
path: root/parts/appwizard/common/scons/admin/generic.py
diff options
context:
space:
mode:
Diffstat (limited to 'parts/appwizard/common/scons/admin/generic.py')
-rw-r--r--parts/appwizard/common/scons/admin/generic.py48
1 files changed, 24 insertions, 24 deletions
diff --git a/parts/appwizard/common/scons/admin/generic.py b/parts/appwizard/common/scons/admin/generic.py
index 55c37c90..52c4e3bc 100644
--- a/parts/appwizard/common/scons/admin/generic.py
+++ b/parts/appwizard/common/scons/admin/generic.py
@@ -31,18 +31,18 @@ def generate(env):
env['HELP']=1
if env['HELP']:
- print """
+ print("""
"""+BOLD+"""*** Generic options ***
-----------------------"""+NORMAL+"""
"""+BOLD+"""* debug """+NORMAL+""": debug=1 (-g) or debug=full (-g3, slower) else use environment CXXFLAGS, or -O2 by default
"""+BOLD+"""* prefix """+NORMAL+""": the installation path
"""+BOLD+"""* extraincludes """+NORMAL+""": a list of paths separated by ':'
ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/include:/usr/local
-"""+NORMAL
+"""+NORMAL)
## Global cache directory
## Put all project files in it so a rm -rf cache will clean up the config
- if not env.has_key('CACHEDIR'):
+ if 'CACHEDIR' not in env:
env['CACHEDIR'] = os.getcwd()+'/cache/'
if not os.path.isdir(env['CACHEDIR']):
os.mkdir(env['CACHEDIR'])
@@ -56,9 +56,9 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
# Special trick for installing rpms ...
env['DESTDIR']=''
- if 'install' in sys.argv and os.environ.has_key('DESTDIR'):
+ if 'install' in sys.argv and 'DESTDIR' in os.environ:
env['DESTDIR']=os.environ['DESTDIR']+'/'
- print CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR']
+ print(CYAN+'** Enabling DESTDIR for the project ** ' + NORMAL + env['DESTDIR'])
# load the options
from SCons.Options import Options, PathOption
@@ -89,7 +89,7 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
env['_CONFIGURE']=0
# configure the environment if needed
- if not env['HELP'] and (env['_CONFIGURE'] or not env.has_key('ISCONFIGURED')):
+ if not env['HELP'] and (env['_CONFIGURE'] or 'ISCONFIGURED' not in env):
import re
def makeHashTable(args):
@@ -108,40 +108,40 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
env['ARGS']=makeHashTable(sys.argv)
# be paranoid, unset existing variables
- if env.has_key('KDECXXFLAGS'):
+ if 'KDECXXFLAGS' in env:
env.__delitem__('KDECXXFLAGS')
- if env.has_key('KDECCFLAGS'):
+ if 'KDECCFLAGS' in env:
env.__delitem__('KDECCFLAGS')
- if env.has_key('KDELINKFLAGS'):
+ if 'KDELINKFLAGS' in env:
env.__delitem__('KDELINKFLAGS')
- if env.has_key('PREFIX'):
+ if 'PREFIX' in env:
env.__delitem__('PREFIX')
- if env.has_key('EXTRAINCLUDES'):
+ if 'EXTRAINCLUDES' in env:
env.__delitem__('EXTRAINCLUDES')
- if env.has_key('ISCONFIGURED'):
+ if 'ISCONFIGURED' in env:
env.__delitem__('ISCONFIGURED')
if env['ARGS'].get('debug', None):
debuglevel = env['ARGS'].get('debug', None)
- print CYAN+'** Enabling debug for the project **' + NORMAL
+ print(CYAN+'** Enabling debug for the project **' + NORMAL)
if (debuglevel == "full"):
env['KDECXXFLAGS'] = ['-DDEBUG', '-g3']
else:
env['KDECXXFLAGS'] = ['-DDEBUG', '-g']
else:
- if os.environ.has_key('CXXFLAGS'):
+ if 'CXXFLAGS' in os.environ:
# user-defined flags (gentooers will be elighted)
env['KDECXXFLAGS'] = SCons.Util.CLVar( os.environ['CXXFLAGS'] )
env.Append( KDECXXFLAGS = ['-DNDEBUG', '-DNO_DEBUG'] )
else:
env.Append(KDECXXFLAGS = ['-O2', '-DNDEBUG', '-DNO_DEBUG'])
- if os.environ.has_key('CFLAGS'):
+ if 'CFLAGS' in os.environ:
env['KDECCFLAGS'] = SCons.Util.CLVar( os.environ['CFLAGS'] )
## FreeBSD settings (contributed by will at freebsd dot org)
if os.uname()[0] == "FreeBSD":
- if os.environ.has_key('PTHREAD_LIBS'):
+ if 'PTHREAD_LIBS' in os.environ:
env.AppendUnique( KDELINKFLAGS = SCons.Util.CLVar( os.environ['PTHREAD_LIBS'] ) )
else:
syspf = os.popen('/sbin/sysctl kern.osreldate')
@@ -159,15 +159,15 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
# User-specified prefix
if env['ARGS'].get('prefix', None):
env['PREFIX'] = env['ARGS'].get('prefix', None)
- print CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL
- elif env.has_key('PREFIX'):
+ print(CYAN+'** set the installation prefix for the project : ' + env['PREFIX'] +' **'+ NORMAL)
+ elif 'PREFIX' in env:
env.__delitem__('PREFIX')
# User-specified include paths
env['EXTRAINCLUDES'] = env['ARGS'].get('extraincludes', None)
if env['ARGS'].get('extraincludes', None):
- print CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL
- elif env.has_key('EXTRAINCLUDES'):
+ print(CYAN+'** set extra include paths for the project : ' + env['EXTRAINCLUDES'] +' **'+ NORMAL)
+ elif 'EXTRAINCLUDES' in env:
env.__delitem__('EXTRAINCLUDES')
env['ISCONFIGURED']=1
@@ -175,16 +175,16 @@ ie: """+BOLD+"""scons configure debug=full prefix=/usr/local extraincludes=/tmp/
# And finally save the options in the cache
opts.Save(cachefile, env)
- if env.has_key('KDECXXFLAGS'):
+ if 'KDECXXFLAGS' in env:
env.AppendUnique( CPPFLAGS = env['KDECXXFLAGS'] )
- if env.has_key('KDECCFLAGS'):
+ if 'KDECCFLAGS' in env:
env.AppendUnique( CCFLAGS = env['KDECCFLAGS'] )
- if env.has_key('KDELINKFLAGS'):
+ if 'KDELINKFLAGS' in env:
env.AppendUnique( LINKFLAGS = env['KDELINKFLAGS'] )
- if env.has_key('EXTRAINCLUDES'):
+ if 'EXTRAINCLUDES' in env:
incpaths = []
for dir in str(env['EXTRAINCLUDES']).split(':'):
incpaths.append( dir )