[ AC_MSG_ERROR([required library function is missing on your system])])
# pkg-config based tests
PKG_PROG_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
if test "$WIN32" != "xyes"; then
PKG_CHECK_MODULES([NCURSES], [ncursesw], [],
[
AC_MSG_ERROR([required library ncursesw was not found on your system: $NCURSES_PKG_ERRORS])
])
fi
else
AC_MSG_WARN([pkg-config was not found on your sytem])
fi
if (test -z "$PKG_CONFIG") || (test "x$WIN32" = "xyes"); then
AC_CHECK_HEADER([curses.h],
[],
[
AC_MSG_ERROR([headers for the ncurses library were not found on your system])
]
)
if test "x$WIN32" = "xyes"; then
AC_CHECK_LIB([pdcurses], [clear],
[],
[
AC_MSG_ERROR([required library pdcurses was not found on your system])
]
)
AC_CHECK_LIB(ws2_32, main,
[
WINSOCK2_LIBS="-lws2_32"
AC_SUBST(WINSOCK2_LIBS)
],
[
AC_MSG_ERROR([required library winsock2 was not found on the system, please check your MinGW installation])
]
)
else
AC_CHECK_LIB([ncursesw], [get_wch],
[],
[
unset ac_cv_lib_ncursesw_get_wch
AC_CHECK_LIB([ncursesw], [get_wch],
[],
[
AC_MSG_ERROR([required library ncurses was not found on your system])
],
[
-ltinfo
]
)
]
)
fi
fi
# sodium is included by Tox headers so we kind of need to know where it is
LIBSODIUM_CFLAGS=
CFLAGS_SAVE="$CFLAGS"
CPPFLAGS_SAVE="$CPPFLAGS"
if test -n "$LIBSODIUM_SEARCH_HEADERS"; then
CFLAGS="$CFLAGS -I$LIBSODIUM_SEARCH_HEADERS"
CPPFLAGS="$CFLAGS -I$LIBSODIUM_SEARCH_HEADERS"
AC_CHECK_HEADER(sodium.h,
[
LIBSODIUM_CFLAGS="-I$LIBSODIUM_SEARCH_HEADERS"
],
[
AC_MSG_ERROR([header files for required library libsodium was not found in requested location $LIBSODIUM_SEARCH_HEADERS])
]
)
else
AC_CHECK_HEADER(sodium.h,
[],
[
AC_MSG_ERROR([header files for required library libsodium was not found on your system, please check http://download.libsodium.org/libsodium/releases/])
]
)
fi
CFLAGS="$CFLAGS_SAVE"
CPPFLAGS="$CPPFLAGS_SAVE"
AC_SUBST(LIBSODIUM_CFLAGS)
LIBSODIUM_LIBS=
LIBSODIUM_LDFLAGS=
LDFLAGS_SAVE="$LDFLAGS"
if test -n "$LIBSODIUM_SEARCH_LIBS"; then
LDFLAGS="$LDFLAGS -L$LIBSODIUM_SEARCH_LIBS"
AC_CHECK_LIB(sodium, randombytes_random,
[
LIBSODIUM_LDFLAGS="-L$LIBSODIUM_SEARCH_LIBS"
LIBSODIUM_LIBS="-lsodium"
],
[
AC_MSG_ERROR([required library libsodium was not found in requested location $LIBSODIUM_SEARCH_LIBS])
]
)
else
AC_CHECK_LIB(sodium, randombytes_random,
[],
[
AC_MSG_ERROR([required library libsodium was not found on your system, please check http://download.libsodium.org/libsodium/releases/])