diff --git a/ChangeLog b/ChangeLog index a6113634..baf2d8eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -* 2014-05-22: Version 0.1.2 +* 2014-06-02: Version 0.1.2 * Fixed rdata fields for MX * Expose only public API symbols * Updated manpages @@ -11,6 +11,7 @@ Thanks Paul Hoffman * Mac OSX package built instructions for generic user in README.md Thanks Joel Purra + * Fixed build problems on RHEL/CentOS due using libevent 1.x * 2014-03-24 : Version 0.1.1 diff --git a/README.md b/README.md index 99f4c876..23e60298 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ getdns API ========== -* Date: 2014-05-22 +* Date: 2014-06-02 * GitHub: getdns is a [modern asynchronous DNS API](http://www.vpnc.org/getdns-api/) @@ -142,21 +142,20 @@ Some platform specific features are not implemented in the first public release There are a few known issues which we have summarized below - the most recent and helpful list is being maintained in the git issues list in the repository. +Other known issues are being managed in the git repository issue list. * (#113) Changing the resolution type between stub and recursive after a query has been issued with a context will not work - the previous resolution type will continue to be used. If you want to change the resolution type you will need to create a new context and set the resolution type for that context. -* older versions of libtool and ranlib may have problems with the way we leverage features specific to exported sybols. If you see messages during linking it may be due to an older version of libtool in your PATH. This can be fixed by updating your libtool or adding the getdns build directory to the beginning of your path so that our libtool/ranlib are picked up. +* older versions of libtool and ranlib may have problems with the way we leverage features specific to exported symbols. If you see error messages during linking it may be due to an older version of libtool in your PATH. This can be fixed by updating your libtool or adding the getdns build directory to the beginning of your path so that our libtool/ranlib are preferred. #Supported Platforms The primary platforms targeted are Linux and FreeBSD, other platform are supported as we get time. The names listed here are intended to help ensure that we catch platform specific breakage, not to limit the work that folks are doing. -* Debian 7.0, 7.3 -* FreeBSD 8.4, 9.2, 10.0 -* RHEL/CentOS 6.4, 6.5 -* OSX 10.8, 10.9 -* Ubuntu 12.04, 13.10 +* RHEL/CentOS 6.4 +* OSX 10.8 +* Ubuntu 13.10 For most platforms where we have provided a binary distribution as a compressed tar you can simply untar the file and run "make install". Bear in mind that any dependencies @@ -176,7 +175,7 @@ We intend to add MS-Windows, Android and other platforms to the releases as we h If you're using [FreeBSD](http://www.freebsd.org/), you may install getdns via the [ports tree](http://www.freshports.org/dns/getdns/) by running: `cd /usr/ports/dns/getdns && make install clean` -If you are using FreeBSD 10 getdns can be intalled via 'pkg install getdns'. +If you are using FreeBSD 10 getdns can be intalled via 'pkg install getdns'. There may be some problems building getdns on FreeBSD 10 using libevent. ###CentOS/RHEL 6.5 diff --git a/configure b/configure index 30b01122..ea6573df 100755 --- a/configure +++ b/configure @@ -3248,9 +3248,7 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac case "$host_os" in - linux* ) CFLAGS="$CFLAGS -D_XOPEN_SOURCE=501" # unfortunate, but needed to - # pick up strdup() declaration - # in + linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;; solaris* ) CFLAGS="$CFLAGS -D__EXTENSIONS__" # for strdup() from ;; @@ -5642,7 +5640,7 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -5660,10 +5658,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; - powerpc64le-*linux*) - LD="${LD-ld} -m elf32lppclinux" - ;; - powerpc64-*linux*) + ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) @@ -5682,10 +5677,7 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - powerpcle-*linux*) - LD="${LD-ld} -m elf64lppc" - ;; - powerpc-*linux*) + ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) @@ -9694,14 +9686,10 @@ fi # before this can be enabled. hardcode_into_libs=yes - # Add ABI-specific directories to the system library path. - sys_lib_dlsearch_path_spec="/lib64 /usr/lib64 /lib /usr/lib" - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec $lt_ld_extra" - + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on @@ -11177,11 +11165,6 @@ _ACEOF ac_fn_c_check_type "$LINENO" "u_char" "ac_cv_type_u_char" "$ac_includes_default" if test "x$ac_cv_type_u_char" = xyes; then : -cat >>confdefs.h <<_ACEOF -#define HAVE_U_CHAR 1 -_ACEOF - - fi @@ -11198,6 +11181,13 @@ else fi +# libevent 1.x requires a u_char typedef which is not always available +# on some systems so our check is a little complicated +# we further need to ensure that this is included in the getdns headers +# that get installed later so some users may not be building in an +# environment that has the generated config.h SO we need to generate +# this one extra header in that case + have_libevent=0 EXTENSION_LIBEVENT_EXT_LIBS="" EXTENSION_LIBEVENT_LIB="" @@ -11281,18 +11271,29 @@ if test "x$ac_cv_header_event2_event_h" = xyes; then : #define HAVE_EVENT2_EVENT_H 1 _ACEOF have_libevent=1 - EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop" + if test "x_$ac_cv_search_event_loop" = "x_none required"; then : + +else + EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop" +fi else for ac_header in event.h do : ac_fn_c_check_header_compile "$LINENO" "event.h" "ac_cv_header_event_h" "$ac_includes_default + #if HAVE_U_CHAR == 0 + typedef unsigned char u_char; + #endif " if test "x$ac_cv_header_event_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_EVENT_H 1 _ACEOF have_libevent=1 - EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop" + if test "x_$ac_cv_search_event_loop" = "x_none required"; then : + +else + EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop" +fi else as_fn_error $? "event2/event.h and event.h missing, try without libevent" "$LINENO" 5 have_libevent=0 diff --git a/configure.ac b/configure.ac index 77480756..9c7cb7ef 100644 --- a/configure.ac +++ b/configure.ac @@ -45,9 +45,7 @@ AC_PROG_CPP # Checks for programs. AC_CANONICAL_HOST case "$host_os" in - linux* ) CFLAGS="$CFLAGS -D_XOPEN_SOURCE=501" # unfortunate, but needed to - # pick up strdup() declaration - # in + linux* ) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;; solaris* ) CFLAGS="$CFLAGS -D__EXTENSIONS__" # for strdup() from ;; @@ -189,7 +187,7 @@ AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T -AC_CHECK_TYPES([u_char]) +AC_CHECK_TYPE([u_char]) getdns_LIBS=$LIBS getdns_LDFLAGS=$LDFLAGS @@ -200,6 +198,13 @@ AC_ARG_WITH([libevent], [with_libevent=search], [withval=no]) +# libevent 1.x requires a u_char typedef which is not always available +# on some systems so our check is a little complicated +# we further need to ensure that this is included in the getdns headers +# that get installed later so some users may not be building in an +# environment that has the generated config.h SO we need to generate +# this one extra header in that case + have_libevent=0 EXTENSION_LIBEVENT_EXT_LIBS="" EXTENSION_LIBEVENT_LIB="" @@ -213,15 +218,18 @@ AS_IF([test x_$withval = x_no], [AC_CHECK_FUNCS([event_base_new event_base_free])] [AC_CHECK_HEADERS([event2/event.h], [have_libevent=1] - [EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"], + [AS_IF([test "x_$ac_cv_search_event_loop" = "x_none required"],[],[EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"])], [AC_CHECK_HEADERS([event.h], [have_libevent=1] - [EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"], + [AS_IF([test "x_$ac_cv_search_event_loop" = "x_none required"],[],[EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"])], [AC_MSG_ERROR([event2/event.h and event.h missing, try without libevent])] [have_libevent=0], - [AC_INCLUDES_DEFAULT])], + [AC_INCLUDES_DEFAULT] + [#if HAVE_U_CHAR == 0 + typedef unsigned char u_char; + #endif])], [AC_INCLUDES_DEFAULT])], - [AC_MSG_ERROR([libevent missing, try without libevent])] + [AC_MSG_ERROR([libevent missing, try without libevent])] )], [have_libevent=1] [AC_MSG_NOTICE([assuming libevent in $withval])] diff --git a/src/config.h.in b/src/config.h.in index d3c657b9..c384d0cf 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -63,9 +63,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UV_H -/* Define to 1 if the system has the type `u_char'. */ -#undef HAVE_U_CHAR - /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR diff --git a/src/convert.c b/src/convert.c index 8fad6e10..97510cea 100644 --- a/src/convert.c +++ b/src/convert.c @@ -33,6 +33,7 @@ */ #include +#include #include #include #include diff --git a/src/extension/libevent.c b/src/extension/libevent.c index dcccd636..e42d6a10 100644 --- a/src/extension/libevent.c +++ b/src/extension/libevent.c @@ -40,9 +40,6 @@ #ifdef HAVE_EVENT2_EVENT_H # include #else -# ifndef u_char -# define u_char unsigned char -# endif # include # define evutil_socket_t int # define event_free free