Bug 186563 - databases/postgis21: error: use of undeclared identifier 'ICONV_SET_TRANSLITERATE'
Summary: databases/postgis21: error: use of undeclared identifier 'ICONV_SET_TRANSLITE...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Some People
Assignee: Po-Chuan Hsieh
URL:
Keywords: easy
Depends on:
Blocks:
 
Reported: 2014-02-08 18:10 UTC by O. Hartmann
Modified: 2015-03-31 13:38 UTC (History)
5 users (show)

See Also:
koobs: maintainer-feedback? (sunpoet)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2014-02-08 18:10:00 UTC
[...]
cc -I ../liblwgeom -O2 -pipe -O3 -march=native -I/usr/local/include -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing  -fPIC -DPIC  -Wall -Wmissing-prototypes    -I. -I. -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -I/usr/local/include/libxml2 -I/usr/include -I/usr/local/include -I/usr/local/include  -c -o dbfopen.o dbfopen.c
cc -I ../liblwgeom -O2 -pipe -O3 -march=native -I/usr/local/include -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing  -fPIC -DPIC  -Wall -Wmissing-prototypes    -I. -I. -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -I/usr/local/include/libxml2 -I/usr/include -I/usr/local/include -I/usr/local/include  -c -o getopt.o getopt.c
cc -I ../liblwgeom -O2 -pipe -O3 -march=native -I/usr/local/include -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing  -fPIC -DPIC  -Wall -Wmissing-prototypes    -I. -I. -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -I/usr/local/include/libxml2 -I/usr/include -I/usr/local/include -I/usr/local/include  -c -o shpcommon.o shpcommon.c
cc -I ../liblwgeom -O2 -pipe -O3 -march=native -I/usr/local/include -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing  -fPIC -DPIC  -Wall -Wmissing-prototypes    -I. -I. -I/usr/local/include/postgresql/server -I/usr/local/include/postgresql/internal -I/usr/local/include/libxml2 -I/usr/include -I/usr/local/include -I/usr/local/include  -c -o safileio.o safileio.c
cc -I ../liblwgeom -O2 -pipe -O3 -march=native -I/usr/local/include -DLIBICONV_PLUG -fstack-protector -fno-strict-aliasing  -fPIC -DPIC  -Wall -Wmissing-prototypes    -c shp2pgsql-core.c
shp2pgsql-core.c:103:17: warning: passing 'char **' to parameter of type 'const char **' discards qualifiers in nested pointer types
      [-Wincompatible-pointer-types-discards-qualifiers]
        if ( iconv(cd, &inputbuf, &inbytesleft, &outputptr, &outbytesleft) == -1 )
                       ^~~~~~~~~
/usr/local/include/iconv.h:83:48: note: passing argument to parameter 'inbuf' here
extern size_t iconv (iconv_t cd, const char* * inbuf, size_t *inbytesleft, char* * outbuf, size_t *outbytesleft);
                                               ^
shp2pgsql-core.c:108:3: warning: implicit declaration of function 'iconvctl' is invalid in C99 [-Wimplicit-function-declaration]
                iconvctl(cd, ICONV_SET_TRANSLITERATE, &on);
                ^
shp2pgsql-core.c:108:16: error: use of undeclared identifier 'ICONV_SET_TRANSLITERATE'
                iconvctl(cd, ICONV_SET_TRANSLITERATE, &on);


[...]


 [postgis21] make showconfig
===> The following configuration options are available for postgis-2.1.0_1:
     LOADERGUI=off: Enable shp2pgsql-gui
     RASTER=off: Raster support
     TOPOLOGY=on: Topology support
===> Use 'make config' to modify these settings
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-02-08 18:10:07 UTC
Maintainer of databases/postgis21,

Please note that PR ports/186563 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/186563

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer freebsd_triage 2014-02-08 18:10:08 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Yuichiro NAITO 2014-02-20 06:07:36 UTC
Hello.

I'm facing same problem on FreeBSD 10.0-R.
For quick fix, please apply following path.

