I am in the process of using GNU libiconv in (formerly GNU) Recode. Recode versions 3.6 and earlier included an old version of libiconv. Version 3.7 used the system iconv facility. Version 3.8 will use up-to-date GNU libiconv for consistency: difference in behaviour between different iconv implementations was exacerbating the problems that already arise from differences between iconv and Recode's internal operation.
I am attempting to follow the suggestion in NOTES:
Q: How can I integrate libiconv into my package?
A: Just copy the entire libiconv package into a subdirectory of your package.
At configuration time, call libiconv's configure script with the
appropriate --srcdir option and maybe --enable-static or --disable-shared.
Then "cd libiconv && make && make install-lib libdir=... includedir=...".
'install-lib' is a special (not GNU standardized) target which installs
only the include file - in $(includedir) - and the library - in $(libdir) -
and does not use other directory variables. After "installing" libiconv
in your package's build directory, building of your package can proceed.
I have added libiconv to Recode git as a submodule, using the latest release (1.17). This is nice and simple. It would be good to cross-reference this suggestion from README, where it documents the standard gnulib/autotools-based way to install libiconv standalone.
It would be nice to document an example command to run in configure; maybe something like:
libiconv_dir=libiconv
$MKDIR_P $libiconv_dir && cd $libiconv_dir && ../$srcdir/$libiconv_dir/configure --srcdir=. --disable-shared && make && make install-lib libdir=$ac_pwd/src includedir=$ac_pwd/src && cd ..
It would also be good to point out that then one should use
#include "iconv.h"
rather than
#include <iconv.h>
--