automake
[Top][All Lists]
Advanced

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

Re: Change a flag for a specific file


From: Sylvestre Ledru
Subject: Re: Change a flag for a specific file
Date: Wed, 11 Oct 2006 16:35:49 +0200

Le lundi 07 août 2006 à 15:39 +0200, Ralf Wildenhues a écrit :

> * Sylvestre Ledru wrote on Mon, Aug 07, 2006 at 03:17:56PM CEST:
> > 
> If it is even important to you to have _only_ one file compiled with
> this flag, say bar.f, while all the others do not get this flag, you
> could make the compilation of bar.f special by putting it in a (not
> installed) library.  For example:
>   bin_PROGRAMS = foo
>   foo_SOURCES = foo.f
>   foo_LDADD = libdummy.a
>   noinst_LIBRARIES = libdummy.a
>   libdummy_a_SOURCES = bar.f
>   libdummy_a_FCFLAGS = -O0
Sorry for bothering you again. (I promise that if we have the
opportunity to meet each other, I will pay you a beer (at least one)) !

I come back on this point because I have been faced on optimisation
issue on some plateform and I switched everything with libtool.

Here is what I did :
noinst_LTLIBRARIES = libdummy-lapack.la
libdummy_lapack_la_SOURCES = dlamch.f
libdummy_lapack_la_FFLAGS = -O0

This solution gives me : 
/bin/sh ../../libtool --tag=F77 --mode=compile gfortran -O0 -O2 -g -Wall
-I/home/sylvestre/dev/scilab5/modules/core/includes -c -o
libdummy_lapack_la-dlamch.lo `test -f 'dlamch.f' || echo './'`dlamch.f
libtool: compile:  gfortran -O0 -O2 -g -Wall
-I/home/sylvestre/dev/scilab5/modules/core/includes -c dlamch.f  -fPIC
-o .libs/libdummy_lapack_la-dlamch.o

As you can see, there are to -O option with different values.

I tried also this command :
libdummy_lapack_la_FFLAGS "`echo $(FFLAGS)| sed -e 's|-O[0-9+]|-O0|'`"
but it produces the same result.

In the Makefile produced, I can see why there is an error : 

libdummy_lapack_la-dlamch.lo: dlamch.f
        $(LIBTOOL) --tag=F77 --mode=compile $(F77) $(libdummy_lapack_la_FFLAGS)
$(FFLAGS) -c -o libdummy_lapack_la-dlamch.lo `test -f 'dlamch.f' || echo
'$(srcdir)/'`dlamch.f

It reuses $(FFLAGS).

I am using automake 1.9.6, autoconf 2.60a and libtool 2.1a.

What I am doing wrong this time ? :p

Sylvestre





reply via email to

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