Re: [PATCH] Fix for CRLF problem

2000-10-20 Thread Akim Demaille


| Index: ChangeLog
| ===
| RCS file: /cvs/automake/automake/ChangeLog,v
| retrieving revision 1.891
| diff -u -r1.891 ChangeLog
| --- ChangeLog 2000/10/06 22:49:14 1.891
| +++ ChangeLog 2000/10/09 14:43:56
| @@ -1,3 +1,12 @@
| +2000-10-09  Morten Eriksen  [EMAIL PROTECTED]
| +
| + * aclocal.in (write_aclocal): Don't write aclocal.m4 with
| + CRLFs. This circumvents a bug in Cygwin bash.
| +
| + * automake.in (generate_makefile): Don't write Makefile.in
| + files with CRLFs, as it causes problems for the dependency-file
| + extraction in AM_OUTPUT_DEPENDENCY_COMMANDS.
| +

This looks fine to me.  Any resistance?

| Index: aclocal.in
| ===
| RCS file: /cvs/automake/automake/aclocal.in,v
| retrieving revision 1.46
| diff -u -r1.46 aclocal.in
| --- aclocal.in2000/10/06 22:49:14 1.46
| +++ aclocal.in2000/10/09 14:43:57
| @@ -429,6 +429,13 @@
|  
|  open (ACLOCAL, " " . $output_file)
| || die "aclocal: couldn't open \`$output_file' for writing: $!\n";
| +
| +# In case we're running under MSWindows, don't write with CRLF.
| +# (This circumvents a bug in at least Cygwin bash where the shell
| +# parsing fails on lines ending with the continuation character '\'
| +# and CRLF.)
| +binmode ACLOCAL;
| +
|  print ACLOCAL "dnl $output_file generated automatically by aclocal $VERSION\n";
|  print ACLOCAL "\
|  dnl Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
| Index: automake.in
| ===
| RCS file: /cvs/automake/automake/automake.in,v
| retrieving revision 1.796
| diff -u -r1.796 automake.in
| --- automake.in   2000/09/15 20:09:55 1.796
| +++ automake.in   2000/10/09 14:44:05
| @@ -689,6 +689,11 @@
|  }
|  print "automake: creating ", $makefile, ".in\n" if $verbose;
|  
| +# In case we're running under MSWindows, don't write with CRLF
| +# (as it causes problems for the dependency-file extraction in
| +# AM_OUTPUT_DEPENDENCY_COMMANDS).
| +binmode GM_FILE;
| +
|  print GM_FILE $output_vars;
|  # We make sure that `all:' is the first target.
|  print GM_FILE $output_all;
| 




Re: [PATCH] Fix for CRLF problem

2000-10-20 Thread Alexandre Oliva

On Oct 20, 2000, Akim Demaille [EMAIL PROTECTED] wrote:

 This looks fine to me.  Any resistance?

Ok with me.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicampoliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist*Please* write to mailing lists, not to me




[PATCH] Fix for CRLF problem

2000-10-09 Thread Morten Eriksen

Hi,

I had problems running a configure script under Cygwin, because of
extra CR-characters (i.e. ASCII \015, "carriage return") being added
to the shell code of the macros gathered into aclocal.m4 by Automake's
``aclocal''.

This lead to problems when running ``configure'' due to what looks
like a bug in the Cygwin bash port (using the latest release): lines
ending with '\' (i.e. "continuation" lines) plus CRLF will not be
parsed correctly -- bash just ends the command, as if the '\'
character wasn't there.

The attached patch will let Automake circumvent this bug by writing
aclocal.m4 in binary mode (i.e. with just LF instead of CRLF under
MSWindows). I believe this to be the correct behavior anyway, Cygwin
bash bug or not.

