aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac108
1 files changed, 45 insertions, 63 deletions
diff --git a/configure.ac b/configure.ac
index e503a5da..09da0ad4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,28 +35,22 @@ AC_SUBST(LIB_VERSION_REVISION)
35AC_SUBST(LIB_VERSION_AGE) 35AC_SUBST(LIB_VERSION_AGE)
36 36
37AC_MSG_CHECKING([[whether z/OS special settings are required]]) 37AC_MSG_CHECKING([[whether z/OS special settings are required]])
38if test `uname -s` = "OS/390" 38AS_IF([test `uname -s` = "OS/390"],
39then 39[
40# configure binaries for z/OS 40# configure binaries for z/OS
41 if test -z "$CC" 41 AS_IF([test -z "$CC"],
42 then 42 [CC=`pwd`"/contrib/xcc"
43 CC=`pwd`"/contrib/xcc" 43 chmod +x $CC || true])
44 chmod +x $CC || true 44 AS_IF([test -z "$CPP"],
45 fi 45 CPP="c89 -E")
46 if test -z "$CPP" 46 AS_IF([test -z "$CXXCPP"],
47 then 47 CXXCPP="c++ -E -+")
48 CPP="c89 -E"
49 fi
50 if test -z "$CXXCPP"
51 then
52 CXXCPP="c++ -E -+"
53 fi
54 AC_MSG_RESULT([[yes]]) 48 AC_MSG_RESULT([[yes]])
55# _CCC_CCMODE=1 49# _CCC_CCMODE=1
56# _C89_CCMODE=1 50# _C89_CCMODE=1
57else 51],
58 AC_MSG_RESULT([[no]]) 52 AC_MSG_RESULT([[no]])
59fi 53)
60 54
61# Checks for programs. 55# Checks for programs.
62AC_PROG_AWK 56AC_PROG_AWK
@@ -427,15 +421,14 @@ AS_IF([[test "x$with_threads" = "xposix"]],
427 ) 421 )
428 ] 422 ]
429 ) 423 )
430if test "x$USE_THREADS" = "xposix"; then 424AS_IF([test "x$USE_THREADS" = "xposix"],
431 CC="$PTHREAD_CC" 425 [CC="$PTHREAD_CC"
432 AC_DEFINE([MHD_USE_POSIX_THREADS],[1],[define to use pthreads]) 426 AC_DEFINE([MHD_USE_POSIX_THREADS],[1],[define to use pthreads])
433 MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $PTHREAD_CFLAGS" 427 MHD_LIB_CFLAGS="$MHD_LIB_CFLAGS $PTHREAD_CFLAGS"
434 MHD_LIBDEPS="$PTHREAD_LIBS $MHD_LIBDEPS" 428 MHD_LIBDEPS="$PTHREAD_LIBS $MHD_LIBDEPS"
435 MHD_LIBDEPS_PKGCFG="$PTHREAD_LIBS $MHD_LIBDEPS_PKGCFG" 429 MHD_LIBDEPS_PKGCFG="$PTHREAD_LIBS $MHD_LIBDEPS_PKGCFG"
436elif test "x$USE_THREADS" = "xw32"; then 430elif test "x$USE_THREADS" = "xw32"; then
437 AC_DEFINE([MHD_USE_W32_THREADS],[1],[define to use W32 threads]) 431 AC_DEFINE([MHD_USE_W32_THREADS],[1],[define to use W32 threads])])
438fi
439AM_CONDITIONAL([USE_POSIX_THREADS], [test "x$USE_THREADS" = "xposix"]) 432AM_CONDITIONAL([USE_POSIX_THREADS], [test "x$USE_THREADS" = "xposix"])
440AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"]) 433AM_CONDITIONAL([USE_W32_THREADS], [test "x$USE_THREADS" = "xw32"])
441AC_MSG_RESULT([[$USE_THREADS]]) 434AC_MSG_RESULT([[$USE_THREADS]])
@@ -444,7 +437,7 @@ AC_ARG_ENABLE([[thread-names]],
444 [AS_HELP_STRING([--disable-thread-names [auto] ],[do not set names on MHD generated threads])], 437 [AS_HELP_STRING([--disable-thread-names [auto] ],[do not set names on MHD generated threads])],
445 [], [enable_thread_names='auto']) 438 [], [enable_thread_names='auto'])
446 439
447if test "x$enable_thread_names" != "xno" && test "x$USE_THREADS" = "xposix"; then 440AS_IF([test "x$enable_thread_names" != "xno" && test "x$USE_THREADS" = "xposix"],[
448 # Check for thread name function 441 # Check for thread name function
449 HAVE_THREAD_NAME_FUNC="no" 442 HAVE_THREAD_NAME_FUNC="no"
450 SAVE_LIBS="$LIBS" 443 SAVE_LIBS="$LIBS"
@@ -600,10 +593,9 @@ AC_INCLUDES_DEFAULT
600 593
601 LIBS="$SAVE_LIBS" 594 LIBS="$SAVE_LIBS"
602 CFLAGS="$SAVE_CFLAGS" 595 CFLAGS="$SAVE_CFLAGS"
603fi 596])
604 597
605AS_IF( 598AS_IF([[test "x$enable_thread_names" != "xno"]],
606 [[test "x$enable_thread_names" != "xno"]],
607 [ 599 [
608 AC_MSG_CHECKING([[whether to enable thread names]]) 600 AC_MSG_CHECKING([[whether to enable thread names]])
609 AC_COMPILE_IFELSE( 601 AC_COMPILE_IFELSE(
@@ -690,31 +682,25 @@ AC_ARG_ENABLE([[poll]],
690 [enable_poll='auto'] 682 [enable_poll='auto']
691 ) 683 )
692 684
693if test "$enable_poll" != "no"; then 685AS_IF([test "$enable_poll" != "no"],
694 if test "$os_is_native_w32" != "yes"; then 686 [AS_IF([test "$os_is_native_w32" != "yes"],
695 AC_CHECK_HEADERS([poll.h], 687 AC_CHECK_HEADERS([poll.h],
696 [ 688 [AC_CHECK_FUNCS([poll], [have_poll='yes'], [have_poll='no'])],
697 AC_CHECK_FUNCS([poll], [have_poll='yes'], [have_poll='no']) 689 [],
698 ], [], [AC_INCLUDES_DEFAULT]) 690 [AC_INCLUDES_DEFAULT]),
699 else 691 [AC_MSG_CHECKING([for WSAPoll()])
700 AC_MSG_CHECKING([for WSAPoll()]) 692 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
701 AC_LINK_IFELSE([
702 AC_LANG_PROGRAM([[
703#include <winsock2.h> 693#include <winsock2.h>
704 ]], [[ 694 ]],[[
705WSAPOLLFD fda[2]; 695WSAPOLLFD fda[2];
706WSAPoll(fda, 2, 0);]])], 696WSAPoll(fda, 2, 0);]])],
707 [ 697 [have_poll='yes'
708 have_poll='yes' 698 AC_DEFINE([HAVE_POLL],[1])
709 AC_DEFINE([HAVE_POLL],[1]) 699 ],[have_poll='no'])
710 ], [have_poll='no']) 700 AC_MSG_RESULT([$have_poll])])
711 AC_MSG_RESULT([$have_poll]) 701 AS_IF([test "$enable_poll" = "yes" && test "$have_poll" != "yes"],
712 fi 702 AC_MSG_ERROR([[Support for poll was explicitly requested but cannot be enabled on this platform.]]))
713 if test "$enable_poll" = "yes" && test "$have_poll" != "yes"; then 703 enable_poll="$have_poll"])
714 AC_MSG_ERROR([[Support for poll was explicitly requested but cannot be enabled on this platform.]])
715 fi
716 enable_poll="$have_poll"
717fi
718 704
719AC_ARG_ENABLE([[epoll]], 705AC_ARG_ENABLE([[epoll]],
720 [AS_HELP_STRING([[--enable-epoll[=ARG]]], [enable epoll support (yes, no, auto) [auto]])], 706 [AS_HELP_STRING([[--enable-epoll[=ARG]]], [enable epoll support (yes, no, auto) [auto]])],
@@ -722,23 +708,20 @@ AC_ARG_ENABLE([[epoll]],
722 [enable_epoll='auto'] 708 [enable_epoll='auto']
723 ) 709 )
724 710
725if test "$enable_epoll" != "no"; then 711AS_IF([test "$enable_epoll" != "no"],
726 AX_HAVE_EPOLL 712 [AX_HAVE_EPOLL
727 if test "${ax_cv_have_epoll}" = "yes"; then 713 AS_IF([test "${ax_cv_have_epoll}" = "yes"],
728 AC_DEFINE([[EPOLL_SUPPORT]],[[1]],[Define to 1 to enable epoll support]) 714 [AC_DEFINE([[EPOLL_SUPPORT]],[[1]],[Define to 1 to enable epoll support])
729 enable_epoll='yes' 715 enable_epoll='yes'],
730 else 716 [AS_IF([test "$enable_epoll" = "yes"],
731 if test "$enable_epoll" = "yes"; then 717 AC_MSG_ERROR([[Support for epoll was explicitly requested but cannot be enabled on this platform.]]))
732 AC_MSG_ERROR([[Support for epoll was explicitly requested but cannot be enabled on this platform.]]) 718 enable_epoll='no'])])
733 fi
734 enable_epoll='no'
735 fi
736fi
737 719
738AM_CONDITIONAL([MHD_HAVE_EPOLL], [[test "x$enable_epoll" = xyes]]) 720AM_CONDITIONAL([MHD_HAVE_EPOLL], [[test "x$enable_epoll" = xyes]])
739 721
740if test "x$enable_epoll" = "xyes"; then 722AS_IF([test "x$enable_epoll" = "xyes"],
741 AC_CACHE_CHECK([for epoll_create1()], [mhd_cv_have_epoll_create1], [ 723 AC_CACHE_CHECK([for epoll_create1()],
724 [mhd_cv_have_epoll_create1], [
742 AC_LINK_IFELSE([ 725 AC_LINK_IFELSE([
743 AC_LANG_PROGRAM([[ 726 AC_LANG_PROGRAM([[
744#include <sys/epoll.h> 727#include <sys/epoll.h>
@@ -748,8 +731,7 @@ fd = epoll_create1(EPOLL_CLOEXEC);]])],
748 [mhd_cv_have_epoll_create1=yes], 731 [mhd_cv_have_epoll_create1=yes],
749 [mhd_cv_have_epoll_create1=no])]) 732 [mhd_cv_have_epoll_create1=no])])
750 AS_IF([test "x$mhd_cv_have_epoll_create1" = "xyes"],[ 733 AS_IF([test "x$mhd_cv_have_epoll_create1" = "xyes"],[
751 AC_DEFINE([[HAVE_EPOLL_CREATE1]], [[1]], [Define if you have epoll_create1 function.])]) 734 AC_DEFINE([[HAVE_EPOLL_CREATE1]], [[1]], [Define if you have epoll_create1 function.])]))
752fi
753 735
754# Check for headers that are ALWAYS required 736# Check for headers that are ALWAYS required
755AC_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])], [AC_INCLUDES_DEFAULT]) 737AC_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])], [AC_INCLUDES_DEFAULT])