diff --git a/src/Makefile.am b/src/Makefile.am index e08546ef..018ef04c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -279,10 +279,11 @@ BUILT_SOURCES = query/wasaparse.cpp AM_YFLAGS = -d # We use -release: the lib is only shared -# between recoll programs from the same release. -# -version-info $(VERSION_INFO) -librecoll_la_LDFLAGS = -release $(VERSION) \ - -Wl,--no-undefined -Wl,--warn-unresolved-symbols +# between recoll programs from the same release. So the lib is just named +# after the recoll version (e.g librecoll-1.27.1.so) +# -version-info $(VERSION_INFO) would handle ABI compat issues, we don't +# need it +librecoll_la_LDFLAGS = -release $(VERSION) -no-undefined @NO_UNDEF_LINK_FLAG@ librecoll_la_LIBADD = $(XSLT_LIBS) $(LIBXAPIAN) $(LIBICONV) $(LIBTHREADS) diff --git a/src/configure.ac b/src/configure.ac index 7b791c8e..2665f6d1 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -27,6 +27,19 @@ if test "$rcl_link_ok" = "no" ; then fi AC_LANG_POP([C++]) +AC_CANONICAL_HOST + +# We want librecoll.so to have no undefined symbols because it makes our +# life easier when building the loadable modules for, e.g. Python Can't +# make sense of the libtool -no-undefined flag. It seems to do nothing on +# Linux. Otoh, -Wl,--no-undefined or -z,defs is not portable (e.g. does not +# work on the mac). So set this link flag as a system-dependant value here +case $host_os in + linux*) + NO_UNDEF_LINK_FLAG=-Wl,--no-undefined + ;; +esac + AC_PROG_YACC AC_PROG_LIBTOOL @@ -505,6 +518,7 @@ RECOLL_DATADIR=${m_datadir}/recoll RCLVERSION=$PACKAGE_VERSION RCLLIBVERSION=$RCLVERSION +AC_SUBST(NO_UNDEF_LINK_FLAG) AC_SUBST(RECOLL_DATADIR) AC_SUBST(X_CFLAGS) AC_SUBST(X_PRE_LIBS)