fix compilation in win:32 and 64 bits
This commit is contained in:
parent
265bc20f90
commit
e97bac6548
37
configure.in
37
configure.in
@ -40,17 +40,28 @@ AC_INIT(YAP, 6.3.4, yap-users@sf.net, yap )
|
|||||||
|
|
||||||
DOC_VERSION=4.2.9
|
DOC_VERSION=4.2.9
|
||||||
|
|
||||||
|
AC_PROG_CC
|
||||||
|
AC_PROG_CPP
|
||||||
|
AC_PROG_CXX
|
||||||
|
AC_CHECK_TOOL([RC], [windres], [:])
|
||||||
|
|
||||||
|
# if we are trying to use -m32 in a WIN32/mingw setup then
|
||||||
|
# we cannot trust lpthread
|
||||||
|
# we cannot trust RC
|
||||||
|
AC_ARG_ENABLE(abi,
|
||||||
|
[ --enable-abi support an ABI ],
|
||||||
|
[ CC="$CC -m$enableval"; CPP="$CPP -m$enableval"; CXX="$CXX -m$enableval"; RCFLAGS="--output-format=coff --target=pe-i386" ; pthreadlib="`pwd`/pthreadGC2.dll"; win_abi="$enableval" ] , win_abi=no )
|
||||||
|
|
||||||
AC_CONFIG_HEADER(config.h)
|
AC_CONFIG_HEADER(config.h)
|
||||||
AC_CONFIG_HEADER(YapTermConfig.h)
|
AC_CONFIG_HEADER(YapTermConfig.h)
|
||||||
|
|
||||||
dnl store the environment's compilation flags
|
dnl store the environment's compilation flags
|
||||||
mycflags="$CFLAGS"
|
mycflags="$CFLAGS"
|
||||||
|
|
||||||
AC_PROG_CC
|
|
||||||
AC_PROG_CPP
|
|
||||||
AC_PROG_CXX
|
|
||||||
AC_PROG_AWK
|
AC_PROG_AWK
|
||||||
AC_SUBST(GCC)
|
AC_SUBST(GCC)
|
||||||
|
AC_SUBST(RC)
|
||||||
|
AC_SUBST(RCFLAGS)
|
||||||
AC_SUBST(C_INTERF_FLAGS)
|
AC_SUBST(C_INTERF_FLAGS)
|
||||||
AC_SUBST(C_PARSER_FLAGS)
|
AC_SUBST(C_PARSER_FLAGS)
|
||||||
AC_LANG(C)
|
AC_LANG(C)
|
||||||
@ -507,7 +518,11 @@ then
|
|||||||
then
|
then
|
||||||
# locale complaints without this.
|
# locale complaints without this.
|
||||||
if test "$threads" = yes; then
|
if test "$threads" = yes; then
|
||||||
AC_CHECK_LIB(pthread, main)
|
if test $win_abi = 32; then
|
||||||
|
LIBS="$LIBS $pthreadlib"
|
||||||
|
else
|
||||||
|
AC_CHECK_LIB(pthread, main)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
AC_CHECK_LIB(mscrt,main)
|
AC_CHECK_LIB(mscrt,main)
|
||||||
if test "$target_cpu" = x86_64; then
|
if test "$target_cpu" = x86_64; then
|
||||||
@ -568,6 +583,7 @@ then
|
|||||||
LIBS="-lcygwin"
|
LIBS="-lcygwin"
|
||||||
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
|
EXTRA_LIBS_FOR_DLLS="\$(abs_top_builddir)/yap.dll"
|
||||||
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
|
EXTRA_INCLUDES_FOR_WIN32="-I\$(srcdir)/packages/PLStream/windows"
|
||||||
|
AC_CHECK_LIB(pthread,pthread_create)
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if test "$prefix" = "NONE"
|
if test "$prefix" = "NONE"
|
||||||
@ -603,6 +619,7 @@ else
|
|||||||
AC_CHECK_LIB(nss_files,main)
|
AC_CHECK_LIB(nss_files,main)
|
||||||
AC_CHECK_LIB(nss_dns,main)
|
AC_CHECK_LIB(nss_dns,main)
|
||||||
AC_CHECK_LIB(resolv,main)
|
AC_CHECK_LIB(resolv,main)
|
||||||
|
AC_CHECK_LIB(pthread,pthread_create)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$yap_cv_readline" != "no"
|
if test "$yap_cv_readline" != "no"
|
||||||
@ -632,7 +649,6 @@ fi
|
|||||||
|
|
||||||
if test "$threads" = yes
|
if test "$threads" = yes
|
||||||
then
|
then
|
||||||
AC_CHECK_LIB(pthread,pthread_create)
|
|
||||||
AC_CHECK_HEADERS(pthread.h)
|
AC_CHECK_HEADERS(pthread.h)
|
||||||
AC_CHECK_FUNCS(pthread_mutexattr_setkind_np pthread_mutexattr_settype)
|
AC_CHECK_FUNCS(pthread_mutexattr_setkind_np pthread_mutexattr_settype)
|
||||||
if test "$pthreadlocking" = yes
|
if test "$pthreadlocking" = yes
|
||||||
@ -1723,12 +1739,15 @@ AC_SUBST(TARGETS)
|
|||||||
AC_SUBST(PLTARGETS)
|
AC_SUBST(PLTARGETS)
|
||||||
AC_SUBST(CHR_TARGETS)
|
AC_SUBST(CHR_TARGETS)
|
||||||
|
|
||||||
|
# use the lib directly in mingw setups
|
||||||
AC_CHECK_LIB(pthread, pthread_create,
|
if test "$win_abi" = "32"; then
|
||||||
[CLIB_PTHREADS="-lpthread"],[CLIB_PTHREADS=""])
|
CLIB_PTHREADS="$pthreadlib"
|
||||||
|
else
|
||||||
|
AC_CHECK_LIB(pthread, pthread_create,
|
||||||
|
[CLIB_PTHREADS="-lpthread"],[CLIB_PTHREADS=""])
|
||||||
|
fi
|
||||||
AC_SUBST(CLIB_PTHREADS)
|
AC_SUBST(CLIB_PTHREADS)
|
||||||
|
|
||||||
|
|
||||||
AC_CHECK_TYPES(socklen_t, [], [],
|
AC_CHECK_TYPES(socklen_t, [], [],
|
||||||
[
|
[
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
29
misc/mkwin
29
misc/mkwin
@ -23,6 +23,8 @@ else
|
|||||||
THREADS=$2
|
THREADS=$2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
CONFIGURE=../yap-6.3/configure
|
||||||
|
|
||||||
# debugging setup
|
# debugging setup
|
||||||
do_compile=true
|
do_compile=true
|
||||||
do_install=true
|
do_install=true
|
||||||
@ -38,13 +40,15 @@ fi
|
|||||||
|
|
||||||
if test $ABI = 64; then
|
if test $ABI = 64; then
|
||||||
GCC_PATH=/c/cygwin/Yap/mingw64
|
GCC_PATH=/c/cygwin/Yap/mingw64
|
||||||
|
HOST="--host=x86_64-w64-mingw32"
|
||||||
|
# ok.
|
||||||
|
|
||||||
CUDD=yes
|
CUDD=yes
|
||||||
GECODE=no #does not link with mingw64, VC++ trouble
|
GECODE=no #does not link with mingw64, VC++ trouble
|
||||||
GMP=yes
|
GMP=yes
|
||||||
JAVA=yes
|
JAVA=yes
|
||||||
PYTHON=no
|
PYTHON=no
|
||||||
REAL=yes
|
REAL=yes
|
||||||
HOST="--host=x86_64-w64-mingw32"
|
|
||||||
|
|
||||||
# it seems python2.7 does not support mingw64
|
# it seems python2.7 does not support mingw64
|
||||||
PYTHON_PATH="/c/Python33-64"
|
PYTHON_PATH="/c/Python33-64"
|
||||||
@ -54,7 +58,6 @@ HOST="--host=x86_64-w64-mingw32"
|
|||||||
CUDD_PATH=/c/cygwin/Yap/cudd-2.5.0-mingw64
|
CUDD_PATH=/c/cygwin/Yap/cudd-2.5.0-mingw64
|
||||||
JAVA_PATH="/c/Program Files/Java/jdk1.7.0_51"
|
JAVA_PATH="/c/Program Files/Java/jdk1.7.0_51"
|
||||||
R_PATH="/c/Program Files/R/R-3.0.2"
|
R_PATH="/c/Program Files/R/R-3.0.2"
|
||||||
R_ABI=x64
|
|
||||||
if test $THREADS = yes
|
if test $THREADS = yes
|
||||||
then
|
then
|
||||||
cp "$GCC_PATH/x86_64-w64-mingw32/lib/libwinpthread-1.dll" .
|
cp "$GCC_PATH/x86_64-w64-mingw32/lib/libwinpthread-1.dll" .
|
||||||
@ -64,7 +67,8 @@ fi
|
|||||||
|
|
||||||
# HOME WIN32 configuration
|
# HOME WIN32 configuration
|
||||||
if test $ABI = 32; then
|
if test $ABI = 32; then
|
||||||
GCC_PATH="/c/cygwin/Yap/mingw32/mingw32"
|
GCC_PATH="/c/TDM-GCC-64"
|
||||||
|
|
||||||
CUDD=yes
|
CUDD=yes
|
||||||
GECODE=no # install only allows one of 32 or 64 bits
|
GECODE=no # install only allows one of 32 or 64 bits
|
||||||
GMP=yes
|
GMP=yes
|
||||||
@ -73,20 +77,16 @@ PYTHON=no
|
|||||||
REAL=yes
|
REAL=yes
|
||||||
|
|
||||||
PYTHON_PATH="/c/Python27"
|
PYTHON_PATH="/c/Python27"
|
||||||
export PATH="$GCC_PATH"/bin:$PATH:"$PYTHON_PATH"
|
export PATH="$GCC_PATH"/bin:$PATH
|
||||||
# GECODE_PATH="/c/Program Files/Gecode"
|
# GECODE_PATH="/c/Program Files/Gecode"
|
||||||
GMP=/c/cygwin/Yap/win32
|
GMP=/c/cygwin/Yap/win32
|
||||||
CUDD_PATH=/c/cygwin/Yap/cudd-2.5.0-mingw32
|
CUDD_PATH=/c/cygwin/Yap/cudd-2.5.0-mingw32
|
||||||
JAVA_PATH="/c/Program Files (x86)/Java/jdk1.7.0_51"
|
JAVA_PATH="/c/Program Files (x86)/Java/jdk1.7.0_51"
|
||||||
R_PATH="/c/Program Files/R/R-3.0.2"
|
R_PATH="/c/Program Files/R/R-3.0.2"
|
||||||
R_ABI=i386
|
HOST="--enable-abi=32"
|
||||||
HOST=""
|
|
||||||
|
|
||||||
if test $THREADS = yes
|
cp $GCC_PATH/bin/libwinpthread-1.dll .
|
||||||
then
|
cp libwinpthread-1.dll pthreadGC2.dll
|
||||||
cp "$GCC_PATH/i686-w64-mingw32/lib/libwinpthread-1.dll" .
|
|
||||||
cp libwinpthread-1.dll pthreadGC2.dll
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
@ -111,11 +111,16 @@ then
|
|||||||
fi
|
fi
|
||||||
if test $REAL = yes
|
if test $REAL = yes
|
||||||
then
|
then
|
||||||
|
if test $ABI = 32; then
|
||||||
|
R_ABI=i386
|
||||||
|
else
|
||||||
|
R_ABI=x64
|
||||||
|
fi
|
||||||
export PATH="$PATH":"$R_PATH"/bin/"$R_ABI"
|
export PATH="$PATH":"$R_PATH"/bin/"$R_ABI"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$do_compile" = true; then
|
if test "$do_compile" = true; then
|
||||||
../yap-6.3/configure $HOST \
|
"$CONFIGURE" $HOST \
|
||||||
--with-R="$REAL" \
|
--with-R="$REAL" \
|
||||||
--with-java="$JAVA" \
|
--with-java="$JAVA" \
|
||||||
--with-gmp="$GMP" \
|
--with-gmp="$GMP" \
|
||||||
|
Reference in New Issue
Block a user