+if test "x$socket_needs_socket" = "xyes"; then
+ LIBOPING_PC_LIBS_PRIVATE="${LIBOPING_PC_LIBS_PRIVATE} -lsocket"
+fi
+
+# Under Solaris, the `xnet' library provides `recvmsg' which complies with the
+# X/Open CAE Specification.
+with_libxnet="no"
+AC_CHECK_LIB(xnet, __xnet_recvmsg, [with_libxnet="yes"],[])
+if test "x$with_libxnet" = "xyes"
+then
+ CPPFLAGS="$CPPFLAGS -D_XPG4_2 -D__EXTENSIONS__"
+fi
+if test "x$with_libxnet" = "xyes"; then
+ LIBOPING_PC_LIBS_PRIVATE="${LIBOPING_PC_LIBS_PRIVATE} -lxnet"
+fi
+
+AC_SUBST(LIBOPING_PC_LIBS_PRIVATE)
+
+AC_SEARCH_LIBS([nanosleep],[rt],[],
+ [AC_MSG_ERROR([cannot find nanosleep])])
+AC_SEARCH_LIBS([clock_gettime],[rt],[],
+ [AC_MSG_ERROR([cannot find clock_gettime])])
+
+with_ncurses="no"
+AC_CHECK_HEADERS(ncursesw/ncurses.h ncurses.h, [with_ncurses="yes"], [])
+if test "x$with_ncurses" = "xyes"
+then
+ have_ncursesw="no"
+ have_ncurses="no"
+ NCURSES_LIB=""
+
+ AC_CHECK_LIB(ncursesw, mvwprintw, [have_ncursesw="yes"], [have_ncursesw="no"])
+ AC_CHECK_LIB(ncurses, mvwprintw, [have_ncurses="yes"], [have_ncurses="no"])
+
+ if test "x$have_ncursesw" = "xyes"; then
+ NCURSES_LIB="-lncursesw"
+ else if test "x$have_ncurses" = "xyes"; then
+ NCURSES_LIB="-lncurses"
+ else
+ with_ncurses="no"
+ fi; fi
+ AC_SUBST(NCURSES_LIB)
+fi
+AM_CONDITIONAL(BUILD_WITH_LIBNCURSES, test "x$with_ncurses" = "xyes")
+
+AC_FUNC_STRERROR_R
+
+AC_ARG_ENABLE(debug, [AS_HELP_STRING([--enable-debug], [Enable extensive debugging output.])],
+[
+ if test "x$enable_debug" = "xyes"
+ then
+ AC_DEFINE(WITH_DEBUG, 1, [Define to 1 if you want to get debugging output.])
+ fi
+], [])
+AM_CONDITIONAL(BUILD_WITH_DEBUG, test "x$enable_debug" = "xyes")
+
+AC_ARG_WITH(perl-bindings, [AS_HELP_STRING([--with-perl-bindings@<:@=OPTIONS@:>@], [Options passed to "perl Makefile.PL".])],
+[
+ if test "x$withval" != "xno" && test "x$withval" != "xyes"
+ then
+ PERL_BINDINGS_OPTIONS="$withval"
+ with_perl_bindings="yes"
+ else
+ PERL_BINDINGS_OPTIONS=""
+ with_perl_bindings="$withval"
+ fi
+],
+[
+ PERL_BINDINGS_OPTIONS=""
+ with_perl_bindings="yes"
+])
+
+if test "x$with_perl_bindings" = "xyes"
+then
+ BINDINGS="perl-bindings"
+else
+ BINDINGS=""
+fi
+
+AC_SUBST(PERL_BINDINGS_OPTIONS)
+
+AC_SUBST(BINDINGS)