On Tue, 27 Jul 2010, Yan Seiner wrote:
>
>
>
> On Tue, July 27, 2010 4:20 pm, Robert P. J. Day wrote:
> >
> > i'm not convinced, for the simple reason that i could
> > cross-compile a trivial "hi, world" program with the toolchain
> > installed elsewhere as long as i had the search path set properly.
> > if what you say is true, wouldn't that have been impossible?
>
> I think you'll run into weird breakage as the compiler pulls in the
> wrong header files and such.
>
> Install it in root, then create symlinks to where you want.
i'm still not convinced that this is an actual problem, let me
explain what inspired it. (and i will test what you suggest shortly,
but i'll also explain why i don't think it's going to work.)
i wanted to cross-compile the luci GUI admin interface (the one
that's the standard for openwrt) to see if i could just drop it on a
TS-7260 system (writing additional modules, of course). i checked out
the luci svn repo, and i can trivially compile it natively on my
ubuntu 10.04 system. piece of cake.
however, based on the docs, if i want to cross-compile, i need to do
something like:
$ make CC=arm-unknown-linux-gnu-gcc LD=arm-unknown-linux-gnu-ld
where i've installed the TS toolchain under my home directory, and set
my shell search PATH to find the executables. and what i get is:
... snip ...
make[1]: Entering directory
`/home/rpjday/luci/svn/trunk/contrib/luacurses'
mkdir -p dist/usr/lib/lua
arm-unknown-linux-gnu-gcc -O2 --std=gnu99 -shared -pedantic \
-Wall -fPIC -I/usr/include/lua5.1 -o
dist/usr/lib/lua/curses.so src/curses.c src/luacurses.c
src/curses.c:39:20: error: curses.h: No such file or directory
... snip ...
what that tells me is that the toolchain doesn't support curses,
correct? if i scan the entire toolchain install directory, there is
no curses.h header file, so the above error makes sense. i *do* have
all of curses development installed *natively*, but the cross compile
operation obviously isn't searching outside of the toolchain for
curses.h, which is exactly what i would expect.
in short, trying to cross-compile luci with the TS toolchain
installed in a regular directory for me failed because it couldn't
find "curses.h", but that's what i would expect because that toolchain
doesn't *provide* that header file and, in my opinion, it would be
wrong to go looking for it elsewhere. in other words, installing the
toolchain under /opt should still fail for exactly the same reason --
no toolchain curses support. is that not correct?
i'll install under /opt and test it, but i expect the same build
error and i'd be happy for anyone to dissect my logic and explain what
i might have missed.
rday
--
========================================================================
Robert P. J. Day Waterloo, Ontario, CANADA
Top-notch, inexpensive online Linux/OSS/kernel courses
http://crashcourse.ca
Twitter: http://twitter.com/rpjday
LinkedIn: http://ca.linkedin.com/in/rpjday
========================================================================
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|