diff --git a/SConscript b/SConscript index c8a92140b59a0eec1357bb554e7b2db06b83abff..7cd2f6bb0071603f18135e98ce2dbe8aa5254831 100644 --- a/SConscript +++ b/SConscript @@ -6,28 +6,47 @@ Import('env') if env.GetOption('clean'): if os.path.exists(os.environ['SECURITY_TRANSFORMS_HOME']+"/third_party/ELFIO"): - print 'Removing third_party/ELFIO' + print 'Removing third_party/ELFIO' shutil.rmtree(os.environ['SECURITY_TRANSFORMS_HOME']+"/third_party/ELFIO") + if os.path.exists(os.environ['SECURITY_TRANSFORMS_HOME']+"/third_party/SQLITE3"): + print 'Removing third_party/SQLITE3' + shutil.rmtree(os.environ['SECURITY_TRANSFORMS_HOME']+"/third_party/SQLITE3") if os.path.exists(os.environ['SECURITY_TRANSFORMS_HOME']+"/include/elfio"): - print 'Removing include/elfio' + print 'Removing include/elfio' shutil.rmtree(os.environ['SECURITY_TRANSFORMS_HOME']+"/include/elfio") if os.path.exists(os.environ['SECURITY_TRANSFORMS_HOME']+"/include/targ-config.h"): - print 'Removing include/elfio' + print 'Removing include/targ-config.h' os.remove(os.environ['SECURITY_TRANSFORMS_HOME']+"/include/targ-config.h") else: ELFIO_DIR=os.environ['SECURITY_TRANSFORMS_HOME']+"/third_party/ELFIO/" if not os.path.exists(ELFIO_DIR): os.makedirs(ELFIO_DIR) # make directory tgz=tarfile.open(os.environ['SECURITY_TRANSFORMS_HOME']+"/third_party/elfio-2.2.tar.gz", "r:gz") - print 'Extracting elfio tarball' - tgz.list(verbose=False) + print 'Extracting elfio tarball' + tgz.list(verbose=False) tgz.extractall(ELFIO_DIR) shutil.copytree(ELFIO_DIR+"elfio-2.2/elfio", os.environ['SECURITY_TRANSFORMS_HOME']+"/include/elfio") - shutil.copy(os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'],"third_party","elfio.hpp"), + shutil.copy(os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'],"third_party","elfio.hpp"), os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'],"include","elfio","elfio.hpp")) else: assert os.path.isdir(ELFIO_DIR) + # SQLITE3 + SQLITE3_DIR=os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'], 'third_party/SQLITE3') + if not os.path.exists(SQLITE3_DIR): + os.makedirs(SQLITE3_DIR) # make directory + tgz=tarfile.open(os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'], 'third_party/sqlite-autoconf-3071300.tar.gz'), "r:gz") + print 'Extracting needed files from sqlite3 tarball' + tgz.list(verbose=False) + tgz.extract('sqlite-autoconf-3071300/sqlite3.h', SQLITE3_DIR) + tgz.extract('sqlite-autoconf-3071300/sqlite3.c', SQLITE3_DIR) + # copy sqlite3.h + source_dir = os.path.join(SQLITE3_DIR, 'sqlite-autoconf-3071300') + target_dir = os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'], 'appfw', 'src') + shutil.copy(os.path.join(source_dir, 'sqlite3.h'), os.path.abspath(os.path.join(target_dir, 'sqlite3.h'))) + else: + assert os.path.isdir(SQLITE3_DIR) + # check/install targ-config.h if not os.path.isfile(os.environ['SECURITY_TRANSFORMS_HOME']+"/include/targ-config.h"): (sysname, nodename, release, version, machine)=os.uname() @@ -48,5 +67,6 @@ SConscript("tools/SConscript", variant_dir='scons_build/tools') build_appfw=ARGUMENTS.get("build_appfw", None) if build_appfw is None or int(build_appfw)==1: - SConscript("appfw/SConscript", variant_dir='scons_build/appfw') -#if ARGUMENTS.get("build_appfw", None) is None or int(env['build_appfw'])==1: +# SConscript("appfw/src/SConscript", variant_dir='scons_build/appfw') + SConscript("appfw/src/SConscript.64", variant_dir='scons_build/appfw.64') + SConscript("appfw/src/SConscript.32", variant_dir='scons_build/appfw.32') diff --git a/SConstruct b/SConstruct index 80bdf75fbf68f828543b4b962b456adfc6bd75df..0b223f57546e32c2a6e27aa82f52310ec5a9c98c 100644 --- a/SConstruct +++ b/SConstruct @@ -13,11 +13,11 @@ env.Replace(LINKFLAGS="-fPIC -w ") env.Replace(SECURITY_TRANSFORMS_HOME=os.environ['SECURITY_TRANSFORMS_HOME']) env.Replace(do_64bit_build=ARGUMENTS.get("do_64bit_build",None)) env.Replace(debug=ARGUMENTS.get("debug",0)) -#env.Replace(build_appfw=ARGUMENTS.get("build_appfw", None)) +env.Replace(build_appfw=ARGUMENTS.get("build_appfw", None)) # by default, turn on build of appfw -#if env['build_appfw'] is None: -# env['build_appfw'] = 1 +if env['build_appfw'] is None: + env['build_appfw'] = 1 if int(env['debug']) == 1: print "Setting debug mode" diff --git a/appfw/SConscript b/appfw/SConscript index 5c6d9197439c3f5126b41a2e97cefe0542ab382b..e10a2cbd2cc26ae916c8a33fc87afad8397351d4 100644 --- a/appfw/SConscript +++ b/appfw/SConscript @@ -1,7 +1,7 @@ import os +import shutil Import('env') -SConscript("src/SConstruct") - -#SConscript("test/SConscript") +SConscript("src/SConscript.64", variant_dir='build64') +SConscript("src/SConscript.32", variant_dir='build32') diff --git a/appfw/src/SConscript.32 b/appfw/src/SConscript.32 index bf7725f5556c47531c587685e4277bce047a5e8c..97d4367d398538b05d6525569b186bec455d4ff3 100644 --- a/appfw/src/SConscript.32 +++ b/appfw/src/SConscript.32 @@ -20,8 +20,6 @@ env.Replace(CCFLAGS="-m32") SQLITE3_DIR=os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'], 'third_party/SQLITE3') -print 'i am in cwd: ', os.getcwd() - if env.GetOption('clean'): print 'option clean is turned on' if os.path.exists(SQLITE3_DIR): @@ -33,14 +31,6 @@ if env.GetOption('clean'): if os.path.exists('combined_sqlite3.c'): os.remove('combined_sqlite3.c') else: - if not os.path.exists(SQLITE3_DIR): - os.makedirs(SQLITE3_DIR) # make directory - tgz=tarfile.open(os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'], 'third_party/sqlite-autoconf-3071300.tar.gz'), "r:gz") - print 'Extracting needed files from sqlite3 tarball' - tgz.list(verbose=False) - tgz.extract('sqlite-autoconf-3071300/sqlite3.h', SQLITE3_DIR) - tgz.extract('sqlite-autoconf-3071300/sqlite3.c', SQLITE3_DIR) - assert os.path.isdir(SQLITE3_DIR) source_dir = os.path.join(SQLITE3_DIR, 'sqlite-autoconf-3071300') @@ -48,14 +38,6 @@ else: shutil.copy(os.path.join(source_dir, 'sqlite3.c'), os.path.join(target_dir, 'appfw_sqlite3.c')) shutil.copy(os.path.join(source_dir, 'sqlite3.h'), os.path.join(target_dir, 'appfw_sqlite3.h')) - print 'Copying sqlite3.h into: ' + os.path.join(target_dir, 'sqlite3.h') - shutil.copy(os.path.join(source_dir, 'sqlite3.h'), os.path.join(target_dir, 'sqlite3.h')) - print 'Copying sqlite3.h into: ' + os.path.abspath(os.path.join(target_dir, '..', 'sqlite3.h')) - shutil.copy(os.path.join(source_dir, 'sqlite3.h'), os.path.abspath(os.path.join(target_dir, '..', 'sqlite3.h'))) - - assert os.path.exists(os.path.abspath(os.path.join(target_dir, '..', 'sqlite3.h'))) - assert os.path.exists(os.path.abspath(os.path.join(target_dir, 'sqlite3.h'))) - # need to do the sed replacement: sqlite3.[ch] --> appfw_sqlite3.[ch] substitute_in_file(os.path.join(target_dir,'appfw_sqlite3.c'), 'sqlite3', 'appfw_sqlite3') substitute_in_file(os.path.join(target_dir,'appfw_sqlite3.h'), 'sqlite3', 'appfw_sqlite3') @@ -67,9 +49,6 @@ else: for line in fileinput.input(files=('appfw_sqlite3.c', sqlfw_c)): fout.write(line) - assert os.path.exists(os.path.abspath(os.path.join(target_dir, '..', 'sqlite3.h'))) - assert os.path.exists(os.path.abspath(os.path.join(target_dir, 'sqlite3.h'))) - libname="appfw" files_c = ''' diff --git a/appfw/src/SConscript.64 b/appfw/src/SConscript.64 index 989a0e11fb9532455bf649a8096492205d20e714..36571f78880df254739d15202293c21d5858a8f6 100644 --- a/appfw/src/SConscript.64 +++ b/appfw/src/SConscript.64 @@ -20,10 +20,7 @@ env.Replace(INSTALL_PATH_PREFIX="$SECURITY_TRANSFORMS_HOME/appfw/lib/64") SQLITE3_DIR=os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'], 'third_party/SQLITE3') -print 'i am in cwd: ', os.getcwd() - if env.GetOption('clean'): - print 'option clean is turned on' if os.path.exists(SQLITE3_DIR): shutil.rmtree(SQLITE3_DIR) if os.path.exists('appfw_sqlite3.c'): @@ -33,14 +30,6 @@ if env.GetOption('clean'): if os.path.exists('combined_sqlite3.c'): os.remove('combined_sqlite3.c') else: - if not os.path.exists(SQLITE3_DIR): - os.makedirs(SQLITE3_DIR) # make directory - tgz=tarfile.open(os.path.join(os.environ['SECURITY_TRANSFORMS_HOME'], 'third_party/sqlite-autoconf-3071300.tar.gz'), "r:gz") - print 'Extracting needed files from sqlite3 tarball' - tgz.list(verbose=False) - tgz.extract('sqlite-autoconf-3071300/sqlite3.h', SQLITE3_DIR) - tgz.extract('sqlite-autoconf-3071300/sqlite3.c', SQLITE3_DIR) - assert os.path.isdir(SQLITE3_DIR) source_dir = os.path.join(SQLITE3_DIR, 'sqlite-autoconf-3071300') @@ -48,14 +37,6 @@ else: shutil.copy(os.path.join(source_dir, 'sqlite3.c'), os.path.join(target_dir, 'appfw_sqlite3.c')) shutil.copy(os.path.join(source_dir, 'sqlite3.h'), os.path.join(target_dir, 'appfw_sqlite3.h')) - print 'Copying sqlite3.h into: ' + os.path.join(target_dir, 'sqlite3.h') - shutil.copy(os.path.join(source_dir, 'sqlite3.h'), os.path.join(target_dir, 'sqlite3.h')) - print 'Copying sqlite3.h into: ' + os.path.abspath(os.path.join(target_dir, '..', 'sqlite3.h')) - shutil.copy(os.path.join(source_dir, 'sqlite3.h'), os.path.abspath(os.path.join(target_dir, '..', 'sqlite3.h'))) - - assert os.path.exists(os.path.abspath(os.path.join(target_dir, '..', 'sqlite3.h'))) - assert os.path.exists(os.path.abspath(os.path.join(target_dir, 'sqlite3.h'))) - # need to do the sed replacement: sqlite3.[ch] --> appfw_sqlite3.[ch] substitute_in_file(os.path.join(target_dir,'appfw_sqlite3.c'), 'sqlite3', 'appfw_sqlite3') substitute_in_file(os.path.join(target_dir,'appfw_sqlite3.h'), 'sqlite3', 'appfw_sqlite3') @@ -67,9 +48,6 @@ else: for line in fileinput.input(files=('appfw_sqlite3.c', sqlfw_c)): fout.write(line) - assert os.path.exists(os.path.abspath(os.path.join(target_dir, '..', 'sqlite3.h'))) - assert os.path.exists(os.path.abspath(os.path.join(target_dir, 'sqlite3.h'))) - libname="appfw" files_c = '''