WIN64 support (sill needs improvement)
This commit is contained in:
2
packages/gecode/Makefile.in
Normal file → Executable file
2
packages/gecode/Makefile.in
Normal file → Executable file
@@ -23,7 +23,7 @@ SHAREDIR=$(ROOTDIR)/share
|
||||
#
|
||||
#
|
||||
CXX=@CXX@
|
||||
CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I. -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../os
|
||||
CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I. -I$(srcdir) -I../.. -I$(srcdir)/../../include -I$(srcdir)/../../os -I "@GECODE_INCLUDES@"
|
||||
#
|
||||
#
|
||||
# You shouldn't need to change what follows.
|
||||
|
69
packages/gecode/configure.in
Normal file → Executable file
69
packages/gecode/configure.in
Normal file → Executable file
@@ -1,5 +1,9 @@
|
||||
dnl Gecode support
|
||||
|
||||
AC_ARG_ENABLE(gecode,
|
||||
[ --enable-gecode install gecode library],
|
||||
[use_gecode="$enableval"], use_gecode=no)
|
||||
|
||||
dnl gecode is usually in /usr/local
|
||||
if test -d /usr/local/include/gecode; then
|
||||
CFLAGS="$CFLAGS -I/usr/local/include"
|
||||
@@ -7,18 +11,6 @@ if test -d /usr/local/include/gecode; then
|
||||
GECODE_EXTRALIBS="-L/usr/local/lib"
|
||||
fi
|
||||
|
||||
AC_CHECK_HEADER(gecode/support/config.hpp,
|
||||
have_gecode=yes, have_gecode=no)
|
||||
|
||||
AC_ARG_ENABLE(gecode,
|
||||
[ --enable-gecode install gecode library],
|
||||
[use_gecode="$enableval"
|
||||
if test "$use_gecode" = yes; then
|
||||
if test "$have_gecode" = no; then
|
||||
AC_MSG_ERROR([cannot enable gecode: gecode library not found])
|
||||
fi
|
||||
fi], use_gecode=$have_gecode)
|
||||
|
||||
if test "$use_gecode" = no; then
|
||||
PKG_GECODE=""
|
||||
else
|
||||
@@ -44,7 +36,32 @@ if test "$use_gecode" = yes; then
|
||||
if test $i_am_cross_compiling = yes
|
||||
then
|
||||
GECODE_VERSION=4.2.1
|
||||
else
|
||||
elif test x"$WINDOWS" = x; then
|
||||
if test $ac_cv_sizeof_int_p = 8; then
|
||||
GECODE_ARCH=x64
|
||||
else
|
||||
GECODE_ARCH=i386
|
||||
fi
|
||||
GECODE_PATH=`which fzn-gecode`
|
||||
GECODE_PATH=`dirname "$GECODE_PATH"`
|
||||
GECODE_PATH=`dirname "$GECODE_PATH"`
|
||||
GECODE_INCLUDES="$GECODE_PATH"/include
|
||||
GECODE_LIBDIR="\"$GECODE_PATH\""/lib
|
||||
GECODE_BINDIR="\"$GECODE_PATH\""/bin
|
||||
GECODE_TVERSION=`echo "$GECODE_PATH"/lib/GecodeDriver-*-d-"$GECODE_ARCH".lib | cut -d'-' -f 2-4`
|
||||
GECODE_VERSION=`echo "$GECODE_TVERSION"|sed 's/-/\./g'`
|
||||
GECODE_MAJOR=`echo $GECODE_VERSION| sed 's/\(^.\).*/\1/'`
|
||||
GE_SUF="-$GECODE_TVERSION-r-$GECODE_ARCH.dll"
|
||||
GECODE_EXTRALIBS="$GECODE_BINDIR/GecodeDriver$GE_SUF \
|
||||
$GECODE_BINDIR/GecodeSupport$GE_SUF \
|
||||
$GECODE_BINDIR/GecodeKernel$GE_SUF \
|
||||
$GECODE_BINDIR/GecodeInt$GE_SUF \
|
||||
$GECODE_BINDIR/GecodeSet$GE_SUF \
|
||||
$GECODE_BINDIR/GecodeSearch$GE_SUF"
|
||||
if test "$GECODE_MAJOR" = "4"; then
|
||||
GECODE_EXTRALIBS="$GECODE_EXTRALIBS $GECODE_BINDIR/GecodeFloat$GE_SUF"
|
||||
fi
|
||||
else
|
||||
AC_MSG_CHECKING([gecode version])
|
||||
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include "gecode/support/config.hpp"
|
||||
@@ -75,21 +92,29 @@ return 0;
|
||||
CXXFLAGS="$saved_CXXFLAGS"
|
||||
;;
|
||||
esac
|
||||
|
||||
GECODE_MAJOR=`echo $GECODE_VERSION| sed 's/\(^.\).*/\1/'`
|
||||
if test "$GECODE_MAJOR" = "3"; then
|
||||
GECODE_EXTRALIBS="$GECODE_EXTRALIBS -lgecodesupport -lgecodekernel -lgecodeint -lgecodeset -lgecodesearch"
|
||||
else
|
||||
GECODE_EXTRALIBS="$GECODE_EXTRALIBS -lgecodesupport -lgecodekernel -lgecodefloat -lgecodeint -lgecodeset -lgecodesearch"
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
GECODE_MAJOR=`echo $GECODE_VERSION| sed 's/\(^.\).*/\1/'`
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS -I \"$GECODE_INCLUDES\""
|
||||
|
||||
AC_CHECK_HEADER(gecode/support/config.hpp)
|
||||
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
|
||||
AC_SUBST(GECODE_EXTRALIBS)
|
||||
AC_SUBST(GECODE_INCLUDES)
|
||||
AC_SUBST(GECODE_VERSION)
|
||||
AC_SUBST(GECODE_MAJOR)
|
||||
|
||||
if test "$GECODE_MAJOR" = "3"; then
|
||||
GECODE_EXTRALIBS="$GECODE_EXTRALIBS -lgecodesupport -lgecodekernel -lgecodeint -lgecodeset -lgecodesearch"
|
||||
else
|
||||
GECODE_EXTRALIBS="$GECODE_EXTRALIBS -lgecodesupport -lgecodekernel -lgecodefloat -lgecodeint -lgecodeset -lgecodesearch"
|
||||
fi
|
||||
|
||||
AC_SUBST(GECODE_VERSION)
|
||||
AC_SUBST(GECODE_EXTRALIBS)
|
||||
|
||||
if test "$PKG_GECODE" = "packages/gecode"; then
|
||||
AC_CONFIG_FILES([packages/gecode/Makefile])
|
||||
|
10
packages/gecode/gecode4-common.icc
Normal file → Executable file
10
packages/gecode/gecode4-common.icc
Normal file → Executable file
@@ -19,6 +19,16 @@
|
||||
#ifndef GECODE_COMMON
|
||||
#define GECODE_COMMON
|
||||
|
||||
#if defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#define __i386__ 1
|
||||
#if __x86_64__
|
||||
#define _WIN64 1
|
||||
#define _AMD64_ 1
|
||||
#endif
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "gecode/driver.hh"
|
||||
#include "gecode/int.hh"
|
||||
#include "gecode/set.hh"
|
||||
|
@@ -21,54 +21,60 @@ elif test -e "$srcdir"/packages/python/Makefile.in ; then
|
||||
else
|
||||
PYTHON="$yap_cv_python"
|
||||
fi
|
||||
if test $i_am_cross_compiling = yes
|
||||
if test "$i_am_cross_compiling" = yes
|
||||
then
|
||||
#mingw
|
||||
PYTHON_DIR=`dirname "$PYTHON"`
|
||||
PYTHON_DIR=`which "$PYTHON"`
|
||||
PYTHON_DIR=`dirname "$PYTHON_DIR"`
|
||||
PYTHON_DLL=`echo "$PYTHON_DIR"/python*.dll`
|
||||
PYTHON_LIBS="\"$PYTHON_DLL\""
|
||||
PYTHON_INCLUDES="-I \"$PYTHON_DIR\"/include"
|
||||
else
|
||||
PYTHONHOME=`$PYTHON -c'import sys; sys.stdout.write(sys.prefix)'`
|
||||
PYTHONVERSION=`"$PYTHON" -c "import sys; sys.stdout.write(sys.version[[:3]])"`
|
||||
if test -d "$PYTHONHOME/libs"; then
|
||||
dnl windows
|
||||
PYTHONV=`echo "$PYTHONVERSION"|sed -e 's/\.//g'`
|
||||
PYTHON_LIBS="-L $PYTHONHOME/libs"
|
||||
elif test -d "$PYTHONHOME/lib"; then
|
||||
PYTHON_LIBS="-L $PYTHONHOME/lib"
|
||||
else
|
||||
echo "Could not find libraries for Python"
|
||||
PKG_PYTHON=""
|
||||
fi
|
||||
OLIBS=$LIBS
|
||||
LIBS=$PYTHON_LIBS
|
||||
AC_SEARCH_LIBS(Py_Initialize, [python"$PYTHONVERSION" python"$PYTHONVERSION"m],,[echo "Could not find libraries for Python";
|
||||
PKG_PYTHON=""],"$OLIBS")
|
||||
PYTHON_LIBS=$LIBS
|
||||
LIBS=$OLIBS
|
||||
if test -d "$PYTHONHOME/include/python$PYTHONVERSION"; then
|
||||
PYTHON_INCLUDES="-I $PYTHONHOME/include/python$PYTHONVERSION"
|
||||
elif test -d "$PYTHONHOME/include/python$PYTHONVERSION"m; then
|
||||
PYTHON_INCLUDES="-I $PYTHONHOME/include/python$PYTHONVERSION"m
|
||||
elif test -d "$PYTHONHOME/include"; then
|
||||
PYTHON_INCLUDES="-I $PYTHONHOME/include"
|
||||
else
|
||||
echo "Could not find includes for Python"
|
||||
PKG_PYTHON=""
|
||||
fi
|
||||
PYTHONHOME=`$PYTHON -c'import sys; sys.stdout.write(sys.prefix)'`
|
||||
PYTHONHOME=`(cd "$PYTHONHOME" && pwd)`
|
||||
PYTHONVERSION=`"$PYTHON" -c "import sys; sys.stdout.write(sys.version[[:3]])"`
|
||||
if test -d "$PYTHONHOME/libs"; then
|
||||
#mingw
|
||||
PYTHON_DIR="$PYTHONHOME"
|
||||
PYTHON_DLL=`echo "$PYTHON_DIR"/python*.dll`
|
||||
PYTHON_LIBS="\"$PYTHON_DLL\""
|
||||
PYTHON_INCLUDES="-I \"$PYTHON_DIR\"/include"
|
||||
elif test -d "$PYTHONHOME/lib"; then
|
||||
# unix, mac
|
||||
PYTHON_LIBS="-L $PYTHONHOME/lib"
|
||||
OLIBS=$LIBS
|
||||
LIBS=$PYTHON_LIBS
|
||||
AC_SEARCH_LIBS(Py_Initialize, [python"$PYTHONVERSION" python"$PYTHONVERSION"m],,[echo "Could not find libraries for Python";
|
||||
PKG_PYTHON=""],"$OLIBS")
|
||||
PYTHON_LIBS=$LIBS
|
||||
LIBS=$OLIBS
|
||||
if test -d "$PYTHONHOME/include/python$PYTHONVERSION"; then
|
||||
PYTHON_INCLUDES="-I $PYTHONHOME/include/python$PYTHONVERSION"
|
||||
elif test -d "$PYTHONHOME/include/python$PYTHONVERSION"m; then
|
||||
PYTHON_INCLUDES="-I $PYTHONHOME/include/python$PYTHONVERSION"m
|
||||
elif test -d "$PYTHONHOME/include"; then
|
||||
PYTHON_INCLUDES="-I $PYTHONHOME/include"
|
||||
else
|
||||
echo "Could not find includes for Python"
|
||||
PKG_PYTHON=""
|
||||
fi
|
||||
else
|
||||
echo "Could not find libraries for Python"
|
||||
PKG_PYTHON=""
|
||||
fi
|
||||
fi
|
||||
else
|
||||
PYTHON_TARGET="dummy"
|
||||
PKG_PYTHON=""
|
||||
fi
|
||||
|
||||
if test "$PKG_PYTHON" != ""; then
|
||||
|
||||
AC_SUBST(PYTHON_TARGET)
|
||||
AC_SUBST(PKG_PYTHON)
|
||||
AC_SUBST(PYTHON_INCLUDES)
|
||||
AC_SUBST(PYTHON_LIBS)
|
||||
|
||||
if test "$PKG_PYTHON" != ""; then
|
||||
AC_CONFIG_FILES([ packages/python/Makefile ])
|
||||
fi
|
||||
|
||||
|
Reference in New Issue
Block a user