From 5fbef72af327b54c7e6b91c78bced9e6074116f1 Mon Sep 17 00:00:00 2001 From: Nate Bargmann Date: Wed, 19 Nov 2014 22:02:30 -0600 Subject: [PATCH] Properly exclude non-Linux/MS Windows build of G313 While the Winradio G313 backend wasn't being compiled on a non-Linux POSIX system, the register function in winradio.c was which caused an error linking rigctl. Also, the host_os test in the configure script now looks for a string containg "*linux-gnu*" which accepts such systems as the Raspberry Pi which is defined as "linux-gnueabihf". Thanks to Lorenzo Simoncello, IW3HER, for reporting this build error on the Raspberry Pi. --- configure.ac | 6 +++++- winradio/winradio.c | 6 ++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 0af57e34a..adb73231c 100644 --- a/configure.ac +++ b/configure.ac @@ -619,13 +619,17 @@ AS_CASE(["$host_os"], ], dnl As g313-posix.c has a hard dependency on linux/types.h dnl via linradio/wrg313api.h, disable compilation on other POSIX. - [ *linux-gnu ], [ +dnl (Certain systems have extra characters following "-gnu" such as +dnl the Raspberry Pi which is "linux-gnueabihf"; presume that "linux-gnu" +dnl is a sufficient test.) + [ *linux-gnu* ], [ AM_CONDITIONAL(G313_LINUX_GNU, true) AM_CONDITIONAL(G313_WINDOWS, false) ], [ AM_CONDITIONAL(G313_LINUX_GNU, false) AM_CONDITIONAL(G313_WINDOWS, false) + AC_DEFINE([OTHER_POSIX], [1], [Compilation on POSIX other than Linux]) ]) dnl If libdl is present, check for its header file. diff --git a/winradio/winradio.c b/winradio/winradio.c index a4bd38395..24411c9f0 100644 --- a/winradio/winradio.c +++ b/winradio/winradio.c @@ -252,11 +252,9 @@ DECLARE_INITRIG_BACKEND(winradio) #endif #endif - /* Not available on MS Windows */ -#ifndef _WIN32 -#ifndef __CYGWIN__ + /* Available on Linux and MS Windows */ +#ifndef OTHER_POSIX rig_register(&g313_caps); -#endif #endif return RIG_OK;