]> granicus.if.org Git - postgis/commitdiff
Change autoconf iconv-detection code so that ICONV_LDFLAGS is explicitly set in the...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 14 Jul 2008 10:41:05 +0000 (10:41 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 14 Jul 2008 10:41:05 +0000 (10:41 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2845 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac

index 66a29ac59a2544bba3c9dedc1c7734ef59b3f194..9a1f31be36a3c3a96e21c8e2d30f6be32a3716c3 100644 (file)
@@ -106,28 +106,23 @@ dnl
 dnl Detect iconv if it is installed (used for shp2pgsql encoding conversion if available)
 dnl
 
-LIBS_SAVE="$LIBS"
 HAVE_ICONV_H=0
 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], [HAVE_ICONV=1], [])
+       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 iconv included as part of libiconv
-               AC_CHECK_LIB([iconv], [iconv_open], [HAVE_ICONV=1], [])
+               AC_CHECK_LIB([iconv], [iconv_open], [ICONV_LDFLAGS=-liconv 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], [HAVE_ICONV=1], [])
+                       AC_CHECK_LIB([iconv], [libiconv_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])
-                       else
-                               ICONV_LDFLAGS="$LIBS"
                        fi
-               else
-                       ICONV_LDFLAGS="$LIBS"
                fi      
        fi
 else
@@ -135,7 +130,6 @@ else
        AC_MSG_WARN([could not find iconv.h header: no support for encoding conversion will be included])
 fi
 
-LIBS="$LIBS_SAVE"
 
 dnl Only define HAVE_ICONV in postgis_config.h if we detect iconv sucessfully
 if test "x$HAVE_ICONV" != "x"; then