mainAutoconf - Support: sr #110554, AC_CONFIG_HEADERS doesn't work...


sr #110554: AC_CONFIG_HEADERS doesn't work properly for files with Windows line-endings

Submitter:  David Allsopp <dra27>
Submitted:  Thu 21 Oct 2021 04:20:43 PM UTC
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  Microsoft Windows
* Mandatory Fields

Add a New Comment Rich Markup

Thu 21 Oct 2021 04:20:43 PM UTC, original submission:  

For headers with standard

#undef MACRO

lines, AC_CONFIG_HEADERS doesn't perform substitutions if the there is no whitespace following MACRO and the .in file has Windows CRLF line-endings.

This is a mild nuisance, given that the C pre-processor shouldn't mind about line endings. The work-around is to add space (or space and a comment) after the macro name, but the fix seems relatively straightforward (assuming the change is portable).

diff --git a/lib/autoconf/status.m4 b/lib/autoconf/status.m4
index c2721a85..d5c222bb 100644
--- a/lib/autoconf/status.m4
+++ b/lib/autoconf/status.m4
@@ -824,9 +824,9 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   for (key in D) D_is_set[key] = 1
   FS = "^G"
-/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\r?\$)/ {
   line = \$ 0
-  split(line, arg, " ")
+  split(line, arg, /[ \r\t]/)
   if (arg[1] == "#") {
     defundef = arg[2]
     mac1 = arg[3]

David Allsopp <dra27>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by dra27 (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.12