From 7dcdecfa091a10a186f43ed82c4b1ee3d6e82b7c Mon Sep 17 00:00:00 2001 From: Kevin Borgolte Date: Tue, 5 May 2015 11:29:26 -0700 Subject: [PATCH 1/3] fix mixed tab/spaces indent --- scripts/mk_util.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index 72d432eab..b0443c808 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -248,16 +248,16 @@ def test_fpmath(cc): t.add('int main() { return 42; }\n') t.commit() if exec_compiler_cmd([cc, CPPFLAGS, 'tstsse.cpp', LDFLAGS, '-mfpmath=sse -msse -msse2']) == 0: - FPMATH_FLAGS="-mfpmath=sse -msse -msse2" + FPMATH_FLAGS="-mfpmath=sse -msse -msse2" return "SSE2-GCC" elif exec_compiler_cmd([cc, CPPFLAGS, 'tstsse.cpp', LDFLAGS, '-msse -msse2']) == 0: - FPMATH_FLAGS="-msse -msse2" + FPMATH_FLAGS="-msse -msse2" return "SSE2-CLANG" elif exec_compiler_cmd([cc, CPPFLAGS, 'tstsse.cpp', LDFLAGS, '-mfpu=vfp -mfloat-abi=hard']) == 0: - FPMATH_FLAGS="-mfpu=vfp -mfloat-abi=hard" + FPMATH_FLAGS="-mfpu=vfp -mfloat-abi=hard" return "ARM-VFP" else: - FPMATH_FLAGS="" + FPMATH_FLAGS="" return "UNKNOWN" @@ -412,7 +412,7 @@ def find_ml_lib(): print ('Finding OCAML_LIB...') t = TempFile('output') null = open(os.devnull, 'wb') - try: + try: subprocess.call([OCAMLC, '-where'], stdout=t.fname, stderr=null) t.commit() except: @@ -553,7 +553,7 @@ def display_help(exit_code): print(" -n, --nodotnet do not generate Microsoft.Z3.dll make rules.") print(" -j, --java generate Java bindings.") print(" --ml generate OCaml bindings.") - print(" --staticlib build Z3 static library.") + print(" --staticlib build Z3 static library.") if not IS_WINDOWS: print(" -g, --gmp use GMP.") print(" --gprof enable gprof") @@ -1841,7 +1841,7 @@ def mk_config(): CPPFLAGS = '%s -DZ3GITHASH=%s' % (CPPFLAGS, GIT_HASH) CXXFLAGS = '%s -fvisibility=hidden -c' % CXXFLAGS FPMATH = test_fpmath(CXX) - CXXFLAGS = '%s %s' % (CXXFLAGS, FPMATH_FLAGS) + CXXFLAGS = '%s %s' % (CXXFLAGS, FPMATH_FLAGS) HAS_OMP = test_openmp(CXX) if HAS_OMP: CXXFLAGS = '%s -fopenmp' % CXXFLAGS From f458423868c8613c57903a038797995d7806c842 Mon Sep 17 00:00:00 2001 From: Kevin Borgolte Date: Tue, 5 May 2015 11:29:48 -0700 Subject: [PATCH 2/3] remove trailing whitespace --- scripts/mk_util.py | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index b0443c808..f8a9f4468 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -1415,7 +1415,7 @@ class MLComponent(Component): fout.close() if VERBOSE: print("Updated '%s'" % ml_meta_out) - + def mk_makefile(self, out): if is_ml_enabled(): @@ -1459,16 +1459,16 @@ class MLComponent(Component): archives = archives + ' ' + os.path.join(sub_dir,m) + '.cma' mls = mls + ' ' + os.path.join(sub_dir, m) + '.ml' - out.write('%s: %s %s\n' % - (os.path.join(sub_dir, 'z3native_stubs$(OBJ_EXT)'), - os.path.join(sub_dir, 'z3native_stubs.c'), + out.write('%s: %s %s\n' % + (os.path.join(sub_dir, 'z3native_stubs$(OBJ_EXT)'), + os.path.join(sub_dir, 'z3native_stubs.c'), get_component(Z3_DLL_COMPONENT).dll_name+'$(SO_EXT)')); - out.write('\t$(CC) $(CXXFLAGS_OCAML) -I %s -I %s %s $(CXX_OUT_FLAG)%s$(OBJ_EXT)\n' % + out.write('\t$(CC) $(CXXFLAGS_OCAML) -I %s -I %s %s $(CXX_OUT_FLAG)%s$(OBJ_EXT)\n' % (OCAML_LIB, api_src, os.path.join(sub_dir, 'z3native_stubs.c'), os.path.join(sub_dir, 'z3native_stubs'))) out.write('%s: %s %s %s$(SO_EXT)' % ( - os.path.join(sub_dir, "z3ml.cmxa"), - cmis, + os.path.join(sub_dir, "z3ml.cmxa"), + cmis, archives, get_component(Z3_DLL_COMPONENT).dll_name)) out.write(' %s\n' % (os.path.join(sub_dir, 'z3native_stubs$(OBJ_EXT)'))) @@ -1507,7 +1507,7 @@ class MLComponent(Component): out.write(' ' + get_component(Z3_DLL_COMPONENT).dll_name + '$(LIB_EXT)') out.write('\n\n') - + def main_component(self): return is_ml_enabled() @@ -1631,7 +1631,7 @@ class MLExampleComponent(ExampleComponent): if ML_ENABLED: out.write('ml_example.byte: api/ml/z3ml.cmxa ') for mlfile in get_ml_files(self.ex_dir): - out.write(' %s' % os.path.join(self.to_ex_dir, mlfile)) + out.write(' %s' % os.path.join(self.to_ex_dir, mlfile)) out.write('\n') out.write('\t%s ' % OCAMLC) if DEBUG_MODE: @@ -1642,7 +1642,7 @@ class MLExampleComponent(ExampleComponent): out.write('\n') out.write('ml_example$(EXE_EXT): api/ml/z3ml.cmxa ml_example.byte') for mlfile in get_ml_files(self.ex_dir): - out.write(' %s' % os.path.join(self.to_ex_dir, mlfile)) + out.write(' %s' % os.path.join(self.to_ex_dir, mlfile)) out.write('\n') out.write('\t%s ' % OCAMLOPT) if DEBUG_MODE: @@ -1803,7 +1803,7 @@ def mk_config(): if is_verbose(): print('64-bit: %s' % is64()) print('OpenMP: %s' % HAS_OMP) - if is_java_enabled(): + if is_java_enabled(): print('JNI Bindings: %s' % JNI_HOME) print('Java Compiler: %s' % JAVAC) if is_ml_enabled(): @@ -1927,10 +1927,10 @@ def mk_config(): print('OpenMP: %s' % HAS_OMP) print('Prefix: %s' % PREFIX) print('64-bit: %s' % is64()) - print('FP math: %s' % FPMATH) + print('FP math: %s' % FPMATH) if GPROF: print('gprof: enabled') - print('Python version: %s' % distutils.sysconfig.get_python_version()) + print('Python version: %s' % distutils.sysconfig.get_python_version()) if is_java_enabled(): print('JNI Bindings: %s' % JNI_HOME) print('Java Compiler: %s' % JAVAC) @@ -2819,7 +2819,7 @@ def mk_z3consts_ml(api_files): m2 = comment_pat.match(line) if m1 or m2: # skip blank lines and comments - linenum = linenum + 1 + linenum = linenum + 1 elif mode == SEARCHING: m = typedef_pat.match(line) if m: @@ -2897,7 +2897,7 @@ def mk_z3consts_ml(api_files): m2 = comment_pat.match(line) if m1 or m2: # skip blank lines and comments - linenum = linenum + 1 + linenum = linenum + 1 elif mode == SEARCHING: m = typedef_pat.match(line) if m: From 024923526baec3343d70da9cfa04a5bc1c0f7c35 Mon Sep 17 00:00:00 2001 From: Kevin Borgolte Date: Tue, 5 May 2015 11:31:32 -0700 Subject: [PATCH 3/3] remove unused modules --- scripts/mk_util.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/mk_util.py b/scripts/mk_util.py index f8a9f4468..c98f44fa6 100644 --- a/scripts/mk_util.py +++ b/scripts/mk_util.py @@ -8,7 +8,6 @@ ############################################ import sys import os -import glob import re import getopt import shutil @@ -17,7 +16,6 @@ from fnmatch import fnmatch import distutils.sysconfig import compileall import subprocess -import string def getenv(name, default): try: