diff --git a/Makefile.am b/Makefile.am index bc33a66e..eef3d3d1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,16 +1,15 @@ AUTOMAKE_OPTIONS = foreign nostdinc 1.9.6 ACLOCAL_AMFLAGS = -I m4 --install -MSVCFILES = msvc_ver.inc +MSVCFILES = msvc_ver.inc buildconf.bat # adig and ahost are just sample programs and thus not mentioned with the # regular sources and headers EXTRA_DIST = AUTHORS CHANGES README.cares $(man_MANS) RELEASE-NOTES \ - libcares.pc.in buildconf get_ver.awk maketgz TODO README.msvc \ - $(MSVCFILES) INSTALL.md README.md LICENSE.md \ - CMakeLists.txt \ - Makefile.dj Makefile.m32 Makefile.netware Makefile.msvc Makefile.Watcom \ - AUTHORS CONTRIBUTING.md SECURITY.md TODO + c-ares-config.cmake.in libcares.pc.cmake libcares.pc.in buildconf get_ver.awk \ + maketgz TODO README.msvc $(MSVCFILES) INSTALL.md README.md LICENSE.md \ + CMakeLists.txt Makefile.dj Makefile.m32 Makefile.netware Makefile.msvc \ + Makefile.Watcom AUTHORS CONTRIBUTING.md SECURITY.md TODO CLEANFILES = $(PDFPAGES) $(HTMLPAGES) @@ -24,35 +23,6 @@ SUBDIRS = @BUILD_SUBDIRS@ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = libcares.pc -CARES_VERSION_INFO = -version-info 6:2:4 -# This flag accepts an argument of the form current[:revision[:age]]. So, -# passing -version-info 3:12:1 sets current to 3, revision to 12, and age to -# 1. -# -# If either revision or age are omitted, they default to 0. Also note that age -# must be less than or equal to the current interface number. -# -# Here are a set of rules to help you update your library version information: -# -# 1.Start with version information of 0:0:0 for each libtool library. -# -# 2.Update the version information only immediately before a public release of -# your software. More frequent updates are unnecessary, and only guarantee -# that the current interface number gets larger faster. -# -# 3.If the library source code has changed at all since the last update, then -# increment revision (c:r+1:a) -# -# 4.If any interfaces have been added, removed, or changed since the last -# update, increment current, and set revision to 0. (c+1:r=0:a) -# -# 5.If any interfaces have been added since the last public release, then -# increment age. (c:r:a+1) -# -# 6.If any interfaces have been removed since the last public release, then -# set age to 0. (c:r:a=0) -# - # where to install the c-ares headers libcares_ladir = $(includedir) diff --git a/configure.ac b/configure.ac index 4516796b..5e15fc88 100644 --- a/configure.ac +++ b/configure.ac @@ -1,8 +1,38 @@ AC_PREREQ(2.57) -AC_INIT([c-ares], [1.17.0], +AC_INIT([c-ares], [1.17.1], [c-ares mailing list: http://cool.haxx.se/mailman/listinfo/c-ares]) +CARES_VERSION_INFO="6:2:4" +dnl This flag accepts an argument of the form current[:revision[:age]]. So, +dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to +dnl 1. +dnl +dnl If either revision or age are omitted, they default to 0. Also note that age +dnl must be less than or equal to the current interface number. +dnl +dnl Here are a set of rules to help you update your library version information: +dnl +dnl 1.Start with version information of 0:0:0 for each libtool library. +dnl +dnl 2.Update the version information only immediately before a public release of +dnl your software. More frequent updates are unnecessary, and only guarantee +dnl that the current interface number gets larger faster. +dnl +dnl 3.If the library source code has changed at all since the last update, then +dnl increment revision (c:r+1:a) +dnl +dnl 4.If any interfaces have been added, removed, or changed since the last +dnl update, increment current, and set revision to 0. (c+1:r=0:a) +dnl +dnl 5.If any interfaces have been added since the last public release, then +dnl increment age. (c:r:a+1) +dnl +dnl 6.If any interfaces have been removed since the last public release, then +dnl set age to 0. (c:r:a=0) +dnl +AC_SUBST([CARES_VERSION_INFO]) + XC_OVR_ZZ50 XC_OVR_ZZ60 CARES_OVERRIDE_AUTOCONF @@ -102,9 +132,9 @@ esac XC_LIBTOOL -# -# Automake conditionals based on libtool related checks -# +dnl +dnl Automake conditionals based on libtool related checks +dnl AM_CONDITIONAL([CARES_LT_SHLIB_USE_VERSION_INFO], [test "x$xc_lt_shlib_use_version_info" = 'xyes']) @@ -113,30 +143,30 @@ AM_CONDITIONAL([CARES_LT_SHLIB_USE_NO_UNDEFINED], AM_CONDITIONAL([CARES_LT_SHLIB_USE_MIMPURE_TEXT], [test "x$xc_lt_shlib_use_mimpure_text" = 'xyes']) -# -# Due to libtool and automake machinery limitations of not allowing -# specifying separate CPPFLAGS or CFLAGS when compiling objects for -# inclusion of these in shared or static libraries, we are forced to -# build using separate configure runs for shared and static libraries -# on systems where different CPPFLAGS or CFLAGS are mandatory in order -# to compile objects for each kind of library. Notice that relying on -# the '-DPIC' CFLAG that libtool provides is not valid given that the -# user might for example choose to build static libraries with PIC. -# - -# -# Make our Makefile.am files use the staticlib CPPFLAG only when strictly -# targeting a static library and not building its shared counterpart. -# +dnl +dnl Due to libtool and automake machinery limitations of not allowing +dnl specifying separate CPPFLAGS or CFLAGS when compiling objects for +dnl inclusion of these in shared or static libraries, we are forced to +dnl build using separate configure runs for shared and static libraries +dnl on systems where different CPPFLAGS or CFLAGS are mandatory in order +dnl to compile objects for each kind of library. Notice that relying on +dnl the '-DPIC' CFLAG that libtool provides is not valid given that the +dnl user might for example choose to build static libraries with PIC. +dnl + +dnl +dnl Make our Makefile.am files use the staticlib CPPFLAG only when strictly +dnl targeting a static library and not building its shared counterpart. +dnl AM_CONDITIONAL([USE_CPPFLAG_CARES_STATICLIB], [test "x$xc_lt_build_static_only" = 'xyes']) -# -# Make staticlib CPPFLAG variable and its definition visible in output -# files unconditionally, providing an empty definition unless strictly -# targeting a static library and not building its shared counterpart. -# +dnl +dnl Make staticlib CPPFLAG variable and its definition visible in output +dnl files unconditionally, providing an empty definition unless strictly +dnl targeting a static library and not building its shared counterpart. +dnl CPPFLAG_CARES_STATICLIB= if test "x$xc_lt_build_static_only" = 'xyes'; then @@ -155,7 +185,7 @@ CARES_SET_COMPILER_OPTIMIZE_OPTS CARES_SET_COMPILER_WARNING_OPTS if test "$compiler_id" = "INTEL_UNIX_C"; then - # + dnl if test "$compiler_num" -ge "1000"; then dnl icc 10.X or later CFLAGS="$CFLAGS -shared-intel" @@ -163,7 +193,7 @@ if test "$compiler_id" = "INTEL_UNIX_C"; then dnl icc 9.X specific CFLAGS="$CFLAGS -i-dynamic" fi - # + dnl fi CARES_CHECK_COMPILER_HALT_ON_ERROR @@ -267,19 +297,19 @@ then AC_MSG_CHECKING([for gethostbyname in $winsock_LIB]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#else -#ifdef HAVE_WINSOCK_H -#include -#endif -#endif -#endif +dnlifdef HAVE_WINDOWS_H +dnlifndef WIN32_LEAN_AND_MEAN +dnldefine WIN32_LEAN_AND_MEAN +dnlendif +dnlinclude +dnlifdef HAVE_WINSOCK2_H +dnlinclude +dnlelse +dnlifdef HAVE_WINSOCK_H +dnlinclude +dnlendif +dnlendif +dnlendif ]],[[ gethostbyname("www.dummysite.com"); ]]) @@ -302,7 +332,7 @@ then AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ /* Older Minix versions may need here instead */ -#include +dnlinclude ]],[[ gethostbyname("www.dummysite.com"); ]]) @@ -320,8 +350,8 @@ then AC_MSG_CHECKING([for gethostbyname for eCos]) AC_LINK_IFELSE([ AC_LANG_PROGRAM([[ -#include -#include +dnlinclude +dnlinclude ]],[[ gethostbyname("www.dummysite.com"); ]]) @@ -374,12 +404,12 @@ AS_IF([test "x$host_vendor" = "xapple"], [ AC_MSG_CHECKING([for iOS minimum version 10 or later]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include -#include +dnlinclude +dnlinclude ]], [[ -#if TARGET_OS_IPHONE == 0 || __IPHONE_OS_VERSION_MIN_REQUIRED < 100000 -#error Not iOS 10 or later -#endif +dnlif TARGET_OS_IPHONE == 0 || __IPHONE_OS_VERSION_MIN_REQUIRED < 100000 +dnlerror Not iOS 10 or later +dnlendif return 0; ]]) ],[ @@ -395,15 +425,15 @@ AS_IF([test "x$host_vendor" = "xapple"], [ AC_MSG_CHECKING([for macOS minimum version 10.12 or later]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([[ -#include -#include +dnlinclude +dnlinclude ]], [[ -#ifndef MAC_OS_X_VERSION_10_12 -# define MAC_OS_X_VERSION_10_12 101200 -#endif -#if MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 -#error Not macOS 10.12 or later -#endif +dnlifndef MAC_OS_X_VERSION_10_12 +dnl define MAC_OS_X_VERSION_10_12 101200 +dnlendif +dnlif MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_12 +dnlerror Not macOS 10.12 or later +dnlendif return 0; ]]) ],[ @@ -485,26 +515,26 @@ dnl to do if found [], dnl default includes [ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_TIME_H -#include -#endif +dnlifdef HAVE_SYS_TYPES_H +dnlinclude +dnlendif +dnlifdef HAVE_SYS_TIME_H +dnlinclude +dnlendif dnl We do this default-include simply to make sure that the nameser_compat.h dnl header *REALLY* can be include after the new nameser.h. It seems AIX 5.1 dnl (and others?) is not designed to allow this. -#ifdef HAVE_ARPA_NAMESER_H -#include -#endif +dnlifdef HAVE_ARPA_NAMESER_H +dnlinclude +dnlendif dnl *Sigh* these are needed in order for net/if.h to get properly detected. -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif +dnlifdef HAVE_SYS_SOCKET_H +dnlinclude +dnlendif +dnlifdef HAVE_NETINET_IN_H +dnlinclude +dnlendif ] ) @@ -536,7 +566,7 @@ if test "xyes" = "x$longlong"; then fi -# check for ssize_t +dnl check for ssize_t AC_CHECK_TYPE(ssize_t, [ CARES_TYPEOF_ARES_SSIZE_T=ssize_t ], [ CARES_TYPEOF_ARES_SSIZE_T=int ]) @@ -544,17 +574,17 @@ AC_DEFINE_UNQUOTED([CARES_TYPEOF_ARES_SSIZE_T], ${CARES_TYPEOF_ARES_SSIZE_T}, [the signed version of size_t]) -# check for bool type +dnl check for bool type AC_CHECK_TYPE([bool],[ AC_DEFINE(HAVE_BOOL_T, 1, [Define to 1 if bool is an available type.]) ], ,[ -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_STDBOOL_H -#include -#endif +dnlifdef HAVE_SYS_TYPES_H +dnlinclude +dnlendif +dnlifdef HAVE_STDBOOL_H +dnlinclude +dnlendif ]) CARES_CONFIGURE_ARES_SOCKLEN_T @@ -604,23 +634,23 @@ CARES_CHECK_FUNC_WRITEV dnl check for AF_INET6 CARES_CHECK_CONSTANT( [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif +dnlundef inline +dnlifdef HAVE_WINDOWS_H +dnlifndef WIN32_LEAN_AND_MEAN +dnldefine WIN32_LEAN_AND_MEAN +dnlendif +dnlinclude +dnlifdef HAVE_WINSOCK2_H +dnlinclude +dnlendif +dnlelse +dnlifdef HAVE_SYS_TYPES_H +dnlinclude +dnlendif +dnlifdef HAVE_SYS_SOCKET_H +dnlinclude +dnlendif +dnlendif ], [PF_INET6], AC_DEFINE_UNQUOTED(HAVE_PF_INET6,1,[Define to 1 if you have PF_INET6.]) ) @@ -628,23 +658,23 @@ CARES_CHECK_CONSTANT( dnl check for PF_INET6 CARES_CHECK_CONSTANT( [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#endif +dnlundef inline +dnlifdef HAVE_WINDOWS_H +dnlifndef WIN32_LEAN_AND_MEAN +dnldefine WIN32_LEAN_AND_MEAN +dnlendif +dnlinclude +dnlifdef HAVE_WINSOCK2_H +dnlinclude +dnlendif +dnlelse +dnlifdef HAVE_SYS_TYPES_H +dnlinclude +dnlendif +dnlifdef HAVE_SYS_SOCKET_H +dnlinclude +dnlendif +dnlendif ], [AF_INET6], AC_DEFINE_UNQUOTED(HAVE_AF_INET6,1,[Define to 1 if you have AF_INET6.]) ) @@ -653,26 +683,26 @@ CARES_CHECK_CONSTANT( dnl check for the in6_addr structure CARES_CHECK_STRUCT( [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#endif +dnlundef inline +dnlifdef HAVE_WINDOWS_H +dnlifndef WIN32_LEAN_AND_MEAN +dnldefine WIN32_LEAN_AND_MEAN +dnlendif +dnlinclude +dnlifdef HAVE_WINSOCK2_H +dnlinclude +dnlifdef HAVE_WS2TCPIP_H +dnlinclude +dnlendif +dnlendif +dnlelse +dnlifdef HAVE_SYS_TYPES_H +dnlinclude +dnlendif +dnlifdef HAVE_NETINET_IN_H +dnlinclude +dnlendif +dnlendif ], [in6_addr], AC_DEFINE_UNQUOTED(HAVE_STRUCT_IN6_ADDR,1,[Define to 1 if you have struct in6_addr.]) ) @@ -680,26 +710,26 @@ CARES_CHECK_STRUCT( dnl check for the sockaddr_in6 structure CARES_CHECK_STRUCT( [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#endif +dnlundef inline +dnlifdef HAVE_WINDOWS_H +dnlifndef WIN32_LEAN_AND_MEAN +dnldefine WIN32_LEAN_AND_MEAN +dnlendif +dnlinclude +dnlifdef HAVE_WINSOCK2_H +dnlinclude +dnlifdef HAVE_WS2TCPIP_H +dnlinclude +dnlendif +dnlendif +dnlelse +dnlifdef HAVE_SYS_TYPES_H +dnlinclude +dnlendif +dnlifdef HAVE_NETINET_IN_H +dnlinclude +dnlendif +dnlendif ], [sockaddr_in6], AC_DEFINE_UNQUOTED(HAVE_STRUCT_SOCKADDR_IN6,1, [Define to 1 if you have struct sockaddr_in6.]) ac_have_sockaddr_in6=yes @@ -710,26 +740,26 @@ AC_CHECK_MEMBER(struct sockaddr_in6.sin6_scope_id, [Define to 1 if your struct sockaddr_in6 has sin6_scope_id.]) , , [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#endif +dnlundef inline +dnlifdef HAVE_WINDOWS_H +dnlifndef WIN32_LEAN_AND_MEAN +dnldefine WIN32_LEAN_AND_MEAN +dnlendif +dnlinclude +dnlifdef HAVE_WINSOCK2_H +dnlinclude +dnlifdef HAVE_WS2TCPIP_H +dnlinclude +dnlendif +dnlendif +dnlelse +dnlifdef HAVE_SYS_TYPES_H +dnlinclude +dnlendif +dnlifdef HAVE_NETINET_IN_H +dnlinclude +dnlendif +dnlendif ]) dnl check for the addrinfo structure @@ -737,32 +767,32 @@ AC_CHECK_MEMBER(struct addrinfo.ai_flags, AC_DEFINE_UNQUOTED(HAVE_STRUCT_ADDRINFO,1, [Define to 1 if you have struct addrinfo.]),, [ -#undef inline -#ifdef HAVE_WINDOWS_H -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif -#include -#ifdef HAVE_WINSOCK2_H -#include -#ifdef HAVE_WS2TCPIP_H -#include -#endif -#endif -#else -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_NETINET_IN_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif -#ifdef HAVE_NETDB_H -#include -#endif -#endif +dnlundef inline +dnlifdef HAVE_WINDOWS_H +dnlifndef WIN32_LEAN_AND_MEAN +dnldefine WIN32_LEAN_AND_MEAN +dnlendif +dnlinclude +dnlifdef HAVE_WINSOCK2_H +dnlinclude +dnlifdef HAVE_WS2TCPIP_H +dnlinclude +dnlendif +dnlendif +dnlelse +dnlifdef HAVE_SYS_TYPES_H +dnlinclude +dnlendif +dnlifdef HAVE_NETINET_IN_H +dnlinclude +dnlendif +dnlifdef HAVE_SYS_SOCKET_H +dnlinclude +dnlendif +dnlifdef HAVE_NETDB_H +dnlinclude +dnlendif +dnlendif ] ) diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 36c6c37b..c918667f 100644 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -29,7 +29,7 @@ AM_LDFLAGS = libcares_la_LDFLAGS_EXTRA = if CARES_LT_SHLIB_USE_VERSION_INFO -libcares_la_LDFLAGS_EXTRA += $(CARES_VERSION_INFO) +libcares_la_LDFLAGS_EXTRA += -version-info @CARES_VERSION_INFO@ endif if CARES_LT_SHLIB_USE_NO_UNDEFINED diff --git a/travis/distcheck.sh b/travis/distcheck.sh index b15781bf..ca6f98fc 100755 --- a/travis/distcheck.sh +++ b/travis/distcheck.sh @@ -2,13 +2,25 @@ set -e if [ "$BUILD_TYPE" = "normal" -a "$TRAVIS_OS_NAME" = "linux" ]; then + # Make distribution tarball ./maketgz 99.98.97 + # Extract distribution tarball for building tar xvf c-ares-99.98.97.tar.gz cd c-ares-99.98.97 - ./configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug + # Build autotools + mkdir build-autotools + cd build-autotools + ../configure --disable-symbol-hiding --enable-expose-statics --enable-maintainer-mode --enable-debug make cd test $TEST_WRAP ./arestest -4 -v $TEST_FILTER - cd .. - cd .. + cd ../.. + # Build CMake + mkdir build-cmake + cd build-cmake + cmake -DCMAKE_BUILD_TYPE=DEBUG -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_BUILD_TESTS=ON .. + make + cd bin + $TEST_WRAP ./arestest -4 -v $TEST_FILTER + cd ../.. fi