]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Do "readline" on NetBSD.
authorFrederick Bruckman <bruckman@ntp.org>
Sat, 9 Aug 2003 11:13:01 +0000 (06:13 -0500)
committerFrederick Bruckman <bruckman@ntp.org>
Sat, 9 Aug 2003 11:13:01 +0000 (06:13 -0500)
bk: 3f34d73dTm4GfTMtwj4T3tIBNn2e7Q

configure.in
ntpdc/ntpdc.c
ntpq/ntpq.c

index 7b7eccd9d3096dc84b2a5faf3b5879a519430e16..447ab7964899fa8cfde319734dc79755e34a743c 100644 (file)
@@ -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
index 294b88da2dbcc6b493113f7b260404beaf3033fc..a3dac407702170bd06fb549b5acdf8926190d632 100644 (file)
 # define closesocket close
 #endif /* SYS_WINNT */
 
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) || defined (HAVE_LIBEDIT)
 # include <readline/readline.h>
 # include <readline/history.h>
-#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 */
 }
 
 
index e45a4af74827fd1bebe20f9f9ffd6756fb75a9f6..62c2717dc17c31d8f1388cdfb18b3d1fa0b96bcc 100644 (file)
 #define closesocket close
 #endif /* SYS_WINNT */
 
-#ifdef HAVE_LIBREADLINE
+#if defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDIT)
 # include <readline/readline.h>
 # include <readline/history.h>
-#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 */