summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2016-11-08 15:24:26 +0100
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2016-11-20 17:31:49 +0100
commit10241198c0e35e59dcb59c8a725639684a7416d3 (patch)
tree60b44f345a454279fc60e82bf0619cadbbf4ec58 /configure.ac
parent2d34f67f2c45d259744570042a0fd78739617328 (diff)
downloadgnutls-10241198c0e35e59dcb59c8a725639684a7416d3.tar.gz
Use libunistring when present instead of iconv()
That allows us to rely to a single provider for unicode functionality.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 18 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index 1960c5c2bd..121caba477 100644
--- a/configure.ac
+++ b/configure.ac
@@ -293,11 +293,6 @@ AM_CONDITIONAL(HAVE_SECCOMP_TESTS, test "$seccomp_tests" = "yes")
AC_LIB_HAVE_LINKFLAGS(seccomp,, [#include <seccomp.h>
], [seccomp_init(0);])
-AC_LIB_HAVE_LINKFLAGS(unistring,, [#include <uninorm.h>
-], [u8_normalize(0, 0, 0, 0, 0);])
-
-AM_CONDITIONAL(HAVE_LIBUNISTRING, test "$HAVE_LIBUNISTRING" = "yes")
-
# check for libcrypto - used in test programs
AC_LIB_HAVE_LINKFLAGS(crypto,, [#include <openssl/evp.h>
], [EVP_CIPHER_CTX_init(NULL);])
@@ -329,22 +324,32 @@ if test "$ac_cv_func_clock_gettime" != "yes";then
gnutls_needs_librt=yes
fi
+AC_LIB_HAVE_LINKFLAGS(unistring,, [#include <uninorm.h>], [u8_normalize(0, 0, 0, 0, 0);])
+
ac_have_unicode=no
-if test "$ac_cv_func_iconv" != "yes";then
- AC_LIB_HAVE_LINKFLAGS(iconv,, [#include <iconv.h>], [iconv (0, 0, 0, 0, 0);])
- if test "$HAVE_LIBICONV" = "yes";then
- ac_have_unicode=yes
- fi
-else
+if test "$HAVE_LIBUNISTRING" = "yes";then
ac_have_unicode=yes
+ ac_have_unistring=yes
+else
+ if test "$ac_cv_func_iconv" != "yes";then
+ AC_LIB_HAVE_LINKFLAGS(iconv,, [#include <iconv.h>], [iconv (0, 0, 0, 0, 0);])
+ fi
+
+ if test "$ac_cv_func_iconv" = "yes" || test "$HAVE_LIBICONV" = "yes";then
+ ac_have_unicode="partial (iconv)"
+ else
+ ac_have_unicode=no
+ fi
fi
if test "$ac_have_unicode" != "yes";then
if test "$have_win" = "yes";then
- ac_have_unicode=yes
+ ac_have_unicode="partial (winapi)"
fi
fi
+AM_CONDITIONAL(HAVE_LIBUNISTRING, test "$ac_have_unistring" = "yes")
+
dnl Note that g*l_INIT are run after we check for library capabilities,
dnl to prevent issues from caching lib dependencies. See discussion
dnl in https://bugs.gentoo.org/show_bug.cgi?id=494940 and
@@ -496,6 +501,7 @@ else
*** libidn was not found. IDNA support will be disabled.
*** ]])
fi
+
else
with_libidn=no
fi