読者です 読者をやめる 読者になる 読者になる

FIELD NOTES: 書を持って街へ出よう

合同会社フィールドワークス プログラマ兼代表のブログ

CamlPDFをFindlibで管理する

開発環境

CamlPDFのビルドにはOCamlMakefileを使用しているが,make libinstallを実行してもライブラリとしてインストールされない。そこで,ライブラリとしてインストールできるようにmakefileを修正した。

変更点は,一点。makefileにLIBINSTALL_FILESの宣言を追加した。

LIBINSTALL_FILES = utility.cmi utility.mli \
          istring.cmi istring.mli \
          io.cmi io.mli \
          unzip.cmi unzip.mli \
          pdfio.cmi pdfio.mli \
          cgenlex.cmi cgenlex.mli \
          zlib.cmi zlib.mli \
          zlibstubs.c \
          transform.cmi transform.mli \
          units.cmi units.mli \
          paper.cmi paper.mli \
          pdf.cmi pdf.mli \
          pdfcrypt.cmi pdfcrypt.mli \
          pdfwrite.cmi pdfwrite.mli \
          pdfcodec.cmi pdfcodec.mli \
          pdfread.cmi pdfread.mli \
          pdfpages.cmi pdfpages.mli \
          pdfdoc.cmi pdfdoc.mli \
          pdfannot.cmi pdfannot.mli \
          pdffun.cmi pdffun.mli \
          pdfspace.cmi pdfspace.mli \
          pdfimage.cmi pdfimage.mli \
          glyphlist.cmi glyphlist.mli \
          pdftext.cmi pdftext.mli \
          fonttables.cmi fonttables.mli \
          pdfgraphics.cmi pdfgraphics.mli \
          pdfmarks.cmi pdfmarks.mli \
          cff.cmi cff.mli \
          $(RESULT).cma $(RESULT).cmxa \
          $(RESULT).$(EXT_LIB) $(RES_CLIB)

インストールする。

$ sudo make libinstall
make[1]: `libcamlpdf_stubs.a' is up to date.
make[1]: `camlpdf.cma' is up to date.
make[1]: `libcamlpdf_stubs.a' is up to date.
make[1]: `camlpdf.cmxa' is up to date.

Installing library with ocamlfind
ocamlfind install  camlpdf META utility.cmi utility.mli istring.cmi istring.mli io.cmi io.mli unzip.cmi unzip.mli pdfio.cmi pdfio.mli cgenlex.cmi cgenlex.mli zlib.cmi zlib.mli zlibstubs.c transform.cmi transform.mli units.cmi units.mli paper.cmi paper.mli pdf.cmi pdf.mli pdfcrypt.cmi pdfcrypt.mli pdfwrite.cmi pdfwrite.mli pdfcodec.cmi pdfcodec.mli pdfread.cmi pdfread.mli pdfpages.cmi pdfpages.mli pdfdoc.cmi pdfdoc.mli pdfannot.cmi pdfannot.mli pdffun.cmi pdffun.mli pdfspace.cmi pdfspace.mli pdfimage.cmi pdfimage.mli glyphlist.cmi glyphlist.mli pdftext.cmi pdftext.mli fonttables.cmi fonttables.mli pdfgraphics.cmi pdfgraphics.mli pdfmarks.cmi pdfmarks.mli cff.cmi cff.mli camlpdf.cma camlpdf.cmxa camlpdf.a libcamlpdf_stubs.a
Installed /opt/local/lib/site-lib/camlpdf/libcamlpdf_stubs.a
Installed /opt/local/lib/site-lib/camlpdf/camlpdf.a
Installed /opt/local/lib/site-lib/camlpdf/camlpdf.cmxa
Installed /opt/local/lib/site-lib/camlpdf/camlpdf.cma
Installed /opt/local/lib/site-lib/camlpdf/cff.mli
Installed /opt/local/lib/site-lib/camlpdf/cff.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfmarks.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfmarks.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfgraphics.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfgraphics.cmi
Installed /opt/local/lib/site-lib/camlpdf/fonttables.mli
Installed /opt/local/lib/site-lib/camlpdf/fonttables.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdftext.mli
Installed /opt/local/lib/site-lib/camlpdf/pdftext.cmi
Installed /opt/local/lib/site-lib/camlpdf/glyphlist.mli
Installed /opt/local/lib/site-lib/camlpdf/glyphlist.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfimage.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfimage.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfspace.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfspace.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdffun.mli
Installed /opt/local/lib/site-lib/camlpdf/pdffun.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfannot.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfannot.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfdoc.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfdoc.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfpages.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfpages.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfread.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfread.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfcodec.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfcodec.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfwrite.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfwrite.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfcrypt.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfcrypt.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdf.mli
Installed /opt/local/lib/site-lib/camlpdf/pdf.cmi
Installed /opt/local/lib/site-lib/camlpdf/paper.mli
Installed /opt/local/lib/site-lib/camlpdf/paper.cmi
Installed /opt/local/lib/site-lib/camlpdf/units.mli
Installed /opt/local/lib/site-lib/camlpdf/units.cmi
Installed /opt/local/lib/site-lib/camlpdf/transform.mli
Installed /opt/local/lib/site-lib/camlpdf/transform.cmi
Installed /opt/local/lib/site-lib/camlpdf/zlibstubs.c
Installed /opt/local/lib/site-lib/camlpdf/zlib.mli
Installed /opt/local/lib/site-lib/camlpdf/zlib.cmi
Installed /opt/local/lib/site-lib/camlpdf/cgenlex.mli
Installed /opt/local/lib/site-lib/camlpdf/cgenlex.cmi
Installed /opt/local/lib/site-lib/camlpdf/pdfio.mli
Installed /opt/local/lib/site-lib/camlpdf/pdfio.cmi
Installed /opt/local/lib/site-lib/camlpdf/unzip.mli
Installed /opt/local/lib/site-lib/camlpdf/unzip.cmi
Installed /opt/local/lib/site-lib/camlpdf/io.mli
Installed /opt/local/lib/site-lib/camlpdf/io.cmi
Installed /opt/local/lib/site-lib/camlpdf/istring.mli
Installed /opt/local/lib/site-lib/camlpdf/istring.cmi
Installed /opt/local/lib/site-lib/camlpdf/utility.mli
Installed /opt/local/lib/site-lib/camlpdf/utility.cmi
Installed /opt/local/lib/site-lib/camlpdf/META

Installation successful.

サンプルプログラムを別ディレクトリにコピーして試す。

$ ocamlfind ocamlc -o pdfhello -linkpkg -package camlpdf pdfhello.ml

問題なくコンパイル終了。

広告を非表示にする