gnucash-docs master: Improve building Japanese PDF in separate build directory.

John Ralls jralls at code.gnucash.org
Sun Mar 30 15:59:52 EDT 2014


Updated	 via  https://github.com/Gnucash/gnucash-docs/commit/a86680b2 (commit)
	from  https://github.com/Gnucash/gnucash-docs/commit/47c4a89f (commit)



commit a86680b21061f29614e1b82073ffac7152d827fc
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Mar 30 12:59:38 2014 -0700

    Improve building Japanese PDF in separate build directory.

diff --git a/configure.ac b/configure.ac
index 6eb884a..0434de7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,15 +74,17 @@ AC_ARG_WITH([japanese-fontdir],
 			[with_japanese_fontdir=check])
 AC_ARG_WITH([japanese-mincho-ttf],
 	[AS_HELP_STRING([--with-japanese-mincho-ttf],
-			[specify Japanese Mincho TrueType font (default is ipaexm.ttf)])],,)
+			[specify Japanese Mincho TrueType font (default is ume-tmo3.ttf)])],,)
 AC_ARG_WITH([japanese-gothic-ttf],
 	[AS_HELP_STRING([--with-japanese-gothic-ttf],
-			[specify Japanese Gothic TrueType font (default is ipaexg.ttf)])],,)
+			[specify Japanese Gothic TrueType font (default is ume-tmo3.ttf)])],,)
 
