configure scripts and cross-compiling
Peter Kurpis
pkurpis@keck.hawaii.edu
Wed May 23 18:04:00 GMT 2001
> 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.
More information about the Gcc-help
mailing list