bug-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Cross-compiling cfengine?


From: Marcus Furlong
Subject: Cross-compiling cfengine?
Date: Wed, 31 Jan 2007 15:27:21 +0000
User-agent: KNode/0.10.4

Hi,

Just wondering if it's possible to cross-compile cfengine. Has anyone else
done it so far? I have tried, and got it to work, but it's a bit quirky.


The attached patch allows configure to continue without testing if a db
program compiles, basically by just stripping out those tests. Would it be
possible to have a --disable-db-tests argument to configure that skips
those tests? That would stop the following error:

checking Berkeley DB Version... configure: error: cannot run test program
while cross compiling


Another error I get is that configure finds the correct db includes, but
then does not find the corresponding libraries:

checking for BerkeleyDB location
in /home/furlongm/projects/oe/build/tmp/staging/i486-linux/include... 
/home/furlongm/projects/oe/build/tmp/staging/i486-linux/include
checking Berkeley DB Version... configure: error: This release of cfengine
requires BerkeleyDB 3.2 or later

config.log shows that the error is 

./conftest: error while loading shared libraries: libdb-4.4.so: cannot open
shared object file: No such file or directory

Currently I get around this by using
LD_PRELOAD=${STAGING_LIBDIR}/libdb-4.4.so ./configure

but it would be nice to have it in a way that wasn't dependant on the libdb
version. Maybe a configure option --with-db-libraries=
or --with-extra=libraries=?


Another problem I have is that CHFLAGS gets set when it shouldn't be. I just
sed it out for after configure has run, but the corresponding config.log
entry would seem to be here:

configure:12900: checking for chflags
configure:12957: ccache i486-linux-gcc -o
conftest -pthread 
-isystem/home/furlongm/projects/oe/build/tmp/staging/i486-linux/include 
-fexpensive-optimizations -Os
/tmp/ccCdas7o.o: In function `main':
conftest.c:(.text+0x13): warning: warning: chflags is not implemented and
will always fail
configure:12963: $? = 0
configure:12967: test -z
                         || test ! -s conftest.err
configure:12970: $? = 0
configure:12973: test -s conftest
configure:12976: $? = 0
configure:12988: result: yes


Trying to run an openssl program also fails, as it probably does for pcre
too..

| checking for OpenSSL
location... /home/furlongm/projects/oe/tmp/staging/i486-linux/lib/..
| checking OpenSSL Version... configure: error: cannot run test program
while cross compiling

But I got around these by un-setting --host=${HOST_SYS}
and --target=${TARGET_SYS} as arguments to configure, which shouldn't work,
but does. (Possibly because the host environments openssl and pcre are the
same versions as the build environments ones, so these tests pass. Possibly
the same fixes as were needed for db are needed for openssl and pcre too.)


My autotools skills are severely lacking (I did try though) but I can test
anything if that's needed. For now, if anyone else might be trying to
cross-compile cfengine, the above might help you with the current version.

Marcus.

Attachment: bogus.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]