autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I test if the GNU or Sun linker is used?


From: Russ Allbery
Subject: Re: How can I test if the GNU or Sun linker is used?
Date: Thu, 06 Aug 2009 20:04:00 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

"Dr. David Kirkby" <address@hidden> writes:
> Russ Allbery wrote:

>> It's a pain in the ass, but sadly the most robust thing for you to do
>> is to write configure probes that try to use the exact linker options
>> that you want to use and see if they work.

> I've done that. Sage will build ok on Solaris if gcc is configured to use
> GNU or Sun tools. It could break if a mix and Sun and GNU are used.

Well, I was meaning duplicate excatly the way that you would call the
linker in Sage, down to the path and everything.  So, for instance, if
you're doing the link step through the compiler, check the flag that way
in Autoconf as well.

It requires sometimes constructing rather complex test programs.

> Having thought about it more, just compiling a simple program
>
> main()
> {
> }
>
> as:
>
> gcc -Wl,-zallextract simple.c
>
> should return an error if the GNU linker is used, as it will not
> understand the -zallextract option. But it will not produce any error if
> gcc uses the Sun linker, since -zallextract is a valid option.

Yeah, exactly.

-- 
Russ Allbery (address@hidden)             <http://www.eyrie.org/~eagle/>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]