support cross-compilation for windows

This commit is contained in:
Vitor Santos Costa 2014-01-23 01:46:16 +00:00
parent fe6142ca69
commit 0391988788
8 changed files with 99 additions and 28 deletions

View File

@ -181,12 +181,14 @@ special_functors;
INLINE_ONLY inline EXTERN Float CpFloatUnaligned(CELL *ptr);
#if SIZEOF_DOUBLE == SIZEOF_INT_P
#define MkFloatTerm(fl) __MkFloatTerm((fl) PASS_REGS)
INLINE_ONLY inline EXTERN Term __MkFloatTerm (Float USES_REGS);
INLINE_ONLY inline EXTERN Float FloatOfTerm (Term t);
#if SIZEOF_DOUBLE == SIZEOF_INT_P
INLINE_ONLY inline EXTERN Term
__MkFloatTerm (Float dbl USES_REGS)
{
@ -196,8 +198,6 @@ __MkFloatTerm (Float dbl USES_REGS)
}
INLINE_ONLY inline EXTERN Float FloatOfTerm (Term t);
INLINE_ONLY inline EXTERN Float
FloatOfTerm (Term t)
{
@ -258,10 +258,6 @@ CpFloatUnaligned (CELL * ptr)
#endif
INLINE_ONLY inline EXTERN Term MkFloatTerm (Float);
#define MkFloatTerm(fl) __MkFloatTerm((fl) PASS_REGS)
INLINE_ONLY inline EXTERN Term
__MkFloatTerm (Float dbl USES_REGS)
{
@ -273,8 +269,6 @@ __MkFloatTerm (Float dbl USES_REGS)
}
INLINE_ONLY inline EXTERN Float FloatOfTerm (Term t);
INLINE_ONLY inline EXTERN Float
FloatOfTerm (Term t)
{

82
configure vendored
View File

@ -5081,6 +5081,7 @@ fi
i_am_cross_compiling=$cross_compiling
if test "$target_os" = "cygwin" -o "$target_os" = "mingw32" -o "$target_os" = "mingw64"
then
INSTALL_COMMAND=install_win32
@ -5505,6 +5506,7 @@ fi
else
prefix="$SYSTEMDRIVE/Yap"
fi
i_am_cross_compiling=yes
;;
**)
if test "$target_cpu" = "x86_64"
@ -10989,6 +10991,12 @@ elif test -d "$cudd_dir/lib"; then
LIBS="$LIBS -L $cudd_dir/lib"
fi
if test $i_am_cross_compiling = yes
then
#mingw: we know where things are
CUDD_LDFLAGS="-L $cudd_dir/lib -lall_cudd"
else
if test -d "$cudd_dir/util"; then
LIBS="$LIBS -L $cudd_dir/util"
fi
@ -11312,6 +11320,7 @@ EOF
LIBS="$oldlibs"
fi
fi
@ -11424,7 +11433,23 @@ if test "$yap_cv_R" != "no" -a -e "$srcdir"/packages/real/Makefile.in; then
for ac_prog in R
if test $i_am_cross_compiling = yes
then
REAL_TARGET="ritf"
REAL_INCLUDES=-I"\"$yap_cv_R\""/include
case "$target_cpu" in
i*86*)
REAL_LIBS="-L\"$yap_cv_R\"/bin/i386 -lR"
;;
x86*)
REAL_LIBS="-L\"$yap_cv_R\"/bin/x64 -lR"
;;
**)
REAL_TARGET="dummy"
;;
esac
else
for ac_prog in R
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
@ -11467,19 +11492,19 @@ fi
done
test -n "$REXE" || REXE=""none""
if test $REXE = none; then
REAL_TARGET="dummy"
else
REAL_TARGET="ritf"
REAL_INCLUDES="$($REXE CMD config --cppflags | grep -v ^WARNING)"
REAL_LIBS="$($REXE CMD config --ldflags | grep -v ^WARNING)"
if test $REXE = none; then
REAL_TARGET="dummy"
else
REAL_TARGET="ritf"
REAL_INCLUDES="$($REXE CMD config --cppflags | grep -v ^WARNING)"
REAL_LIBS="$($REXE CMD config --ldflags | grep -v ^WARNING)"
ocppflags="$CPPFLAGS"
ocflags="$CFLAGS"
CPPFLAGS+=" $REAL_INCLUDES"
CFLAGS+=" $REAL_INCLUDES"
ocppflags="$CPPFLAGS"
ocflags="$CFLAGS"
CPPFLAGS+=" $REAL_INCLUDES"
CFLAGS+=" $REAL_INCLUDES"
for ac_header in Rinterface.h
for ac_header in Rinterface.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "Rinterface.h" "ac_cv_header_Rinterface_h" "$ac_includes_default"
if test "x$ac_cv_header_Rinterface_h" = xyes; then :
@ -11492,8 +11517,9 @@ fi
done
CFLAGS="$ocflags"
CPPFLAGS="$ocppflags"
CFLAGS="$ocflags"
CPPFLAGS="$ocppflags"
fi
fi
@ -11729,7 +11755,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 11732 "configure" */
/* #line 11758 "configure" */
public class Test {
}
EOF
@ -11905,7 +11931,7 @@ EOF
if uudecode$EXEEXT Test.uue; then
ac_cv_prog_uudecode_base64=yes
else
echo "configure: 11908: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: 11934: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5
cat Test.uue >&5
ac_cv_prog_uudecode_base64=no
@ -12036,7 +12062,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 12039 "configure" */
/* #line 12065 "configure" */
public class Test {
}
EOF
@ -12071,7 +12097,7 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
/* [#]line 12074 "configure" */
/* [#]line 12100 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);
@ -12722,6 +12748,12 @@ _ACEOF
if test $i_am_cross_compiling = yes
then
#mingw: we know where things are
JPLCFLAGS="-I \"$yap_cv_java\"/include -I \"$yap_cv_java\"/include/win32"
JAVALIBS="-L \"$yap_cv_java\"/jre/bin/server -L \"$yap_cv_java\"/jre/bin/client -ljvm"
fi
@ -12829,6 +12861,10 @@ GECODE_VERSION=unknown-gecode-version
if test "$use_gecode" = yes; then
if test $i_am_cross_compiling = yes
then
GECODE_VERSION=4.2.1
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gecode version" >&5
$as_echo_n "checking gecode version... " >&6; }
if test "$cross_compiling" = yes; then :
@ -12914,6 +12950,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
;;
esac
fi
fi
GECODE_MAJOR=`echo $GECODE_VERSION| sed 's/\(^.\).*/\1/'`
@ -13331,6 +13368,14 @@ test -n "$PYTHON" || PYTHON=""none""
else
PYTHON="$yap_cv_python"
fi
if test $i_am_cross_compiling = yes
then
#mingw
PYTHON_DIR=`dirname "$PYTHON"`
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
@ -13415,6 +13460,7 @@ fi
echo "Could not find includes for Python"
ENABLE_PYTHON="@# "
fi
fi
else
PYTHON_TARGET="dummy"
ENABLE_PYTHON="@# "

