This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: configure scripts and cross-compiling
- To: aoliva at redhat dot com
- Subject: Re: configure scripts and cross-compiling
- From: pkurpis at keck dot hawaii dot edu (Peter Kurpis)
- Date: Wed, 23 May 2001 15:04:30 -1000 (HST)
- Cc: gcc-help at gcc dot gnu dot org, bug-autoconf at gnu dot org
> On May 23, 2001, Mike Culbertson <mikec@infoleak.com> wrote:
>
> > Could somone specify what it is generic configure script would have to
> > find in order to think that the compiler I am using (gcc 2.95-3 on
> > sun/sparc solaris 8) is a cross-compiler?
>
> It would try to run a `main(){ exit(0); }' program built with that
> compiler and be fail.
I got stung by this heuristic for g++ on solaris, though. The program
failed, so configure assumed it was a cross-compiler, but the problem
turned out to be that an otherwise okay *native* executable wasn't
finding libstdc++.so (because ld doesn't hardwire the appopriate runtime
search path on solaris).
BTW, the autoconf macro AC_PROG_CXX has this problem, so I am taking this
opportunity to CC the approprate reflector.
BTW (again), if LD_LIBRARY_PATH or LD_RUN_PATH isn't set to point to libstdc++.so
(which it isn't by design in my environment), I've been getting g++
to tell me where the libstdc++.so is in an environment-independent way
in configure.in by using the rather convoluted:
`$CXX --print-search-dirs | sed -n 's/^install: \(.*\)\/lib\/.*$/\1\/lib/p'`
Note in a makefile, you need to double-up on the second $ character.