]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Bug fix
authorTom Tromey <tromey@redhat.com>
Fri, 5 Apr 1996 07:44:21 +0000 (07:44 +0000)
committerTom Tromey <tromey@redhat.com>
Fri, 5 Apr 1996 07:44:21 +0000 (07:44 +0000)
ChangeLog
NEWS
TODO
automake.in
automake.texi
lib/mkinstalldirs
mkinstalldirs
version.texi

index 999289bdf44adc70015d9bbe894d0a050559422c..7222ffafe2b04f0315ae03de313f4d2c01a284b0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 Fri Apr  5 00:22:14 1996  Tom Tromey  <tromey@creche.cygnus.com>
 
+       * mkinstalldirs (errstatus): Don't necessarily die if mkdir
+       fails.
+
        * automake.in (handle_source_transform): Typo fix.
 
 Thu Apr  4 15:10:50 1996  Tom Tromey  <tromey@creche.cygnus.com>
diff --git a/NEWS b/NEWS
index 1e9b1194a6cc6e70dd5a85edc0a0ce9f4f1c7ec8..2a3e034f052a4e07da96aa91fd1760dbcff08659 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,8 +4,8 @@ New in 0.32:
   AC_CONFIG_AUX_DIR.
 * Removed DIST_SUBDIRS, DIST_OTHER
 * AC_ARG_PROGRAM only required when an actual program exists
-* dist-local target now run before distribution packaged up; idea from
-  Dieter Baron.
+* dist-hook target now run before distribution packaged up; idea from
+  Dieter Baron.  Other hooks exist, too.
 * Preliminary (unfinished) support for libtool
 \f
 New in 0.31:
diff --git a/TODO b/TODO
index 266c6e14aea10af47f3374a73ec9bceccb39fe6e..1c4b974e2ea0e5fd70c93b921e0610fb95e6fb49 100644 (file)
--- a/TODO
+++ b/TODO
@@ -2,9 +2,8 @@ Priorities for release:
 * Fix all mkinstalldirs invocations
 * Add support for libtool
 * At top level, config.h is not depended on...
-* Rename dist-local -> dist-hook
-* Add install-data-hook, install-exec-hook
 * Must look for/enforce existence of stamp-h.in in srcdir?
+   ... there is something broken here...
 * Should be a way to have "nobuild_PROGRAMS" which aren't even built,
   but which could be by running the magic make command.
 
@@ -14,7 +13,6 @@ Other priorities:
 * Rewrite clean targets.
 * Must rewrite error handling code.  Right now it is a real mess
   Should fix up require_file junk at the same time
-* Add EXTRA_prog_SOURCES, for eg Apache
 
 Things to finish libtool support:
 * Handle grody compilation issue
@@ -37,9 +35,6 @@ an option
 
 Think about ways to make automake fit better with Cygnus-style trees.
 
-Omit program transform vars from header if no program installed.  This
-is currently pretty hard to do.
-
 Use recode in dist target when MAINT_CHARSET specified.  Read caveats
 in automake.in before doing this.  Note the same problem used to apply
 to the no-dependencies option; maybe it still should?  Note also that
@@ -78,6 +73,9 @@ Clean up the output:
 * regularize how backslash-newline is done.  Just one space between text
   and backslash should be the rule.  Update makefile-mode to allow this.
   (set column to 0, probably)
+Omit program transform vars from header if no program installed.  This
+is currently pretty hard to do.  (But with beautification code it
+would probably be easy)
 
 It should be possible to have ansi2knr in just one place in a package.
 Jim Meyering says just rely on configure to make links as appropriate.
index b33a7b70e3271b490d3ea54e1a57aab5b78370fd..2bad7330716b86d43edcd07508e9714999e04ca3 100755 (executable)
@@ -501,13 +501,44 @@ sub handle_source_transform
     local ($objpat) = $obj;
     $objpat =~ s/(\W)/\\$1/g;
 
