]> granicus.if.org Git - graphviz/commitdiff
common: autotools: make awk crlf agnostic when generating svgcolor_lib
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 22 Aug 2021 06:10:21 +0000 (08:10 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 28 Sep 2021 16:17:16 +0000 (18:17 +0200)
Fixes errors like this with Cygwin in a crlf environment with
SHELLOPTS=igncr:

../../lib/common/colortbl.h:1524:2: error: missing terminating " character
 1524 | {"/svg/ ",0,255,255,255,0,0,0},
      |  ^~~~~~

Although not shown in the error message, this line actually contained
a carriage return after /svg/:

{"/svg/^M",0,255,255,255,0,0,0},

lib/common/Makefile.am

index 8b847a6c5e751c8f6e73863c1d6f7b7faa847d8f..9621125fa1a8668d39304119e134b08a392ff538 100644 (file)
@@ -44,7 +44,7 @@ brewer_lib : $(top_srcdir)/lib/common/brewer_colors  $(top_srcdir)/awk/brewer.aw
        $(AWK) -f $(top_srcdir)/awk/brewer.awk $(top_srcdir)/lib/common/brewer_colors > brewer_lib
 
 svgcolor_lib : $(top_srcdir)/lib/common/svgcolor_names  $(top_srcdir)/awk/svgcolor.awk
-        $(AWK) -f $(top_srcdir)/awk/svgcolor.awk $(top_srcdir)/lib/common/svgcolor_names > svgcolor_lib
+        $(AWK) -v RS="\r*\n" -f $(top_srcdir)/awk/svgcolor.awk $(top_srcdir)/lib/common/svgcolor_names > svgcolor_lib
 
 htmllex.o htmllex.lo: htmllex.c htmllex.h htmlparse.h
 htmlparse.o htmlparse.lo: htmlparse.c htmlparse.h