mirror of
https://github.com/Z3Prover/z3
synced 2025-06-06 22:23:22 +00:00
added --x86 build flag
This commit is contained in:
parent
48c72d2c38
commit
5e6ea4e570
1 changed files with 13 additions and 2 deletions
|
@ -59,6 +59,7 @@ VERBOSE=True
|
||||||
DEBUG_MODE=False
|
DEBUG_MODE=False
|
||||||
SHOW_CPPS = True
|
SHOW_CPPS = True
|
||||||
VS_X64 = False
|
VS_X64 = False
|
||||||
|
LINUX_X64 = True
|
||||||
ONLY_MAKEFILES = False
|
ONLY_MAKEFILES = False
|
||||||
Z3PY_SRC_DIR=None
|
Z3PY_SRC_DIR=None
|
||||||
VS_PROJ = False
|
VS_PROJ = False
|
||||||
|
@ -334,7 +335,8 @@ def check_java():
|
||||||
raise MKException("Failed to detect jni.h. Possible solution: set JNI_HOME with the path to JDK.")
|
raise MKException("Failed to detect jni.h. Possible solution: set JNI_HOME with the path to JDK.")
|
||||||
|
|
||||||
def is64():
|
def is64():
|
||||||
return sys.maxsize >= 2**32
|
global LINUX_X64
|
||||||
|
return LINUX_X64 and sys.maxsize >= 2**32
|
||||||
|
|
||||||
def check_ar():
|
def check_ar():
|
||||||
if is_verbose():
|
if is_verbose():
|
||||||
|
@ -450,6 +452,8 @@ def display_help(exit_code):
|
||||||
print(" -t, --trace enable tracing in release mode.")
|
print(" -t, --trace enable tracing in release mode.")
|
||||||
if IS_WINDOWS:
|
if IS_WINDOWS:
|
||||||
print(" -x, --x64 create 64 binary when using Visual Studio.")
|
print(" -x, --x64 create 64 binary when using Visual Studio.")
|
||||||
|
else:
|
||||||
|
print(" --x86 force 32-bit x86 build on x64 systems.")
|
||||||
print(" -m, --makefiles generate only makefiles.")
|
print(" -m, --makefiles generate only makefiles.")
|
||||||
if IS_WINDOWS:
|
if IS_WINDOWS:
|
||||||
print(" -v, --vsproj generate Visual Studio Project Files.")
|
print(" -v, --vsproj generate Visual Studio Project Files.")
|
||||||
|
@ -477,12 +481,13 @@ def display_help(exit_code):
|
||||||
def parse_options():
|
def parse_options():
|
||||||
global VERBOSE, DEBUG_MODE, IS_WINDOWS, VS_X64, ONLY_MAKEFILES, SHOW_CPPS, VS_PROJ, TRACE, VS_PAR, VS_PAR_NUM
|
global VERBOSE, DEBUG_MODE, IS_WINDOWS, VS_X64, ONLY_MAKEFILES, SHOW_CPPS, VS_PROJ, TRACE, VS_PAR, VS_PAR_NUM
|
||||||
global DOTNET_ENABLED, JAVA_ENABLED, STATIC_LIB, PREFIX, GMP, FOCI2, FOCI2LIB, PYTHON_PACKAGE_DIR, GPROF, GIT_HASH
|
global DOTNET_ENABLED, JAVA_ENABLED, STATIC_LIB, PREFIX, GMP, FOCI2, FOCI2LIB, PYTHON_PACKAGE_DIR, GPROF, GIT_HASH
|
||||||
|
global LINUX_X64
|
||||||
try:
|
try:
|
||||||
options, remainder = getopt.gnu_getopt(sys.argv[1:],
|
options, remainder = getopt.gnu_getopt(sys.argv[1:],
|
||||||
'b:df:sxhmcvtnp:gj',
|
'b:df:sxhmcvtnp:gj',
|
||||||
['build=', 'debug', 'silent', 'x64', 'help', 'makefiles', 'showcpp', 'vsproj',
|
['build=', 'debug', 'silent', 'x64', 'help', 'makefiles', 'showcpp', 'vsproj',
|
||||||
'trace', 'nodotnet', 'staticlib', 'prefix=', 'gmp', 'foci2=', 'java', 'parallel=', 'gprof',
|
'trace', 'nodotnet', 'staticlib', 'prefix=', 'gmp', 'foci2=', 'java', 'parallel=', 'gprof',
|
||||||
'githash='])
|
'githash=', 'x86'])
|
||||||
except:
|
except:
|
||||||
print("ERROR: Invalid command line option")
|
print("ERROR: Invalid command line option")
|
||||||
display_help(1)
|
display_help(1)
|
||||||
|
@ -501,6 +506,8 @@ def parse_options():
|
||||||
if not IS_WINDOWS:
|
if not IS_WINDOWS:
|
||||||
raise MKException('x64 compilation mode can only be specified when using Visual Studio')
|
raise MKException('x64 compilation mode can only be specified when using Visual Studio')
|
||||||
VS_X64 = True
|
VS_X64 = True
|
||||||
|
elif opt in ('--x86'):
|
||||||
|
LINUX_X64=False
|
||||||
elif opt in ('-h', '--help'):
|
elif opt in ('-h', '--help'):
|
||||||
display_help(0)
|
display_help(0)
|
||||||
elif opt in ('-m', '--onlymakefiles'):
|
elif opt in ('-m', '--onlymakefiles'):
|
||||||
|
@ -1593,6 +1600,10 @@ def mk_config():
|
||||||
CPPFLAGS = '%s -D_AMD64_' % CPPFLAGS
|
CPPFLAGS = '%s -D_AMD64_' % CPPFLAGS
|
||||||
if sysname == 'Linux':
|
if sysname == 'Linux':
|
||||||
CPPFLAGS = '%s -D_USE_THREAD_LOCAL' % CPPFLAGS
|
CPPFLAGS = '%s -D_USE_THREAD_LOCAL' % CPPFLAGS
|
||||||
|
elif not LINUX_X64:
|
||||||
|
CXXFLAGS = '%s -m32' % CXXFLAGS
|
||||||
|
LDFLAGS = '%s -m32' % LDFLAGS
|
||||||
|
SLIBFLAGS = '%s -m32' % SLIBFLAGS
|
||||||
if DEBUG_MODE:
|
if DEBUG_MODE:
|
||||||
CPPFLAGS = '%s -DZ3DEBUG' % CPPFLAGS
|
CPPFLAGS = '%s -DZ3DEBUG' % CPPFLAGS
|
||||||
if TRACE or DEBUG_MODE:
|
if TRACE or DEBUG_MODE:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue