summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAkira Yokosawa <akiyks@gmail.com>2024-01-05 18:50:45 +0900
committerPaul E. McKenney <paulmck@kernel.org>2024-01-07 13:36:29 -0800
commit12c5daa32b75b45ddb894a2f448296e9523dcaf2 (patch)
tree9801066412ca4b635fce38f6e57d04592915c993
parent27da59e6ac577975e16c10ab2ca53e65a7501bdd (diff)
downloadperfbook-12c5daa32b75b45ddb894a2f448296e9523dcaf2.tar.gz
Makefile: Don't use rsvg-convert < 2.57
rsvg-convert versions prior to 2.57 doesn't recognize options for specifying output PDF version. Default PDF output version depends on the version of rsvg-convert. Version 2.57's default is PDF 1.7. For the moment, don't use younger versions of rsvg-convert. Use inkscape as a fallback. For rsvg-convert >= 2.57, specify --format=pdf1.5, which matches inkscape's default behavior. Signed-off-by: Akira Yokosawa <akiyks@gmail.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
-rw-r--r--Makefile16
1 files changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index f869862c..9f19ce52 100644
--- a/Makefile
+++ b/Makefile
@@ -116,7 +116,15 @@ endif
# rsvg-convert is preferred to inkscape in SVG --> PDF conversion
RSVG_CONVERT := $(shell $(WHICH) rsvg-convert 2>/dev/null)
ifdef RSVG_CONVERT
- SVG_PDF_CONVERTER = (rsvg-convert)
+ RSVG_CONVERT_VER := $(shell rsvg-convert --version | $(SED) -e 's/rsvg-convert version //')
+ RSVG_CONVERT_VER_MINOR := $(shell echo $(RSVG_CONVERT_VER) | $(SED) -E -e 's/^([0-9]+\.[0-9]+).*/\1/')
+ RSVG_CONVERT_GOOD_VER ?= 2.57
+ RSVG_CONVERT_GOOD := $(shell echo $(RSVG_CONVERT_VER_MINOR) $(RSVG_CONVERT_GOOD_VER) | awk '{if ($$1 >= $$2) print 1;}')
+ ifeq ($(RSVG_CONVERT_GOOD),1)
+ SVG_PDF_CONVERTER = (rsvg-convert v$(RSVG_CONVERT_VER))
+ else
+ SVG_PDF_CONVERTER = (inkscape)
+ endif
else
SVG_PDF_CONVERTER = (inkscape)
endif
@@ -468,7 +476,7 @@ $(PDFTARGETS_OF_SVG): %.pdf: %.svg
ifeq ($(STEELFONT),0)
$(error "Steel City Comic" font not found. See #1 in FAQ.txt)
endif
-ifndef RSVG_CONVERT
+ifneq ($(RSVG_CONVERT_GOOD),1)
ifndef INKSCAPE
$(error $< --> $@ inkscape nor rsvg-convert not found. Please install either one)
endif
@@ -494,8 +502,8 @@ ifeq ($(RECOMMEND_LIBERATIONMONO),1)
$(info Nice-to-have font family 'Liberation Mono' not found. See #9 in FAQ-BUILD.txt)
endif
-ifdef RSVG_CONVERT
- @cat $<i | rsvg-convert --format=pdf > $@
+ifeq ($(RSVG_CONVERT_GOOD),1)
+ @cat $<i | rsvg-convert --format=pdf1.5 > $@
else
ifeq ($(INKSCAPE_ONE),0)
@inkscape --export-pdf=$@ $<i > /dev/null 2>&1