--- Makefile.org    2014-02-20 14:22:22.000000000 +0900
+++ Makefile    2014-02-20 14:24:56.000000000 +0900
@@ -19,7 +19,7 @@

 USE_GNOME=    libxml2
 USE_PGSQL=    yes
-USES=        gmake iconv perl5 pkgconfig
+USES=        gmake iconv:wchar_t perl5 pkgconfig
 USE_LDCONFIG=    yes
 GNU_CONFIGURE=    yes
 USE_PERL5=    build

This problem occurs when all following conditions are  satisfied.
  1. on FreeBSD 10.0-R or later (means base system has iconv library)
  2. converters/libiconv is installed
  3. a ports application is using iconvctl() function.

For the condition 1. and 2.  , ports/Mk/Uses/iconv.mk adds
'CFLAGS+=-DLIBICONV_PLUG' .
LIBICONV_PLUG undefines iconvctl() and ICONV_SET_TRANSLITERATE  in
/usr/local/include/iconv.h

This is the reason of the compile error.

But I'm not sure this path is correct fix by the following reasons.

 a) postgis does not need wchar_t conversion.
      (Making iconv:iconvctl option is better solution?)

 b) if postgis configure does not detect iconvctl() function, they  do not
use iconvctl() and the defenitions.
      (I should make a problem report of autoconf ?)


-- 
Yuichiro NAITO
(naito.yuichiro@gmail.com)
Comment 4 Rainer Hurling freebsd_committer freebsd_triage 2014-02-20 19:34:21 UTC
Caused on the error message, I think it should be more sufficient to use
'iconv:translit' instead of 'iconv:wchar_t', shouldn't it?

At least it works for me on 11.0-CURRENT amd64 r262153.


--- Makefile.orig	2013-11-10 07:10:40.000000000 +0100
+++ Makefile	2014-02-20 20:28:12.000000000 +0100
@@ -19,7 +19,7 @@

 USE_GNOME=	libxml2
 USE_PGSQL=	yes
-USES=		gmake iconv perl5 pkgconfig
+USES=		gmake iconv:translit perl5 pkgconfig
 USE_LDCONFIG=	yes
 GNU_CONFIGURE=	yes
 USE_PERL5=	build
Comment 5 Yuichiro NAITO 2014-02-25 02:32:58 UTC
I think both iconv:wchar_t and iconv:translit work same.
I'm not sure which semantic is better.

-- 
Yuichiro NAITO
(naito.yuichiro@gmail.com)
Comment 6 O. Hartmann 2014-04-18 20:13:29 UTC
This problem is still present and the offered patch is working. Why isn't it committed
yet?
Comment 7 Martin Wilke freebsd_committer freebsd_triage 2014-06-04 08:20:19 UTC
I fixed now in rev356445.
Comment 8 Romain Tartière freebsd_committer freebsd_triage 2014-12-28 21:02:44 UTC
Any reason the iconv fix was not applied to databases/postgis20?

I am facing similar failures and having the very same workaround for some times, and guess the fix can be applied to this port too.

Thanks!
Comment 9 Romain Tartière freebsd_committer freebsd_triage 2014-12-28 21:06:57 UTC
Wow, didn't see that databases/postgis20 and databases/postgis21 do not have the same maintainer.

sunpoet@, can you please consider using "iconv:wchar_t" for databases/postgis20 ?
Comment 10 commit-hook freebsd_committer freebsd_triage 2015-03-31 13:36:50 UTC
A commit references this bug:

Author: sunpoet
Date: Tue Mar 31 13:36:38 UTC 2015
New revision: 382817
URL: https://svnweb.freebsd.org/changeset/ports/382817

Log:
  - Use USES=iconv:wchar_t
  - Bump PORTREVISION for dependency change (on FreeBSD 10+)

  PR:		186563
  Submitted by:	romain

Changes:
  head/databases/postgis20/Makefile
Comment 11 Po-Chuan Hsieh freebsd_committer freebsd_triage 2015-03-31 13:38:38 UTC
Committed. Thanks!