]> granicus.if.org Git - graphviz/commitdiff
plugin/core: autotools: make awk crlf agnostic when generating ps.h
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Sun, 22 Aug 2021 06:25:01 +0000 (08:25 +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 even with
SHELLOPTS=igncr:

ps.h:2:1: error: missing terminating " character
    2 | "%%BeginProlog ",
      | ^~~~~~~~~~~~~~

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

"%%BeginProlog\r",

plugin/core/Makefile.am

index 3cad8cc4f4bdb8266f3fb13f43a09a0d4380b619..3e72fc8ef9926dfc24dc121377668d2ce1856757 100644 (file)
@@ -44,7 +44,7 @@ libgvplugin_core_la_LIBADD = $(top_builddir)/lib/gvc/libgvc.la \
 gvrender_core_ps.o gvrender_core_ps.lo: ps.h
 
 ps.h : $(srcdir)/ps.txt
-       $(AWK) -f $(top_srcdir)/awk/stringize.awk $(srcdir)/ps.txt > ps.h
+       $(AWK) -v RS="\r*\n" -f $(top_srcdir)/awk/stringize.awk $(srcdir)/ps.txt > ps.h
 
 if WITH_WIN32
 libgvplugin_core_la_LDFLAGS += -no-undefined