]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1478] linking fails with undefined reference EVP_MD_pkey_type.
authorDave Hart <hart@ntp.org>
Mon, 8 Feb 2010 14:11:12 +0000 (14:11 +0000)
committerDave Hart <hart@ntp.org>
Mon, 8 Feb 2010 14:11:12 +0000 (14:11 +0000)
[Bug 1479] Compilation fails because of not finding readline headers.
[Bug 1484] ushort is not defined in QNX6.

bk: 4b701b808fXIxii9pLOj-55cwSWBXA

ChangeLog
include/mbg_gps166.h
libntp/ntp_lineedit.c
m4/ntp_lineeditlibs.m4
ntpd/ntp_control.c

index b6e8ac6efb91f17cacb4be24e3345007b8d14d20..099e24a16d8b674be75878d5d5fda54f61f0b34a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,10 @@
 ---
 
 * [Bug 1477] 1st non-gmake make in clone w/VPATH can't make COPYRIGHT.
+* [Bug 1478] linking fails with undefined reference EVP_MD_pkey_type.
+* [Bug 1479] Compilation fails because of not finding readline headers.
 * [Bug 1480] snprintf() cleanup caused unterminated refclock IDs.
+* [Bug 1484] ushort is not defined in QNX6.
 
 ---
 (4.2.6p1-RC4) 2010/02/04 Released by Harlan Stenn <stenn@ntp.org>
