HAL_SITL: Fixing SITL build for OSX.

This commit is contained in:
John Boiles 2013-07-04 23:01:16 +07:00 committed by Andrew Tridgell
parent a694b781c7
commit bb2a6b8a22
2 changed files with 14 additions and 0 deletions

View File

@ -33,6 +33,14 @@ using namespace AVR_SITL;
#define LISTEN_BASE_PORT 5760
// On OSX, MSG_NOSIGNAL doesn't exist. The equivalent is to set SO_NOSIGPIPE
// in setsockopt for the socket. However, if we just skip that, and don't use
// MSG_NOSIGNAL, everything seems to work fine and SIGPIPE doesn't seem to be
// generated.
#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
#endif
bool SITLUARTDriver::_console;
/* UARTDriver method implementations */

View File

@ -18,7 +18,10 @@ CXXOPTS = -ffunction-sections -fdata-sections -fno-exceptions -fsigned
COPTS = -ffunction-sections -fdata-sections -fsigned-char
ASOPTS = -x assembler-with-cpp
ifneq ($(SYSTYPE),Darwin)
LISTOPTS = -adhlns=$(@:.o=.lst)
endif
CPUFLAGS = -D_GNU_SOURCE
CPULDFLAGS = -g
@ -31,7 +34,10 @@ CFLAGS += $(WARNFLAGS) $(DEPFLAGS) $(COPTS)
ASFLAGS = -g $(CPUFLAGS) $(DEFINES) -Wa,$(LISTOPTS) $(DEPFLAGS)
ASFLAGS += $(ASOPTS)
LDFLAGS = -g $(CPUFLAGS) $(OPTFLAGS) $(WARNFLAGS)
ifneq ($(SYSTYPE),Darwin)
LDFLAGS += -Wl,--gc-sections -Wl,-Map -Wl,$(SKETCHMAP)
endif
LIBS = -lm