mirror of
https://framagit.org/bortzmeyer/echoping
synced 2024-11-15 00:12:48 +00:00
135 lines
2.6 KiB
Plaintext
135 lines
2.6 KiB
Plaintext
dnl $Id$
|
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
AC_INIT(echoping.h)
|
|
dnl AC_CANONICAL_HOST
|
|
AM_INIT_AUTOMAKE(echoping, 4.1.0)
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
dnl User options
|
|
AC_ARG_ENABLE(http,
|
|
[--enable-http HTTP (Web's main protocol) support],dnl
|
|
[if test "$enableval" = "yes"; then
|
|
AC_DEFINE(HTTP)
|
|
HTTP=1
|
|
fi],
|
|
dnl Default: enable it
|
|
[AC_DEFINE(HTTP)
|
|
HTTP=1])
|
|
AC_ARG_ENABLE(icp,
|
|
[--enable-icp ICP (for testing Web proxies/caches) support],dnl
|
|
[if test "$enableval" = "yes"; then
|
|
AC_DEFINE(ICP)
|
|
ICP=1
|
|
fi])
|
|
AC_ARG_ENABLE(smtp,
|
|
[--enable-smtp SMTP (Mail's main protocol) support],dnl
|
|
[if test "$enableval" = "yes"; then
|
|
AC_DEFINE(SMTP)
|
|
SMTP=1
|
|
fi],
|
|
dnl Default: enable it
|
|
[AC_DEFINE(SMTP)
|
|
SMTP=1])
|
|
AC_ARG_WITH(ssl,
|
|
[--with-ssl[=DIR] SSL crypt support (needs OpenSSL)],dnl
|
|
[if test "$withval" != "no"; then
|
|
AC_DEFINE(OPENSSL)
|
|
OPENSSL=1
|
|
if test "$withval" != "yes"; then
|
|
SSLROOT=$withval
|
|
LDFLAGS="${LDFLAGS} -L$SSLROOT/lib"
|
|
CPPFLAGS="${CPPFLAGS} -I$SSLROOT/include"
|
|
fi
|
|
fi],
|
|
dnl Default: disable it
|
|
)
|
|
|
|
dnl See T/TCP later
|
|
|
|
dnl Checks for programs.
|
|
AC_PROG_CC
|
|
AC_PROG_INSTALL
|
|
|
|
dnl Checks for libraries.
|
|
|
|
dnl Checks for header files.
|
|
AC_HEADER_STDC
|
|
AC_CHECK_HEADERS(sys/time.h unistd.h)
|
|
CF_SYS_ERRLIST
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
AC_C_CONST
|
|
AC_HEADER_TIME
|
|
|
|
dnl Checks for library functions.
|
|
CF_LIB_SOCKET
|
|
CF_LIB_NSL
|
|
AC_TYPE_SIGNAL
|
|
AC_FUNC_VPRINTF
|
|
AC_CHECK_FUNCS(gettimeofday socket gethostbyname sigaction, , AC_MSG_ERROR(Missing mandatory function))
|
|
|
|
if test "$OPENSSL" = "1"; then
|
|
CF_LIB_OPENSSL
|
|
fi
|
|
|
|
dnl T/TCP
|
|
AC_MSG_CHECKING([T/TCP])
|
|
AC_TRY_COMPILE(
|
|
[#include <sys/types.h>
|
|
#include <sys/socket.h>
|
|
],
|
|
[int foobar = MSG_EOF;],
|
|
[AC_DEFINE(TTCP)
|
|
ac_have_ttcp="yes"],
|
|
ac_have_ttcp=no)
|
|
AC_MSG_RESULT($ac_have_ttcp)
|
|
AC_ARG_ENABLE(ttcp,
|
|
[--enable-ttcp T/TCP (Transaction TCP) support],
|
|
[if test "$enableval" = "yes"; then
|
|
if test $ac_have_ttcp = "yes"; then
|
|
AC_DEFINE(HAVE_TTCP)
|
|
TTCP=1
|
|
else
|
|
AC_MSG_WARN([No T/TCP support on this system, request ignored])
|
|
fi
|
|
fi],
|
|
dnl Default: enable it if supported
|
|
if test $ac_have_ttcp = "yes"; then
|
|
AC_DEFINE(HAVE_TTCP)
|
|
TTCP=1
|
|
fi)
|
|
|
|
dnl if test "$ICP" = "1"; then
|
|
dnl CF_CHECK_SERVICES
|
|
dnl fi
|
|
|
|
if test "$GCC" = yes; then
|
|
CFLAGS="$CFLAGS -Wall"
|
|
fi
|
|
|
|
AC_OUTPUT(Makefile)
|
|
|
|
|
|
AC_DEFUN([DISPLAY_SETTING],
|
|
[
|
|
AC_MSG_CHECKING($1)
|
|
if [ eval 'test "$$1" = "1"' > /dev/null]; then
|
|
AC_MSG_RESULT( enabled)
|
|
else
|
|
AC_MSG_RESULT( disabled)
|
|
fi
|
|
])dnl
|
|
echo ""
|
|
echo "Configuration of echoping:"
|
|
|
|
DISPLAY_SETTING(HTTP)
|
|
DISPLAY_SETTING(ICP)
|
|
DISPLAY_SETTING(OPENSSL)
|
|
DISPLAY_SETTING(SMTP)
|
|
DISPLAY_SETTING(TTCP)
|
|
|
|
|
|
|
|
|