GithubHelp home page GithubHelp logo

perrywerneck / lib3270 Goto Github PK

View Code? Open in Web Editor NEW
10.0 6.0 6.0 2.77 MB

TN3270 client Library

Home Page: https://softwarepublico.gov.br/social/pw3270/

License: GNU Lesser General Public License v3.0

Makefile 1.18% Shell 1.31% M4 1.73% C 95.79%
3270 tn3270 mainframe

lib3270's Introduction

TN3270 Protocol Library for Linux/Windows

Created originally as part of PW3270 application.

License: GPL v3 CodeQL build result Publish Downloads

Installation

Pre build packages

You can download installation package for supported linux distributions in Open Build Service

Download from open build service Download from githut

Building for Linux

  1. Get lib3270 sources from git

    git clone https://github.com/PerryWerneck/lib3270.git ./lib3270
  2. Install the required libraries

    • autoconf
    • automake
    • binutils
    • coreutils
    • gcc-c++
    • gettext-devel
    • m4
    • pkgconfig
    • openssl-devel
    • dbus-1-devel
    • xz

    (This command can make it easy on SuSE: grep -i buildrequires rpm/lib3270.spec | cut -d: -f2 | sudo xargs zypper in )

  3. Configure and build

    ./autogen.sh
    make clean
    make all

Building for Windows

Cross-compiling on SuSE Linux (Native or WSL)

  1. First add the MinGW Repositories for your SuSE version from:

    sudo zypper ar obs://windows:mingw:win32 mingw32
    sudo zypper ar obs://windows:mingw:win64 mingw64
    sudo zypper ref
  2. Get lib3270 sources from git

    git clone https://github.com/PerryWerneck/lib3270.git ./lib3270
  3. Install cross compilers

    ./lib3270/win/install-cross.sh --all (for 32 and 64 bits)
  4. Configure build

    ./lib3270/win/win-configure.sh --64 (for 64 bits)
  5. Build

    cd lib3270
    make clean
    make all

Windows native with MSYS2 (Using bundle script)

  1. Install and update MSYS2

    • Download and install msys2
    • Update msys:
    pacman -Syu

    Afther this close and reopen mingw shell.

  2. Get lib3270 sources from git using the mingw shell

    git clone https://github.com/PerryWerneck/lib3270.git ./lib3270
  3. Run bundle script

    cd lib3270
    ./win/bundle.msys --pre-reqs --build

Windows native with MSYS2 (Manual)

  1. Install and update MSYS2

    • Download and install msys2
    • Update msys:
    pacman -Syu

    Afther this close and reopen mingw shell.

  2. Update system path

    • Add c:\msys64\usr\bin and c:\msys64\mingw64\bin to system path
  3. Install devel packages using pacman on mingw shell

    pacman -S --needed zip dos2unix mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool

    Afther this close and reopen mingw shell.

  4. Get lib3270 sources from git using the mingw shell

    git clone https://github.com/PerryWerneck/lib3270.git ./lib3270
  5. Build library using the mingw shell

    cd lib3270
    ./autogen.sh
    make all
  6. Install

    make install

Building for macOS

Using homebrew

Install

  1. Install homebrew

  2. Install dependencies

    brew update
    brew install xz automake binutils coreutils curl gettext libtool openssl pkgconfig
    brew upgrade
  3. Configure, build and install

    export PKG_CONFIG_PATH="$(brew --prefix curl)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"
    ./autogen.sh --prefix="$(brew --cellar)/lib3270/5.4" --with-libiconv-prefix=$(brew --prefix gettext)
    make all && make install
    brew link lib3270

Uninstall

```shell
brew unlink lib3270
rm -fr "$(brew --cellar)/lib3270"
```

Using jhbuild

  1. Install jhbuild

    https://wiki.gnome.org/Projects/GTK/OSX/Building

  2. build

    jhbuild --moduleset=https://raw.githubusercontent.com/PerryWerneck/lib3270/master/mac/lib3270.modules build lib3270

lib3270's People

