From ea56dee9a3987780523ee66cde8e191c83fffa77 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 1 Apr 2019 21:41:22 -0300 Subject: [PATCH] Incluindo scripts para empacotamento em windows. --- win/install-cross.sh | 85 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ win/win-configure.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 154 insertions(+), 0 deletions(-) create mode 100755 win/install-cross.sh create mode 100755 win/win-configure.sh diff --git a/win/install-cross.sh b/win/install-cross.sh new file mode 100755 index 0000000..340147d --- /dev/null +++ b/win/install-cross.sh @@ -0,0 +1,85 @@ +#!/bin/bash + +install_packages() { + +TEMPFILE=$(mktemp) + +cat > ${TEMPFILE} << EOF +cross-binutils +cross-gcc +cross-gcc-c++ +cross-pkg-config +filesystem +libopenssl +libopenssl-devel +libintl-devel +win_iconv-devel +zlib-devel +winpthreads-devel +cross-cpp +gettext-tools +headers +lib3270-5_2-devel +libv3270-5_2-devel +EOF + +# Instala apicativos e temas necessários +sudo zypper --non-interactive in \ + gettext-tools \ + automake + +while read FILE +do + sudo zypper --non-interactive in ${1}-${FILE} +done < ${TEMPFILE} + +rm -f ${TEMPFILE} + +} + +if [ -z ${1} ]; then + echo "Use ${0} --32 for 32 bits cross-compiler" + echo "Use ${0} --64 for 64 bits cross-compiler" + exit -1 +fi + + +until [ -z "${1}" ] +do + if [ ${1:0:2} = '--' ]; then + tmp=${1:2} + parameter=${tmp%%=*} + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") + + case $parameter in + + ar) + zypper ar --refresh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_42.3/ mingw32 + zypper ar --refresh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_42.3/ mingw64 + ;; + + 32) + install_packages mingw32 + ;; + + 64) + install_packages mingw64 + ;; + + ALL) + install_packages mingw32 + install_packages mingw64 + ;; + + + *) + value=${tmp##*=} + eval $parameter=$value + esac + + fi + + shift +done + + diff --git a/win/win-configure.sh b/win/win-configure.sh new file mode 100755 index 0000000..f30114c --- /dev/null +++ b/win/win-configure.sh @@ -0,0 +1,69 @@ +#!/bin/bash + +aclocal +if test $? != 0 ; then + echo "aclocal failed." + exit -1 +fi + +autoconf +if test $? != 0 ; then + echo "autoconf failed." + exit -1 +fi + +mkdir -p scripts +automake --add-missing 2> /dev/null | true + +export HOST_CC=/usr/bin/gcc + +until [ -z "${1}" ] +do + if [ ${1:0:2} = '--' ]; then + tmp=${1:2} + parameter=${tmp%%=*} + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") + + case $parameter in + + 32) + rm -f win32.cache + ./configure \ + --cache-file=win32.cache \ + --host=i686-w64-mingw32 \ + --prefix=/usr/i686-w64-mingw32/sys-root/mingw \ + --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib + + exit $? + ;; + + 64) + rm -f win64.cache + ./configure \ + --cache-file=win64.cache \ + --host=x86_64-w64-mingw32 \ + --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw \ + --libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib + exit $? + ;; + + ALL) + ;; + + + *) + value=${tmp##*=} + eval $parameter=$value + esac + + fi + + shift +done + +echo "Execute:" +echo " ${0} --32 for 32 bits windows." +echo " ${0} --64 for 64 bits windows." + +exit -1 + -- libgit2 0.21.2