diff --git a/README.md b/README.md index eeb95a3..f0e9040 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,8 @@ The latest version packaged for many linux distributions can be found in SuSE Bu Requirements ============ -GTK-3 - https://www.gtk.org/ - + * GTK-3 (https://www.gtk.org/) + * lib3270 (https://softwarepublico.gov.br/social/pw3270/) Building for Linux @@ -25,3 +24,26 @@ Building for Linux Cross-compiling for Windows =========================== +Cross-compiling on SuSE Linux (Native or WSL) +--------------------------------------------- + +1. First add the MinGW Repositories for your SuSE version from: + + * 32 bits: https://build.opensuse.org/project/show/windows:mingw:win32 + * 64 bits: https://build.opensuse.org/project/show/windows:mingw:win64 + +2. Get lib3270 sources from git + + * git clone http://softwarepublico.gov.br/gitlab/pw3270/lib3270.git ./v3270 + +3. Install cross compilers + + * ./v3270/win/install-cross.sh --32 (for 32 bits) + * ./v3270/win/install-cross.sh --64 (for 64 bits) + * ./v3270/win/install-cross.sh --all (for 32 and 64 bits) + +3. Configure build + + * ./v3270/win/win-configure.sh --32 (for 32 bits) + * ./v3270/win/win-configure.sh --64 (for 64 bits) + diff --git a/win/install-cross.sh b/win/install-cross.sh new file mode 100755 index 0000000..55cad36 --- /dev/null +++ b/win/install-cross.sh @@ -0,0 +1,104 @@ +#!/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 +libepoxy0 +libgdk_pixbuf-2_0-0 +atk-devel +pango-devel +win_iconv-devel +pixman-devel +glib2-devel +cairo-devel +freetype-devel +gtk3-devel +filesystem +gettext-tools +gtk3-data +gtk3-tools +gnome-icon-theme +hicolor-icon-theme +gdk-pixbuf-loader-rsvg +gdk-pixbuf-query-loaders +EOF + +# Instala apicativos e temas necessários +sudo zypper --non-interactive in \ + adwaita-icon-theme \ + gettext-tools \ + glib2-devel \ + optipng \ + ImageMagick + +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