From: Frederick Bruckman Date: Sat, 9 Aug 2003 11:13:01 +0000 (-0500) Subject: Do "readline" on NetBSD. X-Git-Tag: NTP_4_2_0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a73c1eced8786dfa3b68cc299a54253c1fb34b9;p=thirdparty%2Fntp.git Do "readline" on NetBSD. bk: 3f34d73dTm4GfTMtwj4T3tIBNn2e7Q --- diff --git a/configure.in b/configure.in index 7b7eccd9d3..447ab79648 100644 --- a/configure.in +++ b/configure.in @@ -220,8 +220,13 @@ case "$ac_cv_header_readline_history_h$ac_cv_header_readline_readline_h" in AC_CHECK_LIB(readline, readline, LIBS="-lreadline -lcurses $LIBS" AC_DEFINE(HAVE_LIBREADLINE) - AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]) - , , -lcurses)) + AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]), + AC_CHECK_LIB(edit, readline, + LIBS="-ledit -lcurses" + AC_DEFINE(HAVE_LIBEDIT, , [Do we have the edit library?]) + AC_DEFINE(HAVE_LIBCURSES, , [Do we have the curses library?]) + , , -lcurses) + , -lcurses)) READLINE_LIBS=$LIBS AC_SUBST(READLINE_LIBS) LIBS=$save_LIBS diff --git a/ntpdc/ntpdc.c b/ntpdc/ntpdc.c index 294b88da2d..a3dac40770 100644 --- a/ntpdc/ntpdc.c +++ b/ntpdc/ntpdc.c @@ -24,10 +24,10 @@ # define closesocket close #endif /* SYS_WINNT */ -#ifdef HAVE_LIBREADLINE +#if defined(HAVE_LIBREADLINE) || defined (HAVE_LIBEDIT) # include # include -#endif /* HAVE_LIBREADLINE */ +#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ @@ -1042,7 +1042,7 @@ again: static void getcmds(void) { -#ifdef HAVE_LIBREADLINE +#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT) char *line; for (;;) { @@ -1051,7 +1051,7 @@ getcmds(void) docmd(line); free(line); } -#else /* not HAVE_LIBREADLINE */ +#else /* not (HAVE_LIBREADLINE || HAVE_LIBEDIT) */ char line[MAXLINE]; for (;;) { @@ -1068,7 +1068,7 @@ getcmds(void) docmd(line); } -#endif /* not HAVE_LIBREADLINE */ +#endif /* not HAVE_LIBREADLINE || HAVE_LIBEDIT */ } diff --git a/ntpq/ntpq.c b/ntpq/ntpq.c index e45a4af748..62c2717dc1 100644 --- a/ntpq/ntpq.c +++ b/ntpq/ntpq.c @@ -27,10 +27,10 @@ #define closesocket close #endif /* SYS_WINNT */ -#ifdef HAVE_LIBREADLINE +#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT) # include # include -#endif /* HAVE_LIBREADLINE */ +#endif /* HAVE_LIBREADLINE || HAVE_LIBEDIT */ #ifdef SYS_VXWORKS /* vxWorks needs mode flag -casey*/ @@ -1324,7 +1324,7 @@ doquery( static void getcmds(void) { -#ifdef HAVE_LIBREADLINE +#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT) char *line; for (;;) { @@ -1333,7 +1333,7 @@ getcmds(void) docmd(line); free(line); } -#else /* not HAVE_LIBREADLINE */ +#else /* not (HAVE_LIBREADLINE || HAVE_LIBEDIT) */ char line[MAXLINE]; for (;;) { @@ -1350,7 +1350,7 @@ getcmds(void) docmd(line); } -#endif /* not HAVE_LIBREADLINE */ +#endif /* not (HAVE_LIBREADLINE || HAVE_LIBEDIT) */ } #ifndef SYS_WINNT /* Under NT cannot handle SIGINT, WIN32 spawns a handler */