* Porting to Autoconf 2.5 (copnfigure.in -> configure.ac, etc)

* Porting to version 0.3 of libidn
* New autoconf test for GNU libidn
Initial
Stephane Bortzmeyer 21 years ago
parent efcfa00812
commit 9d0fec5e12

@ -17,7 +17,8 @@ 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)
--disable-idn (suppress the IDN support, the handling of Unicode domaine names, see RFC 3490)
--without-libidn (suppress the IDN support, the handling of Unicode - multi-script - domain names, see RFC 3490)
--with-libidn[=/where/is/libidn] (tell the system where to find the GNU libidn library <http://www.josefsson.org/libidn/>)
--with-gnutls[=/where/is/gnutls] (add the SSL/TLS support, you will need
the GNU TLS library <http://www.gnutls.org/>)
--with-ssl[=/where/is/ssl] (add the SSL/TLS support, you will need

@ -9,7 +9,7 @@ echoping_LDADD =
DOCS=DETAILS
TESTS=test-echoping-local test-echoping-remote
MORE_TESTS=test-echoping-proxy test-echoping-icp test-echoping-crypto test-echoping-tos test-echoping-ipv6
MORE_TESTS=test-echoping-proxy test-echoping-icp test-echoping-crypto test-echoping-tos test-echoping-ipv6 test-echoping-idn
test: check
tests: check

@ -103,9 +103,9 @@ MANS = $(man_MANS)
NROFF = nroff
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
Makefile.am Makefile.in NEWS TODO acconfig.h acinclude.m4 aclocal.m4 \
config.guess config.h.in config.sub configure configure.in install-sh \
missing mkinstalldirs
Makefile.am Makefile.in NEWS TODO acinclude.m4 aclocal.m4 config.guess \
config.h.in config.sub configure configure.ac install-sh missing \
mkinstalldirs
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@ -120,19 +120,19 @@ OBJECTS = $(echoping_OBJECTS)
all: all-redirect
.SUFFIXES:
.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
cd $(top_builddir) \
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
$(ACLOCAL_M4): configure.in acinclude.m4
$(ACLOCAL_M4): configure.ac acinclude.m4
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
config.status: $(srcdir)/configure.ac $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
$(srcdir)/configure: $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
@ -150,7 +150,7 @@ $(srcdir)/config.h.in: $(srcdir)/stamp-h.in
rm -f $(srcdir)/stamp-h.in; \
$(MAKE) $(srcdir)/stamp-h.in; \
else :; fi
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.ac $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null

@ -1,45 +0,0 @@
@BOTTOM@
/* Do we have getaddrinfo()? */
#undef HAVE_GETADDRINFO_PROTO
/* Do we have POSIX signals? */
#undef HAVE_SIGACTION
/* Do we have T/TCP? */
#undef HAVE_TTCP
/* Do we have TOS? */
#undef HAVE_TOS
/* Do we have socket priority? */
#undef HAVE_SOCKET_PRIORITY
/* HTTP support */
#undef HTTP
/* SMTP support */
#undef SMTP
/* ICP support */
#undef ICP
/* IDN (Unicode) */
#undef IDN
/* SSL (crypto) */
#undef OPENSSL
/* TLS (crypto) */
#undef GNUTLS
/* Port name for HTTP. Unused. */
#undef HTTP_TCP_PORT
/* Port name for ICP */
#undef ICP_UDP_PORT
#undef PACKAGE
#undef VERSION
/* $Id$ */

@ -158,6 +158,15 @@ else
fi
])
# Check GNU libidn
# TODO: check the patched libc with AI_IDN. See libidn, in libc/getaddrinfo-idn.txt.
AC_DEFUN([CF_LIB_LIBIDN],
[
AC_CHECK_LIB(idn,idna_to_ascii_8z,
[LIBS="${LIBS} -lidn"],
[AC_ERROR([Get the GNU libidn library (http://www.josefsson.org/libidn/) in order to use Unicode - multi-script - domain names or use --without-libidn to disable it])], dnl
)])
# Check OpenSSL
AC_DEFUN([CF_LIB_OPENSSL],
[
@ -175,14 +184,6 @@ 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/) or use --disable-idn])], dnl
)])
dnl experimental
AC_DEFUN([CF_CHECK_TCP_SERVICE],
[

42
SRC/aclocal.m4 vendored

@ -170,6 +170,14 @@ else
fi
])
# Check GNU libidn
AC_DEFUN([CF_LIB_LIBIDN],
[
AC_CHECK_LIB(idn,idna_to_ascii_8z,
[LIBS="${LIBS} -lidn"],
[AC_ERROR([Get the GNU libidn library (http://www.josefsson.org/libidn/) in order to use Unicode - multi-script - domain names or use --without-libidn to disable it])], dnl
)])
# Check OpenSSL
AC_DEFUN([CF_LIB_OPENSSL],
[
@ -187,14 +195,6 @@ 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/) or use --disable-idn])], dnl
)])
dnl experimental
AC_DEFUN([CF_CHECK_TCP_SERVICE],
[
@ -281,7 +281,7 @@ fi
# lib-prefix.m4 serial 3 (gettext-0.12.2)
# lib-prefix.m4 serial 3 (gettext-0.13)
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
@ -989,7 +989,7 @@ AC_DEFUN([AC_LIB_APPENDTOVAR],
done
])
# lib-ld.m4 serial 2 (gettext-0.12)
# lib-ld.m4 serial 3 (gettext-0.13)
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
@ -1005,11 +1005,12 @@ 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])
case `$LD -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
acl_cv_prog_gnu_ld=yes ;;
*)
acl_cv_prog_gnu_ld=no ;;
esac])
with_gnu_ld=$acl_cv_prog_gnu_ld
])
@ -1079,11 +1080,12 @@ AC_CACHE_VAL(acl_cv_path_LD,
# 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
case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
*GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break ;;
*)
test "$with_gnu_ld" != yes && break ;;
esac
fi
done
IFS="$ac_save_ifs"

@ -1,100 +1,121 @@
/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to empty if the keyword does not work. */
#undef const
/* Crypto (TLS) support */
#undef GNUTLS
/* Define if you don't have vprintf but do have _doprnt. */
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
/* Define if you have the vprintf function. */
#undef HAVE_VPRINTF
/* Define as the return type of signal handlers (int or void). */
#undef RETSIGTYPE
/* Define if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Define if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
/* Define if you have the getaddrinfo function. */
/* Define to 1 if you have the `getaddrinfo' function. */
#undef HAVE_GETADDRINFO
/* Define if you have the getnameinfo function. */
/* Define to 1 if you have the `getnameinfo' function. */
#undef HAVE_GETNAMEINFO
/* Define if you have the gettimeofday function. */
/* Define to 1 if you have the `gettimeofday' function. */
#undef HAVE_GETTIMEOFDAY
/* Define if you have the inet_ntop function. */
/* Define to 1 if you have the `inet_ntop' function. */
#undef HAVE_INET_NTOP
/* Define if you have the sigaction function. */
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION
/* Define if you have the socket function. */
/* Define to 1 if you have the `socket' function. */
#undef HAVE_SOCKET
/* Define if you have the strerror function. */
/* Socket priority support */
#undef HAVE_SOCKET_PRIORITY
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
/* Define if you have the usleep function. */
#undef HAVE_USLEEP
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define if you have the <sys/time.h> header file. */
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/time.h> header file. */
#undef HAVE_SYS_TIME_H
/* Define if you have the <unistd.h> header file. */
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Type Of Service support */
#undef HAVE_TOS
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Name of package */
#undef PACKAGE
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
/* Version number of package */
#undef VERSION
/* Define to 1 if you have the `vprintf' function. */
#undef HAVE_VPRINTF
/* HTTP support */
#undef HTTP
/* Do we have getaddrinfo()? */
#undef HAVE_GETADDRINFO_PROTO
/* ICP support */
#undef ICP
/* Do we have POSIX signals? */
#undef HAVE_SIGACTION
/* Internationalized Domain Names support */
#undef LIBIDN
/* Do we have T/TCP? */
#undef HAVE_TTCP
/* Crypto (SSL) support */
#undef OPENSSL
/* Do we have TOS? */
#undef HAVE_TOS
/* Name of package */
#undef PACKAGE
/* Do we have socket priority? */
#undef HAVE_SOCKET_PRIORITY
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* HTTP support */
#undef HTTP
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* SMTP support */
#undef SMTP
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* ICP support */
#undef ICP
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* IDN (Unicode) */
#undef IDN
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* SSL (crypto) */
#undef OPENSSL
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* TLS (crypto) */
#undef GNUTLS
/* SMTP support */
#undef SMTP
/* Port name for HTTP. Unused. */
#undef HTTP_TCP_PORT
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Port name for ICP */
#undef ICP_UDP_PORT
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
#undef PACKAGE
/* Transaction TCP support */
#undef TTCP
/* Version number of package */
#undef VERSION
/* $Id$ */
/* Define to empty if `const' does not conform to ANSI C. */
#undef const

