From 72470992aac5d1338f651463d1becf56f516dd65 Mon Sep 17 00:00:00 2001 From: wb2osz Date: Sun, 27 Aug 2017 11:41:15 -0400 Subject: [PATCH] Mac OSX compile fixes. --- Makefile.macosx | 8 ++++---- direwolf.h | 11 +++++++++++ serial_port.c | 5 ++++- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/Makefile.macosx b/Makefile.macosx index c28a8f1..f01f218 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -26,7 +26,8 @@ APPS := direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc -all : $(APPS) direwolf.desktop direwolf.conf @echo " " +all : $(APPS) direwolf.conf + @echo " " @echo "Next step install with: " @echo " " @echo " sudo make install" @@ -315,7 +316,7 @@ INSTALLDIR := /usr/local INSTALL=ginstall .PHONY: install -install : $(APPS) direwolf.conf tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png direwolf.desktop +install : $(APPS) direwolf.conf tocalls.txt symbols-new.txt symbolsX.txt dw-icon.png # # Applications, not installed with package manager, normally go in /usr/local/bin. # /usr/bin is used instead when installing from .DEB or .RPM package. @@ -350,7 +351,6 @@ install : $(APPS) direwolf.conf tocalls.txt symbols-new.txt symbolsX.txt dw-icon $(INSTALL) -D --mode=644 symbols-new.txt /usr/share/direwolf/symbols-new.txt $(INSTALL) -D --mode=644 symbolsX.txt /usr/share/direwolf/symbolsX.txt $(INSTALL) -D --mode=644 dw-icon.png /usr/share/direwolf/dw-icon.png - $(INSTALL) -D --mode=644 direwolf.desktop /usr/share/applications/direwolf.desktop # # Documentation. Various plain text files and PDF. # @@ -485,7 +485,7 @@ testagc : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o # Unit test for demodulators atest : atest.c demod.c dsp.c demod_afsk.c demod_psk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ - fcs_calc.c ax25_pad.c decode_aprs.c dwgpsnmea.o dwgps.o serial_port.o telemetry.c dtest_now.o latlong.c symbols.c textcolor.c tt_text.c + fcs_calc.c ax25_pad.c decode_aprs.c dwgpsnmea.o dwgps.o serial_port.o telemetry.c dtime_now.o latlong.c symbols.c textcolor.c tt_text.c $(CC) $(CFLAGS) -o $@ $^ -lm #atest : atest.c fsk_fast_filter.h demod.c dsp.c demod_afsk.c demod_psk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ # fcs_calc.c ax25_pad.c decode_aprs.c dwgpsnmea.o dwgps.o serial_port.o telemetry.c latlong.c symbols.c textcolor.c tt_text.c diff --git a/direwolf.h b/direwolf.h index a647b60..daa971a 100644 --- a/direwolf.h +++ b/direwolf.h @@ -32,6 +32,17 @@ #endif +#ifdef __APPLE__ + +// https://groups.yahoo.com/neo/groups/direwolf_packet/conversations/messages/2072 + +// I think we should put it here, so it will apply to all files, +// rather than only in ptt.c. + +#define __DARWIN_C_LEVEL __DARWIN_C_FULL + +#endif + /* * Previously, we could handle only a single audio device. diff --git a/serial_port.c b/serial_port.c index a32f804..5f3c8e1 100644 --- a/serial_port.c +++ b/serial_port.c @@ -237,9 +237,12 @@ MYFDTYPE serial_port_open (char *devicename, int baud) case 9600: cfsetispeed (&ts, B9600); cfsetospeed (&ts, B9600); break; case 19200: cfsetispeed (&ts, B19200); cfsetospeed (&ts, B19200); break; case 38400: cfsetispeed (&ts, B38400); cfsetospeed (&ts, B38400); break; +#ifndef __APPLE__ + // Not defined for Mac OSX. + // https://groups.yahoo.com/neo/groups/direwolf_packet/conversations/messages/2072 case 57600: cfsetispeed (&ts, B57600); cfsetospeed (&ts, B57600); break; case 115200: cfsetispeed (&ts, B115200); cfsetospeed (&ts, B115200); break; - +#endif default: text_color_set(DW_COLOR_ERROR); dw_printf ("serial_port_open: Unsupported speed %d. Using 4800.\n", baud); cfsetispeed (&ts, B4800); cfsetospeed (&ts, B4800);