mirror of
https://github.com/Z3Prover/z3
synced 2025-04-12 04:03:39 +00:00
Added --with-python configuration option, replaced *.py with *.pyc in install-python make command.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
bd1729239b
commit
39f695f756
26
Makefile.in
26
Makefile.in
|
@ -22,6 +22,7 @@ LDFLAGS_EXTRA=
|
||||||
PREFIX=@prefix@
|
PREFIX=@prefix@
|
||||||
HAS_PYTHON=@HAS_PYTHON@
|
HAS_PYTHON=@HAS_PYTHON@
|
||||||
PYTHON_PACKAGE_DIR=@PYTHON_PACKAGE_DIR@
|
PYTHON_PACKAGE_DIR=@PYTHON_PACKAGE_DIR@
|
||||||
|
PYTHON=@PYTHON@
|
||||||
#########################
|
#########################
|
||||||
|
|
||||||
Z3=z3
|
Z3=z3
|
||||||
|
@ -470,21 +471,22 @@ uninstall:
|
||||||
install-python: $(BIN_DIR)/lib$(Z3).@SO_EXT@
|
install-python: $(BIN_DIR)/lib$(Z3).@SO_EXT@
|
||||||
@if test $(HAS_PYTHON) -eq 0; then echo "Python is not available in your system."; exit 1; fi
|
@if test $(HAS_PYTHON) -eq 0; then echo "Python is not available in your system."; exit 1; fi
|
||||||
@echo "Installing Python bindings at $(PYTHON_PACKAGE_DIR)."
|
@echo "Installing Python bindings at $(PYTHON_PACKAGE_DIR)."
|
||||||
@cp python/z3.py $(PYTHON_PACKAGE_DIR)
|
@$(PYTHON) python/example.py > /dev/null
|
||||||
@cp python/z3core.py $(PYTHON_PACKAGE_DIR)
|
@cp python/z3.pyc $(PYTHON_PACKAGE_DIR)
|
||||||
@cp python/z3types.py $(PYTHON_PACKAGE_DIR)
|
@cp python/z3core.pyc $(PYTHON_PACKAGE_DIR)
|
||||||
@cp python/z3consts.py $(PYTHON_PACKAGE_DIR)
|
@cp python/z3types.pyc $(PYTHON_PACKAGE_DIR)
|
||||||
@cp python/z3tactics.py $(PYTHON_PACKAGE_DIR)
|
@cp python/z3consts.pyc $(PYTHON_PACKAGE_DIR)
|
||||||
@cp python/z3printer.py $(PYTHON_PACKAGE_DIR)
|
@cp python/z3tactics.pyc $(PYTHON_PACKAGE_DIR)
|
||||||
|
@cp python/z3printer.pyc $(PYTHON_PACKAGE_DIR)
|
||||||
@cp $(BIN_DIR)/lib$(Z3).@SO_EXT@ $(PYTHON_PACKAGE_DIR)
|
@cp $(BIN_DIR)/lib$(Z3).@SO_EXT@ $(PYTHON_PACKAGE_DIR)
|
||||||
|
|
||||||
uninstall-python:
|
uninstall-python:
|
||||||
@if test $(HAS_PYTHON) -eq 0; then echo "Python is not available in your system."; exit 1; fi
|
@if test $(HAS_PYTHON) -eq 0; then echo "Python is not available in your system."; exit 1; fi
|
||||||
@echo "Uninstalling Python bindings from $(PYTHON_PACKAGE_DIR)."
|
@echo "Uninstalling Python bindings from $(PYTHON_PACKAGE_DIR)."
|
||||||
@rm -f $(PYTHON_PACKAGE_DIR)/z3.py
|
@rm -f $(PYTHON_PACKAGE_DIR)/z3.pyc
|
||||||
@rm -f $(PYTHON_PACKAGE_DIR)/z3core.py
|
@rm -f $(PYTHON_PACKAGE_DIR)/z3core.pyc
|
||||||
@rm -f $(PYTHON_PACKAGE_DIR)/z3types.py
|
@rm -f $(PYTHON_PACKAGE_DIR)/z3types.pyc
|
||||||
@rm -f $(PYTHON_PACKAGE_DIR)/z3consts.py
|
@rm -f $(PYTHON_PACKAGE_DIR)/z3consts.pyc
|
||||||
@rm -f $(PYTHON_PACKAGE_DIR)/z3tactics.py
|
@rm -f $(PYTHON_PACKAGE_DIR)/z3tactics.pyc
|
||||||
@rm -f $(PYTHON_PACKAGE_DIR)/z3printer.py
|
@rm -f $(PYTHON_PACKAGE_DIR)/z3printer.pyc
|
||||||
@rm -f $(PYTHON_PACKAGE_DIR)/$(BIN_DIR)/lib$(Z3).@SO_EXT@
|
@rm -f $(PYTHON_PACKAGE_DIR)/$(BIN_DIR)/lib$(Z3).@SO_EXT@
|
||||||
|
|
22
configure.in
22
configure.in
|
@ -11,6 +11,17 @@ AS_IF([test "$use_gmp" = "yes"],[
|
||||||
])
|
])
|
||||||
AC_SUBST(EXTRA_LIB_SRCS)
|
AC_SUBST(EXTRA_LIB_SRCS)
|
||||||
|
|
||||||
|
AC_ARG_WITH(python,
|
||||||
|
[AS_HELP_STRING([--with-python=PYTHON_PATH],
|
||||||
|
[specify the location of the python 2.x executable.])])
|
||||||
|
|
||||||
|
PYTHON="python"
|
||||||
|
if test "x$with_python" != x; then
|
||||||
|
PYTHON="$with_python"
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_SUBST(PYTHON)
|
||||||
|
|
||||||
AC_PATH_PROG([D2U], [dos2unix], [no], [~/bin$PATH_SEPARATOR$PATH])
|
AC_PATH_PROG([D2U], [dos2unix], [no], [~/bin$PATH_SEPARATOR$PATH])
|
||||||
AS_IF([test "$D2U" = "no"], [AC_MSG_ERROR(dos2unix not found)])
|
AS_IF([test "$D2U" = "no"], [AC_MSG_ERROR(dos2unix not found)])
|
||||||
AC_SUBST(D2U)
|
AC_SUBST(D2U)
|
||||||
|
@ -52,14 +63,14 @@ if version >= "3":
|
||||||
exit(0)
|
exit(0)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if python tst_python.py; then
|
if $PYTHON tst_python.py; then
|
||||||
HAS_PYTHON="1"
|
HAS_PYTHON="1"
|
||||||
HAS_PYTHON_MSG="yes"
|
HAS_PYTHON_MSG="yes"
|
||||||
cat > get_py_dir.py << EOF
|
cat > get_py_dir.py << EOF
|
||||||
import distutils.sysconfig
|
import distutils.sysconfig
|
||||||
print distutils.sysconfig.get_python_lib()
|
print distutils.sysconfig.get_python_lib()
|
||||||
EOF
|
EOF
|
||||||
if python get_py_dir.py > dir.txt; then
|
if $PYTHON get_py_dir.py > dir.txt; then
|
||||||
PYTHON_PACKAGE_DIR=`cat dir.txt`
|
PYTHON_PACKAGE_DIR=`cat dir.txt`
|
||||||
else
|
else
|
||||||
HAS_PYTHON="0"
|
HAS_PYTHON="0"
|
||||||
|
@ -136,9 +147,10 @@ AC_OUTPUT(Makefile)
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
|
|
||||||
Z3 was configured with success.
|
Z3 was configured with success.
|
||||||
Host platform: $PLATFORM
|
Host platform: $PLATFORM
|
||||||
Arithmetic: $ARITH
|
Arithmetic: $ARITH
|
||||||
Python: $HAS_PYTHON_MSG
|
Python Support: $HAS_PYTHON_MSG
|
||||||
|
Pyyhon: $PYTHON
|
||||||
|
|
||||||
Type 'make' to compile Z3.
|
Type 'make' to compile Z3.
|
||||||
Type 'sudo make install' to install Z3.
|
Type 'sudo make install' to install Z3.
|
||||||
|
|
Loading…
Reference in a new issue