Andreas Fritiofson wrote:
> > Here's an example for urjtag, which uses the pkg-config macros:
> >
> > ( export WD=/tmp/x-urjtag;
..
> > ./autogen.sh --prefix="${WD}" --host=$CROSS --disable-python \
> > --without-readline --with-libusb=1.0 --without-libftdi && \
>
> It's not as easy as you seem to think.
FWIW I've built Linux distributions for a long time, and I
understand the details of what happens in that build well.
> This will not generate a proper build.
That's a confusing statement, I think "proper" is rather vague.
> Binaries will expect to be installed at /tmp/x-urjtag,
As you wrote, a given program may or may not depend on the prefix.
Compiling (cross-compiling or no) any program for general consumption
requires being familiar both with the program being compiled and with
the intended system where it will be used, in order to produce
something "proper."
Host and build system are factors as much as the prefix. I intended
to demonstrate use of pkg-config, as opposed to teach a course
in Linux From Scratch with focus on cross-compiliation.
> which is not likely to be the case on the host system, so will fail
> to find configuration files, for example.
In order to keep things simple I let prefix equal DESTDIR. I even
tested my binaries, and they worked.
Anyone who further studies the build process and the tools finds that
prefix needs not equal DESTDIR, which allows to accomodate any prefix
requirements by the host system, while still keeping things
structured and convenient on the build system.
If you face such requirements then I would however suggest that
you're at the point where having a tool manage your cross-platform
software distribution creation starts to make sense. It's also out
of scope for OpenOCD - as was the pkg-config tangent.
I think it is clear from this thread as well as countless others
that portable build processes although used by many open source
projects are not widely understood, even for native builds.
Cross-compiling adds another layer of complexity, making even
fewer people know the ins and outs.
I did not claim that pkg-config is a panacea, but what it does it
does very well, and it is so simple to take advantage of it that I
think everyone should.
> You may be able to get the desired result by playing around with
> sysroot setting of configure and/or pkg-config, but that probably
> brings on another set of complexities.
Please try it out and share your experience.
//Peter
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel