<div dir="ltr"><div><br><br>On Wed, Feb 26, 2020 at 5:35 PM Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>> wrote:<br>><br>> Dear all,<br>><br>> In order to compile in a conda environment (where iconv is installed through conda, not in the system), I'm trying to add a path to icon into ./configure(.in). The issue is that although GRASS happens to configure properly, the compilation fails because libiconv.* is not found.<br><br>it seems that GRASS configure uses iconv from libc if present, but at compile time this is not always true: sometimes iconv from libiconv is attempted to be used and not from libc.<br><br>See <a href="https://lists.osgeo.org/pipermail/grass-dev/2014-December/072690.html">https://lists.osgeo.org/pipermail/grass-dev/2014-December/072690.html</a><br><br>Most importantly, regarding only iconv:<br><br>"In the configure script, the header checks and the library checks are<br>disconnected."<br></div><div><br></div><div>This needs to be fixed.If the configure checks pass, the settings used by configure (included headers, linkied libraries) need to be used as compile time.<br></div><div><br></div>Markus M<br><div><br>><br>> I have added code which is used for other libraries, although I'm not sure what exactly should I do for a mandatory dependency. The part which seems to be failing is AC_CHECK_FUNC.<br>><br>> ac_save_ldflags="$LDFLAGS"<br>> LDFLAGS="$LDFLAGS $ICONVLIBPATH"<br>> # LDFLAGS now contains the path set using --with-iconv-libs<br>> AC_CHECK_FUNC(iconv, ICONVLIB=, [<br>> AC_CHECK_LIB(iconv, iconv, ICONVLIB=-liconv, [<br>> AC_CHECK_LIB(giconv, iconv, ICONVLIB=-lgiconv, [<br>> AC_CHECK_FUNC(libiconv, ICONVLIB=, [<br>> AC_CHECK_LIB(iconv, libiconv, ICONVLIB=-liconv, [<br>> AC_CHECK_LIB(giconv, libiconv, ICONVLIB=-lgiconv, [<br>>     AC_MSG_WARN([*** Unable to locate iconv() function.])<br>>     ICONVLIB=<br>> ])])])])])])<br>> AC_SUBST(ICONVLIB)<br>> LDFLAGS="${ac_save_ldflags}"<br>> # The AC_CHECK_FUNC step above seems to succeed<br>> # The output is "checking for iconv... yes"<br>> # The step below fails because $ICONVLIB is empty<br>> # With "checking for iconv in -l... no"<br>> LOC_CHECK_LIBS($ICONVLIB,iconv,iconv,$ICONVLIBPATH,ICONV,,,)<br>><br>> I'm including a full diff too. Note that the iconv library is different from the others because our ./configure allows for different names of the library.<br>><br>> Alternative would be to use LDFLAGS. That would be actually ideal, because all libraries are just at one common prefix. However, providing it as a parameter to ./configure (which seems to be the recommended way even over the above) results in "unknown platform" and providing it as an environmental variable does not have any effect.<br>><br>> Please, let me know if you have any advice,<br>> Vaclav<br>><br>> _______________________________________________<br>> grass-dev mailing list<br>> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-dev">https://lists.osgeo.org/mailman/listinfo/grass-dev</a></div></div>