-JAPANESE_MINCHO_TTF=`pwd`/fonts/ume-tmo3.ttf
-JAPANESE_GOTHIC_TTF=`pwd`/fonts/ume-tmo3.ttf
-japanese_mincho_metric=fonts/mincho.xml
-japanese_gothic_metric=fonts/gothic.xml
+JAPANESE_MINCHO_TTF=fonts/ume-tmo3.ttf
+JAPANESE_GOTHIC_TTF=fonts/ume-tmo3.ttf
+JAPANESE_MINCHO_TTF_ABS='${top_srcdir}/${JAPANESE_MINCHO_TTF}'
+JAPANESE_GOTHIC_TTF_ABS='${top_srcdir}/${JAPANESE_GOTHIC_TTF}'
+japanese_mincho_metric=/fonts/mincho.xml
+japanese_gothic_metric=/fonts/gothic.xml
 
 if test -z "$FOP_TTFREADER"; then
    AC_MSG_WARN([
@@ -96,31 +98,41 @@ dnl Japanese fonts search path (Ubuntu, RedHat, openSUSE:local, Fedora)
   if test "x$with_japanese_fontdir" != "xcheck" && test "x$with_japanese_fontdir" != "xyes" ; then
      japanese_fontdir="$with_japanese_fontdir $japanese_fontdir"
   fi
-  
+
   if test "x$with_japanese_mincho_ttf" != "x" ; then
-      for fontdir in $japanese_fontdir ""; do
-          font=$fontdir/$with_japanese_mincho_ttf
-          AC_CHECK_FILE($font,[
-			       JAPANESE_MINCHO_TTF=$font
-      	    		       unset japanese_mincho_metric
-			       break
-      			       ],)
-      done
+       AC_CHECK_FILE($with_japanese_mincho_ttf,
+		     [JAPANESE_MINCHO_TTF=$with_japanase_mincho_ttf
+		      JAPANESE_MINCHO_TTF_ABS=$font
+		      unset japanese_mincho_metric
+		      font = $with_japanese_mincho_ttf],
+		     [for fontdir in $japanese_fontdir ""; do
+          	     	  font=$fontdir/$with_japanese_mincho_ttf
+          		  AC_CHECK_FILE($font,
+					[JAPANESE_MINCHO_TTF=$font
+					 JAPANESE_MINCHO_TTF_ABS=$font
+      	    		       		 unset japanese_mincho_metric
+			       		 break],)
+      			  done])
       if test -z $font; then
           AC_MSG_WARN([$with_japanese_mincho_ttf not found, using default mincho font])
       fi
       unset font
   fi
-  if test "x$with_japanese_gothic_ttf" != "x" ; then 
-      for fontdir in $japanese_fontdir ""; do
-          font=$fontdir/$with_japanese_gothic_ttf
-          AC_CHECK_FILE($font,[
-	         	       JAPANESE_GOTHIC_TTF=$font
-			       unset japanese_gothic_metric
-			       break
-			      ],)
-      done
-      if test -z $font; then
+  if test "x$with_japanese_gothic_ttf" != "x" ; then
+        AC_CHECK_FILE($with_japanese_gothic_ttf,
+		     [JAPANESE_GOTHIC_TTF=$with_japanase_gothic_ttf
+		      JAPANESE_GOTHIC_TTF_ABS=$font
+		      unset japanese_gothic_metric
+		      font = $with_japanese_gothic_ttf],
+		     [for fontdir in $japanese_fontdir ""; do
+          	     	  font=$fontdir/$with_japanese_gothic_ttf
+          		  AC_CHECK_FILE($font,
+					[JAPANESE_GOTHIC_TTF=$font
+					 JAPANESE_GOTHIC_TTF_ABS=$font
+      	    		       		 unset japanese_gothic_metric
+			       		 break],)
+      			  done])
+       if test -z $font; then
           AC_MSG_WARN([$with_japanese_gothic_ttf not found, using default gothic font])
       fi
       unset font
@@ -128,14 +140,20 @@ dnl Japanese fonts search path (Ubuntu, RedHat, openSUSE:local, Fedora)
 fi
 echo Mincho Metric: $japanese_mincho_metric
 if test "x$japanese_mincho_metric" != "x"; then
-   cp $japanese_mincho_metric guide/ja
+   AC_CONFIG_COMMANDS([mincho_metric],
+		      [cp $ac_top_srcdir$mincho_metric guide/ja],
+		      [mincho_metric=$japanese_mincho_metric])
 fi
 echo Gothic Metric: $japanese_gothic_metric
 if test "x$japanese_gothic_metric" != "x"; then
-   cp $japanese_gothic_metric guide/ja
+   AC_CONFIG_COMMANDS([gothic_metric],
+		      [cp $ac_top_srcdir$gothic_metric guide/ja],
+		      [gothic_metric=$japanese_gothic_metric])
 fi
 AC_SUBST(JAPANESE_MINCHO_TTF)
+AC_SUBST(JAPANESE_MINCHO_TTF_ABS)
 AC_SUBST(JAPANESE_GOTHIC_TTF)
+AC_SUBST(JAPANESE_GOTHIC_TTF_ABS)
 
 dnl
 dnl Check for mobi target and optional ebook-convert
@@ -154,7 +172,7 @@ else
   AC_MSG_NOTICE([Didn't make mobi target.  If you need, specify --with-mobi])
 fi
 
-AC_OUTPUT(
+AC_CONFIG_FILES([
 gnucash-docs.spec
 help/Makefile
 help/C/Makefile
@@ -165,5 +183,8 @@ guide/C/Makefile
 guide/de/Makefile
 guide/it/Makefile
 guide/ja/Makefile
-guide/ja/fop.xconf
-Makefile)
+Makefile])
+
+AC_CONFIG_FILES([guide/ja/fop.xconf])
+
+AC_OUTPUT
diff --git a/guide/ja/Makefile.am b/guide/ja/Makefile.am
index b052bf7..69c3cd3 100644
--- a/guide/ja/Makefile.am
+++ b/guide/ja/Makefile.am
@@ -38,9 +38,9 @@ if WITH_MOBI
 include $(top_srcdir)/mobi.make
 endif
 
-mincho.xml: $(JAPANESE_MINCHO_TTF)
+mincho.xml: $(JAPANESE_MINCHO_TTF_ABS)
 	$(FOP_TTFREADER) $< $@
-gothic.xml: $(JAPANESE_GOTHIC_TTF)
+gothic.xml: $(JAPANESE_GOTHIC_TTF_ABS)
 	$(FOP_TTFREADER) $< $@
 $(docname).pdf: $(docname).fo mincho.xml gothic.xml  $(fopconfig)
 	$(FOP) $(FOPFLAGS) -fo $(docname).fo -pdf $@
diff --git a/guide/ja/fop.xconf.in b/guide/ja/fop.xconf.in
index 93aeef3..53aabb1 100644
--- a/guide/ja/fop.xconf.in
+++ b/guide/ja/fop.xconf.in
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <fop version="1.0">
-  <base>.</base>
+  <font-base>@abs_top_srcdir@</font-base>
   
   <!-- Source resolution in dpi (dots/pixels per inch) for determining the size of pixels in SVG and bitmap images, default: 72dpi -->
   <source-resolution>72</source-resolution>



Summary of changes:
 configure.ac          | 81 ++++++++++++++++++++++++++++++++-------------------
 guide/ja/Makefile.am  |  4 +--
 guide/ja/fop.xconf.in |  2 +-
 3 files changed, 54 insertions(+), 33 deletions(-)



More information about the gnucash-changes mailing list