From 1c9e619998d38e36045b465f0784ae999610e819 Mon Sep 17 00:00:00 2001 From: Philippe Coval Date: Mon, 4 Jul 2016 13:58:15 +0200 Subject: [PATCH] Build: disable shared library of gtest as suggested As suggested by Jon A. Cruz " "GTest in general is more focused away from the shared. System-wide pre-compiled shared libs were deprecated a while back. Sets of programs built at the same time *might* be OK with a local shared version, but static linkage makes it safer." So this patch explicitly disable dynamic library of gtest, it can be reverted on trouble as there is no "hard requirement" for it. For the record, I came to this once I noticed that using default shared library caused troubles on some Yocto distros (LfAgl) : relocation R_X86_64_PC32 \ against undefined hidden symbol `__init_array_start' can not be used ... I suspect this problem is not related to gtest or iotivity. Bug: https://jira.iotivity.org/browse/IOT-863 Bug-AGL: https://jira.automotivelinux.org/browse/SPEC-158 Change-Id: I9e4798aa3a579020255e8f53a8da8926dc4dee4f Signed-off-by: Philippe Coval Reviewed-on: https://gerrit.iotivity.org/gerrit/9147 Reviewed-by: Thiago Macieira Tested-by: jenkins-iotivity Reviewed-by: Jon A. Cruz --- extlibs/gtest/SConscript | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extlibs/gtest/SConscript b/extlibs/gtest/SConscript index bdff00e..a751ca3 100644 --- a/extlibs/gtest/SConscript +++ b/extlibs/gtest/SConscript @@ -18,7 +18,6 @@ gtest_url = 'https://googletest.googlecode.com/files/gtest-1.7.0.zip' if target_os in targets_need_gtest: print '*** Checking for installation of google unit test 1.7.0 ***' - if not os.path.exists(gtest_dir): # If the gtest zip file is not already present, download it if not os.path.exists(gtest_zip_file): @@ -71,10 +70,9 @@ elif target_os == 'linux': # Run configure on gtest print 'Configuring google unit test' if env.get('CROSS_COMPILE'): - env.Configure(gtest_dir, './configure --host=' + env['CROSS_COMPILE']) + env.Configure(gtest_dir, './configure --disable-shared --host=' + env['CROSS_COMPILE']) else: - env.Configure(gtest_dir, './configure') - + env.Configure(gtest_dir, './configure --disable-shared') # Run make on gtest print 'Making google unit test' env.Configure(gtest_dir, 'make') -- 2.7.4