autoconf
[Top][All Lists]
Advanced

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

Re: How do I write this test?


From: Andrew W. Nosenko
Subject: Re: How do I write this test?
Date: Fri, 7 Aug 2009 16:38:25 +0300

On Fri, Aug 7, 2009 at 16:18, Andrew W.
Nosenko<address@hidden> wrote:
> On Fri, Aug 7, 2009 at 13:39, Dr. David Kirkby<address@hidden> wrote:
>> I'm trying to write a test, but find the documentation extremely sparse on
>> this.
>>
>> I wish to compile the following C program:
>>
>> main()
>> {
>> }
>>
>> using the compiler option "-Wl,-zextractall"
>>
>> and see if it returns 0 or 1.
>
> Assuming that under "if it returns 0 or 1" you mean link stage, you may try
>
> LDFLAGS_save=$LDFLAGS
> LDFLAGS="-Wl,-zextractall $LDFLAGS"
> AC_LINK_IFELSE(AC_LANG_PROGRAM([],[]),
>    [success=yes],
>    [success=no])
> LDFLAGS=$LDFLAGS_save
>
> if x$success = xyes; then ...
>
> But see below...
>
>>
>> That seems like a pretty simple thing to do, but I can't work out from the
>> docs how to do this.
>>
>> Dave
>>
>> PS, that should pass if the Sun linker is used by the compiler, which will
>> allow me to test if gcc is using the Sun linker or not. (I'll only perform
>> the test if the OS is Solaris and the C compiler is gcc).
>
> ... but are you sure that your test will _fail_ if 'ld' will be non-Sun ld?
> I especially tried to inject obviously non-existent option using '-Wl'
> interface and it was simple silently ignored on my FreeBSD-7.0 +
> gcc-4.3 + Gnu ld 2.15 (all compilation stages were passed just as if
> non-existent option would not be passed).

BTW #1: I may be wrong, but guess that you try to play with shared
libraries (guessed from linker flag).  Did you consider using libtool
instead of implementing all and any flawors and workarounds by hands?

BTW #2: indeed you need '-zextractall', not '-zallextract'?

-- 
Andrew W. Nosenko <address@hidden>




reply via email to

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