7520
SRC/configure vendored

File diff suppressed because it is too large Load Diff

@ -3,6 +3,7 @@ dnl $Id$
dnl Process this file with autoconf to produce a configure script.
AC_INIT(echoping.h)
AC_CANONICAL_HOST
AC_PROG_CC(cc gcc)
AM_INIT_AUTOMAKE(echoping, 5.2.0-BETA)
AM_CONFIG_HEADER(config.h)
@ -10,40 +11,49 @@ dnl User options
AC_ARG_ENABLE(http,
[--enable-http HTTP (Web's main protocol) support],dnl
[if test "$enableval" = "yes"; then
AC_DEFINE(HTTP)
AC_DEFINE(HTTP,,[HTTP support])
HTTP=1
fi],
dnl Default: enable it
[AC_DEFINE(HTTP)
[AC_DEFINE(HTTP,,[HTTP support])
HTTP=1])
AC_ARG_ENABLE(icp,
[--enable-icp ICP (for testing Web proxies/caches) support],dnl
[if test "$enableval" = "yes"; then
AC_DEFINE(ICP)
AC_DEFINE(ICP,,[ICP support])
ICP=1
fi])
AC_ARG_ENABLE(smtp,
[--enable-smtp SMTP (Mail's main protocol) support],dnl
[if test "$enableval" = "yes"; then
AC_DEFINE(SMTP)
AC_DEFINE(SMTP,,[SMTP support])
SMTP=1
fi],
dnl Default: enable it
[AC_DEFINE(SMTP)
[AC_DEFINE(SMTP,,[SMTP support])
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
dnl IDN
dnl Default: enable it
LIBIDN=1
AC_ARG_WITH(libidn,
[--with-libidn[=DIR] Internationalized Domain Names support (needs GNU libidn)],dnl
[if test "$withval" != "no"; then
if test "$withval" != "yes"; then
IDNROOT=$withval
LDFLAGS="${LDFLAGS} -L$IDNROOT/lib"
CPPFLAGS="${CPPFLAGS} -I$IDNROOT/include"
fi
else
LIBIDN=0
fi],
dnl Default: enable it
[AC_DEFINE(IDN)
IDN=1])
)
if test "$LIBIDN" = "1"; then
AC_DEFINE(LIBIDN,,[Internationalized Domain Names support])
fi
AC_ARG_WITH(ssl,
[--with-ssl[=DIR] SSL crypt support (needs OpenSSL)],dnl
[if test "$withval" != "no"; then
AC_DEFINE(OPENSSL)
AC_DEFINE(OPENSSL,,[Crypto (SSL) support])
OPENSSL=1
if test "$withval" != "yes"; then
SSLROOT=$withval
@ -56,7 +66,7 @@ AC_ARG_WITH(ssl,
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)
AC_DEFINE(GNUTLS,,[Crypto (TLS) support])
GNUTLS=1
CPPFLAGS="${CPPFLAGS} `libgnutls-config --cflags`"
LDFLAGS="${LDFLAGS} `libgnutls-config --libs`"
@ -119,10 +129,9 @@ 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
if test "$LIBIDN" = "1"; then
CF_LIB_LIBIDN
fi
if test "$OPENSSL" = "1" && test "$GNUTLS" = "1"; then
AC_MSG_ERROR([Choose OpenSSL or GNU TLS but not both])
fi
@ -140,7 +149,7 @@ AC_TRY_COMPILE(
#include <sys/socket.h>
],
[int foobar = MSG_EOF;],
[AC_DEFINE(TTCP)
[AC_DEFINE(TTCP,,[Transaction TCP support])
ac_have_ttcp="yes"],
ac_have_ttcp=no)
AC_MSG_RESULT($ac_have_ttcp)
@ -148,7 +157,7 @@ AC_ARG_ENABLE(ttcp,
[--enable-ttcp T/TCP (Transaction TCP) support],
[if test "$enableval" = "yes"; then
if test $ac_have_ttcp = "yes"; then
AC_DEFINE(HAVE_TTCP)
AC_DEFINE(TTCP,,[Transaction TCP support])
TTCP=1
else
AC_MSG_WARN([No T/TCP support on this system, request ignored])
@ -156,7 +165,7 @@ AC_ARG_ENABLE(ttcp,
fi],
dnl Default: enable it if supported
if test $ac_have_ttcp = "yes"; then
AC_DEFINE(HAVE_TTCP)
AC_DEFINE(TTCP,,[Transaction TCP support])
TTCP=1
fi)
@ -167,7 +176,7 @@ AC_TRY_COMPILE(
#include <netinet/in.h>
],
[int foobar = IP_TOS;],
[AC_DEFINE(HAVE_TOS)
[AC_DEFINE(HAVE_TOS,,[Type Of Service support])
ac_have_tos="yes"],
ac_have_tos="no")
AC_MSG_RESULT($ac_have_tos)
@ -175,7 +184,7 @@ AC_ARG_ENABLE(tos,
[--enable-tos TOS (Type Of Service) support],
[if test "$enableval" = "yes"; then
if test $ac_have_tos = "yes"; then
AC_DEFINE(HAVE_TOS)
AC_DEFINE(HAVE_TOS,,[Type Of Service support])
TOS=1
else
AC_MSG_WARN([No TOS support on this system, request ignored])
@ -183,7 +192,7 @@ AC_ARG_ENABLE(tos,
fi],
dnl Default: enable it if supported
if test $ac_have_tos = "yes"; then
AC_DEFINE(HAVE_TOS)
AC_DEFINE(HAVE_TOS,,[Type Of Service support])
TOS=1
fi)
@ -203,7 +212,7 @@ AC_ARG_ENABLE(priority,
[--enable-priority PRIORITY (socket priority) support],
[if test "$enableval" = "yes"; then
if test $ac_have_priority = "yes"; then
AC_DEFINE(HAVE_SOCKET_PRIORITY)
AC_DEFINE(HAVE_SOCKET_PRIORITY,,[Socket priority support])
PRIORITY=1
else
AC_MSG_WARN([No socket priority support on this system, request ignored])
@ -211,7 +220,7 @@ AC_ARG_ENABLE(priority,
fi],
dnl Default: enable it if supported
if test $ac_have_priority = "yes"; then
AC_DEFINE(HAVE_SOCKET_PRIORITY)
AC_DEFINE(HAVE_SOCKET_PRIORITY,,[Socket priority support])
PRIORITY=1
fi)
@ -238,7 +247,7 @@ DISPLAY_SETTING(ICP)
DISPLAY_SETTING(OPENSSL)
DISPLAY_SETTING(GNUTLS)
DISPLAY_SETTING(SMTP)
DISPLAY_SETTING(IDN)
DISPLAY_SETTING(LIBIDN)
DISPLAY_SETTING(TTCP)
DISPLAY_SETTING(TOS)
DISPLAY_SETTING(PRIORITY)

@ -425,7 +425,7 @@ main (argc, argv)
printf ("\nThis is %s, version %s.\n\n", progname, VERSION);
}
server = argv[0];
#ifdef IDN
#ifdef LIBIDN
locale_server = server;
utf8_server = stringprep_locale_to_utf8 (server);
if (utf8_server)
@ -525,10 +525,10 @@ main (argc, argv)
}
#endif
#ifdef IDN
#ifdef LIBIDN
if ((result =
idna_to_ascii_from_utf8 (utf8_server, &ace_server, 0,
1)) != IDNA_SUCCESS)
idna_to_ascii_8z (utf8_server, &ace_server, IDNA_USE_STD3_ASCII_RULES
)) != IDNA_SUCCESS)
{
err_quit ("IDN error for host: %s %d", server, result);
}

@ -49,7 +49,7 @@
#include <gnutls/gnutls.h>
#endif
#ifdef IDN
#ifdef LIBIDN
#include <stringprep.h> /* stringprep_locale_to_utf8() */
#include <idna.h> /* idna_to_ascii_from_utf8() */
#endif
@ -142,7 +142,7 @@ struct timeval max_timeval;
#define CHARGENERATED " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefg";
char *server;
#ifdef IDN
#ifdef LIBIDN
char *locale_server, *ace_server, *utf8_server;
#endif

@ -11,4 +11,4 @@ echo "dependent but you typically 'export LC_CTYPE=xx_XX.utf8'. 'locale -a' to g
echo "possible values."
./echoping -h / -v café.gennic.net
./echoping -h / -v www.trườngđạihọcbáchkhoahànội.edu.vn

Loading…
Cancel
Save