PerryWerneck/lib3270

Error building on Apple Sillicon

mgrossmann opened this issue · 7 comments

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

Seens like something wrong with iconv detection. Can you try using the ci-build.sh on branch develop (it's a work in progress, but, it will be easier to me fix on it)...

`
git checkout develop

./mac/ci-build.sh
`

Just updated ci-build.sh to set iconv path from brew.

The fix for #33 is missing in mac/ci-build.sh:

❯ mac/ci-build.sh
/opt/homebrew/opt/curl/lib/pkgconfig:/opt/homebrew/opt/openssl@3/lib/pkgconfig
zlib                  zlib - zlib compression library
gio-unix-2.0          GIO unix specific APIs - unix specific headers for glib I/O library
cairo-xcb             cairo-xcb - XCB surface backend for cairo graphics library
applewmproto          AppleWMProto - AppleWM extension headers
gio-2.0               GIO - glib I/O library
xf86dgaproto          XF86DGAProto - XF86DGA extension headers
xcb-composite         XCB Composite - XCB Composite Extension
cairo-gobject         cairo-gobject - gobject functions for cairo graphics library
cairo-quartz-font     cairo-quartz-font - Quartz font backend for cairo graphics library
harfbuzz-icu          harfbuzz-icu - HarfBuzz text shaping library ICU integration
libpng16              libpng - Loads and saves PNG files
randrproto            RandrProto - Randr extension headers
cairo-ps              cairo-ps - PostScript surface backend for cairo graphics library
xcb-xevie             XCB Xevie - XCB Xevie Extension
gmodule-2.0           GModule - Dynamic module loader for GLib
glib-2.0              GLib - C Utility Library
xdmcp                 Xdmcp - X Display Manager Control Protocol library
dmxproto              DMXProto - DMX extension headers
termkey               termkey - Abstract terminal key input library
xau                   Xau - X authorization file management library
fontsproto            FontsProto - Fonts extension headers
xcb-damage            XCB Damage - XCB Damage Extension
gmpxx                 GNU MP C++ - GNU Multiple Precision Arithmetic Library (C++ bindings)
libpcre2-16           libpcre2-16 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support
python-3.11           Python - Build a C extension for Python
xcb-xvmc              XCB XvMC - XCB XvMC Extension
libturbojpeg          libturbojpeg - A SIMD-accelerated JPEG codec that provides the TurboJPEG API
libevent_core         libevent_core - libevent_core
xcb-ge                XCB GenericEvent - XCB GenericEvent Extension
libedit               libedit - command line editor library provides generic line editing, history, and tokenization functions.
presentproto          PresentProto - Present extension headers
uuid                  uuid - Universally unique id library
glproto               GLProto - GL extension headers
libuv                 libuv - multi-platform support library with a focus on asynchronous I/O.
libevent_pthreads     libevent_pthreads - libevent_pthreads adds pthreads-based threading support to libevent
libexslt              libexslt - EXSLT Extension library
sdl2                  sdl2 - Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
libffi                libffi - Library supporting Foreign Function Interfaces
gmodule-no-export-2.0 GModule - Dynamic module loader for GLib
libidn2               libidn2 - Library implementing IDNA2008 and TR46
xrender               Xrender - X Render Library
xproto                Xproto - Xproto headers
bigreqsproto          BigReqsProto - BigReqs extension headers
luajit                LuaJIT - Just-in-time compiler for Lua
liblzma               liblzma - General purpose data compression library
xext                  Xext - Misc X Extension Library
xcb                   XCB - X-protocol C Binding
libssh2               libssh2 - Library for SSH-based communication
libluv                libluv - Bare and full libuv bindings for Lua/LuaJIT.
libzstd               zstd - fast lossless compression algorithm library
xcb-xtest             XCB XTEST - XCB XTEST Extension
videoproto            VideoProto - Video extension headers
xcb-record            XCB Record - XCB Record Extension
libiodbc              iODBC - iODBC Driver Manager
xcb-randr             XCB RandR - XCB RandR Extension
renderproto           RenderProto - Render extension headers
lcms2                 lcms2 - LCMS Color Management Library
xcb-present           XCB Present - XCB Present Extension
libcares              c-ares - asynchronous DNS lookup library
libssl                OpenSSL-libssl - Secure Sockets Layer and cryptography libraries
yaml-0.1              LibYAML - Library to parse and emit YAML
librtmp               librtmp - RTMP implementation
libbrotlidec          libbrotlidec - Brotli decoder library
libgit2               libgit2 - The git library, take 2
libpcre2-32           libpcre2-32 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support
apr-util-1            APR Utils - Companion library for APR
libevent              libevent - libevent is an asynchronous notification event loop library
openssl               OpenSSL - Secure Sockets Layer and cryptography libraries and tools
libxml-2.0            libXML - libXML library version2.
odbc                  odbc (unixODBC) - unixODBC Driver Manager library
libevent_openssl      libevent_openssl - libevent_openssl adds openssl-based TLS support to libevent
xcb-sync              XCB Sync - XCB Sync Extension
cairo-pdf             cairo-pdf - PDF surface backend for cairo graphics library
libutf8proc           libutf8proc - UTF8 processing
ncurses               ncurses - ncurses 5.7 library
fixesproto            FixesProto - X Fixes extension headers
expat                 expat - expat XML parser
xcb-xv                XCB Xv - XCB Xv Extension
xcb-shm               XCB Shm - XCB Shm Extension
x11-xcb               X11 XCB - X Library XCB interface
xcb-xprint            XCB Xprint - XCB Xprint Extension
xcb-shape             XCB Shape - XCB Shape Extension
SDL_net               SDL_net - net library for Simple DirectMedia Layer
graphite2             Graphite2 - Font rendering engine for Complex Scripts
apr-1                 APR - The Apache Portable Runtime library
xwaylandproto         XwaylandProto - Xwayland extension headers
vorbisfile            vorbisfile - vorbisfile is a library that provides a convenient high-level API for decoding and basic manipulation of all Vorbis I audio streams
libbrotlicommon       libbrotlicommon - Brotli common dictionary library
damageproto           DamageProto - Damage extension headers
xcb-xkb               XCB XKB - XCB Keyboard Extension (EXPERIMENTAL)
dri3proto             DRI3Proto - DRI3 extension headers
libjpeg               libjpeg - A SIMD-accelerated JPEG codec that provides the libjpeg API
gmodule-export-2.0    GModule - Dynamic module loader for GLib
x11                   X11 - X Library
cairo-xlib            cairo-xlib - Xlib surface backend for cairo graphics library
libntlm               Libntlm - Library for NTLM authentication
sqlite3               SQLite - SQL database engine
kbproto               KBProto - KB extension headers
xcb-xinput            XCB XInput - XCB XInput Extension (EXPERIMENTAL)
xcb-dri2              XCB DRI2 - XCB DRI2 Extension
vterm                 vterm - Abstract VT220/Xterm/ECMA-48 emulation library
xcb-dri3              XCB DRI3 - XCB DRI3 Extension
pixman-1              Pixman - The pixman library (version 1)
odbcinst              odbcinst (unixODBC) - unixODBC Configuration Library
cairo-xcb-shm         cairo-xcb-shm - XCB/SHM functions for cairo graphics library
tree-sitter           tree-sitter - An incremental parsing system for programming tools
cairo-quartz-image    cairo-quartz-image - Quartz Image surface backend for cairo graphics library
xcb-xselinux          XCB SELinux - XCB SELinux Extension
libpcre2-8            libpcre2-8 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support
harfbuzz-cairo        harfbuzz-cairo - HarfBuzz cairo support
xf86driproto          XF86DRIProto - XF86DRI extension headers
xcb-xinerama          XCB Xinerama - XCB Xinerama Extension
python-3.11-embed     Python - Embed Python into an application
compositeproto        CompositeExt - Composite extension headers
dri2proto             DRI2Proto - DRI2 extension headers
inputproto            InputProto - Input extension headers
xextproto             XExtProto - XExt extension headers
odbccr                odbccr (unixODBC) - unixODBC Cursor Library
libtiff-4             libtiff - Tag Image File Format (TIFF) library.
gobject-2.0           GObject - GLib Type, Object, Parameter and Signal Library
vorbisenc             vorbisenc - vorbisenc is a library that provides a convenient API for setting up an encoding environment using libvorbis
resourceproto         ResourceProto - Resource extension headers
gthread-2.0           GThread - Thread support for GLib
xcb-dpms              XCB DPMS - XCB DPMS Extension
cairo-fc              cairo-fc - Fontconfig font backend for cairo graphics library
libnghttp2            libnghttp2 - HTTP/2 C library
fontconfig            Fontconfig - Font configuration and customization library
libcrypto             OpenSSL-libcrypto - OpenSSL cryptography library
harfbuzz-subset       harfbuzz-subset - HarfBuzz font subsetter
python3               Python - Build a C extension for Python
libpng                libpng - Loads and saves PNG files
libcurl               libcurl - Library to transfer files with ftp, http, etc.
libpcreposix          libpcreposix - PCREPosix - Posix compatible interface to libpcre
liblz4                lz4 - extremely fast lossless compression algorithm library
dpmsproto             DPMSProto - DPMS extension headers
xf86vidmodeproto      XF86VidModeProto - XF86VidMode extension headers
cairo-xlib-xrender    cairo-xlib-xrender - Xlib Xrender surface backend for cairo graphics library
cairo-ft              cairo-ft - FreeType font backend for cairo graphics library
cairo                 cairo - Multi-platform 2D graphics library
cairo-png             cairo-png - PNG functions for cairo graphics library
xcb-res               XCB Res - XCB X-Resource Extension
scrnsaverproto        ScrnSaverProto - ScrnSaver extension headers
sdl                   sdl12_compat - An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
libpcre2-posix        libpcre2-posix - Posix compatible interface to libpcre2-8
xcmiscproto           XCMiscProto - XCMisc extension headers
unibilium             unibilium - terminfo parser and utility functions
python3-embed         Python - Embed Python into an application
ogg                   ogg - ogg is a library for manipulating ogg bitstreams
xf86bigfontproto      XF86BigFontProto - XF86BigFont extension headers
cairo-svg             cairo-svg - SVG surface backend for cairo graphics library
xineramaproto         XineramaProto - Xinerama extension headers
cairo-quartz          cairo-quartz - Quartz surface backend for cairo graphics library
ncursesw              ncursesw - ncurses 5.7 library
vorbis                vorbis - vorbis is the primary Ogg Vorbis library
recordproto           RecordProto - Record extension headers
harfbuzz              harfbuzz - HarfBuzz text shaping library
lzo2                  lzo2 - LZO - a real-time data compression library
xcb-render            XCB Render - XCB Render Extension
libpcre               libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
cairo-script          cairo-script - script surface backend for cairo graphics library
sdl12_compat          sdl12_compat - An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
libbrotlienc          libbrotlienc - Brotli encoder library
msgpack-c             MessagePack - Binary-based efficient object serialization library
freetype2             FreeType 2 - A free, high-quality, and portable font engine.
xcb-xf86dri           XCB XFree86-DRI - XCB XFree86-DRI Extension
cairo-tee             cairo-tee - tee surface backend for cairo graphics library
libevent_extra        libevent_extra - libevent_extra
gmp                   GNU MP - GNU Multiple Precision Arithmetic Library
xcb-xfixes            XCB XFixes - XCB XFixes Extension
xcb-screensaver       XCB Screensaver - XCB Screensaver Extension
oniguruma             oniguruma - Regular expression library
harfbuzz-gobject      harfbuzz-gobject - HarfBuzz text shaping library GObject integration
xcb-glx               XCB GLX - XCB GLX Extension
libxslt               libxslt - XSLT library version 2.
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-darwin22.4.0
checking host system type... aarch64-apple-darwin22.4.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... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/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-darwin22.4.0 file names to aarch64-apple-darwin22.4.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin22.4.0 file names to toolchain format... func_convert_file_noop
checking for /Library/Developer/CommandLineTools/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 (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin22.4.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... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/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++... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Library/Developer/CommandLineTools/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 (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin22.4.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... no
checking for convert... no
checking for optipng... no
checking for libintl.h... no
configure: error: Can't find required file libintl.h

What's the result of the command:

. /configure --with-libiconv-prefix=$(brew --prefix gettext)

Are you running in the standard shell or using other environment like keg? I noticed that your configure are detecting gettext on /opt/homebrew. Here, using a X86 virtual machine they are in /usr/local...

(...)
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for xgettext... /usr/local/bin/xgettext
checking for msgcat... /usr/local/bin/msgcat
checking for msginit... /usr/local/bin/msginit
checking for msgmerge... /usr/local/bin/msgmerge
checking for msgfmt... /usr/local/bin/msgfmt
checking for valgrind... no
checking for rsvg-convert... /usr/local/bin/rsvg-convert
checking for convert... /usr/local/bin/convert
checking for optipng... no
checking for libintl.h... yes
checking for doxygen... /usr/local/bin/doxygen
(...)

The build using github action is detecting in the same path (https://github.com/PerryWerneck/lib3270/actions/runs/4860592730/jobs/8664588306)

Hi Perry,

still no success. I'm using a stock Shell (zsh) in a stock environment. (no keg)
Regarding the HomeBrew prefix. It looks like they switched to /op/homebrew,
thats why $(brew --prefix xxx) is so great.

Regarding the iconv linker error. It looks like there are different labels that the linker
is searching for and which are present in the library. See the nm output in one of my
previous comments.

Best, Mike

❯ ./configure --with-libiconv-prefix=$(brew --prefix gettext)
checking build system type... aarch64-apple-darwin22.4.0
checking host system type... aarch64-apple-darwin22.4.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... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/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-darwin22.4.0 file names to aarch64-apple-darwin22.4.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin22.4.0 file names to toolchain format... func_convert_file_noop
checking for /Library/Developer/CommandLineTools/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 (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin22.4.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... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/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++... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Library/Developer/CommandLineTools/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 (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin22.4.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... no
checking for convert... no
checking for optipng... no
checking for libintl.h... no
configure: error: Can't find required file libintl.h
❯ ./configure --with-libiconv-prefix=$(brew --prefix libiconv) "LDFLAGS=$LDFLAGS -L$(brew --prefix gettext)/lib" "CFLAGS=-I$(brew --prefix gettext)/include"
checking build system type... aarch64-apple-darwin22.4.0
checking host system type... aarch64-apple-darwin22.4.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... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/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-darwin22.4.0 file names to aarch64-apple-darwin22.4.0 format... func_convert_file_noop
checking how to convert aarch64-apple-darwin22.4.0 file names to toolchain format... func_convert_file_noop
checking for /Library/Developer/CommandLineTools/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 (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin22.4.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... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/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++... /Library/Developer/CommandLineTools/usr/bin/ld
checking if the linker (/Library/Developer/CommandLineTools/usr/bin/ld) is GNU ld... no
checking whether the g++ linker (/Library/Developer/CommandLineTools/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 (/Library/Developer/CommandLineTools/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin22.4.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... no
checking for convert... no
checking for optipng... no
checking for libintl.h... yes
checking for doxygen... no
checking for dot... no
checking whether doxygen should use graphviz... no, graphviz missing
checking for GNUC visibility attribute... no
checking whether C compiler accepts -fvisibility=hidden... yes
configure: No default crl url
checking for malloc.h... no
checking for syslog.h... yes
checking for getaddrinfo... yes
checking for vasprintf... yes
checking for strtok_r... yes
checking for localtime_r... yes
checking for inet_ntop... yes
checking for libssl libcrypto... yes
checking for curl-config... /usr/bin/curl-config
configure: Using libcurl 7.87.0
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating locale/Makefile
config.status: creating sdk/lib3270.pc
config.status: creating sdk/lib3270-static.pc
config.status: creating src/include/config.h
config.status: executing libtool commands
config.status: executing depfiles commands
❯ 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

Can you send the Makefile and config.log to my e-mail (perry.werneck@gmail.com)?

Hi, I used the following commands and had no issues building on macos sonoma uname -a: Darwin MacBook-Pro-3 23.2.0 Darwin Kernel Version 23.2.0: Wed Nov 15 21:53:18 PST 2023; root:xnu-10002.61.3~2/RELEASE_ARM64_T6000 arm64

I used the following commands on the current main branch:

./autogen.sh --prefix="$(brew --cellar)/lib3270/5.4" --with-libiconv-prefix=$(brew --prefix gettext) "LDFLAGS=-L$(brew --prefix gettext)/lib" "CFLAGS=-I$(brew --prefix gettext)/include"
make all
make install