From cb36fa9fec169aebfad039654928a9367c681c45 Mon Sep 17 00:00:00 2001 From: Jason Hiser <jdhiser@gmail.com> Date: Sat, 16 Feb 2019 09:19:45 -0500 Subject: [PATCH] changes to support scons from peasoup-umbrella dir Former-commit-id: 617f773d82e9994f5789682e470d4bb971222e2e --- .gitignore | 2 + SConscript | 81 ++++++++++++++++++++++++++++++++++++++++ SConstruct | 36 ++++++++++++++++++ SMPStaticAnalyzer | 2 +- irdb-libs | 2 +- irdb_transforms | 2 +- zipr | 2 +- zipr_install | 2 +- zipr_large_only_plugin | 2 +- zipr_push64_reloc_plugin | 2 +- zipr_relax_plugin | 2 +- zipr_scfi_plugin | 2 +- zipr_trace_plugin | 2 +- zipr_unpin_plugin | 2 +- zipr_xeon_plugin | 2 +- 15 files changed, 131 insertions(+), 12 deletions(-) create mode 100644 SConscript create mode 100644 SConstruct diff --git a/.gitignore b/.gitignore index 6f87467ef..fe5c3b91e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,6 @@ installed manifest.txt.config ubuntu16_files/manifest.txt.config zest_runtime +.sconsign.dblite +build diff --git a/SConscript b/SConscript new file mode 100644 index 000000000..5de1a7752 --- /dev/null +++ b/SConscript @@ -0,0 +1,81 @@ +import shutil +import os +import tarfile + +Import('env') + + +#if [ ! -f manifest.txt.config -o ! -d "$PS_INSTALL" ]; then + +if not os.path.isfile("manifest.txt.config"): + print "Doing pedi setup" + pedisetup = Command( target = "./testoutput-setup", + source = "./SConscript", + action = os.environ['PEDI_HOME'] + + "/pedi --setup -m manifest.txt -l ida -l ida_key -l ps -l zipr -l stars -i " + + os.environ['PS_INSTALL'] + ) +else: + print "Pedi already setup" + pedisetup=list() + + + +# build stars and libirdb +libirdb= SConscript("irdb-libs/SConscript") # , variant_dir='build/irdb-libs') +Depends(libirdb,pedisetup) +libsmpsa= SConscript("SMPStaticAnalyzer/SConscript") # + +# specify some explicit dependencies to make sure these build in order +Depends(libsmpsa,libirdb) + +# now finish building irdb-libs once stars is setup +libirdbdeep=SConscript("irdb-libs/SConscript.deep", variant_dir='build/irdb-libs') +Depends(libirdbdeep,libsmpsa) + +# list of zipr plugins and irdb xforms to build +transformDirs=''' + zipr_large_only_plugin + irdb_transforms + zipr_push64_reloc_plugin + zipr_relax_plugin + zipr + zipr_trace_plugin + zipr_unpin_plugin + ''' + +# build the xforms and plugins +xforms=list() +for i in Split(transformDirs): + Export('env') + xform = SConscript(i+"/SConscript") + print "After step "+str(i)+", env[LINKFLAGS]=:"+env['LINKFLAGS'] + Depends(xform, libirdbdeep) + xforms = xforms + xform + + +#finally, run pedi to do the final install + +pedi = Command( target = "./testoutput-install", + source = "./SConscript", + action = os.environ['PEDI_HOME']+"/pedi -m manifest.txt " ) + +Depends(pedi, xforms) +Default( pedi ) + +if env.GetOption('clean') and os.path.isfile("manifest.txt.config"): + with open("manifest.txt.config") as myfile: + first_line=myfile.readlines()[0] #put here the interval you want + + first_line=first_line.rstrip() + + # if [[ $(head -1 manifest.txt.config) == $PS_INSTALL ]] ; then + if str(first_line) == str(os.environ['PS_INSTALL']): + print "Doing pedi clean" + os.system( "pwd; $PEDI_HOME/pedi -c -m manifest.txt " ) + shutil.rmtree(os.environ['PS_INSTALL']) + else: + print "Eliding pedi clean as I'm not the root" + print "Root is '"+first_line+"'" + print "I am '"+str(os.environ['PS_INSTALL'])+"'" + diff --git a/SConstruct b/SConstruct new file mode 100644 index 000000000..f973d39d7 --- /dev/null +++ b/SConstruct @@ -0,0 +1,36 @@ +import os +import sys + +env=Environment() + + +# default build options +env.Replace(CFLAGS=" -fPIC -fmax-errors=2 -Wall -Werror -fmax-errors=2 ") +env.Replace(CXXFLAGS=" -fPIC -fmax-errors=2 -Wall -Werror -fmax-errors=2 ") +env.Replace(LINKFLAGS="-fPIC -fmax-errors=2 -Wall -Werror -fmax-errors=2 -Wl,-unresolved-symbols=ignore-in-shared-libs ") +env.Replace(SHLINKFLAGS="-fPIC -fmax-errors=2 -Wall -Werror -fmax-errors=2 -shared ") # default is ignore all link errors + +# parse arguments into env and set default values. +env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME']) +env.Replace(IRDB_SDK=os.environ['IRDB_SDK']) +env.Replace(SMPSA_HOME=os.environ['SMPSA_HOME']) +env.Replace(debug=ARGUMENTS.get("debug",0)) +env.Replace(PEDI_HOME=os.environ['PEDI_HOME']) + + +if int(env['debug']) == 1: + print "Setting debug mode" + env.Append(CFLAGS=" -g ") + env.Append(CXXFLAGS=" -g ") + env.Append(LINKFLAGS=" -g ") + env.Append(SHLINKFLAGS=" -g ") +else: + print "Setting release mode" + env.Append(CFLAGS=" -O ") + env.Append(CXXFLAGS=" -O ") + env.Append(LINKFLAGS=" -O ") + env.Append(SHLINKFLAGS=" -O ") + +Export('env') +SConscript("SConscript") + diff --git a/SMPStaticAnalyzer b/SMPStaticAnalyzer index ac449438c..35e23d7b0 160000 --- a/SMPStaticAnalyzer +++ b/SMPStaticAnalyzer @@ -1 +1 @@ -Subproject commit ac449438c65065002cde8f229ba69eececa678f2 +Subproject commit 35e23d7b0764cf88ed1335e199c9074bb0903c57 diff --git a/irdb-libs b/irdb-libs index d1cf03ff3..83aba772d 160000 --- a/irdb-libs +++ b/irdb-libs @@ -1 +1 @@ -Subproject commit d1cf03ff37a850d7fb98b16458747411ac083638 +Subproject commit 83aba772d54135dee90fbf744e4c7b571c9dae1f diff --git a/irdb_transforms b/irdb_transforms index b53be5627..42b9ffbd7 160000 --- a/irdb_transforms +++ b/irdb_transforms @@ -1 +1 @@ -Subproject commit b53be562746eb6e6a677205116fdeed64c4504ed +Subproject commit 42b9ffbd71eb9403bdc462ff96efd845c831a3b9 diff --git a/zipr b/zipr index 5b986cf6e..6ec310e6f 160000 --- a/zipr +++ b/zipr @@ -1 +1 @@ -Subproject commit 5b986cf6ee06139c4659da6218d4fc1d3b14c708 +Subproject commit 6ec310e6f9bb2fb7d972d17e5942d959091b4a81 diff --git a/zipr_install b/zipr_install index 3c03d1d87..27cf31c68 160000 --- a/zipr_install +++ b/zipr_install @@ -1 +1 @@ -Subproject commit 3c03d1d879d783a880b7989c38c5d83fe92e1c84 +Subproject commit 27cf31c68d1827e164503f67bb1a63b507bb3c60 diff --git a/zipr_large_only_plugin b/zipr_large_only_plugin index 12339c978..2dfdbe478 160000 --- a/zipr_large_only_plugin +++ b/zipr_large_only_plugin @@ -1 +1 @@ -Subproject commit 12339c9789869e11d7d13925eb0f6e34cdeccfc4 +Subproject commit 2dfdbe478368eb8a995f43fed087bf0a8cbb568f diff --git a/zipr_push64_reloc_plugin b/zipr_push64_reloc_plugin index 356757cf0..d918e4ae5 160000 --- a/zipr_push64_reloc_plugin +++ b/zipr_push64_reloc_plugin @@ -1 +1 @@ -Subproject commit 356757cf051c251f61d55bfc59bc5255b59f5d4a +Subproject commit d918e4ae5ebae423ee43799c0d9cfb87650b741e diff --git a/zipr_relax_plugin b/zipr_relax_plugin index 82783bd2f..be4f33164 160000 --- a/zipr_relax_plugin +++ b/zipr_relax_plugin @@ -1 +1 @@ -Subproject commit 82783bd2f3ffb67fc4d7535bc56553551183eae7 +Subproject commit be4f331648edf94d2c35f3a4d3b6b8bb684918fe diff --git a/zipr_scfi_plugin b/zipr_scfi_plugin index 117d8f422..6d590ba48 160000 --- a/zipr_scfi_plugin +++ b/zipr_scfi_plugin @@ -1 +1 @@ -Subproject commit 117d8f422006cc72d3a8109ad55e367585a18057 +Subproject commit 6d590ba4831d0fe114ee50db11a7437a39fd5864 diff --git a/zipr_trace_plugin b/zipr_trace_plugin index 246f0706c..485c201e7 160000 --- a/zipr_trace_plugin +++ b/zipr_trace_plugin @@ -1 +1 @@ -Subproject commit 246f0706c720c3c4d5908d9c401c29f508729b63 +Subproject commit 485c201e78a001bea38cad0c38377e4b472ee745 diff --git a/zipr_unpin_plugin b/zipr_unpin_plugin index 1c1e26a1c..36c745483 160000 --- a/zipr_unpin_plugin +++ b/zipr_unpin_plugin @@ -1 +1 @@ -Subproject commit 1c1e26a1c38ed817a22c1f01742960725346d62a +Subproject commit 36c745483816c879bc3a521c0ebb55393f6cee50 diff --git a/zipr_xeon_plugin b/zipr_xeon_plugin index 46d1a74bc..8c159de15 160000 --- a/zipr_xeon_plugin +++ b/zipr_xeon_plugin @@ -1 +1 @@ -Subproject commit 46d1a74bc5f1b8504a3d0e04cf770351aecb8582 +Subproject commit 8c159de15a16b023747187c1db12e2eb9dc3ca22 -- GitLab