more cygwin32 fixes
authorTom Tromey <tromey@redhat.com>
Sat, 22 Mar 1997 08:14:41 +0000 (08:14 +0000)
committerTom Tromey <tromey@redhat.com>
Sat, 22 Mar 1997 08:14:41 +0000 (08:14 +0000)
ChangeLog
automake.in
lib/am/program.am
program.am
tests/ChangeLog
tests/Makefile.am
tests/cygwin32.test [new file with mode: 0755]

index 5c0dd06..deaadda 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@ 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.
+       (file_contents_with_transform): A single newline makes an empty
+       line.
 
        * program.am: Remove executable before linking.
 
index a2a4955..fb37044 100755 (executable)
@@ -1420,7 +1420,7 @@ sub handle_programs
        }
        else
        {
-           $cygxform = 's/^NOTCYGWIN.$*//; s/^CYGWIN//;';
+           $cygxform = 's/^NOTCYGWIN.*$//; s/^CYGWIN//;';
        }
 
        $output_rules .=
@@ -4592,14 +4592,15 @@ sub file_contents_with_transform
        $_ =~ s/\@MAINT\@//g
            unless $seen_maint_mode;
 
-       $had_chars = length ($_);
+       $had_chars = length ($_) && $_ ne "\n";
        eval $command;
        # If the transform caused all the characters to go away, then
        # ignore the line.  Why do this?  Because in Perl 4, a "next"
        # inside of an eval doesn't affect a loop outside the eval.
        # So we can't pass in a "transform" that uses next.  We used
-       # to do this.
-       next if $had_chars && $_ eq '';
+       # to do this.  "Empty" also means consisting of a single
+       # newline.
+       next if $had_chars && ($_ eq '' || $_ eq "\n");
 
        if (/$IGNORE_PATTERN/o)
        {
@@ -4738,11 +4739,11 @@ sub am_install_var
     local ($cygxform);
     if (! $seen_cygwin32)
     {
-       $cygxform = 's/\@EXEEXT\@//g; s/^NOTCYGWIN.*$//; s/^CYGWIN//;';
+       $cygxform = 's/\@EXEEXT\@//g; s/^NOTCYGWIN//; s/^CYGWIN.*$//;';
     }
     else
     {
-       $cygxform .= 's/^CYGWIN.*$//; s/^NOTCYGWIN//;';
+       $cygxform = 's/\@EXEEXT\@/\$(EXEEXT)/g; s/^CYGWIN//; s/^NOTCYGWIN.*$//;';
     }
 
     while (@args)
index 587f5cf..91bf365 100644 (file)
@@ -21,7 +21,7 @@
 ## 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@
+NOTCYGWIN      @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
index 587f5cf..91bf365 100644 (file)
@@ -21,7 +21,7 @@
 ## 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@
+NOTCYGWIN      @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
index 86976c5..d74aaa2 100644 (file)
@@ -1,3 +1,7 @@
+Sat Mar 22 01:14:03 1997  Tom Tromey  <tromey@cygnus.com>
+
+       * cygwin32.test: New file.
+
 Thu Mar 20 00:34:33 1997  Tom Tromey  <tromey@cygnus.com>
 
        * exsource.test: Exit if not using GNU make.
index 8ee2da4..a32478f 100644 (file)
@@ -23,8 +23,8 @@ distdir.test lex2.test libobj4.test libobj5.test version.test \
 ranlib.test confvar.test confvar2.test stdlib.test cxxo.test \
 colon2.test colon3.test remake.test output.test output2.test \
 remake2.test output3.test output4.test colneq2.test subst.test \
-defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test \
-cxxlibobj.test seenc.test
+defun2.test yaccpp.test texinfo3.test texinfo4.test tagsub.test        \
+cxxlibobj.test seenc.test cygwin32.test
 
 EXTRA_DIST = defs $(TESTS)
 
diff --git a/tests/cygwin32.test b/tests/cygwin32.test
new file mode 100755 (executable)
index 0000000..4288238
--- /dev/null
@@ -0,0 +1,24 @@
+#! /bin/sh
+
+# Test basic Cygwin32 functionality.
+
+. $srcdir/defs || exit 1
+
+cat >> configure.in << 'END'
+AC_PROG_CC
+AM_CYGWIN32
+END
+
+cat > Makefile.am << 'END'
+bin_PROGRAMS = www
+www_SOURCES = www.c @extra_stuff@
+EXTRA_www_SOURCES = xtra.c
+END
+
+: > www.c
+: > xtra.c
+
+$AUTOMAKE || exit 1
+
+grep '^CYGWIN' Makefile.in && exit 1
+grep 'EXEEXT' Makefile.in