aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac43
1 files changed, 42 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 53c67de6..54a516e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -302,7 +302,11 @@ AM_CONDITIONAL([USE_POSIX_THREADS], [test "x$USE_THREADS" = "xposix"])
302AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"]) 302AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"])
303AC_MSG_RESULT([[$USE_THREADS]]) 303AC_MSG_RESULT([[$USE_THREADS]])
304 304
305if test "x$HAVE_POSIX_THREADS" = "xyes"; then 305AC_ARG_ENABLE([[thread-names]],
306 [AS_HELP_STRING([--disable-thread-names [auto] ],[do not set names on MHD generated threads])],
307 [], [enable_thread_names='auto'])
308
309if test "x$enable_thread_names" != "xno" && test "x$USE_THREADS" = "xposix"; then
306 # Check for pthread_setname_np() 310 # Check for pthread_setname_np()
307 SAVE_LIBS="$LIBS" 311 SAVE_LIBS="$LIBS"
308 SAVE_CFLAGS="$CFLAGS" 312 SAVE_CFLAGS="$CFLAGS"
@@ -362,6 +366,42 @@ if test "x$HAVE_POSIX_THREADS" = "xyes"; then
362 CFLAGS="$SAVE_CFLAGS" 366 CFLAGS="$SAVE_CFLAGS"
363fi 367fi
364 368
369AS_IF(
370 [[test "x$enable_thread_names" != "xno"]],
371 [
372 AC_MSG_CHECKING([[whether to enable thread names]])
373 AC_COMPILE_IFELSE(
374 [AC_LANG_PROGRAM([], [[
375#ifdef MHD_NO_THREAD_NAMES
376#error Thread names are disabled.
377choke me
378#endif
379
380/* Keep in sync with mhd_threads.h */
381#if defined(MHD_USE_POSIX_THREADS) && (defined(HAVE_PTHREAD_SETNAME_NP_GNU) || defined(HAVE_PTHREAD_SET_NAME_NP_FREEBSD) || defined(HAVE_PTHREAD_SETNAME_NP_DARWIN) || defined(HAVE_PTHREAD_SETNAME_NP_NETBSD) )
382int a = 1;
383#elif defined(MHD_USE_W32_THREADS) && defined(_MSC_FULL_VER)
384int b = 2;
385#else
386#error No thread name function is available.
387choke me
388#endif
389 ]])
390 ], [
391 enable_thread_names='yes'
392 ], [
393 AS_IF([[test "x$enable_thread_names" = "xyes"]],
394 [
395 AC_MSG_RESULT([[no]])
396 AC_MSG_ERROR([[thread names was explicitly requested, but thread name function is not available]])
397 ])
398 enable_thread_names='no'
399 ])
400 AC_MSG_RESULT([[$enable_thread_names]])
401 ])
402
403AS_IF([[test "x$enable_thread_names" = "xno"]],
404 [AC_DEFINE([[MHD_NO_THREAD_NAMES]], [[1]], [Define to 1 to disable setting name on generated threads])])
365 405
366AM_CONDITIONAL(HAVE_W32, [test "x$os_is_native_w32" = "xyes"]) 406AM_CONDITIONAL(HAVE_W32, [test "x$os_is_native_w32" = "xyes"])
367w32_shared_lib_exp=no 407w32_shared_lib_exp=no
@@ -1007,6 +1047,7 @@ AC_MSG_NOTICE([libmicrohttpd ${PACKAGE_VERSION} Configuration Summary:
1007 Cross-compiling: ${cross_compiling} 1047 Cross-compiling: ${cross_compiling}
1008 Operating System: ${host_os} 1048 Operating System: ${host_os}
1009 Threading lib: ${USE_THREADS} 1049 Threading lib: ${USE_THREADS}
1050 Use thread names: ${enable_thread_names}
1010 libcurl (testing): ${MSG_CURL} 1051 libcurl (testing): ${MSG_CURL}
1011 Target directory: ${prefix} 1052 Target directory: ${prefix}
1012 Messages: ${enable_messages} 1053 Messages: ${enable_messages}