build: Set PTHREAD_LIBS for pkgconfig files if empty
authorMatt Turner <mattst88@gmail.com>
Thu, 27 Sep 2012 22:49:52 +0000 (15:49 -0700)
committerMatt Turner <mattst88@gmail.com>
Mon, 1 Oct 2012 22:20:50 +0000 (15:20 -0700)
configure.ac

index 770df2f1a29a2ea6b9fffdda0b8bd677f02057d8..dc2720da088cba810987acbbaafe74f2a293ac5a 100644 (file)
@@ -509,6 +509,10 @@ AC_CHECK_DECLS([signbit],[],
 
 dnl Check for pthreads
 AX_PTHREAD
+dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
+dnl to -pthread, which causes problems if we need -lpthread to appear in
+dnl pkgconfig files.
+test -z "$PTHREAD_LIBS" && PTHREAD_LIBS="-lpthread"
 
 dnl SELinux awareness.
 AC_ARG_ENABLE([selinux],