# if none exist, fail and message that libidn or libidn2
# is required with a preference for libidn2.
# TODO: What we have right here can probably be improved.
+AC_MSG_CHECKING(for idn or idn2)
+
+AC_MSG_CHECKING(for idn)
my_with_libidn=1
AC_ARG_WITH(libidn,
AS_HELP_STRING([--with-libidn=pathname],
[withval="yes"])
AS_IF([test x_$withval = x_yes],
[AC_CHECK_HEADERS([idna.h],
- AC_MSG_NOTICE([Found idna.h]),
- AC_CHECK_HEADERS([idn/idna.h],
- AC_MSG_NOTICE([Found idn/idna.h]),
- my_with_libidn=0))],
+ AC_MSG_NOTICE([Found idna.h]),
+ AC_CHECK_HEADERS([idn/idna.h],
+ AC_MSG_NOTICE([Found idn/idna.h]),
+ my_with_libidn=0))],
[AS_IF([test x_$withval != x_no],
[CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"
AC_CHECK_HEADERS([idna.h],
- AC_MSG_NOTICE([Found idna.h]),
- [AC_MSG_NOTICE([Failed to find idna.h])
- my_with_libidn=0])],
+ AC_MSG_NOTICE([Found idna.h]),
+ [AC_MSG_NOTICE([Failed to find idna.h])
+ my_with_libidn=0])],
[my_with_libidn=0])])
+AC_MSG_CHECKING(for idn2)
my_with_libidn2=1
AC_ARG_WITH(libidn2,
AS_HELP_STRING([--with-libidn2=pathname],
[withval="yes"])
AS_IF([test x_$withval = x_yes],
[AC_CHECK_HEADERS([idn2.h],
- AC_MSG_NOTICE([Found idn2.h]),
- AC_CHECK_HEADERS([idn2/idn2.h],
- AC_MSG_NOTICE([Found idn2/idn2.h]),
- [AC_MSG_NOTICE([Failed to find idn2.h])
- my_with_libidn2=0]))],
+ AC_MSG_NOTICE([Found idn2.h]),
+ AC_CHECK_HEADERS([idn2/idn2.h],
+ AC_MSG_NOTICE([Found idn2/idn2.h]),
+ [AC_MSG_NOTICE([Failed to find idn2.h])
+ my_with_libidn2=0]))],
[AS_IF([test x_$withval != x_no],
[CFLAGS="$CFLAGS -I$withval/include"
LDFLAGS="$LDFLAGS -L$withval/lib"],
- [my_with_libidn2=0])])
+ [my_with_libidn2=0])])
AC_MSG_CHECKING([if libidn can be used])
# Check for LIBIDNs