--- title: 第10章 Motif を必要とする port prev: books/porters-handbook/porting-manpages next: books/porters-handbook/x11-fonts showBookMenu: true weight: 10 params: path: "/books/porters-handbook/porting-motif/" --- [[porting-motif]] = Motif を必要とする port :doctype: book :toc: macro :toclevels: 1 :icons: font :sectnums: :sectnumlevels: 6 :sectnumoffset: 10 :partnums: :source-highlighter: rouge :experimental: :images-path: books/porters-handbook/ ifdef::env-beastie[] ifdef::backend-html5[] :imagesdir: ../../../../images/{images-path} endif::[] ifndef::book[] include::shared/authors.adoc[] include::shared/mirrors.adoc[] include::shared/releases.adoc[] include::shared/attributes/attributes-{{% lang %}}.adoc[] include::shared/{{% lang %}}/teams.adoc[] include::shared/{{% lang %}}/mailing-lists.adoc[] include::shared/{{% lang %}}/urls.adoc[] toc::[] endif::[] ifdef::backend-pdf,backend-epub3[] include::../../../../../shared/asciidoctor.adoc[] endif::[] endif::[] ifndef::env-beastie[] toc::[] include::../../../../../shared/asciidoctor.adoc[] endif::[] コンパイルに Motif ライブラリを必要とするアプリケーションがいくつかあります (Motif 自体は有料のものがいくつかの会社から手に入りますし、 package:x11-toolkits/lesstif[] には多くのアプリケーションを動作させることが可能な無料の互換ライブラリもあります)。 Motif は広く使われているツールキットですし、 有料のもののライセンスでもライブラリを静的にリンクした実行形式の再配布が認められている場合が多いので、 Motif を必要とするソフトウェアを簡単に (port からコンパイルする人々のために) 動的にでも、 (package を配布する人々のために) 静的にでもリンクできるような仕組みが用意されています。 [[motif-use]] == `USE_MOTIF` Motif が無いとコンパイルできない port の [.filename]#Makefile# では、この変数を指定してください。 これにより、Motif を持っていない人がこの port をコンパイルしようとするのを未然に防ぎます。 [[motif-lib]] == `MOTIFLIB` この変数は [.filename]#bsd.port.mk# によって適当な Motif ライブラリの指定に置き換えられます。Port のソースの [.filename]#Makefile# や [.filename]#Imakefile# で Motif ライブラリを参照しているところを、 この変数を参照するようにパッチを適用してください。 代表的な例としては以下の二つがあげられます: . Makefile か Imakefile の中で Motif ライブラリが `-lXm` として使われている場合には、 かわりに `MOTIFLIB` と書いてください。 . Imakefile の中で `XmClientLibs` が使われている場合には、それを `${MOTIFLIB} ${XTOOLLIB} ${XLIB}` と書きかえてください。 なお `MOTIFLIB` は通常、 `-L/usr/X11R6/lib -lXm` か `/usr/X11R6/lib/libXm.a` に置き換えられます。 したがって前に `-L` や `-l` をつける必要はありません。