[postgis-users] Making shp2pgsql using iconv in /usr/local?

Larry Shaffer larry at shafferinteractive.com
Tue Nov 29 17:03:10 PST 2005


strk,

Sorry for the lack of info on my part. I'd like to get this working, but
it's no big thing until I get ready to install the upcoming PostGIS 1.0.6
version, as this is a brand new setup (PostgreSQL and all) with no real
data installed into yet.

Make for PostGIS works fine with USE_ICONV ?= 0



My src path is /usr/local/src/postgresql-8.1.0/contrib/postgis

These are the values in the PGISSRC/Makefile.config:

USE_PROJ ?= 1
PROJ_DIR ?= /usr/local

USE_GEOS ?= 1
GEOS_DIR ?= /usr/local

USE_JTS ?= 0
JTS_INCLUDES = /usr/local/include
JTS_LIBDIR = /usr/local/lib

USE_STATS=1

AUTOCACHE_BBOX ?= 1

PGSQL_SRC=/usr/local/src/postgresql-8.1.0

USE_ICONV ?= 1
(set to 0 for PostGIS make, then to 1 for shp2pgsql make)

LPATH=/usr/local/src/postgresql-8.1.0/contrib/postgis



What's in /usr/local/lib
libiconv_plug.so
libiconv.la
libiconv.so
libiconv.so.2
libiconv.so.2.2.0

What's in /usr/local/include
iconv.h

and whereis?

sh-2.05a# whereis libiconv
libiconv: /usr/local/lib/libiconv.so /usr/local/lib/libiconv.la
sh-2.05a# whereis iconv
iconv: /usr/bin/iconv /usr/local/bin/iconv /usr/include/iconv.h /usr/
share/man/man1/iconv.1.gz /usr/share/man/man3/iconv.3.gz

(Where is /usr/local/include/iconv.h? It *does* exist in /usr/local/
include. This could be the problem...)

Running  iconv -l  for /usr and /usr/local provides positive results of
listing encodings (i.e. both are working).

sh-2.05a# /usr/bin/iconv --version
iconv (GNU libc) 2.2.5
Copyright (C) 2002 Free Software Foundation, Inc.
...
Written by Ulrich Drepper.

sh-2.05a# /usr/local/bin/iconv --version
iconv (GNU libiconv 1.9)
Copyright (C) 2000-2002 Free Software Foundation, Inc.
...
Written by Bruno Haible.

I installed the libiconv-1.9.1 from GNU since it was a standalone.


Should I install the Standard C library (glibc-2.3.2) in /usr/local ? I
don't think the /usr/local extras before make command of shp2pgsql are
making a difference, so I don't think it's worth the effort right now.
See the following...


Here's the output from the /usr/local extras
(run from within contrib/postgis/loader)

