From: Tom Tromey Date: Sat, 22 Mar 1997 08:14:41 +0000 (+0000) Subject: more cygwin32 fixes X-Git-Tag: pre-ian-conditionals~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dc4edf6b7738d83eb971df41baa33ee126564a70;p=thirdparty%2Fautomake.git more cygwin32 fixes --- diff --git a/ChangeLog b/ChangeLog index 5c0dd06ae..deaadda26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Sat Mar 22 00:06:00 1997 Tom Tromey * 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. diff --git a/automake.in b/automake.in index a2a4955b2..fb370446e 100755 --- a/automake.in +++ b/automake.in @@ -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) diff --git a/lib/am/program.am b/lib/am/program.am index 587f5cf43..91bf3652b 100644 --- a/lib/am/program.am +++ b/lib/am/program.am @@ -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 diff --git a/program.am b/program.am index 587f5cf43..91bf3652b 100644 --- a/program.am +++ b/program.am @@ -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 diff --git a/tests/ChangeLog b/tests/ChangeLog index 86976c57d..d74aaa228 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,7 @@ +Sat Mar 22 01:14:03 1997 Tom Tromey + + * cygwin32.test: New file. + Thu Mar 20 00:34:33 1997 Tom Tromey * exsource.test: Exit if not using GNU make. diff --git a/tests/Makefile.am b/tests/Makefile.am index 8ee2da424..a32478ff3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -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 index 000000000..42882389b --- /dev/null +++ b/tests/cygwin32.test @@ -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