GNOME Bugzilla – Bug 388788
Subtle bug in autotools checks for iconv
Last modified: 2013-09-14 16:49:44 UTC
I'm guessing I'm the only one in the universe with a system weird enough to trigger this build bug: configure.in does three things in regards to iconv: 1) Check for any special --with-libiconv flag, setting $ICONV_CFLAGS and $ICONV_LIBS if found 2) Check if a program can *link* (which implies compile as well, I guess) against -liconv, adding -liconv to $ICONV_LIBS if so 3) Checks to see if a simple program can compile, link, AND run with the above determined ICONV_CFLAGS and ICONV_LIBS I think the logic from 2->3 is buggy; -liconv should only be added to ICONV_LIBS if a program can compile, link, *and run* against -liconv. The patch to fix this is trivial; I'll attach it in a minute. With the patch (and a similar one for evolution), everything builds and functions well for me.
Created attachment 78820 [details] [review] Change AC_TRY_LINK to AC_TRY_RUN
Please review.
Created attachment 85290 [details] [review] Supplemental patch Elijah's patch looks good, though I've not run into the problem myself. I guess Elijah has the weirder system. While we're on the topic of iconv, I'm attaching a small rider to this bug. It's a patch for iconv-detect.c that fixes an implicit function declaration.
Patches committed to Subversion trunk, revision 7668.
Awesome, could I convince you to look at the identical bug against evolution, bug 388789? Thanks!
Sure. Actually, I almost committed your patch to evolution by mistake.
Also committed to gnome-2-18 branch (revision 7684).
Eric pointed out a bug in my patch in bug 428375; the program doesn't have a return value. I'm reopening and will attach a trivial patch to fix this issue.
Created attachment 86202 [details] [review] Trivial fix to the bug pointed out by Eric in my previous patch
Thanks. Also added "#include <stdlib.h>" to the test program to make sure it plays nicely with -Werror-implicit-function-declaration. Committed to trunk (revision #7697) and gnome-2-18 branch (revision #7698).