PDP-10 / supdup

Community maintained SUPDUP client for Unix
Other
16 stars 8 forks source link

Portability improvements, cleanup, and bug fixes #36

Open johnsonjh opened 1 month ago

johnsonjh commented 1 month ago

[]()

[]()

Signed-off-by: Jeffrey H. Johnson \trnsz@pobox.com\

johnsonjh commented 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:

IMG_1386

I've actually tested both V16 (XL) and V17 (Open XL) successfully.

johnsonjh commented 1 month ago

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.

johnsonjh commented 1 month ago

[Moved to GitHub Issue #39.]