improvements

This commit is contained in:
vscosta 2014-11-09 12:08:23 +00:00
parent 9c2fd881f7
commit 9868abab6c

View File

@ -1,4 +1,4 @@
# !/bin/sh #!/bin/sh
# #
# script for compiling and installing YAP under msys. Uses a mingw64 # script for compiling and installing YAP under msys. Uses a mingw64
# compiler, msys shell and nsis to do the installing # compiler, msys shell and nsis to do the installing
@ -19,12 +19,14 @@
# http://nsis.sourceforge.net/Main_Page # http://nsis.sourceforge.net/Main_Page
# #
# #
# newline
for YHOME in /y/vsc /z /home/vsc /home/vitor /Users/vsc /u/vitor; for YHOME in /y/vsc /z /home/vsc /home/vitor /Users/vsc /u/vitor;
do do
if test -d $YHOME/Yap if test -d $YHOME/Yap
then then
break break
fi fi
done done
#!/bin/sh #!/bin/sh
@ -60,34 +62,39 @@ VERSION="$VER"."$PATCHID"
I=$# I=$#
while test $I -gt 0 while test $I -gt 0
do do
if test $1 = threads case $1 in
then threads)
THREADS=yes THREADS=yes
elif test $1 = no_threads ;;
then no_threads)
THREADS=no THREADS=no
elif test $1 = reuse ;;
then reuse)
CLEAN=no CLEAN=no
elif test $1 = clean ;;
then exe)
CLEAN=yes CLEAN=exe
elif test $1 = 32 ;;
then clean)
ABI=32 CLEAN=yes
elif test $1 = 64 ;;
then 32)
ABI=64 ABI=32
else ;;
echo "received \"$1\", should be one of threads, no_threads, 32, 64, reuse, clean" 64)
fi ABI=64
I=$(( $I - 1 )) ;;
**)
echo "received \"$1\", should be one of threads, no_threads, 32, 64, reuse, clean"
;;
esac
I=$(( $I - 1 ))
done done
# srcdir comes from here, please avoid relative paths # srcdir comes from here, please avoid relative paths
CONFIGURE="$SRC"/configure CONFIGURE="$SRC"/configure
#DEBUG=" --enable-debug-yap --enable-low-level-tracer" DEBUG=" --enable-debug-yap --enable-low-level-tracer"
DEBUG= #DEBUG=
# debugging setup # debugging setup
do_compile=yes do_compile=yes
@ -99,176 +106,186 @@ do_install=yes
DOCS_DIR="$YHOME"/Yap/doxout DOCS_DIR="$YHOME"/Yap/doxout
if test $ABI = 64; then if test $ABI = 64; then
TARGET=YAP64 TARGET=YAP64
case $( uname ) in case $( uname ) in
*Darwin*) *Darwin*)
GCC_DIR="$MXE" GCC_DIR="$MXE"
HOST="x86_64-w64-mingw32" HOST="x86_64-w64-mingw32"
BUILD=/c/cygwin/Yap/mingw"$ABI" BUILD=/c/cygwin/Yap/mingw"$ABI"
;; ;;
*MINGW64*) *MINGW64*)
# GCC_DIR=/l/Work/noth/mingw-w64/x86_64-4.9.0-posix-seh-rt_v3-rev1/mingw64 # GCC_DIR=/l/Work/noth/mingw-w64/x86_64-4.9.0-posix-seh-rt_v3-rev1/mingw64
# GCC_DIR=/c/TDM-GCC-64 # GCC_DIR=/c/TDM-GCC-64
GCC_DIR=/c/msys64/MinGW64 GCC_DIR=/c/msys64/MinGW64
HOST="x86_64-w64-mingw32" HOST="x86_64-w64-mingw32"
;; ;;
MSYS*) MSYS*)
# GCC_DIR=/c/TDM-GCC-64 # GCC_DIR=/c/TDM-GCC-64
GCC_DIR=/c/msys64 GCC_DIR=/c/msys64
HOST="x86_64-pc-msys" HOST="x86_64-pc-msys"
BLD="--build=$HOST" BLD="--build=$HOST"
;; ;;
esac esac
# ok. # ok.
# BDD compiler package. Get version that compiles on Windows from Vitor! # BDD compiler package. Get version that compiles on Windows from Vitor!
# GMP=/l/Work/noth/msys/1.0/local # GMP=/l/Work/noth/msys/1.0/local
GMP=yes #/c/msys64/usr/win64 GMP=yes #/c/msys64/usr/win64
CUDD=/c/cygwin/Yap/cudd-2.5.0-mingw64 CUDD=/c/cygwin/Yap/cudd-2.5.0-mingw64
GECODE=no # "/c/Program Files/Gecode" GECODE=no # "/c/Program Files/Gecode"
JAVA="$( echo /c/Program\ Files/Java/jdk* )" JAVA="$( echo /c/Program\ Files/Java/jdk* )"
# "/c/Python33-64" # "/c/Python33-64"
PYTHON=yes PYTHON=yes
R="$( echo /c/Program\ Files/R/R-*/bin/x64* )" R=yes
# HOME WIN32 configuration # HOME WIN32 configuration
elif test $ABI = 32; then elif test $ABI = 32; then
TARGET=YAP TARGET=YAP
case $( uname ) in case $( uname ) in
*Darwin*) *Darwin*)
#use mxe as a cross compiler #use mxe as a cross compiler
GCC_DIR="$MXE" GCC_DIR="$MXE"
HOST="i686-pc-mingw32" HOST="i686-pc-mingw32"
GMP=/c/msys64/usr/win32 GMP=/c/msys64/usr/win32
;; ;;
*MINGW32*) *MINGW32*)
GCC_DIR=/c/msys64/mingw32 GCC_DIR=/c/msys64/mingw32
HOST="i686-w64-mingw32" HOST="i686-w64-mingw32"
GMP=yes GMP=yes
;; ;;
esac esac
# ok. # ok.
# BDD compiler package. Get version that compiles on Windows from Vitor! # BDD compiler package. Get version that compiles on Windows from Vitor!
# GMP=/l/Work/noth/msys/1.0/local # GMP=/l/Work/noth/msys/1.0/local
CUDD=/c/cygwin/Yap/cudd-2.5.0-mingw32 CUDD=/c/cygwin/Yap/cudd-2.5.0-mingw32
GECODE=no # "/c/Program Files/Gecode" GECODE=no # "/c/Program Files/Gecode"
JAVA="$( echo /c/Program\ Files\ *x86*/Java/jdk* )" JAVA="$( echo /c/Program\ Files\ *x86*/Java/jdk* )"
#"/c/Python27/DLLs" #"/c/Python27/DLLs"
PYTHON=yes PYTHON=yes
R="$( echo /c/Program\ Files/R/R-*/bin/i* )" R=yes
# HOST=" --enable-abi=32" # HOST=" --enable-abi=32"
fi fi
if test x"$THREADS" = xyes; then if test x"$THREADS" = xyes; then
EXTRA_THREADS="-threads" EXTRA_THREADS="-threads"
fi fi
for BUILD in /c/cygwin/Yap "$HOME"/Yap/bins . for BUILD in /c/cygwin/Yap "$HOME"/Yap/bins .
do do
if test -d $BUILD; then break; fi if test -d $BUILD; then break; fi
done done
BUILD+="/mingw""$ABI""$EXTRA_THREADS" BUILD+="/mingw""$ABI""$EXTRA_THREADS"
export PATH="$GCC_DIR"/bin:"$PATH" export PATH="$GCC_DIR"/bin:"$PATH"
# echo "gcc= " $GCC_DIR # echo "gcc= " $GCC_DIR
echo "host= " $HOST echo "host= " $HOST
if test x"$JAVA" != xno if test x"$JAVA" != xno
then then
export PATH="$PATH":"$JAVA"/bin export PATH="$PATH":"$JAVA"/bin
fi fi
if test x"$PYTHON" != xno if test x"$PYTHON" != xno -a x"$PYTHON" != yes
then then
export PATH="$PATH":"$PYTHON" export PATH="$PATH":"$PYTHON"
fi fi
if test x"$R" != xno
if test x"$R" != yes
then
if test "$ABI" = 32
then
RPATH="$( echo /c/Program\ Files/R/R-*/bin/i386 )"
else
RPATH="$( echo /c/Program\ Files/R/R-*/bin/x64 )"
fi
export PATH="$PATH":"$RPATH"
elif test x"$R" != xno
then then
export PATH="$PATH":"$R" export PATH="$PATH":"$R"
fi fi
if test $CUDD != no if test $CUDD != no
then then
BDDLIB="yes" BDDLIB="yes"
CPLINT="yes" CPLINT="yes"
else else
BDDLIB="no" BDDLIB="no"
CPLINT="no" CPLINT="no"
fi fi
if test x"$GECODE" != xno if test x"$GECODE" != xno
then then
export PATH="$PATH":"$GECODE"/bin export PATH="$PATH":"$GECODE"/bin
fi fi
if test x"$JAVA" != xno if test x"$JAVA" != xno
then then
export PATH="$PATH":"$JAVA"/bin export PATH="$PATH":"$JAVA"/bin
fi fi
if test "$PYTHON" = yes if test "$PYTHON" = yes
then then
export PATH="$PATH":"$PYTHON" export PATH="$PATH":"$PYTHON"
fi fi
if test x"$R" != xno if test x"$R" != xno
then then
if test $ABI = 32; then if test $ABI = 32; then
R_ABI=i386 R_ABI=i386
else else
R_ABI=x64 R_ABI=x64
fi fi
export PATH="$PATH":"$R" export PATH="$PATH":"$R"
fi fi
if test $CLEAN = yes if test $CLEAN = yes
then then
make distclean rm -rf /c/$TARGET
fi fi
export INSTALL_SH=$SRC/yap-"$VERSION"/install.sh export INSTALL_SH=$SRC/yap-"$VERSION"/install.sh
# avoid using relative paths # avoid using relative paths
if test "$do_compile" = yes; then if test "$do_compile" = yes -a "$CLEAN" = yes; then
mkdir -p "$BUILD" rm -rf "$BUILD"/*
cd "$BUILD" mkdir -p "$BUILD"
# make distclean cd "$BUILD"
# /bin/rm -rf "$BUILD"/* # /bin/rm -rf "$BUILD"/*
"$CONFIGURE" --host="$HOST" "$BLD" \ "$CONFIGURE" --host="$HOST" "$BLD" \
--prefix=/c/"$TARGET" $DEBUG\ --prefix=/c/"$TARGET" $DEBUG\
--with-R="$R" \ --with-R="$R" \
--with-java="$JAVA" \ --with-java="$JAVA" \
--with-gmp="$GMP" \ --with-gmp="$GMP" \
--with-python="$PYTHON"/python.exe \ --with-python="$PYTHON"/python.exe \
--with-cudd="$CUDD" --enable-bddlib="$BDDLIB" --with-cplint="$CPLINT" \ --with-cudd="$CUDD" --enable-bddlib="$BDDLIB" --with-cplint="$CPLINT" \
--with-gecode="$GECODE" \ --with-gecode="$GECODE" \
--enable-threads="$THREADS" --enable-pthread-locking --enable-threads="$THREADS" --enable-pthread-locking
make -j 4
fi fi
make -j 4
if test "$do_install" = yes; then if test "$do_install" = yes; then
make install make install
cp -a "$DOCS_DIR"0/html /c/$TARGET/share/doc/Yap cp -a "$DOCS_DIR"0/html /c/$TARGET/share/doc/Yap
cp $DOCS_DIR/latex/*pdf /c/$TARGET/share/doc/Yap cp $DOCS_DIR/latex/*pdf /c/$TARGET/share/doc/Yap
DLL_PATH="$GCC_DIR"/bin DLL_PATH="$GCC_DIR"/bin
cp "$DLL_PATH"/libwinpthread-1.dll /c/"$TARGET"/bin cp "$DLL_PATH"/libwinpthread-1.dll /c/"$TARGET"/bin
cp "$DLL_PATH"/libgmp*.dll /c/"$TARGET"/bin cp "$DLL_PATH"/libgmp*.dll /c/"$TARGET"/bin
cp /c/"$TARGET"/bin/libwinpthread-1.dll /c/"$TARGET"/bin/pthreadGC2.dll cp /c/"$TARGET"/bin/libwinpthread-1.dll /c/"$TARGET"/bin/pthreadGC2.dll
if test $ABI = 64; then if test $ABI = 64; then
"$NSIS" -DREGKEY=SOFTWARE\\YAP\\Prolog64 \ "$NSIS" -DREGKEY=SOFTWARE\\YAP\\Prolog64 \
-DROOTDIR=/c/$TARGET -DTARGET="$TARGET" \ -DROOTDIR=/c/$TARGET -DTARGET="$TARGET" \
-DABI="$ABI" \ -DABI="$ABI" \
-DVERSION="$VERSION""$EXTRA_THREADS" \ -DVERSION="$VERSION""$EXTRA_THREADS" \
-DOPTIONS="$SRC_WIN\\misc\\options.ini" \ -DOPTIONS="$SRC_WIN\\misc\\options.ini" \
-DOUT_DIR=".." -D"WIN64=1" \ -DOUT_DIR=".." -D"WIN64=1" \
-NOCD $SRC/misc/Yap.nsi -NOCD $SRC/misc/Yap.nsi
else else
"$NSIS" -DREGKEY=SOFTWARE\\YAP\\Prolog \ "$NSIS" -DREGKEY=SOFTWARE\\YAP\\Prolog \
-DROOTDIR=/c/$TARGET -DTARGET="$TARGET" \ -DROOTDIR=/c/$TARGET -DTARGET="$TARGET" \
-DABI="$ABI" \ -DABI="$ABI" \
-DVERSION="$VERSION""$EXTRA_THREADS" \ -DVERSION="$VERSION""$EXTRA_THREADS" \
-DOPTIONS="$SRC_WIN\\misc\\options.ini" \ -DOPTIONS="$SRC_WIN\\misc\\options.ini" \
-DOUT_DIR=".." \ -DOUT_DIR=".." \
-NOCD $SRC/misc/Yap.nsi -NOCD $SRC/misc/Yap.nsi
fi fi
fi fi