]> granicus.if.org Git - postgis/commitdiff
Solve iconv-on-Solaris (and hopefully many other platforms with system iconv in...
authorPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 10 Feb 2009 21:20:17 +0000 (21:20 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Tue, 10 Feb 2009 21:20:17 +0000 (21:20 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3683 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac

index 8c536652e5a81b256385b2f3c2aeb8f19707490e..f1019b4ab2f1ba838efb3de72e1c6cdcdb30ac26 100644 (file)
@@ -191,14 +191,14 @@ AC_CHECK_HEADER([iconv.h], [HAVE_ICONV_H=1], [])
 
 dnl If we find the header file, try and link against the library
 if test "x$HAVE_ICONV_H" != "x0"; then
-       dnl Check for iconv includes as part of libc
-       AC_CHECK_LIB([c], [iconv_open], [ICONV_LDFLAGS=-lc HAVE_ICONV=1], [])
+       dnl libconv defines iconv_open to libiconv_open, so we'll check that directly
+       AC_CHECK_LIB([iconv], [libiconv_open], [ICONV_LDFLAGS=-liconv HAVE_ICONV=1], [])
        if test "x$HAVE_ICONV" = "x"; then
-               dnl If not found, check for iconv included as part of libiconv
-               AC_CHECK_LIB([iconv], [iconv_open], [ICONV_LDFLAGS=-liconv HAVE_ICONV=1], [])
+               dnl Check for iconv included as part of libc, using iconv_open
+               AC_CHECK_LIB([c], [iconv_open], [ICONV_LDFLAGS=-lc HAVE_ICONV=1], [])
                if test "x$HAVE_ICONV" = "x"; then
-                       dnl If not found, check for Win32 iconv (some of them use a lib prefix for functions within the iconv DLLs)
-                       AC_CHECK_LIB([iconv], [libiconv_open], [ICONV_LDFLAGS=-liconv HAVE_ICONV=1], [])
+                       dnl But it's possible this implementation of libiconv doesn't have a libiconv_* define
+                       AC_CHECK_LIB([iconv], [iconv_open], [ICONV_LDFLAGS=-liconv HAVE_ICONV=1], [])
                        if test "x$HAVE_ICONV" = "x"; then
                                dnl No iconv library was found; issue a warning to the console
                                AC_MSG_WARN([could not find iconv library: no support for encoding conversion will be included])