Use scons build system.
Add Kconfig switches for reconfigure, controlsend, group and ntpshmmon.
Remove PPS_ON_CTS.

Signed-off-by: Denis Osterland <denis.osterl...@diehl.com>
---
 ...ix-core-compiling-with-nmea-disabled.patch |  29 ----
 ...kage-if-some-drivers-are-not-enabled.patch |  48 -------
 .../0003-fix-a-simple-compile-error.patch     |  28 ----
 patches/gpsd-2.39/0004-Fix-autotool-bug.patch |  53 --------
 ...-on-AM_PATH_PYTHON-to-work-propperly.patch | 104 ---------------
 .../gpsd-2.39/0006-fix-parallel-build.patch   |  38 ------
 patches/gpsd-2.39/autogen.sh                  |   4 -
 patches/gpsd-2.39/series                      |   9 --
 ...t-crash-when-not-building-python-man.patch |  54 ++++++++
 patches/gpsd-3.18.1/series                    |   4 +
 rules/gpsd.in                                 |  33 ++++-
 rules/gpsd.make                               | 125 ++++++++++++------
 12 files changed, 171 insertions(+), 358 deletions(-)
 delete mode 100644 
patches/gpsd-2.39/0001-fix-core-compiling-with-nmea-disabled.patch
 delete mode 100644 
patches/gpsd-2.39/0002-fix-link-breakage-if-some-drivers-are-not-enabled.patch
 delete mode 100644 patches/gpsd-2.39/0003-fix-a-simple-compile-error.patch
 delete mode 100644 patches/gpsd-2.39/0004-Fix-autotool-bug.patch
 delete mode 100644 
patches/gpsd-2.39/0005-just-rely-on-AM_PATH_PYTHON-to-work-propperly.patch
 delete mode 100644 patches/gpsd-2.39/0006-fix-parallel-build.patch
 delete mode 100755 patches/gpsd-2.39/autogen.sh
 delete mode 100644 patches/gpsd-2.39/series
 create mode 100644 
patches/gpsd-3.18.1/0001-SConstruct-Do-not-crash-when-not-building-python-man.patch
 create mode 100644 patches/gpsd-3.18.1/series

