automake
[Top][All Lists]
Advanced

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

Re: dynamic selection of linker


From: Christopher Hulbert
Subject: Re: dynamic selection of linker
Date: Tue, 9 Feb 2010 14:59:38 -0500

On Tue, Feb 9, 2010 at 2:23 PM, Daily, Jeff A <address@hidden> wrote:
>> > > > But regardless of whether NOFORT is true, the Fortran linker is
>> > > > always chosen.  What should I be doing?  Thanks.
>> > >
>> > > Override FCLD (if Makefile-global is acceptable) or
>> > > libtest_la_LINK.
>> > >
>> >
>> > Just to clarify, I'm using F77 and libtool.  After looking at one of
>> > the automake-generated Makefiles, I would need to set F77LINK=$(LINK)
>> > in this case, right?
>>
>> That's another possibility for makefile-global override, yes.
>>
>> Cheers,
>> Ralf
>
> When I conditionally set F77LINK=$(LINK), automake complains.
> # Makefile.am snippet
> if NOFORT
> F77LINK = $(LINK)
> endif
>
> automake: F77LINK was already defined in condition NOFORT, which is included 
> in condition TRUE ...
> Makefile.am: 2 ... `F77LINK` previously defined here
>
> Although inadvisable, I thought the Makefile.am could override whatever it 
> wanted, without warning.  See 23.1 Extending Automake Rules in the automake 
> manual.
>
> If I remove the AM_CONDITIONAL use and simply have F77LINK = $(LINK), 
> automake no longer complains.  This doesn't seem correct.  In any case, I do 
> need to conditionalize this assignment.  For example, I'm not quite sure how 
> I could use AC_SUBST in this case in order to avoid the use of the 
> conditional.  Something to the effect of AC_SUBST([F77LINK], [[$(LINK)]]), if 
> you know what I'm trying to get at here.  (I apologize, I don't know what you 
> meant by Makefile-global, if there is some other means of accomplishing what 
> I want.)

I have a case where sometimes I want to compile fortran code with a C
interface, and sometimes I do not. In this case, I ran into the linker
problem, and I ended up substituting in the configure script as you
mention. Here is a snippet of what I do in configure.ac. In this case
I am using FCLINK because I am not using fortran 77.

dnl
dnl Without this, the linker line is incorrect on platforms without a fortran
dnl compiler even if we are not using fortran sources
dnl
if test "x$enable_fortran" != "xyes" -a "x$enable_seke" != "xyes"; then
  FCLINK='$(LINK)'
else
  FCLINK='$(LIBTOOL) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS)
$(AM_LDFLAGS) $(LDFLAGS) -o $@'
fi
AC_SUBST(FCLINK)


>
> Thanks,
> Jeff
>
>
>




reply via email to

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