Commit e1382c28 authored by Pavel Beketov's avatar Pavel Beketov

Initial commit

parents
#!/bin/sh -x
. ./config.sh
# build only 32 bit on i586 arch
[ "$(epm print info -a)" = "x86" ] && BUILDARCH=win32
# overrride BUILDARCH
[ "$1" ] && BUILDARCH="$1"
CLANG="$(which ccache 2>/dev/null) clang"
check_clang()
{
# TODO: check we have complete 11 or complete 12
if [ "$(epm print info -e)" = "AstraLinux/orel" ] ; then
epm assure llvm-link llvm-9 || fatal
epm assure clang-9 clang-9 || fatal
#epm assure clang clang || fatal
epm assure /usr/bin/lld-link lld-9 || fatal
epm assure /usr/bin/llvm-dlltool llvm-9 || fatal
# to allow clang build 32 bit
#epm install libgcc-10-dev-i386-cross || fatal
epm install gcc-multilib
elif [ "$(epm print info -p)" = "deb" ] ; then
epm assure llvm-link llvm-11 || fatal
epm assure clang-11 clang-11 || fatal
#epm assure clang clang || fatal
epm assure /usr/bin/lld-link lld-11 || fatal
epm assure /usr/bin/llvm-dlltool llvm-11 || fatal
# to allow clang build 32 bit
epm install libgcc-10-dev-i386-cross || fatal
else
epm assure llvm-link llvm || fatal
epm assure clang || fatal
epm assure /usr/bin/lld-link || fatal
epm assure /usr/bin/llvm-dlltool || fatal
# hack for p9
if ! clang --version | grep "clang version 1[1-9]" || ! lld-link --version | grep "LLD 1[1-9]" ; then
epmqp llvm10 | epme --auto
epmqp llvm7 | epme --auto
epm install llvm11.0 clang11.0 /usr/bin/lld-link /usr/bin/llvm-dlltool || fatal
fi
fi
}
epm assure git
epm assure time
case "$COMPILER" in
clang)
check_clang
export CC=$CLANG
;;
gcc)
;;
*)
fatal "Unknown COMPILER $COMPILER"
esac
case "$CROSSCOMPILER" in
clang)
check_clang
for i in clang clang-11 clang-10 clang-9 ; do
which $i 2>/dev/null >/dev/null || continue
export CROSSCC=$i
break
done
WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --with-mingw"
;;
mingw)
WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --with-mingw"
;;
none|'')
WINE_BUILD_OPTIONS="$WINE_BUILD_OPTIONS --without-mingw"
;;
*)
fatal "Unknown CROSSCOMPILER $CROSSCOMPILER"
esac
epm assure jmake etersoft-build-utils || fatal
get_current_branch()
{
( cd $REPO && git branch | grep '^\*' | sed 's/^..//' | tr -d "\n" )
}
print_build_mark()
{
echo "SOURCEREPO=$(realpath $REPO) BRANCH=$(get_current_branch) WINEVERSION='$(cat $REPO/VERSION)' CC=$COMPILER CROSSCC=$CROSSCOMPILER BUILDARCH=$BUILDARCH PLATFORM=$(epm print info -e)"
}
cd_to_repo()
{
if [ -d "$1" ] ; then
[ -f "$1/.eterbuild" ] || fatal "Нет флага .eterbuild в $1, создано не этим скриптом."
if [ "$(print_build_mark)" != "$(cat "$1/.eterbuild")" ] ; then
echo "Build mark $(print_build_mark) is changed (was $(cat "$1/.eterbuild")), removing old build dirs ..."
rm -rvf "$1"
fi
fi
# create dir if missed or just removed above
if [ ! -d "$1" ] ; then
mkdir -p "$1"
print_build_mark > "$1/.eterbuild"
fi
cd $1 || fatal
}
# need we?
# disable rpath using for executable
# subst "s|^\(LDRPATH_INSTALL =\).*|\1|" Makefile.in
if [ "$BUILDARCH" = "win64" ] || [ "$BUILDARCH" = "both" ] ; then
cd_to_repo $BUILDREPO64
$REPO/configure --enable-win64 ${WINE_BUILD_OPTIONS} || fatal "Return from $(pwd)"
jmake || fatal "Return from $(pwd)"
fi
if [ "$BUILDARCH" != "win64" ] ; then
cd_to_repo $BUILDREPO
# don't search X11 via pkg-config, so it will not help. For Astra I made ln -s /usr/lib32/i386-linux-gnu /usr/lib/i386-linux-gnu
#[ -d /usr/lib32/i386-linux-gnu/pkgconfig ] && export PKG_CONFIG_PATH=/usr/lib32/i386-linux-gnu/pkgconfig
# but default use wine tools from with-wine64 path (checking for the directory containing the Wine tools...)
[ -f "$BUILDREPO64/.eterbuild" ] && WINEOPT="--with-wine64=$BUILDREPO64" || WINEOPT=''
$REPO/configure $WINEOPT ${WINE_BUILD_OPTIONS} || fatal "Return from $(pwd)"
jmake || fatal "Return from $(pwd)"
fi
echo "Done: $(print_build_mark)"
# добавить в ww детект префикса (TODO: в wine?)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment