]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
(require_file): New function.
authorTom Tromey <tromey@redhat.com>
Mon, 27 Nov 1995 19:56:26 +0000 (19:56 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 27 Nov 1995 19:56:26 +0000 (19:56 +0000)
(handle_texinfo): Require 'mdate-sh'
(common_sometimes): New variable
(usage): Use it.

automake.in

index 7d3e23abc0568c4097b21d35c4c8db4fc52679f9..d8be9077643af1914ed00ab105bb740458e6eb31 100755 (executable)
@@ -35,8 +35,14 @@ $am_dir = "@datadir@/@PACKAGE@";
     (
      "THANKS", "TODO", "README", "NEWS", "COPYING", "COPYING.LIB",
      "INSTALL", "ABOUT-NLS", "ChangeLog", "configure", "configure.in",
-     "config.guess", "config.sub", "mkinstalldirs", "install-sh",
-     "texinfo.tex"
+     "config.guess", "config.sub", "mkinstalldirs", "install-sh"
+     );
+
+# Commonly used files we auto-include, but only sometimes.
+@common_sometimes =
+    (
+     "version.texi", "aclocal.m4", "acconfig.h", "config.h.top",
+     "config.h.bot", "stamp-h.in", "mdate-sh"
      );
 
 $USAGE = "  --amdir=DIR           directory storing config files
@@ -481,6 +487,8 @@ sub handle_texinfo
        local ($tfile);
        ($tfile = &file_contents ('texi-version')) =~ s/@TEXI@/$texis[0]/g;
        $output_rules = $output_rules . $tfile;
+
+       &require_file ('mdate-sh');
     }
 
     # If user specified file_TEXINFOS, then use that as explicit
@@ -513,11 +521,7 @@ sub handle_texinfo
                     . "DVIS = " . $infobase . ".dvi\n\n");
 
     # Do some error checking.
-    if (! -f ($relative_dir . "/texinfo.tex"))
-    {
-       print STDERR ("automake: \`TEXINFOS' defined in ", $relative_dir,
-                     ", but texinfo.tex does not exist there\n");
-    }
+    &require_file ('texinfo.tex');
 }
 
 # Handle any man pages.
@@ -743,7 +747,7 @@ sub handle_merge_targets
 
     if (defined $contents{'install-local'})
     {
-       print STDERR "automake: use \`install-data' or \`install-exec', not install\n";
+       print STDERR "automake: use \`install-data' or \`install-exec', not \`install'\n";
     }
 
     # Step two: if we are doing recursive makes, write out the
@@ -936,6 +940,26 @@ sub file_contents
     return $results;
 }
 
+################################################################
+
+# Verify that the file must exist in the current directory.
+sub require_file
+{
+    local ($file) = @_;
+    local ($fullfile) = $relative_dir . "/" . $file;
+
+    if (! -f $fullfile)
+    {
+       print STDERR "automake: required file \"$fullfile\" not found\n";
+       $exit_status = 1;
+    }
+    else
+    {
+       push (@dist_common, $file);
+    }
+}
+
+
 ################################################################
 
 # Return directory name of file.
@@ -962,7 +986,7 @@ sub usage
     print $USAGE;
     print "\nFiles which are automatically distributed, if found:\n";
     $~ = "USAGE_FORMAT";
-    local (@lcomm) = sort (@common_files);
+    local (@lcomm) = sort ((@common_files, @common_sometimes));
     local ($one, $two);
     while ($#lcomm >= 0)
     {