Automatically enable hamlib support during compile if header file is present.

This commit is contained in:
WB2OSZ 2017-06-30 22:42:48 -04:00
parent c7c60c4a35
commit 8c4c186730
3 changed files with 17 additions and 8 deletions

View File

@ -284,11 +284,15 @@ LDFLAGS += -lgps
endif endif
# Uncomment following lines to enable hamlib support. # Enable hamlib support if header file is present.
# TODO: automate this too. See if hamlib has been installed.
enable_hamlib := $(wildcard /usr/include/hamlib/rig.h /usr/local/include/hamlib/rig.h)
ifneq ($(enable_hamlib),)
CFLAGS += -DUSE_HAMLIB
LDFLAGS += -lhamlib
endif
#CFLAGS += -DUSE_HAMLIB
#LDFLAGS += -lhamlib
# Name of current directory. # Name of current directory.
@ -312,13 +316,18 @@ direwolf : direwolf.o config.o recv.o demod.o dsp.o demod_afsk.o demod_psk.o dem
dwgps.o dwgpsnmea.o dwgpsd.o dtime_now.o mheard.o ax25_link.o \ dwgps.o dwgpsnmea.o dwgpsd.o dtime_now.o mheard.o ax25_link.o \
misc.a geotranz.a misc.a geotranz.a
$(CC) -o $@ $^ $(LDFLAGS) $(CC) -o $@ $^ $(LDFLAGS)
@echo " "
ifneq ($(enable_gpsd),) ifneq ($(enable_gpsd),)
@echo " " @echo "\t>\tThis includes support for gpsd."
@echo "This includes support for gpsd."
else else
@echo " " @echo "\t>\tThis does NOT include support for gpsd."
@echo "This does NOT include support for gpsd."
endif endif
ifneq ($(enable_hamlib),)
@echo "\t>\tThis includes support for hamlib."
else
@echo "\t>\tThis does NOT include support for hamlib."
endif
@echo " "
# Optimization for slow processors. # Optimization for slow processors.

Binary file not shown.

Binary file not shown.