Skip to content

Commit 8c4c186

Browse files
committed
Automatically enable hamlib support during compile if header file is present.
1 parent c7c60c4 commit 8c4c186

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

Makefile.linux

+17-8
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,15 @@ LDFLAGS += -lgps
284284
endif
285285

286286

287-
# Uncomment following lines to enable hamlib support.
288-
# TODO: automate this too. See if hamlib has been installed.
287+
# Enable hamlib support if header file is present.
288+
289+
enable_hamlib := $(wildcard /usr/include/hamlib/rig.h /usr/local/include/hamlib/rig.h)
290+
ifneq ($(enable_hamlib),)
291+
CFLAGS += -DUSE_HAMLIB
292+
LDFLAGS += -lhamlib
293+
endif
294+
289295

290-
#CFLAGS += -DUSE_HAMLIB
291-
#LDFLAGS += -lhamlib
292296

293297

294298
# 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
312316
dwgps.o dwgpsnmea.o dwgpsd.o dtime_now.o mheard.o ax25_link.o \
313317
misc.a geotranz.a
314318
$(CC) -o $@ $^ $(LDFLAGS)
315-
ifneq ($(enable_gpsd),)
316319
@echo " "
317-
@echo "This includes support for gpsd."
320+
ifneq ($(enable_gpsd),)
321+
@echo "\t>\tThis includes support for gpsd."
318322
else
319-
@echo " "
320-
@echo "This does NOT include support for gpsd."
323+
@echo "\t>\tThis does NOT include support for gpsd."
324+
endif
325+
ifneq ($(enable_hamlib),)
326+
@echo "\t>\tThis includes support for hamlib."
327+
else
328+
@echo "\t>\tThis does NOT include support for hamlib."
321329
endif
330+
@echo " "
322331

323332
# Optimization for slow processors.
324333

doc/Raspberry-Pi-APRS.pdf

47 Bytes
Binary file not shown.

doc/User-Guide.pdf

490 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)