On Fri, 09 Nov 2007 11:50:56 -0500, Ralf Wildenhues
<[EMAIL PROTECTED]> wrote:
Hi Ralf,
Hello Brad,
* Brad Larsen wrote on Fri, Nov 09, 2007 at 05:44:37PM CET:
In the distribution, I want to include only the .in files and not the
derived files. When installing, I want to install only the derived
files
and not the .in files. So far my Makefile.am looks like this:
[snip]
# runme doesn't get included in the distribution.
runtemplate_DATA = runme
DISTCLEANFILES = runme
You don't need the DISTCLEANFILES line.
# all the .in files are included in the distribution. But they are also
installed (because of _DATA, I presume).
dist_runtemplate_DATA = \
[snip]
runme.in \
Just remove runme.in from this list. It will be distributed because you
said
AC_CONFIG_FILES([runme])
in configure.ac. The manual explains both the distribution and the
cleaning aspect in this chapter:
<http://sources.redhat.com/automake/automake.html#Requirements>
Cheers,
Ralf
I guess I wasn't clear enough. In section 4.7.2 of the autoconf manual,
it says:
--------------------
Most of these variables have values that rely on prefix or exec_prefix. It
is deliberate that the directory output variables keep them unexpanded:
typically [EMAIL PROTECTED]@' will be replaced by `${prefix}/share', not
`/usr/local/share'.
This behavior is mandated by the GNU coding standards, so that when the
user runs:
`make'
she can still specify a different prefix from the one specified to
configure, in which case, if needed, the package shall hard code
dependencies corresponding to the make-specified prefix.
`make install'
she can specify a different installation location, in which case the
package must still depend on the location which was compiled in (i.e.,
never recompile when `make install' is run). This is an extremely
important feature, as many people may decide to install all the files of a
package grouped together, and then install links from the final locations
to there.
In order to support these features, it is essential that datadir remains
being defined as `${prefix}/share' to depend upon the current value of
prefix.
A corollary is that you should not use these variables except in Makefiles.
[snip]
Similarly you should not rely on AC_OUTPUT_FILES to replace datadir and
friends in your shell scripts and other files, rather let make manage
their replacement. For instance Autoconf ships templates of its shell
scripts ending with `.in' [...]
--------------------
That's why I'm having the makefile (which autoconf generates) do the
substitution rather than calling AC_OUTPUT_FILES([runme]) or
AC_CONFIG_FILES([runme]). (I tried the latter strategies without
success---the substitutions would end up with '${prefix}' or
'${exec_prefix}' in them, which would probably be undefined when runme is
actually executed. And since I am using a makefile to generate the
derived script 'runme', 'make distclean' doesn't remove it unless I add it
to DISTCLEANFILES---otherwise 'make distcheck' fails.
Cheers,
Brad Larsen