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