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