This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/misc/mkwin

262 lines
5.8 KiB
Plaintext
Raw Normal View History

#!/bin/sh
#
# script for compiling and installing YAP under msys. Uses a mingw64
# compiler, msys shell and nsis to do the installing
# Please read the script before trying to execute it.
# Legal arguments for the script are
# 'threads' - enable threads
# 'no_threads',
# '32', '64' - compile for 32 or 64 bit architecture.
# By default threads are turned off and we use 64 bits.
#
# please check if you have gcc 64 bits in your path and a clone
# of msys shell like smartgit:
#
# http://sourceforge.net/projects/mingwbuilds/
# PS: don't install in the default location.
2014-11-03 00:13:34 +00:00
# mingw should avoid space in its directory path,
# it freaks winres out.
# http://nsis.sourceforge.net/Main_Page
#
#
2014-11-03 00:13:34 +00:00
for YHOME in /y/vsc /z /home/vsc /home/vitor /Users/vsc /u/vitor;
do
if test -d $YHOME/Yap
then
break
fi
done
2014-10-30 16:38:24 +00:00
2014-11-03 00:13:34 +00:00
#!/bin/sh
#
# /**
#
# assumes o mingw32/mingw64 compiler
# native sh like env: msys usually, such as
# http://msys2.sourceforge.net/
#
# Major and Minor
VER="6.3"
# Patch
PATCHID="4"
# SRC in the way it loks to the script
SRC=/c/cygwin/Yap/yap-"$VER"
# the way it looks to win32
SRC_WIN="c:\\cygwin\\Yap\\yap-${VER}"
#SRC=/l/work/noth/git
#SRC_WIN=L:\\work\\noth\\git
2014-10-30 07:47:16 +00:00
#SRC="$HOME"/git/yap-6.3
2014-11-03 00:13:34 +00:00
# do we support THREADS
THREADS=no
# makes install bundle
NSIS="/c/Program Files (x86)/NSIS/makensis"
2014-11-03 00:13:34 +00:00
# emulator, by default, ""
PREFIX_CMD=wine
2014-11-03 00:13:34 +00:00
VERSION="$VER"."$PATCHID"
I=$#
while test $I -gt 0
do
if test $1 = threads
then
2014-10-28 12:56:26 +00:00
THREADS=yes
elif test $1 = no_threads
then
2014-10-28 12:56:26 +00:00
THREADS=no
elif test $1 = 32
then
2014-10-28 12:56:26 +00:00
ABI=32
elif test $1 = 64
then
2014-10-28 12:56:26 +00:00
ABI=64
else
2014-10-28 12:56:26 +00:00
echo "received \"$1\", should be one of threads, no_threads, 32, 64"
fi
I=$(( $I - 1 ))
done
# srcdir comes from here, please avoid relative paths
2014-10-30 07:47:16 +00:00
CONFIGURE="$SRC"/configure
2014-11-03 00:13:34 +00:00
#DEBUG=" --enable-debug-yap --enable-low-level-tracer"
DEBUG=
# debugging setup
2014-11-03 00:13:34 +00:00
do_compile=yes
do_install=yes
# HOME WIN64 configuration
# DOCS_DIR=/l/work/noth/yapdocs
2014-11-03 00:13:34 +00:00
DOCS_DIR="$YHOME"/Yap/doxout
2014-10-30 07:47:16 +00:00
if test "$THREADS" = yes; then
FULL_VERSION="$VERSION"-threads
else
FULL_VERSION="$VERSION"
2014-10-30 07:47:16 +00:00
fi
if test $ABI = 64; then
2014-11-03 00:13:34 +00:00
TARGET=YAP64
2014-10-28 12:56:26 +00:00
case $( uname ) in
*Darwin*)
2014-10-30 07:47:16 +00:00
GCC_DIR="$MXE"
2014-10-28 12:56:26 +00:00
HOST="x86_64-w64-mingw32"
2014-11-03 00:13:34 +00:00
BUILD=/c/cygwin/Yap/mingw"$ABI"
2014-10-28 12:56:26 +00:00
;;
2014-10-30 07:47:16 +00:00
*MINGW64*)
2014-11-03 00:13:34 +00:00
# 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/MinGW64
2014-10-30 07:47:16 +00:00
HOST="x86_64-w64-mingw32"
2014-11-03 00:13:34 +00:00
;;
MSYS*)
# GCC_DIR=/c/TDM-GCC-64
GCC_DIR=/usr
HOST="x86_64-pc-msys"
BLD="--build=$HOST"
2014-10-30 07:47:16 +00:00
;;
esac
2014-10-28 12:56:26 +00:00
# ok.
2014-10-30 07:47:16 +00:00
# BDD compiler package. Get version that compiles on Windows from Vitor!
2014-10-28 12:56:26 +00:00
# GMP=/l/Work/noth/msys/1.0/local
2014-11-03 00:13:34 +00:00
GMP=yes #/c/msys64/usr/win64
2014-10-30 07:47:16 +00:00
CUDD=/c/cygwin/Yap/cudd-2.5.0-mingw64
GECODE=no # "/c/Program Files/Gecode"
JAVA="$( echo /c/Program\ Files/Java/jdk* )"
PYTHON="/c/Python33-64"
R="$( echo /c/Program\ Files/R/R-*/bin/x64 )"
# HOME WIN32 configuration
2014-11-03 00:13:34 +00:00
elif test $ABI = 32; then
TARGET=YAP
2014-10-28 12:56:26 +00:00
case $( uname ) in
*Darwin*)
#use mxe as a cross compiler
2014-11-03 00:13:34 +00:00
GCC_DIR="$MXE"
2014-10-28 12:56:26 +00:00
HOST="i686-pc-mingw32"
2014-11-03 00:13:34 +00:00
GMP=/c/msys64/usr/win32
2014-10-28 12:56:26 +00:00
;;
2014-11-03 00:13:34 +00:00
*MINGW32*)
GCC_DIR=/mingw32
HOST="i686-w64-mingw32"
GMP=yes
2014-10-30 16:38:24 +00:00
;;
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"
2014-11-03 00:13:34 +00:00
JAVA="$( echo /c/Program\ Files\ *x86*/Java/jdk* )"
PYTHON="/c/Python27/DLLs"
2014-10-30 16:38:24 +00:00
R="$( echo /c/Program\ Files/R/R-*/bin/i* )"
2014-11-03 00:13:34 +00:00
# HOST=" --enable-abi=32"
2014-10-28 12:56:26 +00:00
fi
2014-10-30 07:47:16 +00:00
export PATH="$GCC_DIR"/bin:"$PATH"
# echo "gcc= " $GCC_DIR
2014-11-03 00:13:34 +00:00
echo "host= " $HOST
2014-10-30 07:47:16 +00:00
if test x"$JAVA" != xno
then
export PATH="$PATH":"$JAVA"/bin
fi
if test x"$PYTHON" != xno
then
2014-11-03 00:13:34 +00:00
export PATH="$PATH":"$PYTHON"
2014-10-30 07:47:16 +00:00
fi
if test x"$R" != xno
then
export PATH="$PATH":"$R"
fi
2014-11-03 00:13:34 +00:00
if test x${THREADS} != xno
2014-10-28 12:56:26 +00:00
then
2014-11-03 00:13:34 +00:00
cp "$DLL_PATH"/libwinpthread-1.dll .
2014-11-03 00:43:19 +00:00
cp "$DLL_PATH"/gmp*.dll .
cp libwinpthread-1.dll pthreadGC2.dll
fi
2014-10-28 12:56:26 +00:00
if test $CUDD != no
then
2014-10-28 12:56:26 +00:00
BDDLIB="yes"
CPLINT="yes"
else
2014-10-28 12:56:26 +00:00
BDDLIB="no"
CPLINT="no"
fi
2014-10-28 12:56:26 +00:00
2014-10-30 07:47:16 +00:00
if test x"$GECODE" != xno
then
2014-10-30 07:47:16 +00:00
export PATH="$PATH":"$GECODE"/bin
fi
2014-10-28 12:56:26 +00:00
2014-11-03 00:13:34 +00:00
if test x"$JAVA" != xno
then
2014-10-30 07:47:16 +00:00
export PATH="$PATH":"$JAVA"/bin
fi
2014-10-28 12:56:26 +00:00
2014-10-30 07:47:16 +00:00
if test "$PYTHON" = yes
then
2014-10-30 07:47:16 +00:00
export PATH="$PATH":"$PYTHON"
fi
2014-10-28 12:56:26 +00:00
2014-10-30 07:47:16 +00:00
if test x"$R" != xno
then
if test $ABI = 32; then
R_ABI=i386
else
R_ABI=x64
fi
2014-10-30 07:47:16 +00:00
export PATH="$PATH":"$R"
fi
if test do_compile = true
then
make distclean
fi
2014-11-03 00:13:34 +00:00
export INSTALL_SH=$SRC/yap-"$VERSION"/install.sh
# avoid using relative paths
if test "$do_compile" = true; then
2014-10-30 07:47:16 +00:00
BUILD=/c/cygwin/Yap/mingw"$ABI"
mkdir -p "$BUILD"
2014-11-03 00:13:34 +00:00
cd "$BUILD"
# make distclean
2014-10-30 07:47:16 +00:00
# /bin/rm -rf "$BUILD"/*
2014-11-03 00:13:34 +00:00
"$CONFIGURE" --host="$HOST" "$BLD" \
--prefix=/c/"$TARGET" $DEBUG\
2014-10-30 07:47:16 +00:00
--with-R="$R" \
2014-10-28 12:56:26 +00:00
--with-java="$JAVA" \
--with-gmp="$GMP" \
2014-11-03 00:13:34 +00:00
--with-python="$PYTHON"/python.exe \
2014-10-28 12:56:26 +00:00
--with-cudd="$CUDD" --enable-bddlib="$BDDLIB" --with-cplint="$CPLINT" \
--with-gecode="$GECODE" \
2014-10-30 16:38:24 +00:00
--enable-threads="$THREADS" --enable-pthread-locking
2014-10-28 12:56:26 +00:00
make #-j 4 install
fi
2014-11-03 00:13:34 +00:00
if test "$do_install" = yes; then
make install
cp -a $DOCS_DIR/html /c/$TARGET/share/doc/Yap
cp $DOCS_DIR/latex/*pdf /c/$TARGET/share/doc/Yap
2014-10-28 12:56:26 +00:00
if test $ABI = 64; then
"$NSIS" -DREGKEY=SOFTWARE\\YAP\\Prolog64 \
2014-11-03 00:13:34 +00:00
-DROOTDIR=/c/$TARGET \
2014-10-28 12:56:26 +00:00
-DABI="$ABI" \
-DVERSION="$FULL_VERSION" \
2014-10-30 07:47:16 +00:00
-DOPTIONS="$SRC_WIN\\misc\\options.ini" \
2014-10-28 12:56:26 +00:00
-DOUT_DIR=".." -D"WIN64=1" \
2014-11-03 00:13:34 +00:00
-NOCD $SRC/misc/Yap.nsi
2014-10-28 12:56:26 +00:00
else
"$NSIS" -DREGKEY=SOFTWARE\\YAP\\Prolog \
2014-11-03 00:13:34 +00:00
-DROOTDIR=/c/$TARGET\
2014-10-28 12:56:26 +00:00
-DABI="$ABI" \
-DVERSION="$FULL_VERSION" \
2014-10-30 07:47:16 +00:00
-DOPTIONS="$SRC_WIN\\misc\\options.ini" \
2014-10-28 12:56:26 +00:00
-DOUT_DIR=".." \
2014-11-03 00:13:34 +00:00
-NOCD $SRC/misc/Yap.nsi
2014-10-28 12:56:26 +00:00
fi
fi