# HG changeset patch # User Paul Wise # Date 1577075002 -28800 # Node ID ffbb5e3f2551220e5f25c873a1b307d15f23fc5b # Parent 54465fca8b9e45970f592eb44db4fa96051785c8 Add missing linking with zlib and libpthread/librt The uncompress and sem_* functions are used by various parts of the code but the files built from that code were not linked with zlib/pthread/rt. This fixes building with the --no-add-needed linker option. Fixes: https://bugs.debian.org/604796 diff -r 54465fca8b9e -r ffbb5e3f2551 configure.ac --- a/configure.ac Mon Dec 23 12:23:22 2019 +0800 +++ b/configure.ac Mon Dec 23 12:23:22 2019 +0800 @@ -173,7 +173,10 @@ AC_HEADER_DIRENT AC_HEADER_STDC AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h inttypes.h limits.h regex.h semaphore.h signal.h stdarg.h stdint.h stdio.h stdlib.h string.h sys/param.h sys/shm.h sys/stat.h sys/types.h time.h unistd.h wchar.h]) -AC_SEARCH_LIBS([sem_init],[pthread rt]) +save_libs="$LIBS" ; LIBS="" +AC_SEARCH_LIBS([sem_init], [pthread rt], [SEM_LIBS="$LIBS"], [AC_MSG_ERROR([sem_init missing])]) +AC_SUBST([SEM_LIBS]) +LIBS="$save_libs" # Checks for typedefs, structures, and compiler characteristics. diff -r 54465fca8b9e -r ffbb5e3f2551 src/Makefile.am --- a/src/Makefile.am Mon Dec 23 12:23:22 2019 +0800 +++ b/src/Makefile.am Mon Dec 23 12:23:22 2019 +0800 @@ -12,7 +12,7 @@ if STATIC_TOOLS - PSTLIB = @PST_OBJDIR@/libpst.a + PSTLIB = @PST_OBJDIR@/libpst.a @ZLIB_LIBS@ $(SEM_LIBS) else PSTLIB = libpst.la endif @@ -80,7 +80,7 @@ endif libpst_la_SOURCES = $(common_source) $(common_header) -libpst_la_LIBADD = $(LTLIBICONV) +libpst_la_LIBADD = $(LTLIBICONV) @ZLIB_LIBS@ $(SEM_LIBS) EXTRA_DIST = if !NEED_XGETOPT @@ -92,7 +92,7 @@ # the library search path. lspst_LDADD = $(all_libraries) $(PSTLIB) $(LTLIBICONV) @ZLIB_LIBS@ -readpst_LDADD = $(all_libraries) $(PSTLIB) $(LTLIBICONV) $(REGEXLIB) $(GSF_LIBS) @ZLIB_LIBS@ +readpst_LDADD = $(all_libraries) $(PSTLIB) $(LTLIBICONV) $(REGEXLIB) $(GSF_LIBS) @ZLIB_LIBS@ $(SEM_LIBS) pst2ldif_LDADD = $(all_libraries) $(PSTLIB) $(LTLIBICONV) @ZLIB_LIBS@ pst2dii_LDADD = $(all_libraries) $(PSTLIB) $(LTLIBICONV) -lgd @ZLIB_LIBS@ deltasearch_LDADD = $(all_libraries) $(PSTLIB) $(LTLIBICONV) @ZLIB_LIBS@