View File

@ -514,6 +514,7 @@ dnl Check for libraries.
dnl mingw does not get along well with libm
dnl cygnus and mingw32 also need wsock32 to use sockets.
dnl
i_am_cross_compiling=$cross_compiling
if test "$target_os" = "cygwin" -o "$target_os" = "mingw32" -o "$target_os" = "mingw64"
then
INSTALL_COMMAND=install_win32
@ -557,6 +558,7 @@ then
else
prefix="$SYSTEMDRIVE/Yap"
fi
i_am_cross_compiling=yes
;;
**)
if test "$target_cpu" = "x86_64"

View File

@ -330,6 +330,7 @@ int main(int argc, char **arg) {
SETMAXBUFSIZE(params.maxbufsize);
signal(SIGINT, termhandler);
#ifndef __MINGW32__
if (params.ppid != NULL) {
signal(SIGALRM, pidhandler);
alarm(5);
@ -337,6 +338,7 @@ int main(int argc, char **arg) {
signal(SIGALRM, handler);
alarm(params.timeout);
}
#endif
if (params.online) {
if (params.dynreorder == 1)
@ -1769,7 +1771,9 @@ void pidhandler(int num) {
s = (char *) malloc(sizeof(char) * (19 + strlen(params.ppid)));
strcpy(s, "ps "); strcat(s, params.ppid); strcat(s, " >/dev/null");
if (system(s) != 0) exit(4);
#ifndef __MINGW32__
signal(SIGALRM, pidhandler);
#endif
alarm(5);
free(s);
}

View File

@ -284,6 +284,7 @@ int main(int argc, char **arg) {
SETMAXBUFSIZE(params.maxbufsize);
signal(SIGINT, termhandler);
#ifndef __MINGW32__
if (params.ppid != NULL) {
signal(SIGALRM, pidhandler);
alarm(5);
@ -291,6 +292,7 @@ int main(int argc, char **arg) {
signal(SIGALRM, handler);
alarm(params.timeout);
}
#endif
if (params.online) {
MyManager.manager = simpleBDDinit(0);
@ -688,7 +690,9 @@ void pidhandler(int num) {
s = (char *) malloc(sizeof(char) * (19 + strlen(params.ppid)));
strcpy(s, "ps "); strcat(s, params.ppid); strcat(s, " >/dev/null");
if (system(s) != 0) exit(4);
#ifndef __MINGW32__
signal(SIGALRM, pidhandler);
#endif
alarm(5);
free(s);
}

View File

@ -51,6 +51,12 @@ elif test -d "$cudd_dir/lib"; then
LIBS="$LIBS -L $cudd_dir/lib"
fi
if test $i_am_cross_compiling = yes
then
#mingw: we know where things are
CUDD_LDFLAGS="-L $cudd_dir/lib -lall_cudd"
else
if test -d "$cudd_dir/util"; then
LIBS="$LIBS -L $cudd_dir/util"
fi
@ -96,6 +102,7 @@ EOF
LIBS="$oldlibs"
fi
fi
AC_SUBST(ENABLE_CUDD)

View File

@ -41,6 +41,10 @@ GECODE_VERSION=unknown-gecode-version
if test "$use_gecode" = yes; then
if test $i_am_cross_compiling = yes
then
GECODE_VERSION=4.2.1
else
AC_MSG_CHECKING([gecode version])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include "gecode/support/config.hpp"
@ -72,6 +76,7 @@ return 0;
;;
esac
fi
fi
GECODE_MAJOR=`echo $GECODE_VERSION| sed 's/\(^.\).*/\1/'`

View File

@ -21,6 +21,14 @@ elif test -e "$srcdir"/packages/python/Makefile.in ; then
else
PYTHON="$yap_cv_python"
fi
if test $i_am_cross_compiling = yes
then
#mingw
PYTHON_DIR=`dirname "$PYTHON"`
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
@ -49,6 +57,7 @@ elif test -e "$srcdir"/packages/python/Makefile.in ; then
echo "Could not find includes for Python"
ENABLE_PYTHON="@# "
fi
fi
else
PYTHON_TARGET="dummy"
ENABLE_PYTHON="@# "