Handle libintl needing libiconv (for OpenBSD 5.2)
authorDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 7 Nov 2012 20:48:27 +0000 (20:48 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Wed, 7 Nov 2012 20:48:27 +0000 (20:48 +0000)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
configure.ac

index 6288ea1..e3a97e9 100644 (file)
@@ -171,9 +171,18 @@ if test "$USE_NLS" = "yes"; then
       (void)dgettext("openconnect", "foo");])],
       [AC_MSG_RESULT(yes (with -lintl))]
        LIBINTL="-lintl",
-      [AC_MSG_RESULT(no)
-       USE_NLS=no])
-     LIBS="$oldLIBS"])
+      [LIBS="$LIBS -liconv"
+       AC_LINK_IFELSE([AC_LANG_PROGRAM([
+        #include <locale.h>
+        #include <libintl.h>],[
+        setlocale(LC_ALL, "");
+        bindtextdomain("openconnect", "/tmp");
+        (void)dgettext("openconnect", "foo");])],
+        [AC_MSG_RESULT(yes (with -lintl -liconv))]
+         LIBINTL="-lintl",
+        [AC_MSG_RESULT(no)
+         USE_NLS=no])
+     LIBS="$oldLIBS"])])
 fi
 
 if test "$USE_NLS" = "yes"; then