3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-06 17:44:08 +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:
Leonardo de Moura 2012-10-09 07:06:48 -07:00
parent bd1729239b
commit 39f695f756
2 changed files with 31 additions and 17 deletions

View file

@ -22,6 +22,7 @@ LDFLAGS_EXTRA=
PREFIX=@prefix@
HAS_PYTHON=@HAS_PYTHON@
PYTHON_PACKAGE_DIR=@PYTHON_PACKAGE_DIR@
PYTHON=@PYTHON@
#########################
Z3=z3
@ -470,21 +471,22 @@ uninstall:
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
@echo "Installing Python bindings at $(PYTHON_PACKAGE_DIR)."
@cp python/z3.py $(PYTHON_PACKAGE_DIR)
@cp python/z3core.py $(PYTHON_PACKAGE_DIR)
@cp python/z3types.py $(PYTHON_PACKAGE_DIR)
@cp python/z3consts.py $(PYTHON_PACKAGE_DIR)
@cp python/z3tactics.py $(PYTHON_PACKAGE_DIR)
@cp python/z3printer.py $(PYTHON_PACKAGE_DIR)
@$(PYTHON) python/example.py > /dev/null
@cp python/z3.pyc $(PYTHON_PACKAGE_DIR)
@cp python/z3core.pyc $(PYTHON_PACKAGE_DIR)
@cp python/z3types.pyc $(PYTHON_PACKAGE_DIR)
@cp python/z3consts.pyc $(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)
uninstall-python:
@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)."
@rm -f $(PYTHON_PACKAGE_DIR)/z3.py
@rm -f $(PYTHON_PACKAGE_DIR)/z3core.py
@rm -f $(PYTHON_PACKAGE_DIR)/z3types.py
@rm -f $(PYTHON_PACKAGE_DIR)/z3consts.py
@rm -f $(PYTHON_PACKAGE_DIR)/z3tactics.py
@rm -f $(PYTHON_PACKAGE_DIR)/z3printer.py
@rm -f $(PYTHON_PACKAGE_DIR)/z3.pyc
@rm -f $(PYTHON_PACKAGE_DIR)/z3core.pyc
@rm -f $(PYTHON_PACKAGE_DIR)/z3types.pyc
@rm -f $(PYTHON_PACKAGE_DIR)/z3consts.pyc
@rm -f $(PYTHON_PACKAGE_DIR)/z3tactics.pyc
@rm -f $(PYTHON_PACKAGE_DIR)/z3printer.pyc
@rm -f $(PYTHON_PACKAGE_DIR)/$(BIN_DIR)/lib$(Z3).@SO_EXT@

View file

@ -11,6 +11,17 @@ AS_IF([test "$use_gmp" = "yes"],[
])
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])
AS_IF([test "$D2U" = "no"], [AC_MSG_ERROR(dos2unix not found)])
AC_SUBST(D2U)
@ -52,14 +63,14 @@ if version >= "3":
exit(0)
EOF
if python tst_python.py; then
if $PYTHON tst_python.py; then
HAS_PYTHON="1"
HAS_PYTHON_MSG="yes"
cat > get_py_dir.py << EOF
import distutils.sysconfig
print distutils.sysconfig.get_python_lib()
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`
else
HAS_PYTHON="0"
@ -136,9 +147,10 @@ AC_OUTPUT(Makefile)
cat <<EOF
Z3 was configured with success.
Host platform: $PLATFORM
Arithmetic: $ARITH
Python: $HAS_PYTHON_MSG
Host platform: $PLATFORM
Arithmetic: $ARITH
Python Support: $HAS_PYTHON_MSG
Pyyhon: $PYTHON
Type 'make' to compile Z3.
Type 'sudo make install' to install Z3.