[Top][All Lists]

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

Re: How do I configure to run a program?

From: David Fang
Subject: Re: How do I configure to run a program?
Date: Wed, 2 Apr 2008 20:21:19 -0400 (EDT)

Don't use make to do this - just use autoconf, and let your configure
script deal with it:
svnrev=`svnversion .`
AC_CONFIG_FILES([Makefile ... poll.spec)

Now create a file called that contains an exact copy of your
existing poll.spec, but add the autoconf substitution variable, @svnrev@
where it make sense.

In a in the directory containing your poll.spec file, add

EXTRA_DIST = ... poll.spec

I use this trick all the time and it works great! In fact, I generate most
of my rpm and debian build scripts this way.

Thanks, but the problem with this solution is that I would have to rerun the
.configure step each time.  Forgetting to do that is as as easy as
forgetting to edit the spec file.

Doesn't AC_CONFIG_FILES automatically add regenerations rules to the Makefile? usually resembles something like:

# somewhere in
config-generated-file: []
        cd $(top-srcdir) && ./config.status config-generated-file

If the command run to generate it is some script (which is used by config.status), you should be able to append a dependency:

# to
config-generated-file: generating-script

Anytime config.status or your generating script changes, it should automatically be regenerated. (And if only your generating script changes (not, it won't re-run all of configure, just that output phase, config.status.)

And if you want the target to always be up-to-date,
add it to BUILT_SOURCES=, or all-local:, as others suggested.

I let 'make' take care of any dependencies, basically.



David Fang
Computer Systems Laboratory
Electrical & Computer Engineering
Cornell University
        -- (2400 baud? Netscape 3.0?? lynx??? No problem!)

reply via email to

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