Commit e5e36f6e43e673bee101b0edd61319ce5b1851b7
1 parent
04a09f5c
Exists in
master
and in
1 other branch
Documenting windows builds.
Showing
3 changed files
with
198 additions
and
3 deletions
Show diff stats
README.md
| @@ -13,9 +13,8 @@ The latest version packaged for many linux distributions can be found in SuSE Bu | @@ -13,9 +13,8 @@ The latest version packaged for many linux distributions can be found in SuSE Bu | ||
| 13 | Requirements | 13 | Requirements |
| 14 | ============ | 14 | ============ |
| 15 | 15 | ||
| 16 | -GTK-3 | ||
| 17 | - https://www.gtk.org/ | ||
| 18 | - | 16 | + * GTK-3 (https://www.gtk.org/) |
| 17 | + * lib3270 (https://softwarepublico.gov.br/social/pw3270/) | ||
| 19 | 18 | ||
| 20 | 19 | ||
| 21 | Building for Linux | 20 | Building for Linux |
| @@ -25,3 +24,26 @@ Building for Linux | @@ -25,3 +24,26 @@ Building for Linux | ||
| 25 | Cross-compiling for Windows | 24 | Cross-compiling for Windows |
| 26 | =========================== | 25 | =========================== |
| 27 | 26 | ||
| 27 | +Cross-compiling on SuSE Linux (Native or WSL) | ||
| 28 | +--------------------------------------------- | ||
| 29 | + | ||
| 30 | +1. First add the MinGW Repositories for your SuSE version from: | ||
| 31 | + | ||
| 32 | + * 32 bits: https://build.opensuse.org/project/show/windows:mingw:win32 | ||
| 33 | + * 64 bits: https://build.opensuse.org/project/show/windows:mingw:win64 | ||
| 34 | + | ||
| 35 | +2. Get lib3270 sources from git | ||
| 36 | + | ||
| 37 | + * git clone http://softwarepublico.gov.br/gitlab/pw3270/lib3270.git ./v3270 | ||
| 38 | + | ||
| 39 | +3. Install cross compilers | ||
| 40 | + | ||
| 41 | + * ./v3270/win/install-cross.sh --32 (for 32 bits) | ||
| 42 | + * ./v3270/win/install-cross.sh --64 (for 64 bits) | ||
| 43 | + * ./v3270/win/install-cross.sh --all (for 32 and 64 bits) | ||
| 44 | + | ||
| 45 | +3. Configure build | ||
| 46 | + | ||
| 47 | + * ./v3270/win/win-configure.sh --32 (for 32 bits) | ||
| 48 | + * ./v3270/win/win-configure.sh --64 (for 64 bits) | ||
| 49 | + |
| @@ -0,0 +1,104 @@ | @@ -0,0 +1,104 @@ | ||
| 1 | +#!/bin/bash | ||
| 2 | + | ||
| 3 | +install_packages() { | ||
| 4 | + | ||
| 5 | +TEMPFILE=$(mktemp) | ||
| 6 | + | ||
| 7 | +cat > ${TEMPFILE} << EOF | ||
| 8 | +cross-binutils | ||
| 9 | +cross-gcc | ||
| 10 | +cross-gcc-c++ | ||
| 11 | +cross-pkg-config | ||
| 12 | +filesystem | ||
| 13 | +libopenssl | ||
| 14 | +libopenssl-devel | ||
| 15 | +libintl-devel | ||
| 16 | +win_iconv-devel | ||
| 17 | +zlib-devel | ||
| 18 | +winpthreads-devel | ||
| 19 | +cross-cpp | ||
| 20 | +gettext-tools | ||
| 21 | +headers | ||
| 22 | +libepoxy0 | ||
| 23 | +libgdk_pixbuf-2_0-0 | ||
| 24 | +atk-devel | ||
| 25 | +pango-devel | ||
| 26 | +win_iconv-devel | ||
| 27 | +pixman-devel | ||
| 28 | +glib2-devel | ||
| 29 | +cairo-devel | ||
| 30 | +freetype-devel | ||
| 31 | +gtk3-devel | ||
| 32 | +filesystem | ||
| 33 | +gettext-tools | ||
| 34 | +gtk3-data | ||
| 35 | +gtk3-tools | ||
| 36 | +gnome-icon-theme | ||
| 37 | +hicolor-icon-theme | ||
| 38 | +gdk-pixbuf-loader-rsvg | ||
| 39 | +gdk-pixbuf-query-loaders | ||
| 40 | +EOF | ||
| 41 | + | ||
| 42 | +# Instala apicativos e temas necessários | ||
| 43 | +sudo zypper --non-interactive in \ | ||
| 44 | + adwaita-icon-theme \ | ||
| 45 | + gettext-tools \ | ||
| 46 | + glib2-devel \ | ||
| 47 | + optipng \ | ||
| 48 | + ImageMagick | ||
| 49 | + | ||
| 50 | +while read FILE | ||
| 51 | +do | ||
| 52 | + sudo zypper --non-interactive in ${1}-${FILE} | ||
| 53 | +done < ${TEMPFILE} | ||
| 54 | + | ||
| 55 | +rm -f ${TEMPFILE} | ||
| 56 | + | ||
| 57 | +} | ||
| 58 | + | ||
| 59 | +if [ -z ${1} ]; then | ||
| 60 | + echo "Use ${0} --32 for 32 bits cross-compiler" | ||
| 61 | + echo "Use ${0} --64 for 64 bits cross-compiler" | ||
| 62 | + exit -1 | ||
| 63 | +fi | ||
| 64 | + | ||
| 65 | + | ||
| 66 | +until [ -z "${1}" ] | ||
| 67 | +do | ||
| 68 | + if [ ${1:0:2} = '--' ]; then | ||
| 69 | + tmp=${1:2} | ||
| 70 | + parameter=${tmp%%=*} | ||
| 71 | + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") | ||
| 72 | + | ||
| 73 | + case $parameter in | ||
| 74 | + | ||
| 75 | + ar) | ||
| 76 | + zypper ar --refresh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_42.3/ mingw32 | ||
| 77 | + zypper ar --refresh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_42.3/ mingw64 | ||
| 78 | + ;; | ||
| 79 | + | ||
| 80 | + 32) | ||
| 81 | + install_packages mingw32 | ||
| 82 | + ;; | ||
| 83 | + | ||
| 84 | + 64) | ||
| 85 | + install_packages mingw64 | ||
| 86 | + ;; | ||
| 87 | + | ||
| 88 | + ALL) | ||
| 89 | + install_packages mingw32 | ||
| 90 | + install_packages mingw64 | ||
| 91 | + ;; | ||
| 92 | + | ||
| 93 | + | ||
| 94 | + *) | ||
| 95 | + value=${tmp##*=} | ||
| 96 | + eval $parameter=$value | ||
| 97 | + esac | ||
| 98 | + | ||
| 99 | + fi | ||
| 100 | + | ||
| 101 | + shift | ||
| 102 | +done | ||
| 103 | + | ||
| 104 | + |
| @@ -0,0 +1,69 @@ | @@ -0,0 +1,69 @@ | ||
| 1 | +#!/bin/bash | ||
| 2 | + | ||
| 3 | +aclocal | ||
| 4 | +if test $? != 0 ; then | ||
| 5 | + echo "aclocal failed." | ||
| 6 | + exit -1 | ||
| 7 | +fi | ||
| 8 | + | ||
| 9 | +autoconf | ||
| 10 | +if test $? != 0 ; then | ||
| 11 | + echo "autoconf failed." | ||
| 12 | + exit -1 | ||
| 13 | +fi | ||
| 14 | + | ||
| 15 | +mkdir -p scripts | ||
| 16 | +automake --add-missing 2> /dev/null | true | ||
| 17 | + | ||
| 18 | +export HOST_CC=/usr/bin/gcc | ||
| 19 | + | ||
| 20 | +until [ -z "${1}" ] | ||
| 21 | +do | ||
| 22 | + if [ ${1:0:2} = '--' ]; then | ||
| 23 | + tmp=${1:2} | ||
| 24 | + parameter=${tmp%%=*} | ||
| 25 | + parameter=$(echo $parameter | tr "[:lower:]" "[:upper:]") | ||
| 26 | + | ||
| 27 | + case $parameter in | ||
| 28 | + | ||
| 29 | + 32) | ||
| 30 | + rm -f win32.cache | ||
| 31 | + ./configure \ | ||
| 32 | + --cache-file=win32.cache \ | ||
| 33 | + --host=i686-w64-mingw32 \ | ||
| 34 | + --prefix=/usr/i686-w64-mingw32/sys-root/mingw \ | ||
| 35 | + --libdir=/usr/i686-w64-mingw32/sys-root/mingw/lib | ||
| 36 | + | ||
| 37 | + exit $? | ||
| 38 | + ;; | ||
| 39 | + | ||
| 40 | + 64) | ||
| 41 | + rm -f win64.cache | ||
| 42 | + ./configure \ | ||
| 43 | + --cache-file=win64.cache \ | ||
| 44 | + --host=x86_64-w64-mingw32 \ | ||
| 45 | + --prefix=/usr/x86_64-w64-mingw32/sys-root/mingw \ | ||
| 46 | + --libdir=/usr/x86_64-w64-mingw32/sys-root/mingw/lib | ||
| 47 | + exit $? | ||
| 48 | + ;; | ||
| 49 | + | ||
| 50 | + ALL) | ||
| 51 | + ;; | ||
| 52 | + | ||
| 53 | + | ||
| 54 | + *) | ||
| 55 | + value=${tmp##*=} | ||
| 56 | + eval $parameter=$value | ||
| 57 | + esac | ||
| 58 | + | ||
| 59 | + fi | ||
| 60 | + | ||
| 61 | + shift | ||
| 62 | +done | ||
| 63 | + | ||
| 64 | +echo "Execute:" | ||
| 65 | +echo " ${0} --32 for 32 bits windows." | ||
| 66 | +echo " ${0} --64 for 64 bits windows." | ||
| 67 | + | ||
| 68 | +exit -1 | ||
| 69 | + |