I also faces exactly the same problem when trying to build ntp 4.2.0a+stable-8.
After some investigation, I find the three macros were #undef-ed by a system
header <linux/autoconf.h>.  The inclusion path was:

  ntpd/ntp_config.c -> <sys/param.h> -> <linux/param.h> -> <asm/param.h>
  -> <linux/config.h> -> <linux/autoconf.h>

So, with a quick hack by moving the local source headers down below the
system headers (as demonstrated in the patch below), it appears to compile.

I'm not sure if it's the right thing to do. But this may help a bit.

-Theppitak.

--- ntp-4.2.0a+stable.orig/ntpd/ntp_config.c
+++ ntp-4.2.0a+stable/ntpd/ntp_config.c
@@ -5,21 +5,6 @@
 # include <config.h>
 #endif

-#ifdef HAVE_NETINFO
-# include <netinfo/ni.h>
-#endif
-
-#include <netdb.h>
-
-#include "ntpd.h"
-#include "ntp_io.h"
-#include "ntp_unixtime.h"
-#include "ntp_refclock.h"
-#include "ntp_filegen.h"
-#include "ntp_stdlib.h"
-#include "ntp_config.h"
-#include "ntp_cmdargs.h"
-
 #include <stdio.h>
 #include <ctype.h>
 #ifdef HAVE_SYS_PARAM_H
@@ -40,6 +25,21 @@
 extern HANDLE ResolverThreadHandle;
 #endif /* SYS_WINNT */

+#ifdef HAVE_NETINFO
+# include <netinfo/ni.h>
+#endif
+
+#include <netdb.h>
+
+#include "ntpd.h"
+#include "ntp_io.h"
+#include "ntp_unixtime.h"
+#include "ntp_refclock.h"
+#include "ntp_filegen.h"
+#include "ntp_stdlib.h"
+#include "ntp_config.h"
+#include "ntp_cmdargs.h"
+
 extern int priority_done;

 /*

Reply via email to