diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 76 |
1 files changed, 60 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac index b9918093..53c67de6 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -302,6 +302,66 @@ AM_CONDITIONAL([USE_POSIX_THREADS], [test "x$USE_THREADS" = "xposix"]) | |||
302 | AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"]) | 302 | AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"]) |
303 | AC_MSG_RESULT([[$USE_THREADS]]) | 303 | AC_MSG_RESULT([[$USE_THREADS]]) |
304 | 304 | ||
305 | if test "x$HAVE_POSIX_THREADS" = "xyes"; then | ||
306 | # Check for pthread_setname_np() | ||
307 | SAVE_LIBS="$LIBS" | ||
308 | SAVE_CFLAGS="$CFLAGS" | ||
309 | LIBS="$PTHREAD_LIBS $LIBS" | ||
310 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | ||
311 | AC_CHECK_HEADERS([pthread_np.h]) | ||
312 | |||
313 | AC_MSG_CHECKING([[for pthread_setname_np(3) in NetBSD or OSF1 form]]) | ||
314 | AC_LINK_IFELSE( | ||
315 | [AC_LANG_PROGRAM([[ | ||
316 | #include <pthread.h> | ||
317 | #ifdef HAVE_PTHREAD_NP_H | ||
318 | #include <pthread_np.h> | ||
319 | #endif | ||
320 | ]], [[int res = pthread_setname_np(pthread_self(), "name", 0);]])], | ||
321 | [AC_DEFINE([[HAVE_PTHREAD_SETNAME_NP_NETBSD]], [[1]], [Define if you have NetBSD form (or OSF1 form) of pthread_setname_np(3) function.]) | ||
322 | AC_MSG_RESULT([[yes]])], | ||
323 | [AC_MSG_RESULT([[no]]) | ||
324 | |||
325 | AC_MSG_CHECKING([[for pthread_setname_np(3) in GNU/Linux form]]) | ||
326 | AC_LINK_IFELSE( | ||
327 | [AC_LANG_PROGRAM([[ | ||
328 | #include <pthread.h> | ||
329 | #ifdef HAVE_PTHREAD_NP_H | ||
330 | #include <pthread_np.h> | ||
331 | #endif | ||
332 | ]], [[int res = pthread_setname_np(pthread_self(), "name");]])], | ||
333 | [AC_DEFINE([[HAVE_PTHREAD_SETNAME_NP_GNU]], [[1]], [Define if you have GNU/Linux form of pthread_setname_np(3) function.]) | ||
334 | AC_MSG_RESULT([[yes]])], | ||
335 | [AC_MSG_RESULT([[no]]) | ||
336 | |||
337 | AC_MSG_CHECKING([[for pthread_setname_np(3) in Darwin form]]) | ||
338 | AC_LINK_IFELSE( | ||
339 | [AC_LANG_PROGRAM([[ | ||
340 | #include <pthread.h> | ||
341 | #ifdef HAVE_PTHREAD_NP_H | ||
342 | #include <pthread_np.h> | ||
343 | #endif | ||
344 | ]], [[int res = pthread_setname_np("name");]])], | ||
345 | [AC_DEFINE([[HAVE_PTHREAD_SETNAME_NP_DARWIN]], [[1]], [Define if you have Darwin form of pthread_setname_np(3) function.]) | ||
346 | AC_MSG_RESULT([[yes]])], | ||
347 | [AC_MSG_RESULT([[no]]) | ||
348 | |||
349 | AC_MSG_CHECKING([[for pthread_setname_np(3) in FreeBSD form]]) | ||
350 | AC_LINK_IFELSE( | ||
351 | [AC_LANG_PROGRAM([[ | ||
352 | #include <pthread.h> | ||
353 | #ifdef HAVE_PTHREAD_NP_H | ||
354 | #include <pthread_np.h> | ||
355 | #endif | ||
356 | ]], [[pthread_set_name_np(pthread_self(), "name");]])], | ||
357 | [AC_DEFINE([[HAVE_PTHREAD_SET_NAME_NP_FREEBSD]], [[1]], [Define if you have FreeBSD form of pthread_set_name_np(3) function.]) | ||
358 | AC_MSG_RESULT([[yes]])], | ||
359 | [AC_MSG_RESULT([[no]])] ) ]) ]) ]) | ||
360 | |||
361 | LIBS="$SAVE_LIBS" | ||
362 | CFLAGS="$SAVE_CFLAGS" | ||
363 | fi | ||
364 | |||
305 | 365 | ||
306 | AM_CONDITIONAL(HAVE_W32, [test "x$os_is_native_w32" = "xyes"]) | 366 | AM_CONDITIONAL(HAVE_W32, [test "x$os_is_native_w32" = "xyes"]) |
307 | w32_shared_lib_exp=no | 367 | w32_shared_lib_exp=no |
@@ -405,22 +465,6 @@ fd = epoll_create1(EPOLL_CLOEXEC);]])], | |||
405 | AC_DEFINE([[HAVE_EPOLL_CREATE1]], [[1]], [Define if you have epoll_create1 function.])]) | 465 | AC_DEFINE([[HAVE_EPOLL_CREATE1]], [[1]], [Define if you have epoll_create1 function.])]) |
406 | fi | 466 | fi |
407 | 467 | ||
408 | if test "x$HAVE_POSIX_THREADS" = "xyes"; then | ||
409 | # Check for pthread_setname_np() | ||
410 | SAVE_LIBS="$LIBS" | ||
411 | SAVE_CFLAGS="$CFLAGS" | ||
412 | LIBS="$PTHREAD_LIBS $LIBS" | ||
413 | CFLAGS="$CFLAGS $PTHREAD_CFLAGS" | ||
414 | AC_MSG_CHECKING([[for pthread_setname_np]]) | ||
415 | AC_LINK_IFELSE( | ||
416 | [AC_LANG_PROGRAM([[#include <pthread.h>]], [[ pthread_setname_np(pthread_self(), "name")]])], | ||
417 | [AC_DEFINE([[HAVE_PTHREAD_SETNAME_NP]], [[1]], [Define if you have pthread_setname_np function.]) | ||
418 | AC_MSG_RESULT([[yes]])], | ||
419 | [AC_MSG_RESULT([[no]])] ) | ||
420 | LIBS="$SAVE_LIBS" | ||
421 | CFLAGS="$SAVE_CFLAGS" | ||
422 | fi | ||
423 | |||
424 | # Check for headers that are ALWAYS required | 468 | # Check for headers that are ALWAYS required |
425 | AC_CHECK_HEADERS([fcntl.h math.h errno.h limits.h stdio.h locale.h sys/stat.h sys/types.h],,AC_MSG_ERROR([Compiling libmicrohttpd requires standard UNIX headers files])) | 469 | AC_CHECK_HEADERS([fcntl.h math.h errno.h limits.h stdio.h locale.h sys/stat.h sys/types.h],,AC_MSG_ERROR([Compiling libmicrohttpd requires standard UNIX headers files])) |
426 | 470 | ||