(There might be a better way than using ``binmode'' to instruct Perl's
``print'' function to write LF instead of CRLF, but I couldn't find
one. I'm no Perl guru.  :^})

BTW, I've also reported the bash bug to the cygwin mailinglist.

Regards,
Morten



Index: ChangeLog
===
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.891
diff -u -r1.891 ChangeLog
--- ChangeLog   2000/10/06 22:49:14 1.891
+++ ChangeLog   2000/10/09 10:59:37
@@ -1,3 +1,8 @@
+2000-10-09  Morten Eriksen  [EMAIL PROTECTED]
+
+   * aclocal.in (write_aclocal): Don't write aclocal.m4 with
+   CRLFs. This circumvents a bug in Cygwin bash.
+
 2000-10-06  Alexandre Duret-Lutz  [EMAIL PROTECTED]
 
* aclocal.in (add_file): Strip comments while scanning for
Index: aclocal.in
===
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.46
diff -u -r1.46 aclocal.in
--- aclocal.in  2000/10/06 22:49:14 1.46
+++ aclocal.in  2000/10/09 10:59:38
@@ -429,6 +429,13 @@
 
 open (ACLOCAL, " " . $output_file)
|| die "aclocal: couldn't open \`$output_file' for writing: $!\n";
+
+# In case we're running under MSWindows, don't write with CRLF.
+# (This circumvents a bug in at least Cygwin bash where the shell
+# parsing fails on lines ending with the continuation character '\'
+# and CRLF.)
+binmode ACLOCAL;
+
 print ACLOCAL "dnl $output_file generated automatically by aclocal $VERSION\n";
 print ACLOCAL "\
 dnl Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.



Re: [PATCH] Fix for CRLF problem

2000-10-09 Thread Morten Eriksen

Hi,

I found another problem with Automake under Cygwin. The Makefile.in
files are written with CRLF, which causes the grep and/or sed code
which extracts the list of dependency files in
AM_OUTPUT_DEPENDENCY_COMMANDS to fail.

Updated patch attached below.

Regards,
Morten



Index: ChangeLog
===
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.891
diff -u -r1.891 ChangeLog
--- ChangeLog   2000/10/06 22:49:14 1.891
+++ ChangeLog   2000/10/09 14:43:56
@@ -1,3 +1,12 @@
+2000-10-09  Morten Eriksen  [EMAIL PROTECTED]
+
+   * aclocal.in (write_aclocal): Don't write aclocal.m4 with
+   CRLFs. This circumvents a bug in Cygwin bash.
+
+   * automake.in (generate_makefile): Don't write Makefile.in
+   files with CRLFs, as it causes problems for the dependency-file
+   extraction in AM_OUTPUT_DEPENDENCY_COMMANDS.
+
 2000-10-06  Alexandre Duret-Lutz  [EMAIL PROTECTED]
 
* aclocal.in (add_file): Strip comments while scanning for
Index: aclocal.in
===
RCS file: /cvs/automake/automake/aclocal.in,v
retrieving revision 1.46
diff -u -r1.46 aclocal.in
--- aclocal.in  2000/10/06 22:49:14 1.46
+++ aclocal.in  2000/10/09 14:43:57
@@ -429,6 +429,13 @@
 
 open (ACLOCAL, " " . $output_file)
|| die "aclocal: couldn't open \`$output_file' for writing: $!\n";
+
+# In case we're running under MSWindows, don't write with CRLF.
+# (This circumvents a bug in at least Cygwin bash where the shell
+# parsing fails on lines ending with the continuation character '\'
+# and CRLF.)
+binmode ACLOCAL;
+
 print ACLOCAL "dnl $output_file generated automatically by aclocal $VERSION\n";
 print ACLOCAL "\
 dnl Copyright (C) 1994, 1995-9, 2000 Free Software Foundation, Inc.
Index: automake.in
===
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.796
diff -u -r1.796 automake.in
--- automake.in 2000/09/15 20:09:55 1.796
+++ automake.in 2000/10/09 14:44:05
@@ -689,6 +689,11 @@
 }
 print "automake: creating ", $makefile, ".in\n" if $verbose;
 
+# In case we're running under MSWindows, don't write with CRLF
+# (as it causes problems for the dependency-file extraction in
+# AM_OUTPUT_DEPENDENCY_COMMANDS).
+binmode GM_FILE;
+
 print GM_FILE $output_vars;
 # We make sure that `all:' is the first target.
 print GM_FILE $output_all;