+Wed Feb 7 18:00:29 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * automake.in (handle_source_transform): All dep_files are
+ relative to $(srcdir).
+ (handle_libraries): Ditto.
+ (scan_configure): Test for AC_PROG_INSTALL as well as
+ fp_PROG_INSTALL. Don't error here.
+ (seen_prog_install): Now global.
+ (scripts_installed): New global.
+ (handle_scripts): Set it.
+ Give error if appropriate install macro not seen.
+ (handle_subdirs): Ensure $seen_gettext before requiring
+ gettext-specific files.
+
+ From Jim Meyering:
+ * automake.in (handle_source_transform): Use \W when quoting
+ regexp. When blah_SOURCES not explicitly defined, still create
+ entry in %deps.
+ * depend.am ($(srcdir)/.deps/%.P): Don't use \< in regexp.
+ * subdirs.am (maintainer-clean-recursive): Now depends on
+ $(CONFIG_HEADER) and Makefile.
+
+ * automake.in (handle_source_transform): Skip macro references.
+
Mon Feb 5 14:58:58 1996 Tom Tromey <tromey@creche.cygnus.com>
* automake.in (handle_texinfo): Include "rm" when deleting files.
New in 0.29:
-* Bug fixes
+* Many bug fixes
* More sophisticated configure.in scanning; now understands ALLOCA and
LIBOBJS directly, handles AC_CONFIG_HEADER more precisely, etc.
* TEXINFOS and MANS now obsolete; use info_TEXINFOS and man_MANS instead.
* CONFIG_HEADER variable now obsolete
* Can handle multiple Texinfo sources
* Allow hierarchies deeper than 2. From Gord Matzigkeit.
+* HEADERS variable no longer needed; now can put .h files directly into
+ foo_SOURCES variable.
\f
New in 0.28:
* Added --gnu and --gnits options
Handle MAINT_CHARSET. Use recode in dist target. Handle dist-zoo and
dist-zip.
+If AC_PATH_X given, add extra stuff to generated Makefile.in.
+
Add support for html via an option. Use texi2html. Use
"html_TEXINFOS", and htmldir = .../html. Include html files in
distribution. Also allow "html_DATA", for raw .html files.
a potential bug: configure puts "blah.o" into LIBOBJS, thus implying
these files can't be de-ansified. Not a problem?
+consider automatically adding -I$(srcdir) to INCLUDES.
+
In general most .am files should be merged into automake. For
instance all the "clean" targets could be merged by keeping lists of
things to be removed. This would be a lot nicer looking. Note that
'maintainer-clean' should "rm -rf .deps". Ditto distclean
Should look for clean-local targets in Makefile.am.
-If 'foo' is in SCRIPTS, and 'foo.in' exists, generate code to rebuild
-by running configure. Also, ensure that 'foo' is listed in AC_OUTPUT
-line.
-
Think about writing a small tool to guess what the local Makefile.am
should look like.
check
look in configure.in's AC_OUTPUT command and include those files in
-distribution. Or consider new CONFIGURED_FILES macro that lists files
-generated by config.status.
+distribution. Make sure to support the ":" notation. automatically
+regenerate all files listed in AC_OUTPUT line.
Auto-distribute "ChangeLog.[0-9]+"?
foo_SOURCES = a.c b.c
Is this worth implementing?
-Get the list of Makefiles to create from configure.in AC_OUTPUT
-if none are given.
- [ right now we look for any Makefile.am's lying around
- I think this is better, because it allows use of subdirs
- which don't use automake -- eg, stuff from gettext ]
-
Should libexec programs have the name transform done on them?
Order the output rules sensibly, so FOO_SOURCES and FOO_OBJECTS are
# Whether ud_GNU_GETTEXT has been seen in configure.in.
$seen_gettext = 0;
+# 1 if AC_PROG_INSTALL seen, 2 if fp_PROG_INSTALL seen.
+$seen_prog_install = 0;
+
+# 1 if any scripts installed, 0 otherwise.
+$scripts_installed = 0;
+
\f
&initialize_global_constants;
}
}
+&am_conf_error ($scripts_installed ? 'fp_PROG_INSTALL' : 'AC_PROG_INSTALL'
+ . " must be used in configure.in")
+ unless $seen_prog_install > $scripts_installed;
+
exit $exit_status;
{
local ($one_file, $obj) = @_;
local ($objpat) = $obj;
- $objpat =~ s/([.\$])/\\\1/g;
+ $objpat =~ s/(\W)/\\\1/g;
# Look for file_SOURCES and file_OBJECTS.
if (defined $contents{$one_file . "_SOURCES"})
local (@result) = ();
foreach (@files)
{
- # Just skip header files.
+ # Skip header files.
next if /\.h$/;
+ # Skip things that look like macro references.
+ next if /^\$\(.*\)$/;
+ next if /^\$\{.*\}$/;
if (/^(.*)\.[yl]$/)
{
# Transform .o or $o file into .P file (for automatic
# dependency code).
s/$objpat$/.P/g;
- $dep_files{'.deps/' . $_} = 1;
+ $dep_files{'$(srcdir)/.deps/' . $_} = 1;
}
&pretty_print ($one_file . "_OBJECTS =", '', @result);
. $obj . "\n");
push (@sources, $one_file . '.c');
push (@objects, $one_file . $obj);
+ $dep_files{'$(srcdir)/.deps/' . $one_file . '.P'} = 1;
}
if (defined $contents{'CONFIG_HEADER'})
if ($iter ne 'alloca.c')
{
($rewrite = $iter) =~ s/\.c$/.P/;
- $dep_files{'.deps/' . $rewrite} = 1;
+ $dep_files{'$(srcdir)/.deps/' . $rewrite} = 1;
&require_file ($NORMAL, $iter);
}
}
{
&am_error ("\@ALLOCA\@ seen but \`AC_FUNC_ALLOCA' not in \`configure.in'")
if ! defined $libsources{'alloca.c'};
- $dep_files{'.deps/alloca.P'} = 1;
+ $dep_files{'$(srcdir)/.deps/alloca.P'} = 1;
&require_file ($NORMAL, 'alloca.c');
}
}
# Handle scripts.
sub handle_scripts
{
- &am_install_var ('-clean',
- 'scripts', 'SCRIPTS',
- 'bin', 'sbin', 'libexec', 'noinst');
+ # FIXME can't determine if these scripts are really being
+ # installed or not.
+ $scripts_installed = &am_install_var ('-clean',
+ 'scripts', 'SCRIPTS',
+ 'bin', 'sbin', 'libexec', 'noinst');
}
# Search a file for a "version.texi" Texinfo include. Return the name
&am_conf_error
("ud_GNU_GETTEXT in configure.in but \`po' not in SUBDIRS")
- if $contents{'SUBDIRS'} !~ /\bpo\b/;
+ if $seen_gettext && $contents{'SUBDIRS'} !~ /\bpo\b/;
&am_conf_error
("ud_GNU_GETTEXT in configure.in but \`intl' not in SUBDIRS")
- if $contents{'SUBDIRS'} !~ /\bintl\b/;
+ if $seen_gettext && $contents{'SUBDIRS'} !~ /\bintl\b/;
- &require_file ($NORMAL, 'ABOUT-NLS');
+ &require_file ($NORMAL, 'ABOUT-NLS') if $seen_gettext;
return if ! defined $contents{'SUBDIRS'};
%libsources = ();
local ($in_ac_output, @make_list) = 0;
- local ($seen_prog_install) = 0;
local ($seen_arg_prog) = 0;
local ($seen_canonical) = 0;
while (<CONFIGURE>)
# we only really require AC_ARG_PROGRAM if any program is
# installed.
$seen_make_set = 1 if /AC_PROG_MAKE_SET/;
- $seen_prog_install = 1 if /fp_PROG_INSTALL/;
+ $seen_prog_install = 1 if ! $seen_prog_install && /AC_PROG_INSTALL/;
+ $seen_prog_install = 2 if ! $seen_prog_install && /fp_PROG_INSTALL/;
$seen_arg_prog = 1 if /AC_ARG_PROGRAM/;
}
&require_file ($NORMAL, 'config.guess', 'config.sub')
if $seen_canonical;
- &am_conf_error ("fp_PROG_INSTALL must be used in configure.in")
- unless $seen_prog_install;
&am_conf_error ("AC_ARG_PROGRAM must be used in configure.in")
unless $seen_arg_prog;
AC_SUBST(VERSION)
@end example
-If your @file{configure.in} uses @samp{AC_CONFIG_HEADER}, then in each
-directory you should define the @samp{CONFIG_HEADER} variable to hold
-the name of the header.
-
-For instance, in cpio's @file{src/Makefile.am}, we see:
-
-@example
-CONFIG_HEADER = ../config.h
-@end example
-
-
@code{automake} also assumes that your @file{configure} script will
define the variable @samp{INSTALL_SCRIPT}. Until this is incorporated
in @code{autoconf}'s @samp{AC_PROG_INSTALL} macro, you can use this
])
@end example
+@code{automake} requires this macro if you install any scripts.
+Otherwise only @code{AC_PROG_INSTALL} is required.
@code{automake} also assumes your @file{configure.in} calls
@samp{AC_ARG_PROGRAM}.
In this simple case, the resulting @file{Makefile.in} will contain code
to generate a program named @code{hello}. The variable
-@samp{@var{prog}_SOURCE} is used to specify which source files get built
+@samp{@var{prog}_SOURCES} is used to specify which source files get built
into an executable:
@example
-hello_SOURCE = hello.c
+hello_SOURCES = hello.c
@end example
This causes @file{hello.o} to be built from @code{hello.c} at compile
Multiple programs can be built in a single directory -- simply list them
all in the @samp{PROGRAMS} definition. Multiple programs can share a
-single source file. The source file must be listed in each ``_SOURCE''
+single source file. The source file must be listed in each ``_SOURCES''
definition.
Sometimes it is useful to determine the programs that are to be built at
$(srcdir)/.deps/%.P: $(srcdir)/%.c
@echo "mkdeps $< > $@"
-## Need \< in regexp because otherwise when srcdir=. too much can be
-## matched. Also we regexp-quote srcdir because "." is a matching
-## operator, and commonly appears in filenames.
- @re=`echo 's,\<$(srcdir),,g' | sed 's/\./\\./g'`; \
- $(MKDEP) $< | sed $$re > $@-tmp
+## Use funny regexp because otherwise too much can be matched when
+## srcdir begins with ".". Can't use \< since sed doesn't recognize
+## "." as a word start. Regexp-quote srcdir because "." is a matching
+## operator which commonly appears in filenames.
+ @re=`echo 's,^$(srcdir)/*,,g;s, $(srcdir)/*, ,g' | sed 's,\.,\\\\.,g'`; \
+ $(MKDEP) $< | sed "$$re" > $@-tmp
@if test -n "$o"; then \
sed 's/\.o:/$$o:/' $@-tmp > $@; \
rm $@-tmp; \
$(srcdir)/.deps/%.P: $(srcdir)/%.c
@echo "mkdeps $< > $@"
-## Need \< in regexp because otherwise when srcdir=. too much can be
-## matched. Also we regexp-quote srcdir because "." is a matching
-## operator, and commonly appears in filenames.
- @re=`echo 's,\<$(srcdir),,g' | sed 's/\./\\./g'`; \
- $(MKDEP) $< | sed $$re > $@-tmp
+## Use funny regexp because otherwise too much can be matched when
+## srcdir begins with ".". Can't use \< since sed doesn't recognize
+## "." as a word start. Regexp-quote srcdir because "." is a matching
+## operator which commonly appears in filenames.
+ @re=`echo 's,^$(srcdir)/*,,g;s, $(srcdir)/*, ,g' | sed 's,\.,\\\\.,g'`; \
+ $(MKDEP) $< | sed "$$re" > $@-tmp
@if test -n "$o"; then \
sed 's/\.o:/$$o:/' $@-tmp > $@; \
rm $@-tmp; \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
+maintainer-clean-recursive: $(CONFIG_HEADER) Makefile
for subdir in $(SUBDIRS); do \
target=`echo $@ | sed s/-recursive//`; \
echo making $$target in $$subdir; \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive \
mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
+maintainer-clean-recursive: $(CONFIG_HEADER) Makefile
for subdir in $(SUBDIRS); do \
target=`echo $@ | sed s/-recursive//`; \
echo making $$target in $$subdir; \