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

Regina Obe lr at pcorp.us
Sun Nov 26 17:55:51 PST 2017

Okay does look like I have two iconv's.

I assume the second one which is the one I want was installed when I did:

pkg install iconv

The original one I don't know where that came from perhaps it's part of a fresh BSD install.

So one is installed in /usr/bin/iconv
Doesn't seem to respond to the usual  --version command and when I call gives this:

iconv: unrecognized option `--version'
Usage:  iconv [-cs] -f <from_code> -t <to_code> [file ...]
        iconv -f <from_code> [-cs] [-t <to_code>] [file ...]
        iconv -t <to_code> [-cs] [-f <from_code>] [file ...]
        iconv -l

The one which perhaps postgis is hooking too when I overwrite the ICONV_LDFLAGS

/usr/local/bin/iconv --version

Gives output:

iconv (GNU libiconv 1.14)
Copyright (C) 2000-2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Bruno Haible.

-----Original Message-----
From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Sandro Santilli
Sent: Sunday, November 26, 2017 3:44 PM
To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
Cc: 'PostGIS Development Discussion' <postgis-devel at lists.osgeo.org>
Subject: Re: [postgis-users] [postgis-devel] Compiling PostGIS under FreeBSD 11

On Sun, Nov 26, 2017 at 03:11:01PM -0500, Regina Obe wrote:
> Confirmed just changing
> From:
> 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.])

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 ?

postgis-users mailing list
postgis-users at lists.osgeo.org

More information about the postgis-users mailing list