]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 1837] Build fails on Win7 due to regedit requiring privilege.
authorDave Hart <hart@ntp.org>
Wed, 23 Feb 2011 18:57:00 +0000 (18:57 +0000)
committerDave Hart <hart@ntp.org>
Wed, 23 Feb 2011 18:57:00 +0000 (18:57 +0000)
Provide fallback definitions for GetAdaptersAddresses() for Windows
  build environments lacking iphlpapi.h.
Rename file containing 1.xxxx ChangeSet revision from version to
  scm-rev to avoid invoking GNU make implicit rules attempting to
  compile version.c into version.  Problem was with sntp/version.o
  during make distcheck after fix for spurious sntp rebuilds.

bk: 4d65587ckwn64Ly42Oa7la8KQMlNIA

12 files changed:
ChangeLog
lib/isc/win32/interfaceiter.c
ntpd/Makefile.am
ntpdate/Makefile.am
ntpdc/Makefile.am
ntpq/Makefile.am
ports/winnt/include/gaa_compat.h [new file with mode: 0644]
ports/winnt/scripts/mkver.bat
ports/winnt/vs2008/libntp/libntp.vcproj
sntp/Makefile.am
sntp/libevent/test/Makefile.am
util/Makefile.am

index 3e4434d5aa84f340575b327e60953e3447839f10..48779b6becee6ff2e1c5b7b9161fc05c1f05568d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,7 @@
 * [Bug 1834] ntpdate 4.2.7p131 aborts with assertion failure.
+* [Bug 1837] Build fails on Win7 due to regedit requiring privilege.
+* Provide fallback definitions for GetAdaptersAddresses() for Windows
+  build environments lacking iphlpapi.h.
 * Move sntp last in top-level Makefile.am SUBDIRS so that the libevent
   tearoff (if required) and sntp are compiled after the rest.
 * Use a single set of Automake options for each package in configure.ac
@@ -7,6 +10,10 @@
   sntp/version was out-of-date relative to phony target FRC.version.
 * Do not cache paths to perl, test, or pkg-config, searching the PATH
   at configure time is worth it to pick up tool updates.
+* Rename file containing 1.xxxx ChangeSet revision from version to
+  scm-rev to avoid invoking GNU make implicit rules attempting to
+  compile version.c into version.  Problem was with sntp/version.o
+  during make distcheck after fix for spurious sntp rebuilds.
 (4.2.7p132) 2011/02/22 Released by Harlan Stenn <stenn@ntp.org>
 * [Bug 1832] ntpdate doesn't allow timeout > 2s.
 * [Bug 1833] The checking sem_timedwait() fails without -pthread.
index 34c9428bcb5ff7b633e75910798ab58944a20b97..0b2269dd0b55485198ad50bcddf72b52adb76df1 100644 (file)
 /* $Id: interfaceiter.c,v 1.13.110.2 2009/01/18 23:47:41 tbox Exp $ */
 
 #include <config.h>
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <iphlpapi.h>
-#include <sys/types.h>
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
+#include <sys/types.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <gaa_compat.h>
 
 #include <isc/interfaceiter.h>
 #include <isc/mem.h>
index b46c24381e97a7bdbb1283058496306e2d545040..51f6b869899fb0414b542a986001671b4c24d32e 100644 (file)
@@ -267,12 +267,14 @@ check-saveconfig: $(srcdir)/complete.conf compsave.conf
 ../libparse/libparse.a:
        cd ../libparse && $(MAKE) check-libparse
 
-$(top_srcdir)/sntp/version:
-       cd $(top_srcdir)/sntp && $(MAKE) version
+$(top_srcdir)/sntp/scm-rev:
+       cd $(top_srcdir)/sntp && $(MAKE) check-scm-rev
 
-version.o: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/sntp/version
-       env CSET=`cat $(top_srcdir)/sntp/version` $(top_builddir)/scripts/mkver ntpd
-       $(COMPILE) -c version.c
+version.c: $(ntpd_OBJECTS) ../libntp/libntp.a @LIBPARSE@ Makefile $(top_srcdir)/sntp/scm-rev
+       env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/mkver ntpd
+       
+version.o: version.c
+       env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
 
 include $(top_srcdir)/bincheck.mf
 include $(top_srcdir)/check-libopts.mf
index e753b67c422e545a8f6a64f930673729c636bab0..5af5f5d318197127d02f58b19ebc5e3090ef0e1f 100644 (file)
@@ -27,12 +27,14 @@ noinst_HEADERS=     ntpdate.h
 
 $(PROGRAMS): $(LDADD)
 
