This commit is contained in:
TriForceX
2021-03-13 22:13:38 -03:00
parent c77595adbd
commit b3ecc6e32d
7043 changed files with 119377 additions and 73694 deletions

View File

@@ -0,0 +1,148 @@
From 727c37ef78f2229998ac51942f5d11c754d0c6b9 Mon Sep 17 00:00:00 2001
From: Robert Hancock <hancock@sedsystems.ca>
Date: Mon, 13 Jul 2020 17:33:48 -0600
Subject: [PATCH] Fix errors during gpsd 3.20 cross-compilation
Adapt some post-3.20 changes to the gpsd SConstruct file from the
gpsd master branch to fix issues when cross-compiling. Original
commits did not cherry-pick cleanly onto 3.20 due to other
upstream changes.
Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
---
SConstruct | 81 ++++++++++++++++++++++--------------------------------
1 file changed, 33 insertions(+), 48 deletions(-)
diff --git a/SConstruct b/SConstruct
index 33e0ff326..93e8fcfea 100644
--- a/SConstruct
+++ b/SConstruct
@@ -386,13 +386,16 @@ env['SC_PYTHON'] = sys.executable # Path to SCons Python
# So we rely on MergeFlags/ParseFlags to do the right thing for us.
env['STRIP'] = "strip"
env['PKG_CONFIG'] = "pkg-config"
-for i in ["AR", "CC", "CXX", "LD",
- "PKG_CONFIG", "STRIP", "TAR"]:
+for i in ["AR", # linker for static libs, usually "ar"
+ "CC",
+ "CXX",
+ # "LD", # scons does not use LD, usually "ld"
+ "PKG_CONFIG",
+ "SHLINK", # linker for shared libs, usually "gcc" or "g++", NOT "ld"
+ "STRIP",
+ "TAR"]:
if i in os.environ:
- j = i
- if i == "LD":
- i = "SHLINK"
- env[i] = os.getenv(j)
+ env[i] = os.getenv(i)
for i in ["ARFLAGS", "CFLAGS", "CXXFLAGS", "LDFLAGS", "SHLINKFLAGS",
"CPPFLAGS", "CCFLAGS", "LINKFLAGS"]:
if i in os.environ:
@@ -483,7 +486,7 @@ devenv = (("ADDR2LINE", "addr2line"),
("GCCBUG", "gccbug"),
("GCOV", "gcov"),
("GPROF", "gprof"),
- ("LD", "ld"),
+ # ("LD", "ld"), # scons does not use LD
("NM", "nm"),
("OBJCOPY", "objcopy"),
("OBJDUMP", "objdump"),
@@ -565,6 +568,22 @@ def CheckXsltproc(context):
return ret
+def CheckTime_t(context):
+ context.Message('Checking if sizeof(time_t) is 64 bits... ')
+ ret = context.TryLink("""
+ #include <time.h>
+
+ int main(int argc, char **argv) {
+ static int test_array[1 - 2 * ((long int) sizeof(time_t) < 8 )];
+ test_array[0] = 0;
+ (void) argc; (void) argv;
+ return 0;
+ }
+ """, '.c')
+ context.Result(ret)
+ return ret
+
+
def CheckCompilerOption(context, option):
context.Message('Checking if compiler accepts %s... ' % (option,))
old_CFLAGS = context.env['CFLAGS'][:] # Get a *copy* of the old list
@@ -597,42 +616,6 @@ def CheckHeaderDefines(context, file, define):
return ret
-def CheckSizeOf(context, type):
- """Check sizeof 'type'"""
- context.Message('Checking size of ' + type + '... ')
-
- program = """
-#include <stdlib.h>
-#include <stdio.h>
-
-/*
- * The CheckSizeOf function does not have a way for the caller to
- * specify header files to be included to provide the type being
- * checked. As a workaround until that is remedied, include the
- * header required for time_t, which is the sole current use of this
- * function.
- */
-#include <time.h>
-
-int main() {
- printf("%d", (int)sizeof(""" + type + """));
- return 0;
-}
-"""
-
- # compile it
- ret = context.TryCompile(program, '.c')
- if 0 == ret:
- announce('ERROR: TryCompile failed\n')
- # fall back to sizeof(time_t) is 8
- return '8'
-
- # run it
- ret = context.TryRun(program, '.c')
- context.Result(ret[0])
- return ret[1]
-
-
def CheckCompilerDefines(context, define):
context.Message('Checking if compiler supplies %s... ' % (define,))
ret = context.TryLink("""
@@ -708,8 +691,8 @@ config = Configure(env, custom_tests={
'CheckCompilerOption': CheckCompilerOption,
'CheckHeaderDefines': CheckHeaderDefines,
'CheckPKG': CheckPKG,
- 'CheckSizeOf': CheckSizeOf,
'CheckXsltproc': CheckXsltproc,
+ 'CheckTime_t': CheckTime_t,
'GetPythonValue': GetPythonValue,
})
@@ -1043,11 +1026,13 @@ else:
confdefs.append("/* #undef HAVE_%s_H */\n"
% hdr.replace("/", "_").upper())
- sizeof_time_t = config.CheckSizeOf("time_t")
- confdefs.append("#define SIZEOF_TIME_T %s\n" % sizeof_time_t)
- announce("sizeof(time_t) is %s" % sizeof_time_t)
- if 4 >= int(sizeof_time_t):
+ if 0 == config.CheckTime_t():
announce("WARNING: time_t is too small. It will fail in 2038")
+ sizeof_time_t = 4
+ else:
+ sizeof_time_t = 8
+
+ confdefs.append("#define SIZEOF_TIME_T %s\n" % sizeof_time_t)
# check function after libraries, because some function require libraries
# for example clock_gettime() require librt on Linux glibc < 2.17
--
2.18.4

View File

@@ -1,29 +0,0 @@
From eb7cce5dbb53a64cf55ac0d9a7fa4dcbebd4b173 Mon Sep 17 00:00:00 2001
From: Waldemar Brodkorb <wbx@openadk.org>
Date: Mon, 14 Aug 2017 23:24:38 +0200
Subject: [PATCH] SConstruct: do not force -O2 by default
-O2 can cause problems on some architectures, so do not force it by
default.
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
SConstruct | 2 --
1 file changed, 2 deletions(-)
diff --git a/SConstruct b/SConstruct
index fe444a2..93d91a4 100644
--- a/SConstruct
+++ b/SConstruct
@@ -330,8 +330,6 @@ if not 'CCFLAGS' in os.environ:
# Should we build with optimisation?
if env['debug'] or env['coveraging']:
env.Append(CCFLAGS=['-O0'])
- else:
- env.Append(CCFLAGS=['-O2'])
# Get a slight speedup by not doing automatic RCS and SCCS fetches.
env.SourceCode('.', None)
--
2.9.4

View File

@@ -44,10 +44,6 @@ config BR2_PACKAGE_GPSD_PROFILING
comment "profiling support not available with uClibc-based toolchain"
depends on !BR2_TOOLCHAIN_USES_GLIBC
config BR2_PACKAGE_GPSD_PPS
bool "PPS time syncing support"
select BR2_PACKAGE_GPSD_NTP_SHM
config BR2_PACKAGE_GPSD_USER
bool "GPSD privilege revocation user"

View File

@@ -1,3 +1,3 @@
# Locally calculated
sha256 27dd24d45b2ac69baab7933da2bf6ae5fb0be90130f67e753c110a3477155f39 gpsd-3.19.tar.gz
sha256 172a7805068eacb815a3c5225436fcb0be46e7e49a5001a94034eac43df85e50 gpsd-3.20.tar.gz
sha256 13ba6fe5b2f41f03b854f9ac5f271e116d5ed55890cc20f5fe44dcfa0dc5958b COPYING

View File

@@ -4,13 +4,13 @@
#
################################################################################
GPSD_VERSION = 3.19
GPSD_VERSION = 3.20
GPSD_SITE = http://download-mirror.savannah.gnu.org/releases/gpsd
GPSD_LICENSE = BSD-2-Clause
GPSD_LICENSE_FILES = COPYING
GPSD_INSTALL_STAGING = YES
GPSD_DEPENDENCIES = host-python host-scons host-pkgconf
GPSD_DEPENDENCIES = host-python3 host-scons host-pkgconf
GPSD_LDFLAGS = $(TARGET_LDFLAGS)
GPSD_CFLAGS = $(TARGET_CFLAGS)
@@ -25,7 +25,7 @@ GPSD_SCONS_OPTS = \
strip=no \
python=no \
qt=no \
ntpshm=yes
systemd=$(if $(BR2_INIT_SYSTEMD),yes,no)
ifeq ($(BR2_PACKAGE_NCURSES),y)
GPSD_DEPENDENCIES += ncurses
@@ -55,8 +55,8 @@ GPSD_SCONS_OPTS += usb=no
endif
# If bluetooth is available build it before so the package can use it
ifeq ($(BR2_PACKAGE_BLUEZ_UTILS),y)
GPSD_DEPENDENCIES += bluez_utils
ifeq ($(BR2_PACKAGE_BLUEZ5_UTILS),y)
GPSD_DEPENDENCIES += bluez5_utils
else
GPSD_SCONS_OPTS += bluez=no
endif
@@ -162,9 +162,6 @@ GPSD_SCONS_OPTS += ublox=no
endif
# Features
ifneq ($(BR2_PACKAGE_GPSD_PPS),y)
GPSD_SCONS_OPTS += pps=no
endif
ifeq ($(BR2_PACKAGE_GPSD_SQUELCH),y)
GPSD_SCONS_OPTS += squelch=yes
endif
@@ -199,12 +196,15 @@ ifeq ($(BR2_PACKAGE_GPSD_MAX_DEV),y)
GPSD_SCONS_OPTS += max_devices=$(BR2_PACKAGE_GPSD_MAX_DEV_VALUE)
endif
GPSD_SCONS_ENV += LDFLAGS="$(GPSD_LDFLAGS)" CFLAGS="$(GPSD_CFLAGS)"
GPSD_SCONS_ENV += \
LDFLAGS="$(GPSD_LDFLAGS)" \
CFLAGS="$(GPSD_CFLAGS)" \
CCFLAGS="$(GPSD_CFLAGS)"
define GPSD_BUILD_CMDS
(cd $(@D); \
$(GPSD_SCONS_ENV) \
$(HOST_DIR)/bin/python2 $(SCONS) \
$(HOST_DIR)/bin/python3 $(SCONS) \
$(GPSD_SCONS_OPTS))
endef
@@ -212,9 +212,9 @@ define GPSD_INSTALL_TARGET_CMDS
(cd $(@D); \
$(GPSD_SCONS_ENV) \
DESTDIR=$(TARGET_DIR) \
$(HOST_DIR)/bin/python2 $(SCONS) \
$(HOST_DIR)/bin/python3 $(SCONS) \
$(GPSD_SCONS_OPTS) \
install)
$(if $(BR2_PACKAGE_HAS_UDEV),udev-install,install))
endef
define GPSD_INSTALL_INIT_SYSV
@@ -222,25 +222,27 @@ define GPSD_INSTALL_INIT_SYSV
$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd
endef
# systemd unit files are installed automatically, but need to update the
# /usr/local path references in the provided files to /usr.
define GPSD_INSTALL_INIT_SYSTEMD
$(SED) 's%/usr/local%/usr%' \
$(TARGET_DIR)/usr/lib/systemd/system/gpsd.service \
$(TARGET_DIR)/usr/lib/systemd/system/gpsdctl@.service
endef
define GPSD_INSTALL_STAGING_CMDS
(cd $(@D); \
$(GPSD_SCONS_ENV) \
DESTDIR=$(STAGING_DIR) \
$(HOST_DIR)/bin/python2 $(SCONS) \
$(HOST_DIR)/bin/python3 $(SCONS) \
$(GPSD_SCONS_OPTS) \
install)
endef
# After installing the udev rule, make it writable so that this
# After the udev rule is installed, make it writable so that this
# package can be re-built/re-installed.
ifeq ($(BR2_PACKAGE_HAS_UDEV),y)
define GPSD_INSTALL_UDEV_RULES
(cd $(@D); \
$(GPSD_SCONS_ENV) \
DESTDIR=$(TARGET_DIR) \
$(HOST_DIR)/bin/python2 $(SCONS) \
$(GPSD_SCONS_OPTS) \
udev-install)
chmod u+w $(TARGET_DIR)/lib/udev/rules.d/25-gpsd.rules
endef