shithub: libvpx

Download patch

ref: b46d58ad6a18beecd43a029ae68c00fbf6d03937
parent: 23963021205ba27872aea11f4f11f53bec77e03d
author: Johann <johannkoenig@google.com>
date: Fri Jan 18 06:31:22 EST 2013

Link pthread when it is available

Linking when we don't use it but it is available is probably harmless.

Gtest requires pthreads. Don't automatically enable unit tests if we
don't have it.

Change-Id: I5e6c3b609f840c7b6dbb36fc65809f0ef84685f8

--- a/configure
+++ b/configure
@@ -655,7 +655,7 @@
         enabled postproc || die "postproc_visualizer requires postproc to be enabled"
     fi
 
-    # Enable unit tests if we have a working C++ compiler
+    # Enable unit tests by default if we have a working C++ compiler.
     case "$toolchain" in
         *-vs*)
             soft_enable unit_tests
@@ -668,7 +668,7 @@
             # x86 targets.
         ;;
         *)
-            check_cxx "$@" <<EOF && soft_enable unit_tests
+            enabled pthread_h && check_cxx "$@" <<EOF && soft_enable unit_tests
 int z;
 EOF
         ;;
--- a/libs.mk
+++ b/libs.mk
@@ -17,7 +17,6 @@
   ASM:=.asm
 endif
 
-
 #
 # Calculate platform- and compiler-specific offsets for hand coded assembly
 #
@@ -327,7 +326,11 @@
 	$(qexec)echo 'Requires:' >> $@
 	$(qexec)echo 'Conflicts:' >> $@
 	$(qexec)echo 'Libs: -L$${libdir} -lvpx -lm' >> $@
+ifeq ($(HAVE_PTHREAD_H),yes)
 	$(qexec)echo 'Libs.private: -lm -lpthread' >> $@
+else
+	$(qexec)echo 'Libs.private: -lm' >> $@
+endif
 	$(qexec)echo 'Cflags: -I$${includedir}' >> $@
 INSTALL-LIBS-yes += $(LIBSUBDIR)/pkgconfig/vpx.pc
 INSTALL_MAPS += $(LIBSUBDIR)/pkgconfig/%.pc %.pc
--