Define u_char if including event.h for libevent1

This commit is contained in:
Neel Goyal 2014-02-25 14:21:44 -05:00
parent d7c5122565
commit 2b19661e77
6 changed files with 62 additions and 38 deletions

86
configure vendored
View File

@ -734,10 +734,10 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_fast_install
enable_shared
enable_static
with_pic
enable_fast_install
with_gnu_ld
with_sysroot
enable_libtool_lock
@ -1369,10 +1369,10 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=no]
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
--disable-rpath disable hardcoded rpath (default=enabled)
@ -2211,37 +2211,6 @@ GETDNS_COMPILATION_COMMENT="getdns 0.1.0 configured on $CURRENT_DATE for the Feb
# LT_INIT
# Check whether --enable-fast-install was given.
if test "${enable_fast_install+set}" = set; then :
enableval=$enable_fast_install; p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
enable_fast_install=no
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -6800,6 +6769,35 @@ test -z "$pic_mode" && pic_mode=default
# Check whether --enable-fast-install was given.
if test "${enable_fast_install+set}" = set; then :
enableval=$enable_fast_install; p=${PACKAGE-default}
case $enableval in
yes) enable_fast_install=yes ;;
no) enable_fast_install=no ;;
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for pkg in $enableval; do
IFS="$lt_save_ifs"
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
else
enable_fast_install=yes
fi
@ -11258,6 +11256,17 @@ _ACEOF
CHECK_EVENT_PROG=check_getdns_event
else
# not found - look for event.h
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 :
else
cat >>confdefs.h <<_ACEOF
#define u_char unsigned char
_ACEOF
fi
for ac_header in event.h
do :
ac_fn_c_check_header_compile "$LINENO" "event.h" "ac_cv_header_event_h" "$ac_includes_default
@ -11267,6 +11276,7 @@ if test "x$ac_cv_header_event_h" = xyes; then :
#define HAVE_EVENT_H 1
_ACEOF
# found
have_libevent=1
EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"
CHECK_EVENT_PROG=check_getdns_event
else
@ -12213,12 +12223,12 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
sed_quote_subst='$sed_quote_subst'
double_quote_subst='$double_quote_subst'
delay_variable_subst='$delay_variable_subst'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
@ -13110,9 +13120,6 @@ available_tags=""
# ### BEGIN LIBTOOL CONFIG
# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install
# Which release of libtool.m4 was used?
macro_version=$macro_version
macro_revision=$macro_revision
@ -13126,6 +13133,9 @@ build_old_libs=$enable_static
# What type of objects to build.
pic_mode=$pic_mode
# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install
# Shell to use when invoking shell scripts.
SHELL=$lt_SHELL

View File

@ -209,8 +209,10 @@ AC_SEARCH_LIBS([event_loop],
[EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"]
[CHECK_EVENT_PROG=check_getdns_event],
# not found - look for event.h
[AC_CHECK_TYPE(u_char, unsigned char)]
[AC_CHECK_HEADERS([event.h],
# found
[have_libevent=1]
[EXTENSION_LIBEVENT_EXT_LIBS="$ac_cv_search_event_loop"]
[CHECK_EVENT_PROG=check_getdns_event],
# not found - give up

View File

@ -109,6 +109,9 @@
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define to `unsigned char' if <sys/types.h> does not define. */
#undef u_char
/* Define to the type of an unsigned integer type of width exactly 16 bits if
such a type exists and the standard includes do not define it. */
#undef uint16_t

View File

@ -29,5 +29,8 @@
#ifdef HAVE_EVENT2_EVENT_H
#include <event2/event.h>
#else
# ifndef u_char
# define u_char unsigned char
# endif
#include <event.h>
#endif

View File

@ -40,6 +40,9 @@
#ifdef HAVE_EVENT2_EVENT_H
# include <event2/event.h>
#else
# ifndef u_char
# define u_char unsigned char
# endif
# include <event.h>
# define evutil_socket_t int
# define event_free free

View File

@ -27,5 +27,8 @@
#ifdef HAVE_EVENT2_EVENT_H
#include <event2/event.h>
#else
# ifndef u_char
# define u_char unsigned char
# endif
#include <event.h>
#endif