Sat 17 Feb 2007 01:35:44 AM UTC, comment #11:
What advantage does setting $PATH to be all cross-compilers offer? I've just been doing "configure --host=i586-mingw32msvc --build=i686-linux" and then configure picks up all the cross-tools that have names prefixed with i586-mingw32msvc-*.
If there's a better way to detect $CC_FOR_BUILD, then I'd be happy to adopt it.
|
Sat 17 Feb 2007 12:36:44 AM UTC, comment #10:
On 2/16/07, Ben Pfaff <INVALID.NOREPLY@gnu.org> wrote:
> Here's my proposed solution. Comments?
It works, basically, but I have to be quite careful what I set CC_FOR_BUILD to.
- On my setup I set up the PATH for cross-compiling. Thus if I do not set CC_FOR_BUILD, I get the cc from my cross-compiling path. This only results in an error long after q2c has been built. Perhaps there should be no fallback if CC_FOR_BUILD does not exist, or even better if configure checks that CC_FOR_BUILD builds binaries that can actually be run on the build host.
My second problem was that if I simply set CC_FOR_BUILD to /usr/bin/gcc, gcc picks up the "as" on the cross-compiling path, which leads to the error:
/usr/bin/gcc ./src/language/lexer/q2c.c -o ./src/language/lexer/q2c
as: unrecognized option `-Qy'
Thus I had to set CC_FOR_BUILD to cc_for_build.sh
---- cc_for_build.sh ---
export PATH=$HOST_PATH && $HOST_CC "$@"
---- END ---
In my cross.env I have
...
export CC_FOR_BUILD=`which \`pwd\`/cc_for_build.sh \`pwd\`/../cc_for_build.sh \`pwd\`/../../cc_for_build.sh`
export HOST_CC=`which gcc`
export HOST_PATH=$PATH
PATH="$PREFIX/bin:$PREFIX/$TARGET/bin:$PATH"
...
|
Fri 16 Feb 2007 11:27:20 PM UTC, comment #9:
I just built pspp successfully after doing a clean checkout of both pspp and gnulib, and the patch below. I'm not sure what was causing the trouble before. 'sorry for the noise.
|
Fri 16 Feb 2007 07:25:24 PM UTC, comment #8:
I checked this in.
Jason's comments on the quote.c changes still presumably apply to that bug; I've linked to it from there.
|
Fri 16 Feb 2007 05:13:40 PM UTC, comment #7:
Yes. The problem showed after applying the patch and
then running make clean. Now it seems like another problem,
though, since I just saw mbchar.h in the gl/ directory on another machine.
I'll start with a new checkout of pspp and gnulib and see
if the problem persists.
|
Fri 16 Feb 2007 05:06:18 PM UTC, comment #6:
>src/libpspp/quote.c:25:20: mbchar.h: No such file or directory
Jason: was this meant to be in response to bug #18860, which introduces libpspp/quote.c?
|
Fri 16 Feb 2007 04:57:45 PM UTC, comment #5:
After applying the patch, a clean build gave
me this error on OBSD 64 bit x86:
src/libpspp/quote.c:25:20: mbchar.h: No such file or directory
|
Fri 16 Feb 2007 07:57:29 AM UTC, comment #4:
I think this is good.
The only other thing that needs to be done is to put a note about cross compiling in INSTALL.
In fact, looking at this file, I think there is a lot of generic information of limited usefulness. I think INSTALL should be rewritten, and there are some things in README, which ought to be moved to INSTALL.
|
Fri 16 Feb 2007 05:49:58 AM UTC, comment #3:
Here's my proposed solution. Comments?
CC'ing John M-D because he's been so helpful in this area.
(file #11982)
|
Tue 13 Feb 2007 05:53:11 PM UTC, comment #2:
Unsurprisingly, we are not the first to run into similar problems. A little bit of looking around turned up common conventions for doing this with Autoconf and Automake:
http://autoconf-archive.cryp.to/ac_prog_cc_for_build.html
http://sources.redhat.com/ml/automake/2004-01/msg00152.html
http://sourceware.org/autobook/autobook/autobook_270.html
Probably we should adopt the macro from that first link.
|
Mon 12 Feb 2007 03:20:13 PM UTC, comment #1:
Rewriting in perl might be a good idea for the longer term.
In the mean time, we could just assume that "cc" invokes a native compiler on the build machine. Or, we could have an extra autoconf option which is required, if autoconf detects that cross compiling is in effect.
|
Fri 09 Feb 2007 04:59:27 AM UTC, original submission:
The q2c program needs to run on the build architecture, not on the host architecture, but it's not obvious how to make Automake do what we want. (Maybe we should rewrite q2c in Perl.)
|