Use openpty for cross-platform pty setup and improve startup errors
This commit is contained in:
parent
1cd0da319c
commit
2459c4559d
3 changed files with 59 additions and 37 deletions
7
Makefile
7
Makefile
|
|
@ -5,10 +5,15 @@ PREFIX ?= /usr/local
|
|||
BINDIR = $(PREFIX)/bin
|
||||
MANDIR ?= $(PREFIX)/share/man
|
||||
|
||||
# openpty(3) lives in libutil on the BSDs, but in libc on Linux and macOS
|
||||
# (and in musl). Resolve it in the shell so this Makefile works with both
|
||||
# GNU make and BSD make.
|
||||
PTY_LIB_SH = uname -s | grep -Eq 'BSD|DragonFly' && echo -lutil
|
||||
|
||||
all: murx
|
||||
|
||||
murx: murx.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ murx.c $(LDLIBS)
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ murx.c $(LDLIBS) `$(PTY_LIB_SH)`
|
||||
|
||||
install: murx murx.1
|
||||
install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(MANDIR)/man1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue