diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 124 |
1 files changed, 58 insertions, 66 deletions
diff --git a/configure.ac b/configure.ac index b77d803..b89ce35 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_PREREQ(2.57) dnl Version not hardcoded here. Fetched later from ares_version.h -AC_INIT([c-ares], [-], +AC_INIT([c-ares], [1.12.0], [c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares]) XC_OVR_ZZ50 @@ -12,6 +12,7 @@ AC_CONFIG_SRCDIR([ares_ipv6.h]) AC_CONFIG_HEADERS([ares_config.h ares_build.h]) AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) CARES_CHECK_OPTION_DEBUG CARES_CHECK_OPTION_OPTIMIZE @@ -19,6 +20,7 @@ CARES_CHECK_OPTION_WARNINGS CARES_CHECK_OPTION_WERROR CARES_CHECK_OPTION_CURLDEBUG CARES_CHECK_OPTION_SYMBOL_HIDING +CARES_CHECK_OPTION_EXPOSE_STATICS XC_CHECK_PATH_SEPARATOR @@ -64,6 +66,8 @@ if test -z "$AR" || test "$AR" = "not_found"; then fi AC_SUBST([AR]) +AX_CODE_COVERAGE + dnl Remove non-configure distributed ares_build.h if test -f ${srcdir}/ares_build.h; then rm -f ${srcdir}/ares_build.h @@ -78,8 +82,9 @@ dnl Get system canonical name AC_DEFINE_UNQUOTED(OS, "${host}", [cpu-machine-OS]) XC_CHECK_PROG_CC +AX_CXX_COMPILE_STDCXX_11([noext],[optional]) -AM_INIT_AUTOMAKE +XC_AUTOMAKE dnl This defines _ALL_SOURCE for AIX CARES_CHECK_AIX_ALL_SOURCE @@ -346,6 +351,30 @@ if test "$HAVE_GETHOSTBYNAME" != "1"; then AC_MSG_ERROR([couldn't find libraries for gethostbyname()]) fi +dnl resolv lib for iPhone +AS_IF([test "x$host_vendor" = "xapple"], [ + AC_MSG_CHECKING([for iPhone target]) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ +#include "TargetConditionals.h" + ]], [[ +#if TARGET_OS_IPHONE == 0 +#error Not an iPhone target +#endif +return 0; + ]]) + ],[ + AC_MSG_RESULT([yes]) + AC_SEARCH_LIBS([res_servicename], [resolv], [ + AC_DEFINE([CARES_USE_LIBRESOLV], [1], [Use resolver library to configure cares]) + ], [ + AC_MSG_ERROR([Unable to find libresolv which is required for iPhone targets]) + ]) + ],[ + AC_MSG_RESULT([no]) + ]) +]) + dnl resolve lib? AC_CHECK_FUNC(strcasecmp, , [ AC_CHECK_LIB(resolve, strcasecmp) ]) @@ -453,13 +482,6 @@ AC_TYPE_SIZE_T AC_HEADER_TIME CURL_CHECK_STRUCT_TIMEVAL -AC_CHECK_SIZEOF(size_t) -AC_CHECK_SIZEOF(long) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(short) -CARES_CONFIGURE_LONG -AC_CHECK_SIZEOF(time_t) - AC_CHECK_TYPE(long long, [AC_DEFINE(HAVE_LONGLONG, 1, [Define to 1 if the compiler supports the 'long long' data type.])] @@ -732,63 +754,6 @@ AC_CHECK_FUNCS([bitncmp \ ]) -AC_CHECK_SIZEOF(struct in6_addr, , -[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include <windows.h> -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#ifdef HAVE_WS2TCPIP_H -#include <ws2tcpip.h> -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#endif -] -) - -AC_CHECK_SIZEOF(struct in_addr, , -[ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include <windows.h> -#ifdef HAVE_WINSOCK2_H -#include <winsock2.h> -#ifdef HAVE_WS2TCPIP_H -#include <ws2tcpip.h> -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include <sys/types.h> -#endif -#ifdef HAVE_SYS_SOCKET_H -#include <sys/socket.h> -#endif -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#endif -] -) - - dnl Check if the getnameinfo function is available dnl and get the types of five of its arguments. CURL_CHECK_FUNC_GETNAMEINFO @@ -850,5 +815,32 @@ squeeze CARES_PRIVATE_LIBS XC_CHECK_BUILD_FLAGS +AC_MSG_CHECKING([whether to build tests]) +AC_ARG_ENABLE(tests, + AC_HELP_STRING([--enable-tests], [build test suite]), + [ build_tests="$enableval" ], + [ if test "x$HAVE_CXX11" = "x1" && test "x$cross_compiling" = "xno" ; then + build_tests="yes" + else + build_tests="no" + fi + ] +) + +if test "x$build_tests" = "xyes" ; then + if test "x$HAVE_CXX11" = "0" ; then + AC_MSG_ERROR([*** Building tests requires a CXX11 compiler]) + fi + if test "x$cross_compiling" = "xyes" ; then + AC_MSG_ERROR([*** Tests not supported when cross compiling]) + fi +fi +AC_MSG_RESULT([$build_tests]) + +if test "x$build_tests" = "xyes" ; then + AC_CONFIG_SUBDIRS([test]) +fi + AC_CONFIG_FILES([Makefile libcares.pc]) AC_OUTPUT +XC_AMEND_DISTCLEAN(['.']) |