-$(top_srcdir)/sntp/version:
-       cd $(top_srcdir)/sntp && $(MAKE) version
-
-version.o: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/version
-       env CSET=`cat $(top_srcdir)/sntp/version` $(top_builddir)/scripts/mkver ntpdate
-       $(COMPILE) -c version.c
+$(top_srcdir)/sntp/scm-rev:
+       cd $(top_srcdir)/sntp && $(MAKE) check-scm-rev
+
+version.c: $(ntpdate_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+       env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/mkver ntpdate
+       
+version.o: version.c
+       env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
 
 include $(top_srcdir)/bincheck.mf
 include $(top_srcdir)/sntp/check-libntp.mf
index 2b44054163dad794e1193f53d93792a00a05e3ff..9f2f15c5643871032bd9e2d1fab2fae7973037e5 100644 (file)
@@ -69,12 +69,14 @@ check-layout: ntpdc-layout $(srcdir)/layout.std layout.here
 
 $(PROGRAMS): version.o
 
-$(top_srcdir)/sntp/version:
-       cd $(top_srcdir)/sntp && $(MAKE) version
+$(top_srcdir)/sntp/scm-rev:
+       cd $(top_srcdir)/sntp && $(MAKE) check-scm-rev
 
-version.o: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/version
-       env CSET=`cat $(top_srcdir)/sntp/version` $(top_builddir)/scripts/mkver ntpdc
-       $(COMPILE) -c version.c
+version.c: $(ntpdc_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+       env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/mkver ntpdc
+       
+version.o: version.c
+       env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
 
 # I ran nl_in.c (attached, to be installed into ntpdc) through
 # $(CC) -E nl_in.c | nl.pl > nl.c
index 5d4a78aa64b98dfac54a37077277fe922d95ebde..720457fe4163d0b0b611809f12f4f5d1b7551a2b 100644 (file)
@@ -55,14 +55,16 @@ $(srcdir)/ntpq-opts.texi: $(srcdir)/ntpq-opts.def $(std_def_list)
        $(run_ag) -Taginfo.tpl -DLEVEL=section ntpq-opts.def
        $(top_srcdir)/scripts/check--help $@
 
-$(top_srcdir)/sntp/version:
-       cd $(top_srcdir)/sntp && $(MAKE) version
-
 $(PROGRAMS): version.o
 
-version.o: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/version
-       env CSET=`cat $(top_srcdir)/sntp/version` $(top_builddir)/scripts/mkver ntpq
-       $(COMPILE) -c version.c
+$(top_srcdir)/sntp/scm-rev:
+       cd $(top_srcdir)/sntp && $(MAKE) check-scm-rev
+
+version.c: $(ntpq_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+       env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/mkver ntpq
+       
+version.o: version.c
+       env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
 
 include $(top_srcdir)/bincheck.mf
 include $(top_srcdir)/check-libopts.mf
diff --git a/ports/winnt/include/gaa_compat.h b/ports/winnt/include/gaa_compat.h
new file mode 100644 (file)
index 0000000..13cc9e1
--- /dev/null
@@ -0,0 +1,771 @@
+/*
+ * ports/winnt/include/gaa_compat.h
+ *
+ * This header allows systems without a recent-enough SDK to build NTP
+ * which can use GetAdaptersAddresses(), related functions and macros.
+ */
+#ifndef GAA_COMPAT_H
+#define GAA_COMPAT_H
+
+#ifdef _W64
+# include <iphlpapi.h>
+#else  /* !_W64 follows */
+
+#pragma warning(push)
+/* warning C4201: nonstandard extension used : nameless struct/union */
+#pragma warning(disable:4201)
+/* warning C4214: nonstandard extension used : bit field types other than int */
+#pragma warning(disable:4214)
+
+/* +++++++++++++++++++++++ from nldef.h */
+typedef enum {
+    //
+    // These values are from iptypes.h.
+    // They need to fit in a 4 bit field.
+    //
+    IpPrefixOriginOther = 0,
+    IpPrefixOriginManual,
+    IpPrefixOriginWellKnown,
+    IpPrefixOriginDhcp,
+    IpPrefixOriginRouterAdvertisement,
+    IpPrefixOriginUnchanged = 1 << 4
+} NL_PREFIX_ORIGIN;
+
+typedef enum {
+    //
+    // These values are from in iptypes.h.
+    // They need to fit in a 4 bit field.
+    //
+    IpSuffixOriginOther = 0,
+    IpSuffixOriginManual,
+    IpSuffixOriginWellKnown,
+    IpSuffixOriginDhcp,
+    IpSuffixOriginLinkLayerAddress,
+    IpSuffixOriginRandom,
+    IpSuffixOriginUnchanged = 1 << 4
+} NL_SUFFIX_ORIGIN;
+
+typedef enum {
+    //
+    // These values are from in iptypes.h.
+    //
+    IpDadStateInvalid    = 0,
+    IpDadStateTentative,
+    IpDadStateDuplicate,
+    IpDadStateDeprecated,
+    IpDadStatePreferred,
+} NL_DAD_STATE;
+/* +++++++++++++++++++++++ from nldef.h */
+
+
+/* +++++++++++++++++++++++ from ifdef.h */
+typedef ULONG32 NET_IF_OBJECT_ID, *PNET_IF_OBJECT_ID;
+
+
+typedef enum _NET_IF_ADMIN_STATUS   // ifAdminStatus
+{
+    NET_IF_ADMIN_STATUS_UP = 1,
+    NET_IF_ADMIN_STATUS_DOWN = 2,
+    NET_IF_ADMIN_STATUS_TESTING = 3
+} NET_IF_ADMIN_STATUS, *PNET_IF_ADMIN_STATUS;
+
+typedef enum _NET_IF_OPER_STATUS   // ifOperStatus
+{
+    NET_IF_OPER_STATUS_UP = 1,
+    NET_IF_OPER_STATUS_DOWN = 2,
+    NET_IF_OPER_STATUS_TESTING = 3,
+    NET_IF_OPER_STATUS_UNKNOWN = 4,
+    NET_IF_OPER_STATUS_DORMANT = 5,
+    NET_IF_OPER_STATUS_NOT_PRESENT = 6,
+    NET_IF_OPER_STATUS_LOWER_LAYER_DOWN = 7
+} NET_IF_OPER_STATUS, *PNET_IF_OPER_STATUS;
+
+//
+// Flags to extend operational status
+//
+#define NET_IF_OPER_STATUS_DOWN_NOT_AUTHENTICATED        0x00000001
+#define NET_IF_OPER_STATUS_DOWN_NOT_MEDIA_CONNECTED      0x00000002
+#define NET_IF_OPER_STATUS_DORMANT_PAUSED                0x00000004
+#define NET_IF_OPER_STATUS_DORMANT_LOW_POWER             0x00000008
+
+typedef UINT32 NET_IF_COMPARTMENT_ID, *PNET_IF_COMPARTMENT_ID;
+
+//
+// Define compartment ID type:
+//
+#define NET_IF_COMPARTMENT_ID_UNSPECIFIED   (NET_IF_COMPARTMENT_ID)0
+#define NET_IF_COMPARTMENT_ID_PRIMARY       (NET_IF_COMPARTMENT_ID)1
+
+#define NET_IF_OID_IF_ALIAS             0x00000001  // identifies the ifAlias string for an interface
+#define NET_IF_OID_COMPARTMENT_ID       0x00000002  // identifies the compartment ID for an interface.
+#define NET_IF_OID_NETWORK_GUID         0x00000003  // identifies the NetworkGuid for an interface.
+#define NET_IF_OID_IF_ENTRY             0x00000004  // identifies statistics for an interface.
+
+//
+// Define NetworkGUID type:
+//
+typedef GUID NET_IF_NETWORK_GUID, *PNET_IF_NETWORK_GUID;
+
+//
+// Define macros for an "unspecified" NetworkGUID value to be used in structures
+// that haven't had the NET_LUID field filled in yet.
+//
+#define NET_SET_UNSPECIFIED_NETWORK_GUID(_pNetworkGuid)
+#define NET_IS_UNSPECIFIED_NETWORK_GUID(_NetworkGuidValue)
+
+//
+// To prevent collisions between user-assigned and system-assigend site-ids,
+// we partition the site-id space into two:
+// 1. User-Assigned: NET_SITEID_UNSPECIFIED < SiteId < NET_SITEID_MAXUSER
+// 2. System-Assigned: NET_SITEID_MAXUSER < SiteId < NET_SITEID_MAXSYSTEM
+//
+// Note: A network's SiteId doesn't really need to be settable.
+// 1. The network profile manager creates a network per network profile.
+// 2. NDIS/IF assigns a unique SiteId to each network.
+//
+#define NET_SITEID_UNSPECIFIED (0)
+#define NET_SITEID_MAXUSER (0x07ffffff)
+#define NET_SITEID_MAXSYSTEM (0x0fffffff)
+C_ASSERT(NET_SITEID_MAXUSER < NET_SITEID_MAXSYSTEM);
+
+typedef enum _NET_IF_RCV_ADDRESS_TYPE // ifRcvAddressType
+{
+    NET_IF_RCV_ADDRESS_TYPE_OTHER = 1,
+    NET_IF_RCV_ADDRESS_TYPE_VOLATILE = 2,
+    NET_IF_RCV_ADDRESS_TYPE_NON_VOLATILE = 3
+} NET_IF_RCV_ADDRESS_TYPE, *PNET_IF_RCV_ADDRESS_TYPE;
+
+typedef struct _NET_IF_RCV_ADDRESS_LH
+{
+    NET_IF_RCV_ADDRESS_TYPE ifRcvAddressType;
+    USHORT                  ifRcvAddressLength;
+    USHORT                  ifRcvAddressOffset; // from beginning of this struct
+} NET_IF_RCV_ADDRESS_LH, *PNET_IF_RCV_ADDRESS_LH;
+
+typedef struct _NET_IF_ALIAS_LH
+{
+    USHORT  ifAliasLength;  // in bytes, of ifAlias string
+    USHORT  ifAliasOffset;  // in bytes, from beginning of this struct
+} NET_IF_ALIAS_LH, *PNET_IF_ALIAS_LH;
+
+#pragma warning(push)
+#pragma warning(disable:4214) // bit field types other than int
+typedef union _NET_LUID_LH
+{
+    ULONG64     Value;
+    struct
+    {
+        ULONG64     Reserved:24;
+        ULONG64     NetLuidIndex:24;
+        ULONG64     IfType:16;                  // equal to IANA IF type
+    }Info;
+} NET_LUID_LH, *PNET_LUID_LH;
+#pragma warning(pop)
+
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef NET_IF_RCV_ADDRESS_LH NET_IF_RCV_ADDRESS;
+typedef NET_IF_RCV_ADDRESS* PNET_IF_RCV_ADDRESS;
+
+typedef NET_IF_ALIAS_LH NET_IF_ALIAS;
+typedef NET_IF_ALIAS* PNET_IF_ALIAS;
+#endif //NTDDI_LONGHORN
+
+//
+// Need to make this visible on all platforms (for the purpose of IF_LUID).
+//
+typedef NET_LUID_LH NET_LUID;
+typedef NET_LUID* PNET_LUID;
+
+//
+// IF_LUID
+//
+// Define the locally unique datalink interface identifier type.
+// This type is persistable.
+//
+typedef NET_LUID IF_LUID, *PIF_LUID;
+
+typedef ULONG NET_IFINDEX, *PNET_IFINDEX;       // Interface Index (ifIndex)
+typedef UINT16 NET_IFTYPE, *PNET_IFTYPE;        // Interface Type (IANA ifType)
+
+#define NET_IFINDEX_UNSPECIFIED (NET_IFINDEX)(0)    // Not a valid ifIndex
+#define NET_IFLUID_UNSPECIFIED (0)    // Not a valid if Luid
+
+//
+// Definitions for NET_IF_INFORMATION.Flags
+//
+#define NIIF_HARDWARE_INTERFACE         0x00000001  // Set iff hardware
+#define NIIF_FILTER_INTERFACE           0x00000002
+#define NIIF_NDIS_RESERVED1             0x00000004
+#define NIIF_NDIS_RESERVED2             0x00000008
+#define NIIF_NDIS_RESERVED3             0x00000010
+#define NIIF_NDIS_WDM_INTERFACE         0x00000020
+#define NIIF_NDIS_ENDPOINT_INTERFACE    0x00000040
+
+#define NIIF_WAN_TUNNEL_TYPE_UNKNOWN    ((ULONG)(-1))
+
+//
+// Define datalink interface access types.
+//
+typedef enum _NET_IF_ACCESS_TYPE
+{
+    NET_IF_ACCESS_LOOPBACK = 1,
+    NET_IF_ACCESS_BROADCAST = 2,
+    NET_IF_ACCESS_POINT_TO_POINT = 3,
+    NET_IF_ACCESS_POINT_TO_MULTI_POINT = 4,
+    NET_IF_ACCESS_MAXIMUM = 5
+} NET_IF_ACCESS_TYPE, *PNET_IF_ACCESS_TYPE;
+
+
+//
+// Define datalink interface direction types.
+//
+typedef enum _NET_IF_DIRECTION_TYPE
+{
+    NET_IF_DIRECTION_SENDRECEIVE,
+    NET_IF_DIRECTION_SENDONLY,
+    NET_IF_DIRECTION_RECEIVEONLY,
+    NET_IF_DIRECTION_MAXIMUM
+} NET_IF_DIRECTION_TYPE, *PNET_IF_DIRECTION_TYPE;
+
+
+typedef enum _NET_IF_CONNECTION_TYPE
+{
+   NET_IF_CONNECTION_DEDICATED = 1,
+   NET_IF_CONNECTION_PASSIVE = 2,
+   NET_IF_CONNECTION_DEMAND = 3,
+   NET_IF_CONNECTION_MAXIMUM = 4
+} NET_IF_CONNECTION_TYPE, *PNET_IF_CONNECTION_TYPE;
+
+
+typedef enum _NET_IF_MEDIA_CONNECT_STATE
+{
+    MediaConnectStateUnknown,
+    MediaConnectStateConnected,
+    MediaConnectStateDisconnected
+} NET_IF_MEDIA_CONNECT_STATE, *PNET_IF_MEDIA_CONNECT_STATE;
+
+#define NET_IF_LINK_SPEED_UNKNOWN   ((ULONG64)(-1))
+
+//
+// Defines the duplex state of media
+//
+typedef enum _NET_IF_MEDIA_DUPLEX_STATE
+{
+    MediaDuplexStateUnknown,
+    MediaDuplexStateHalf,
+    MediaDuplexStateFull
+} NET_IF_MEDIA_DUPLEX_STATE, *PNET_IF_MEDIA_DUPLEX_STATE;
+
+
+// Special values for fields in NET_PHYSICAL_LOCATION
+#define NIIF_BUS_NUMBER_UNKNOWN         ((ULONG)(-1))
+#define NIIF_SLOT_NUMBER_UNKNOWN        ((ULONG)(-1))
+#define NIIF_FUNCTION_NUMBER_UNKNOWN    ((ULONG)(-1))
+
+typedef struct _NET_PHYSICAL_LOCATION_LH
+{
+    ULONG                   BusNumber;          // Physical location
+    ULONG                   SlotNumber;         // ... for hardware
+    ULONG                   FunctionNumber;     // ... devices.
+} NET_PHYSICAL_LOCATION_LH, *PNET_PHYSICAL_LOCATION_LH;
+
+//
+// maximum string size in -wchar- units
+//
+#define IF_MAX_STRING_SIZE 256
+
+typedef struct _IF_COUNTED_STRING_LH
+{
+    USHORT      Length; // in -Bytes-
+    WCHAR       String[IF_MAX_STRING_SIZE + 1];
+} IF_COUNTED_STRING_LH, *PIF_COUNTED_STRING_LH;
+
+#define IF_MAX_PHYS_ADDRESS_LENGTH 32
+
+typedef struct _IF_PHYSICAL_ADDRESS_LH
+{
+    USHORT      Length;
+    UCHAR       Address[IF_MAX_PHYS_ADDRESS_LENGTH];
+} IF_PHYSICAL_ADDRESS_LH, *PIF_PHYSICAL_ADDRESS_LH;
+
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef NET_PHYSICAL_LOCATION_LH NET_PHYSICAL_LOCATION;
+typedef NET_PHYSICAL_LOCATION* PNET_PHYSICAL_LOCATION;
+
+typedef IF_COUNTED_STRING_LH IF_COUNTED_STRING;
+typedef IF_COUNTED_STRING* PIF_COUNTED_STRING;
+
+typedef IF_PHYSICAL_ADDRESS_LH IF_PHYSICAL_ADDRESS;
+typedef IF_PHYSICAL_ADDRESS* PIF_PHYSICAL_ADDRESS;
+#endif
+
+
+//
+// IF_INDEX
+//
+// Define the interface index type.
+// This type is not persistable.
+// This must be unsigned (not an enum) to replace previous uses of
+// an index that used a DWORD type.
+//
+
+typedef NET_IFINDEX IF_INDEX, *PIF_INDEX;
+#define IFI_UNSPECIFIED NET_IFINDEX_UNSPECIFIED
+
+
+//
+// Get definitions for IFTYPE and IF_ACCESS_TYPE.
+//
+#include <ipifcons.h>
+
+
+//
+// Types of tunnels (sub-type of IF_TYPE when IF_TYPE is IF_TYPE_TUNNEL).
+// See http://www.iana.org/assignments/ianaiftype-mib.
+//
+typedef enum {
+    TUNNEL_TYPE_NONE = 0,
+    TUNNEL_TYPE_OTHER = 1,
+    TUNNEL_TYPE_DIRECT = 2,
+    TUNNEL_TYPE_6TO4 = 11,
+    TUNNEL_TYPE_ISATAP = 13,
+    TUNNEL_TYPE_TEREDO = 14,
+} TUNNEL_TYPE, *PTUNNEL_TYPE;
+
+//
+// IF_ADMINISTRATIVE_STATE
+//
+// Datalink Interface Administrative State.
+// Indicates whether the interface has been administratively enabled.
+//
+
+typedef enum _IF_ADMINISTRATIVE_STATE {
+    IF_ADMINISTRATIVE_DISABLED,
+    IF_ADMINISTRATIVE_ENABLED,
+    IF_ADMINISTRATIVE_DEMANDDIAL,
+} IF_ADMINISTRATIVE_STATE, *PIF_ADMINISTRATIVE_STATE;
+
+
+//
+// Note: Interface is Operational iff
+// ((MediaSense is Connected) and (AdministrativeState is Enabled))
+// or
+// ((MediaSense is Connected) and (AdministrativeState is OnDemand))
+//
+// !Operational iff
+// ((MediaSense != Connected) or (AdministrativeState is Disabled))
+//
+
+//
+// OperStatus values from RFC 2863
+//
+typedef enum {
+    IfOperStatusUp = 1,
+    IfOperStatusDown,
+    IfOperStatusTesting,
+    IfOperStatusUnknown,
+    IfOperStatusDormant,
+    IfOperStatusNotPresent,
+    IfOperStatusLowerLayerDown
+} IF_OPER_STATUS;
+/* +++++++++++++++++++++++ from ifdef.h */
+
+
+/* +++++++++++++++++++++++ from iptypes.h */
+// Definitions and structures used by getnetworkparams and getadaptersinfo apis
+
+#define MAX_ADAPTER_DESCRIPTION_LENGTH  128 // arb.
+#define MAX_ADAPTER_NAME_LENGTH         256 // arb.
+#define MAX_ADAPTER_ADDRESS_LENGTH      8   // arb.
+#define DEFAULT_MINIMUM_ENTITIES        32  // arb.
+#define MAX_HOSTNAME_LEN                128 // arb.
+#define MAX_DOMAIN_NAME_LEN             128 // arb.
+#define MAX_SCOPE_ID_LEN                256 // arb.
+#define MAX_DHCPV6_DUID_LENGTH          130 // RFC 3315.
+
+//
+// types
+//
+
+// Node Type
+
+#define BROADCAST_NODETYPE              1
+#define PEER_TO_PEER_NODETYPE           2
+#define MIXED_NODETYPE                  4
+#define HYBRID_NODETYPE                 8
+
+//
+// IP_ADDRESS_STRING - store an IP address as a dotted decimal string
+//
+
+typedef struct {
+    char String[4 * 4];
+} IP_ADDRESS_STRING, *PIP_ADDRESS_STRING, IP_MASK_STRING, *PIP_MASK_STRING;
+
+//
+// IP_ADDR_STRING - store an IP address with its corresponding subnet mask,
+// both as dotted decimal strings
+//
+
+typedef struct _IP_ADDR_STRING {
+    struct _IP_ADDR_STRING* Next;
+    IP_ADDRESS_STRING IpAddress;
+    IP_MASK_STRING IpMask;
+    DWORD Context;
+} IP_ADDR_STRING, *PIP_ADDR_STRING;
+
+//
+// ADAPTER_INFO - per-adapter information. All IP addresses are stored as
+// strings
+//
+
+typedef struct _IP_ADAPTER_INFO {
+    struct _IP_ADAPTER_INFO* Next;
+    DWORD ComboIndex;
+    char AdapterName[MAX_ADAPTER_NAME_LENGTH + 4];
+    char Description[MAX_ADAPTER_DESCRIPTION_LENGTH + 4];
+    UINT AddressLength;
+    BYTE Address[MAX_ADAPTER_ADDRESS_LENGTH];
+    DWORD Index;
+    UINT Type;
+    UINT DhcpEnabled;
+    PIP_ADDR_STRING CurrentIpAddress;
+    IP_ADDR_STRING IpAddressList;
+    IP_ADDR_STRING GatewayList;
+    IP_ADDR_STRING DhcpServer;
+    BOOL HaveWins;
+    IP_ADDR_STRING PrimaryWinsServer;
+    IP_ADDR_STRING SecondaryWinsServer;
+    time_t LeaseObtained;
+    time_t LeaseExpires;
+} IP_ADAPTER_INFO, *PIP_ADAPTER_INFO;
+
+#ifdef _WINSOCK2API_
+
+//
+// The following types require Winsock2.
+//
+
+typedef NL_PREFIX_ORIGIN IP_PREFIX_ORIGIN;
+typedef NL_SUFFIX_ORIGIN IP_SUFFIX_ORIGIN;
+typedef NL_DAD_STATE IP_DAD_STATE;
+
+typedef struct _IP_ADAPTER_UNICAST_ADDRESS_LH {
+    union {
+        ULONGLONG Alignment;
+        struct { 
+            ULONG Length;
+            DWORD Flags;
+        };
+    };
+    struct _IP_ADAPTER_UNICAST_ADDRESS_LH *Next;
+    SOCKET_ADDRESS Address;
+
+    IP_PREFIX_ORIGIN PrefixOrigin;
+    IP_SUFFIX_ORIGIN SuffixOrigin;
+    IP_DAD_STATE DadState;
+
+    ULONG ValidLifetime;
+    ULONG PreferredLifetime;
+    ULONG LeaseLifetime;
+    UINT8 OnLinkPrefixLength;
+} IP_ADAPTER_UNICAST_ADDRESS_LH,
+ *PIP_ADAPTER_UNICAST_ADDRESS_LH;
+
+typedef struct _IP_ADAPTER_UNICAST_ADDRESS_XP {
+    union {
+        ULONGLONG Alignment;
+        struct { 
+            ULONG Length;
+            DWORD Flags;
+        };
+    };
+    struct _IP_ADAPTER_UNICAST_ADDRESS_XP *Next;
+    SOCKET_ADDRESS Address;
+
+    IP_PREFIX_ORIGIN PrefixOrigin;
+    IP_SUFFIX_ORIGIN SuffixOrigin;
+    IP_DAD_STATE DadState;
+
+    ULONG ValidLifetime;
+    ULONG PreferredLifetime;
+    ULONG LeaseLifetime;
+} IP_ADAPTER_UNICAST_ADDRESS_XP, *PIP_ADAPTER_UNICAST_ADDRESS_XP;
+
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef  IP_ADAPTER_UNICAST_ADDRESS_LH IP_ADAPTER_UNICAST_ADDRESS;
+typedef  IP_ADAPTER_UNICAST_ADDRESS_LH *PIP_ADAPTER_UNICAST_ADDRESS;
+#elif (NTDDI_VERSION >= NTDDI_WINXP)
+typedef  IP_ADAPTER_UNICAST_ADDRESS_XP IP_ADAPTER_UNICAST_ADDRESS;
+typedef  IP_ADAPTER_UNICAST_ADDRESS_XP *PIP_ADAPTER_UNICAST_ADDRESS;
+#endif
+
+//
+// Bit values of IP_ADAPTER_UNICAST_ADDRESS Flags field.
+//
+#define IP_ADAPTER_ADDRESS_DNS_ELIGIBLE 0x01
+#define IP_ADAPTER_ADDRESS_TRANSIENT    0x02
+
+typedef struct _IP_ADAPTER_ANYCAST_ADDRESS_XP {
+    union {
+        ULONGLONG Alignment;
+        struct { 
+            ULONG Length;
+            DWORD Flags;
+        };
+    };
+    struct _IP_ADAPTER_ANYCAST_ADDRESS_XP *Next;
+    SOCKET_ADDRESS Address;
+} IP_ADAPTER_ANYCAST_ADDRESS_XP, *PIP_ADAPTER_ANYCAST_ADDRESS_XP;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_ANYCAST_ADDRESS_XP IP_ADAPTER_ANYCAST_ADDRESS;
+typedef IP_ADAPTER_ANYCAST_ADDRESS_XP *PIP_ADAPTER_ANYCAST_ADDRESS;
+#endif
+
+typedef struct _IP_ADAPTER_MULTICAST_ADDRESS_XP {
+    union {
+        ULONGLONG Alignment;
+        struct {
+            ULONG Length;
+            DWORD Flags;
+        };
+    };
+    struct _IP_ADAPTER_MULTICAST_ADDRESS_XP *Next;
+    SOCKET_ADDRESS Address;
+} IP_ADAPTER_MULTICAST_ADDRESS_XP, *PIP_ADAPTER_MULTICAST_ADDRESS_XP;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_MULTICAST_ADDRESS_XP IP_ADAPTER_MULTICAST_ADDRESS;
+typedef IP_ADAPTER_MULTICAST_ADDRESS_XP *PIP_ADAPTER_MULTICAST_ADDRESS;
+#endif
+
+typedef struct _IP_ADAPTER_DNS_SERVER_ADDRESS_XP {
+    union {
+        ULONGLONG Alignment;
+        struct {
+            ULONG Length;
+            DWORD Reserved;
+        };
+    };
+    struct _IP_ADAPTER_DNS_SERVER_ADDRESS_XP *Next;
+    SOCKET_ADDRESS Address;
+} IP_ADAPTER_DNS_SERVER_ADDRESS_XP, *PIP_ADAPTER_DNS_SERVER_ADDRESS_XP;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_DNS_SERVER_ADDRESS_XP IP_ADAPTER_DNS_SERVER_ADDRESS;
+typedef IP_ADAPTER_DNS_SERVER_ADDRESS_XP *PIP_ADAPTER_DNS_SERVER_ADDRESS;
+#endif
+
+typedef struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH {
+    union {
+        ULONGLONG Alignment;
+        struct {
+            ULONG Length;
+            DWORD Reserved;
+        };
+    };
+    struct _IP_ADAPTER_WINS_SERVER_ADDRESS_LH *Next;
+    SOCKET_ADDRESS Address;
+} IP_ADAPTER_WINS_SERVER_ADDRESS_LH, *PIP_ADAPTER_WINS_SERVER_ADDRESS_LH;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH IP_ADAPTER_WINS_SERVER_ADDRESS;
+typedef IP_ADAPTER_WINS_SERVER_ADDRESS_LH *PIP_ADAPTER_WINS_SERVER_ADDRESS;
+#endif
+
+
+typedef struct _IP_ADAPTER_GATEWAY_ADDRESS_LH {
+    union {
+        ULONGLONG Alignment;
+        struct {
+            ULONG Length;
+            DWORD Reserved;
+        };
+    };
+    struct _IP_ADAPTER_GATEWAY_ADDRESS_LH *Next;
+    SOCKET_ADDRESS Address;
+} IP_ADAPTER_GATEWAY_ADDRESS_LH, *PIP_ADAPTER_GATEWAY_ADDRESS_LH;
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef IP_ADAPTER_GATEWAY_ADDRESS_LH IP_ADAPTER_GATEWAY_ADDRESS;
+typedef IP_ADAPTER_GATEWAY_ADDRESS_LH *PIP_ADAPTER_GATEWAY_ADDRESS;
+#endif
+
+typedef struct _IP_ADAPTER_PREFIX_XP {
+    union {
+        ULONGLONG Alignment;
+        struct {
+            ULONG Length;
+            DWORD Flags;
+        };
+    };
+    struct _IP_ADAPTER_PREFIX_XP *Next;
+    SOCKET_ADDRESS Address;
+    ULONG PrefixLength;
+} IP_ADAPTER_PREFIX_XP, *PIP_ADAPTER_PREFIX_XP;
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef IP_ADAPTER_PREFIX_XP IP_ADAPTER_PREFIX;
+typedef IP_ADAPTER_PREFIX_XP *PIP_ADAPTER_PREFIX;
+#endif
+
+//
+// Bit values of IP_ADAPTER_ADDRESSES Flags field.
+//
+#define IP_ADAPTER_DDNS_ENABLED               0x00000001
+#define IP_ADAPTER_REGISTER_ADAPTER_SUFFIX    0x00000002
+#define IP_ADAPTER_DHCP_ENABLED               0x00000004
+#define IP_ADAPTER_RECEIVE_ONLY               0x00000008
+#define IP_ADAPTER_NO_MULTICAST               0x00000010
+#define IP_ADAPTER_IPV6_OTHER_STATEFUL_CONFIG 0x00000020
+#define IP_ADAPTER_NETBIOS_OVER_TCPIP_ENABLED 0x00000040
+#define IP_ADAPTER_IPV4_ENABLED               0x00000080
+#define IP_ADAPTER_IPV6_ENABLED               0x00000100
+
+typedef struct _IP_ADAPTER_ADDRESSES_LH {
+    union {
+        ULONGLONG Alignment;
+        struct {
+            ULONG Length;
+            IF_INDEX IfIndex;
+        };
+    };
+    struct _IP_ADAPTER_ADDRESSES_LH *Next;
+    PCHAR AdapterName;
+    PIP_ADAPTER_UNICAST_ADDRESS_LH FirstUnicastAddress;
+    PIP_ADAPTER_ANYCAST_ADDRESS_XP FirstAnycastAddress;
+    PIP_ADAPTER_MULTICAST_ADDRESS_XP FirstMulticastAddress;
+    PIP_ADAPTER_DNS_SERVER_ADDRESS_XP FirstDnsServerAddress;
+    PWCHAR DnsSuffix;
+    PWCHAR Description;
+    PWCHAR FriendlyName;
+    BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
+    ULONG PhysicalAddressLength;
+    union {
+        ULONG Flags;
+        struct {
+            ULONG DdnsEnabled : 1;
+            ULONG RegisterAdapterSuffix : 1;
+            ULONG Dhcpv4Enabled : 1;
+            ULONG ReceiveOnly : 1;
+            ULONG NoMulticast : 1;
+            ULONG Ipv6OtherStatefulConfig : 1;
+            ULONG NetbiosOverTcpipEnabled : 1;
+            ULONG Ipv4Enabled : 1;
+            ULONG Ipv6Enabled : 1;
+            ULONG Ipv6ManagedAddressConfigurationSupported : 1;
+        };
+    };
+    ULONG Mtu;
+    IFTYPE IfType;
+    IF_OPER_STATUS OperStatus;
+    IF_INDEX Ipv6IfIndex;
+    ULONG ZoneIndices[16];
+    PIP_ADAPTER_PREFIX_XP FirstPrefix;
+
+    ULONG64 TransmitLinkSpeed;
+    ULONG64 ReceiveLinkSpeed;
+    PIP_ADAPTER_WINS_SERVER_ADDRESS_LH FirstWinsServerAddress;
+    PIP_ADAPTER_GATEWAY_ADDRESS_LH FirstGatewayAddress;
+    ULONG Ipv4Metric;
+    ULONG Ipv6Metric;
+    IF_LUID Luid;
+    SOCKET_ADDRESS Dhcpv4Server;
+    NET_IF_COMPARTMENT_ID CompartmentId;
+    NET_IF_NETWORK_GUID NetworkGuid;
+    NET_IF_CONNECTION_TYPE ConnectionType;    
+    TUNNEL_TYPE TunnelType;
+    //
+    // DHCP v6 Info.
+    //
+    SOCKET_ADDRESS Dhcpv6Server;
+    BYTE Dhcpv6ClientDuid[MAX_DHCPV6_DUID_LENGTH];
+    ULONG Dhcpv6ClientDuidLength;
+    ULONG Dhcpv6Iaid;
+} IP_ADAPTER_ADDRESSES_LH, 
+ *PIP_ADAPTER_ADDRESSES_LH;
+
+typedef struct _IP_ADAPTER_ADDRESSES_XP {
+    union {
+        ULONGLONG Alignment;
+        struct {
+            ULONG Length;
+            DWORD IfIndex;
+        };
+    };
+    struct _IP_ADAPTER_ADDRESSES_XP *Next;
+    PCHAR AdapterName;
+    PIP_ADAPTER_UNICAST_ADDRESS_XP FirstUnicastAddress;
+    PIP_ADAPTER_ANYCAST_ADDRESS_XP FirstAnycastAddress;
+    PIP_ADAPTER_MULTICAST_ADDRESS_XP FirstMulticastAddress;
+    PIP_ADAPTER_DNS_SERVER_ADDRESS_XP FirstDnsServerAddress;
+    PWCHAR DnsSuffix;
+    PWCHAR Description;
+    PWCHAR FriendlyName;
+    BYTE PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
+    DWORD PhysicalAddressLength;
+    DWORD Flags;
+    DWORD Mtu;
+    DWORD IfType;
+    IF_OPER_STATUS OperStatus;
+    DWORD Ipv6IfIndex;
+    DWORD ZoneIndices[16];
+    PIP_ADAPTER_PREFIX_XP FirstPrefix;
+} IP_ADAPTER_ADDRESSES_XP,
+ *PIP_ADAPTER_ADDRESSES_XP;
+
+#if (NTDDI_VERSION >= NTDDI_LONGHORN)
+typedef  IP_ADAPTER_ADDRESSES_LH IP_ADAPTER_ADDRESSES;
+typedef  IP_ADAPTER_ADDRESSES_LH *PIP_ADAPTER_ADDRESSES;
+#elif (NTDDI_VERSION >= NTDDI_WINXP)
+typedef  IP_ADAPTER_ADDRESSES_XP IP_ADAPTER_ADDRESSES;
+typedef  IP_ADAPTER_ADDRESSES_XP *PIP_ADAPTER_ADDRESSES;
+#else
+//
+// For platforms other platforms that are including
+// the file but not using the types.
+//
+typedef  IP_ADAPTER_ADDRESSES_XP IP_ADAPTER_ADDRESSES;
+typedef  IP_ADAPTER_ADDRESSES_XP *PIP_ADAPTER_ADDRESSES;
+#endif
+
+
+//
+// Flags used as argument to GetAdaptersAddresses().
+// "SKIP" flags are added when the default is to include the information.
+// "INCLUDE" flags are added when the default is to skip the information.
+//
+#define GAA_FLAG_SKIP_UNICAST                   0x0001
+#define GAA_FLAG_SKIP_ANYCAST                   0x0002
+#define GAA_FLAG_SKIP_MULTICAST                 0x0004
+#define GAA_FLAG_SKIP_DNS_SERVER                0x0008
+#define GAA_FLAG_INCLUDE_PREFIX                 0x0010
+#define GAA_FLAG_SKIP_FRIENDLY_NAME             0x0020
+#define GAA_FLAG_INCLUDE_WINS_INFO              0x0040
+#define GAA_FLAG_INCLUDE_GATEWAYS               0x0080
+#define GAA_FLAG_INCLUDE_ALL_INTERFACES         0x0100
+#define GAA_FLAG_INCLUDE_ALL_COMPARTMENTS       0x0200
+#define GAA_FLAG_INCLUDE_TUNNEL_BINDINGORDER    0x0400
+
+#endif /* _WINSOCK2API_ */
+/* +++++++++++++++++++++++ from iptypes.h */
+
+
+/* +++++++++++++++++++++++ from iphlpapi.h */
+#ifdef _WINSOCK2API_
+
+//
+// The following functions require Winsock2.
+//
+
+ULONG
+WINAPI
+GetAdaptersAddresses(
+    IN ULONG Family,
+    IN ULONG Flags,
+    IN PVOID Reserved,
+    __out_bcount_opt(*SizePointer) PIP_ADAPTER_ADDRESSES AdapterAddresses, 
+    IN OUT PULONG SizePointer
+    );
+
+#endif
+/* +++++++++++++++++++++++ from iphlpapi.h */
+
+#endif /* !_W64 */
+#pragma warning(pop)
+#endif /* GAA_COMPAT_H */
index e273de29d46cbccb91aca832463be0dea4ba84ea..7b448299607d6b8450ce006621e1afe9db59728e 100755 (executable)
@@ -20,6 +20,8 @@ see notes/remarks directly below this header:
 #
 #
 # Changes:
+# 02/23/2011   David J Taylor  - Use reg instead of regedit so "run as
+#                                administrator" is not required.
 # 12/21/2009   Dave Hart
 #                              - packageinfo.sh uses prerelease= now not
 #                                releasecandidate=
@@ -135,7 +137,8 @@ REM ****************************************************************************
        SET UTC_SIGN=
        
        REM *** Now get the timezone settings from the registry
-       regedit /e %TEMP%\TZ-%GENERATED_PROGRAM%.TMP "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation"
+       reg export "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation" %TEMP%\TZ-%GENERATED_PROGRAM%.TMP
+       REM was: regedit /e %TEMP%\TZ-%GENERATED_PROGRAM%.TMP "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\TimeZoneInformation"
        IF NOT EXIST %TEMP%\TZ-%GENERATED_PROGRAM%.TMP GOTO NOTZINFO
 
        for /f "Tokens=1* Delims==" %%a in ('type %TEMP%\TZ-%GENERATED_PROGRAM%.TMP') do if %%a == "ActiveTimeBias" SET ACTIVEBIAS=%%b
@@ -237,13 +240,13 @@ REM ****************************************************************************
 
 :NOBK
        REM ** If that was not successful, we'll take a look into a version file, if available
-       IF EXIST ..\..\..\..\sntp\version (
-               IF "%CSET%"=="" FOR /F "TOKENS=1" %%a IN ('type ..\..\..\..\sntp\version') DO @SET CSET=%%a
+       IF EXIST ..\..\..\..\sntp\scm-rev (
+               IF "%CSET%"=="" FOR /F "TOKENS=1" %%a IN ('type ..\..\..\..\sntp\scm-rev') DO @SET CSET=%%a
        )
        REM next if block can go away once all windows compilers are building in
        REM ports\winnt\<compiler dir>\<binary name dir> (ports\winnt\vs2008\ntpd)
-       IF EXIST ..\..\..\sntp\version (
-               IF "%CSET%"=="" FOR /F "TOKENS=1" %%a IN ('type ..\..\..\sntp\version') DO @SET CSET=%%a
+       IF EXIST ..\..\..\sntp\scm-rev (
+               IF "%CSET%"=="" FOR /F "TOKENS=1" %%a IN ('type ..\..\..\sntp\scm-rev') DO @SET CSET=%%a
        )
 
        REM ** Now, expand our version number with the CSet revision, if we managed to get one
@@ -263,7 +266,8 @@ REM ****************************************************************************
        IF exist userset.reg del userset.reg
        IF exist userset.txt del userset.txt
        
-       regedit /E userset.reg "HKEY_CURRENT_USER\Control Panel\International"
+       reg export "HKEY_CURRENT_USER\Control Panel\International" userset.reg
+       REM was: regedit /E userset.reg "HKEY_CURRENT_USER\Control Panel\International"
        IF not exist userset.reg goto ERRNOREG
 
        rem *** convert from unicode to ascii if necessary
@@ -398,7 +402,7 @@ REM ****************************************************************************
 REM Here are the error messages I know
 REM *****************************************************************************************************************
 :ERRNOREG
-   ECHO "Error: Registry could not be read (check if regedit.exe is available and works as expected)"
+   ECHO "Error: Registry could not be read (check if reg.exe is available and works as expected)"
    GOTO EOF
 
 
index fb339a13e16eff18aaaadaf2dd4e2f4387f97a2d..78b5eb036a99b192293dd41c93f6af9f828ae3dc 100644 (file)
                                RelativePath="..\..\..\..\lib\isc\include\isc\event.h"
                                >
                        </File>
+                       <File
+                               RelativePath="..\..\include\gaa_compat.h"
+                               >
+                       </File>
                        <File
                                RelativePath="..\..\..\..\include\global.h"
                                >
                                >
                        </File>
                        <File
-                               RelativePath="..\..\include\sys\time.h"
+                               RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
-                               RelativePath="..\..\..\..\lib\isc\win32\include\isc\time.h"
+                               RelativePath="..\..\include\sys\time.h"
                                >
                        </File>
                        <File
index 32975e1c4552ea05a89b95c2d27ec78e84c1cd66..09e2665539ab853157319edb65dc1953dbf74604 100644 (file)
@@ -102,7 +102,7 @@ EXTRA_DIST =                                \
        sntp.html                       \
        sntp.texi                       \
        tests_main.h                    \
-       $(srcdir)/version               \
+       $(srcdir)/scm-rev               \
        $(srcdir)/m4/version.m4         \
        $(NULL)
 
@@ -111,7 +111,7 @@ BUILT_SOURCES =                             \
        libtool                         \
        $(srcdir)/sntp-opts.c           \
        $(srcdir)/sntp-opts.h           \
-       check-version                   \
+       check-scm-rev                   \
        $(srcdir)/include/version.def   \
        $(srcdir)/m4/version.m4         \
        $(srcdir)/include/version.texi  \
@@ -147,9 +147,11 @@ $(PROGRAMS): version.o
 ## That is probably not possible since LDADD_LIBEVENT may be
 ## non-file "-levent_core".
 
-version.o: $(sntp_OBJECTS) ../libntp/libntp.a $(srcdir)/version
-       env CSET=`cat $(srcdir)/version` $(top_builddir)/../scripts/mkver sntp
-       $(COMPILE) -c version.c
+version.c: $(sntp_OBJECTS) ../libntp/libntp.a Makefile $(srcdir)/scm-rev
+       env CSET=`cat $(srcdir)/scm-rev` $(top_builddir)/../scripts/mkver sntp
+       
+version.o: version.c
+       env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
 
 check-autogen-version.def: FRC
        @cd $(srcdir)                                                   \
@@ -167,15 +169,18 @@ built-sources-only: $(BUILT_SOURCES)
        @: do-nothing action to avoid default SCCS get
 
 ## HMS: The next bit is still suboptimal.  We'll get an error if this is
-## a bk repo and srcdir or version is unwritable.
+## a bk repo and srcdir or scm-rev is unwritable.
 
-check-version:
+check-scm-rev: $(srcdir)/scm-rev
+       @: do-nothing
+
+$(srcdir)/scm-rev:
        -test -r $(srcdir)/../SCCS/s.ChangeSet &&               \
            (bk version) >/dev/null 2>&1 &&                     \
            cd $(srcdir)/.. &&                                  \
            x=`bk -R prs -hr+ -nd:I: ChangeSet` &&              \
-           y=`cat sntp/version 2>/dev/null` || true &&         \
-           case "$$x" in ''|$$y) ;; *) echo $$x > sntp/version ;; esac
+           y=`cat sntp/scm-rev 2>/dev/null` || true &&         \
+           case "$$x" in ''|$$y) ;; *) echo $$x > sntp/scm-rev ;; esac
 
 $(srcdir)/m4/version.m4: $(srcdir)/../packageinfo.sh
        TEMPDIR=`pwd` && export TEMPDIR && cd $(srcdir) && \
index abcb18ce9bf69ddb9e0fac76a680015f95cff5ca..a1cec4d7ac952b1d72b1551c926d07093252bed1 100644 (file)
@@ -51,7 +51,7 @@ regress_SOURCES += regress_iocp.c
 endif
 
 regress_LDADD = @LIBEVENT_GC_SECTIONS@ ../libevent.la $(PTHREAD_LIBS) $(ZLIB_LIBS)
-regress_CFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat \
+regress_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/compat \
        -I$(top_srcdir)/include -I../include $(PTHREAD_CFLAGS) $(ZLIB_CFLAGS)
 regress_LDFLAGS = $(PTHREAD_CFLAGS)
 
index 42335d7d8156b6210f10f198f023e306288c2ee1..6bed13b9a29d8949cbf7e50146a34594fb8dc643 100644 (file)
@@ -63,14 +63,16 @@ jitter_LDADD=
 kern.o: kern.c
        $(COMPILE) -DHAVE_TIMEX_H -c kern.c
 
-$(top_srcdir)/sntp/version:
-       cd $(top_srcdir)/sntp && $(MAKE) version
-
 $(PROGRAMS): version.o
 
-version.o: $(ntp_keygen_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/version
-       env CSET=`cat $(top_srcdir)/sntp/version` $(top_builddir)/scripts/mkver ntp-keygen
-       $(COMPILE) -c version.c
+$(top_srcdir)/sntp/scm-rev:
+       cd $(top_srcdir)/sntp && $(MAKE) check-scm-rev
+
+version.c: $(ntp_keygen_OBJECTS) ../libntp/libntp.a Makefile $(top_srcdir)/sntp/scm-rev
+       env CSET=`cat $(top_srcdir)/sntp/scm-rev` $(top_builddir)/scripts/mkver ntp-keygen
+       
+version.o: version.c
+       env CCACHE_DISABLE=1 $(COMPILE) -c version.c -o version.o
 
 include $(top_srcdir)/bincheck.mf
 include $(top_srcdir)/sntp/check-libntp.mf