[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnu-libiconv] Including libiconv in another package
From: |
Bruno Haible |
Subject: |
Re: [bug-gnu-libiconv] Including libiconv in another package |
Date: |
Sun, 26 Feb 2023 18:01:46 +0100 |
Hi Reuben,
> 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 understand. Good that you notify me; I'll try to keep that in mind on
the libiconv side.
> 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.
OK.
> It would be good to
> cross-reference this suggestion from README, where it documents the
> standard gnulib/autotools-based way to install libiconv standalone.
Well, no, I don't want to publicize this way of integrating GNU libiconv
even more. If 10 packages were to do the same as you do with Recode, that
would become a real burden.
> 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>
Any careful maintainer will find out to do this.
Less immediate and easy to find out: If you want to include the statically
built libiconv.a in a shared library librecode.so, you need to pass a
particular option in CFLAGS. With GCC or clang it's '-fPIC', with some
other compilers it's '-KPIC'; you need the $lt_cv_prog_compiler_pic
variable from the libtool configuration here.
That will be something worth noting in the NOTES file, once you have verified
that my hint works.
Bruno