diff --git a/patches/gpsd-2.39/0001-fix-core-compiling-with-nmea-disabled.patch 
b/patches/gpsd-2.39/0001-fix-core-compiling-with-nmea-disabled.patch
deleted file mode 100644
index e3e166be3..000000000
--- a/patches/gpsd-2.39/0001-fix-core-compiling-with-nmea-disabled.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From: Luotao Fu <l...@pengutronix.de>
-Date: Sun, 30 Oct 2011 22:33:40 +0100
-Subject: [PATCH] fix core compiling with nmea disabled
-
-struct nmea is only defined in the driver union if NMEA_ENABLED is set.
-libpgsd_core however acquires if the ignore_trailing_edge in nmea is set
-or not carelessly if NMEA_ENABLED is set. Add an additional ifdef of
-NMEA_ENABLE to fix this.
-
-Signed-off-by: Luotao Fu <l...@pengutronix.de>
----
-# 20110222 wsa: fixed in master meanwhile
-
- libgpsd_core.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/libgpsd_core.c b/libgpsd_core.c
-index 28f787d..4109369 100644
---- a/libgpsd_core.c
-+++ b/libgpsd_core.c
-@@ -206,7 +206,7 @@ static /*@null@*/void *gpsd_ppsmonitor(void *arg)
-           } else if (cycle > 999000 && cycle < 1001000 ) {
-               /* looks like PPS pulse or square wave */
-               if (duration > 499000 && duration < 501000
--#ifdef GPSCLOCK_ENABLE
-+#if defined(NMEA_ENABLE) && defined(GPSCLOCK_ENABLE)
-                 && session->driver.nmea.ignore_trailing_edge
- #endif /* GPSCLOCK_ENABLE */
-                 ) {
diff --git 
a/patches/gpsd-2.39/0002-fix-link-breakage-if-some-drivers-are-not-enabled.patch
 
b/patches/gpsd-2.39/0002-fix-link-breakage-if-some-drivers-are-not-enabled.patch
deleted file mode 100644
index b39161ec1..000000000
--- 
a/patches/gpsd-2.39/0002-fix-link-breakage-if-some-drivers-are-not-enabled.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From: Luotao Fu <l...@pengutronix.de>
-Date: Thu, 23 Apr 2009 18:18:54 +0200
-Subject: [PATCH] fix link breakage if some drivers are not enabled
-
-rtcm*_unpack and rtcm*_dump functions are only declared if the rtcm drivers are
-enabled during configuration. The same for aivdm. If these drivers are not
-enabled, linking will fail due to unknow reference. Add some ifdefs to avoid
-this. This is ugly ifdef hell. It'd be way eleganter to change the structures 
in
-driver code and put some function pointer checking in here. Due to lack of time
-I only did this quick hack. Better ideas are highly welcome.
-
-Signed-off-by: Luotao Fu <l...@pengutronix.de>
----
-# 20110222 wsa: fixed in master meanwhile. Like this.
-
- gpsdecode.c |    6 ++++++
- 1 files changed, 6 insertions(+), 0 deletions(-)
-
-diff --git a/gpsdecode.c b/gpsdecode.c
-index ffe898b..e18c698 100644
---- a/gpsdecode.c
-+++ b/gpsdecode.c
-@@ -57,19 +57,25 @@ static void decode(FILE *fpin, FILE *fpout)
-       else if (lexer.type == COMMENT_PACKET)
-           continue;
-       else if (lexer.type == RTCM2_PACKET) {
-+#if defined(RTCM104V2_ENABLE)
-           rtcm2_unpack(&rtcm2, (char *)lexer.isgps.buf);
-           rtcm2_dump(&rtcm2, buf, sizeof(buf));
-           (void)fputs(buf, fpout);
-+#endif
-       }
-       else if (lexer.type == RTCM3_PACKET) {
-+#if defined(RTCM104V3_ENABLE)
-           rtcm3_unpack(&rtcm3, (char *)lexer.outbuffer);
-           rtcm3_dump(&rtcm3, stdout);
-+#endif
-       }
-       else if (lexer.type == AIVDM_PACKET) {
-+#if defined(aivdm_dump)
-           /*@ -uniondef */
-           if (aivdm_decode((char *)lexer.outbuffer, lexer.outbuflen, &aivdm))
-               aivdm_dump(&aivdm.decoded, scaled, labeled, stdout);
-           /*@ +uniondef */
-+#endif
-       }
-     }
- }
diff --git a/patches/gpsd-2.39/0003-fix-a-simple-compile-error.patch 
b/patches/gpsd-2.39/0003-fix-a-simple-compile-error.patch
deleted file mode 100644
index 312102d75..000000000
--- a/patches/gpsd-2.39/0003-fix-a-simple-compile-error.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Juergen Beisert <jbeis...@pengutronix.de>
-Date: Sun, 30 Oct 2011 22:33:40 +0100
-Subject: [PATCH] fix a simple compile error
-
-This fixes the following compile error:
-
-.libs/drivers.o drivers.c:938: error: expected '}' before ';' token
-
-Signed-off-by: Juergen Beisert <jbeis...@pengutronix.de>
----
-# 20110222 wsa: fixed in master meanwhile
-
- drivers.c |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/drivers.c b/drivers.c
-index 89cd772..373476f 100644
---- a/drivers.c
-+++ b/drivers.c
-@@ -935,7 +935,7 @@ static gps_mask_t garmintxt_parse_input(struct 
gps_device_t *session)
- 
- static const struct gps_type_t garmintxt = {
-     .type_name     = "Garmin Simple Text",            /* full name of type */
--    .packet_type   = RTCM2_PACKET;    /* associated lexer packet type */
-+    .packet_type   = RTCM2_PACKET,    /* associated lexer packet type */
-     .trigger       = NULL,            /* no recognition string */
-     .channels      = 0,                       /* not used */
-     .probe_wakeup  = NULL,            /* no wakeup to be done before hunt */
diff --git a/patches/gpsd-2.39/0004-Fix-autotool-bug.patch 
b/patches/gpsd-2.39/0004-Fix-autotool-bug.patch
deleted file mode 100644
index d1054186f..000000000
--- a/patches/gpsd-2.39/0004-Fix-autotool-bug.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From: Luotao Fu <l...@pengutronix.de>
-Date: Thu, 23 Apr 2009 15:15:21 +0200
-Subject: [PATCH] Fix autotool bug
-
-Original by Richard Hansen:
-Autoconf has a longstanding bug in AC_REQUIRE that causes out-of-order
-macro expansion problems.  This patch works around the Autoconf bug.
-
-lfu:
-This one fixes the configure script fails if run with --disable-python.
-Some macro needed by dependency tracker is errorneously expanded inside the
-python check condition, which cause that these will be failed to be set if
-python is not enabled.
-
-Signed-off-by: FIXME
----
-# 20110222 wsa: fixed in master meanwhile
-
- configure.ac |   21 +++++++++++++++++++++
- 1 files changed, 21 insertions(+), 0 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 7db2a6c..67e9253 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -5,6 +5,27 @@ dnl AC_PREFIX_PROGRAM(gcc)
- AM_CONFIG_HEADER(gpsd_config.h)
- AC_LANG([C])
- 
-+# ACREQUIRE_BUGFIX
-+# ----------------
-+# Due to a longstanding Autoconf bug (Autoconf 2.50 to at least 2.63),
-+# any macro that is AC_REQUIREd at any point must be AC_REQUIREd
-+# *before* it is directly expanded.  The macros below were being
-+# directly expanded before being AC_REQUIREd, so we AC_REQUIRE them
-+# early to prevent out-of-order expansion problems.  See the threads
-+# at:
-+# http://lists.gnu.org/archive/html/bug-autoconf/2008-12/msg00039.html
-+# http://lists.gnu.org/archive/html/autoconf-patches/2008-12/msg00058.html
-+# http://lists.gnu.org/archive/html/bug-autoconf/2009-01/msg00019.html
-+# http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00247.html
-+AC_DEFUN_ONCE([ACREQUIRE_BUGFIX],
-+[
-+  AC_REQUIRE([AC_PROG_CPP])
-+  AC_REQUIRE([AC_PROG_EGREP])
-+  AC_REQUIRE([AC_PROG_CC])
-+])
-+ACREQUIRE_BUGFIX
-+# ACREQUIRE_BUGFIX done
-+
- AC_ARG_ENABLE(python,
-   AC_HELP_STRING([--disable-python],
-                [disable python scripts and library bindings]),
diff --git 
a/patches/gpsd-2.39/0005-just-rely-on-AM_PATH_PYTHON-to-work-propperly.patch 
b/patches/gpsd-2.39/0005-just-rely-on-AM_PATH_PYTHON-to-work-propperly.patch
deleted file mode 100644
index 648146116..000000000
--- a/patches/gpsd-2.39/0005-just-rely-on-AM_PATH_PYTHON-to-work-propperly.patch
+++ /dev/null
@@ -1,104 +0,0 @@
-From: Marc Kleine-Budde <m...@pengutronix.de>
-Date: Sun, 30 Oct 2011 22:33:40 +0100
-Subject: [PATCH] just rely on AM_PATH_PYTHON to work propperly
-
-remove hand crafted python detection and detection of
-PYTHON_LIBS and PYTHON_CFLAGS, they are not used anyway.
-
-Signed-off-by: Marc Kleine-Budde <m...@pengutronix.de>
----
- configure.ac |   77 ++++------------------------------------------------------
- 1 files changed, 5 insertions(+), 72 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 67e9253..08f99a8 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -27,82 +27,15 @@ ACREQUIRE_BUGFIX
- # ACREQUIRE_BUGFIX done
- 
- AC_ARG_ENABLE(python,
--  AC_HELP_STRING([--disable-python],
-+  AS_HELP_STRING([--disable-python],
-                [disable python scripts and library bindings]),
-   [try_python="$enableval"], [try_python="yes"])
--if test "x$try_python" = "xyes"; then
--      AM_PATH_PYTHON
--      ac_python=yes
--      if test "x$PYTHON" = "x"; then
--              AC_PATH_PROG(PYTHON, python, none)
--      fi
--
--      if test "x$PYTHON" = "xnone"; then
--      AC_MSG_WARN([*** Python interpreter not found, Python support 
disabled.])
--              ac_python=no
--      fi
--
--      if test "x$ac_python" = "xyes"; then
--              AC_MSG_CHECKING(Python version and location)
--              PYTHON_PREFIX=`$PYTHON -c "import sys; print sys.prefix"`
--              PYTHON_VERSION_MAJOR=[`$PYTHON -c "import sys; print '%d' % 
(sys.version_info[0]);"`]
--              PYTHON_VERSION_MINOR=[`$PYTHON -c "import sys; print '%d' % 
(sys.version_info[1]);"`]
--              PYTHON_VERSION="${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}"
--              AC_MSG_RESULT([$PYTHON, $PYTHON_VERSION, $PYTHON_PREFIX])
--
--              AC_MSG_CHECKING(whether Python is at least 2.4)
--              if test $PYTHON_VERSION_MAJOR -lt 2 -o $PYTHON_VERSION_MAJOR 
-eq 2 -a $PYTHON_VERSION_MINOR -lt 3; then
--                      AC_MSG_RESULT(no)
--                      AC_MSG_WARN([*** GPSD requires at least Python 2.3, 
Python support disabled.])
--                      ac_python=no
--              fi
--              if test "x$ac_python" = "xyes"; then
--                      AC_MSG_RESULT(yes)
--
--                      PYTHON_CFLAGS="-DHAVE_PYTHON 
-I$PYTHON_PREFIX/include/python$PYTHON_VERSION"
--
--                      OLD_CPPFLAGS="$CPPFLAGS"
--                      OLD_CXXFLAGS="$CXXFLAGS"
--                      CPPFLAGS="$CPPFLAGS $PYTHON_CFLAGS"
--                      CXXFLAGS="$CXXFLAGS $PYTHON_CFLAGS"
--
--                      AC_CHECK_HEADERS([Python.h],
--                                      [],
--                                      [AC_MSG_WARN([*** Python include files 
not found! You should install the Python development package. Python support 
disabled]); ac_python=no])
--                      CPPFLAGS="$OLD_CPPFLAGS"
--                      CXXFLAGS="$OLD_CXXFLAGS"
- 
--                      if test "x$ac_python" = "xyes"; then
--                              AC_SUBST([PYTHON_CFLAGS])
--
--                              ac_python=no
--                              for pylibpath in '/usr/lib' $PYTHON_PREFIX/lib 
$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config; do
--                                      eval `echo unset 
ac_cv_lib_python$PYTHON_VERSION'___'Py_Finalize | tr '.' '_'`
--
--                                      save_LIBS=$LIBS
--                                      LIBS="$LIBS -L$pylibpath $PYTHON_LIBS"
--                                      AC_CHECK_LIB(python$PYTHON_VERSION, 
Py_Finalize, PYTHON_LIBS="-L$pylibpath -lpython$PYTHON_VERSION $PYTHON_DEPS"; 
ac_python=yes,,$PYTHON_DEPS)
--                                      LIBS=$save_LIBS
--                                      if test "x$ac_python" = "xyes"; then
--                                              break
--                                      fi
--                              done
--
--                              if test "x$ac_python" != "xyes"; then
--                                      AC_MSG_WARN(*** Python development 
libraries required, Python support disabled)
--                              fi
--                              AC_SUBST([PYTHON_LIBS])
--
--                              AC_SUBST(pkgpythondir)
--                              if test "x$python_install" = "xyes"; then
--                                      
pkgpythondir=$PYTHON_PREFIX"/lib/python"$PYTHON_VERSION"/site-packages/gpsd"
--                              fi
--
--                      fi
--              fi
--      fi
-+if test "x$try_python" = "xyes"; then
-+  AM_PATH_PYTHON([2.4], [have_python=yes], [have_python=no])
- fi
--AM_CONDITIONAL([HAVE_PYTHON], [test x"$ac_python" = xyes])
-+
-+AM_CONDITIONAL([HAVE_PYTHON], [test "${have_python}" = "yes"])
- 
- AC_PROG_LN_S
- AC_PROG_MAKE_SET
diff --git a/patches/gpsd-2.39/0006-fix-parallel-build.patch 
b/patches/gpsd-2.39/0006-fix-parallel-build.patch
deleted file mode 100644
index 1ee26f2c0..000000000
--- a/patches/gpsd-2.39/0006-fix-parallel-build.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From: Robert Schwebel <r.schwe...@pengutronix.de>
-Date: Sun, 30 Oct 2011 22:33:40 +0100
-Subject: [PATCH] fix parallel build
-
-The build system has a race with the creation of the python bindings; if
-both targets of the "gpspacket.so gpslib.so:" rule are started at the
-same time, the build "sometimes" breaks; this can be triggered with only
-a few cycles when built with -j16 on a 8-way box.
-
-Signed-off-by: Robert Schwebel <r.schwe...@pengutronix.de>
----
- Makefile.am |    9 +++++++--
- 1 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/Makefile.am b/Makefile.am
-index 05e31f0..818c57a 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -187,12 +187,17 @@ if HAVE_PYTHON
- PYEXTENSIONS = gpspacket.so gpslib.so
- noinst_SCRIPTS = gpspacket.so gpslib.so setup.py
- 
--gpspacket.so gpslib.so: gpspacket.c gpslib.c libgps.la
-+.PHONY: build_python_ext
-+build_python_ext: gpspacket.c gpslib.c libgps.la
-       (pwd="`pwd`"; cd $(srcdir) && $(PYTHON) setup.py build_ext --build-lib 
"$$pwd" --build-temp "$$pwd/build" --include-dirs "$$pwd")
--endif
-+
-+gpspacket.so: build_python_ext
-+gpslib.so: build_python_ext
-+
- # Clean up after Python
- clean-local:
-       rm -rf build
-+endif
- 
- #
- # Build test_gpsmm
diff --git a/patches/gpsd-2.39/autogen.sh b/patches/gpsd-2.39/autogen.sh
deleted file mode 100755
index f2a0d7c3a..000000000
--- a/patches/gpsd-2.39/autogen.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-
-./autogen.sh --help
-
diff --git a/patches/gpsd-2.39/series b/patches/gpsd-2.39/series
deleted file mode 100644
index 4c18748c4..000000000
--- a/patches/gpsd-2.39/series
+++ /dev/null
@@ -1,9 +0,0 @@
-# generated by git-ptx-patches
-#tag:base --start-number 1
-0001-fix-core-compiling-with-nmea-disabled.patch
-0002-fix-link-breakage-if-some-drivers-are-not-enabled.patch
-0003-fix-a-simple-compile-error.patch
-0004-Fix-autotool-bug.patch
-0005-just-rely-on-AM_PATH_PYTHON-to-work-propperly.patch
-0006-fix-parallel-build.patch
-# 78d23d82a5e7a26d3f088a02c22c703d  - git-ptx-patches magic
diff --git 
a/patches/gpsd-3.18.1/0001-SConstruct-Do-not-crash-when-not-building-python-man.patch
 
b/patches/gpsd-3.18.1/0001-SConstruct-Do-not-crash-when-not-building-python-man.patch
new file mode 100644
index 000000000..04968aeaa
--- /dev/null
+++ 
b/patches/gpsd-3.18.1/0001-SConstruct-Do-not-crash-when-not-building-python-man.patch
@@ -0,0 +1,54 @@
+From: "Gary E. Miller" <g...@rellim.com>
+Date: Thu, 1 Nov 2018 15:49:01 -0700
+Subject: [PATCH] SConstruct: Do not crash when not building python man pages.
+
+[cherry-pick 02d21faebec245e1526449fb54e7078914d75db7]
+Signed-off-by: Denis Osterland <denis.osterl...@diehl.com>
+---
+ SConstruct | 13 +++++++++----
+ 1 file changed, 9 insertions(+), 4 deletions(-)
+
+diff --git a/SConstruct b/SConstruct
+index b8f3fb1dc541..edbb434a2c54 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -1751,14 +1751,19 @@ if tiocmiwait:
+         "ppscheck.8": "ppscheck.xml",
+     })
+ 
+-all_manpages = list(base_manpages.keys()) + list(python_manpages.keys())
++all_manpages = list(base_manpages.keys())
++if python_manpages:
++    all_manpages += list(python_manpages.keys())
+ 
+ man_env = env.Clone()
+ if man_env.GetOption('silent'):
+     man_env['SPAWN'] = filtered_spawn  # Suppress stderr chatter
+ manpage_targets = []
+ if manbuilder:
+-    items = list(base_manpages.items()) + list(python_manpages.items())
++    items = list(base_manpages.items())
++    if python_manpages:
++        items += list(python_manpages.items())
++
+     for (man, xml) in items:
+         manpage_targets.append(man_env.Man(source=xml, target=man))
+ 
+@@ -1907,7 +1912,7 @@ if qt_env:
+ 
+ 
+ maninstall = []
+-for manpage in list(base_manpages.keys()) + list(python_manpages.keys()):
++for manpage in all_manpages:
+     if not manbuilder and not os.path.exists(manpage):
+         continue
+     section = manpage.split(".")[1]
+@@ -2517,7 +2522,7 @@ if os.path.exists("gpsd.c") and 
os.path.exists(".gitignore"):
+     if ".gitignore" in distfiles:
+         distfiles.remove(".gitignore")
+     distfiles += generated_sources
+-    distfiles += list(base_manpages.keys()) + list(python_manpages.keys())
++    distfiles += all_manpages
+     if "packaging/rpm/gpsd.spec" not in distfiles:
+         distfiles.append("packaging/rpm/gpsd.spec")
+ 
diff --git a/patches/gpsd-3.18.1/series b/patches/gpsd-3.18.1/series
new file mode 100644
index 000000000..ba97ac90b
--- /dev/null
+++ b/patches/gpsd-3.18.1/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-SConstruct-Do-not-crash-when-not-building-python-man.patch
+# f09e4e5d0f6524f690ad968bf592a3cb  - git-ptx-patches magic
diff --git a/rules/gpsd.in b/rules/gpsd.in
index ff270cff5..3c3b1bfa8 100644
--- a/rules/gpsd.in
+++ b/rules/gpsd.in
@@ -1,6 +1,7 @@
 ## SECTION=system_libraries
 menuconfig GPSD
        tristate
+       select HOST_PYTHON_SCONS
        select LIBC_M
        select LIBC_NSL
        select LIBC_PTHREAD
@@ -35,14 +36,20 @@ config GPSD_NTPSHM
        bool
        prompt "ntpshm"
 
+config GPSD_RECONFIGURE
+       bool "enable reconfigure"
+       help
+         allow gpsd to change device settings
+
+config GPSD_CONTROLSEND
+       bool "enable controlsend"
+       help
+         allow gpsctl/gpsmon to change device settings
+
 config GPSD_PPS
        bool
        prompt "pps"
 
-config GPSD_PPS_ON_CTS
-       bool
-       prompt "pps_on_cts"
-
 config GPSD_USER
        string
        default "root"
@@ -50,6 +57,12 @@ config GPSD_USER
        help
          This user is used for privilege separation.
 
+config GPSD_GROUP
+       string "gpsd group"
+       default "root"
+       help
+         This group is used for privilege separation.
+
 config GPSD_FIXED_PORT_SPEED
        string
        prompt "fixed port speed"
@@ -288,6 +301,18 @@ menu "install options"
                  that draws an illustrative graph. It can also be told to
                  emit the raw profile data.
 
+       config GPSD_NTPSHMMON
+               bool "ntpshmmon"
+               select GPSD_NTPSHM
+               help
+                 Capture samples from GPS or other ntpd refclock sources.
+                 This program monitors the shared-memory segments updated by
+                 gpsd (and possibly other refclock sources) as a way of
+                 communicating with ntpd, the Network Time Protocol daemon.
+                 It reads these in exactly the way an ntpd instance does.
+                 It can be run concurrently with ntpd without interfering with
+                 ntpd's normal operation.
+
 endmenu
 
 endif
diff --git a/rules/gpsd.make b/rules/gpsd.make
index 85b587df0..4b789a080 100644
--- a/rules/gpsd.make
+++ b/rules/gpsd.make
@@ -17,70 +17,110 @@ PACKAGES-$(PTXCONF_GPSD) += gpsd
 #
 # Paths and names
 #
-GPSD_VERSION   := 2.39
-GPSD_MD5       := 3db437196a6840c252fca99b6c19d4d0
+GPSD_VERSION   := 3.18.1
+GPSD_MD5       := 3b11f26b295010666b1767b308f90bc5
 GPSD           := gpsd-$(GPSD_VERSION)
 GPSD_SUFFIX    := tar.gz
-GPSD_URL       := $(call ptx/mirror, SF, gpsd.berlios/$(GPSD).$(GPSD_SUFFIX))
+GPSD_URL       := 
http://download-mirror.savannah.gnu.org/releases/gpsd/$(GPSD).$(GPSD_SUFFIX)
 GPSD_SOURCE    := $(SRCDIR)/$(GPSD).$(GPSD_SUFFIX)
 GPSD_DIR       := $(BUILDDIR)/$(GPSD)
+GPSD_LICENSE   := BSD-3-Clause
+GPSD_LICENSE_FILES     := file://COPYING;md5=d217a23f408e91c94359447735bc1800
 
 # ----------------------------------------------------------------------------
 # Prepare
 # ----------------------------------------------------------------------------
 
+GPSD_CONF_TOOL := NO
+
 GPSD_ENV = \
        $(CROSS_ENV) \
        PYTHON=$(CROSS_PYTHON)
 
-#
-# autoconf
-#
-GPSD_AUTOCONF := \
-       $(CROSS_AUTOCONF_USR) \
-       --without-x \
-       --$(call ptx/endis, PTXCONF_GPSD_PYTHON)-python \
-       --$(call ptx/endis, PTXCONF_GPSD_PROFILING)-profiling \
-       --$(call ptx/endis, PTXCONF_GPSD_NTPSHM)-ntpshm \
-       --$(call ptx/endis, PTXCONF_GPSD_PPS)-pps \
-       --$(call ptx/endis, PTXCONF_GPSD_PPS_ON_CTS)-pps-on-cts \
-       --$(call ptx/endis, PTXCONF_GPSD_DBUS)-dbus \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_NMEA)-nmea \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_SIRF)-sirf \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_TSIP)-tsip \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_FV18)-fv18 \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_TRIPMATE)-tripmate \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_EARTHMATE)-earthmate \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_ITRAX)-itrax \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_ASHTECH)-ashtech \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_NAVCOM)-navcom \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_GARMIN)-garmin \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_GARMINTXT)-garmintxt \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_TNT)-tnt \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_UBX)-ubx \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_EVERMORE)-evermore \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_GPSCLOCK)-gpsclock \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_RTCM104V2)-rtcm104v2 \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_RTCM104V3)-rtcm104v3 \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_NTRIP)-ntrip \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_SUPERSTAR2)-superstar2 \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_OCEANSERVER)-oceanserver \
-       --$(call ptx/endis, PTXCONF_GPSD_DRIVER_MKT3301)-mkt3301
+GPSD_SCONS_OPTS := \
+       arch=$(PTXCONF_ARCH_STRING) \
+       manbuild=no \
+       prefix=/usr \
+       sysroot= \
+       nostrip=yes \
+       python=$(call ptx/yesno, PTXCONF_GPSD_PYTHON) \
+       ncurses=$(call ptx/yesno, PTXCONF_NCURSES) \
+       libgpsmm=no \
+       qt=no \
+       usb=no \
+       bluez=no \
+       dbus_export=$(call ptx/yesno, PTXCONF_GPSD_DBUS) \
+       ashtech=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_ASHTECH) \
+       aivdm=no \
+       earthmate=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_EARTHMATE) \
+       evermore=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_EVERMORE) \
+       fury=no \
+       fv18=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_FV18) \
+       garmin=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_GARMIN) \
+       garmintxt=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_GARMINTXT) \
+       geostar=no \
+       gpsclock=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_GPSCLOCK) \
+       greis=no \
+       isync=no \
+       itrax=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_ITRAX) \
+       mtk3301=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_MKT3301) \
+       nmea0183=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_NMEA) \
+       ntrip=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_NTRIP) \
+       navcom=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_NAVCOM) \
+       nmea2000=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_NMEA) \
+       oceanserver=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_OCEANSERVER) \
+       oncore=no \
+       rtcm104v2=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_RTCM104V2) \
+       rtcm104v3=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_RTCM104V3) \
+       sirf=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_SIRF) \
+       superstar2=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_SUPERSTAR2) \
+       tsip=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_TSIP) \
+       tripmate=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_TRIPMATE) \
+       tnt=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_TNT) \
+       ublox=$(call ptx/yesno, PTXCONF_GPSD_DRIVER_UBX) \
+       ntpshm=$(call ptx/yesno, PTXCONF_GPSD_NTPSHM) \
+       pps=$(call ptx/yesno, PTXCONF_GPSD_PPS) \
+       squelch=no \
+       reconfigure=$(call ptx/yesno, PTXCONF_GPSD_RECONFIGURE) \
+       controlsend=$(call ptx/yesno, PTXCONF_GPSD_CONTROLSEND) \
+       oldstyle=no \
+       profiling=$(call ptx/yesno, PTXCONF_GPSD_PROFILING) \
+       clientdebug=no
 
 ifneq ($(call remove_quotes,$(PTXCONF_GPSD_USER)),)
