Open larsbrinkhoff opened 1 month ago
Depending on the way nurses was compiled, linking libtinfo may be necessary. If you use pkg-config
to get the libraries to link, it does usually include tinfo:
$ pkg-config --libs ncurses
-lncurses -ltinfo
$ pkg-config --libs ncursesw
-lncursesw -ltinfo
Instead of using -lncurses
you could do something like:
diff --git a/Makefile b/Makefile
index a2941f5..6d17b53 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,13 @@
# Makefile for the supdup server and client.
+SHELL = /bin/sh
PREFIX ?= /usr/local
OS_NAME = $(shell uname)
ifeq ($(OS_NAME), Darwin)
OS = OSX
endif
CC = cc
CFLAGS = -g -Wall
LDFLAGS = -g
@@ -14,21 +15,21 @@ LDFLAGS = -g
# Mac OSX
ifeq ($(OS), OSX)
LDFLAGS = -L/opt/local/lib
endif
# The server isn't ready for prime time.
all: supdup
SUPDUP_OBJS = supdup.o charmap.o tcp.o chaos.o
supdup: $(SUPDUP_OBJS)
- $(CC) $(LDFLAGS) -o $@ $(SUPDUP_OBJS) -lncurses
+ $(CC) $(LDFLAGS) -o $@ $(SUPDUP_OBJS) $(shell pkg-config --libs ncurses 2> /dev/null || echo '-lncurses')
SUPDUPD_OBJS = supdupd.o
supdupd: $(SUPDUPD_OBJS)
$(CC) $(LDFLAGS) -o $@ $(SUPDUPD_OBJS)
install: supdup
install -m 0755 supdup $(PREFIX)/bin
test -x supdupd && install -m 0755 supdupd $(PREFIX)/bin
clean:
This is GNU syntax, but that should be fine, as the Makefile doesn't work under bmake
currently anyway.
I made a PR at https://github.com/PDP-10/supdup/pull/36
Linux/musl, NetBSD, OpenBSD, AIX, and Haiku now work; they didn't before.
I cannot explain why things changed, but historically -lcurses
also needs -ltinfo
for various stupid reasons to just be sure -- sometimes even -ltermcap
. It has always been a hit and miss.
@ams and @drforbin, please continue discussion here. I'm curious why -ltinfo would be needed now, when it was not the case before. Please elaborate.
See also: https://github.com/PDP-10/its/issues/2322