Scim cross compilation on arm

1 message Options
Embed this post
Permalink
Luca Ottaviano

Scim cross compilation on arm

Reply Threaded More More options
Print post
Permalink
Hi all,
I've managed to cross compile scim on arm platform but not without some
fighting with autoconf and configure, so I'm going to ask some questions
about configure.ac and the build process in general.

I'm compiling the current stable version (1.4.7) on Ubuntu 8.10 32-bit
with gcc 3.4 for arm.

First off, when cross compiling configure dies on the check for docbook
and xsltproc. After a bit of research, I found that in configure.ac the
check is defined as:
    AC_CHECK_FILE([path/to/stylesheet/on/build/machine])
According to this link:
http://www.mail-archive.com/autoconf@.../msg02858.html
this macro should be used when checking
"...for the existence of /dev/... and things like /etc/passwd...

These files, of course, are related to the host, certainly not the
build machine.  That's why he decided to die when cross compiling."

I'm not an autoconf expert, but probably these can be substituted with
'test -f' checks. Is there a reason why you didn't use that?

I have a patch that uses 'test -f' for all those check, but that (and in
general all the changes to configure.ac) triggers another problem : the
generated libtool file does not work anymore, giving very strange error
messages, for example:

if /bin/bash ../libtool --tag=CXX --mode=compile arm-linux-g++ -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../src -I.. -I../src -I../intl -DSCIM_DATADIR=\"/usr/local/share/scim\" -DSCIM_LOCALEDIR=\"/usr/local/share/locale\" -DSCIM_SYSCONFDIR=\"/usr/local/etc\" -DSCIM_LIBEXECDIR=\"/usr/local/lib/scim-1.0\" -DSCIM_ICONDIR=\"/usr/local/share/scim/icons\" -DSCIM_MODULE_PATH=\"/usr/local/lib/scim-1.0\"    -g -O2 -MT scim_config_base.lo -MD -MP -MF ".deps/scim_config_base.Tpo" -c -o scim_config_base.lo scim_config_base.cpp; \
        then mv -f ".deps/scim_config_base.Tpo" ".deps/scim_config_base.Plo"; else rm -f ".deps/scim_config_base.Tpo"; exit 1; fi
../libtool: line 804: X--tag=CXX: command not found
../libtool: line 804: X--tag=CXX: command not found
../libtool: line 837: libtool: ignoring unknown tag : command not found
../libtool: line 804: X--mode=compile: command not found
../libtool: line 837: libtool: ignoring unknown tag : command not found
../libtool: line 804: X--tag=CXX: command not found
../libtool: line 837: libtool: ignoring unknown tag : command not found
../libtool: line 804: X--mode=compile: command not found
../libtool: line 804: X--mode=compile: command not found
[...and so on, all the parameters seem to have an X in front of them...]
../libtool: line 1165: Xscim_chartraits.lo: command not found
../libtool: line 1114: Xarm-linux-g++: command not found
../libtool: line 1170: libtool: compile: cannot determine name of library object from `': command not found

If I take that command line and modify it to use the system libtool, the
compilation is ok.
Do you have a clue of what's going on here? Why did you use a custom
libtool script instead of the system one?

Second, with my toolchain the linking process dies because it cannot
find the function rpl_malloc. This is automatically defined in the
automatically generated config.h as:
#define malloc rpl_malloc
which in turn is generated by the macro AC_FUNC_MALLOC in configure.ac.
Of course, if I delete that line in config.h the linker is happy, but
that's not the proper way to go! :)
Do you have any hints?

Finally, I think scim triggers a bug on gcc 3.4, that complains about
'::malloc undefined' in cstdlib. Please be proud! :)
I solved it by adding a '#include <stdlib.h>' at the top of
scim_private.h.
Do you think it's possible to patch it? (maybe with a comment to track
why the include was added...)

Thanks in advance.
--
Ing. Luca Ottaviano - [hidden email]
Develer S.r.l. - http://www.develer.com/
.hardware .software .innovation
Tel.: +39 055 3986627 - ext.: 218


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Scim-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/scim-devel