mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-03 21:09:11 +00:00 
			
		
		
		
	checkpoint
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
		
							parent
							
								
									c4898a67e3
								
							
						
					
					
						commit
						236a32c3d4
					
				
					 10 changed files with 256 additions and 965 deletions
				
			
		
							
								
								
									
										168
									
								
								src/dead/configure.in
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										168
									
								
								src/dead/configure.in
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,168 @@
 | 
			
		|||
AC_PREREQ(2.50)
 | 
			
		||||
AC_INIT(lib/util.h)
 | 
			
		||||
 | 
			
		||||
ARITH="internal"
 | 
			
		||||
AC_ARG_WITH([gmp], [AS_HELP_STRING([--with-gmp], [Use GMP for multi-precision naturals (default=no)])], [use_gmp=yes], [use_gmp=no])
 | 
			
		||||
AS_IF([test "$use_gmp" = "yes"],[
 | 
			
		||||
  ARITH="gmp"
 | 
			
		||||
  CPPFLAGS="$CPPFLAGS -D_MP_GMP"
 | 
			
		||||
],[
 | 
			
		||||
  CPPFLAGS="$CPPFLAGS -D_MP_INTERNAL"
 | 
			
		||||
])
 | 
			
		||||
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)
 | 
			
		||||
 | 
			
		||||
AC_PROG_CXX(g++)
 | 
			
		||||
AC_PROG_MAKE_SET
 | 
			
		||||
 | 
			
		||||
AC_LANG_CPLUSPLUS
 | 
			
		||||
 | 
			
		||||
host_os=`uname -s`
 | 
			
		||||
 | 
			
		||||
AS_IF([test "$host_os" = "Darwin"], [
 | 
			
		||||
  PLATFORM=osx
 | 
			
		||||
  SO_EXT=dylib
 | 
			
		||||
  SLIBFLAGS="-dynamiclib -fopenmp"
 | 
			
		||||
  COMP_VERSIONS="-compatibility_version \$(Z3_VERSION) -current_version \$(Z3_VERSION)"
 | 
			
		||||
  STATIC_FLAGS=
 | 
			
		||||
  CPPFLAGS+=" -mmacosx-version-min=10.4"
 | 
			
		||||
], [test "$host_os" = "Linux"], [
 | 
			
		||||
  PLATFORM=linux
 | 
			
		||||
  SO_EXT=so
 | 
			
		||||
  LDFLAGS=-lrt
 | 
			
		||||
  SLIBFLAGS="-shared -fopenmp"
 | 
			
		||||
  COMP_VERSIONS=
 | 
			
		||||
  STATIC_FLAGS=-static
 | 
			
		||||
], [test "${host_os:0:6}" = "CYGWIN"], [
 | 
			
		||||
   PLATFORM=win
 | 
			
		||||
   SO_EXT=dll
 | 
			
		||||
   LDFLAGS=
 | 
			
		||||
   SLIBFLAGS="-shared -fopenmp"
 | 
			
		||||
   COMP_VERSIONS=
 | 
			
		||||
   STATIC_FLAGS=-static
 | 
			
		||||
   CPPFLAGS+=" -D_CYGWIN"
 | 
			
		||||
],
 | 
			
		||||
[
 | 
			
		||||
  AC_MSG_ERROR([Unknown host platform: $host_os])
 | 
			
		||||
])
 | 
			
		||||
AC_SUBST(PLATFORM)
 | 
			
		||||
AC_SUBST(SO_EXT)
 | 
			
		||||
AC_SUBST(SLIBFLAGS)
 | 
			
		||||
AC_SUBST(COMP_VERSIONS)
 | 
			
		||||
AC_SUBST(STATIC_FLAGS)
 | 
			
		||||
 | 
			
		||||
cat > tst_python.py <<EOF
 | 
			
		||||
from sys import version
 | 
			
		||||
if version >= "3":
 | 
			
		||||
   exit(1)
 | 
			
		||||
exit(0)
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
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
 | 
			
		||||
    PYTHON_PACKAGE_DIR=`cat dir.txt`
 | 
			
		||||
  else
 | 
			
		||||
    HAS_PYTHON="0"
 | 
			
		||||
    HAS_PYTHON_MSG="no"
 | 
			
		||||
  fi
 | 
			
		||||
  rm -f dir.txt
 | 
			
		||||
  rm -f get_py_dir.py
 | 
			
		||||
else
 | 
			
		||||
  HAS_PYTHON="0"
 | 
			
		||||
  HAS_PYTHON_MSG="no"
 | 
			
		||||
fi
 | 
			
		||||
AC_SUBST(PYTHON_PACKAGE_DIR)
 | 
			
		||||
AC_SUBST(HAS_PYTHON)
 | 
			
		||||
rm -f tst_python.py
 | 
			
		||||
 | 
			
		||||
