[Top][All Lists]
[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: |
Thu, 12 Oct 2006 11:59:55 +0200 |
Le mercredi 11 octobre 2006 à 16:46 +0200, Ralf Wildenhues a écrit :
> * Sylvestre Ledru wrote on Wed, Oct 11, 2006 at 04:35:49PM CEST:
> >
> > 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.
>
> Yep, the one from $(libdummy_lapack_la_FFLAGS) and the one from
> $(FFLAGS).
>
> A good idea is to view the per-target flags as an override for the AM_*
> flags, and view the unadorned flags as user-owned ("you" are the
> developer, the person issuing ./configure is the user in this case).
> You should never change the latter.
I agree that it is important that the user could change this flags.
However, I have to turn off the optimisation on a few files because it
even causes problems with Linux. It is really something that I have to
impose to the user.
> Whenever you need to override AM_*FLAGS, do that with per-target flags.
It is what I do with my libdummy-lapack.la but I don't get how I can remove the
optimisation just for this lib. There is still the
optimisation from FFLAGS.
> I should add that there is a bug in Automake 1.9.6 in that for linking,
> these above-mentioned semantics are not coherent. This has been fixed
> in 1.9b and will be fixed in Automake 1.10:
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/automake/NEWS?rev=1.295&content-type=text/x-cvsweb-markup&cvsroot=automake
>
> (If that bothers you in what you're trying to do, please report back.)
ok, I will !
>
> Further note that it often comes handy to compute some sensible value
> for AM_FFLAGS from some configure tests. For that, you can do something
> like
>
> AM_FFLAGS=$some_value
> AC_SUBST([AM_FFLAGS])
>
> in the configure.ac file.
OK, if I understand well (which is not sure), in the configure.ac where
I specified some flags (mainly defined in CFLAGS, FFLAGS), I should work
with AM_FFLAGS instead ?
Do you have a good example of program using "perfectly" autotools ? (I
am not convinced by the example coreutils and I didn't see many good
examples.. each project is using autotools a different way).
Cheers
Sylvestre