summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2010-12-14 11:25:07 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2010-12-14 11:25:07 +0100
commit12466677f5a7abfe691022a983bd80f498d3f2ea (patch)
tree84ca59adf96b30aa7362e0527d42fccb687a95ed
parent400b471a43d02dbcdf2c6affdde7ac1b1d7171a8 (diff)
autotools: fix compilation with old libtool 1.5.22 on CentOS 5.5
As reported in the "[os-libsynthesis] libsynthesissdk.a built without -fPIC" mail thread, explicitly adding PIC flags for code in libsynthesissdk.a is necessary to make that lib usable in shared objects. It seems that more recent libtool versions do that automatically, but not libtool 1.5.22 on CentOS 5.5.
-rw-r--r--configure.in7
-rw-r--r--src/Makefile.am.in4
2 files changed, 11 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index b0ee64a..e2a0c14 100644
--- a/configure.in
+++ b/configure.in
@@ -12,6 +12,13 @@ AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
AM_PROG_CC_C_O
+dnl Extract PIC flags from libtool configure for libsynthesissdk.a
+dnl (makes assumptions about libtool var naming!). Some versions
+dnl of libtool use PIC mode automatically for static libraries,
+dnl others don't (?!). See "[os-libsynthesis] libsynthesissdk.a built without -fPIC".
+PIC_CXXFLAGS="$lt_prog_compiler_pic_CXX"
+AC_SUBST(PIC_CXXFLAGS)
+
AC_ARG_ENABLE(debug-logs,
AS_HELP_STRING([--debug-logs],
[For developers: add links to call location to HTML log files. Depends on Doxygen (for HTML version of source) and g++ (for __PRETTY_FUNCTION__).]),
diff --git a/src/Makefile.am.in b/src/Makefile.am.in
index e412171..9e0f9bb 100644
--- a/src/Makefile.am.in
+++ b/src/Makefile.am.in
@@ -108,6 +108,8 @@ XMLPARSE_CFLAGS_BUILTIN = -I$(srcdir)/Targets/ReleasedProducts/clientEngine_auto
endif
libsynthesissdk_la_LDFLAGS = -static
+libsynthesissdk_la_CFLAGS = $(PIC_CXXFLAGS)
+libsynthesissdk_la_CXXFLAGS = $(PIC_CXXFLAGS)
libsynthesissdk_la_SOURCES = @LIBSYNTHESISSDK_HEADERS@
if COND_STATIC
libsynthesissdk_la_SOURCES += @LIBSYNTHESISSDK_SOURCES_SDK_ONLY@
@@ -128,6 +130,8 @@ libsynthesissdk_la_CPPFLAGS = \
-I$(srcdir)/syncml_tk/src/sml/mgr/inc/
libsynthesisstubs_la_LDFLAGS = -static
+libsynthesisstubs_la_CFLAGS = $(libsynthesissdk_la_CXXFLAGS)
+libsynthesisstubs_la_CXXFLAGS = $(libsynthesissdk_la_CXXFLAGS)
libsynthesisstubs_la_SOURCES = sysync_SDK/Sources/enginestubs.c
libsynthesisstubs_la_CPPFLAGS = $(libsynthesissdk_la_CPPFLAGS)