Contributors

andrebreves avatar bmwiedemann avatar davide125 avatar lowobservable avatar perrywerneck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

lib3270's Issues

Error building on Apple Sillicon

Hello Perry,

I'm still in trouble with building pw3270.
Currently I'm stuck with building lib3270 via HomeBrew:

export PKG_CONFIG_PATH="$(brew --prefix curl)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig"
./autogen.sh --prefix="$(brew --cellar)/lib3270/5.4"
...
...
checking for libintl.h... no
configure: error: Can't find required file libintl.h

Regarding #33 I then tried

❯ ./configure "LDFLAGS=$LDFLAGS -L$(brew --prefix gettext)/lib" "CFLAGS=-I$(brew --prefix gettext)/include"
...
...
config.status: executing depfiles commands

Went fine, and now I started the build;

❯ make all
...
...
/Users/mike/repos/lib3270/.obj/macos/Release/./src/core/ansi.o ...
Undefined symbols for architecture arm64:
  "_iconv", referenced from:
      _convert in iconv.o
     (maybe you meant: _lib3270_iconv_from_host, _lib3270_iconv_free , _lib3270_iconv_new , _lib3270_iconv_to_host )
  "_iconv_close", referenced from:
      _lib3270_iconv_free in iconv.o
  "_iconv_open", referenced from:
      _lib3270_iconv_new in iconv.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [/Users/mike/repos/lib3270/.bin/Release/lib3270-5.4.dylib] Error 1

Some checks:

❯ ./configure "LDFLAGS=$LDFLAGS -L$(brew --prefix gettext)/lib" "CFLAGS=-I$(brew --prefix gettext)/include" | grep iconv
checking for iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
❯ find /opt -name "libiconv.*" -print
/opt/homebrew/Cellar/libiconv/1.17/.brew/libiconv.rb
/opt/homebrew/Cellar/libiconv/1.17/lib/libiconv.2.dylib
/opt/homebrew/Cellar/libiconv/1.17/lib/libiconv.dylib
/opt/homebrew/Cellar/libiconv/1.17/lib/libiconv.a
❯ nm $(brew --prefix libiconv)/lib/libiconv.a | grep iconv
iconv.o:
0000000000100d08 D __libiconv_version
00000000000020d4 T _iconv_canonicalize
00000000000018d4 T _libiconv
00000000000018f8 T _libiconv_close
0000000000000788 T _libiconv_open
0000000000001910 T _libiconv_open_into
0000000000001d24 T _libiconvctl
0000000000001e58 T _libiconvlist
00000000000000c8 T _libiconv_relocate
00000000000001ac T _libiconv_relocate2
0000000000000000 T _libiconv_set_relocation_prefix

Any hint is welcome.

Thanks, Mike

Enable ignore option on message 'The host certificate doesn't have CRL distribution points'

Describe the Bug

When connecting to the host via a TN3270S connection, I get the error: "Can't verify. The host certificate doesn't have CRL distribution points". The connection proceeds but without security.

Screenshot_20201015_091955

