Use icu library for IDN feature
[platform/upstream/curl.git] / configure.ac
index 417ba20..38a021b 100644 (file)
@@ -2954,18 +2954,18 @@ dnl http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/ \
 dnl genprogc/thread_quick_ref.htm
 
 dnl **********************************************************************
-dnl Check for GLIB-2.0 (IDN support)
+dnl Check for ICU-UC (IDN support)
 dnl **********************************************************************
 
-AC_MSG_CHECKING([whether to build with glib-2.0])
+AC_MSG_CHECKING([whether to build with icu-uc])
 OPT_IDN="default"
-AC_ARG_WITH(glib-2.0,
-AC_HELP_STRING([--with-glib2=PATH],[Enable glib-2.0 usage])
-AC_HELP_STRING([--without-glib2],[Disable glib-2.0 usage]),
+AC_ARG_WITH(icu-uc,
+AC_HELP_STRING([--with-icu-uc=PATH],[Enable icu-uc usage])
+AC_HELP_STRING([--without-icu-uc],[Disable icu-uc usage]),
   [OPT_IDN=$withval])
 case "$OPT_IDN" in
   no)
-    dnl --without-glib2 option used
+    dnl --without-icu-uc option used
     want_idn="no"
     AC_MSG_RESULT([no])
     ;;
@@ -2976,13 +2976,13 @@ case "$OPT_IDN" in
     AC_MSG_RESULT([(assumed) yes])
     ;;
   yes)
-    dnl --with-glib2 option used without path
+    dnl --with-icu-uc option used without path
     want_idn="yes"
     want_idn_path="default"
     AC_MSG_RESULT([yes])
     ;;
   *)
-    dnl --with-glib2 option used with path
+    dnl --with-icu-uc option used with path
     want_idn="yes"
     want_idn_path="$withval"
     AC_MSG_RESULT([yes ($withval)])
@@ -2999,33 +2999,33 @@ if test "$want_idn" = "yes"; then
   if test "$want_idn_path" != "default"; then
     dnl path has been specified
     IDN_PCDIR="$want_idn_path/lib$libsuff/pkgconfig"
-    CURL_CHECK_PKGCONFIG(glib-2.0, [$IDN_PCDIR])
+    CURL_CHECK_PKGCONFIG(icu-uc, [$IDN_PCDIR])
     if test "$PKGCONFIG" != "no"; then
       IDN_LIBS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
-        $PKGCONFIG --libs-only-l glib-2.0 2>/dev/null`
+        $PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
       IDN_LDFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
-        $PKGCONFIG --libs-only-L glib-2.0 2>/dev/null`
+        $PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
       IDN_CPPFLAGS=`CURL_EXPORT_PCDIR([$IDN_PCDIR]) dnl
-        $PKGCONFIG --cflags-only-I glib-2.0 2>/dev/null`
+        $PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
     else
       dnl pkg-config not available or provides no info
-      IDN_LIBS="-lglib-2.0"
+      IDN_LIBS="-licu-uc"
       IDN_LDFLAGS="-L$want_idn_path/lib$libsuff"
       IDN_CPPFLAGS="-I$want_idn_path/include"
       IDN_DIR="$want_idn_path/lib$libsuff"
     fi
   else
     dnl path not specified
-    CURL_CHECK_PKGCONFIG(glib-2.0)
+    CURL_CHECK_PKGCONFIG(icu-uc)
     if test "$PKGCONFIG" != "no"; then
-      IDN_LIBS=`$PKGCONFIG --libs-only-l glib-2.0 2>/dev/null`
-      IDN_LDFLAGS=`$PKGCONFIG --libs-only-L glib-2.0 2>/dev/null`
-      IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I glib-2.0 2>/dev/null`
+      IDN_LIBS=`$PKGCONFIG --libs-only-l icu-uc 2>/dev/null`
+      IDN_LDFLAGS=`$PKGCONFIG --libs-only-L icu-uc 2>/dev/null`
+      IDN_CPPFLAGS=`$PKGCONFIG --cflags-only-I icu-uc 2>/dev/null`
       IDN_DIR=`echo $IDN_LDFLAGS | $SED -e 's/-L//'`
     else
       dnl pkg-config not available or provides no info
-      IDN_LIBS="-lglib-2.0"
+      IDN_LIBS="-licu-uc"
     fi
   fi
   #
@@ -3045,23 +3045,23 @@ if test "$want_idn" = "yes"; then
   LDFLAGS="$IDN_LDFLAGS $LDFLAGS"
   LIBS="$IDN_LIBS $LIBS"
   #
-  AC_MSG_CHECKING([if g_hostname_to_ascii can be linked])
+  AC_MSG_CHECKING([if uidna_nameToASCII_UTF8 can be linked])
   AC_LINK_IFELSE([
-    AC_LANG_FUNC_LINK_TRY([g_hostname_to_ascii])
+    AC_LANG_FUNC_LINK_TRY([uidna_nameToASCII_UTF8])
   ],[
     AC_MSG_RESULT([yes])
-    tst_links_glib2="yes"
+    tst_links_icu="yes"
   ],[
     AC_MSG_RESULT([no])
-    tst_links_glib2="no"
+    tst_links_icu="no"
   ])
   #
-  if test "$tst_links_glib2" = "yes"; then
-    AC_DEFINE(USE_GLIB2_HOSTNAME, 1, [Define to 1 if you have the `glib-2.0' library (-lglib-2.0).])
+  if test "$tst_links_icu" = "yes"; then
+    AC_DEFINE(USE_ICU_IDNA, 1, [Define to 1 if you have the `icu-uc' library (-licu-uc).])
     dnl different versions of libidn have different setups of these:
 
     AC_SUBST([IDN_ENABLED], [1])
-    curl_idn_msg="enabled (glib-2.0)"
+    curl_idn_msg="enabled (icu-uc)"
     if test -n "$IDN_DIR" -a "x$cross_compiling" != "xyes"; then
       LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$IDN_DIR"
       export LD_LIBRARY_PATH