Skip to content
Snippets Groups Projects
SConstruct 1.6 KiB
Newer Older
jdh8d's avatar
jdh8d committed
import os
import sys

jdh8d's avatar
jdh8d committed
(sysname, nodename, release, version, machine)=os.uname()

jdh8d's avatar
jdh8d committed

env=Environment()

# default build options
jdh8d's avatar
jdh8d committed
env.Replace(CFLAGS=" -fPIC ")
env.Replace(CXXFLAGS=" -std=c++11 -fPIC ")
jdh8d's avatar
jdh8d committed
env.Replace(LINKFLAGS=" -fPIC ")
jdh8d's avatar
jdh8d committed

# parse arguments
env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME'])
env.Replace(ZIPR_HOME=os.environ['ZIPR_HOME'])
env.Replace(ZIPR_INSTALL=os.environ['ZIPR_INSTALL'])
env.Replace(ZIPR_SDK=os.environ['ZIPR_SDK'])
whh8b's avatar
whh8b committed
env.Replace(profile=ARGUMENTS.get("profile",0))
jdh8d's avatar
jdh8d committed
env.Replace(debug=ARGUMENTS.get("debug",0))
jdh8d's avatar
jdh8d committed
env.Replace(do_cgc=ARGUMENTS.get("do_cgc",0))
jdh8d's avatar
jdh8d committed
env.Replace(do_64bit_build=ARGUMENTS.get("do_64bit_build",0))

whh8b's avatar
whh8b committed
if int(env['profile']) == 1:
        print "Setting profile and debug mode"
        env.Append(CFLAGS=" -pg")
        env.Append(CXXFLAGS=" -pg")
        env.Append(LINKFLAGS=" -pg")
        env['debug'] = 1
jdh8d's avatar
jdh8d committed
if int(env['debug']) == 1:
        print "Setting debug mode"
        env.Append(CFLAGS=" -g")
        env.Append(CXXFLAGS=" -g")
        env.Append(LINKFLAGS=" -g")
else:
        print "Setting release mode"
        env.Append(CFLAGS=" -O3")
        env.Append(CXXFLAGS=" -O3")
        env.Append(LINKFLAGS=" -O3")

env['build_appfw']=0
env['build_tools']=0

jdh8d's avatar
jdh8d committed
# add extra flag for solaris.
if sysname == "SunOS":
        env.Append(LINKFLAGS=" -L/opt/csw/lib -DSOLARIS  ")
        env.Append(CFLAGS=" -I/opt/csw/include -DSOLARIS ")
        env.Append(CXXFLAGS=" -I/opt/csw/include -DSOLARIS  ")
else:
	env.Append(CFLAGS=" -fPIE ")
	env.Append(CXXFLAGS=" -fPIE ")
	env.Append(LINKFLAGS=" -fPIE ")
	


jdh8d's avatar
jdh8d committed
Export('env')
SConscript("SConscript", variant_dir='build')