-GPSD_AUTOCONF += --enable-gpsd-user=$(PTXCONF_GPSD_USER)
+GPSD_SCONS_OPTS += gpsd_user=$(PTXCONF_GPSD_USER)
+endif
+ifneq ($(call remove_quotes,$(PTXCONF_GPSD_GROUP)),)
+GPSD_SCONS_OPTS += gpsd_group=$(PTXCONF_GPSD_GROUP)
 endif
 ifneq ($(call remove_quotes,$(PTXCONF_GPSD_FIXED_PORT_SPEED)),)
-GPSD_AUTOCONF += --enable-fixed-port-speed=$(PTXCONF_GPSD_FIXED_PORT_SPEED)
+GPSD_SCONS_OPTS += fixed_port_speed=$(PTXCONF_GPSD_FIXED_PORT_SPEED)
 endif
-
 ifneq ($(call remove_quotes,$(PTXCONF_GPSD_MAX_CLIENTS)),)
-GPSD_AUTOCONF += --enable-max-clients=$(PTXCONF_GPSD_MAX_CLIENTS)
+GPSD_SCONS_OPTS += limited_max_clients=$(PTXCONF_GPSD_MAX_CLIENTS)
 endif
 ifneq ($(call remove_quotes,$(PTXCONF_GPSD_MAX_DEVICES)),)
