aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac36
1 files changed, 20 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 3e840234..d2d2bfb7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -361,13 +361,14 @@ AM_CONDITIONAL([CYGWIN_TARGET], [[test "x$os_is_windows" = "xyes" && \
361 test "x${os_is_native_w32}" != "xyes"]]) 361 test "x${os_is_native_w32}" != "xyes"]])
362 362
363AC_ARG_WITH([threads], 363AC_ARG_WITH([threads],
364 [AS_HELP_STRING([--with-threads=LIB],[choose threading library (posix, w32, auto) [auto]])], 364 [AS_HELP_STRING([--with-threads=LIB],[choose threading library (posix, w32, auto, none) [auto]])],
365 [], [with_threads='auto']) 365 [], [with_threads='auto'])
366AS_CASE([[$with_threads]], 366AS_CASE([[$with_threads]],
367 [[win32]], [[with_threads='w32']], 367 [[win32]], [[with_threads='w32']],
368 [[pthreads]], [[with_threads='posix']], 368 [[pthreads]], [[with_threads='posix']],
369 [[posix]], [[:]], 369 [[posix]], [[:]],
370 [[w32]], [[:]], 370 [[w32]], [[:]],
371 [[none]], [[with_threads='none']],
371 [[auto]], [[:]], 372 [[auto]], [[:]],
372 [AC_MSG_ERROR([[incorrect parameter "$with_threads" specified for --with-threads]])] 373 [AC_MSG_ERROR([[incorrect parameter "$with_threads" specified for --with-threads]])]
373) 374)
@@ -398,41 +399,44 @@ AS_IF([[test "x$with_threads" = "xauto"]],
398 ] 399 ]
399) 400)
400 401
401AC_MSG_CHECKING([[for threading lib to use with libmicrohttpd]]) 402AC_MSG_CHECKING([[for threading lib to use with libmicrohttpd ($with_threads)]])
402AS_IF([[test "x$with_threads" = "xposix"]], 403AS_IF([test "x$with_threads" = "xposix"],
403 [ # forced posix threads 404 [ # forced posix threads
404 AS_IF([[test "x$mhd_have_posix_threads" = "xyes"]], [[ USE_THREADS='posix' ]], 405 AS_IF([test "x$mhd_have_posix_threads" = "xyes"], [USE_THREADS='posix'],
405 [ AS_IF([[test "x$os_is_windows" = "xyes"]] , 406 [ AS_IF([[test "x$os_is_windows" = "xyes"]] ,
406 [ AC_MSG_ERROR([[Posix threads are not available. Try to configure --with-threads=auto]])], 407 [ AC_MSG_ERROR([[Posix threads are not available. Try to configure --with-threads=auto]])],
407 [ AC_MSG_ERROR([[No threading lib is available. Consider installing pthreads]])] ) 408 [ AC_MSG_ERROR([[No threading lib is available. Consider installing pthreads]])] )
408 ]) 409 ])
409 ] , 410 ])
410 [[ test "x$with_threads" = "xw32" ]] , 411AS_IF([test "x$with_threads" = "xw32"],
411 [ # forced w32 threads 412 [ # forced w32 threads
412 AS_IF([[test "x$mhd_have_w32_threads" = "xyes"]], 413 AS_IF([[test "x$mhd_have_w32_threads" = "xyes"]],
413 [[ USE_THREADS='w32' ]], 414 [[ USE_THREADS='w32' ]],
414 [ AC_MSG_ERROR([[W32 threads are not available. Try to configure --with-threads=auto]])]) 415 [ AC_MSG_ERROR([[W32 threads are not available. Try to configure --with-threads=auto]])])
415 ] , 416 ])
416 [ # automatic threads lib selection 417AS_IF([test "x$with_threads" = "xauto"],
417 AS_IF([[test "x$os_is_native_w32" = "xyes" && test "x$mhd_have_w32_threads" = "xyes"]] , 418 [# automatic threads lib selection
419 AS_IF([[test "x$os_is_native_w32" = "xyes" && test "x$mhd_have_w32_threads" = "xyes"]] ,
418 [[ USE_THREADS='w32' ]] , 420 [[ USE_THREADS='w32' ]] ,
419 [[ test "x$mhd_have_posix_threads" = "xyes" ]], [[ USE_THREADS='posix' ]], 421 [[ test "x$mhd_have_posix_threads" = "xyes" ]], [[ USE_THREADS='posix' ]],
420 [[ test "x$mhd_have_w32_threads" = "xyes" ]], [[ USE_THREADS='w32' ]], 422 [[ test "x$mhd_have_w32_threads" = "xyes" ]], [[ USE_THREADS='w32' ]],
421 [ AC_MSG_ERROR([[No threading lib is available. Consider installing pthreads]]) ] 423 [ AC_MSG_ERROR([[No threading lib is available. Consider installing pthreads]]) ]
422 ) 424 )])
423 ] 425AS_IF([test "x$with_threads" = "xnone"],
424 ) 426 [USE_THREADS='none'])
427
425AS_IF([test "x$USE_THREADS" = "xposix"], 428AS_IF([test "x$USE_THREADS" = "xposix"],
426 [CC="$PTHREAD_CC" 429 [CC="$PTHREAD_CC"
427 AC_DEFINE([MHD_USE_POSIX_THREADS],[1],[define to use pthreads]) 430 AC_DEFINE([MHD_USE_POSIX_THREADS],[1],[define to use pthreads])
428 MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $PTHREAD_CFLAGS" 431 MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $PTHREAD_CFLAGS"
429 MHD_LIBDEPS="$PTHREAD_LIBS $MHD_LIBDEPS" 432 MHD_LIBDEPS="$PTHREAD_LIBS $MHD_LIBDEPS"
430 MHD_LIBDEPS_PKGCFG="$PTHREAD_LIBS $MHD_LIBDEPS_PKGCFG" 433 MHD_LIBDEPS_PKGCFG="$PTHREAD_LIBS $MHD_LIBDEPS_PKGCFG"],
431elif test "x$USE_THREADS" = "xw32"; then 434 [AS_IF([test "x$USE_THREADS" = "xw32"],
432 AC_DEFINE([MHD_USE_W32_THREADS],[1],[define to use W32 threads])]) 435 [AC_DEFINE([MHD_USE_W32_THREADS],[1],[define to use W32 threads])])])
433AM_CONDITIONAL([USE_POSIX_THREADS], [test "x$USE_THREADS" = "xposix"]) 436AM_CONDITIONAL([USE_POSIX_THREADS], [test "x$USE_THREADS" = "xposix"])
434AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"]) 437AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"])
435AC_MSG_RESULT([[$USE_THREADS]]) 438AM_CONDITIONAL([DISABLE_THREADS], [test "x$USE_THREADS" = "xnone"])
439AC_MSG_RESULT([$USE_THREADS])
436 440
437AC_ARG_ENABLE([[thread-names]], 441AC_ARG_ENABLE([[thread-names]],
438 [AS_HELP_STRING([--disable-thread-names [auto] ],[do not set names on MHD generated threads])], 442 [AS_HELP_STRING([--disable-thread-names [auto] ],[do not set names on MHD generated threads])],