cygwin fixes
authorTom Tromey <tromey@redhat.com>
Sat, 22 Mar 1997 07:18:50 +0000 (07:18 +0000)
committerTom Tromey <tromey@redhat.com>
Sat, 22 Mar 1997 07:18:50 +0000 (07:18 +0000)
ChangeLog
automake.in
lib/am/program.am
program.am

index 2191792..5c0dd06 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 Sat Mar 22 00:06:00 1997  Tom Tromey  <tromey@cygnus.com>
 
+       * automake.in (am_install_var): Make sure to delete
+       CYGWIN/NOTCYGWIN tokens as appropriate.
+       (handle_programs): Remove NOTCYGWIN tokens as well.
+
+       * program.am: Remove executable before linking.
+
        * texinfos.am (.texi.dvi): Look in @TEXINFODIR@ for texinfo.tex.
        (.texinfo.dvi): Likewise.
 
index 170650b..a2a4955 100755 (executable)
@@ -1413,10 +1413,14 @@ sub handle_programs
            $xlink = $linker ? $linker : 'LINK';
        }
 
-       local ($cygxform) = '';
+       local ($cygxform);
        if (! $seen_cygwin32)
        {
-           $cygxform .= 's/^CYGWIN.*$//;';
+           $cygxform = 's/^CYGWIN.*$//; s/^NOTCYGWIN//;';
+       }
+       else
+       {
+           $cygxform = 's/^NOTCYGWIN.$*//; s/^CYGWIN//;';
        }
 
        $output_rules .=
@@ -4734,11 +4738,11 @@ sub am_install_var
     local ($cygxform);
     if (! $seen_cygwin32)
     {
-       $cygxform = 's/\@EXEEXT\@//g; s/^NOTCYGWIN.*$//;';
+       $cygxform = 's/\@EXEEXT\@//g; s/^NOTCYGWIN.*$//; s/^CYGWIN//;';
     }
     else
     {
-       $cygxform .= 's/^CYGWIN.*$//;';
+       $cygxform .= 's/^CYGWIN.*$//; s/^NOTCYGWIN//;';
     }
 
     while (@args)
index a4ca3e6..587f5cf 100644 (file)
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 @PROGRAM@: $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_DEPENDENCIES)
+## Remove program before linking.  Otherwise the link will fail if the
+## program is running somewhere.  FIXME: this could be a loss if
+## you're using an incremental linker.  Maybe we should think twice?
+## Or maybe not... sadly, incremental linkers are rarer than losing
+## systems.
+NOTCYWIN       @rm -f @PROGRAM@
+CYGWIN @rm -f @PROGRAM@$(EXEEXT)
        $(@XLINK@) $(@XPROGRAM@_LDFLAGS) $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_LDADD) $(LIBS)
 ## Why take such a funny approach to Cygwin32 executables?  Why not
 ## just rewrite this file to PROGRAM$(EXEEXT), and then rewrite
index a4ca3e6..587f5cf 100644 (file)
 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 ## 02111-1307, USA.
 @PROGRAM@: $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_DEPENDENCIES)
+## Remove program before linking.  Otherwise the link will fail if the
+## program is running somewhere.  FIXME: this could be a loss if
+## you're using an incremental linker.  Maybe we should think twice?
+## Or maybe not... sadly, incremental linkers are rarer than losing
+## systems.
+NOTCYWIN       @rm -f @PROGRAM@
+CYGWIN @rm -f @PROGRAM@$(EXEEXT)
        $(@XLINK@) $(@XPROGRAM@_LDFLAGS) $(@XPROGRAM@_OBJECTS) $(@XPROGRAM@_LDADD) $(LIBS)
 ## Why take such a funny approach to Cygwin32 executables?  Why not
 ## just rewrite this file to PROGRAM$(EXEEXT), and then rewrite