${ISCDEPLIBS} ${ISCCFGDEPLIBS}
LIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \
- ${ISCLIBS} @IDNKIT_LIBS@ @LIBIDN_LIBS@ @LIBIDN2_LIBS@ @LIBS@
+ ${ISCLIBS} @IDNKIT_LIBS@ @LIBIDN2_LIBS@ @LIBS@
NOSYMLIBS = ${DNSLIBS} ${IRSLIBS} ${BIND9LIBS} ${ISCCFGLIBS} \
- ${ISCNOSYMLIBS} @IDNKIT_LIBS@ @LIBIDN_LIBS@ @LIBIDN2_LIBS@ @LIBS@
+ ${ISCNOSYMLIBS} @IDNKIT_LIBS@ @LIBIDN2_LIBS@ @LIBS@
SUBDIRS =
#include <idn/api.h>
#endif
-#ifdef WITH_LIBIDN
-#include <idna.h>
-#include <stringprep.h>
-#endif
-
#ifdef WITH_LIBIDN2
#include <idn2.h>
#endif
}
#endif /* WITH_IDNKIT */
-#ifdef WITH_LIBIDN
-static isc_result_t
-idn_locale_to_ace(const char *from, char *to, size_t tolen) {
- isc_result_t result = ISC_R_FAILURE;
- int res;
- char *tmp_str = NULL;
- char *ace_str = NULL;
-
- tmp_str = stringprep_locale_to_utf8(from);
-
- if (tmp_str != NULL) {
- if (strlen(tmp_str) >= tolen) {
- debug("UTF-8 string is too long");
- free(tmp_str);
- return ISC_R_NOSPACE;
- }
- }
- else
- return ISC_R_FAILURE;
-
- res = idna_to_ascii_8z(tmp_str, &ace_str, 0);
- if (res == IDNA_SUCCESS) {
- /* check the length */
- if (strlen(tmp_str) >= tolen) {
- debug("encoded ASC string is too long");
- result = ISC_R_NOSPACE;
- } else {
- (void) strncpy(to, ace_str, tolen);
- result = ISC_R_SUCCESS;
- }
- }
-
- free(tmp_str);
- free(ace_str);
- if (res != IDNA_SUCCESS) {
- fatal("idna_to_ascii_8z failed: %s", idna_strerror(res));
- }
- return (result);
-}
-
-static isc_result_t
-idn_ace_to_locale(const char *from, char *to, size_t tolen) {
- int res;
- isc_result_t result;
- char *tmp_str = NULL;
-
- res = idna_to_unicode_8zlz(from, &tmp_str, 0);
-
- if (res == IDNA_SUCCESS) {
- /* check the length */
- if (strlen(tmp_str) >= tolen) {
- debug("decoded locale string is too long");
- result = ISC_R_FAILURE;
- goto cleanup;
- }
-
- (void) strncpy(to, tmp_str, tolen);
-
- result = ISC_R_SUCCESS;
- } else {
- debug("idna_to_unicode_8z8l failed: %s",
- idna_strerror(res));
- result = ISC_R_FAILURE;
- }
-
-cleanup:
- free(tmp_str);
- return (result);
-}
-#endif /* WITH_LIBIDN */
-
#ifdef WITH_LIBIDN2
static isc_result_t
idn_locale_to_ace(const char *from, char *to, size_t tolen) {
fi
AC_SUBST(IDNKIT_LIBS)
-#
-# IDN support using libidn
-#
-LIBIDN_LIBS=
-AC_ARG_WITH(libidn,
- AS_HELP_STRING([--with-libidn[=PATH]], [enable IDN support using GNU libidn [yes|no|path]]),
- use_libidn="$withval", use_libidn="no")
-case "$use_libidn" in
-yes)
- if test X$prefix = XNONE ; then
- libidn_path=/usr/local
- else
- libidn_path=$prefix
- fi
- LIBIDN_LIBS="-lidn"
- ;;
-no)
- ;;
-*)
- LIBIDN_LIBS="-L$use_libidn/lib -lidn"
- libidn_path="$use_libidn"
- ;;
-esac
-
-if test "$use_libidn" != no; then
- AC_DEFINE(WITH_LIBIDN, 1, [define if libidn support is to be included.])
- STD_CINCLUDES="$STD_CINCLUDES -I$libidn_path/include"
-fi
-AC_SUBST(LIBIDN_LIBS)
-
#
# IDN support using libidn2
#
# IDN support in general
#
-# check if idnkit, libidn and libidn2 are not used at the same time
-if test "$use_idnkit" != no && test "$use_libidn" != no; then
- AC_MSG_ERROR([idnkit and libidn cannot be used at the same time.])
-fi
+# check if idnkit and libidn2 are not used at the same time
if test "$use_idnkit" != no && test "$use_libidn2" != no; then
AC_MSG_ERROR([idnkit and libidn2 cannot be used at the same time.])
fi
-if test "$use_libidn" != no && test "$use_libidn2" != no; then
- AC_MSG_ERROR([libidn and libidn2 cannot be used at the same time.])
-fi
-
# the IDN support is on
-if test "$use_idnkit" != no || test "$use_libidn" != no || test "$use_libidn2" != no; then
+if test "$use_idnkit" != no || test "$use_libidn2" != no; then
AC_DEFINE(WITH_IDN_SUPPORT, 1, [define if IDN input support is to be included.])
if test "$use_libidn2" = no || test "$use_libidn2_out" != no; then
AC_DEFINE(WITH_IDN_OUT_SUPPORT, 1, [define if IDN output support is to be included.])