libiconv-prefix seems broken

"Wood, David" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Hello,

I'm compiling freetds-0.82.1.dev.20081111 on Solaris 10 x86.  I had been
successfully using "--with-libiconv-prefix" with v0.64; however, with
v0.82 configure failed to detect my installation of GNU libiconv.  I
eventually realised that freetds-0.82.1.dev.20081111 doesn't ship with
config.rpath.  I generated config.rpath myself and made some progress
until:

<<
/tmp/freetds/src/apps/fisql > gmake
/bin/bash ../../../libtool --tag=CC --mode=link gcc -D_REENTRANT
-pthreads -O3 -g -Wdeclaration-after-statement  -O3 -g
-L/usr/local/unixodbc-2.2.14/lib -o fisql  fisql.o terminal.o edit.o
handlers.o interrupt.o ../../dblib/libsybdb.la
../../replacements/libreplacements.la -lnsl -lsocket
gcc -D_REENTRANT -pthreads -O3 -g -Wdeclaration-after-statement -O3 -g
-o .libs/fisql fisql.o terminal.o edit.o handlers.o interrupt.o
-L/usr/local/unixodbc-2.2.14/lib ../../dblib/.libs/libsybdb.so
../../replacements/.libs/libreplacements.a -lnsl -lsocket
-R/usr/local/freetds-0.82.1.dev.20081111/lib
Undefined                       first referenced
 symbol                             in file
libiconv_close                      ../../dblib/.libs/libsybdb.so
libiconv_open                       ../../dblib/.libs/libsybdb.so
libiconv                            ../../dblib/.libs/libsybdb.so
ld: fatal: Symbol referencing errors. No output written to .libs/fisql
collect2: ld returned 1 exit status
gmake: *** [fisql] Error 1
>>

I used this fix for fisql:

<<
--- src/apps/fisql/Makefile.am  7 Jan 2009 01:57:46 -0000       1.1.1.1
+++ src/apps/fisql/Makefile.am  9 Jan 2009 00:37:34 -0000
@@ -6,6 +6,6 @@
 else
 bin_PROGRAMS   = fisql

-fisql_LDADD    = ../../dblib/libsybdb.la
../../replacements/libreplacements.la $(NETWORK_LIBS) $(READLINE_LIBS)
+fisql_LDADD    = ../../dblib/libsybdb.la
../../replacements/libreplacements.la $(NETWORK_LIBS) $(LIBICONV)
$(READLINE_LIBS)
 fisql_SOURCES  = fisql.c terminal.c terminal.h edit.c edit.h handlers.c
handlers.h interrupt.c interrupt.h
 endif
>>

I again made more progress until freebcp:

<<
gcc -D_REENTRANT -pthreads -O3 -g -Wdeclaration-after-statement -O3 -g
-o .libs/freebcp freebcp.o -L/usr/local/unixodbc-2.2.14/lib
../dblib/.libs/libsybdb.so -lnsl -lsocket
-R/usr/local/freetds-0.82.1.dev.20081111/lib
Undefined                       first referenced
 symbol                             in file
libiconv_close                      ../dblib/.libs/libsybdb.so
libiconv_open                       ../dblib/.libs/libsybdb.so
libiconv                            ../dblib/.libs/libsybdb.so
ld: fatal: Symbol referencing errors. No output written to .libs/freebcp
collect2: ld returned 1 exit status
>>

>From freetds/src/apps/Makefile:

<<
freebcp_LDADD = ../dblib/libsybdb.la $(NETWORK_LIBS)
freebcp_SOURCES = freebcp.c freebcp.h
tsql_LDADD = ../tds/libtds.la \
                  ../replacements/libreplacements.la \
                  $(NETWORK_LIBS) $(LIBICONV) $(FREETDS_LIBGCC)
$(READLINE_LIBS)

>>

Notice tsql includes LIBICONV whereas freebcp does not.  This problem
extends to bsqldb, defncopy, and many others.  I decided to stop mucking
with individual Makefiles and I now forcibly link GNU iconv via LDFLAGS.
Perhaps a better / more generic fix would be appropriate?

David
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.