-    # Look for file_SOURCES and file_OBJECTS.
-    if (defined $contents{$one_file . "_SOURCES"})
+    if (defined $contents{$one_file . "_OBJECTS"})
     {
-       if (! defined $contents{$one_file . "_OBJECTS"})
+       &am_line_error ($one_file . '_OBJECTS',
+                       $one_file . '_OBJECTS', 'should not be defined');
+       # No point in continuing.
+       return;
+    }
+
+    local ($source_list);
+    local ($prefix);
+    foreach $prefix ('', 'EXTRA_')
+    {
+       $source_list = '';
+       if (defined $contents{$prefix . $one_file . "_SOURCES"})
+       {
+           push (@sources, '$(' . $prefix . $one_file . "_SOURCES)");
+           push (@objects, '$(' . $prefix . $one_file . "_OBJECTS)")
+               unless $prefix eq 'EXTRA_';
+           $source_list = $contents{$prefix . $one_file . "_SOURCES"};
+       }
+       elsif ($prefix eq '')
+       {
+           $output_vars .= ($one_file . "_SOURCES = " . $one_file . ".c\n"
+                            . $one_file . "_OBJECTS = ". $one_file
+                            . $obj . "\n");
+           push (@sources, $one_file . '.c');
+           push (@objects, $one_file . $obj);
+           $source_list = $one_file . ".c ";
+       }
+       else
+       {
+           $output_vars .= "EXTRA_" . $one_file . "_SOURCES =\n";
+       }
+
+       if ($source_list)
        {
            # Turn sources into objects.
-           local (@files) = split (/\s+/, $contents{$one_file . "_SOURCES"});
+           local (@files) = split (/\s+/, $source_list);
            local (@result) = ();
            foreach (@files)
            {
@@ -539,7 +570,8 @@ sub handle_source_transform
                s/\.cc$/$obj/g;
                s/\.cxx$/$obj/g;
                s/\.[cCmylfs]$/$obj/g;
-               push (@result, $_);
+               push (@result, $_)
+                   unless $prefix eq 'EXTRA_';
 
                # Transform .o or $o file into .P file (for automatic
                # dependency code).
@@ -547,25 +579,9 @@ sub handle_source_transform
                $dep_files{'$(srcdir)/.deps/' . $_} = 1;
            }
 
-           &pretty_print ($one_file . "_OBJECTS =", "", @result);
-       }
-       else
-       {
-           &am_line_error ($one_file . '_OBJECTS',
-                           $one_file . '_OBJECTS', 'should not be defined');
+           &pretty_print ($one_file . "_OBJECTS =", "", @result)
+               unless $prefix eq 'EXTRA_';
        }
-
-       push (@sources, '$(' . $one_file . "_SOURCES)");
-       push (@objects, '$(' . $one_file . "_OBJECTS)");
-    }
-    else
-    {
-       $output_vars .= ($one_file . "_SOURCES = " . $one_file . ".c\n"
-                        . $one_file . "_OBJECTS = ". $one_file
-                        . $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'})
@@ -1135,12 +1151,12 @@ sub handle_dist_worker
 ';
     }
 
-    # If the target `dist-local' exists, run it now.  This allows
+    # If the target `dist-hook' exists, run it now.  This allows
     # users to do random weird things to the distribution before it is
     # packaged up.
-    if (defined $contents{'dist-local'})
+    if (defined $contents{'dist-hook'})
     {
-       $output_rules .= "\t\$(MAKE) dist-local\n";
+       $output_rules .= "\t\$(MAKE) dist-hook\n";
     }
 
     # Finalize.
@@ -1648,13 +1664,23 @@ sub handle_merge_targets
     # Step three: print definitions users can use.
     $output_rules .= ("install-exec: "
                      . join (' ', @install_exec)
-                     . "\n\n");
+                     . "\n");
+    if (defined $contents{'install-exec-hook'})
+    {
+       $output_rules .= "\t" . '$(MAKE) install-exec-hook' . "\n";
+    }
+    $output_rules .= "\n";
     push (@install, 'install-exec') if !$recursive_install;
     push (@phony, 'install-exec');
 
     $output_rules .= ("install-data: "
                      . join (' ', @install_data)
-                     . "\n\n");
+                     . "\n");
+    if (defined $contents{'install-data-hook'})
+    {
+       $output_rules .= "\t" . '$(MAKE) install-data-hook' . "\n";
+    }
+    $output_rules .= "\n";
     push (@install, 'install-data') if !$recursive_install;
     push (@phony, 'install-data');
 
index d87f69cdc25de36f5c97273f67717f5105356016..2bc9db7dec7a750e90e06b2fc947bc2575b74af0 100644 (file)
@@ -1007,13 +1007,13 @@ the @code{EXTRA_DIST} variable.
 @vindex EXTRA_DIST
 
 Occasionally it is useful to be able to change the distribution before
-it is packaged up.  If the @code{dist-local} target exists, it is run
+it is packaged up.  If the @code{dist-hook} target exists, it is run
 after the distribution directory is filled, but before the actual tar
 (or shar) file is created.  One way to use this is for distributing file
 in subdirectories for which a new @file{Makefile.am} is overkill:
 
 @example
-dist-local:
+dist-hook:
         mkdir $(distdir)/random
         cp -p random/a1 random/a2 $(distdir)/random
 @end example
@@ -1172,6 +1172,21 @@ install-data-local:
         $(INSTALL_DATA) $(srcdir)/afile /etc/afile
 @end example
 
+Some targets also have a way to run another target, called a @dfn{hook},
+after their work is done.  The hook is named after the principal target,
+with @samp{-hook} appended.  The targets allowing hooks are
+@code{install-data}, @code{install-exec}, and @code{dist}.
+@trindex install-data-hook
+@trindex install-exec-hook
+@trindex dist-hook
+
+For instance, here is how to create a hard link to an installed program:
+
+@example
+install-exec-hook:
+        $(LN) $(bindir)/program $(bindir)/proglink
+@end example
+
 @c FIXME should include discussion of variables you can use in these
 @c rules
 
index 0801ec2c96612d4502d7ca321a3585b013b50397..cc8783edce301ef5e36ec6b3ca54bf347ed77be4 100755 (executable)
@@ -20,7 +20,11 @@ for file in ${1+"$@"} ; do
 
      if test ! -d "$pathcomp"; then
         echo "mkdir $pathcomp" 1>&2
-        mkdir "$pathcomp" || errstatus=$?
+        mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+     fi
+
+     if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
      fi
 
      pathcomp="$pathcomp/"
index 0801ec2c96612d4502d7ca321a3585b013b50397..cc8783edce301ef5e36ec6b3ca54bf347ed77be4 100755 (executable)
@@ -20,7 +20,11 @@ for file in ${1+"$@"} ; do
 
      if test ! -d "$pathcomp"; then
         echo "mkdir $pathcomp" 1>&2
-        mkdir "$pathcomp" || errstatus=$?
+        mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+     fi
+
+     if test ! -d "$pathcomp"; then
+       errstatus=$lasterr
      fi
 
      pathcomp="$pathcomp/"
index 221774ae63256fa33c6dc4628a7a985b03cfe847..c300307dd1eb5a12d9ba6ca4a9a2ee04db8027d9 100644 (file)
@@ -1,3 +1,3 @@
-@set UPDATED 28 March 1996
+@set UPDATED 4 April 1996
 @set EDITION 0.32
 @set VERSION 0.32