Fix an issue builing extensions. Make sure to look for the headers as well as the libs

This commit is contained in:
Neel Goyal 2014-02-24 16:35:48 -05:00
parent ba5c7beec4
commit 72bb33ca2e
3 changed files with 96 additions and 14 deletions

57
configure vendored
View File

@ -11250,14 +11250,37 @@ if test "x$ac_cv_header_event2_event_h" = xyes; then :
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
#define HAVE_EVENT2_EVENT_H 1 #define HAVE_EVENT2_EVENT_H 1
_ACEOF _ACEOF
# event2/event.h found
EXTENSION_LIBEVENT_EXT_LIBS="-l$ac_lib"
CHECK_EVENT_PROG=check_getdns_event
else
# not found - look for event.h
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 test "x$ac_cv_header_event_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_EVENT_H 1
_ACEOF
# found
EXTENSION_LIBEVENT_EXT_LIBS="-l$ac_lib"
CHECK_EVENT_PROG=check_getdns_event
else
# not found - give up
have_libevent=0
EXTENSION_LIBEVENT_LIB=""
fi
done
fi fi
done done
EXTENSION_LIBEVENT_EXT_LIBS="-l$ac_lib"
CHECK_EVENT_PROG=check_getdns_event
else else
# libs not found
have_libevent=0 have_libevent=0
EXTENSION_LIBEVENT_LIB="" EXTENSION_LIBEVENT_LIB=""
fi fi
@ -11326,6 +11349,14 @@ $as_echo "$ac_cv_search_uv_run" >&6; }
ac_res=$ac_cv_search_uv_run ac_res=$ac_cv_search_uv_run
if test "$ac_res" != no; then : if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
for ac_header in uv.h
do :
ac_fn_c_check_header_compile "$LINENO" "uv.h" "ac_cv_header_uv_h" "$ac_includes_default
"
if test "x$ac_cv_header_uv_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_UV_H 1
_ACEOF
EXTENSION_LIBUV_EXT_LIBS="-l$ac_lib" EXTENSION_LIBUV_EXT_LIBS="-l$ac_lib"
CHECK_UV_PROG=check_getdns_uv CHECK_UV_PROG=check_getdns_uv
else else
@ -11333,6 +11364,13 @@ else
EXTENSION_LIBUV_LIB="" EXTENSION_LIBUV_LIB=""
fi fi
done
else
have_libuv=0
EXTENSION_LIBUV_LIB=""
fi
@ -11397,8 +11435,23 @@ $as_echo "$ac_cv_search_ev_run" >&6; }
ac_res=$ac_cv_search_ev_run ac_res=$ac_cv_search_ev_run
if test "$ac_res" != no; then : if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
for ac_header in ev.h
do :
ac_fn_c_check_header_compile "$LINENO" "ev.h" "ac_cv_header_ev_h" "$ac_includes_default
"
if test "x$ac_cv_header_ev_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_EV_H 1
_ACEOF
EXTENSION_LIBEV_EXT_LIBS="-l$ac_lib" EXTENSION_LIBEV_EXT_LIBS="-l$ac_lib"
CHECK_EV_PROG=check_getdns_ev CHECK_EV_PROG=check_getdns_ev
else
have_libev=0
EXTENSION_LIBUV_LIB=""
fi
done
else else
have_libev=0 have_libev=0
EXTENSION_LIBEV_LIB="" EXTENSION_LIBEV_LIB=""

View File

@ -203,9 +203,21 @@ CHECK_EVENT_PROG=""
AC_SEARCH_LIBS([event_loop], AC_SEARCH_LIBS([event_loop],
[event_core event], [event_core event],
[AC_CHECK_FUNCS([event_base_new event_base_free])] [AC_CHECK_FUNCS([event_base_new event_base_free])]
[AC_CHECK_HEADERS([event2/event.h],,, [AC_INCLUDES_DEFAULT])] [AC_CHECK_HEADERS([event2/event.h],
# event2/event.h found
[EXTENSION_LIBEVENT_EXT_LIBS="-l$ac_lib"] [EXTENSION_LIBEVENT_EXT_LIBS="-l$ac_lib"]
[CHECK_EVENT_PROG=check_getdns_event], [CHECK_EVENT_PROG=check_getdns_event],
# not found - look for event.h
[AC_CHECK_HEADERS([event.h],
# found
[EXTENSION_LIBEVENT_EXT_LIBS="-l$ac_lib"]
[CHECK_EVENT_PROG=check_getdns_event],
# not found - give up
[have_libevent=0]
[EXTENSION_LIBEVENT_LIB=""],
[AC_INCLUDES_DEFAULT])]
,[AC_INCLUDES_DEFAULT])],
# libs not found
[have_libevent=0] [have_libevent=0]
[EXTENSION_LIBEVENT_LIB=""]) [EXTENSION_LIBEVENT_LIB=""])
@ -221,9 +233,13 @@ EXTENSION_LIBUV_EXT_LIBS=""
CHECK_UV_PROG="" CHECK_UV_PROG=""
AC_SEARCH_LIBS([uv_run], AC_SEARCH_LIBS([uv_run],
[uv], [uv],
[AC_CHECK_HEADERS([uv.h],
[EXTENSION_LIBUV_EXT_LIBS="-l$ac_lib"] [EXTENSION_LIBUV_EXT_LIBS="-l$ac_lib"]
[CHECK_UV_PROG=check_getdns_uv], [CHECK_UV_PROG=check_getdns_uv],
[have_libuv=0] [have_libuv=0]
[EXTENSION_LIBUV_LIB=""],
[AC_INCLUDES_DEFAULT])],
[have_libuv=0]
[EXTENSION_LIBUV_LIB=""]) [EXTENSION_LIBUV_LIB=""])
AC_SUBST(have_libuv) AC_SUBST(have_libuv)
@ -238,9 +254,13 @@ EXTENSION_LIBEV_EXT_LIBS=""
AC_SEARCH_LIBS([ev_run], AC_SEARCH_LIBS([ev_run],
[ev], [ev],
[AC_CHECK_HEADERS([ev.h],
[EXTENSION_LIBEV_EXT_LIBS="-l$ac_lib"] [EXTENSION_LIBEV_EXT_LIBS="-l$ac_lib"]
[CHECK_EV_PROG=check_getdns_ev], [CHECK_EV_PROG=check_getdns_ev],
[have_libev=0] [have_libev=0]
[EXTENSION_LIBUV_LIB=""],
[AC_INCLUDES_DEFAULT])],
[have_libev=0]
[EXTENSION_LIBEV_LIB=""]) [EXTENSION_LIBEV_LIB=""])
AC_SUBST(have_libev) AC_SUBST(have_libev)

View File

@ -12,6 +12,12 @@
/* Define to 1 if you have the `event_base_new' function. */ /* Define to 1 if you have the `event_base_new' function. */
#undef HAVE_EVENT_BASE_NEW #undef HAVE_EVENT_BASE_NEW
/* Define to 1 if you have the <event.h> header file. */
#undef HAVE_EVENT_H
/* Define to 1 if you have the <ev.h> header file. */
#undef HAVE_EV_H
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
@ -51,6 +57,9 @@
/* Define to 1 if you have the <unistd.h> header file. */ /* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
/* Define to 1 if you have the <uv.h> header file. */
#undef HAVE_UV_H
/* Define to the sub-directory in which libtool stores uninstalled libraries. /* Define to the sub-directory in which libtool stores uninstalled libraries.
*/ */
#undef LT_OBJDIR #undef LT_OBJDIR