cat > tst64.c <<EOF
 | 
			
		||||
    int main() {
 | 
			
		||||
    	return sizeof(unsigned) == sizeof(void*);
 | 
			
		||||
    }
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
AC_SUBST(EXTRA_LIBS)
 | 
			
		||||
 | 
			
		||||
g++ $CPPFLAGS tst64.c -o tst64
 | 
			
		||||
if ./tst64; then
 | 
			
		||||
   dnl In 64-bit systems we have to compile using -fPIC
 | 
			
		||||
   CPPFLAGS="$CPPFLAGS -D_AMD64_"
 | 
			
		||||
   dnl Only enable use of thread local storage for 64-bit Linux. It is disabled for OSX and 32-bit Linux
 | 
			
		||||
   if test $PLATFORM = "linux"; then
 | 
			
		||||
      CPPFLAGS="$CPPFLAGS -D_USE_THREAD_LOCAL" 
 | 
			
		||||
   fi
 | 
			
		||||
   CXXFLAGS="-fPIC"
 | 
			
		||||
   EXTRA_LIBS=""
 | 
			
		||||
   dnl Rewrite -lz3-gmp to -lz3 in the files:
 | 
			
		||||
   dnl  - test_capi/build-external-linux.sh 
 | 
			
		||||
   dnl  - test_user_theory/build-external-linux.sh
 | 
			
		||||
   dnl Reason: the library libz3-gmp.so is not available in 64-bit systems
 | 
			
		||||
   dnl sed 's|lz3-gmp|lz3|' test_capi/build-external-linux.sh > tmp.sh
 | 
			
		||||
   dnl mv tmp.sh test_capi/build-external-linux.sh
 | 
			
		||||
   dnl sed 's|lz3-gmp|lz3|' test_user_theory/build-external-linux.sh > tmp.sh
 | 
			
		||||
   dnl mv tmp.sh test_user_theory/build-external-linux.sh
 | 
			
		||||
else
 | 
			
		||||
   CXXFLAGS=""
 | 
			
		||||
   dnl In 64-bit systems it is not possible to build a dynamic library using static gmp.
 | 
			
		||||
   dnl EXTRA_LIBS="\$(BIN_DIR)/lib\$(Z3)-gmp.so"
 | 
			
		||||
fi
 | 
			
		||||
rm -f tst64.c
 | 
			
		||||
rm -f tst64
 | 
			
		||||
 | 
			
		||||
AC_SUBST(GMP_STATIC_LIB)
 | 
			
		||||
GMP_STATIC_LIB=""
 | 
			
		||||
 | 
			
		||||
if test "$ARITH" = "gmp"; then
 | 
			
		||||
   AC_CHECK_HEADER([gmp.h], GMP='gmp', AC_MSG_ERROR([GMP include file not found]))
 | 
			
		||||
   AC_SUBST(LIBS)
 | 
			
		||||
   AC_CHECK_LIB(gmp, __gmpz_cmp, LIBS="-lgmp $LIBS", AC_MSG_ERROR([GMP library not found]))
 | 
			
		||||
   dnl Look for libgmp.a at /usr/local/lib and /usr/lib
 | 
			
		||||
   dnl TODO: make the following test more robust...
 | 
			
		||||
   if test -e /usr/local/lib/libgmp.a; then
 | 
			
		||||
      GMP_STATIC_LIB="/usr/local/lib/libgmp.a"
 | 
			
		||||
   else if test -e /usr/lib/libgmp.a; then
 | 
			
		||||
      GMP_STATIC_LIB="/usr/lib/libgmp.a"
 | 
			
		||||
   else if test -e /usr/lib/libgmp.dll.a; then
 | 
			
		||||
      GMP_STATIC_LIB="/usr/lib/libgmp.dll.a"
 | 
			
		||||
   else
 | 
			
		||||
      AC_MSG_ERROR([Failed to find libgmp.a])   
 | 
			
		||||
   fi fi fi
 | 
			
		||||
fi
 | 
			
		||||
 | 
			
		||||
AC_PROG_CXXCPP
 | 
			
		||||
 | 
			
		||||
AC_OUTPUT(Makefile)
 | 
			
		||||
 | 
			
		||||
cat <<EOF
 | 
			
		||||
 | 
			
		||||
Z3 was configured with success.
 | 
			
		||||
Host platform:  $PLATFORM
 | 
			
		||||
Arithmetic:     $ARITH
 | 
			
		||||
Python Support: $HAS_PYTHON_MSG
 | 
			
		||||
Python:         $PYTHON 
 | 
			
		||||
Prefix:         $prefix
 | 
			
		||||
 | 
			
		||||
Type 'make' to compile Z3.
 | 
			
		||||
Type 'sudo make install' to install Z3.
 | 
			
		||||
Type 'sudo make install-z3py' to install Z3 Python (Z3Py) bindings.
 | 
			
		||||
EOF
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue