[cogl/wip/rig: 1/33] check if we need to explicitly link with a libiconv library



commit 48c8833e7acea939c4cf23c90af2609d28476085
Author: Robert Bragg <robert linux intel com>
Date:   Wed Mar 12 15:36:07 2014 +0000

    check if we need to explicitly link with a libiconv library
    
    This is also careful to check whether locale_charset() is available
    in the case that we are explicitly linking to libiconv otherwise
    since it may not be enough to just check for the localcharset.h header.

 configure.ac |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index bffc31b..c4bc7bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1440,10 +1440,19 @@ if test $found_export_dynamic = no; then
         LDFLAGS="${old_ldflags}"
 fi
 
-AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h localcharset.h sys/types.h)
+AC_CHECK_HEADERS(getopt.h sys/time.h sys/wait.h pwd.h langinfo.h iconv.h sys/types.h)
 AC_CHECK_HEADER(alloca.h, [HAVE_ALLOCA_H=1], [HAVE_ALLOCA_H=0])
 AC_SUBST(HAVE_ALLOCA_H)
 
+AC_CHECK_FUNC(iconv_open,
+              [
+                AC_CHECK_HEADER(localcharset.h, AC_DEFINE([HAVE_LOCALCHARSET_H], [1], [localcharset.h]))
+              ],
+              [
+                COGL_DEP_LIBS="$COGL_DEP_LIBS -liconv"
+                AC_CHECK_LIB([iconv], [locale_charset],
+                             [AC_CHECK_HEADER(localcharset.h, AC_DEFINE([HAVE_LOCALCHARSET_H], [1], 
[localcharset.h]))])
+              ])
 
 dnl ================================================================
 dnl Platform values


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]