Fix -pthread in fuse.pc
authorMiklos Szeredi <mszeredi@suse.cz>
Wed, 16 May 2012 14:45:27 +0000 (16:45 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Wed, 16 May 2012 14:45:27 +0000 (16:45 +0200)
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
configure.in
fuse.pc.in
lib/Makefile.am

index 3457ffb88ce8a1246996926cdb065cc86ab747de..b9856ecc117ee39b25a1cfedb095414e78b7b025 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-05-16  Miklos Szeredi <miklos@szeredi.hu>
+
+       * 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 <miklos@szeredi.hu>
 
        * Released 2.9.0
index f2e6c87c45204a6475421ca0a077a63e04acc743..e9ce79b97ee981847f6db055de42c7417cb56703 100644 (file)
@@ -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)
 
index d87f7afe945ee522be8ffb7a2176174fc6dccb3c..8fdb84154c74a351d03934e71c8f64061cd1021a 100644 (file)
@@ -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
index 010b24410ed761f73b44ed50c4a8ec8bd3ecb067..5ca57399dca763f46351b344c95a7534261d5c86 100644 (file)
@@ -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