Previous pw3270 versions (I do not know the exact release as I've not been using pw3270 for some time) did connect securely.
Is it really needed to enforce this kind of verification? The IBM RedBook "Implementing PKI Services on z/OS" lists this extension as "not critical".

Expected Behavior

I would like to be able to connect securely, maybe by instructing pw3270 to ignore the CDP and use the certificate anyway.

System

  • OpenSUSE Tumbleweed 20201007
  • pw3270 5.3-1.3 x86_64

Export PA1,2,3 on action table.

The "PA" actions should be exported on action table allowing users to change/view the associated keyboard accelerators.

Related to pw3270 issue 8

Support for IND$FILE on z/VM-CMS

The Problem

A clear and concise description of what the problem is, E.g. I'm always frustrated when [...]

The Solution

A clear and concise description of what you want to happen.

The Alternatives

A clear and concise description of any alternative solutions or features you've considered.

Build instructions for macOS fail

Following the build instructions for macOS fails on Big Sur and Monterey (at least).

The initial problem in autogen.sh is that libtoolize needs to be glibtoolize to use the Homebrew-installed version.

Once that is fixed, the build fails in the autoconf stage with configure: error: libssl not present.

Segfault when application is closed while connecting

Lib3270 segfaults when the application is closed while connecting. The lib3270 cleanup procedure should wait for background thread.

#0 0x00007f2f6097ff7a in net_disconnect (hSession=0x555d59937810) at src/core/telnet.c:492 #1 0x00007f2f6098bb84 in host_disconnect (hSession=<optimized out>, hSession@entry=0x555d59937810, failed=failed@entry=0) at src/core/host.c:126 #2 0x00007f2f6098bc27 in lib3270_disconnect (h=h@entry=0x555d59937810) at src/core/host.c:108 #3 0x00007f2f6099d6c7 in net_reconnect (hSession=0x555d59937810, seconds=<optimized out>) at src/core/linux/connect.c:295 #4 0x00007f2f60bdead8 in () at /usr/lib64/libv3270.so.5.4 #5 0x00007f2f60e73e47 in () at /usr/lib64/libglib-2.0.so.0 #6 0x00007f2f60e77464 in g_main_context_dispatch () at /usr/lib64/libglib-2.0.so.0 #7 0x00007f2f60e77800 in () at /usr/lib64/libglib-2.0.so.0 #8 0x00007f2f60e7788c in g_main_context_iteration () at /usr/lib64/libglib-2.0.so.0 #9 0x00007f2f6168484d in g_application_run () at /usr/lib64/libgio-2.0.so.0 #10 0x0000555d58d57bd8 in main (argc=1, argv=0x7ffefb791998) at src/main/main.c:115

Connection loop with an invalid server address

If there is an invalid server address in the session file (in this case, "localhost:9023"), pw3270 shows a connection error, but loops trying to connect to it. There is no way to cancel or change the current session settings (all options are disabled in the dialog).

image
image

The application should either stop trying to connect to the invalid address after the first error, or allow the operation to be canceled.

Connection loop with an invalid server address

Describe the Bug

If there is an invalid server address in the session file (in this case, "localhost:9023"), pw3270 shows a connection error, but loops trying to connect to it. There is no way to cancel or change the current session settings (all options are disabled in the dialog).

image
image

Expected Behavior

The application should either stop trying to connect to the invalid address after the first error, or allow the operation to be canceled.

System

  • openSUSE Leap 15.2
  • PW3270 5.4+git20210406.x86_64

autogen.sh fails on MacOS Apple Silicon

I did run autoupdate, and gettext is installed, and I have done brew unlink gettext && brew link gettext --force.

open-keg>adam@m1-wired:~/git/lib3270$ uname -a
Darwin m1-wired.fsf.net 21.6.0 Darwin Kernel Version 21.6.0: Mon Aug 22 20:20:05 PDT 2022; root:xnu-8020.140.49~2/RELEASE_ARM64_T8101 arm64

Libintl is clearly installed:

open-keg>adam@m1-wired:~/git/lib3270$ find /opt -name libintl\* -print 2>/dev/null
/opt/homebrew/include/libintl.h
/opt/homebrew/lib/libintl.dylib
/opt/homebrew/lib/libintl.8.dylib
/opt/homebrew/lib/libintl.a
/opt/homebrew/Cellar/emscripten/3.1.22/libexec/system/lib/libc/musl/include/libintl.h
/opt/homebrew/Cellar/gettext/0.21/include/libintl.h
/opt/homebrew/Cellar/gettext/0.21/lib/libintl.dylib
/opt/homebrew/Cellar/gettext/0.21/lib/libintl.8.dylib
/opt/homebrew/Cellar/gettext/0.21/lib/libintl.a

But here's the output from autogen.

open-keg>adam@m1-wired:~/git/lib3270$ ./autogen.sh --prefix="$(brew --cellar)/lib3270/5.4"
glibtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'scripts'.
glibtoolize: linking file 'scripts/ltmain.sh'
glibtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
glibtoolize: linking file 'm4/libtool.m4'
glibtoolize: linking file 'm4/ltoptions.m4'
glibtoolize: linking file 'm4/ltsugar.m4'
glibtoolize: linking file 'm4/ltversion.m4'
glibtoolize: linking file 'm4/lt~obsolete.m4'
glibtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am.
configure.ac:54: warning: The macro `AC_TRY_LINK' is obsolete.
configure.ac:54: You should run autoupdate.
./lib/autoconf/general.m4:2920: AC_TRY_LINK is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
./lib/autoconf/general.m4:2270: AC_CACHE_CHECK is expanded from...
m4/iconv.m4:22: AM_ICONV_LINK is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:54: the top level
configure.ac:54: warning: The macro `AC_TRY_COMPILE' is obsolete.
configure.ac:54: You should run autoupdate.
./lib/autoconf/general.m4:2847: AC_TRY_COMPILE is expanded from...
lib/m4sugar/m4sh.m4:692: _AS_IF_ELSE is expanded from...
lib/m4sugar/m4sh.m4:699: AS_IF is expanded from...
./lib/autoconf/general.m4:2249: AC_CACHE_VAL is expanded from...
m4/iconv.m4:77: AM_ICONV is expanded from...
configure.ac:54: the top level
checking build system type... aarch64-apple-darwin21.6.0
checking host system type... aarch64-apple-darwin21.6.0
checking how to print strings... printf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking whether gcc understands -c and -o together... yes
checking for a sed that does not truncate output... /opt/homebrew/bin/gsed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by gcc... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 786432
checking how to convert aarch64-apple-darwin21.6.0 file names to aarch64-apple-darwin21.6.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin21.6.0 file names to toolchain format... func_convert_file_noop
checking for /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld option to reload object files... -r
checking for file... file
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... no
checking for strip... strip
checking for ranlib... ranlib
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... no
checking if : is a manifest tool... no
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for lipo... lipo
checking for otool... otool
checking for otool64... no
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking for -force_load linker flag... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... yes
checking for gcc option to produce PIC... -fno-common -DPIC
checking if gcc PIC flag -fno-common -DPIC works... yes
checking if gcc static flag -static works... no
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin21.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a BSD-compatible install... /opt/homebrew/bin/ginstall -c
checking whether build environment is sane... yes
checking for a race-free mkdir -p... /opt/homebrew/bin/gmkdir -p
checking whether make sets $(MAKE)... yes
checking whether make supports the include directive... yes (GNU style)
checking whether make supports nested variables... yes
checking dependency style of gcc... none
checking for ld used by GCC... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking for shared library run path origin... done
checking for iconv... yes
checking how to link with libiconv... -liconv
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for gcc... (cached) gcc
checking whether the compiler supports GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to enable C11 features... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld
checking if the linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking for g++ option to produce PIC... -fno-common -DPIC
checking if g++ PIC flag -fno-common -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin21.6.0 dyld
checking how to hardcode library paths into programs... immediate
checking dependency style of g++... none
checking for a sed that does not truncate output... (cached) /opt/homebrew/bin/gsed
checking whether ln -s works... yes
checking for ar... /usr/bin/ar
checking for dlltool... no
checking for strip... /usr/bin/strip
checking for ar... (cached) /usr/bin/ar
checking for windres... no
checking for pkg-config... /opt/homebrew/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for xgettext... /opt/homebrew/bin/xgettext
checking for msgcat... /opt/homebrew/bin/msgcat
checking for msginit... /opt/homebrew/bin/msginit
checking for msgmerge... /opt/homebrew/bin/msgmerge
checking for msgfmt... /opt/homebrew/bin/msgfmt
checking for valgrind... no
checking for rsvg-convert... /opt/homebrew/bin/rsvg-convert
checking for convert... /opt/homebrew/bin/convert
checking for optipng... no
checking for libintl.h... no
configure: error: Can't find required file libintl.h

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.