summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlli Salli <ollisal@gmail.com>2012-02-07 16:37:47 (GMT)
committerOlli Salli <ollisal@gmail.com>2012-02-07 17:03:35 (GMT)
commit0c9c11eee409aba15c58d9e91ab7d8f0eb1b7c7b (patch)
treed993241d1a53b5b56f2435735aadae9cfbf0fd77
parent5c780cf06292a80271bbe5a35d5d10a9eba5e8d2 (diff)
downloadtelepathy-gabble-master.tar.gz
telepathy-gabble-master.tar.xz
Only pass -fPIC cflag to submodules if compiler doesn't warn or error from itHEADmaster
Reviewed-by: Siraj Razick <siraj.razick@collabora.co.uk>
-rw-r--r--configure.ac6
1 files changed, 5 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 96d2ba3..906ec73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -316,7 +316,11 @@ ac_configure_args="$ac_configure_args --with-installed-headers=${wocky_install_h
# Code from the submodules will be linked in to the gabble-plugins.so shared library, so they need
# to be compiled as position-independent code. Pass on any other flags we got as well.
-sub_cflags="$CFLAGS -fPIC"
+#
+# On some platforms -fPIC results in a "all code is position independent" warning though, so let's
+# try to compile with -Werror to find out if the current platform is one of these.
+sub_cflags="$CFLAGS"
+TP_COMPILER_FLAG([-fPIC -Werror], [sub_cflags+=" -fPIC"])
ac_configure_args+=" CFLAGS=\"$sub_cflags\""
if test "x$ENABLE_CODING_STYLE_CHECKS" = xyes ; then