hns - 日記自動生成システム - Version 2.19.9

先月 2011年01月 来月
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31
Namazu for hns による簡易全文検索
詳しくは 詳細指定/ヘルプを参照して下さい
検索式:

2011年01月14日(金) 旧暦 [n年日記] [更新:"2011/01/16 01:00:16"]

#1 [pkgsrc][TeX] (dvipdfmx) Error: /undefinedresource in /findfont

Error: /undefinedresource in /findfont
Operand stack:
   6.6587   Ryumin-Light-EUC-H
2010/12/19/ doesn't make it.

cidfmap の位置:

実は機械をすっかり入替えていて、
ML115NetBSD amd64 + DOM05.0_STABLE2010/04 頃
PowerEdge T105NetBSD amd645.12011/01
のようにしている。でどうも gs がまた Ryumin-Light-H がないとか言っている。

cidfmap を読んでくれない:

それで、今一つ得たことは、cidfmap の位置が
/usr/pkg/share/ghostscript/8.71/Resource/Init/cidfmap
では読んでくれなくて、少なくとも現 direcotry (current directory) に置けば 読む、ということだ。
前の機械では、次のところにもあったが、
/usr/pkg/share/ghostscript/8.71/Resource/Init/cidfmap
/usr/pkg/share/ghostscript/8.71/lib/cidfmap
今回はこれでもだめらしい。
t-105@makoto 22:25:25/110114(..8.71/lib)% ls -l ../Resource/Init/cidfmap
-rw-r--r--  1 root  wheel  1244 Jan 13 23:34 ../Resource/Init/cidfmap
t-105@makoto 22:25:37/110114(..8.71/lib)% sudo ln -s ../Resource/Init/cidfmap .
2010/12/18 の日記 を見ると、一度だけ Init の下を見に行っている ktrace -t n の記録がある。 だから条件によっては、そこを見に行くらしい。 少なくとも FONTDIR 変数の内容によるものではなかった気がする。
普通だったら source を見ればいいはずだけれど gs の場合には postscript 語で書いてあるので、(僕には) 読むのはかなり大変

libpng 1.5:

ちなみに、今は png が 1.5 になっていて、僕の観察では ghostscript-8.71nb6 は png 1.5 では build 出来ない。(なので今は 1.4.5 に戻して試しているところ)

disable-compile-init:

宇羅さんによれば、--disable-compile-init の有無は関係ない、ということになっている (付けなくても大丈夫の意味)。
これに関連して(と思うが) 次のような表示が出る
t-105@makoto 23:21:14/110114(~)% gs --help |grep compile
Initialization files are compiled into the executable.
これは --disable-compile-init の意味に見えるが、build の指定に関係なく、 上記表示が出る、というのが今の僕の理解(観察)
そして man gs すると、FILES の項目に少し書いてあって、 いろいろなファイルを参照する時に、その探索位置をコンパイル時に 埋込むかどうか、という話で、やはり今回の(僕の)関心事としては、この指定 は関係ないのではないかと思っている。

GS_LIB:

それで、同じく man page の INITIALIZATION FILES の項に GS_LIB への言及がある。 試しにその GS_LIB を指定すると、cidfmap を読んでくれる。 (実際には、cidfmap のある位置への直接の指定でなく *.ps を探すのかとは思う)
env GS_LIB=/usr/pkg/share/ghostscript/8.71/Resource/Init gs /tmp/ps
更に次のような説明があるので、make する時に GS_LIB_DEFAULT を入れておけば良いのかな。
 3. the directories  specified  by  the  GS_LIB_DEFAULT  macro  in  the
  Ghostscript  makefile  when  the  executable was built.
次のようなものは記述がある
(..print/ghostscript)% grep GS_LIB_DEFAULT `find . -name unix-gcc.mak`
GS_LIB_DEFAULT=
$(gsdatadir)/Resource/Init:
$(gsdatadir)/lib:
$(gsdatadir)/Resource/Font:
$(gsdir)/fonts
(実際には一行)。これらは --help で Search path: の部分に表示されるものと一致している (と思う)
Search path:
   . : %rom%Resource/Init/ : %rom%lib/ :
   /usr/pkg/share/ghostscript/8.71/Resource/Init :
   /usr/pkg/share/ghostscript/8.71/lib :
   /usr/pkg/share/ghostscript/8.71/Resource/Font :
   /usr/pkg/share/ghostscript/fonts :
   /usr/pkg/share/fonts/default/ghostscript :
   ... (omitted) ...
これ以外に GS_LIB が上書きされていて動作が変になっている、と考えるのかな。

正常時と異常時の違い:

異常時
Loading NimbusSanL-Bold font from %rom%Resource/Font/NimbusSanL-Bold...
Loading NimbusSanL-Regu font from %rom%Resource/Font/NimbusSanL-Regu...
....
Can't find (or can't open) font file %rom%Resource/Font/Ryumin-Light-H.
正常時 (env GS_LIB= を付けた時)
Loading NimbusSanL-Bold font from /usr/pkg/share/ghostscript/8.71/Resource/
   Font/NimbusSanL-Bold... 3277152 1721013 3752160 2466406 1 done.
Loading NimbusSanL-Regu font from /usr/pkg/share/ghostscript/8.71/Resource/
   Font/NimbusSanL-Regu... 3310432 1821787 3752160 2467288 1 done.