sh-2.05a# LDFLAGS="-L/usr/local/lib -liconv" CFLAGS="-I/usr/local/
include" make shp2pgsql
make: `shp2pgsql' is up to date.
sh-2.05a# make clean
rm -f shpopen.o dbfopen.o getopt.o PQunescapeBytea.o shp2pgsql.o
pgsql2shp.o shp2pgsql pgsql2shp
sh-2.05a# LDFLAGS="-L/usr/local/lib -liconv" CFLAGS="-I/usr/local/
include" make shp2pgsql
gcc -g -Wall -I.. -I. -I/usr/local/src/postgresql-8.1.0/src/interfaces/
libpq -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-
strict-aliasing -DUSE_ICONV -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/
etc"' -DUSE_VERSION=81 -I/usr/local/src/postgresql-8.1.0/src/include -
D_GNU_SOURCE  -I/usr/local  -c -o shpopen.o shpopen.c
shpopen.c:176: warning: `rcsid' defined but not used
gcc -g -Wall -I.. -I. -I/usr/local/src/postgresql-8.1.0/src/interfaces/
libpq -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-
strict-aliasing -DUSE_ICONV -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/
etc"' -DUSE_VERSION=81 -I/usr/local/src/postgresql-8.1.0/src/include -
D_GNU_SOURCE  -I/usr/local  -c -o dbfopen.o dbfopen.c
dbfopen.c:200: warning: `rcsid' defined but not used
gcc -g -Wall -I.. -I. -I/usr/local/src/postgresql-8.1.0/src/interfaces/
libpq -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-
strict-aliasing -DUSE_ICONV -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/
etc"' -DUSE_VERSION=81 -I/usr/local/src/postgresql-8.1.0/src/include -
D_GNU_SOURCE  -I/usr/local  -c -o getopt.o getopt.c
gcc -g -Wall -I.. -I. -I/usr/local/src/postgresql-8.1.0/src/interfaces/
libpq -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-
strict-aliasing -DUSE_ICONV -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/
etc"' -DUSE_VERSION=81 -I/usr/local/src/postgresql-8.1.0/src/include -
D_GNU_SOURCE  -I/usr/local  -c -o PQunescapeBytea.o PQunescapeBytea.c
gcc -g -Wall -I.. -I. -I/usr/local/src/postgresql-8.1.0/src/interfaces/
libpq -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-
strict-aliasing -DUSE_ICONV -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/
etc"' -DUSE_VERSION=81 -I/usr/local/src/postgresql-8.1.0/src/include -
D_GNU_SOURCE  -I/usr/local  -c -o shp2pgsql.o shp2pgsql.c
gcc -g -Wall -I.. -I. -I/usr/local/src/postgresql-8.1.0/src/interfaces/
libpq -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Winline -fno-
strict-aliasing -DUSE_ICONV -DFRONTEND -DSYSCONFDIR='"/usr/local/pgsql/
etc"' -DUSE_VERSION=81 shpopen.o dbfopen.o getopt.o PQunescapeBytea.o
shp2pgsql.o -L/usr/local/src/postgresql-8.1.0/src/port -lstdc++  -L/usr/
local -Wl,-rpath,/usr/local/pgsql/lib -o shp2pgsql 
shp2pgsql.o: In function `utf8':
/usr/local/src/postgresql-8.1.0/contrib/postgis/loader/shp2pgsql.c:1630:
undefined reference to `libiconv_open'
/usr/local/src/postgresql-8.1.0/contrib/postgis/loader/shp2pgsql.c:1648:
undefined reference to `libiconv'
/usr/local/src/postgresql-8.1.0/contrib/postgis/loader/shp2pgsql.c:1654:
undefined reference to `libiconv_close'
collect2: ld returned 1 exit status
make: *** [shp2pgsql] Error 1

and without the /usr/local extras... just 'make shp2pgsql'...

exactly the same results.

I don't think /usr/local/include/incov.h is being located. Either way,
it's failing to make when using the base install of Debian

[linus]$ uname -a
Linux linus 2.4.28-grsec+w+fhs6b+gr0501+nfs+++p4+c4+gr6b-v6.188 #1 SMP
Fri Jan 14 11:41:59 PST 2005 i686 unknown



Any help would be appreciated. Thanx.

-- 
Larry




# strk at refractions.net <strk at refractions.net> emailed the following
#   on Tue, Nov 29, 2005 at 11:18 PM (3:18 PM South Dakota, USA):

>On Tue, Nov 29, 2005 at 03:01:51PM -0700, Larry Shaffer wrote:
>
>> LDFLAGS="-L/usr/local/lib -liconv" CFLAGS="-I/usr/local/include" make
>> shp2pgsql
>> 
>> No go. Still fails to use the iconv in /usr/local same errors as making
>> without the LD and C FLAGS env variables set and the USEICONV (sp?) set
>> to 1 in ../Makefile.config.
>
>Can you be include more informations ?
>Does it fail to compile or to use intended lib ?
>Does it link to any libiconv ?
>Did you find the USE_ICONV variable in Makefile.config
>(it has an underscore) ?
>
>--strk;
>_______________________________________________
>postgis-users mailing list
>postgis-users at postgis.refractions.net
>http://postgis.refractions.net/mailman/listinfo/postgis-users





More information about the postgis-users mailing list