[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [gpsd-dev] [PATCH] Building test_libgps can fail with specifc build
From: |
Gary E. Miller |
Subject: |
Re: [gpsd-dev] [PATCH] Building test_libgps can fail with specifc build options. |
Date: |
Thu, 14 Jul 2016 19:39:42 -0700 |
Yo Robert!
Sorry for the delay. The patch works for me as you described.
Applied and pushed.
Thanks for the patch!
On Tue, 28 Jun 2016 22:53:33 +0000
Robert Norris <address@hidden> wrote:
> test_libgps will fail with this build command:
> scons shared=True socket_export=True minimal=True test_libgps
> resulting with undefined reference to 'libgps_dump_state' errors
>
> As test_libgps would force debugging on, yet libgps_dump_state() is
> compiled out.
>
> Simply wrap libgps_dump_state() calls with suitable ifdefs
> and don't force the LIBGPS_DEBUG define in code.
> ---
> test_libgps.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/test_libgps.c b/test_libgps.c
> index c9db543..8baadf7 100644
> --- a/test_libgps.c
> +++ b/test_libgps.c
> @@ -10,8 +10,6 @@
> #include <stdarg.h>
> #include <ctype.h>
>
> -#define LIBGPS_DEBUG
> -
> #include "gps.h"
> #include "libgps.h"
> #include "gpsdclient.h"
> @@ -94,7 +92,9 @@ int main(int argc, char *argv[])
> while (fgets(buf, sizeof(buf), stdin) != NULL) {
> if (buf[0] == '{' || isalpha(buf[0])) {
> gps_unpack(buf, &gpsdata);
> +#ifdef LIBGPS_DEBUG
> libgps_dump_state(&gpsdata);
> +#endif
> }
> }
> #endif
> @@ -115,8 +115,10 @@ int main(int argc, char *argv[])
> errno, gps_errstr(errno));
> }
> #ifdef SOCKET_EXPORT_ENABLE
> +#ifdef LIBGPS_DEBUG
> libgps_dump_state(&collect);
> #endif
> +#endif
> (void)gps_close(&collect);
> } else {
> int tty = isatty(0);
> @@ -135,8 +137,10 @@ int main(int argc, char *argv[])
> (void)gps_send(&collect, buf);
> (void)gps_read(&collect);
> #ifdef SOCKET_EXPORT_ENABLE
> +#ifdef LIBGPS_DEBUG
> libgps_dump_state(&collect);
> #endif
> +#endif
> }
> (void)gps_close(&collect);
> }
RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
address@hidden Tel:+1 541 382 8588
pgpdnnqXYJbBO.pgp
Description: OpenPGP digital signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [gpsd-dev] [PATCH] Building test_libgps can fail with specifc build options.,
Gary E. Miller <=