Allow compilation of BACnet/IP demos in Cygwin in Windows
This commit is contained in:
@@ -61,10 +61,22 @@ SUBDIRS = readprop writeprop readfile writefile reinit server dcc \
|
|||||||
ifeq (${BACDL_DEFINE},-DBACDL_BIP=1)
|
ifeq (${BACDL_DEFINE},-DBACDL_BIP=1)
|
||||||
SUBDIRS += whoisrouter iamrouter initrouter readbdt
|
SUBDIRS += whoisrouter iamrouter initrouter readbdt
|
||||||
endif
|
endif
|
||||||
ifeq (${BACNET_PORT},linux)
|
|
||||||
|
# EKH: only include MSTP stuff if building targets MSTP or ALL. This allows us to compile under Cygwin, which has no support for RS485 (yet)
|
||||||
|
# I searched for a clean way of doing the 'or' operation and the best I could come up with was http://stackoverflow.com/questions/7656425/makefile-ifeq-logical-or
|
||||||
|
addMSTP=
|
||||||
|
ifdef BACDL_ALL
|
||||||
|
addMSTP = true
|
||||||
|
endif
|
||||||
|
ifeq (${BACDL_DEFINE},-DBACDL_MSTP=1)
|
||||||
|
addMSTP = true
|
||||||
|
endif
|
||||||
|
ifdef addMSTP # if we want MSTP
|
||||||
|
ifeq (${BACNET_PORT},linux) # AND we are compiling under linux/cygwin
|
||||||
SUBDIRS += mstpcap mstpcrc
|
SUBDIRS += mstpcap mstpcrc
|
||||||
#SUBDIRS += router
|
#SUBDIRS += router
|
||||||
endif
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq (${BACNET_PORT},win32)
|
ifeq (${BACNET_PORT},win32)
|
||||||
SUBDIRS += ptransfer mstpcap mstpcrc
|
SUBDIRS += ptransfer mstpcap mstpcrc
|
||||||
|
|||||||
@@ -75,19 +75,25 @@
|
|||||||
|
|
||||||
#define ENUMS
|
#define ENUMS
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#ifndef __CYGWIN__
|
||||||
#include <net/route.h>
|
#include <net/route.h>
|
||||||
|
#endif
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
|
#ifndef __CYGWIN__
|
||||||
#include <net/if_arp.h>
|
#include <net/if_arp.h>
|
||||||
|
#endif
|
||||||
#include <features.h> /* for the glibc version number */
|
#include <features.h> /* for the glibc version number */
|
||||||
#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
|
#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
|
||||||
#include <netpacket/packet.h>
|
#include <netpacket/packet.h>
|
||||||
#include <net/ethernet.h> /* the L2 protocols */
|
#include <net/ethernet.h> /* the L2 protocols */
|
||||||
#else
|
#else
|
||||||
#include <asm/types.h>
|
#include <asm/types.h>
|
||||||
|
#ifndef __CYGWIN__
|
||||||
#include <linux/if_packet.h>
|
#include <linux/if_packet.h>
|
||||||
#include <linux/if_arcnet.h>
|
#include <linux/if_arcnet.h>
|
||||||
#include <linux/if_ether.h>
|
#include <linux/if_ether.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <sys/un.h>
|
#include <sys/un.h>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ are created that run under Windows or Linux. They use the BACnet/IP datalink
|
|||||||
layer for communication by default, but could be compiled to use BACnet
|
layer for communication by default, but could be compiled to use BACnet
|
||||||
Ethernet, ARCNET, or MS/TP.
|
Ethernet, ARCNET, or MS/TP.
|
||||||
|
|
||||||
Linux/Unix
|
Linux/Unix/Cygwin
|
||||||
$ make clean all
|
$ make clean all
|
||||||
|
|
||||||
Windows
|
Windows
|
||||||
|
|||||||
Reference in New Issue
Block a user