X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=configure.ac;h=d692c5b359e89bb33b6eb703ec6ab1a3b7eb277a;hb=88d314548e75b4c2940d7736faf4b7c6eb95b48d;hp=c259e4e4f76db9a548fe83c0f5f6375acb68a8e9;hpb=cb6cec903b2dba8f33f058470dd979b2a183d34c;p=platform%2Fupstream%2Fc-ares.git diff --git a/configure.ac b/configure.ac index c259e4e..d692c5b 100644 --- a/configure.ac +++ b/configure.ac @@ -2,19 +2,23 @@ AC_PREREQ(2.57) dnl Version not hardcoded here. Fetched later from ares_version.h AC_INIT([c-ares], [-], - [c-ares mailing list => http://cool.haxx.se/mailman/listinfo/c-ares]) + [c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares]) CARES_OVERRIDE_AUTOCONF AC_CONFIG_SRCDIR([ares_ipv6.h]) -AM_CONFIG_HEADER([config.h ares_build.h]) +AM_CONFIG_HEADER([ares_config.h ares_build.h]) +AC_CONFIG_MACRO_DIR([m4]) AM_MAINTAINER_MODE CARES_CHECK_OPTION_DEBUG CARES_CHECK_OPTION_OPTIMIZE CARES_CHECK_OPTION_WARNINGS +CARES_CHECK_OPTION_WERROR +CARES_CHECK_OPTION_CURLDEBUG +CARES_CHECK_OPTION_SYMBOL_HIDING -CARES_CHECK_PATH_SEPARATOR +CARES_CHECK_PATH_SEPARATOR_REQUIRED dnl SED is mandatory for configure process and libtool. dnl Set it now, allowing it to be changed later. @@ -50,7 +54,7 @@ fi AC_SUBST([EGREP]) dnl AR is mandatory for configure process and libtool. -dnl This is target dependant, so check it as a tool. +dnl This is target dependent, so check it as a tool. AC_PATH_TOOL([AR], [ar], [not_found], [$PATH:/usr/bin:/usr/local/bin]) if test -z "$AR" || test "$AR" = "not_found"; then @@ -58,11 +62,12 @@ if test -z "$AR" || test "$AR" = "not_found"; then fi AC_SUBST([AR]) -dnl Fetch c-ares version from ares_version.h -VERSION=`$SED -ne 's/^#define ARES_VERSION_STR "\(.*\)"/\1/p' ${srcdir}/ares_version.h` -AM_INIT_AUTOMAKE([c-ares], [$VERSION]) -AC_MSG_CHECKING([c-ares version]) -AC_MSG_RESULT([$VERSION]) +dnl Remove non-configure distributed ares_build.h +if test -f ${srcdir}/ares_build.h; then + rm -f ${srcdir}/ares_build.h +fi + +AM_INIT_AUTOMAKE dnl dnl Detect the canonical host and target build environment @@ -80,6 +85,7 @@ dnl This defines _ALL_SOURCE for AIX CARES_CHECK_AIX_ALL_SOURCE dnl Our configure and build reentrant settings +CARES_CONFIGURE_THREAD_SAFE CARES_CONFIGURE_REENTRANT dnl check for how to do large files @@ -94,11 +100,6 @@ esac dnl support building of Windows DLLs AC_LIBTOOL_WIN32_DLL -CARES_PROCESS_DEBUG_BUILD_OPTS - -AM_CONDITIONAL(DEBUGBUILD, test x$want_debug = xyes) -AM_CONDITIONAL(CURLDEBUG, test x$want_debug = xyes) - dnl force libtool to build static libraries with PIC on AMD64-Linux & FreeBSD AC_MSG_CHECKING([if arch-OS host is AMD64-Linux/FreeBSD (to build static libraries with PIC)]) case $host in @@ -111,20 +112,38 @@ case $host in ;; esac +AC_MSG_CHECKING([if compiler is icc (to build with PIC)]) +case $CC in + icc | */icc) + AC_MSG_RESULT([yes]) + with_pic=yes + ;; + *) + AC_MSG_RESULT([no]) + ;; +esac + dnl libtool setup AC_PROG_LIBTOOL -AC_MSG_CHECKING([if we need -no-undefined]) +AC_MSG_CHECKING([if we need CARES_BUILDING_LIBRARY]) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - need_no_undefined=yes + *-*-mingw*) + AC_DEFINE(CARES_BUILDING_LIBRARY, 1, [when building c-ares library]) + AC_MSG_RESULT(yes) + AC_MSG_CHECKING([if we need CARES_STATICLIB]) + if test "X$enable_shared" = "Xno" + then + AC_DEFINE(CARES_STATICLIB, 1, [when not building a shared library]) + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi ;; *) - need_no_undefined=no + AC_MSG_RESULT(no) ;; esac -AC_MSG_RESULT($need_no_undefined) -AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes) dnl ********************************************************************** dnl platform/compiler/architecture specific checks/flags @@ -136,30 +155,27 @@ CARES_SET_COMPILER_DEBUG_OPTS CARES_SET_COMPILER_OPTIMIZE_OPTS CARES_SET_COMPILER_WARNING_OPTS -case $host in +if test "$compiler_id" = "INTEL_UNIX_C"; then # - x86_64*linux*|amd64*freebsd*|ia64*freebsd*) - # - if test "$compiler_id" = "INTEL_UNIX_C"; then - # - if test "$compiler_num" -ge "900" && - test "$compiler_num" -lt "1000"; then - dnl icc 9.X specific - CFLAGS="$CFLAGS -i-dynamic" - fi - # - if test "$compiler_num" -ge "1000"; then - dnl icc 10.X or later - CFLAGS="$CFLAGS -shared-intel" - fi - # - fi - ;; + if test "$compiler_num" -ge "1000"; then + dnl icc 10.X or later + CFLAGS="$CFLAGS -shared-intel" + elif test "$compiler_num" -ge "900"; then + dnl icc 9.X specific + CFLAGS="$CFLAGS -i-dynamic" + fi # -esac +fi CARES_CHECK_COMPILER_HALT_ON_ERROR CARES_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE +CARES_CHECK_COMPILER_SYMBOL_HIDING + +CARES_CHECK_NO_UNDEFINED +AM_CONDITIONAL(NO_UNDEFINED, test x$need_no_undefined = xyes) + +CARES_CHECK_CURLDEBUG +AM_CONDITIONAL(CURLDEBUG, test x$want_curldebug = xyes) dnl ********************************************************************** dnl Compilation based checks should not be done before this point. @@ -347,8 +363,7 @@ if test "$ac_cv_lib_resolve_strcasecmp" = "$ac_cv_func_strcasecmp"; then fi ac_cv_func_strcasecmp="no" -dnl socket lib? -AC_CHECK_FUNC(connect, , [ AC_CHECK_LIB(socket, connect) ]) +CARES_CHECK_LIBS_CONNECT dnl ********************************************************************** dnl In case that function clock_gettime with monotonic timer is available, @@ -371,58 +386,10 @@ AC_HELP_STRING([--enable-libgcc],[use libgcc when linking]), ) -dnl Default is to try the thread-safe versions of a few functions -OPT_THREAD=on - -dnl detect AIX 4.3 or later -AC_MSG_CHECKING([AIX 4.3 or later]) -AC_PREPROC_IFELSE([ -#if defined(_AIX) && defined(_AIX43) -printf("just fine"); -#else -#error "this is not AIX 4.3 or later" -#endif -], - [ AC_MSG_RESULT([yes]) - RECENTAIX=yes - OPT_THREAD=off ], - [ AC_MSG_RESULT([no]) ] -) - -AC_ARG_ENABLE(thread,dnl -AC_HELP_STRING([--disable-thread],[don't look for thread-safe functions]) -AC_HELP_STRING([--enable-thread],[look for thread-safe functions]), -[ case "$enableval" in - no) - OPT_THREAD=off - AC_MSG_WARN(c-ares will not get built using thread-safe functions) - ;; - *) - ;; - esac -] -) - -if test X"$OPT_THREAD" = Xoff -then - AC_DEFINE(DISABLED_THREADSAFE, 1, - [Set to explicitly specify we don't want to use thread-safe functions]) -fi - -dnl for recent AIX versions, we skip all the thread-safe checks above since -dnl they claim a thread-safe libc using the standard API. But there are -dnl some functions still not thread-safe. Check for these! - dnl Let's hope this split URL remains working: dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \ dnl genprogc/thread_quick_ref.htm -if test "x$RECENTAIX" = "xyes"; then - - AC_DEFINE(_THREAD_SAFE, 1, [define this if you need it to compile thread-safe code]) - -fi - dnl ********************************************************************** dnl Back to "normal" configuring @@ -443,11 +410,13 @@ AC_CHECK_HEADERS( sys/ioctl.h \ sys/param.h \ sys/uio.h \ + assert.h \ netdb.h \ netinet/in.h \ netinet/tcp.h \ net/if.h \ errno.h \ + socket.h \ strings.h \ stdbool.h \ time.h \ @@ -504,11 +473,17 @@ AC_CHECK_TYPE(long long, if test "xyes" = "x$longlong"; then AC_MSG_CHECKING([if numberLL works]) - AC_COMPILE_IFELSE([long long val = 1000LL;], - [AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL])] - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no) - ) + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[ + ]],[[ + long long val = 1000LL; + ]]) + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_LL, 1, [if your compiler supports LL]) + ],[ + AC_MSG_RESULT([no]) + ]) fi @@ -544,19 +519,25 @@ CURL_CHECK_FUNC_RECVFROM CURL_CHECK_FUNC_SEND CURL_CHECK_MSG_NOSIGNAL +CARES_CHECK_FUNC_CLOSESOCKET +CARES_CHECK_FUNC_CLOSESOCKET_CAMEL +CARES_CHECK_FUNC_CONNECT CARES_CHECK_FUNC_FCNTL CARES_CHECK_FUNC_FREEADDRINFO CARES_CHECK_FUNC_GETADDRINFO +CARES_CHECK_FUNC_GETENV CARES_CHECK_FUNC_GETHOSTBYADDR CARES_CHECK_FUNC_GETHOSTBYNAME CARES_CHECK_FUNC_GETHOSTNAME CARES_CHECK_FUNC_GETSERVBYPORT_R +CARES_CHECK_FUNC_INET_NET_PTON CARES_CHECK_FUNC_INET_NTOP CARES_CHECK_FUNC_INET_PTON CARES_CHECK_FUNC_IOCTL CARES_CHECK_FUNC_IOCTLSOCKET CARES_CHECK_FUNC_IOCTLSOCKET_CAMEL CARES_CHECK_FUNC_SETSOCKOPT +CARES_CHECK_FUNC_SOCKET CARES_CHECK_FUNC_STRCASECMP CARES_CHECK_FUNC_STRCMPI CARES_CHECK_FUNC_STRDUP @@ -748,7 +729,7 @@ AC_CHECK_FUNCS([bitncmp \ ],[ AC_MSG_RESULT([yes]) eval "ac_cv_func_$func=yes" - AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$func]), [1], + AC_DEFINE_UNQUOTED(XC_SH_TR_CPP([HAVE_$func]), [1], [Define to 1 if you have the $func function.]) ],[ AC_MSG_RESULT([but still no]) @@ -756,37 +737,6 @@ AC_CHECK_FUNCS([bitncmp \ ]) -dnl Check for inet_net_pton -AC_CHECK_FUNCS(inet_net_pton) -dnl Again, some systems have it, but not IPv6 -if test "$ac_cv_func_inet_net_pton" = "yes" ; then -AC_MSG_CHECKING(if inet_net_pton supports IPv6) -AC_TRY_RUN( - [ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -int main() - { - struct in6_addr addr6; - if (inet_net_pton(AF_INET6, "::1", &addr6, sizeof(addr6)) < 1) - exit(1); - else - exit(0); - } - ], [ - AC_MSG_RESULT(yes) - AC_DEFINE_UNQUOTED(HAVE_INET_NET_PTON_IPV6,1,[Define to 1 if inet_net_pton supports IPv6.]) - ], AC_MSG_RESULT(no),AC_MSG_RESULT(no)) -fi - - AC_CHECK_SIZEOF(struct in6_addr, , [ #undef inline @@ -882,9 +832,17 @@ fi CARES_CHECK_OPTION_NONBLOCKING CARES_CHECK_NONBLOCKING_SOCKET +CARES_CONFIGURE_SYMBOL_HIDING + CARES_PRIVATE_LIBS="$LIBS" AC_SUBST(CARES_PRIVATE_LIBS) +CARES_CFLAG_EXTRAS="" +if test X"$want_werror" = Xyes; then + CARES_CFLAG_EXTRAS="-Werror" +fi +AC_SUBST(CARES_CFLAG_EXTRAS) + dnl squeeze whitespace out of some variables squeeze CFLAGS