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

@@ -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="@# "