Skip to content

Instantly share code, notes, and snippets.

@tpopela
Last active January 2, 2019 12:03
Show Gist options
  • Save tpopela/5d48c2bfe93ec31c73a9e35bfebdaa22 to your computer and use it in GitHub Desktop.
Save tpopela/5d48c2bfe93ec31c73a9e35bfebdaa22 to your computer and use it in GitHub Desktop.
Google Earth Enterprise 5.3.0 compilation on Fedora 29
commit bfb87b58931bd9e0c89e2f40ee10d89a1fe07356
Author: Tomas Popela <[email protected]>
Date: Wed Jan 2 11:32:23 2019 +0100
Fix compilation of GEE 5.3.0 on Fedora 29
diff --git a/earth_enterprise/src/SConstruct b/earth_enterprise/src/SConstruct
index ae44c44..17bccc1 100644
--- a/earth_enterprise/src/SConstruct
+++ b/earth_enterprise/src/SConstruct
@@ -245,10 +245,22 @@ else:
dynamiclibs = {}
# TODO: remove this and fix all places where we see this warnings.
+# common/geFilePool.cpp:571:77: error: throw will always call terminate() [-Werror=terminate]
+# common/packetfile/packetindex.cpp:73:28: error: catching polymorphic type 'class khSimpleException' by value [-Werror=catch-value=]
+# NATIVE-REL-x86_64/protobuf/streaming_imagery.pb.cc:223:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
+# common/packet.cpp:165:53: error: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'struct etDataHeader' with no trivial copy-assignment [-Werror=class-memaccess]
+# common/packet.cpp:419:23: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
+# common/packet.cpp:299:18: error: '.header' directive writing 7 bytes into a region of size between 1 and 500 [-Werror=format-overflow=]
if native_cc:
warnflags += ['-Wno-error=unused-result',
'-Wno-error=unused-local-typedefs',
- '-Wno-error=unused-but-set-variable']
+ '-Wno-error=unused-but-set-variable',
+ '-Wno-error=terminate',
+ '-Wno-error=catch-value=',
+ '-Wno-error=misleading-indentation',
+ '-Wno-error=class-memaccess',
+ '-Wno-error=memset-elt-size',
+ '-Wno-error=format-overflow=']
if max_num_jobs_coeff:
cppflags += ['-DKH_MAX_NUM_JOBS_COEFF=%s' % max_num_jobs_coeff]
diff --git a/earth_enterprise/src/common/khxml/khdom.h b/earth_enterprise/src/common/khxml/khdom.h
index 17a271f..d99cc2e 100644
--- a/earth_enterprise/src/common/khxml/khdom.h
+++ b/earth_enterprise/src/common/khxml/khdom.h
@@ -691,7 +691,7 @@ inline
void
FromAttribute(khxml::DOMAttr *attr, QString &val)
{
- val = QString::fromUcs2(attr->getValue());
+ val = QString::fromUcs2(reinterpret_cast<const ushort*>(attr->getValue()));
}
inline
@@ -712,7 +712,7 @@ GetTextAndCDATA(khxml::DOMElement *elem)
(node->getNodeType() == khxml::DOMNode::CDATA_SECTION_NODE)) {
khxml::DOMCharacterData* data = static_cast<khxml::DOMCharacterData*>(node);
if (data->getLength() > 0) {
- result.append(QString::fromUcs2(data->getData()));
+ result.append(QString::fromUcs2(reinterpret_cast<const ushort*>(data->getData())));
}
}
node = node->getNextSibling();
@@ -783,7 +783,7 @@ FromElement(khxml::DOMElement *elem, QString &val)
val = "";
val.squeeze();
} else {
- val = QString::fromUcs2((static_cast<khxml::DOMText*>(valNode))->getData());
+ val = QString::fromUcs2(reinterpret_cast<const ushort*>((static_cast<khxml::DOMText*>(valNode))->getData()));
}
}
@@ -807,10 +807,10 @@ FromElement(khxml::DOMElement *elem, EncryptedQString &val)
khxml::DOMCharacterData* data = static_cast<khxml::DOMCharacterData*>(node);;
if (data->getLength() > 0) {
if (method == "plaintext") {
- val = QString::fromUcs2(data->getData());
+ val = QString::fromUcs2(reinterpret_cast<const ushort*>(data->getData()));
return;
} else if (method == "simple") {
- QString tmp = QString::fromUcs2(data->getData());
+ QString tmp = QString::fromUcs2(reinterpret_cast<const ushort*>(data->getData()));
for (uint i = 0; i < tmp.length(); ++i) {
tmp[i] = tmp[i].unicode() - 13;
}
@@ -1046,7 +1046,7 @@ FromElement(khxml::DOMElement *elem, std::map<QString, U> &map)
while (node) {
if (node->getNodeType() == khxml::DOMNode::ELEMENT_NODE) {
khxml::DOMElement *elem = static_cast<khxml::DOMElement*>(node);
- QString name = QString::fromUcs2(elem->getTagName());
+ QString name = QString::fromUcs2(reinterpret_cast<const ushort*>(elem->getTagName()));
U value;
FromElement(elem, value);
map.insert(std::make_pair(name, value));
diff --git a/earth_enterprise/src/common/khxml/khxml.h b/earth_enterprise/src/common/khxml/khxml.h
index a7e614b..9df5992 100644
--- a/earth_enterprise/src/common/khxml/khxml.h
+++ b/earth_enterprise/src/common/khxml/khxml.h
@@ -92,7 +92,7 @@ inline
QString
XMLStr2QString(const XMLCh *xmlch)
{
- return QString::fromUcs2(xmlch);
+ return QString::fromUcs2(reinterpret_cast<const ushort*>(xmlch));
}
diff --git a/earth_enterprise/src/fusion/autoingest/SConscript b/earth_enterprise/src/fusion/autoingest/SConscript
index 0a4ea16..7492e2e 100644
--- a/earth_enterprise/src/fusion/autoingest/SConscript
+++ b/earth_enterprise/src/fusion/autoingest/SConscript
@@ -25,6 +25,7 @@ env = origenv.Clone();
env.Append(CPPPATH = ['#fusion/autoingest', # static header files
])
+env['CXXFLAGS'] += ['-Wno-error=stringop-truncation']
idlfiles = [ 'storage/deprecated/ReprojectConfig',
'storage/deprecated/BlendConfig',
diff --git a/earth_enterprise/src/fusion/autoingest/memory-tests/SConscript b/earth_enterprise/src/fusion/autoingest/memory-tests/SConscript
index ece89a3..398d912 100644
--- a/earth_enterprise/src/fusion/autoingest/memory-tests/SConscript
+++ b/earth_enterprise/src/fusion/autoingest/memory-tests/SConscript
@@ -32,5 +32,5 @@ for test_name in [
test_name,
['{0}.cc'.format(test_name)],
LIBS = [
- 'geautoingest', 'gemiscconfig', 'gecommon', 'yaml-cpp'
+ 'geautoingest', 'gemiscconfig', 'gecommon', 'yaml-cpp', 'qt-mt'
])
diff --git a/earth_enterprise/src/fusion/mtjtools/analyze/analyze.cpp b/earth_enterprise/src/fusion/mtjtools/analyze/analyze.cpp
index 94cd957..66271a4 100755
--- a/earth_enterprise/src/fusion/mtjtools/analyze/analyze.cpp
+++ b/earth_enterprise/src/fusion/mtjtools/analyze/analyze.cpp
@@ -469,8 +469,8 @@ int main(int argc, char* argv[])
// generate desired mapping specification for each band of input image
//
- int lPoint[8];
- int rPoint[8];
+ int lPoint[8] = {};
+ int rPoint[8] = {};
int b;
for (b = 0; b < h.bands(); b++)
{
diff --git a/earth_enterprise/src/fusion/portableglobe/servers/fileunpacker/shared/SConscript b/earth_enterprise/src/fusion/portableglobe/servers/fileunpacker/shared/SConscript
index 4cc022d..b25e0ca 100644
--- a/earth_enterprise/src/fusion/portableglobe/servers/fileunpacker/shared/SConscript
+++ b/earth_enterprise/src/fusion/portableglobe/servers/fileunpacker/shared/SConscript
@@ -25,6 +25,10 @@ libglb_sources = ['glc_unpacker.cpp',
'packetbundle_finder.cpp',
'dbroot_info_reader.cpp']
+# fusion/portableglobe/servers/fileunpacker/shared/file_unpacker.cpp:106:50: error: '%04d' directive output may be truncated writing between 4 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
+# fusion/portableglobe/servers/fileunpacker/shared/file_unpacker.cpp:122:50: error: '%04d' directive output may be truncated writing between 4 and 10 bytes into a region of size 9 [-Werror=format-truncation=]
+env['CXXFLAGS'] += ['-Wno-error=format-truncation']
+
# Creates libglb.so
glb = env.sharedLib('glb', libglb_sources, LIBS=['gedbroot'])
@@ -42,6 +46,9 @@ root_dir = Dir(swig_env.exportdirs['root']).abspath
swig_env['CPPFLAGS'] += ['-I%s' % swig_env['python_include']]
swig_env.Append(SWIGFLAGS = ['-python', '-c++'])
+# NATIVE-REL-x86_64/fusion/portableglobe/servers/fileunpacker/shared/libglc_unpacker_wrap.cc:7669:16: error: 'char* strncpy(char*, const char*, size_t)' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
+swig_env['CPPFLAGS'] += ['-Wno-error=stringop-overflow=']
+
libglc_unpacker = swig_env.sharedLib('libglc_unpacker',
['libglc_unpacker.i', portable_glc_reader_sobj],
LIBS=['glb'])
diff --git a/earth_enterprise/src/fusion/rasterfuse/vipm/procmesh.cpp b/earth_enterprise/src/fusion/rasterfuse/vipm/procmesh.cpp
index cafb00d..ae427eb 100644
--- a/earth_enterprise/src/fusion/rasterfuse/vipm/procmesh.cpp
+++ b/earth_enterprise/src/fusion/rasterfuse/vipm/procmesh.cpp
@@ -21,6 +21,7 @@
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
+#include <set>
#ifndef min
@@ -1588,7 +1589,6 @@ void etQemMesh::constrainBorderVertices()
}
-#include <set>
void
etQemMesh::FixDanglingPoints(void)
{
diff --git a/earth_enterprise/src/fusion/tools/SConscript b/earth_enterprise/src/fusion/tools/SConscript
index 5c441a3..ea203cc 100644
--- a/earth_enterprise/src/fusion/tools/SConscript
+++ b/earth_enterprise/src/fusion/tools/SConscript
@@ -59,7 +59,9 @@ gepolymaskgen = env.executable('gepolymaskgen',
LIBS=['geautoingest', 'dbmanifest',
'geraster', 'gegdal', 'gerastergdal', 'gdal', 'geutil', 'gecommon', 'qt-mt', 'geos'])
-gevectorimport = env.executable('gevectorimport', 'gevectorimport.cpp',
+env_gvectorimport = env.Clone()
+env_gvectorimport['CXXFLAGS'] += ['-Wno-error=format-truncation']
+gevectorimport = env_gvectorimport.executable('gevectorimport', 'gevectorimport.cpp',
LIBS=['gegst', 'sgl', 'gif', 'png12', 'jpeg', 'freetype', 'qt-mt', 'geutil', 'gecommon', 'geos'])
gevectorquery = env.executable('gevectorquery', 'gevectorquery.cpp',
diff --git a/earth_enterprise/src/installer/common.sh b/earth_enterprise/src/installer/common.sh
index e2dbe83..cb94ae5 100644
--- a/earth_enterprise/src/installer/common.sh
+++ b/earth_enterprise/src/installer/common.sh
@@ -64,6 +64,7 @@ NUM_CPUS="$(grep processor /proc/cpuinfo | wc -l | $NEWLINECLEANER)"
SUPPORTED_OS_LIST=("Ubuntu", "Red Hat Enterprise Linux (RHEL)", "CentOS", "Linux Mint")
UBUNTUKEY="ubuntu"
REDHATKEY="rhel"
+FEDORAKEY="fedora"
CENTOSKEY="centos"
OS_RELEASE1="/etc/os-release"
OS_RELEASE2="/etc/system-release"
@@ -84,6 +85,7 @@ is_package_installed()
{
# args: $1: Ubuntu package
# args: $2: RHEL package
+ # args: $3: Fedora package
if [ "$MACHINE_OS" == "$UBUNTUKEY" ] && [ ! -z "$1" ]; then
if [[ ! -z "$(dpkg -l $1 | grep "^ii")" ]]; then
@@ -93,6 +95,10 @@ is_package_installed()
if [[ ! -z "$(rpm -qa | grep ^$2)" ]]; then
return 0
fi
+ elif { [ "$MACHINE_OS" == "$FEDORAKEY" ]; } && [ ! -z "$3" ]; then
+ if [[ ! -z "$(rpm -qa | grep ^$3)" ]]; then
+ return 0
+ fi
fi
return 1
@@ -105,12 +111,16 @@ software_check()
# args: $1: name of script
# args: $2: Ubuntu package
# args: $3: RHEL package
+ # args: $4: Fedora package
- if ! is_package_installed $2 $3 ; then
+ if ! is_package_installed $2 $3 $4; then
if [ "$MACHINE_OS" == "$UBUNTUKEY" ] && [ ! -z "$2" ]; then
echo -e "\nInstall $2 and restart the $1."
software_check_retval=1
- elif { [ "$MACHINE_OS" == "$REDHATKEY" ] || [ "$MACHINE_OS" == "$CENTOSKEY" ]; } && [ ! -z "$3" ]; then
+ elif { [ "$MACHINE_OS" == "$REDHATKEY" ] || [ "$MACHINE_OS" == "$CENTOSKEY" ]; } && [ ! -z "$3" ]; then
+ echo -e "\nInstall $3 and restart the $1."
+ software_check_retval=1
+ elif { [ "$MACHINE_OS" == "$FEDORAKEY" ]; } && [ ! -z "$4" ]; then
echo -e "\nInstall $3 and restart the $1."
software_check_retval=1
else
@@ -145,6 +155,8 @@ determine_os()
MACHINE_OS=$UBUNTUKEY
elif [[ "${test_os,,}" == "linux mint"* ]]; then
MACHINE_OS=$UBUNTUKEY
+ elif [[ "${test_os,,}" == "fedora"* ]]; then
+ MACHINE_OS=$FEDORAKEY
elif [[ "${test_os,,}" == "red hat"* ]]; then
MACHINE_OS=$REDHATKEY
elif [[ "${test_os,,}" == "centos"* ]]; then
diff --git a/earth_enterprise/src/installer/install_fusion.sh b/earth_enterprise/src/installer/install_fusion.sh
index d4a3025..dbe57c2 100755
--- a/earth_enterprise/src/installer/install_fusion.sh
+++ b/earth_enterprise/src/installer/install_fusion.sh
@@ -248,11 +248,11 @@ check_prereq_software()
local check_prereq_software_retval=0
local script_name="$GEEF $LONG_VERSION installer"
- if ! software_check "$script_name" "libxml2-utils" "libxml2.*x86_64"; then
+ if ! software_check "$script_name" "libxml2-utils" "libxml2.*x86_64" "libxml2.*x86_64"; then
check_prereq_software_retval=1
fi
- if ! software_check "$script_name" "python2.[67]" "python-2.[67].*"; then
+ if ! software_check "$script_name" "python2.[67]" "python-2.[67].*" "python2-2.[67].*"; then
check_prereq_software_retval=1
fi
diff --git a/earth_enterprise/src/installer/install_server.sh b/earth_enterprise/src/installer/install_server.sh
index 7a4ebd9..52c57ce 100755
--- a/earth_enterprise/src/installer/install_server.sh
+++ b/earth_enterprise/src/installer/install_server.sh
@@ -76,7 +76,7 @@ main_preinstall()
exit 1
fi
- if is_package_installed "opengee-common" "opengee-common"; then
+ if is_package_installed "opengee-common" "opengee-common" "opengee-common"; then
show_opengee_package_installed "install" "$GEES"
exit 1
fi
@@ -139,11 +139,11 @@ check_prereq_software()
local check_prereq_software_retval=0
local script_name="$GEES $LONG_VERSION installer"
- if ! software_check "$script_name" "libxml2-utils" "libxml2.*x86_64"; then
+ if ! software_check "$script_name" "libxml2-utils" "libxml2.*x86_64" "libxml2.*x86_64"; then
check_prereq_software_retval=1
fi
- if ! software_check "$script_name" "python2.[67]" "python-2.[67].*"; then
+ if ! software_check "$script_name" "python2.[67]" "python-2.[67].*" "python2-2.[67].*"; then
check_prereq_software_retval=1
fi
diff --git a/earth_enterprise/src/installer/uninstall_fusion.sh b/earth_enterprise/src/installer/uninstall_fusion.sh
index 2c93489..5d7b980 100755
--- a/earth_enterprise/src/installer/uninstall_fusion.sh
+++ b/earth_enterprise/src/installer/uninstall_fusion.sh
@@ -180,7 +180,7 @@ check_prereq_software()
{
local check_prereq_software_retval=0
- if ! software_check "$GEEF $LONG_VERSION uninstaller" "libxml2-utils" "libxml2-.*x86_64"; then
+ if ! software_check "$GEEF $LONG_VERSION uninstaller" "libxml2-utils" "libxml2-.*x86_64" "libxml2-.*x86_64"; then
check_prereq_software_retval=1
fi
diff --git a/earth_enterprise/src/keyhole/earth_client_protobuf/SConscript b/earth_enterprise/src/keyhole/earth_client_protobuf/SConscript
index 1444e5f..fc29a7c 100644
--- a/earth_enterprise/src/keyhole/earth_client_protobuf/SConscript
+++ b/earth_enterprise/src/keyhole/earth_client_protobuf/SConscript
@@ -28,8 +28,11 @@ for i in proto_files:
proto_out = env.ProtocolBuffer(i)
proto_inputs.append(proto_out[0]) # Only compile the cc files.
+# NATIVE-REL-x86_64/protobuf/quadtreeset.pb.cc:362:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
+# NATIVE-REL-x86_64/protobuf/diorama_streaming.pb.cc:383:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation]
env['CPPFLAGS'] += [
- '-Wfatal-errors'
+ '-Wfatal-errors',
+ '-Wno-error=misleading-indentation'
]
# Compile the cc files and add them to the "proto.a" lib.
diff --git a/earth_enterprise/src/server/mod_fdb/apache_fdb_reader.h b/earth_enterprise/src/server/mod_fdb/apache_fdb_reader.h
index e5bfde1..e42d04c 100644
--- a/earth_enterprise/src/server/mod_fdb/apache_fdb_reader.h
+++ b/earth_enterprise/src/server/mod_fdb/apache_fdb_reader.h
@@ -20,6 +20,10 @@
#define GEO_EARTH_ENTERPRISE_SRC_SERVER_MOD_FDB_APACHE_FDB_READER_H_
#include <http_request.h>
+// NATIVE-REL-x86_64/include/httpd.h:1938:17: error: 'strtoul_is_not_a_portable_function_use_strtol_instead' is not a member of 'std'
+#ifdef strtoul
+#undef strtoul
+#endif
#include <http_log.h>
#include <http_protocol.h>
#include <ap_compat.h>
diff --git a/earth_enterprise/src/server/mod_fdb/mod_fdb_impl.h b/earth_enterprise/src/server/mod_fdb/mod_fdb_impl.h
index 5270967..4a0d331 100644
--- a/earth_enterprise/src/server/mod_fdb/mod_fdb_impl.h
+++ b/earth_enterprise/src/server/mod_fdb/mod_fdb_impl.h
@@ -19,6 +19,9 @@
#define GEO_EARTH_ENTERPRISE_SRC_SERVER_MOD_FDB_MOD_FDB_IMPL_H_
#include <httpd.h>
+#ifdef strtoul
+#undef strtoul
+#endif
#include <http_config.h>
#ifdef __cplusplus
diff --git a/earth_enterprise/src/server/mod_fdb/tileservice.h b/earth_enterprise/src/server/mod_fdb/tileservice.h
index 5f854eb..1a83c36 100755
--- a/earth_enterprise/src/server/mod_fdb/tileservice.h
+++ b/earth_enterprise/src/server/mod_fdb/tileservice.h
@@ -21,6 +21,9 @@
#include <ap_compat.h>
#include <apr_date.h>
#include <http_request.h>
+#ifdef strtoul
+#undef strtoul
+#endif
#include <http_log.h>
#include <http_protocol.h>
#include <string>
diff --git a/earth_enterprise/src/server/mod_fdb/unpackermanager.h b/earth_enterprise/src/server/mod_fdb/unpackermanager.h
index 8b4d298..0e59382 100644
--- a/earth_enterprise/src/server/mod_fdb/unpackermanager.h
+++ b/earth_enterprise/src/server/mod_fdb/unpackermanager.h
@@ -29,6 +29,9 @@
#include <ap_compat.h>
#include <apr_date.h>
#include <http_request.h>
+#ifdef strtoul
+#undef strtoul
+#endif
#include <http_log.h>
#include <http_protocol.h>
#include <map>
diff --git a/earth_enterprise/src/third_party/SConscript b/earth_enterprise/src/third_party/SConscript
index 18888c7..657e50a 100644
--- a/earth_enterprise/src/third_party/SConscript
+++ b/earth_enterprise/src/third_party/SConscript
@@ -84,7 +84,8 @@ else:
third_party_bin = '%s/bin' % Dir('.').abspath
-cflags = ' '.join(env['optflags'] + ['-fPIC'])
+# https://fedoraproject.org/wiki/Changes/SunRPCRemoval
+cflags = ' '.join(env['optflags'] + ['-fPIC'] + ['-I/usr/include/tirpc'])
lpaths = ' '.join(map(lambda i: '-L%s' % i, env['rpathlink_dirs']))
lflags = ' '.join(third_party_env['LINKFLAGS'])
our_lib = '-L%s' % Dir(env.exportdirs['lib']).abspath
diff --git a/earth_enterprise/src/third_party/gdal/SConscript b/earth_enterprise/src/third_party/gdal/SConscript
index f89d311..ed05272 100644
--- a/earth_enterprise/src/third_party/gdal/SConscript
+++ b/earth_enterprise/src/third_party/gdal/SConscript
@@ -58,7 +58,7 @@ gdal_env = third_party_env.DeepCopy()
optdir = gdal_env['optdir']
root_dir = Dir(gdal_env.exportdirs['root']).abspath
-gdal_patches = ['gdal-jp2-V2.3.0.patch']
+gdal_patches = ['gdal-jp2-V2.3.0.patch', 'gdal-locale_h.patch']
if GetOption('clean'):
gdal_env.Execute('rm -rf %s' % current_dir)
diff --git a/earth_enterprise/src/third_party/gdal/gdal-locale_h.patch b/earth_enterprise/src/third_party/gdal/gdal-locale_h.patch
new file mode 100644
index 0000000..0ffd6a3
--- /dev/null
+++ b/earth_enterprise/src/third_party/gdal/gdal-locale_h.patch
@@ -0,0 +1,14 @@
+diff -up gdal-2.1.2/port/cpl_config.h.in.locale_h gdal-2.1.2/port/cpl_config.h.in
+--- gdal-2.1.2/port/cpl_config.h.in.locale_h 2018-12-19 13:43:17.328302354 +0100
++++ gdal-2.1.2/port/cpl_config.h.in 2018-12-19 13:43:51.915654213 +0100
+@@ -92,8 +92,10 @@
+ /* Define to 1 if you have the <limits.h> header file. */
+ #undef HAVE_LIMITS_H
+
++#ifndef HAVE_LOCALE_H
+ /* Define to 1 if you have the <locale.h> header file. */
+ #undef HAVE_LOCALE_H
++#endif
+
+ /* Define to 1, if your compiler supports long long data type */
+ #undef HAVE_LONG_LONG
diff --git a/earth_enterprise/src/third_party/gtest/SConscript b/earth_enterprise/src/third_party/gtest/SConscript
index c805b4d..356d7a8 100644
--- a/earth_enterprise/src/third_party/gtest/SConscript
+++ b/earth_enterprise/src/third_party/gtest/SConscript
@@ -21,11 +21,13 @@ Import('env')
buildGtest = False
# Check environment for libgtest.so
+# This ^ is not true as it looks for .a or .lib files, not the shared libraries
conf = Configure(env)
if not conf.CheckLib('gtest'):
buildGtest = True
env = conf.Finish()
+buildGtest = False
# Build libgtest as a shared library. If we make gtest static it forces all
# executables linked against it to link statically and that messes up the
diff --git a/earth_enterprise/src/third_party/libjs/SConscript b/earth_enterprise/src/third_party/libjs/SConscript
index 54f7525..6517689 100644
--- a/earth_enterprise/src/third_party/libjs/SConscript
+++ b/earth_enterprise/src/third_party/libjs/SConscript
@@ -118,6 +118,7 @@ inc_dir = '%s/include' % install_root
lib_dir = '%s/lib' % install_root
lic_dir = '%s/share/doc/packages/%s' % (install_root, libjs_ge_version)
libjs_target = '%s/.install' % current_dir
+# /usr/include/features.h:184:3: error: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Werror=cpp]
libjs_install = libjs_env.Command(
libjs_target, libjs_build,
['install -d -m 755 %s/libjs' % inc_dir,
@@ -138,8 +139,8 @@ libjs_install = libjs_env.Command(
'#ifndef SYSV\n'
'#define SYSV\n'
'#endif\n'
- '#ifndef _BSD_SOURCE\n'
- '#define _BSD_SOURCE\n'
+ '#ifndef _DEFAULT_SOURCE\n'
+ '#define _DEFAULT_SOURCE\n'
'#endif\n'
'#ifndef POSIX_SOURCE\n'
'#define POSIX_SOURCE\n'
diff --git a/earth_enterprise/src/third_party/postgresql/SConscript b/earth_enterprise/src/third_party/postgresql/SConscript
index ddfabb1..728f959 100644
--- a/earth_enterprise/src/third_party/postgresql/SConscript
+++ b/earth_enterprise/src/third_party/postgresql/SConscript
@@ -54,10 +54,25 @@ else:
'-Wdeclaration-after-statement -Wendif-labels '
'-fno-strict-aliasing"')
+# https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=ea4cbf8f1050b490d3040e659598bee63494288d#patch1
+postgresql_patches = ['rename_copy_file_range.patch']
+postgresql_target = '%s/.patch_postgresql' % current_dir
+
+postgresql_patch = postgresql_env.Command(
+ postgresql_target,
+ postgresql_extract + map(postgresql_env.GetBuildPath, postgresql_patches),
+ [postgresql_env.MultiCommand(
+ 'cd %s\n'
+ '%s\n'
+ 'touch %s' % (build_root,
+ '\n'.join(map(lambda i: 'patch -g0 -p1 -s < %s' % (
+ postgresql_env.GetBuildPath(i)), postgresql_patches)),
+ postgresql_target))])
+
# [2] Configure
postgresql_target = '%s/.configure' % current_dir
postgresql_configure = postgresql_env.Command(
- postgresql_target, postgresql_extract,
+ postgresql_target, [ postgresql_extract, postgresql_patch ],
[postgresql_env.MultiCommand(
('cd {build_root_escaped}\n'
'export LD_LIBRARY_PATH={build_lib_dir_escaped}\n'
diff --git a/earth_enterprise/src/third_party/postgresql/rename_copy_file_range.patch b/earth_enterprise/src/third_party/postgresql/rename_copy_file_range.patch
new file mode 100644
index 0000000..7558520
--- /dev/null
+++ b/earth_enterprise/src/third_party/postgresql/rename_copy_file_range.patch
@@ -0,0 +1,68 @@
+From ea4cbf8f1050b490d3040e659598bee63494288d Mon Sep 17 00:00:00 2001
+From: Andres Freund <[email protected]>
+Date: Wed, 3 Jan 2018 12:00:11 -0800
+Subject: [PATCH] Rename pg_rewind's copy_file_range() to avoid conflict with
+ new linux syscall.
+
+Upcoming versions of glibc will contain copy_file_range(2), a wrapper
+around a new linux syscall for in-kernel copying of data ranges. This
+conflicts with pg_rewinds function of the same name.
+
+Therefore rename pg_rewinds version. As our version isn't a generic
+copying facility we decided to choose a rewind specific function name.
+
+Per buildfarm animal caiman and subsequent discussion with Tom Lane.
+
+Author: Andres Freund
+Discussion:
+ https://postgr.es/m/[email protected]
+ https://postgr.es/m/[email protected]
+Backpatch: 9.5-, where pg_rewind was introduced
+---
+ src/bin/pg_rewind/copy_fetch.c | 9 +++++----
+ 1 file changed, 5 insertions(+), 4 deletions(-)
+
+diff --git a/src/bin/pg_rewind/copy_fetch.c b/src/bin/pg_rewind/copy_fetch.c
+index 168d040881..964c541060 100644
+--- a/src/bin/pg_rewind/copy_fetch.c
++++ b/src/bin/pg_rewind/copy_fetch.c
+@@ -158,7 +158,7 @@ recurse_dir(const char *datadir, const char *parentpath,
+ * If 'trunc' is true, any existing file with the same name is truncated.
+ */
+ static void
+-copy_file_range(const char *path, off_t begin, off_t end, bool trunc)
++rewind_copy_file_range(const char *path, off_t begin, off_t end, bool trunc)
+ {
+ char buf[BLCKSZ];
+ char srcpath[MAXPGPATH];
+@@ -224,7 +224,7 @@ copy_executeFileMap(filemap_t *map)
+ break;
+
+ case FILE_ACTION_COPY:
+- copy_file_range(entry->path, 0, entry->newsize, true);
++ rewind_copy_file_range(entry->path, 0, entry->newsize, true);
+ break;
+
+ case FILE_ACTION_TRUNCATE:
+@@ -232,7 +232,8 @@ copy_executeFileMap(filemap_t *map)
+ break;
+
+ case FILE_ACTION_COPY_TAIL:
+- copy_file_range(entry->path, entry->oldsize, entry->newsize, false);
++ rewind_copy_file_range(entry->path, entry->oldsize,
++ entry->newsize, false);
+ break;
+
+ case FILE_ACTION_CREATE:
+@@ -259,7 +260,7 @@ execute_pagemap(datapagemap_t *pagemap, const char *path)
+ while (datapagemap_next(iter, &blkno))
+ {
+ offset = blkno * BLCKSZ;
+- copy_file_range(path, offset, offset + BLCKSZ, false);
++ rewind_copy_file_range(path, offset, offset + BLCKSZ, false);
+ /* Ok, this block has now been copied from new data dir to old */
+ }
+ pg_free(iter);
+--
+2.11.0
+
diff --git a/earth_enterprise/src/third_party/qt/SConscript b/earth_enterprise/src/third_party/qt/SConscript
index 51fb199..3cf2dc3 100644
--- a/earth_enterprise/src/third_party/qt/SConscript
+++ b/earth_enterprise/src/third_party/qt/SConscript
@@ -86,6 +86,7 @@ qt_configure = qt_env.Command(
'-system-zlib '
'-system-libjpeg -system-libmng ' #-system-libpng
'-I/usr/include/libpng12 '
+ '-I/usr/include/tirpc ' # https://fedoraproject.org/wiki/Changes/SunRPCRemoval
'-qt-imgfmt-jpeg -qt-imgfmt-mng '
'-thread '
'-shared -no-cups -freetype -stl -xcursor -xinerama -xrandr -xrender '
sudo dnf install -y \
bison-devel cmake daemonize freeglut-devel \
gdbm-devel geos-devel giflib-devel python2-GitPython \
libcap-devel libmng-devel libpng12-devel libX11-devel libXcursor-devel \
libXft-devel libXinerama-devel libxml2-devel libXmu-devel libXrandr-devel \
ogdi-devel openjpeg-devel openjpeg2-devel openssl-devel \
perl-Alien-Packages perl-Perl4-CoreLibs proj-devel python2-devel \
rpm-build rpmrebuild rsync scons \
xerces-c xerces-c-devel xorg-x11-server-devel zlib-devel \
ant bzip2 doxygen gcc-c++ patch python2-setuptools \
swig tar libnsl2-devel git-lfs libtirpc-devel \
yaml-cpp-devel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment