Allow compilation of BACnet/IP demos in Cygwin in Windows

This commit is contained in:
ekh
2013-05-10 19:24:26 +00:00
parent 14643101c0
commit 15fe7e56c2
3 changed files with 20 additions and 2 deletions
+13 -1
View File
@@ -61,10 +61,22 @@ SUBDIRS = readprop writeprop readfile writefile reinit server dcc \
ifeq (${BACDL_DEFINE},-DBACDL_BIP=1)
SUBDIRS += whoisrouter iamrouter initrouter readbdt
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 += router
endif
endif
ifeq (${BACNET_PORT},win32)
SUBDIRS += ptransfer mstpcap mstpcrc
+6
View File
@@ -75,19 +75,25 @@
#define ENUMS
#include <sys/socket.h>
#ifndef __CYGWIN__
#include <net/route.h>
#endif
#include <net/if.h>
#ifndef __CYGWIN__
#include <net/if_arp.h>
#endif
#include <features.h> /* for the glibc version number */
#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
#include <netpacket/packet.h>
#include <net/ethernet.h> /* the L2 protocols */
#else
#include <asm/types.h>
#ifndef __CYGWIN__
#include <linux/if_packet.h>
#include <linux/if_arcnet.h>
#include <linux/if_ether.h>
#endif
#endif
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/un.h>
+1 -1
View File
@@ -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
Ethernet, ARCNET, or MS/TP.
Linux/Unix
Linux/Unix/Cygwin
$ make clean all
Windows