From 50b99ee0529832220ef6f9f7dfaa01067a03935d Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Fri, 9 Feb 1996 05:02:29 +0000 Subject: [PATCH] Bug fixes. Handle AC_PATH_XTRA. Handle AC_OUTPUT : syntax --- ChangeLog | 16 ++++++++++++++++ NEWS | 4 ++++ TODO | 9 +-------- automake.in | 35 +++++++++++++++++++++++++++++++---- data.am | 5 ++++- header.am | 5 ++++- lib/am/data.am | 5 ++++- lib/am/header.am | 5 ++++- lib/am/scripts.am | 5 ++++- libraries.am | 5 ++++- programs.am | 5 ++++- scripts.am | 5 ++++- 12 files changed, 84 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5c842b810..63e9736b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,23 @@ Thu Feb 8 15:30:29 1996 Tom Tromey + * automake.in (handle_configure): Handle AC_OUTPUT ":" syntax. + + From Jim Meyering: + * libraries.am (install-@DIR@LIBRARIES): Depend on all, not + (@DIR@_LIBFILES). + * header.am (install-@DIR@HEADERS): Depend on all, not + $(@DIR@_HEADERS). + * data.am (install-@DIR@DATA): Depend on all, not $(@DIR@_DATA). + * scripts.am (install-@DIR@SCRIPTS): Depend on all, not + $(@DIR@_SCRIPTS). + * programs.am (install-@DIR@PROGRAMS): Depend on all, not + $(@DIR@_PROGRAMS). + * automake.in (initialize_per_input): Initialize $use_dependencies. + ($seen_path_xtra): New variable. + (scan_configure): Look for AC_PATH_XTRA. + (get_object_extension): Add variables to output if X seen. Thu Feb 8 10:02:45 1996 Greg A. Woods diff --git a/NEWS b/NEWS index 4e9ad342e..578a8876e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +New in 0.30: +* configure.in scanner knows about AC_PATH_XTRA +* + New in 0.29: * Many bug fixes * More sophisticated configure.in scanning; now understands ALLOCA and diff --git a/TODO b/TODO index c765d8c34..f97b47652 100644 --- a/TODO +++ b/TODO @@ -4,15 +4,11 @@ Top priorities: This will allow the callers to be a little smarter. * Rewrite clean targets. -Make HEADERS obsolete - Think about ways to make automake fit better with Cygnus-style trees. 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. @@ -26,6 +22,7 @@ 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. +ditto path to config.h In general most .am files should be merged into automake. For instance all the "clean" targets could be merged by keeping lists of @@ -57,10 +54,6 @@ Consider supporting syntax from autoconf "derived:source", eg: Write autoconf macro to do all work necessary for automake. Eg define PACKAGE, VERSION, etc. -Change glob pattern to look for to '*/Makefile*.am', so that gettext's -po directory can use a Makefile.in.am (and generate Makefile.in.in) - -Should 'distclean' remove $(SCRIPTS)? 'maintainer-clean' should "rm -rf .deps". Ditto distclean Should look for clean-local targets in Makefile.am. diff --git a/automake.in b/automake.in index 2d6c50356..d682a887a 100755 --- a/automake.in +++ b/automake.in @@ -103,6 +103,9 @@ $seen_prog_install = 0; # 1 if any scripts installed, 0 otherwise. $scripts_installed = 0; +# Whether AC_PATH_XTRA has been seen in configure.in +$seen_path_xtra = 0; + &initialize_global_constants; @@ -119,6 +122,7 @@ die "automake: no \`Makefile.am' found or specified\n" # Now do all the work on each file. foreach $am_file (@input_files) { + # FIXME should support the AC_OUTPUT ":" syntax here. if (! -f ($am_file . '.am')) { &am_error ('no such file'); @@ -341,12 +345,22 @@ sub get_object_extension { if (! $dir_holds_sources) { - # Boilerplate. $output_vars .= &file_contents ('compile-vars'); $output_rules .= &file_contents ('compile'); &push_phony_cleaners ('compile'); + # If using X, include some extra variable definitions. NOTE + # we don't want to force these into CFLAGS or anything, + # because not all programs will necessarily use X. + if ($seen_path_xtra) + { + $output_vars .= ("X_CFLAGS = \@X_CFLAGS\@\n" + . "X_LIBS = \@X_LIBS\@\n" + . "X_EXTRA_LIBS = \@X_EXTRA_LIBS\@\n" + . "X_PRE_LIBS = \@X_PRE_LIBS\@\n"); + } + # Check for automatic de-ANSI-fication. $dir_holds_sources = '.o'; push (@suffixes, '.c', '.o'); @@ -1144,7 +1158,7 @@ sub handle_configure # Now look for other files in this directory which must be remade # by config.status, and generate rules for them. - local ($file, $local); + local ($file, $local, $input); foreach $file (@other_input_files) { # Skip files not in this directory, any Makefile, and the @@ -1154,9 +1168,21 @@ sub handle_configure ($local = $file) =~ s/^.*\///; next if $local eq 'Makefile'; - # FIXME support ":" syntax of AC_OUTPUT here. + if ($local =~ /^(.*):(.*)$/) + { + # This is the ":" syntax of AC_OUTPUT. + $input = $2; + $local = $1; + } + else + { + # Normal usage. + $input = $local . '.in'; + } + # FIXME when using autoconf ":" syntax, should we set CONFIG_FILES + # to $local:$input? $output_rules .= ($local . ': ' - . '$(top_builddir)/config.status ' . $local . ".in\n" + . '$(top_builddir)/config.status ' . $input . "\n" . "\t" . 'cd $(top_srcdir) && CONFIG_FILES=' . ($relative_dir eq '.' ? '' : '$(subdir)/') @@ -1533,6 +1559,7 @@ sub scan_configure } $seen_canonical = 1 if /AC_CANONICAL_(HOST|SYSTEM)/; + $seen_path_xtra = 1 if /AC_PATH_XTRA/; # Some things required by Automake. FIXME we only really # require fp_PROG_INSTALL if some scripts are installed. And diff --git a/data.am b/data.am index aa445f9ef..f8bbab266 100644 --- a/data.am +++ b/data.am @@ -15,7 +15,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -install-@DIR@DATA: $(@DIR@_DATA) +## +## Can't depend on $(@DIR@_DATA) here; otherwise conditional +## data will always be built. +install-@DIR@DATA: all $(top_srcdir)/mkinstalldirs $(@DIR@dir) for p in $(@DIR@_DATA); do \ $(INSTALL_DATA) $(srcdir)/$$p $(@DIR@dir)/$$p; \ diff --git a/header.am b/header.am index bc2575048..4c0409edc 100644 --- a/header.am +++ b/header.am @@ -15,7 +15,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -install-@DIR@HEADERS: $(@DIR@_HEADERS) +## +## Can't depend on $(@DIR@_HEADERS) here; otherwise conditional +## headers will always be built. +install-@DIR@HEADERS: all $(top_srcdir)/mkinstalldirs $(@DIR@dir) for p in $(@DIR@_HEADERS); do \ $(INSTALL_DATA) $(srcdir)/$$p $(@DIR@dir)/$$p; \ diff --git a/lib/am/data.am b/lib/am/data.am index aa445f9ef..f8bbab266 100644 --- a/lib/am/data.am +++ b/lib/am/data.am @@ -15,7 +15,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -install-@DIR@DATA: $(@DIR@_DATA) +## +## Can't depend on $(@DIR@_DATA) here; otherwise conditional +## data will always be built. +install-@DIR@DATA: all $(top_srcdir)/mkinstalldirs $(@DIR@dir) for p in $(@DIR@_DATA); do \ $(INSTALL_DATA) $(srcdir)/$$p $(@DIR@dir)/$$p; \ diff --git a/lib/am/header.am b/lib/am/header.am index bc2575048..4c0409edc 100644 --- a/lib/am/header.am +++ b/lib/am/header.am @@ -15,7 +15,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -install-@DIR@HEADERS: $(@DIR@_HEADERS) +## +## Can't depend on $(@DIR@_HEADERS) here; otherwise conditional +## headers will always be built. +install-@DIR@HEADERS: all $(top_srcdir)/mkinstalldirs $(@DIR@dir) for p in $(@DIR@_HEADERS); do \ $(INSTALL_DATA) $(srcdir)/$$p $(@DIR@dir)/$$p; \ diff --git a/lib/am/scripts.am b/lib/am/scripts.am index 39199d719..f542206aa 100644 --- a/lib/am/scripts.am +++ b/lib/am/scripts.am @@ -15,7 +15,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS) +## +## Can't depend on $(@DIR@_SCRIPTS) here; otherwise conditional +## scripts will always be built. +install-@DIR@SCRIPTS: all $(top_srcdir)/mkinstalldirs $(@DIR@dir) for p in $(@DIR@_SCRIPTS); do \ if test -f $$p; then \ diff --git a/libraries.am b/libraries.am index ab4c9c19e..476226639 100644 --- a/libraries.am +++ b/libraries.am @@ -15,7 +15,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -install-@DIR@LIBRARIES: $(@DIR@_LIBFILES) +## +## Can't depend on $(@DIR@_LIBRARIES) here; otherwise conditional +## libraries will always be built. +install-@DIR@LIBRARIES: all $(top_srcdir)/mkinstalldirs $(@DIR@dir) for p in $(@DIR@_LIBFILES); do \ if test -f $$p; then \ diff --git a/programs.am b/programs.am index 26379ca77..440df599f 100644 --- a/programs.am +++ b/programs.am @@ -15,7 +15,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -install-@DIR@PROGRAMS: $(@DIR@_PROGRAMS) +## +## Can't depend on $(@DIR@_PROGRAMS) here; otherwise conditional +## executables will always be built. +install-@DIR@PROGRAMS: all $(top_srcdir)/mkinstalldirs $(@DIR@dir) for p in $(@DIR@_PROGRAMS); do \ if test -f $$p; then \ diff --git a/scripts.am b/scripts.am index 39199d719..f542206aa 100644 --- a/scripts.am +++ b/scripts.am @@ -15,7 +15,10 @@ ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA ## 02111-1307, USA. -install-@DIR@SCRIPTS: $(@DIR@_SCRIPTS) +## +## Can't depend on $(@DIR@_SCRIPTS) here; otherwise conditional +## scripts will always be built. +install-@DIR@SCRIPTS: all $(top_srcdir)/mkinstalldirs $(@DIR@dir) for p in $(@DIR@_SCRIPTS); do \ if test -f $$p; then \ -- 2.11.4.GIT