[postgis-users] [postgis-devel] Compiling PostGIS under FreeBSD 11

Sandro Santilli strk at kbt.io
Sun Nov 26 12:43:44 PST 2017


On Sun, Nov 26, 2017 at 03:11:01PM -0500, Regina Obe wrote:
> Confirmed just changing 
> 
> From:
> 
> ICONV_LDFLAGS=-lc
> 
> to
> 
> ICONV_LDFLAGS= -liconv
> 
> Fixed the issue, unfortunately I can't figure out a non-hacky way of fixing this.

The code setting ICONV_LDFLAGS, in configure.ac, is as follows:

  dnl libconv defines iconv_open to libiconv_open, so we'll check that directly
  AC_CHECK_LIB([iconv], [libiconv_open], [ICONV_LDFLAGS="$ICONV_LDFLAGS -liconv" HAVE_ICONV=1], [])
  if test "x$HAVE_ICONV" = "x"; then
    dnl Check for iconv included as part of libc, using iconv_open
    AC_CHECK_LIB([c], [iconv_open], [ICONV_LDFLAGS="$ICONV_LDFLAGS -lc" HAVE_ICONV=1], [])
    if test "x$HAVE_ICONV" = "x"; then
      dnl But it's possible this implementation of libiconv doesn't have a libiconv_* define
      AC_CHECK_LIB([iconv], [iconv_open], [ICONV_LDFLAGS="$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_ERROR([Could not find libiconv. Please install libiconv and libiconv-devel.])
      fi
    fi
  fi

In order to get just '-lc' you should have found NO `libiconv_open` in libiconv,
while you would have found `iconv_open` in libc.

But your error message complains about:

  undefined reference to `libiconv_open'

which you report as being found when you set ICONV_LDFLAGS to -liconv
...

So my question is: do you have multiple libiconv.so files on the
system ?

--strk;


More information about the postgis-users mailing list