On Mon, Jun 09, 2003 at 04:54:35PM -0400, Andy Dougherty wrote:
> Now, if I run it with GNU make I get
> 
>     -le eval {print "First line."} or print  "Second line.";
> 
> But if I run it with Sun's /usr/ccs/bin/make, I get
> 
>     -le eval {print "First line."} \
>     or print  "Second line.";
> 
> Note that the trailing '\' is still there, and the data is still actually split
> over two lines.  Whether or not that's legal perl syntax
> depends on the contents of those particular lines.  In this case, it's not.
> 
> No, I don't know an easy way around this offhand.

It might have something to do with this in Sun's make man page:

  Shell commands may be continued across input lines by escaping the 
  NEWLINE with a backslash (\). The continuing line must also start with a 
  TAB.

I wasn't making sure there was a tab on the following line.  GNU make must
be more tolerant of it missing.  nmake, too.  And MMK and MMS... 

So try the attached patch which extends escape_newlines() by putting
a tab after the newline guaranteeing the next line will be indented.


-- 
Stupid am I?  Stupid like a fox!
Index: lib/ExtUtils/MM_Unix.pm
===================================================================
RCS file: /usr/local/cvsroot/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm,v
retrieving revision 1.165
diff -u -r1.165 MM_Unix.pm
--- lib/ExtUtils/MM_Unix.pm     5 Jun 2003 06:37:37 -0000       1.165
+++ lib/ExtUtils/MM_Unix.pm     9 Jun 2003 23:51:57 -0000
@@ -792,7 +792,7 @@
 
     my $date_check = $self->oneliner(<<'CODE', ['-l']);
 print 'Warning: Makefile possibly out of date with $(VERSION_FROM)'
-  if -e '$(VERSION_FROM)' and -M '$(VERSION_FROM)' < -M '$(FIRST_MAKEFILE)';
+    if -e '$(VERSION_FROM)' and -M '$(VERSION_FROM)' < -M '$(FIRST_MAKEFILE)';
 CODE
 
     return sprintf <<'MAKE_FRAG', $date_check;
@@ -3597,7 +3597,7 @@
 sub escape_newlines {
     my($self, $text) = @_;
 
-    $text =~ s{\n}{\\\n}g;
+    $text =~ s{\n}{\\\n\t}g;
 
     return $text;
 }
Index: lib/ExtUtils/MM_VMS.pm
===================================================================
RCS file: /usr/local/cvsroot/ExtUtils-MakeMaker/lib/ExtUtils/MM_VMS.pm,v
retrieving revision 1.95
diff -u -r1.95 MM_VMS.pm
--- lib/ExtUtils/MM_VMS.pm      23 May 2003 06:40:14 -0000      1.95
+++ lib/ExtUtils/MM_VMS.pm      9 Jun 2003 23:54:36 -0000
@@ -2213,7 +2213,7 @@
 sub escape_newlines {
     my($self, $text) = @_;
 
-    $text =~ s{\n}{-\n}g;
+    $text =~ s{\n}{-\n\t}g;
 
     return $text;
 }
Index: lib/ExtUtils/MM_Win32.pm
===================================================================
RCS file: /usr/local/cvsroot/ExtUtils-MakeMaker/lib/ExtUtils/MM_Win32.pm,v
retrieving revision 1.62
diff -u -r1.62 MM_Win32.pm
--- lib/ExtUtils/MM_Win32.pm    7 Apr 2003 02:39:48 -0000       1.62
+++ lib/ExtUtils/MM_Win32.pm    9 Jun 2003 23:54:43 -0000
@@ -481,7 +481,7 @@
     my($self, $text) = @_;
 
     # Escape newlines
-    $text =~ s{\n}{\\\n}g;
+    $text =~ s{\n}{\\\n\t}g;
 
     return $text;
 }

Reply via email to