Skip to content
Snippets Groups Projects
Commit 3b4931c0 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Added termcap and ncurses detection.

parent 088ff280
No related branches found
No related tags found
No related merge requests found
......@@ -9,7 +9,8 @@ PROGRAMS= ud
LDAP_INCDIR= ../../include
LDAP_LIBDIR= ../../libraries
XLIBS = $(LIBTERMCAP)
XDEFS = $(TERMCAP_DEFS)
XLIBS = $(TERMCAP_LIBS)
ud : version.o
$(CC) $(LDFLAGS) -o $@ version.o $(OBJS) $(LIBS)
......
This diff is collapsed.
......@@ -452,8 +452,36 @@ dnl AC_DEFINE(HAVE_TCPD)
fi
# ud needs termcap (should insert check here)
LIBTERMCAP="-ltermcap"
AC_SUBST(LIBTERMCAP)
ol_link_termcap=no
TERMCAP_DEFS=
TERMCAP_LIBS=
AC_CHECK_HEADERS(termcap.h ncurses.h)
if test $ol_link_termcap = no ; then
AC_CHECK_LIB(termcap, tputs, [have_termcap=yes], [have_termcap=no])
if test $have_termcap = yes ; then
ol_link_termcap=yes
TERMCAP_LIBS=-ltermcap
fi
fi
if test $ol_link_termcap = no ; then
AC_CHECK_LIB(ncurses, initscr, [have_ncurses=yes], [have_ncurses=no])
if test $have_ncurses = yes ; then
ol_link_termcap=yes
TERMCAP_LIBS=-lncurses
fi
fi
if test $ol_link_termcap = no ; then
TERMCAP_DEFS="-DNOTERMCAP"
TERMCAP_LIBS=
fi
AC_SUBST(TERMCAP_DEFS)
AC_SUBST(TERMCAP_LIBS)
# FreeBSD (and others) have crypt(3) in -lcrypt
if test $ol_enable_crypt != no ; then
......
......@@ -145,6 +145,9 @@
/* Define if you have the <malloc.h> header file. */
#undef HAVE_MALLOC_H
/* Define if you have the <ncurses.h> header file. */
#undef HAVE_NCURSES_H
/* Define if you have the <ndbm.h> header file. */
#undef HAVE_NDBM_H
......@@ -181,6 +184,9 @@
/* Define if you have the <syslog.h> header file. */
#undef HAVE_SYSLOG_H
/* Define if you have the <termcap.h> header file. */
#undef HAVE_TERMCAP_H
/* Define if you have the <termio.h> header file. */
#undef HAVE_TERMIO_H
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment