-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support cross-compilation #11
Comments
Actually I have no clue why it's implemented this way, but patches are welcome to change it. |
I am trying to compile the library for arm-linux today and encountered the same issue. Looking forward to a fix. Thanks. |
The real downer here is |
It's there because different iconv implementation use different names for some encodings and support different set of encodings. Even on Linux there can be either libiconv or iconv embedded in glibc, though I'm not sure how much different these two are. |
On linux, there is for example also the musl c library (http://musl-libc.org), which has its own iconv implementation. (It seems to violate one assumption of iconvcap: it can only convert from legacy encodings, but not to them.) |
@nijel, AFAIU iconvcap just tries already known, hardcoded names, so why enca can't do this too? |
It tries one by one possible options for every encoding, doing that on every conversion sounds pretty awkward. |
Sometimes being portable is indeed awkward. Also it should be possible to cache at runtime the correct name after enca figures it out for the first time and reuse it afterwards. |
Caching it could be option, though so far enca is absolutely stateless and does not store any configuration on the disk. On the other side, there is also question whether anybody actually uses enca on systems which do use non standard encoding names in iconv... In the end I'm not really opposed to patch which would change do_iconv_open to iterate over possible charsets when doing iconv_open. I don't think the perfromance hit would be major here and it will probably make it work more as expected... |
The make_hash is compiled with host toolchain since 2393833, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841644 |
Please add |
Patches welcome :-) |
To support cross-compilation, enca’s build system must not depend on executables built for the host system. This includes the
make_hash
tool andiconvcap
. Since this depends on the host iconv, it isn’t just a matter of convincing the build system to do the right thing (though even that would be slightly non-trivial with automake)—ideally, these tools should not exist in the first place.I just had a quick look at things and it seems to me like the following happens:
configure
builds and runsiconvcap
to generateiconvenc.h
, which then contains a number of#define
s which don’t seem to be used directly anywhere (can’t tell for sure, just grepping things)encodings.dat
in the source treemake_hash
to generateencodings.h
Excuse my rudeness. Maybe there is a reason to do it this way. But as an outsider, I sure had a WTF moment just now. If possible at all, I think this should be done at runtime.
The text was updated successfully, but these errors were encountered: