mqtt-fan: libmosquittopp.so: add missing depending library
authorHauke Mehrtens <hauke.mehrtens@lantiq.com>
Tue, 21 Jul 2015 20:38:02 +0000 (22:38 +0200)
committerUze Choi <uzchoi@samsung.com>
Wed, 22 Jul 2015 12:16:54 +0000 (12:16 +0000)
libmosquittopp.so also depends on libpthread.so, this patch adds these
dependencies to the build. In addition it puts the dependency to
mosquitto to the beginning of the list. This is needed because
mosquitto is a statically linked lib and it also has unresolved
symbols, but gcc only searches the dynamic libs defined after the
static for unresolved symbols in the static lib.

Without this the dynamic loader will not automatically load these
libraries and it could result in unresolved dependencies at runtime.

Change-Id: I866a46305c31d37cf706b9f2b965e843c35c5667
Signed-off-by: Hauke Mehrtens <hauke.mehrtens@lantiq.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1797
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Younghyun Joo <yh_.joo@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/protocol-plugin/plugins/mqtt-fan/lib/cpp/SConscript

index f935f79..15c7e62 100644 (file)
@@ -16,7 +16,10 @@ mosquittopp_env.AppendUnique(CPPPATH = ['./', '../'])
 if target_os not in ['windows', 'winrt']:
        mosquittopp_env.AppendUnique(CFLAGS = ['-Wall', '-ggdb', '-O2', '-fPIC'])
 
-mosquittopp_env.AppendUnique(LIBS = ['mosquitto', 'ssl', 'crypto'])
+if target_os == 'linux':
+       mosquittopp_env.AppendUnique(LIBS = ['pthread'])
+
+mosquittopp_env.PrependUnique(LIBS = ['mosquitto', 'ssl', 'crypto'])
 ######################################################################
 # Source files and Targets
 ######################################################################