diff --git a/SRC/INSTALL b/SRC/INSTALL index 040157c..c216a67 100644 --- a/SRC/INSTALL +++ b/SRC/INSTALL @@ -17,6 +17,7 @@ may not be available on your platform). --disable-http (suppress the HTTP support) --disable-smtp (suppress the SMTP support) --enable-icp (add the ICP support, to monitor Web proxies like Squid) +--enable-idn (add the IDN support, to handle Unicode domaine names, see RFC 3490) --with-gnutls[=/where/is/gnutls] (add the SSL/TLS support, you will need the GNU TLS library ) --with-ssl[=/where/is/ssl] (add the SSL/TLS support, you will need diff --git a/SRC/Makefile.in b/SRC/Makefile.in index 14a80ad..938963b 100644 --- a/SRC/Makefile.in +++ b/SRC/Makefile.in @@ -518,6 +518,9 @@ upload-force: dist rm -f upload.log ncftpput -d upload.log upload.sourceforge.net /incoming $(distdir).tar.gz +realclean: clean + rm -f *~ + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/SRC/acconfig.h b/SRC/acconfig.h index 57bf87d..2f0acc1 100644 --- a/SRC/acconfig.h +++ b/SRC/acconfig.h @@ -24,6 +24,9 @@ /* ICP support */ #undef ICP +/* IDN (Unicode) */ +#undef IDN + /* SSL (crypto) */ #undef OPENSSL diff --git a/SRC/acinclude.m4 b/SRC/acinclude.m4 index 9b74cb2..5cb71af 100644 --- a/SRC/acinclude.m4 +++ b/SRC/acinclude.m4 @@ -175,6 +175,14 @@ AC_CHECK_LIB(gnutls,gnutls_global_init, [AC_ERROR([Get the GNU TLS library (http://www.gnutls.org/)])], dnl )]) +# Check GNU libidn +AC_DEFUN([CF_LIB_GNUIDN], +[ +AC_CHECK_LIB(idn,idna_to_ascii_from_utf8, +[LIBS="${LIBS} `pkg-config libidn --libs-only-L` `pkg-config libidn --libs-only-l`"], +[AC_ERROR([Get the GNU IDN library (http://www.josefsson.org/libidn/)])], dnl +)]) + dnl experimental AC_DEFUN([CF_CHECK_TCP_SERVICE], [ diff --git a/SRC/aclocal.m4 b/SRC/aclocal.m4 index 2d78a54..8c37d07 100644 --- a/SRC/aclocal.m4 +++ b/SRC/aclocal.m4 @@ -187,6 +187,14 @@ AC_CHECK_LIB(gnutls,gnutls_global_init, [AC_ERROR([Get the GNU TLS library (http://www.gnutls.org/)])], dnl )]) +# Check GNU libidn +AC_DEFUN([CF_LIB_GNUIDN], +[ +AC_CHECK_LIB(idn,idna_to_ascii_from_utf8, +[LIBS="${LIBS} `pkg-config libidn --libs-only-L` `pkg-config libidn --libs-only-l`"], +[AC_ERROR([Get the GNU IDN library (http://www.josefsson.org/libidn/)])], dnl +)]) + dnl experimental AC_DEFUN([CF_CHECK_TCP_SERVICE], [ diff --git a/SRC/config.h.in b/SRC/config.h.in index 699ad6c..3ccbdb0 100644 --- a/SRC/config.h.in +++ b/SRC/config.h.in @@ -79,6 +79,9 @@ /* ICP support */ #undef ICP +/* IDN (Unicode) */ +#undef IDN + /* SSL (crypto) */ #undef OPENSSL diff --git a/SRC/configure b/SRC/configure index 243dc18..ad9a436 100755 --- a/SRC/configure +++ b/SRC/configure @@ -18,6 +18,8 @@ ac_help="$ac_help ac_help="$ac_help --enable-smtp SMTP (Mail's main protocol) support" ac_help="$ac_help +--enable-idn IDN (Internationalized Domain Names, host names in Unicode, with GNU libidn) support" +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" @@ -563,7 +565,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:567: checking host system type" >&5 +echo "configure:569: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -595,7 +597,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:599: checking for a BSD compatible install" >&5 +echo "configure:601: 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 @@ -648,7 +650,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:652: checking whether build environment is sane" >&5 +echo "configure:654: checking whether build environment is sane" >&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -705,7 +707,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:709: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:711: 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 @@ -734,7 +736,7 @@ fi PACKAGE=echoping -VERSION=5.1.0 +VERSION=5.2.0-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; } @@ -751,7 +753,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 -echo "configure:755: checking for working aclocal" >&5 +echo "configure:757: 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. @@ -764,7 +766,7 @@ else fi echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 -echo "configure:768: checking for working autoconf" >&5 +echo "configure:770: 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. @@ -777,7 +779,7 @@ else fi echo $ac_n "checking for working automake""... $ac_c" 1>&6 -echo "configure:781: checking for working automake" >&5 +echo "configure:783: 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. @@ -790,7 +792,7 @@ else fi echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 -echo "configure:794: checking for working autoheader" >&5 +echo "configure:796: 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. @@ -803,7 +805,7 @@ else fi echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 -echo "configure:807: checking for working makeinfo" >&5 +echo "configure:809: 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. @@ -868,6 +870,24 @@ EOF SMTP=1 fi +# Check whether --enable-idn or --disable-idn was given. +if test "${enable_idn+set}" = set; then + enableval="$enable_idn" + if test "$enableval" = "yes"; then + cat >> confdefs.h <<\EOF +#define IDN 1 +EOF + + IDN=1 + fi +else + cat >> confdefs.h <<\EOF +#define IDN 1 +EOF + + IDN=1 +fi + # Check whether --with-ssl or --without-ssl was given. if test "${with_ssl+set}" = set; then withval="$with_ssl" @@ -909,7 +929,7 @@ 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:913: checking for $ac_word" >&5 +echo "configure:933: 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 @@ -939,7 +959,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:943: checking for $ac_word" >&5 +echo "configure:963: 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 @@ -990,7 +1010,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:994: checking for $ac_word" >&5 +echo "configure:1014: 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 @@ -1022,7 +1042,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:1026: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:1046: 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. @@ -1033,12 +1053,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 1037 "configure" +#line 1057 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:1042: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1062: \"$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 @@ -1064,12 +1084,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:1068: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:1088: 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:1073: checking whether we are using GNU C" >&5 +echo "configure:1093: 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 @@ -1078,7 +1098,7 @@ else yes; #endif EOF -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 +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1102: \"$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 @@ -1097,7 +1117,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:1101: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:1121: 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 @@ -1140,7 +1160,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:1144: checking for a BSD compatible install" >&5 +echo "configure:1164: 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 @@ -1195,7 +1215,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:1199: checking how to run the C preprocessor" >&5 +echo "configure:1219: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1210,13 +1230,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1220: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1240: \"$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 : @@ -1227,13 +1247,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1257: \"$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 : @@ -1244,13 +1264,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1274: \"$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 : @@ -1275,12 +1295,12 @@ fi echo "$ac_t""$CPP" 1>&6 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:1279: checking for ANSI C header files" >&5 +echo "configure:1299: 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 < #include @@ -1288,7 +1308,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1292: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1312: \"$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* @@ -1305,7 +1325,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 @@ -1323,7 +1343,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 @@ -1344,7 +1364,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -1355,7 +1375,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:1359: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -1382,17 +1402,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:1386: checking for $ac_hdr" >&5 +echo "configure:1406: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1396: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1416: \"$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* @@ -1432,12 +1452,12 @@ osf*) esac echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1436: checking for working const" >&5 +echo "configure:1456: 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 <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1507,12 +1527,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:1511: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:1531: 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 < #include @@ -1521,7 +1541,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:1525: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1545: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -1544,7 +1564,7 @@ fi echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1548: checking for socket in -lsocket" >&5 +echo "configure:1568: 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 @@ -1552,7 +1572,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1587: \"$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 @@ -1580,9 +1600,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:1584: checking if libsocket is mandatory" >&5 +echo "configure:1604: checking if libsocket is mandatory" >&5 cat > conftest.$ac_ext < #include @@ -1598,7 +1618,7 @@ int main() { socket (AF_INET, SOCK_STREAM, 0) ; return 0; } EOF -if { (eval echo configure:1602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1622: \"$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 @@ -1616,7 +1636,7 @@ fi echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1620: checking for gethostbyname in -lnsl" >&5 +echo "configure:1640: 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 @@ -1624,7 +1644,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1659: \"$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 @@ -1652,9 +1672,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:1656: checking if libnsl is mandatory" >&5 +echo "configure:1676: checking if libnsl is mandatory" >&5 cat > conftest.$ac_ext < #include @@ -1663,7 +1683,7 @@ int main() { gethostbyname(domain) ; return 0; } EOF -if { (eval echo configure:1667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1687: \"$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 @@ -1681,7 +1701,7 @@ fi echo $ac_n "checking for pow in -lm""... $ac_c" 1>&6 -echo "configure:1685: checking for pow in -lm" >&5 +echo "configure:1705: 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 @@ -1689,7 +1709,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1724: \"$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 @@ -1717,9 +1737,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:1721: checking if libmath is mandatory" >&5 +echo "configure:1741: checking if libmath is mandatory" >&5 cat > conftest.$ac_ext < double a,b; @@ -1727,7 +1747,7 @@ int main() { pow(a,b) ; return 0; } EOF -if { (eval echo configure:1731: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1751: \"$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 @@ -1744,12 +1764,12 @@ fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:1748: checking return type of signal handlers" >&5 +echo "configure:1768: 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 < #include @@ -1766,7 +1786,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:1770: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -1785,12 +1805,12 @@ EOF echo $ac_n "checking for vprintf""... $ac_c" 1>&6 -echo "configure:1789: checking for vprintf" >&5 +echo "configure:1809: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1837: \"$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 @@ -1837,12 +1857,12 @@ fi if test "$ac_cv_func_vprintf" != yes; then echo $ac_n "checking for _doprnt""... $ac_c" 1>&6 -echo "configure:1841: checking for _doprnt" >&5 +echo "configure:1861: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1889: \"$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 @@ -1892,12 +1912,12 @@ fi for ac_func in getaddrinfo getnameinfo inet_ntop do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1896: checking for $ac_func" >&5 +echo "configure:1916: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1944: \"$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 @@ -1942,9 +1962,9 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking $ac_func again by including ""... $ac_c" 1>&6 -echo "configure:1946: checking $ac_func again by including " >&5 +echo "configure:1966: checking $ac_func again by including " >&5 cat > conftest.$ac_ext < #include @@ -1953,7 +1973,7 @@ int main() { $ac_func(NULL, NULL, NULL, NULL); ; return 0; } EOF -if { (eval echo configure:1957: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1977: \"$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 @@ -1971,12 +1991,12 @@ done for ac_func in gettimeofday socket sigaction strerror do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1975: checking for $ac_func" >&5 +echo "configure:1995: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2023: \"$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 @@ -2027,12 +2047,12 @@ done for ac_func in usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2031: checking for $ac_func" >&5 +echo "configure:2051: 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 <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2079: \"$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 @@ -2080,13 +2100,58 @@ fi done +if test "$IDN" = "1"; then + +echo $ac_n "checking for idna_to_ascii_from_utf8 in -lidn""... $ac_c" 1>&6 +echo "configure:2107: checking for idna_to_ascii_from_utf8 in -lidn" >&5 +ac_lib_var=`echo idn'_'idna_to_ascii_from_utf8 | 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="-lidn $LIBS" +cat > conftest.$ac_ext <&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} `pkg-config libidn --libs-only-L` `pkg-config libidn --libs-only-l`" +else + echo "$ac_t""no" 1>&6 +{ echo "configure: error: Get the GNU IDN library (http://www.josefsson.org/libidn/)" 1>&2; exit 1; } +fi + +fi + 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:2090: checking for SSL_CTX_new in -lssl" >&5 +echo "configure:2155: 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 @@ -2095,7 +2160,7 @@ else LIBS="-lssl -lcrypto $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2175: \"$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 @@ -2131,7 +2196,7 @@ fi if test "$GNUTLS" = "1"; then echo $ac_n "checking for gnutls_global_init in -lgnutls""... $ac_c" 1>&6 -echo "configure:2135: checking for gnutls_global_init in -lgnutls" >&5 +echo "configure:2200: 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 @@ -2139,7 +2204,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnutls $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2219: \"$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 @@ -2174,9 +2239,9 @@ fi fi echo $ac_n "checking T/TCP""... $ac_c" 1>&6 -echo "configure:2178: checking T/TCP" >&5 +echo "configure:2243: checking T/TCP" >&5 cat > conftest.$ac_ext < #include @@ -2185,7 +2250,7 @@ int main() { int foobar = MSG_EOF; ; return 0; } EOF -if { (eval echo configure:2189: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2254: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define TTCP 1 @@ -2226,9 +2291,9 @@ fi echo $ac_n "checking Type Of Service""... $ac_c" 1>&6 -echo "configure:2230: checking Type Of Service" >&5 +echo "configure:2295: checking Type Of Service" >&5 cat > conftest.$ac_ext < #include @@ -2237,7 +2302,7 @@ int main() { int foobar = IP_TOS; ; return 0; } EOF -if { (eval echo configure:2241: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_TOS 1 @@ -2278,9 +2343,9 @@ fi echo $ac_n "checking Socket priority""... $ac_c" 1>&6 -echo "configure:2282: checking Socket priority" >&5 +echo "configure:2347: checking Socket priority" >&5 cat > conftest.$ac_ext < #include @@ -2289,7 +2354,7 @@ int main() { int foobar = SO_PRIORITY; ; return 0; } EOF -if { (eval echo configure:2293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2358: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SOCKET_PRIORITY 1 @@ -2711,7 +2776,7 @@ echo "Configuration of echoping:" echo $ac_n "checking HTTP""... $ac_c" 1>&6 -echo "configure:2715: checking HTTP" >&5 +echo "configure:2780: checking HTTP" >&5 if eval 'test "$HTTP" = "1"' > /dev/null; then echo "$ac_t""enabled" 1>&6 else @@ -2720,7 +2785,7 @@ fi echo $ac_n "checking ICP""... $ac_c" 1>&6 -echo "configure:2724: checking ICP" >&5 +echo "configure:2789: checking ICP" >&5 if eval 'test "$ICP" = "1"' > /dev/null; then echo "$ac_t""enabled" 1>&6 else @@ -2729,7 +2794,7 @@ fi echo $ac_n "checking OPENSSL""... $ac_c" 1>&6 -echo "configure:2733: checking OPENSSL" >&5 +echo "configure:2798: checking OPENSSL" >&5 if eval 'test "$OPENSSL" = "1"' > /dev/null; then echo "$ac_t""enabled" 1>&6 else @@ -2738,7 +2803,7 @@ fi echo $ac_n "checking GNUTLS""... $ac_c" 1>&6 -echo "configure:2742: checking GNUTLS" >&5 +echo "configure:2807: checking GNUTLS" >&5 if eval 'test "$GNUTLS" = "1"' > /dev/null; then echo "$ac_t""enabled" 1>&6 else @@ -2747,7 +2812,7 @@ fi echo $ac_n "checking SMTP""... $ac_c" 1>&6 -echo "configure:2751: checking SMTP" >&5 +echo "configure:2816: checking SMTP" >&5 if eval 'test "$SMTP" = "1"' > /dev/null; then echo "$ac_t""enabled" 1>&6 else @@ -2755,8 +2820,17 @@ else fi +echo $ac_n "checking IDN""... $ac_c" 1>&6 +echo "configure:2825: checking IDN" >&5 +if eval 'test "$IDN" = "1"' > /dev/null; then + echo "$ac_t""enabled" 1>&6 +else + echo "$ac_t""disabled" 1>&6 +fi + + echo $ac_n "checking TTCP""... $ac_c" 1>&6 -echo "configure:2760: checking TTCP" >&5 +echo "configure:2834: checking TTCP" >&5 if eval 'test "$TTCP" = "1"' > /dev/null; then echo "$ac_t""enabled" 1>&6 else @@ -2765,7 +2839,7 @@ fi echo $ac_n "checking TOS""... $ac_c" 1>&6 -echo "configure:2769: checking TOS" >&5 +echo "configure:2843: checking TOS" >&5 if eval 'test "$TOS" = "1"' > /dev/null; then echo "$ac_t""enabled" 1>&6 else @@ -2774,7 +2848,7 @@ fi echo $ac_n "checking PRIORITY""... $ac_c" 1>&6 -echo "configure:2778: checking PRIORITY" >&5 +echo "configure:2852: checking PRIORITY" >&5 if eval 'test "$PRIORITY" = "1"' > /dev/null; then echo "$ac_t""enabled" 1>&6 else diff --git a/SRC/configure.in b/SRC/configure.in index 2b979ab..57549d1 100644 --- a/SRC/configure.in +++ b/SRC/configure.in @@ -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.1.0) +AM_INIT_AUTOMAKE(echoping, 5.2.0-BETA) AM_CONFIG_HEADER(config.h) dnl User options @@ -31,6 +31,15 @@ AC_ARG_ENABLE(smtp, dnl Default: enable it [AC_DEFINE(SMTP) SMTP=1]) +AC_ARG_ENABLE(idn, + [--enable-idn IDN (Internationalized Domain Names, host names in Unicode, with GNU libidn) support],dnl + [if test "$enableval" = "yes"; then + AC_DEFINE(IDN) + IDN=1 + fi], + dnl Default: enable it + [AC_DEFINE(IDN) + IDN=1]) AC_ARG_WITH(ssl, [--with-ssl[=DIR] SSL crypt support (needs OpenSSL)],dnl [if test "$withval" != "no"; then @@ -110,6 +119,10 @@ AC_CHECK_FUNCS(getaddrinfo getnameinfo inet_ntop, , AC_CHECK_FUNCS(gettimeofday socket sigaction strerror, , AC_MSG_ERROR(Missing mandatory function)) AC_CHECK_FUNCS(usleep) +if test "$IDN" = "1"; then +CF_LIB_GNUIDN +fi + if test "$OPENSSL" = "1" && test "$GNUTLS" = "1"; then AC_MSG_ERROR([Choose OpenSSL or GNU TLS but not both]) fi @@ -225,6 +238,7 @@ DISPLAY_SETTING(ICP) DISPLAY_SETTING(OPENSSL) DISPLAY_SETTING(GNUTLS) DISPLAY_SETTING(SMTP) +DISPLAY_SETTING(IDN) DISPLAY_SETTING(TTCP) DISPLAY_SETTING(TOS) DISPLAY_SETTING(PRIORITY) diff --git a/SRC/echoping.c b/SRC/echoping.c index a5ca843..84efe74 100644 --- a/SRC/echoping.c +++ b/SRC/echoping.c @@ -425,6 +425,11 @@ main (argc, argv) printf ("\nThis is %s, version %s.\n\n", progname, VERSION); } server = argv[0]; +#ifdef IDN + locale_server = server; + utf8_server = stringprep_locale_to_utf8 (server); + server = utf8_server; +#endif if (!http && !icp) { for (p = server; *p && (*p != ':'); p++) @@ -516,6 +521,17 @@ main (argc, argv) } #endif +#ifdef IDN + if ((result = + idna_to_ascii_from_utf8 (utf8_server, &ace_server, 0, + 1)) != IDNA_SUCCESS) + { + err_quit ("IDN error for host: %s %d", server, result); + } + if (verbose) + printf ("ACE name of the server: %s\n", ace_server); + server = ace_server; +#endif error = getaddrinfo (server, port_name, &hints, &res); if (error) { diff --git a/SRC/echoping.h b/SRC/echoping.h index 0e205b3..9386dee 100644 --- a/SRC/echoping.h +++ b/SRC/echoping.h @@ -49,6 +49,11 @@ #include #endif +#ifdef IDN +#include /* stringprep_locale_to_utf8() */ +#include /* idna_to_ascii_from_utf8() */ +#endif + #ifndef FALSE #define FALSE 0 #endif @@ -137,6 +142,9 @@ struct timeval max_timeval; #define CHARGENERATED " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefg"; char *server; +#ifdef IDN +char *locale_server, *ace_server, *utf8_server; +#endif /* My functions */