index 2ec2bdd3073b0d7dec76ea5da9a7a4441ffce967..f4b82381087ec8c2bfb25d64080ff79e832c47e0 100644 (file)
@@ -391,7 +391,7 @@ typedef struct {
   l_fp A0;         /*  ± Clock Correction Coefficient 0             [sec] */
   l_fp A1;         /*  ± Clock Correction Coefficient 1         [sec/sec] */
 
-  ushort WNlsf;    /*  week number of nearest leap second                 */
+  u_short WNlsf;   /*  week number of nearest leap second                 */
   short DNt;       /*  the day number at the end of which LS is inserted  */
   char delta_tls;  /*                                                     */
   char delta_tlsf; /*                                                     */
index 9a74c5697cda7a98c378d11528054a01c937b609..339de635d33a8ca882cb057d48dee7eb3db1431a 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 
+#if defined(HAVE_READLINE_HISTORY) &&          \
+    (!defined(HAVE_READLINE_HISTORY_H) ||      \
+     !defined(HAVE_READLINE_READLINE_H))
+# undef HAVE_READLINE_HISTORY
+#endif
 #if defined(HAVE_READLINE_HISTORY)
 # include <readline/readline.h>
 # include <readline/history.h>
-#else 
-# if defined(HAVE_HISTEDIT_H)
-#  include <histedit.h>
-# endif
+# define LE_READLINE
+#elif defined(HAVE_HISTEDIT_H)
+# include <histedit.h>
+# define LE_EDITLINE
+#else
+# define LE_NONE
 #endif
 
 #include "ntp.h"
@@ -39,15 +46,13 @@ static int  ntp_readline_initted;
 static char *  lineedit_prompt;
 
 
-#if !defined(HAVE_READLINE_HISTORY) && defined(HAVE_HISTEDIT_H)
-
+#ifdef LE_EDITLINE
        static EditLine *       ntp_el;
        static History *        ntp_hist;
        static HistEvent        hev;
 
        char *  ntp_prompt_callback(EditLine *);
-
-#endif /* !HAVE_READLINE_HISTORY_H && HAVE_HISTEDIT_H */
+#endif /* LE_EDITLINE */
 
 
 /*
@@ -68,8 +73,7 @@ ntp_readline_init(
                lineedit_prompt = estrdup(prompt);
        }
 
-#if !defined(HAVE_READLINE_HISTORY) && defined(HAVE_HISTEDIT_H)
-
+#ifdef LE_EDITLINE
        if (NULL == ntp_el) {
 
                ntp_el = el_init(progname, stdin, stdout, stderr);
@@ -104,8 +108,7 @@ ntp_readline_init(
                } else
                        success = 0;
        }
-
-#endif /* !HAVE_READLINE_HISTORY && HAVE_HISTEDIT_H */
+#endif /* LE_EDITLINE */
 
        ntp_readline_initted = success;
 
@@ -121,8 +124,7 @@ ntp_readline_uninit(
        void
        )
 {
-#if !defined(HAVE_READLINE_HISTORY) && defined(HAVE_HISTEDIT_H)
-
+#ifdef LE_EDITLINE
        if (ntp_el) {
                el_end(ntp_el);
                ntp_el = NULL;
@@ -130,8 +132,7 @@ ntp_readline_uninit(
                history_end(ntp_hist);
                ntp_hist = NULL;
        }
-
-#endif /* !HAVE_READLINE_HISTORY && HAVE_HISTEDIT_H */
+#endif /* LE_EDITLINE */
 
        if (lineedit_prompt) {
                free(lineedit_prompt);
@@ -153,21 +154,20 @@ ntp_readline(
        int *   pcount
        )
 {
-#if !defined(HAVE_READLINE_HISTORY) && !defined(HAVE_HISTEDIT_H)
-       char line_buf[MAXEDITLINE];
+       char *          line;
+#ifdef LE_NONE
+       char            line_buf[MAXEDITLINE];
 #endif
-#if !defined(HAVE_READLINE_HISTORY) && defined(HAVE_HISTEDIT_H)
+#ifdef LE_EDITLINE
        const char *    cline;
 #endif
-       char *          line;
 
        if (!ntp_readline_initted)
                return NULL;
 
        *pcount = 0;
 
-#if defined(HAVE_READLINE_HISTORY)
-
+#ifdef LE_READLINE
        line = readline(lineedit_prompt ? lineedit_prompt : "");
        if (NULL != line) {
                if (*line) {
@@ -178,11 +178,9 @@ ntp_readline(
                        line = NULL;
                }
        }
+#endif /* LE_READLINE */
 
-#endif /* HAVE_READLINE_HISTORY */
-
-#if !defined(HAVE_READLINE_HISTORY) && defined(HAVE_HISTEDIT_H)
-
+#ifdef LE_EDITLINE
        cline = el_gets(ntp_el, pcount);
 
        if (NULL != cline && *cline) {
@@ -191,10 +189,9 @@ ntp_readline(
                line = estrdup(cline);
        } else
                line = NULL;
+#endif /* LE_EDITLINE */
 
-#endif /* !HAVE_READLINE_HISTORY && HAVE_HISTEDIT_H */
-
-#if !defined(HAVE_READLINE_HISTORY) && !defined(HAVE_HISTEDIT_H)
+#ifdef LE_NONE
                                        /* stone hammers */
        if (lineedit_prompt) {
 # ifdef VMS
@@ -216,7 +213,7 @@ ntp_readline(
        } else
                line = NULL;
 
-#endif /* !HAVE_READLINE_HISTORY && !HAVE_HISTEDIT_H */
+#endif /* LE_NONE */
 
 
        if (!line)                      /* EOF */
@@ -226,7 +223,7 @@ ntp_readline(
 }
 
 
-#if !defined(HAVE_READLINE_HISTORY) && defined(HAVE_HISTEDIT_H)
+#ifdef LE_EDITLINE
 /*
  * ntp_prompt_callback - return prompt string to el_gets()
  */
@@ -239,5 +236,5 @@ ntp_prompt_callback(
 
        return lineedit_prompt;
 }
-#endif /* !HAVE_READLINE_HISTORY_H && HAVE_HISTEDIT_H */
+#endif /* LE_EDITLINE */
 
index 99c79211e8500e0373a8cc6f62ad63286b1cc991..bca0d8fc8f6ab706ee14a6e567fbca083555e07b 100644 (file)
@@ -75,8 +75,6 @@ AC_DEFUN([NTP_LINEEDITLIBS], [
      no)
        ;;
      *)
-       dnl AC_DEFINE(HAVE_LIBREADLINE, 1,
-        dnl           [Define if you have a readline compatible library])
        AC_CHECK_HEADERS([readline.h readline/readline.h histedit.h])
        AC_CHECK_HEADERS([history.h readline/history.h])
        
index eb3fe440e9666d54b68bb7195f444bc7e4ef2b46..9ab9d1c5e94952957b4b44727efa2029c37b3cbe 100644 (file)
@@ -13,6 +13,7 @@
 #include "ntp_unixtime.h"
 #include "ntp_stdlib.h"
 #include "ntp_config.h"
+#include "ntp_crypto.h"
 #include "ntp_assert.h"
 
 #include <stdio.h>