From 384496dd02cfd9a74b95d62ce0d23a31a7af3730 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 16 May 2012 16:45:27 +0200 Subject: Fix -pthread in fuse.pc Linking to a library that uses threads requires the application to be linked with -pthreads otherwise some pthread functions will be linked to stubs in glibc. So move -pthread from Libs.private to Libs in fuse.pc. Reported by Werner Fink --- ChangeLog | 7 +++++++ configure.in | 5 ++--- fuse.pc.in | 2 +- lib/Makefile.am | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3457ffb..b9856ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-05-16 Miklos Szeredi + + * Linking to a library that uses threads requires the application + to be linked with -pthreads otherwise some pthread functions will + be linked to stubs in glibc. So move -pthread from Libs.private + to Libs in fuse.pc. Reported by Werner Fink + 2012-04-20 Miklos Szeredi * Released 2.9.0 diff --git a/configure.in b/configure.in index f2e6c87..e9ce79b 100644 --- a/configure.in +++ b/configure.in @@ -60,11 +60,10 @@ AC_CHECK_FUNCS([fork setxattr fdatasync splice vmsplice utimensat]) AC_CHECK_MEMBERS([struct stat.st_atim]) AC_CHECK_MEMBERS([struct stat.st_atimespec]) -libfuse_libs="-pthread" LIBS= AC_SEARCH_LIBS(dlopen, [dl]) AC_SEARCH_LIBS(clock_gettime, [rt]) -libfuse_libs="$libfuse_libs $LIBS" +libfuse_libs=$LIBS LIBS= AC_ARG_WITH([libiconv-prefix], [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ @@ -74,7 +73,7 @@ AC_ARG_WITH([libiconv-prefix], done ]) AM_ICONV -libfuse_libs="$libfuse_libs $LTLIBICONV" +libfuse_libs=$libfuse_libs $LTLIBICONV AM_CONDITIONAL(ICONV, test "$am_cv_func_iconv" = yes) AC_SUBST(libfuse_libs) diff --git a/fuse.pc.in b/fuse.pc.in index d87f7af..8fdb841 100644 --- a/fuse.pc.in +++ b/fuse.pc.in @@ -6,6 +6,6 @@ includedir=@includedir@ Name: fuse Description: Filesystem in Userspace Version: @VERSION@ -Libs: -L${libdir} -lfuse +Libs: -L${libdir} -lfuse -pthread Libs.private: @libfuse_libs@ Cflags: -I${includedir}/fuse -D_FILE_OFFSET_BITS=64 diff --git a/lib/Makefile.am b/lib/Makefile.am index 010b244..5ca5739 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -36,7 +36,7 @@ libfuse_la_SOURCES = \ $(iconv_source) \ $(mount_source) -libfuse_la_LDFLAGS = @libfuse_libs@ -version-number 2:9:0 \ +libfuse_la_LDFLAGS = -pthread @libfuse_libs@ -version-number 2:9:0 \ -Wl,--version-script,$(srcdir)/fuse_versionscript if NETBSD -- cgit v1.2.1