-GPSD_AUTOCONF += --enable-max-devices=$(PTXCONF_GPSD_MAX_DEVICES)
+GPSD_SCONS_OPTS += limited_max_devices=$(PTXCONF_GPSD_MAX_DEVICES)
 endif
 
+# ----------------------------------------------------------------------------
+# Compile
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/gpsd.compile:
+       @$(call targetinfo)
+       cd $(GPSD_DIR) && $(GPSD_ENV) scons $(GPSD_SCONS_OPTS)
+       @$(call touch)
+
+# ----------------------------------------------------------------------------
+# Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/gpsd.install:
+       @$(call targetinfo)
+       cd $(GPSD_DIR) && $(GPSD_ENV) DESTDIR=$(GPSD_PKGDIR) scons 
$(GPSD_SCONS_OPTS) install
+       @$(call touch)
+
 # ----------------------------------------------------------------------------
 # Target-Install
 # ----------------------------------------------------------------------------
@@ -130,6 +170,9 @@ endif
 ifdef PTXCONF_GPSD_GPSPROF
        @$(call install_copy, gpsd, 0, 0, 0755, -, /usr/bin/gpsprof)
 endif
+ifdef PTXCONF_GPSD_NTPSHMMON
+       @$(call install_copy, gpsd, 0, 0, 0755, -, /usr/bin/ntpshmmon)
+endif
 
 ifdef PTXCONF_GPSD_PYTHON
        @cd $(GPSD_PKGDIR) && \
-- 
2.20.1



Diehl Connectivity Solutions GmbH
Geschäftsführung: Horst Leonberger
Sitz der Gesellschaft: Nürnberg - Registergericht: Amtsgericht
Nürnberg: HRB 32315
___________________________________________________________________________________________________

Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail 
enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen.
Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten 
haben. Bitte loeschen Sie in diesem Fall die Nachricht.
Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung 
und/oder Publikation dieser E-Mail ist strengstens untersagt.
The contents of the above mentioned e-mail is not legally binding. This e-mail 
contains confidential and/or legally protected information. Please inform us if 
you have received this e-mail by
mistake and delete it in such a case. Each unauthorized reproduction, 
disclosure, alteration, distribution and/or publication of this e-mail is 
strictly prohibited. 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

Reply via email to