Query page
Enter new bug
| Description: |
Opened: 2008-04-25 10:53 |
Forwarding Gentoo bug 219040:
Open Motif 2.3.0 fails to build on FreeBSD due to a undefined references to
libiconv functions:
/bin/bash ../../libtool --tag=CC --mode=link i686-gentoo-freebsd6.2-gcc -O2
-mtune=i686 -pipe -fno-strict-aliasing -Wall -g -fno-strict-aliasing
-Wno-unused -Wno-comment -fno-tree-ter -DCSRG_BASED -DXNO_MTSAFE_API
-DXNO_MTSAFE_PWDAPI -L/usr/local/lib -o wmldbcreate wmldbcreate.o
../../lib/Xm/libXm.la -ljpeg
i686-gentoo-freebsd6.2-gcc -O2 -mtune=i686 -pipe -fno-strict-aliasing -Wall -g
-fno-strict-aliasing -Wno-unused -Wno-comment -fno-tree-ter -DCSRG_BASED
-DXNO_MTSAFE_API -DXNO_MTSAFE_PWDAPI -o .libs/wmldbcreate wmldbcreate.o
-L/usr/local/lib ../../lib/Xm/.libs/libXm.so /usr/lib/libXmu.so
/usr/lib/libXt.so /usr/lib/libSM.so /usr/lib/libICE.so /usr/lib/libXp.so
/usr/lib/libXext.so /usr/lib/libX11.so /usr/lib/libXau.so /usr/lib/libXdmcp.so
-lrpcsvc /usr/lib/libjpeg.so
../../lib/Xm/.libs/libXm.so: undefined reference to `libiconv_open'
../../lib/Xm/.libs/libXm.so: undefined reference to `libiconv_close'
../../lib/Xm/.libs/libXm.so: undefined reference to `libiconv'
collect2: ld returned 1 exit status
gmake[2]: *** [wmldbcreate] Error 1
The reason is that configure is checking for function iconv_open, but the name
of this function is redefined to libiconv_open in the iconv.h header file.
------- Additional Comments From Ulrich Müller 2008-04-25 10:54 -------
Created an attachment (id=179)
Proposed patch for configure.ac
------- Additional Comments From Ulrich Müller 2008-04-25 11:03 -------
As an alternative to attached simple bugfix, you may also consider using
iconv.m4 (from GNU gettext) for proper detection of iconv functions.
------- Additional Comments From Ulrich Müller 2008-07-01 14:36 -------
Created an attachment (id=187)
Updated patch: inclusion of iconv.h needs to be conditional, too
------- Additional Comments From Ulrich Müller 2008-07-01 14:44 -------
Created an attachment (id=188)
Updated patch (right file this time): inclusion of iconv.h needs to be conditional, too
------- Additional Comments From Ihor Hayvuk 2008-08-30 07:22 -------
Fixed as proposed in HEAD and openmotif_2_3 branches
------- Additional Comments From Ulrich Müller 2010-02-04 14:21 -------
Reopening, since it still fails on Solaris 10:
libtool: link: i386-pc-solaris2.10-gcc -march=core2 -O3 -pipe
-fno-strict-aliasing -Wall -g -fno-strict-aliasing -Wno-unused -Wno-comment
-fno-tree-ter -o .libs/wmldbcreate wmldbcreate.o ../../lib/Xm/.libs/libXm.so
-L/Library/Gentoo/usr/lib /Library/Gentoo/usr/lib/libXmu.so -luuid
/Library/Gentoo/usr/lib/libXt.so /Library/Gentoo/usr/lib/libSM.so
/Library/Gentoo/usr/lib/libICE.so /Library/Gentoo/usr/lib/libXp.so
/Library/Gentoo/usr/lib/libXext.so /Library/Gentoo/usr/lib/libX11.so
/Library/Gentoo/usr/lib/libxcb.so /Library/Gentoo/usr/lib/libXau.so
/Library/Gentoo/usr/lib/libXdmcp.so -lsocket -lnsl -Wl,-rpath
-Wl,/Library/Gentoo/usr/lib
../../lib/Xm/.libs/libXm.so: undefined reference to `libiconv'
../../lib/Xm/.libs/libXm.so: undefined reference to `libiconv_close'
../../lib/Xm/.libs/libXm.so: undefined reference to `libiconv_open'
collect2: ld returned 1 exit status
make[2]: *** [wmldbcreate] Error 1
make[2]: Leaving directory
`/Library/Gentoo/var/tmp/portage/x11-libs/openmotif-2.3.2/work/openmotif-2.3.2/tools/wml'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/Library/Gentoo/var/tmp/portage/x11-libs/openmotif-2.3.2/work/openmotif-2.3.2/tools'
The proper fix is to use AM_ICONV (iconv.m4 from GNU gettext), as I had already
suggested previously.
------- Additional Comments From Ulrich Müller 2010-02-04 14:22 -------
This is with 2.3.2 which the "Version" box doesn't allow me to select.
------- Additional Comments From Ulrich Müller 2010-02-05 09:47 -------
Created an attachment (id=268)
Patch using AM_ICONV() from GNU gettext
------- Additional Comments From Ulrich Müller 2010-02-05 09:51 -------
Attached patch fixes the problem. Please note that it will require iconv.m4 and
config.rpath from gettext. Tested with gettext-0.17 on Solaris 10 (where vanilla
2.3.2 fails) and on Linux.
Proper detection of libiconv is tricky, see also
<http://www.gnu.org/software/hello/manual/gettext/AM_005fICONV.html> for a long
description.
Query page
Enter new bug