From 11d78d97cc48d73dbf20e1cca5a8a6ce619db4f1 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 21 Jan 2021 13:56:30 -0300 Subject: [PATCH] Updating README, adding scripts for mingw builds. --- README.md | 14 +++++++++----- win/configure.sh | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ win/install-cross.sh | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 161 insertions(+), 5 deletions(-) create mode 100755 win/configure.sh create mode 100755 win/install-cross.sh diff --git a/README.md b/README.md index ca18049..5897cef 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ See more details at https://softwarepublico.gov.br/social/pw3270/ [![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) ![CodeQL](https://github.com/PerryWerneck/lib3270/workflows/CodeQL/badge.svg) -![Analytics](https://ga-beacon.appspot.com/G-RSMGQ9Q5BG/github/libipc3270) +![Analytics](https://ga-beacon.appspot.com/UA-35100728-2/github/libipc3270) ![Downloads](https://img.shields.io/github/downloads/PerryWerneck/libipc3270/total.svg) ## Instalation @@ -44,13 +44,17 @@ For the supported distributions get the install repositories and instructions fr $ git clone https://github.com/PerryWerneck/libipc3270.git ./libipc3270 ``` -3. Install cross compilers +3. Install 64 bits cross compilers - TODO + ```shell + $ ./libipc3270/win/install-cross.sh --64 + ``` -3. Configure build +3. Configure 64 bits build environment - TODO + ```shell + $ ./libipc3270/win/win-configure.sh --64 + ``` 4. Build diff --git a/win/configure.sh b/win/configure.sh new file mode 100755 index 0000000..f30114c --- /dev/null +++ b/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 + diff --git a/win/install-cross.sh b/win/install-cross.sh new file mode 100755 index 0000000..813ac79 --- /dev/null +++ b/win/install-cross.sh @@ -0,0 +1,83 @@ +#!/bin/bash + +install_packages() { + +TEMPFILE=$(mktemp) + +cat > ${TEMPFILE} << EOF +libtool +gettext-devel +cross-binutils +cross-gcc +cross-gcc-c++ +cross-pkg-config +filesystem +lib3270-devel +libv3270-devel +EOF + +# Instala apicativos e temas necessários +sudo zypper --non-interactive in \ + adwaita-icon-theme \ + gettext-tools \ + glib2-devel \ + autoconf \ + automake \ + libtool + +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 obs://windows:mingw:win32 mingw32 + zypper ar obs://windows:mingw:win64 mingw64 + zypper ar obs://home:PerryWerneck:pw3270 pw3270 + ;; + + 32) + install_packages mingw32 + ;; + + 64) + install_packages mingw64 + ;; + + ALL) + install_packages mingw32 + install_packages mingw64 + ;; + + + *) + value=${tmp##*=} + eval $parameter=$value + esac + + fi + + shift +done + + -- libgit2 0.21.2