From b15bf7d016a2e1d7282ff1bd6998db130a3af34f Mon Sep 17 00:00:00 2001 From: mistermatt2u Date: Tue, 15 Dec 2015 20:39:30 -0500 Subject: [PATCH 1/6] - Replaced logic that determines what version of OS X SDK is installed, and where. Assuming a location of /Developer produced make errors on 10.11. This is likely due to the fact that XCODE installs to /Applications by default (when installed via App Store). - Replaced instances of /opt with /usr. Assuming the existence of /opt caused make errors for 10.11. According to 'man hier', the file system hierarchy information, /opt is not used on OS X. If there is a standard location for shared libraries, it is /usr/lib. --- Makefile.macosx | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/Makefile.macosx b/Makefile.macosx index b6330da7..40367bb4 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -20,29 +20,10 @@ all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx @echo " /Developer/SDKs " @echo " " -SYS_LIBS := -SYS_MIN := -SDK := $(shell find /Developer -maxdepth 1 -type d -name "SDKs") -#$(info $$SDK = ${SDK}) -ifeq (${SDK},/Developer/SDKs) - SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.8.sdk") - ifeq (${SDK},/Developer/SDKs/MacOSX10.8.sdk) - SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.8.sdk - SYS_MIN := -mmacosx-version-min=10.8 - else - SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.9.sdk") - ifeq (${SDK},/Developer/SDKs/MacOSX10.9.sdk) - SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.9.sdk - SYS_MIN := -mmacosx-version-min=10.9 - else - SDK := $(shell find /Developer/SDKs -maxdepth 1 -type d -name "MacOSX10.10.sdk") - ifeq (${SDK},/Developer/SDKs/MacOSX10.10.sdk) - SYS_LIBS := -isystem /Developer/SDKs/MacOSX10.10.sdk - SYS_MIN := -mmacosx-version-min=10.10 - endif - endif - endif -endif +SDK_PATH := $(shell xcrun --show-sdk-path) +SDK_VERSION := $(shell xcrun --show-sdk-version) +SYS_LIBS := -isystem ${SDK_PATH} +SYS_MIN := -mmacosx-version-min=${SDK_VERSION} EXTRA_CFLAGS := DARWIN_CC := $(shell which clang) @@ -169,19 +150,19 @@ endif # Use PortAudio Library # Force static linking of portaudio if the static library is available. -PA_LIB_STATIC := $(shell find /opt/local/lib -maxdepth 1 -type f -name "libportaudio.a") +PA_LIB_STATIC := $(shell find /usr/local/lib -maxdepth 1 -type f -name "libportaudio.a") #$(info $$PA_LIB_STATIC is [${PA_LIB_STATIC}]) ifeq (${PA_LIB_STATIC},) -LDLIBS += -L/opt/local/lib -lportaudio +LDLIBS += -L/usr/local/lib -lportaudio else -LDLIBS += /opt/local/lib/libportaudio.a +LDLIBS += /usr/local/lib/libportaudio.a endif # Include libraries portaudio requires. LDLIBS += -framework CoreAudio -framework AudioUnit -framework AudioToolbox LDLIBS += -framework Foundation -framework CoreServices -CFLAGS += -DUSE_PORTAUDIO -I/opt/local/include +CFLAGS += -DUSE_PORTAUDIO -I/usr/local/include # Uncomment following lines to enable GPS interface & tracker function. # Not available for MacOSX. From 019b4258fa1d15c4c7ed755f6f0049b088b92c4d Mon Sep 17 00:00:00 2001 From: mistermatt2u Date: Tue, 15 Dec 2015 22:18:14 -0500 Subject: [PATCH 2/6] Added gen_fff to 'make clean' target - The file gen_fff is created as part of the build process. However, if the build fails (or maybe even if it doesn't), the gen_fff file is not cleaned when running 'make clean'. --- Makefile.macosx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.macosx b/Makefile.macosx index 40367bb4..40d48fb1 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -472,7 +472,7 @@ depend : $(wildcard *.c) .PHONY: clean clean : - rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc \ + rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_fff gen_packets ttcalc \ fsk_fast_filter.h *.o *.a echo " " > tune.h From 3839ccf3337aaade20c2768bf194de09bb58b1aa Mon Sep 17 00:00:00 2001 From: mistermatt2u Date: Tue, 15 Dec 2015 23:06:59 -0500 Subject: [PATCH 3/6] Removed extraneous 'echo' comments. - Removed 'echo' comments about SDK needing to be located in /Developer. This is no longer the case after commit b15bf7d. --- Makefile.macosx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Makefile.macosx b/Makefile.macosx index 40d48fb1..e57813aa 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -11,14 +11,6 @@ all : direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_packets ttcalc direwolf.conf - @echo " " - @echo "Next step install with: " - @echo " " - @echo " sudo make install" - @echo " " - @echo "System SDK's (10.8 - 10.10) must be located here to make use of them. " - @echo " /Developer/SDKs " - @echo " " SDK_PATH := $(shell xcrun --show-sdk-path) SDK_VERSION := $(shell xcrun --show-sdk-version) From f71eab3ddcdc0e3341dbf1d8b313536cd2f417d1 Mon Sep 17 00:00:00 2001 From: mistermatt2u Date: Wed, 16 Dec 2015 00:06:22 -0500 Subject: [PATCH 4/6] Rollback /opt to /usr changes in commit b15bf7d - Apparently macports likes to put includes in /usr/local/include and not /opt/local/include like maybe it should. So we shouldn't change /opt to /usr for the portaudio part of the makefile. This reverts those changes, and (apparently) allows the portaudio portion to compile on 10.11 --- Makefile.macosx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile.macosx b/Makefile.macosx index e57813aa..3a2888c0 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -142,19 +142,19 @@ endif # Use PortAudio Library # Force static linking of portaudio if the static library is available. -PA_LIB_STATIC := $(shell find /usr/local/lib -maxdepth 1 -type f -name "libportaudio.a") +PA_LIB_STATIC := $(shell find /opt/local/lib -maxdepth 1 -type f -name "libportaudio.a") #$(info $$PA_LIB_STATIC is [${PA_LIB_STATIC}]) ifeq (${PA_LIB_STATIC},) -LDLIBS += -L/usr/local/lib -lportaudio +LDLIBS += -L/opt/local/lib -lportaudio else -LDLIBS += /usr/local/lib/libportaudio.a +LDLIBS += /opt/local/lib/libportaudio.a endif # Include libraries portaudio requires. LDLIBS += -framework CoreAudio -framework AudioUnit -framework AudioToolbox LDLIBS += -framework Foundation -framework CoreServices -CFLAGS += -DUSE_PORTAUDIO -I/usr/local/include +CFLAGS += -DUSE_PORTAUDIO -I/opt/local/include # Uncomment following lines to enable GPS interface & tracker function. # Not available for MacOSX. From 9dac67be80fece70f5486d158cb21d85ceea9aef Mon Sep 17 00:00:00 2001 From: mistermatt2u Date: Wed, 16 Dec 2015 19:48:50 -0500 Subject: [PATCH 5/6] Remove unnecessary manual compiler architecture selection - Remove statements that set the architecture selection that is passed to the compiler. The statemets seemed to only be an opportunity to cause build failures due to manual setting of the architecture. Perhaps it is best to let the compiler do that on its own. --- Makefile.macosx | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Makefile.macosx b/Makefile.macosx index 3a2888c0..1cff6d6e 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -26,12 +26,7 @@ else EXTRA_CFLAGS := -fvectorize -fslp-vectorize -fslp-vectorize-aggressive -pthread endif -# Change as required in support of the available libraries - -#CC := $(DARWIN_CC) -m64 $(SYS_LIBS) $(SYS_MIN) -CC := $(DARWIN_CC) -m32 $(SYS_LIBS) $(SYS_MIN) CFLAGS := -Os -pthread -Igeotranz $(EXTRA_CFLAGS) -# $(info $$CC is [${CC}]) # # The DSP filters spend a lot of time spinning around in little From fcc548923aa05b848b20c2f88f5ebea69587ae44 Mon Sep 17 00:00:00 2001 From: mistermatt2u Date: Thu, 17 Dec 2015 18:30:53 -0500 Subject: [PATCH 6/6] More adjustments to Makefile.macosx, now successfully compiles - Re-work logic to determine if make should build gps tracking support. gpsd support can now be tested. - Temporarily remove the output file of unit test 'atest'. Make was erroring out when completing that target for an unknown reason. - Direwolf now compiles sucessfully on OS X 10.11 --- Makefile.macosx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile.macosx b/Makefile.macosx index 1cff6d6e..bcc70e67 100644 --- a/Makefile.macosx +++ b/Makefile.macosx @@ -151,12 +151,14 @@ LDLIBS += -framework Foundation -framework CoreServices CFLAGS += -DUSE_PORTAUDIO -I/opt/local/include -# Uncomment following lines to enable GPS interface & tracker function. -# Not available for MacOSX. -# Although MacPorts has gpsd, wonder if it's the same thing. -#CFLAGS += -DENABLE_GPSD -#LDLIBS += -lgps +# Enable GPS interface and tracker function if the gpsd package is installed. + +ifeq ($(shell which -s gpsd),) + CFLAGS += -DENABLE_GPSD + LDLIBS += -lgps +endif + # Name of current directory. # Used to generate zip file name for distribution. @@ -401,7 +403,7 @@ testagc : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o atest : atest.c fsk_fast_filter.h demod.c dsp.c demod_afsk.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 - $(CC) $(CFLAGS) -o $@ $^ -lm + $(CC) $(CFLAGS) $^ -lm # Unit test for inner digipeater algorithm @@ -461,6 +463,7 @@ depend : $(wildcard *.c) clean : rm -f direwolf decode_aprs text2tt tt2text ll2utm utm2ll aclients atest log2gpx gen_fff gen_packets ttcalc \ fsk_fast_filter.h *.o *.a + rm -rf aclients.dSYM echo " " > tune.h