GNU TLS support (still a bug when looping)

Initial
Stephane Bortzmeyer 21 years ago
parent 2d94cc47a8
commit 369af6e01c

@ -1,3 +1,7 @@
5.1.0 (NOT YET RELEASED)
* GNU TLS support (alternative to OpenSSL)
5.0.1 (2002-11-04)
* Small bug fixes,

@ -62,6 +62,9 @@ POST_UNINSTALL = :
host_alias = @host_alias@
host_triplet = @host@
CC = @CC@
HAVE_LIB = @HAVE_LIB@
LIB = @LIB@
LTLIB = @LTLIB@
MAKEINFO = @MAKEINFO@
PACKAGE = @PACKAGE@
VERSION = @VERSION@

@ -33,6 +33,9 @@
/* SSL (crypto) */
#undef OPENSSL
/* TLS (crypto) */
#undef GNUTLS
/* Port name for HTTP. Unused. */
#undef HTTP_TCP_PORT

@ -1,6 +1,6 @@
dnl $Id$
dnl Macros beginning with CF_ stolen from Lynx
dnl Macros beginning with CF_ (mostly) stolen from Lynx
dnl Thanks to "T.E.Dickey" <dickey@clark.net>
dnl ---------------------------------------------------------------------------
@ -179,6 +179,14 @@ AC_CHECK_LIB(ssl,SSL_CTX_new,
-lcrypto
)])
# Check GNU TLS
AC_DEFUN([CF_LIB_GNUTLS],
[
AC_CHECK_LIB(gnutls,gnutls_global_init,
[LIBS="${LIBS} `libgnutls-config --libs`"],
[AC_ERROR([Get the GNU TLS library (http://www.gnutls.org/)])], dnl
)])
dnl experimental
AC_DEFUN([CF_CHECK_TCP_SERVICE],
[

829
SRC/aclocal.m4 vendored

@ -12,7 +12,7 @@ dnl PARTICULAR PURPOSE.
dnl $Id$
dnl Macros beginning with CF_ stolen from Lynx
dnl Macros beginning with CF_ (mostly) stolen from Lynx
dnl Thanks to "T.E.Dickey" <dickey@clark.net>
dnl ---------------------------------------------------------------------------
@ -191,6 +191,14 @@ AC_CHECK_LIB(ssl,SSL_CTX_new,
-lcrypto
)])
# Check GNU TLS
AC_DEFUN([CF_LIB_GNUTLS],
[
AC_CHECK_LIB(gnutls,gnutls_global_init,
[LIBS="${LIBS} `libgnutls-config --libs`"],
[AC_ERROR([Get the GNU TLS library (http://www.gnutls.org/)])], dnl
)])
dnl experimental
AC_DEFUN([CF_CHECK_TCP_SERVICE],
[
@ -277,6 +285,825 @@ fi
# lib-prefix.m4 serial 3 (gettext-0.12.2)
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible.
dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
dnl require excessive bracketing.
ifdef([AC_HELP_STRING],
[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
dnl to access previously installed libraries. The basic assumption is that
dnl a user will want packages to use other packages he previously installed
dnl with the same --prefix option.
dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
dnl libraries, but is otherwise very convenient.
AC_DEFUN([AC_LIB_PREFIX],
[
AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib-prefix],
[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
--without-lib-prefix don't search for libraries in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/lib"
fi
fi
])
if test $use_additional = yes; then
dnl Potentially add $additional_includedir to $CPPFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's already present in $CPPFLAGS,
dnl 3. if it's /usr/local/include and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
for x in $CPPFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $CPPFLAGS.
CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
fi
fi
fi
fi
dnl Potentially add $additional_libdir to $LDFLAGS.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's already present in $LDFLAGS,
dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/lib"; then
haveit=
for x in $LDFLAGS; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test "X$additional_libdir" = "X/usr/local/lib"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LDFLAGS.
LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
fi
fi
fi
fi
fi
])
dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
dnl acl_final_exec_prefix, containing the values to which $prefix and
dnl $exec_prefix will expand at the end of the configure script.
AC_DEFUN([AC_LIB_PREPARE_PREFIX],
[
dnl Unfortunately, prefix and exec_prefix get only finally determined
dnl at the end of configure.
if test "X$prefix" = "XNONE"; then
acl_final_prefix="$ac_default_prefix"
else
acl_final_prefix="$prefix"
fi
if test "X$exec_prefix" = "XNONE"; then
acl_final_exec_prefix='${prefix}'
else
acl_final_exec_prefix="$exec_prefix"
fi
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
prefix="$acl_save_prefix"
])
dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
dnl variables prefix and exec_prefix bound to the values they will have
dnl at the end of the configure script.
AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
[
acl_save_prefix="$prefix"
prefix="$acl_final_prefix"
acl_save_exec_prefix="$exec_prefix"
exec_prefix="$acl_final_exec_prefix"
$1
exec_prefix="$acl_save_exec_prefix"
prefix="$acl_save_prefix"
])
# lib-link.m4 serial 4 (gettext-0.12)
dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl From Bruno Haible.
dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
dnl augments the CPPFLAGS variable.
AC_DEFUN([AC_LIB_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
define([Name],[translit([$1],[./-], [___])])
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
AC_LIB_LINKFLAGS_BODY([$1], [$2])
ac_cv_lib[]Name[]_libs="$LIB[]NAME"
ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
])
LIB[]NAME="$ac_cv_lib[]Name[]_libs"
LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
AC_SUBST([LIB]NAME)
AC_SUBST([LTLIB]NAME)
dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
dnl results of this search when this library appears as a dependency.
HAVE_LIB[]NAME=yes
undefine([Name])
undefine([NAME])
])
dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
dnl searches for libname and the libraries corresponding to explicit and
dnl implicit dependencies, together with the specified include files and
dnl the ability to compile and link the specified testcode. If found, it
dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
[
AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
AC_REQUIRE([AC_LIB_RPATH])
define([Name],[translit([$1],[./-], [___])])
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
dnl accordingly.
AC_LIB_LINKFLAGS_BODY([$1], [$2])
dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
dnl because if the user has installed lib[]Name and not disabled its use
dnl via --without-lib[]Name-prefix, he wants to use it.
ac_save_CPPFLAGS="$CPPFLAGS"
AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LIB[]NAME"
AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
LIBS="$ac_save_LIBS"
])
if test "$ac_cv_lib[]Name" = yes; then
HAVE_LIB[]NAME=yes
AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
AC_MSG_CHECKING([how to link with lib[]$1])
AC_MSG_RESULT([$LIB[]NAME])
else
HAVE_LIB[]NAME=no
dnl If $LIB[]NAME didn't lead to a usable library, we don't need
dnl $INC[]NAME either.
CPPFLAGS="$ac_save_CPPFLAGS"
LIB[]NAME=
LTLIB[]NAME=
fi
AC_SUBST([HAVE_LIB]NAME)
AC_SUBST([LIB]NAME)
AC_SUBST([LTLIB]NAME)
undefine([Name])
undefine([NAME])
])
dnl Determine the platform dependent parameters needed to use rpath:
dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
dnl hardcode_direct, hardcode_minus_L.
AC_DEFUN([AC_LIB_RPATH],
[
AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
. ./conftest.sh
rm -f ./conftest.sh
acl_cv_rpath=done
])
wl="$acl_cv_wl"
libext="$acl_cv_libext"
shlibext="$acl_cv_shlibext"
hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
hardcode_direct="$acl_cv_hardcode_direct"
hardcode_minus_L="$acl_cv_hardcode_minus_L"
dnl Determine whether the user wants rpath handling at all.
AC_ARG_ENABLE(rpath,
[ --disable-rpath do not hardcode runtime library paths],
:, enable_rpath=yes)
])
dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
dnl the libraries corresponding to explicit and implicit dependencies.
dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
[
define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
[ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
dnl By default, look in $includedir and $libdir.
use_additional=yes
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
AC_LIB_ARG_WITH([lib$1-prefix],
[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
--without-lib$1-prefix don't search for lib$1 in includedir and libdir],
[
if test "X$withval" = "Xno"; then
use_additional=no
else
if test "X$withval" = "X"; then
AC_LIB_WITH_FINAL_PREFIX([
eval additional_includedir=\"$includedir\"
eval additional_libdir=\"$libdir\"
])
else
additional_includedir="$withval/include"
additional_libdir="$withval/lib"
fi
fi
])
dnl Search the library and its dependencies in $additional_libdir and
dnl $LDFLAGS. Using breadth-first-seach.
LIB[]NAME=
LTLIB[]NAME=
INC[]NAME=
rpathdirs=
ltrpathdirs=
names_already_handled=
names_next_round='$1 $2'
while test -n "$names_next_round"; do
names_this_round="$names_next_round"
names_next_round=
for name in $names_this_round; do
already_handled=
for n in $names_already_handled; do
if test "$n" = "$name"; then
already_handled=yes
break
fi
done
if test -z "$already_handled"; then
names_already_handled="$names_already_handled $name"
dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
dnl or AC_LIB_HAVE_LINKFLAGS call.
uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
eval value=\"\$HAVE_LIB$uppername\"
if test -n "$value"; then
if test "$value" = yes; then
eval value=\"\$LIB$uppername\"
test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
eval value=\"\$LTLIB$uppername\"
test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
else
dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
dnl that this library doesn't exist. So just drop it.
:
fi
else
dnl Search the library lib$name in $additional_libdir and $LDFLAGS
dnl and the already constructed $LIBNAME/$LTLIBNAME.
found_dir=
found_la=
found_so=
found_a=
if test $use_additional = yes; then
if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
found_dir="$additional_libdir"
found_so="$additional_libdir/lib$name.$shlibext"
if test -f "$additional_libdir/lib$name.la"; then
found_la="$additional_libdir/lib$name.la"
fi
else
if test -f "$additional_libdir/lib$name.$libext"; then
found_dir="$additional_libdir"
found_a="$additional_libdir/lib$name.$libext"
if test -f "$additional_libdir/lib$name.la"; then
found_la="$additional_libdir/lib$name.la"
fi
fi
fi
fi
if test "X$found_dir" = "X"; then
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
case "$x" in
-L*)
dir=`echo "X$x" | sed -e 's/^X-L//'`
if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
found_dir="$dir"
found_so="$dir/lib$name.$shlibext"
if test -f "$dir/lib$name.la"; then
found_la="$dir/lib$name.la"
fi
else
if test -f "$dir/lib$name.$libext"; then
found_dir="$dir"
found_a="$dir/lib$name.$libext"
if test -f "$dir/lib$name.la"; then
found_la="$dir/lib$name.la"
fi
fi
fi
;;
esac
if test "X$found_dir" != "X"; then
break
fi
done
fi
if test "X$found_dir" != "X"; then
dnl Found the library.
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
if test "X$found_so" != "X"; then
dnl Linking with a shared library. We attempt to hardcode its
dnl directory into the executable's runpath, unless it's the
dnl standard /usr/lib.
if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
dnl No hardcoding is needed.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
dnl Use an explicit option to hardcode DIR into the resulting
dnl binary.
dnl Potentially add DIR to ltrpathdirs.
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
haveit=
for x in $ltrpathdirs; do
if test "X$x" = "X$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
ltrpathdirs="$ltrpathdirs $found_dir"
fi
dnl The hardcoding into $LIBNAME is system dependent.
if test "$hardcode_direct" = yes; then
dnl Using DIR/libNAME.so during linking hardcodes DIR into the
dnl resulting binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
dnl Use an explicit option to hardcode DIR into the resulting
dnl binary.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
dnl Potentially add DIR to rpathdirs.
dnl The rpathdirs will be appended to $LIBNAME at the end.
haveit=
for x in $rpathdirs; do
if test "X$x" = "X$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
rpathdirs="$rpathdirs $found_dir"
fi
else
dnl Rely on "-L$found_dir".
dnl But don't add it if it's already contained in the LDFLAGS
dnl or the already constructed $LIBNAME
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$found_dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
fi
if test "$hardcode_minus_L" != no; then
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
else
dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
dnl here, because this doesn't fit in flags passed to the
dnl compiler. So give up. No hardcoding. This affects only
dnl very old systems.
dnl FIXME: Not sure whether we should use
dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
dnl here.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
fi
fi
fi
fi
else
if test "X$found_a" != "X"; then
dnl Linking with a static library.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
else
dnl We shouldn't come here, but anyway it's good to have a
dnl fallback.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
fi
fi
dnl Assume the include files are nearby.
additional_includedir=
case "$found_dir" in
*/lib | */lib/)
basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
additional_includedir="$basedir/include"
;;
esac
if test "X$additional_includedir" != "X"; then
dnl Potentially add $additional_includedir to $INCNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/include,
dnl 2. if it's /usr/local/include and we are using GCC on Linux,
dnl 3. if it's already present in $CPPFLAGS or the already
dnl constructed $INCNAME,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_includedir" != "X/usr/include"; then
haveit=
if test "X$additional_includedir" = "X/usr/local/include"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
for x in $CPPFLAGS $INC[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-I$additional_includedir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_includedir"; then
dnl Really add $additional_includedir to $INCNAME.
INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
fi
fi
fi
fi
fi
dnl Look for dependencies.
if test -n "$found_la"; then
dnl Read the .la file. It defines the variables
dnl dlname, library_names, old_library, dependency_libs, current,
dnl age, revision, installed, dlopen, dlpreopen, libdir.
save_libdir="$libdir"
case "$found_la" in
*/* | *\\*) . "$found_la" ;;
*) . "./$found_la" ;;
esac
libdir="$save_libdir"
dnl We use only dependency_libs.
for dep in $dependency_libs; do
case "$dep" in
-L*)
additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
dnl But don't add it
dnl 1. if it's the standard /usr/lib,
dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
dnl 3. if it's already present in $LDFLAGS or the already
dnl constructed $LIBNAME,
dnl 4. if it doesn't exist as a directory.
if test "X$additional_libdir" != "X/usr/lib"; then
haveit=
if test "X$additional_libdir" = "X/usr/local/lib"; then
if test -n "$GCC"; then
case $host_os in
linux*) haveit=yes;;
esac
fi
fi
if test -z "$haveit"; then
haveit=
for x in $LDFLAGS $LIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LIBNAME.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
fi
fi
haveit=
for x in $LDFLAGS $LTLIB[]NAME; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X-L$additional_libdir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
if test -d "$additional_libdir"; then
dnl Really add $additional_libdir to $LTLIBNAME.
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
fi
fi
fi
fi
;;
-R*)
dir=`echo "X$dep" | sed -e 's/^X-R//'`
if test "$enable_rpath" != no; then
dnl Potentially add DIR to rpathdirs.
dnl The rpathdirs will be appended to $LIBNAME at the end.
haveit=
for x in $rpathdirs; do
if test "X$x" = "X$dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
rpathdirs="$rpathdirs $dir"
fi
dnl Potentially add DIR to ltrpathdirs.
dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
haveit=
for x in $ltrpathdirs; do
if test "X$x" = "X$dir"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
ltrpathdirs="$ltrpathdirs $dir"
fi
fi
;;
-l*)
dnl Handle this in the next round.
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
;;
*.la)
dnl Handle this in the next round. Throw away the .la's
dnl directory; it is already contained in a preceding -L
dnl option.
names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
;;
*)
dnl Most likely an immediate library name.
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
;;
esac
done
fi
else
dnl Didn't find the library; assume it is in the system directories
dnl known to the linker and runtime loader. (All the system
dnl directories known to the linker should also be known to the
dnl runtime loader, otherwise the system is severely misconfigured.)
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
fi
fi
fi
done
done
if test "X$rpathdirs" != "X"; then
if test -n "$hardcode_libdir_separator"; then
dnl Weird platform: only the last -rpath option counts, the user must
dnl pass all path elements in one option. We can arrange that for a
dnl single library, but not when more than one $LIBNAMEs are used.
alldirs=
for found_dir in $rpathdirs; do
alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
done
dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
acl_save_libdir="$libdir"
libdir="$alldirs"
eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
else
dnl The -rpath options are cumulative.
for found_dir in $rpathdirs; do
acl_save_libdir="$libdir"
libdir="$found_dir"
eval flag=\"$hardcode_libdir_flag_spec\"
libdir="$acl_save_libdir"
LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
done
fi
fi
if test "X$ltrpathdirs" != "X"; then
dnl When using libtool, the option that works for both libraries and
dnl executables is -R. The -R options are cumulative.
for found_dir in $ltrpathdirs; do
LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
done
fi
])
dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
dnl unless already present in VAR.
dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
dnl contains two or three consecutive elements that belong together.
AC_DEFUN([AC_LIB_APPENDTOVAR],
[
for element in [$2]; do
haveit=
for x in $[$1]; do
AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
if test "X$x" = "X$element"; then
haveit=yes
break
fi
done
if test -z "$haveit"; then
[$1]="${[$1]}${[$1]:+ }$element"
fi
done
])
# lib-ld.m4 serial 2 (gettext-0.12)
dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
dnl This file is free software, distributed under the terms of the GNU
dnl General Public License. As a special exception to the GNU General
dnl Public License, this file may be distributed as part of a program
dnl that contains a configuration script generated by Autoconf, under
dnl the same distribution terms as the rest of that program.
dnl Subroutines of libtool.m4,
dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
dnl with libtool.m4.
dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
AC_DEFUN([AC_LIB_PROG_LD_GNU],
[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
acl_cv_prog_gnu_ld=yes
else
acl_cv_prog_gnu_ld=no
fi])
with_gnu_ld=$acl_cv_prog_gnu_ld
])
dnl From libtool-1.4. Sets the variable LD.
AC_DEFUN([AC_LIB_PROG_LD],
[AC_ARG_WITH(gnu-ld,
[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
# Prepare PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
echo "#! /bin/sh" >conf$$.sh
echo "exit 0" >>conf$$.sh
chmod +x conf$$.sh
if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
PATH_SEPARATOR=';'
else
PATH_SEPARATOR=:
fi
rm -f conf$$.sh
fi
ac_prog=ld
if test "$GCC" = yes; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by GCC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
esac
case $ac_prog in
# Accept absolute paths.
[[\\/]* | [A-Za-z]:[\\/]*)]
[re_direlt='/[^/][^/]*/\.\./']
# Canonicalize the path of ld
ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
"")
# If it fails, then pretend we aren't using GCC.
ac_prog=ld
;;
*)
# If it is relative, then search for the first ld in PATH.
with_gnu_ld=unknown
;;
esac
elif test "$with_gnu_ld" = yes; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
fi
AC_CACHE_VAL(acl_cv_path_LD,
[if test -z "$LD"; then
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
for ac_dir in $PATH; do
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
acl_cv_path_LD="$ac_dir/$ac_prog"
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some GNU ld's only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
test "$with_gnu_ld" != no && break
else
test "$with_gnu_ld" != yes && break
fi
fi
done
IFS="$ac_save_ifs"
else
acl_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
LD="$acl_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
AC_MSG_RESULT(no)
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_LIB_PROG_LD_GNU
])
# Do all the work for Automake. This macro actually does too much --
# some checks are only needed if your package does certain things.
# But this isn't really a big deal.

@ -85,6 +85,9 @@
/* SSL (crypto) */
#undef OPENSSL
/* TLS (crypto) */
#undef GNUTLS
/* Port name for HTTP. Unused. */
#undef HTTP_TCP_PORT

293
SRC/configure vendored

@ -20,6 +20,8 @@ ac_help="$ac_help
ac_help="$ac_help
--with-ssl[=DIR] SSL crypt support (needs OpenSSL)"
ac_help="$ac_help
--with-gnutls[=DIR] SSL/TLS crypt support (needs GNU TLS), the argument DIR should not be necessary"
ac_help="$ac_help
--enable-ttcp T/TCP (Transaction TCP) support"
ac_help="$ac_help
--enable-tos TOS (Type Of Service) support"
@ -561,7 +563,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
fi
echo $ac_n "checking host system type""... $ac_c" 1>&6
echo "configure:565: checking host system type" >&5
echo "configure:567: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@ -593,7 +595,7 @@ echo "$ac_t""$host" 1>&6
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:597: checking for a BSD compatible install" >&5
echo "configure:599: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -646,7 +648,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
echo "configure:650: checking whether build environment is sane" >&5
echo "configure:652: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@ -703,7 +705,7 @@ test "$program_suffix" != NONE &&
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
echo "configure:707: checking whether ${MAKE-make} sets \${MAKE}" >&5
echo "configure:709: checking whether ${MAKE-make} sets \${MAKE}" >&5
set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -732,7 +734,7 @@ fi
PACKAGE=echoping
VERSION=5.0.1
VERSION=5.1-BETA
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
{ echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
@ -749,7 +751,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
echo "configure:753: checking for working aclocal" >&5
echo "configure:755: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@ -762,7 +764,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
echo "configure:766: checking for working autoconf" >&5
echo "configure:768: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@ -775,7 +777,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
echo "configure:779: checking for working automake" >&5
echo "configure:781: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@ -788,7 +790,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
echo "configure:792: checking for working autoheader" >&5
echo "configure:794: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@ -801,7 +803,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
echo "configure:805: checking for working makeinfo" >&5
echo "configure:807: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@ -883,12 +885,31 @@ EOF
fi
fi
# Check whether --with-gnutls or --without-gnutls was given.
if test "${with_gnutls+set}" = set; then
withval="$with_gnutls"
if test "$withval" != "no"; then
cat >> confdefs.h <<\EOF
#define GNUTLS 1
EOF
GNUTLS=1
CPPFLAGS="${CPPFLAGS} `libgnutls-config --cflags`"
LDFLAGS="${LDFLAGS} `libgnutls-config --libs`"
if test "$withval" != "yes"; then
GNUTLSROOT=$withval
LDFLAGS="${LDFLAGS} -L$GNUTLSROOT/lib"
CPPFLAGS="${CPPFLAGS} -I$GNUTLSROOT/include"
fi
fi
fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:892: checking for $ac_word" >&5
echo "configure:913: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -918,7 +939,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:922: checking for $ac_word" >&5
echo "configure:943: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -969,7 +990,7 @@ fi
# Extract the first word of "cl", so it can be a program name with args.
set dummy cl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
echo "configure:973: checking for $ac_word" >&5
echo "configure:994: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1001,7 +1022,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
echo "configure:1005: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
echo "configure:1026: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@ -1012,12 +1033,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
#line 1016 "configure"
#line 1037 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
if { (eval echo configure:1021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@ -1043,12 +1064,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
echo "configure:1047: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "configure:1068: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
echo "configure:1052: checking whether we are using GNU C" >&5
echo "configure:1073: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1057,7 +1078,7 @@ else
yes;
#endif
EOF
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1061: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1082: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@ -1076,7 +1097,7 @@ ac_test_CFLAGS="${CFLAGS+set}"
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
echo "configure:1080: checking whether ${CC-cc} accepts -g" >&5
echo "configure:1101: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@ -1119,7 +1140,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
echo "configure:1123: checking for a BSD compatible install" >&5
echo "configure:1144: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1174,7 +1195,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
echo "configure:1178: checking how to run the C preprocessor" >&5
echo "configure:1199: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@ -1189,13 +1210,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
#line 1193 "configure"
#line 1214 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1199: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1206,13 +1227,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
#line 1210 "configure"
#line 1231 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1216: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1223,13 +1244,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
#line 1227 "configure"
#line 1248 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1233: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@ -1254,12 +1275,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
echo "configure:1258: checking for ANSI C header files" >&5
echo "configure:1279: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1263 "configure"
#line 1284 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@ -1267,7 +1288,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1271: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1284,7 +1305,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1288 "configure"
#line 1309 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@ -1302,7 +1323,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
#line 1306 "configure"
#line 1327 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@ -1323,7 +1344,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
#line 1327 "configure"
#line 1348 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@ -1334,7 +1355,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
if { (eval echo configure:1338: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@ -1361,17 +1382,17 @@ for ac_hdr in sys/time.h unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:1365: checking for $ac_hdr" >&5
echo "configure:1386: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1370 "configure"
#line 1391 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:1375: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:1396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@ -1402,13 +1423,13 @@ for cf_name in sys_nerr sys_errlist
do
echo $ac_n "checking if external $cf_name is declared""... $ac_c" 1>&6
echo "configure:1406: checking if external $cf_name is declared" >&5
echo "configure:1427: checking if external $cf_name is declared" >&5
if eval "test \"`echo '$''{'cf_cv_dcl_$cf_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1412 "configure"
#line 1433 "configure"
#include "confdefs.h"
#ifdef HAVE_STDLIB_H
@ -1421,7 +1442,7 @@ int main() {
long x = (long) $cf_name
; return 0; }
EOF
if { (eval echo configure:1425: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval 'cf_cv_dcl_'$cf_name'=yes'
else
@ -1451,13 +1472,13 @@ fi
# It's possible (for near-UNIX clones) that the data doesn't exist
echo $ac_n "checking if external $cf_name exists""... $ac_c" 1>&6
echo "configure:1455: checking if external $cf_name exists" >&5
echo "configure:1476: checking if external $cf_name exists" >&5
if eval "test \"`echo '$''{'cf_cv_have_$cf_name'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1461 "configure"
#line 1482 "configure"
#include "confdefs.h"
#undef $cf_name
@ -1467,7 +1488,7 @@ int main() {
$cf_name = 2
; return 0; }
EOF
if { (eval echo configure:1471: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1492: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval 'cf_cv_have_'$cf_name'=yes'
else
@ -1508,12 +1529,12 @@ osf*)
esac
echo $ac_n "checking for working const""... $ac_c" 1>&6
echo "configure:1512: checking for working const" >&5
echo "configure:1533: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1517 "configure"
#line 1538 "configure"
#include "confdefs.h"
int main() {
@ -1562,7 +1583,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
if { (eval echo configure:1566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1587: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@ -1583,12 +1604,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
echo "configure:1587: checking whether time.h and sys/time.h may both be included" >&5
echo "configure:1608: checking whether time.h and sys/time.h may both be included" >&5
if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1592 "configure"
#line 1613 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@ -1597,7 +1618,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
if { (eval echo configure:1601: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1622: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@ -1620,7 +1641,7 @@ fi
echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
echo "configure:1624: checking for socket in -lsocket" >&5
echo "configure:1645: checking for socket in -lsocket" >&5
ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1628,7 +1649,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1632 "configure"
#line 1653 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1639,7 +1660,7 @@ int main() {
socket()
; return 0; }
EOF
if { (eval echo configure:1643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1656,9 +1677,9 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking if libsocket is mandatory""... $ac_c" 1>&6
echo "configure:1660: checking if libsocket is mandatory" >&5
echo "configure:1681: checking if libsocket is mandatory" >&5
cat > conftest.$ac_ext <<EOF
#line 1662 "configure"
#line 1683 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <netinet/in.h>
@ -1674,7 +1695,7 @@ int main() {
socket (AF_INET, SOCK_STREAM, 0)
; return 0; }
EOF
if { (eval echo configure:1678: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""no" 1>&6
else
@ -1692,7 +1713,7 @@ fi
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
echo "configure:1696: checking for gethostbyname in -lnsl" >&5
echo "configure:1717: checking for gethostbyname in -lnsl" >&5
ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1700,7 +1721,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1704 "configure"
#line 1725 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1711,7 +1732,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
if { (eval echo configure:1715: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1736: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1728,9 +1749,9 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking if libnsl is mandatory""... $ac_c" 1>&6
echo "configure:1732: checking if libnsl is mandatory" >&5
echo "configure:1753: checking if libnsl is mandatory" >&5
cat > conftest.$ac_ext <<EOF
#line 1734 "configure"
#line 1755 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <netinet/in.h>
@ -1739,7 +1760,7 @@ int main() {
gethostbyname(domain)
; return 0; }
EOF
if { (eval echo configure:1743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1764: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""no" 1>&6
else
@ -1757,7 +1778,7 @@ fi
echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6
echo "configure:1761: checking for pow in -lm" >&5
echo "configure:1782: checking for pow in -lm" >&5
ac_lib_var=`echo m'_'pow | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -1765,7 +1786,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
#line 1769 "configure"
#line 1790 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -1776,7 +1797,7 @@ int main() {
pow()
; return 0; }
EOF
if { (eval echo configure:1780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1801: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -1793,9 +1814,9 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking if libmath is mandatory""... $ac_c" 1>&6
echo "configure:1797: checking if libmath is mandatory" >&5
echo "configure:1818: checking if libmath is mandatory" >&5
cat > conftest.$ac_ext <<EOF
#line 1799 "configure"
#line 1820 "configure"
#include "confdefs.h"
#include <math.h>
double a,b;
@ -1803,7 +1824,7 @@ int main() {
pow(a,b)
; return 0; }
EOF
if { (eval echo configure:1807: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1828: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""no" 1>&6
else
@ -1820,12 +1841,12 @@ fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
echo "configure:1824: checking return type of signal handlers" >&5
echo "configure:1845: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1829 "configure"
#line 1850 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@ -1842,7 +1863,7 @@ int main() {
int i;
; return 0; }
EOF
if { (eval echo configure:1846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:1867: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@ -1861,12 +1882,12 @@ EOF
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
echo "configure:1865: checking for vprintf" >&5
echo "configure:1886: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1870 "configure"
#line 1891 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@ -1889,7 +1910,7 @@ vprintf();
; return 0; }
EOF
if { (eval echo configure:1893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@ -1913,12 +1934,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
echo "configure:1917: checking for _doprnt" >&5
echo "configure:1938: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1922 "configure"
#line 1943 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@ -1941,7 +1962,7 @@ _doprnt();
; return 0; }
EOF
if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:1966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@ -1968,12 +1989,12 @@ fi
for ac_func in getaddrinfo getnameinfo inet_ntop
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:1972: checking for $ac_func" >&5
echo "configure:1993: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 1977 "configure"
#line 1998 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -1996,7 +2017,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2021: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -2018,9 +2039,9 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking $ac_func again by including <netdb.h>""... $ac_c" 1>&6
echo "configure:2022: checking $ac_func again by including <netdb.h>" >&5
echo "configure:2043: checking $ac_func again by including <netdb.h>" >&5
cat > conftest.$ac_ext <<EOF
#line 2024 "configure"
#line 2045 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -2029,7 +2050,7 @@ int main() {
$ac_func(NULL, NULL, NULL, NULL);
; return 0; }
EOF
if { (eval echo configure:2033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "$ac_t""yes" 1>&6
else
@ -2047,12 +2068,12 @@ done
for ac_func in gettimeofday socket sigaction
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2051: checking for $ac_func" >&5
echo "configure:2072: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2056 "configure"
#line 2077 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -2075,7 +2096,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:2079: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -2103,12 +2124,12 @@ done
for ac_func in usleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
echo "configure:2107: checking for $ac_func" >&5
echo "configure:2128: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 2112 "configure"
#line 2133 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@ -2131,7 +2152,7 @@ $ac_func();
; return 0; }
EOF
if { (eval echo configure:2135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2156: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@ -2156,10 +2177,13 @@ fi
done
if test "$OPENSSL" = "1" && test "$GNUTLS" = "1"; then
{ echo "configure: error: Choose OpenSSL or GNU TLS but not both" 1>&2; exit 1; }
fi
if test "$OPENSSL" = "1"; then
echo $ac_n "checking for SSL_CTX_new in -lssl""... $ac_c" 1>&6
echo "configure:2163: checking for SSL_CTX_new in -lssl" >&5
echo "configure:2187: checking for SSL_CTX_new in -lssl" >&5
ac_lib_var=`echo ssl'_'SSL_CTX_new | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@ -2168,7 +2192,7 @@ else
LIBS="-lssl -lcrypto
$LIBS"
cat > conftest.$ac_ext <<EOF
#line 2172 "configure"
#line 2196 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@ -2179,7 +2203,7 @@ int main() {
SSL_CTX_new()
; return 0; }
EOF
if { (eval echo configure:2183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
if { (eval echo configure:2207: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@ -2200,12 +2224,56 @@ else
{ echo "configure: error: Get the OpenSSL library (http://www.openssl.org/)" 1>&2; exit 1; }
fi
fi
if test "$GNUTLS" = "1"; then
echo $ac_n "checking for gnutls_global_init in -lgnutls""... $ac_c" 1>&6
echo "configure:2232: checking for gnutls_global_init in -lgnutls" >&5
ac_lib_var=`echo gnutls'_'gnutls_global_init | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_save_LIBS="$LIBS"
LIBS="-lgnutls $LIBS"
cat > conftest.$ac_ext <<EOF
#line 2240 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gnutls_global_init();
int main() {
gnutls_global_init()
; return 0; }
EOF
if { (eval echo configure:2251: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
LIBS="${LIBS} `libgnutls-config --libs`"
else
echo "$ac_t""no" 1>&6
{ echo "configure: error: Get the GNU TLS library (http://www.gnutls.org/)" 1>&2; exit 1; }
fi
fi
echo $ac_n "checking T/TCP""... $ac_c" 1>&6
echo "configure:2207: checking T/TCP" >&5
echo "configure:2275: checking T/TCP" >&5
cat > conftest.$ac_ext <<EOF
#line 2209 "configure"
#line 2277 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -2214,7 +2282,7 @@ int main() {
int foobar = MSG_EOF;
; return 0; }
EOF
if { (eval echo configure:2218: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2286: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define TTCP 1
@ -2255,9 +2323,9 @@ fi
echo $ac_n "checking Type Of Service""... $ac_c" 1>&6
echo "configure:2259: checking Type Of Service" >&5
echo "configure:2327: checking Type Of Service" >&5
cat > conftest.$ac_ext <<EOF
#line 2261 "configure"
#line 2329 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <netinet/in.h>
@ -2266,7 +2334,7 @@ int main() {
int foobar = IP_TOS;
; return 0; }
EOF
if { (eval echo configure:2270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2338: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_TOS 1
@ -2307,9 +2375,9 @@ fi
echo $ac_n "checking Socket priority""... $ac_c" 1>&6
echo "configure:2311: checking Socket priority" >&5
echo "configure:2379: checking Socket priority" >&5
cat > conftest.$ac_ext <<EOF
#line 2313 "configure"
#line 2381 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
@ -2318,7 +2386,7 @@ int main() {
int foobar = SO_PRIORITY;
; return 0; }
EOF
if { (eval echo configure:2322: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if { (eval echo configure:2390: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKET_PRIORITY 1
@ -2740,7 +2808,7 @@ echo "Configuration of echoping:"
echo $ac_n "checking HTTP""... $ac_c" 1>&6
echo "configure:2744: checking HTTP" >&5
echo "configure:2812: checking HTTP" >&5
if eval 'test "$HTTP" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2749,7 +2817,7 @@ fi
echo $ac_n "checking ICP""... $ac_c" 1>&6
echo "configure:2753: checking ICP" >&5
echo "configure:2821: checking ICP" >&5
if eval 'test "$ICP" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2758,7 +2826,7 @@ fi
echo $ac_n "checking OPENSSL""... $ac_c" 1>&6
echo "configure:2762: checking OPENSSL" >&5
echo "configure:2830: checking OPENSSL" >&5
if eval 'test "$OPENSSL" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2766,8 +2834,17 @@ else
fi
echo $ac_n "checking GNUTLS""... $ac_c" 1>&6
echo "configure:2839: checking GNUTLS" >&5
if eval 'test "$GNUTLS" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
echo "$ac_t""disabled" 1>&6
fi
echo $ac_n "checking SMTP""... $ac_c" 1>&6
echo "configure:2771: checking SMTP" >&5
echo "configure:2848: checking SMTP" >&5
if eval 'test "$SMTP" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2776,7 +2853,7 @@ fi
echo $ac_n "checking TTCP""... $ac_c" 1>&6
echo "configure:2780: checking TTCP" >&5
echo "configure:2857: checking TTCP" >&5
if eval 'test "$TTCP" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2785,7 +2862,7 @@ fi
echo $ac_n "checking TOS""... $ac_c" 1>&6
echo "configure:2789: checking TOS" >&5
echo "configure:2866: checking TOS" >&5
if eval 'test "$TOS" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else
@ -2794,7 +2871,7 @@ fi
echo $ac_n "checking PRIORITY""... $ac_c" 1>&6
echo "configure:2798: checking PRIORITY" >&5
echo "configure:2875: checking PRIORITY" >&5
if eval 'test "$PRIORITY" = "1"' > /dev/null; then
echo "$ac_t""enabled" 1>&6
else

@ -3,7 +3,7 @@ dnl $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(echoping.h)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE(echoping, 5.0.2-BETA)
AM_INIT_AUTOMAKE(echoping, 5.1-BETA)
AM_CONFIG_HEADER(config.h)
dnl User options
@ -44,6 +44,21 @@ AC_ARG_WITH(ssl,
fi],
dnl Default: disable it
)
AC_ARG_WITH(gnutls,
[--with-gnutls[=DIR] SSL/TLS crypt support (needs GNU TLS), the argument DIR should not be necessary],dnl
[if test "$withval" != "no"; then
AC_DEFINE(GNUTLS)
GNUTLS=1
CPPFLAGS="${CPPFLAGS} `libgnutls-config --cflags`"
LDFLAGS="${LDFLAGS} `libgnutls-config --libs`"
if test "$withval" != "yes"; then
GNUTLSROOT=$withval
LDFLAGS="${LDFLAGS} -L$GNUTLSROOT/lib"
CPPFLAGS="${CPPFLAGS} -I$GNUTLSROOT/include"
fi
fi],
dnl Default: disable it
)
dnl See T/TCP later
@ -92,9 +107,15 @@ AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_ntop, ,
AC_CHECK_FUNCS(gettimeofday socket sigaction, , AC_MSG_ERROR(Missing mandatory function))
AC_CHECK_FUNCS(usleep)
if test "$OPENSSL" = "1" && test "$GNUTLS" = "1"; then
AC_MSG_ERROR([Choose OpenSSL or GNU TLS but not both])
fi
if test "$OPENSSL" = "1"; then
CF_LIB_OPENSSL
fi
if test "$GNUTLS" = "1"; then
CF_LIB_GNUTLS
fi
dnl T/TCP
AC_MSG_CHECKING([T/TCP])
@ -199,6 +220,7 @@ echo "Configuration of echoping:"
DISPLAY_SETTING(HTTP)
DISPLAY_SETTING(ICP)
DISPLAY_SETTING(OPENSSL)
DISPLAY_SETTING(GNUTLS)
DISPLAY_SETTING(SMTP)
DISPLAY_SETTING(TTCP)
DISPLAY_SETTING(TOS)

@ -119,6 +119,14 @@ main (argc, argv)
SSL_CTX *ctx = NULL;
SSL *sslh = NULL;
#endif
#ifdef GNUTLS
gnutls_session session;
gnutls_certificate_credentials xcred;
int tls_result;
const int cert_type_priority[3] = { GNUTLS_CRT_X509,
GNUTLS_CRT_OPENPGP, 0
};
#endif
int priority;
int priority_requested = 0;
@ -328,11 +336,11 @@ main (argc, argv)
exit (1);
}
#endif
#ifndef OPENSSL
#if ! (OPENSSL || GNUTLS)
if (ssl)
{
(void) fprintf (stderr,
"%s: not compiled with SSL support.\n", progname);
"%s: not compiled with SSL/TLS support.\n", progname);
exit (1);
}
#endif
@ -596,6 +604,14 @@ main (argc, argv)
err_sys ("Cannot create a new SSL context");
}
#endif
#ifdef GNUTLS
if (ssl)
{
gnutls_global_init ();
gnutls_certificate_allocate_credentials (&xcred);
/* gnutls_certificate_set_x509_trust_file(xcred, CAFILE, GNUTLS_X509_FMT_PEM); */
}
#endif
for (i = 1; i <= number; i++)
{
@ -791,6 +807,40 @@ main (argc, argv)
/* We could check the server's certificate or other funny
things */
}
#endif
#ifdef GNUTLS
if (ssl)
{
tls_result = gnutls_init (&session, GNUTLS_CLIENT);
if (tls_result != 0)
err_sys ("Cannot create a new TLS session");
gnutls_set_default_priority (session);
gnutls_certificate_type_set_priority (session,
cert_type_priority);
gnutls_credentials_set (session, GNUTLS_CRD_CERTIFICATE, xcred);
gnutls_transport_set_ptr (session,
(gnutls_transport_ptr) sockfd);
tls_result = gnutls_handshake (session);
if (tls_result < 0)
{
if ((errno == EINTR) && (timeout_flag))
{
printf ("Timeout while starting TLS\n");
close (sockfd);
continue;
}
else
{
err_sys ("Cannot start the TLS session: %s",
gnutls_strerror (tls_result));
}
}
if (verbose)
printf ("TLS connection using \"%s\"\n",
gnutls_cipher_get_name (gnutls_cipher_get (session)));
/* We could check the server's certificate or other funny
things. See http://www.gnu.org/software/gnutls/documentation/gnutls/gnutls.html#SECTION00622000000000000000 */
}
#endif
}
/* Not T/TCP */
@ -854,6 +904,29 @@ main (argc, argv)
}
/* printf ("DEBUG: writing %s with SSL\n", sendline); */
}
#endif
#ifdef GNUTLS
else
{
if ((rc =
gnutls_record_send (session, sendline,
strlen (sendline))) != n)
{
if ((nr < 0 || nr != n) && timeout_flag)
{
nr = n;
printf ("Timeout while writing\n");
close (sockfd);
continue;
}
else
{
err_sys ("gnutls_record_send error %d on socket: %s",
rc, gnutls_strerror (rc));
}
}
/* printf ("DEBUG: writing %s with TLS\n", sendline); */
}
#endif
/* Write something to the server */
if (writen (sockfd, sendline, n) != n)
@ -922,7 +995,12 @@ main (argc, argv)
n = SSL_get_fd (sslh);
}
#endif
#ifdef GNUTLS
else
{
n = sockfd;
}
#endif
FD_SET (n, &mask);
if (select (n + 1, &mask, 0, 0, NULL) > 0)
{
@ -959,6 +1037,10 @@ main (argc, argv)
#ifdef OPENSSL
else
channel.ssl = sslh;
#endif
#ifdef GNUTLS
else
channel.tls = session;
#endif
nr = read_from_server (channel, ssl);
}
@ -970,7 +1052,6 @@ main (argc, argv)
}
#endif
}
else
{
@ -1082,6 +1163,13 @@ main (argc, argv)
if (ssl)
SSL_shutdown (channel.ssl);
else
#endif
#ifdef GNUTLS
if (ssl)
{
gnutls_global_deinit ();
}
else
#endif
fclose (channel.fs);
}
@ -1154,6 +1242,14 @@ main (argc, argv)
/* SSL_clear (sslh); No, we have to free. Bug #130151 */
SSL_free (sslh);
}
#endif
#ifdef GNUTLS
if (ssl)
{
gnutls_bye (channel.tls, GNUTLS_SHUT_RDWR);
gnutls_deinit (session);
/* gnutls_certificate_free_credentials(xcred); */
}
#endif
}
}

@ -45,6 +45,10 @@
#include <openssl/rand.h>
#endif /* OpenSSL */
#ifdef GNUTLS
#include <gnutls/gnutls.h>
#endif
#ifndef FALSE
#define FALSE 0
#endif
@ -98,6 +102,9 @@ typedef union _CHANNEL
#ifdef OPENSSL
SSL *ssl;
#endif
#ifdef GNUTLS
gnutls_session tls;
#endif
}
CHANNEL;
@ -149,6 +156,9 @@ int readline ();
#ifdef OPENSSL
int SSL_readline ();
#endif
#ifdef GNUTLS
int TLS_readline ();
#endif
/* util.c */
char *random_string ();
void tvsub ();

@ -2,15 +2,17 @@
Summary: Program to test network services
Name: echoping
Version: 4.1.0
Version: 5.0.1
Release: 1
Copyright: GNU
Group: Utilities/Network
Source0: echoping-4.1.0.tar.gz
Packager: Stephane Bortzmeyer <bortz@users.sourceforge.net>
Source0: echoping-5.0.1.tar.gz
Url: http://echoping.sourceforge.net
BuildRoot: /var/tmp/echoping
Requires: openssl
BuildRequires: openssl-devel openssl
Prefix: /usr/local
# Requires: openssl
# BuildRequires: openssl-devel openssl
%description
@ -23,10 +25,10 @@ HTTP) packets.
%prep
%setup -q -n echoping-4.1.0
%setup -q -n echoping-5.0.1
%build
../configure --prefix=/usr/ --enable-http --enable-icp --enable-smtp --enable-ttcp --with-ssl
./configure --prefix=$RPM_BUILD_ROOT/usr/local --enable-http --enable-icp --enable-smtp --enable-ttcp
make
@ -34,14 +36,13 @@ make
rm -rf $RPM_BUILD_ROOT
%install
../configure --prefix=$RPM_BUILD_ROOT/usr/ --with-ssl --enable-http --enable-icp --enable-smtp --enable-ttcp
make install
make install
%files
/
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog DETAILS INSTALL NEWS README TODO
%doc AUTHORS COPYING ChangeLog DETAILS NEWS README TODO
%doc test-echoping-crypto test-echoping-icp test-echoping-local test-echoping-remote
%changelog

@ -76,7 +76,17 @@ read_from_server (CHANNEL fs, short ssl)
}
}
#endif
/* printf ("DEBUG: reading \"%s\"\n (%d chars)\n", big_recvline, nr); */
#ifdef GNUTLS
else
{
nr = TLS_readline (fs.tls, big_recvline, MAXTOREAD, TRUE);
if (nr == -1)
{
err_ret ("TLS_readline error: %s", gnutls_strerror (nr));
}
}
#endif
/* printf ("DEBUG: reading \"%s\"\n (%d chars)\n", big_recvline, nr); */
/* HTTP replies should be separated by CR-LF. Unfortunately, some
servers send only CR :-( */
body = ((nr == 2) || (nr == 1)); /* Empty line CR-LF seen */
@ -104,6 +114,10 @@ read_from_server (CHANNEL fs, short ssl)
#ifdef OPENSSL
else
nr = SSL_readline (fs.ssl, big_recvline, MAXTOREAD, FALSE);
#endif
#ifdef GNUTLS
else
nr = TLS_readline (fs.tls, big_recvline, MAXTOREAD, FALSE);
#endif
/* printf ("DEBUG: reading body \"%s\"\n (%d chars)\n", big_recvline, nr); */
if ((nr < 2) && (errno == EINTR)) /* Probably a timeout */

@ -73,7 +73,7 @@ SSL_readline (sslh, ptr, maxlen, ln)
if (buf_end == 0)
{
rc = SSL_read (sslh, SSL_buffer, maxlen);
if (rc == -1)
if (rc == -1)
return rc;
buf_end = rc;
buf_ptr = 0;
@ -83,22 +83,22 @@ SSL_readline (sslh, ptr, maxlen, ln)
{
buf_ptr = 0;
rc = SSL_read (sslh, SSL_buffer, maxlen);
if (rc == -1)
if (rc == -1)
return rc;
buf_end = rc;
}
else if (SSL_buffer[buf_end] != '\n') {
/* We have a probleme here is the first SSL_read sent back
a text not finished by a \n. See www.SSL.de for an
example. We get more data. See bug #230384 */
rc = SSL_read (sslh, SSL_buffer+buf_end, maxlen);
if (rc == -1)
else if (SSL_buffer[buf_end] != '\n')
{
/* We have a probleme here is the first SSL_read sent back
a text not finished by a \n. See www.SSL.de for an
example. We get more data. See bug #230384 */
rc = SSL_read (sslh, SSL_buffer + buf_end, maxlen);
if (rc == -1)
return rc;
buf_end = buf_end + rc;
}
for (oi = buf_ptr, i = buf_ptr;
i <= buf_end && SSL_buffer[i] != '\n';
i++)
}
for (oi = buf_ptr, i = buf_ptr;
i <= buf_end && SSL_buffer[i] != '\n'; i++)
{
*ptr++ = SSL_buffer[i];
buf_ptr++;
@ -107,31 +107,117 @@ SSL_readline (sslh, ptr, maxlen, ln)
buf_ptr++;
*ptr = '\0';
/* if (ln)
printf ("SSL_redaline returns %d (%s)\n", i - oi, SSL_buffer); */
printf ("SSL_readline returns %d (%s)\n", i - oi, SSL_buffer); */
return (i - oi);
}
else
{
/* OpenSSL reads at most 4096 characters */
rc = 1; /* Just to avoid exiting too soon */
while (n < maxlen && rc != 0) {
if ((buf_end == 0) || (buf_ptr > buf_end))
{
rc = SSL_read (sslh, ptr, maxlen);
buf_end = 0;
buf_ptr = 0;
}
else
{
for (i = buf_ptr; i < maxlen && i <= buf_end; i++)
{
*ptr++ = SSL_buffer[i];
rc++;
}
buf_ptr = i;
}
n = n + rc;
}
rc = 1; /* Just to avoid exiting too soon */
while (n < maxlen && rc != 0)
{
if ((buf_end == 0) || (buf_ptr > buf_end))
{
rc = SSL_read (sslh, ptr, maxlen);
buf_end = 0;
buf_ptr = 0;
}
else
{
for (i = buf_ptr; i < maxlen && i <= buf_end; i++)
{
*ptr++ = SSL_buffer[i];
rc++;
}
buf_ptr = i;
}
n = n + rc;
}
return n;
}
}
#endif
#ifdef GNUTLS
char TLS_buffer[MAXTOREAD];
int buf_ptr;
int buf_end;
int
TLS_readline (session, ptr, maxlen, ln)
gnutls_session session;
char *ptr;
int maxlen;
unsigned short ln;
{
int rc = 0;
int n = 0;
int i, oi;
if (ln)
{
/* Empty buffer */
if (buf_end == 0)
{
rc = gnutls_record_recv (session, TLS_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
buf_ptr = 0;
}
/* No more data in the buffer */
else if (buf_ptr == buf_end)
{
buf_ptr = 0;
rc = gnutls_record_recv (session, TLS_buffer, maxlen);
if (rc == -1)
return rc;
buf_end = rc;
}
else if (TLS_buffer[buf_end] != '\n')
{
rc = gnutls_record_recv (session, TLS_buffer + buf_end, maxlen);
if (rc == -1)
return rc;
buf_end = buf_end + rc;
}
for (oi = buf_ptr, i = buf_ptr;
i <= buf_end && TLS_buffer[i] != '\n'; i++)
{
*ptr++ = TLS_buffer[i];
buf_ptr++;
}
if (TLS_buffer[i] == '\n')
buf_ptr++;
*ptr = '\0';
/* printf ("DEBUG: TLS_readline returns %d (%s)\n", i - oi, TLS_buffer); */
return (i - oi);
}
else
{
rc = 1; /* Just to avoid exiting too soon */
while (n < maxlen && rc > 0)
{
if ((buf_end == 0) || (buf_ptr > buf_end))
{
rc = gnutls_record_recv (session, ptr, maxlen);
buf_end = 0;
buf_ptr = 0;
}
else
{
for (i = buf_ptr; i < maxlen && i <= buf_end; i++)
{
*ptr++ = TLS_buffer[i];
rc++;
/* printf ("DEBUG: Now %d chars read\n", rc); */
}
buf_ptr = i;
}
if (rc > 0)
n = n + rc;
/* printf ("DEBUG: Now %d chars to send\n", n); */
}
return n;
}
}

Loading…
Cancel
Save