Open johnsonjh opened 1 month ago
@ams
About AIX, XCurses (Extended Curses, in AIX 7 base) does work, and can be built as follows with this PR applied and including "curses.h" instead of "ncurses.h" in supdup.c:
$ env CC="gcc-12" gmake NCURSES_LIBS="-lxcurses" EXTRA_LDFLAGS=" "
gcc-12 -D_ALL_SOURCE -I/opt/freeware/include -g -Wall -c -o supdup.o supdup.c
gcc-12 -D_ALL_SOURCE -I/opt/freeware/include -g -Wall -c -o charmap.o charmap.c
gcc-12 -D_ALL_SOURCE -I/opt/freeware/include -g -Wall -c -o tcp.o tcp.c
gcc-12 -D_ALL_SOURCE -I/opt/freeware/include -g -Wall -c -o chaos.o chaos.c
gcc-12 -g -o supdup supdup.o charmap.o tcp.o chaos.o -lxcurses
To answer your earlier question about why libcurses is required when using ncurses:
jhj@force ~/src/supdup $ env CC="gcc-12" gmake EXTRA_LDFLAGS=" "
gcc-12 -D_ALL_SOURCE -I/opt/freeware/include -g -Wall -c -o supdup.o supdup.c
gcc-12 -D_ALL_SOURCE -I/opt/freeware/include -g -Wall -c -o charmap.o charmap.c
gcc-12 -D_ALL_SOURCE -I/opt/freeware/include -g -Wall -c -o tcp.o tcp.c
gcc-12 -D_ALL_SOURCE -I/opt/freeware/include -g -Wall -c -o chaos.o chaos.c
gcc-12 -g -o supdup supdup.o charmap.o tcp.o chaos.o -L/opt/freeware/lib64 -lncurses
ld: 0711-317 ERROR: Undefined symbol: cur_term
ld: 0711-317 ERROR: Undefined symbol: .tputs
ld: 0711-317 ERROR: Undefined symbol: .setupterm
ld: 0711-317 ERROR: Undefined symbol: .tparm
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
collect2: error: ld returned 8 exit status
gmake: *** [GNUmakefile:44: supdup] Error 1
I still think we should require ncurses on AIX. We use ncurses on every other platform, and ncurses is usually integrated with pkg-config so it's easier to get the proper cflags and ldflags automatically.
Adding more complexity in the makefile to avoid requiring ncurses to be installed on AIX isn't a great tradeoff since ncurses is packaged by IBM, and if it's installed, everything works on AIX with a simple "gmake". If ncurses isn't installed, the error is also obvious.
Everything is also working with IBM's proprietary compilers in the latest commit, both 32- and 64-bit:
I've actually tested both V16 (XL) and V17 (Open XL) successfully.
Also, I'm going to drop defaulting -g -Wall
. If users want that they can easily adjust the CFLAGS, and it will unbreak building with proprietary compilers like Oracle Studio and IBM XL C, that don't use GNU compatible command invocations.
Squashing.
[Moved to GitHub Issue #39.]
pkg-config
when available to determine CFLAGS and libraries.supdupd
.supdup
.README.md
.*.ln
(Lint) files,supdupd
, andcompile_commands.json
to.gitignore
..gitattributes
.[]()
Tested build under Oracle Solaris, OpenIndiana illumos, Linux/musl, Linux/glibc, IBM AIX, IBM OS/400 (PASE), Haiku, FreeBSD, OpenBSD, NetBSD, Cygwin, and Apple macOS.
Compilation tested and working with PCC, GCC, Clang, Xcode, IBM XL C, IBM Open XL C, Oracle Studio C, NVIDIA HPC SDK C, Portland Group C, and DMD ImportC.
Passes Cppcheck and Clang Analyzer. []()
[]()
Signed-off-by: Jeffrey H. Johnson \trnsz@pobox.com\