[Top][All Lists]

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

Re: distributing files generated by configure

From: Raja R Harinath
Subject: Re: distributing files generated by configure
Date: 22 Dec 2000 16:24:56 -0600
User-agent: Gnus/5.090001 (Oort Gnus v0.01) Emacs/21.0.93


"Derek R. Price" <address@hidden> writes:
> I have several files which are generated by configure that I want three
> things to happen to.
> 1) Created in $(srcdir) 

Then they shouldn't be created by 'configure' :-)

> rather than $(builddir) or, alternately and second best, targets
> added which make the $(srcdir) counterparts dependent on the
> $(builddir) versions.  I don't like option 2 because a lot of
> diffing and touching will have to be going on to avoid updating
> unchanged files.  2) Removed from distclean 3) Added to dist
> The reason for this is to allow platforms which can't run configure
> (Win32) to checkout from our CVS repository and build as correctly as if
> they had grabbed a generated distribution.  The premise is that any file
> checked into CVS should be in $(srcdir) and should not be removed from
> $(srcdir) by distclean.  Our version.c file is an example of one of
> these files - it is now generated with configure based on the

Here's what's in of autoconf's latest CVS version.

  ## ------------------ ##
  ## Maintainer rules.  ##
  ## ------------------ ##

  ## acversion.m4.  ##

  # - acversion.m4 needs to be updated only once, since it depends on
  #, not on the results of a 'configure' run.
  # - It is guaranteed (with GNU Make) that when the version in
  #   is changed, acversion.m4 is built only after the new version number is
  #   propagated to the Makefile.  (Libtool uses the same guarantee.)

  acversion.m4: $(srcdir)/ $(srcdir)/
          sed 's,@VERSION\@,$(VERSION),g' $(srcdir)/ 
          mv acversion.tm4 $(srcdir)/acversion.m4

I think this exactly mirrors your requirements for version.c and

The idea is that only the maintainer needs to run these rules, since
every 'configure' run with that package will generate the same file,
anyway.  That's why I said that these probably shouldn't be created by
configure.  The only downside being the necessity of an explicit rule
with a 'sed' command, which I don't see as being too onerous.

BTW, why do you need to 'configure' or 'sed' substitute a version
number into a .c file -- you already have config.h which defines the
symbol 'VERSION' to the version number string.

- Hari
Raja R Harinath ------------------------------ address@hidden
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash

reply via email to

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