On Tue, 23 Mar 2004, Norman Gray wrote:
> Tim,
>
> On Tue, 23 Mar 2004, Tim Jenness wrote:
>
> > My current thoughts involve the existence of a _err.in file which
> > has the non-EMS part of the include file and for this .in file to be
> > concatenated with the messgen output. There are a number of ways to
> > proceed after that:
>
> A minor point: I think that the extension .in is probably best avoided
> -- in this context it most strongly suggests a file which is edited by
> ./configure, looking for @...@ strings. The configure.ac file used to
> be called configure.in, and had its name changed precisely because it
> was deemed confusing.
I used _ext (e.g. CHR_ERR_ext and gwm_err.h_ext).
>
> > 1. Extend messgen to recognize the presence of a .in version and copy
> > that in to the output file before writing the EMS codes.
> >
> > 2. Change the autoconf MESSGEN generation code to spot the .in file
> > itself and do the concatentation after running messgen.
> >
> > 3. Do the concatenation explicitly in each Makefile.am (but this would
> > probably require messgen to create an intermediate file rather than the
> > final output file).
>
> My first thought is that, for the present, (3) is the best. If this
> isn't a very common thing to have to do, then it's probably best to
> keep the magic confined to the component with the problem, rather than
> packing even more magic into automake. Even if it were to be
> necessary in a couple of components, I'm slightly reluctant to have
> the automake boilerplate handling pathological cases.
>
> I think that option (1) is probably best, if you can work out a sensible
> syntax for it (perhaps xxx_msg.extra?). And wouldn't it have to work for
> both Fortran and C (or are none of the Fortran cases so pathological?).
I have adopted (1). Patches to messgen now in CVS. You will need the new
version for GWM to build properly (what's the best way in the Makefile.am
to specify that gwm_err.h now has an additional dependency?)
I went for xxx_ext since that seems to be unique and clearly related to
the output file. It also gives us a different file for the fortran and the
C versions. Seems to work fine. It currently does not put extra boiler
plate into the output file with "---- DO NOT EDIT ----" warnings. It
probably should (but I then will need to make sure my comments are in the
correct language).
I will take a look at CHR since that can now be updated to do the correct
thing using messgen.
--
Tim Jenness
JAC software
http://www.jach.hawaii.edu/~timj
|