diff --git a/configure b/configure index 6c89df61..8916c159 100755 --- a/configure +++ b/configure @@ -1859,52 +1859,6 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t - -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -11218,16 +11172,10 @@ _ACEOF ;; esac -ac_fn_c_check_decl "$LINENO" "u_char" "ac_cv_have_decl_u_char" "$ac_includes_default" -if test "x$ac_cv_have_decl_u_char" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +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_DECL_U_CHAR $ac_have_decl -_ACEOF +fi getdns_LIBS=$LIBS @@ -11243,8 +11191,12 @@ else fi -# if user specified a location for libevent then use it, otherwise -# check for libevent 1 +# 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="" @@ -11334,7 +11286,7 @@ 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_DECL_U_CHAR == 0 + #if HAVE_U_CHAR == 0 typedef unsigned char u_char; #endif " diff --git a/configure.ac b/configure.ac index 6166a8d3..689e0975 100644 --- a/configure.ac +++ b/configure.ac @@ -189,7 +189,7 @@ AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T -AC_CHECK_DECLS([u_char]) +AC_CHECK_TYPE([u_char]) getdns_LIBS=$LIBS getdns_LDFLAGS=$LDFLAGS @@ -227,7 +227,7 @@ AS_IF([test x_$withval = x_no], [AC_MSG_ERROR([event2/event.h and event.h missing, try without libevent])] [have_libevent=0], [AC_INCLUDES_DEFAULT] - [#if HAVE_DECL_U_CHAR == 0 + [#if HAVE_U_CHAR == 0 typedef unsigned char u_char; #endif])], [AC_INCLUDES_DEFAULT])], diff --git a/src/config.h.in b/src/config.h.in index 4578b95d..c384d0cf 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -1,9 +1,5 @@ /* src/config.h.in. Generated from configure.ac by autoheader. */ -/* Define to 1 if you have the declaration of `u_char', and to 0 if you don't. - */ -#undef HAVE_DECL_U_CHAR - /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H