175 lines
4.2 KiB
Bash
Executable File
175 lines
4.2 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# script for compiling and installing YAP under msys. Uses a mingw64
|
|
# compiler and nsis to do the installing
|
|
#
|
|
# please check:
|
|
#
|
|
# http://sourceforge.net/projects/mingwbuilds/
|
|
# PS: don't install in the default location.
|
|
# mingw should avoid space in its directory,
|
|
# it freaks winres out.
|
|
# http://nsis.sourceforge.net/Main_Page
|
|
#
|
|
#
|
|
VERSION=6.3.4
|
|
THREADS=no
|
|
ABI=64
|
|
|
|
if test $# = 1; then
|
|
if test $1 = threads; then
|
|
THREADS=yes
|
|
elif test $1 = no_threads; then
|
|
THREADS=no
|
|
elif test $1 = 32; then
|
|
ABI=32
|
|
elif test $1 = 64; then
|
|
ABI=64
|
|
else
|
|
echo "received \"$1\", should be one of threads, no_threads, 32, 64"
|
|
fi
|
|
else
|
|
if test $1 = threads; then
|
|
THREADS=yes
|
|
elif test $1 = no_threads; then
|
|
THREADS=no
|
|
elif test $1 = 32; then
|
|
ABI=32
|
|
elif test $1 = 64; then
|
|
ABI=64
|
|
else
|
|
echo "received 1=\"$1\", should be one of threads, no_threads, 32, 64"
|
|
fi
|
|
if test $2 = threads; then
|
|
THREADS=yes
|
|
elif test $2 = no_threads; then
|
|
THREADS=no
|
|
elif test $2 = 32; then
|
|
ABI=32
|
|
elif test $2 = 64; then
|
|
ABI=64
|
|
else
|
|
echo "received 1=\"$2\", should be one of threads, no_threads, 32, 64"
|
|
fi
|
|
fi
|
|
|
|
CONFIGURE=../yap-6.3/configure
|
|
|
|
# debugging setup
|
|
do_compile=true
|
|
do_install=true
|
|
|
|
# HOME WIN64 configuration
|
|
|
|
DOCS_DIR=/z/Yap/bins/osx
|
|
if test "$THREADS" = yes; then
|
|
FULL_VERSION="$VERSION"-threads
|
|
else
|
|
FULL_VERSION="$VERSION"
|
|
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
|
|
|
|
# it seems python2.7 does not support mingw64
|
|
PYTHON_PATH="/c/Python33-64"
|
|
export PATH="$GCC_PATH"/bin:"$PATH"
|
|
GECODE_PATH="/c/Program Files/Gecode"
|
|
GMP=/c/cygwin/Yap/win64
|
|
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"
|
|
if test $THREADS = yes
|
|
then
|
|
cp "$GCC_PATH/x86_64-w64-mingw32/lib/libwinpthread-1.dll" .
|
|
cp libwinpthread-1.dll pthreadGC2.dll
|
|
fi
|
|
fi
|
|
|
|
# HOME WIN32 configuration
|
|
if test $ABI = 32; then
|
|
GCC_PATH="/c/TDM-GCC-64"
|
|
|
|
CUDD=yes
|
|
GECODE=no # install only allows one of 32 or 64 bits
|
|
GMP=yes
|
|
JAVA=yes
|
|
PYTHON=no
|
|
REAL=yes
|
|
|
|
PYTHON_PATH="/c/Python27"
|
|
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"
|
|
HOST="--enable-abi=32"
|
|
|
|
cp $GCC_PATH/bin/libwinpthread-1.dll .
|
|
cp libwinpthread-1.dll pthreadGC2.dll
|
|
fi
|
|
|
|
|
|
if test $CUDD = yes
|
|
then
|
|
CUDD="$CUDD_PATH"
|
|
BDDLIB="--enable-bddlib"
|
|
else
|
|
BDDLIB=""
|
|
fi
|
|
if test $GECODE = yes
|
|
then
|
|
export PATH="$PATH":"$GECODE_PATH"/bin
|
|
fi
|
|
if test $JAVA = yes
|
|
then
|
|
export PATH="$PATH":"$JAVA_PATH"/bin
|
|
fi
|
|
if test $PYTHON = yes
|
|
then
|
|
export PATH="$PATH":"$PYTHON_PATH"
|
|
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
|
|
"$CONFIGURE" $HOST \
|
|
--with-R="$REAL" \
|
|
--with-java="$JAVA" \
|
|
--with-gmp="$GMP" \
|
|
--with-python="$PYTHON" \
|
|
--with-cudd="$CUDD" "$BDDLIB" \
|
|
--enable-gecode="$GECODE" \
|
|
--enable-threads="$THREADS" --enable-pthread-locking \
|
|
--enable-debug-yap --enable-low-level-tracer
|
|
make install
|
|
fi
|
|
if test "$do_install" = true; then
|
|
if test $ABI = 64; then
|
|
cp $DOCS_DIR/*html /c/Yap64/share/doc/Yap
|
|
cp $DOCS_DIR/*pdf /c/Yap64/share/doc/Yap
|
|
"/c/Program Files (x86)/NSIS/makensis" -DREGKEY=SOFTWARE\\YAP\\Prolog64 -DROOTDIR=Yap64 -DABI="$ABI" -DVERSION="$FULL_VERSION" -DOPTIONS="..\\yap-6.3\\misc\\options.ini" -DOUT_DIR=".." -D"WIN64=1" -NOCD ../yap-6.3/misc/Yap.nsi
|
|
else
|
|
cp $DOCS_DIR/*html /c/Yap/share/doc/Yap
|
|
cp $DOCS_DIR/*pdf /c/Yap/share/doc/Yap
|
|
"/c/Program Files (x86)/NSIS/makensis" -DREGKEY=SOFTWARE\\YAP\\Prolog -DROOTDIR=Yap -DABI="$ABI" -DVERSION="$FULL_VERSION" -DOPTIONS="..\\yap-6.3\\misc\\options.ini" -DOUT_DIR=".." -NOCD ../yap-6.3/misc/Yap.nsi
|
|
fi
|
|
fi
|