Build: disable shared library of gtest as suggested
authorPhilippe Coval <philippe.coval@osg.samsung.com>
Mon, 4 Jul 2016 11:58:15 +0000 (13:58 +0200)
committerJon A. Cruz <jon@joncruz.org>
Fri, 8 Jul 2016 21:07:53 +0000 (21:07 +0000)
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 <philippe.coval@osg.samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/9147
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jon@joncruz.org>
extlibs/gtest/SConscript

index bdff00e..a751ca3 100644 (file)
@@ -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')