Loading Ryumin-Light-H font from /usr/pkg/share/ghostscript/8.71/Resource/
   Font/Ryumin-Light-H... Loading a TT font 
   from /usr/pkg/lib/X11/fonts/TTF/ipam.ttf to emulate a CID font Ryumin-Light 
   ... Done.
912 /* Print the standard help message. */
913 static void
914 print_help(gs_main_instance * minst)
915 {       
916     int i, have_rom_device = 0;
917     
918     print_revision(minst);
919     print_usage(minst);
920     print_emulators(minst);
921     print_devices(minst);
922     print_paths(minst);
923     /* Check if we have the %rom device */
924     for (i = 0; i < gx_io_device_table_count; i++) {
925         const gx_io_device *iodev = gx_io_device_table[i];
926         const char *dname = iodev->dname;
927
928         if (dname && strlen(dname) == 5 && !memcmp("%rom%", dname, 5)) {
929             have_rom_device = 1;
930             break;
931         }
932     }   
933     if (have_rom_device) {
934         outprintf(minst->heap, "Initialization files are compiled into the executable.\n");
935     }   
936     print_help_trailer(minst);
937 }           
%rom% という字は rom_device がある時に表示される
gs.mk の説明
#       COMPILE_INITS - normally 1; compiles the PostScript language
#           initialization files (gs_init.ps et al) and Resource/* tree 
#           into the executable, eliminating the need for these files
#           to be present at run time. Files will be placed in the 
#           %rom% device.
仮説:
  • --disable-compile-inits を指定しても、実際にはその指定は無視されている
    (追記: 間違い。無視されない。gs は共有ライブラリを参照するので確認方法に注意が必要
    --> 従って以下に書いてあることは全て調べる必要がなく、意味がない)
  • configure 的 COMPILE_INITS 変数の処理(代入)の順がおかしい -> × (白)
    grep COMPILE_INITS ./work/ghostscript-8.71/config.status
    S["COMPILE_INITS"]="0"
    
  • AC_SUBST(COMPILE_INITS) の行が反映されていない
    ./work/ghostscript-8.71/configure.ac:AC_SUBST(COMPILE_INITS) (白)
    ./work/ghostscript-8.71/Makefile.in:COMPILE_INITS=@COMPILE_INITS@
    
  • Makefile 的 COMPILE_INITS 変数の代入順がおかしい
  • (Makefile 内の) GS_LIB_DEFAULT の指定は適切に処理されず、 他の固定な探索順序が設定されている

以前の機械では --disable-compile-inits が有効になっている:

そう言えば、最近まで使っていた機械では、cidfmap を読んでくれていたので調べると、次のように compile-inits が無効になっている。
gs --help
....

Search path:
   . : /usr/pkg/share/ghostscript/8.71/Resource/Init :
   /usr/pkg/share/ghostscript/8.71/lib :
   /usr/pkg/share/ghostscript/8.71/Resource/Font :
   /usr/pkg/share/ghostscript/fonts :
   /usr/pkg/share/fonts/default/ghostscript :
   /usr/pkg/share/fonts/default/Type1 :
   /usr/pkg/share/fonts/default/TrueType : /usr/lib/DPS/outline/base :
   /usr/openwin/lib/X11/fonts/Type1 : /usr/openwin/lib/X11/fonts/TrueType
For more information, see /usr/pkg/share/ghostscript/8.71/doc/Use.htm.
Please report bugs to bugs.ghostscript.com.
さて、これはどうやって作ったのかな。
(いまもう一度 make して見たら、同じものが出来ている)
参考:
# The .ps library files and Resources tree are now compiled into Ghostscript by default. This means -Ilib is no longer needed when running gs uninstalled. Run './configure --disable-compile-inits' or set COMPILE_INITS=0 in the makefile to recover the old behaviour. The library files are still installed for reference.

ldd で見ると設置済の /usr/pkg/lib を参照している:

--disable-compile-inits が効かないと思っていたのは間違いでした。
今は gs -h で効くか、効かないかを確めていたのですが、実際には work/.destdir/pkg/bin/gs のまま確認していました。ところが、これは ldd で見ると、次のようになっていて、libgs.so については、作った ばかりのものではなく、設置済のものを見ていました。
t-105@makoto 16:32:47/110115(..print/ghostscript)% !ldd
ldd ./work/.destdir/usr/pkg/bin/gs
./work/.destdir/usr/pkg/bin/gs:
        -lgs.8 => /usr/pkg/lib/libgs.so.8
        -lXt.6 => /usr/pkg/lib/libXt.so.6
make package-install する前に、正しく確認するには、 次のように、共有ライブラリの探索位置を指定してやる必要がありました。
t-105@makoto 16:34:51/110115(..print/ghostscript)% \
env LD_LIBRARY_PATH=./work/.destdir/usr/pkg/lib  ./work/.destdir/usr/pkg/bin/gs -h



最近の日記
2024年05月08日
comparison on ./buildsh tools
2024年05月06日
py-setuptools (python 3.11.9)
make release took 1 hours and 10 min
qemu invocation for 10.99.10
2024年05月05日
Windows 10 version
serial connection
bc bench
2024年05月04日
Trial on 10.99.10
another version (later trial) to succeed
2024年04月29日
dkim
以上、1 日分です。
タイトル一覧
カテゴリ分類
Powered by hns-2.19.9, HyperNikkiSystem Project

Count.cgi (since 2000/02/05)