[GRASS-dev] Adding path iconv library to ./configure

Vaclav Petras wenzeslaus at gmail.com
Wed Feb 26 08:34:31 PST 2020


Dear all,

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.

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.

ac_save_ldflags="$LDFLAGS"
LDFLAGS="$LDFLAGS $ICONVLIBPATH"
# LDFLAGS now contains the path set using --with-iconv-libs
AC_CHECK_FUNC(iconv, ICONVLIB=, [
AC_CHECK_LIB(iconv, iconv, ICONVLIB=-liconv, [
AC_CHECK_LIB(giconv, iconv, ICONVLIB=-lgiconv, [
AC_CHECK_FUNC(libiconv, ICONVLIB=, [
AC_CHECK_LIB(iconv, libiconv, ICONVLIB=-liconv, [
AC_CHECK_LIB(giconv, libiconv, ICONVLIB=-lgiconv, [
    AC_MSG_WARN([*** Unable to locate iconv() function.])
    ICONVLIB=
])])])])])])
AC_SUBST(ICONVLIB)
LDFLAGS="${ac_save_ldflags}"
# The AC_CHECK_FUNC step above seems to succeed
# The output is "checking for iconv... yes"
# The step below fails because $ICONVLIB is empty
# With "checking for iconv in -l... no"
LOC_CHECK_LIBS($ICONVLIB,iconv,iconv,$ICONVLIBPATH,ICONV,,,)

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.

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.

Please, let me know if you have any advice,
Vaclav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20200226/a915959e/attachment-0003.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: iconv_path_in_configure.diff
Type: text/x-patch
Size: 1707 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20200226/a915959e/attachment-0003.bin>


More information about the grass-dev mailing list