autoconf: Enable threaded delta search when pthreads are supported
Automatically set THREADED_DELTA_SEARCH when autoconf test detects support for pthreads on the platform. This will change the default for some platforms that did not enable threaded delta search previously. Signed-off-by: Junio C Hamano <gitster@pobox.com>
David M. Syzdek committed
Nov 3, 2008 at 09:14 UTC
d937c374ccb987356c1412986c8fb106b8aaef75
2 files changed
+6
-1
config.mak.in
+1
@@ -52,4 +52,5 @@ NO_DEFLATE_BOUND=@NO_DEFLATE_BOUND@
52
FREAD_READS_DIRECTORIES=@FREAD_READS_DIRECTORIES@
53
SNPRINTF_RETURNS_BOGUS=@SNPRINTF_RETURNS_BOGUS@
54
NO_PTHREADS=@NO_PTHREADS@
55
+THREADED_DELTA_SEARCH=@THREADED_DELTA_SEARCH@
56
PTHREAD_LIBS=@PTHREAD_LIBS@
configure.ac
+5
-1
@@ -492,7 +492,8 @@ AC_SUBST(NO_MKDTEMP)
492
#
493
# Define NO_PTHREADS if we do not have pthreads
494
#
495
-# Define PTHREAD_LIBS to the linker flag used for Pthread support.
495
+# Define PTHREAD_LIBS to the linker flag used for Pthread support and define
496
+# THREADED_DELTA_SEARCH if Pthreads are available.
497
AC_LANG_CONFTEST([AC_LANG_PROGRAM(
498
[[#include <pthread.h>]],
499
[[pthread_mutex_t test_mutex;]]
@@ -500,16 +501,19 @@ AC_LANG_CONFTEST([AC_LANG_PROGRAM(
501
${CC} -pthread conftest.c -o conftest.o > /dev/null 2>&1
502
if test $? -eq 0;then
503
PTHREAD_LIBS="-pthread"
504
+ THREADED_DELTA_SEARCH=YesPlease
505
else
506
${CC} -lpthread conftest.c -o conftest.o > /dev/null 2>&1
507
if test $? -eq 0;then
508
PTHREAD_LIBS="-lpthread"
509
+ THREADED_DELTA_SEARCH=YesPlease
510
else
511
NO_PTHREADS=UnfortunatelyYes
512
fi
513
fi
514
AC_SUBST(PTHREAD_LIBS)
515
AC_SUBST(NO_PTHREADS)
516
+AC_SUBST(THREADED_DELTA_SEARCH)
517
518
## Site configuration (override autodetection)
519
## --with-PACKAGE[=ARG] and --without-PACKAGE