From b46d58ad6a18beecd43a029ae68c00fbf6d03937 Mon Sep 17 00:00:00 2001 From: Johann Date: Fri, 18 Jan 2013 11:31:22 -0800 Subject: [PATCH] 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 --- configure | 4 ++-- libs.mk | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/configure b/configure index d551b38..89a1eb1 100755 --- a/configure +++ b/configure @@ -655,7 +655,7 @@ process_toolchain() { 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 @@ process_toolchain() { # x86 targets. ;; *) - check_cxx "$@" <> $@ $(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 -- 2.7.4