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>
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
######################################################################