hamedramzi / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
0 stars 0 forks source link

Libtorrent 0.16 doesn't link to libiconv on FreeBSD #388

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Compile lt 0.16 on FreeBSD
2. ldd libtorrent-rasterbar.so (libiconv is missing in the list of libraries.)
3. ld libtorrent-rasterbar.so gives 
libtorrent-rasterbar.so: undefined reference to `libiconv'
libtorrent-rasterbar.so: undefined reference to `libiconv_open'

What version of the product are you using? On what operating system?
0.16

Explicit linking to libiconv is required.

The attached patch adds --with-libiconv to configure. This uses the macro 
AM_ICONV to find the system iconv, and adds the needed flags to LIBS.
Using this option on systems that do not require explicit linking shouldn't be 
problem. In those cases the option will (should) not make any changes.

(http://gcc.gnu.org/svn/gcc/branches/cilkplus/config/iconv.m4)
(Docs: http://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html)

config.rpath (http://gcc.gnu.org/svn/gcc/branches/cilkplus/config.rpath) is 
required by AM_ICONV, so this is also included and copied into the build 
directory by autotool.sh.

It is possible that --with-libiconv is not needed, and that AM_ICONV always 
should be run to test for iconv presence in the system.

Original issue reported on code.google.com by bendi...@gmail.com on 18 Nov 2012 at 1:43

Attachments:

GoogleCodeExporter commented 9 years ago
It appears this patch makes a reference to AC_LIB_RPATH without defining it. 
Where is it supposed to come from? Should that m4 script be included as well?

Original comment by arvid.no...@gmail.com on 19 Nov 2012 at 5:59

GoogleCodeExporter commented 9 years ago
fixed it by adding gettext m4 macro. Thanks for the patch!

Original comment by arvid.no...@gmail.com on 19 Nov 2012 at 6:24

GoogleCodeExporter commented 9 years ago
Both iconv.m4 and config.rpath are needed and included in the patch. iconv.m4 
is loaded like the other m4 files, but config.rpath is needed in the build 
directory, so had to copy that manually in autotool.sh. I didn't find a better 
way to fix that.

Thanks for including the patch ;-)

Original comment by bendi...@gmail.com on 19 Nov 2012 at 11:35