X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=configure.ac;h=b255cefb2e30132e7c0a8d3bcff50a0cadbfa49e;hb=0ce6b69e0f8e25e50bd878678b1444651093bac4;hp=60a6fb575b7193b2cf4df6cf55c7cb4b0bdf2aaf;hpb=e5f0a3ee838764e1ac88e6854176619be31da93f;p=m6w6%2Flibmemcached diff --git a/configure.ac b/configure.ac index 60a6fb57..b255cefb 100644 --- a/configure.ac +++ b/configure.ac @@ -55,9 +55,8 @@ AX_PLATFORM m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) AX_CXX_HEADER_STDCXX_98 -AS_IF([ test "$ax_cv_cxx_stdcxx_98" = no ],[ - AC_MSG_ERROR([Your system lacks a new enough C++ compiler]) - ]) +AS_IF([test "x$ax_cv_cxx_stdcxx_98" = "xno"], + [AC_MSG_ERROR([Your system lacks a new enough C++ compiler])]) AC_DEFUN([LIBMEMCACHED_PROTOCOL], [AC_ARG_ENABLE([libmemcachedprotocol], @@ -76,18 +75,17 @@ LIBMEMCACHED_PROTOCOL # Adding support for libtest m4_include([libtest/yatl.m4]) -m4_include([m4/memcached_sasl.m4]) -m4_include([m4/gearmand.m4]) -m4_include([m4/libgearman.m4]) +CHECK_FOR_GEARMAND +CHECK_FOR_LIBGEARMAND -AM_CONDITIONAL([BUILDING_LIBMEMCACHED], [true]) -AM_CONDITIONAL([HAVE_LIBMEMCACHED], [false]) -AM_CONDITIONAL([HAVE_LIBDRIZZLE], [false]) -AC_DEFINE([HAVE_LIBMEMCACHED], [1], [Enables libmemcached Support]) +AM_CONDITIONAL([BUILDING_LIBMEMCACHED],[true]) +AM_CONDITIONAL([HAVE_LIBMEMCACHED],[false]) +AM_CONDITIONAL([HAVE_LIBDRIZZLE],[false]) +AC_DEFINE([HAVE_LIBMEMCACHED],[1],[Enables libmemcached Support]) -AM_CONDITIONAL([BUILDING_GEARMAN], [false]) +AM_CONDITIONAL([BUILDING_GEARMAN],[false]) -dnl Specialty checks +# Specialty checks AX_CXX_CINTTYPES CONFIG_EXTRA DETECT_BYTEORDER @@ -100,8 +98,8 @@ PROTOCOL_BINARY_TEST ENABLE_DEPRECATED # Checks for programs. -AC_CHECK_PROGS([LEX], ['flex'], [:]) -AC_CHECK_PROGS([YACC], ['bison'], [:]) +AC_CHECK_PROGS([LEX],['flex'],[:]) +AC_CHECK_PROGS([YACC],['bison'],[:]) AX_PROG_SPHINX_BUILD # Checks for libraries. @@ -109,30 +107,33 @@ AC_SEARCH_LIBS([getopt_long],[gnugetopt]) AC_SEARCH_LIBS([gethostbyname],[nsl]) # Checks for header files. -AC_CHECK_HEADERS([arpa/inet.h]) -AC_CHECK_HEADERS([errno.h]) -AC_CHECK_HEADERS([dlfcn.h]) -AC_CHECK_HEADERS([execinfo.h]) -AC_CHECK_HEADERS([fcntl.h]) -AC_CHECK_HEADERS([inttypes.h]) -AC_CHECK_HEADERS([libintl.h]) -AC_CHECK_HEADERS([limits.h]) -AC_CHECK_HEADERS([math.h]) -AC_CHECK_HEADERS([netdb.h]) -AC_CHECK_HEADERS([netinet/in.h]) -AC_CHECK_HEADERS([netinet/tcp.h]) -AC_CHECK_HEADERS([pthread.h]) -AC_CHECK_HEADERS([spawn.h]) -AC_CHECK_HEADERS([stdarg.h]) -AC_CHECK_HEADERS([stddef.h]) -AC_CHECK_HEADERS([stdio.h]) -AC_CHECK_HEADERS([stdlib.h]) -AC_CHECK_HEADERS([sys/socket.h]) -AC_CHECK_HEADERS([sys/sysctl.h]) -AC_CHECK_HEADERS([sys/time.h]) -AC_CHECK_HEADERS([sys/un.h]) -AC_CHECK_HEADERS([time.h]) -AC_CHECK_HEADERS([unistd.h]) +AC_CHECK_HEADERS_ONCE([arpa/inet.h]) +AC_CHECK_HEADERS_ONCE([dlfcn.h]) +AC_CHECK_HEADERS_ONCE([errno.h]) +AC_CHECK_HEADERS_ONCE([execinfo.h]) +AC_CHECK_HEADERS_ONCE([fcntl.h]) +AC_CHECK_HEADERS_ONCE([inttypes.h]) +AC_CHECK_HEADERS_ONCE([libintl.h]) +AC_CHECK_HEADERS_ONCE([limits.h]) +AC_CHECK_HEADERS_ONCE([mach/mach.h]) +AC_CHECK_HEADERS_ONCE([malloc.h]) +AC_CHECK_HEADERS_ONCE([math.h]) +AC_CHECK_HEADERS_ONCE([netdb.h]) +AC_CHECK_HEADERS_ONCE([netinet/in.h]) +AC_CHECK_HEADERS_ONCE([netinet/tcp.h]) +AC_CHECK_HEADERS_ONCE([pthread.h]) +AC_CHECK_HEADERS_ONCE([spawn.h]) +AC_CHECK_HEADERS_ONCE([stdarg.h]) +AC_CHECK_HEADERS_ONCE([stddef.h]) +AC_CHECK_HEADERS_ONCE([stdio.h]) +AC_CHECK_HEADERS_ONCE([stdlib.h]) +AC_CHECK_HEADERS_ONCE([sys/socket.h]) +AC_CHECK_HEADERS_ONCE([sys/sysctl.h]) +AC_CHECK_HEADERS_ONCE([sys/time.h]) +AC_CHECK_HEADERS_ONCE([sys/un.h]) +AC_CHECK_HEADERS_ONCE([syslog.h]) +AC_CHECK_HEADERS_ONCE([time.h]) +AC_CHECK_HEADERS_ONCE([unistd.h]) # Windows only AC_CHECK_HEADERS([winsock2.h]) @@ -143,14 +144,20 @@ AC_CHECK_HEADERS([ws2tcpip.h]) # Checks for library functions. AC_CHECK_FUNCS([alarm]) +AC_CHECK_FUNCS([atexit]) +AC_CHECK_FUNCS([clock_gettime]) AC_CHECK_FUNCS([dup2]) AC_CHECK_FUNCS([fcntl]) +AC_CHECK_FUNCS([floor]) +AC_CHECK_FUNCS([getcwd]) AC_CHECK_FUNCS([getline]) AC_CHECK_FUNCS([gettimeofday]) +AC_CHECK_FUNCS([inet_ntoa]) AC_CHECK_FUNCS([memchr]) AC_CHECK_FUNCS([memmove]) AC_CHECK_FUNCS([memset]) AC_CHECK_FUNCS([pipe2]) +AC_CHECK_FUNCS([putenv]) AC_CHECK_FUNCS([select]) AC_CHECK_FUNCS([setenv]) AC_CHECK_FUNCS([socket]) @@ -159,6 +166,7 @@ AC_CHECK_FUNCS([strcasecmp]) AC_CHECK_FUNCS([strchr]) AC_CHECK_FUNCS([strdup]) AC_CHECK_FUNCS([strerror]) +AC_CHECK_FUNCS([strstr]) AC_CHECK_FUNCS([strtol]) AC_CHECK_FUNCS([strtoul]) AC_CHECK_FUNCS([strtoull]) @@ -176,6 +184,7 @@ AM_CONDITIONAL([BUILD_CACHE],[test "x$build_cache" = "xyes"]) AX_COMPILER_VENDOR +AC_CHECK_TYPES([ptrdiff_t]) AC_HEADER_STDBOOL AC_TYPE_INT16_T AC_TYPE_INT32_T @@ -197,30 +206,19 @@ AC_C_RESTRICT AX_CXX_GCC_ABI_DEMANGLE -AX_SASL_CHECK AX_LIBEVENT -# -# The sasl functions should only be visible if we build with sasl support -# -AS_IF([test "x$ac_enable_sasl" = "xyes"], - [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1"], - [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0"]) -AC_SUBST([LIBMEMCACHED_WITH_SASL_SUPPORT]) - AC_CHECK_LIB([rt],[clock_gettime], - [RT_LIB="-lrt" - AC_SUBST(RT_LIB) - AC_DEFINE([HAVE_CLOCK_GETTIME], [ 1 ], [Have clock_gettime])], - [AC_DEFINE([HAVE_CLOCK_GETTIME], [ 0 ], [Have clock_gettime])]) + [AC_SUBST([RT_LIB],[-lrt]) + AC_DEFINE([HAVE_CLOCK_GETTIME],[1],[Have clock_gettime])], + [AC_DEFINE([HAVE_CLOCK_GETTIME],[0],[Have clock_gettime])]) # Check for the ability to call dlopen AS_IF([test "x$enable_static" = "xyes"], [AC_CHECK_LIB([dl],[dlopen], - [DL_LIB="-ldl" - AC_SUBST([DL_LIB]) - AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])])], - [AC_DEFINE([HAVE_LIBDL], [0], [Have dlopen])]) + [AC_SUBST([DL_LIB],[-ldl]) + AC_DEFINE([HAVE_LIBDL],[1],[Have dlopen])])], + [AC_DEFINE([HAVE_LIBDL], [0], [Have dlopen])]) AC_CHECK_LIB([m],[floor]) AC_CHECK_FUNCS([sigignore]) @@ -239,12 +237,12 @@ AC_DEFINE([GEARMAND_BLOBSLAP_WORKER],[0],[Support for Gearman Blobslap worker]) AC_DEFINE([HAVE_LIBPQ],[0],[Support for Postgres]) AC_DEFINE([HAVE_LIBCURL],[0],[Support for libcurl]) -dnl Check for the requirements for running memcached with less privileges -dnl than the default privilege set. On Solaris we need setppriv and priv.h -dnl If you want to add support for other platforms you should check for -dnl your requirements, define HAVE_DROP_PRIVILEGES, and make sure you add -dnl the source file containing the implementation into memcached_SOURCE -dnl in Makefile.am +# Check for the requirements for running memcached with less privileges +# than the default privilege set. On Solaris we need setppriv and priv.h +# If you want to add support for other platforms you should check for +# your requirements, define HAVE_DROP_PRIVILEGES, and make sure you add +# the source file containing the implementation into memcached_SOURCE +# in Makefile.am AC_CHECK_FUNCS([setppriv], [AC_CHECK_HEADER([priv.h], [AC_DEFINE([HAVE_DROP_PRIVILEGES], @@ -266,17 +264,29 @@ SOCKET_SEND_FLAGS AX_UUID_GENERATE_TIME_SAFE -AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])]) -AX_PTHREAD_TIMEDJOIN_NP +AC_DEFUN([CHECK_FOR_PTHREAD_AND_SASL], + [AX_PTHREAD(, [AC_MSG_ERROR([could not find libpthread])]) + AX_PTHREAD_TIMEDJOIN_NP + + # The sasl functions should only be visible if we build with sasl support + # + AX_SASL_OPTION + AS_IF([test "x$ac_enable_sasl" = xyes], + [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 1"], + [LIBMEMCACHED_WITH_SASL_SUPPORT="#define LIBMEMCACHED_WITH_SASL_SUPPORT 0"]) + AC_SUBST([LIBMEMCACHED_WITH_SASL_SUPPORT]) + ]) +CHECK_FOR_PTHREAD_AND_SASL + # backtrace() does not work with static builds. AS_IF([test "x$enable_static" = "xyes"], [AC_DEFINE([AX_ENABLE_BACKTRACE],[1],[Support for backtrace().])]) PANDORA_ENABLE_DTRACE +HAVE_GCC_ATOMICS AX_ENDIAN AX_ASSERT -AX_CXX_COMPILER_VERSION AX_HARDEN_COMPILER_FLAGS AX_AM_JOBSERVER([yes]) @@ -304,7 +314,7 @@ echo " * LIB Flags: $LIB" echo " * Assertions enabled: $ax_enable_assert" echo " * Debug enabled: $ax_enable_debug" echo " * Warnings as failure: $ac_cv_warnings_as_errors" -echo " * SASL support: $ac_enable_sasl" +echo " * SASL support: $ax_sasl_option" echo " * make -j: $enable_jobserver" echo " * VCS checkout: $ac_cv_vcs_checkout" echo ""