On Mon, 2003-09-29 at 22:45, Dan Kegel wrote: > In cross-compiling the latest nmap, which uses a recent autoconf, > I noticed that it uses CC both for target stuff and for build-time-only > stuff. Looking around via google, I was surprised to see that autoconf > doesn't seem to have a standard macro to set BUILD_CC! > > A proposal was posted four years ago > ( see http://sources.redhat.com/ml/autoconf/1999-07/msg00089.html ) > but doesn't seem to have been popular. > > glibc uses the very simple > > if test $host != $build; then > AC_CHECK_PROGS(BUILD_CC, gcc cc) > fi > > which is pretty good (it's as good as the assumption that > you can tell you're cross-compiling by comparing build and host; > I've run into situations where that's false, but that assumption > is made in a lot of places, so I just grin and mangle my host > identifier to make it true). > > Octave also grabs BUILD_CFLAGS at the same time, which is > a pretty good idea, and it doesn't suffer from the above assumption: > http://www.mit.edu/afs/sipb/project/octave/src/octave-2.1.44/configure.in > > So what's the preferred solution? IMO, BUILD|HOST_CC etc. are hacks to "tunnel" a subset of build-system settings into package configurations. They are only applicable to very simple configuration cases/packages, which do not need to apply both build-system and host-system autoconf checks. Ralf