mknumeric_limits
Gabriel Dos Reis
gdr@codesourcery.com
Mon Feb 19 10:20:00 GMT 2001
Jeffrey A Law <law@redhat.com> writes:
| What's the point behind this code in mknumeric_limits:
|
| case `uname` in
| CYGWIN*)
| LDFLAGS='-nodefaultlibs -lcygwin -lc -lkernel32 -lgcc' ;;
| AIX*)
| case $CXX in
| *pthread*)
| LDFLAGS='-nodefaultlibs -lgcc -L/usr/lib/threads -lpthreads
| -lc_
| r /usr/lib/libc.a' ;;
| *)
| LDFLAGS='-nodefaultlibs -lgcc -lc' ;;
| esac
| ;;
| *)
| LDFLAGS='-nodefaultlibs -lgcc -lc' ;;
| esac
|
|
| First, it seems rather odd to be using "uname" like that, unless this code
| is supposed to be run on the build machine.
|
| Second, by using uname instead of a triplet, we lose the ability to
| select behavior on the triplet. This is important when you consider
| systems like the PA which have two completely different toolchains that
| can not interoperate with each other.
Patches are welcome.
| Third, what's the purpose behind -nodefaultlibs,
mknumeric_limits runs a C++ program by invoking gcc, which
automgically will add '-lstdc++' (which we're in process of
builduing).
| ... then listing the libraries
| you want explicitly? If we're really just building something for the
| build system, why not let the compiler figure out what libraries need to
| be linked to create an executable?
Do you know of a better way to do it?
| The reason I'm looking at this code is I need to make it do something
| slightly different for the PA64 toolchain (but not for the PA32 toolchain)
| and there is no way you can tell which one you're using by running uname.
I welcome your suggestion to select the behaviour on the triplet.
-- Gaby
CodeSourcery, LLC http://www.codesourcery.com
More information about the Gcc
mailing list