Commit 3b4931c0 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Added termcap and ncurses detection.

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