gd 2.0.23-i486


ページ作成日
ページ更新日
PNGなどのイメージフォーマットの画像を動的に生成するためのライブラリです。

1. Package情報

Package
gd-2.0.23-i486-1.tgz
GD Graphic Libaray
http://www.boutell.com/gd/

使用sourceファイル
gd-2.0.23.tar.gz

環境設定

特にありません。

3. Make it by yourself!

まずは、自分のホームディレクトリにソースを落としましょう。
例)/home/takehora/Downloads/gd-2.0.23.tar.gz
次に、ソースを解凍して展開します。
$ tar -zxvf gd-2.0.23.tar.gz                                                    
configureのスクリプトを走らせます。
$ cd ~/Downloads/gd-2.0.23
$ ./configure --prefix=/usr --sysconfdir=/etc --infodir=/usr/share/info         
  --mandir=/usr/share/man
[画面出力を略]

** Configuration summary for gd 2.0.23:

   Support for PNG library:          yes
   Support for JPEG library:         yes
   Support for Freetype 2.x library: yes
   Support for Xpm library:          yes

configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/Makefile
config.status: creating config/gdlib-config
config.status: creating test/Makefile
config.status: creating config.h
config.status: executing depfiles commands

makeします。
ソースファイル中のreadme.jpnに記載がありますが、Unicodeエンコーディングのフォントに対してもJIS系の日本語(EUC、SJIS、7bit JIS)を使用する場合は、 コンパイル時に-DJISX0208を付けてコンパイルする必要があります。
こうすると、gdImageStringTTF()で指定された文字列にASCII以外の文字があると無条件に日本語文字列であると解釈されて、漢字コードを自動判別後に 適切に処理されます。
但し、この場合、UTF-8の日本語文字列を扱えなくなります。
漢字コードの変換にiconvを使う場合は、-DHAVE_ICONVを付けます。
漢字コード変換の際にエラーが発生した場合に適切なメッセージを出させるためには、-DHAVE_STRING_H -DHAVE_ERROR_Hを付けます。
$ make CFLAGS='-DJISX0208 -DHAVE_ICONV -DHAVE_STRING_H -DHAVE_ERROR_H'          
ここでrootに代わり、make installします。
$ su
Password:

# make install-strip prefix=/var/tmp/gd-2.0.23/usr                              
パッケージを作成します。
# cd /var/tmp/gd-2.0.23
# makepkg --linkadd y --chown y gd-2.0.23-i486-1.tgz

Slackware package maker, version 2.1.

Searching for symbolic links:
usr/lib/libgd.so.2 -> libgd.so.2.0.0
usr/lib/libgd.so -> libgd.so.2.0.0

Making symbolic link creation script:
( cd usr/lib ; rm -rf libgd.so.2 )
( cd usr/lib ; ln -sf libgd.so.2.0.0 libgd.so.2 )
( cd usr/lib ; rm -rf libgd.so )
( cd usr/lib ; ln -sf libgd.so.2.0.0 libgd.so )

It is recommended that you make these lines your new installation script.

Would you like to make this stuff the install script for this package
and remove the symbolic links ([y]es, [n]o)? y


Removing symbolic links:
removed `./usr/lib/libgd.so.2'
removed `./usr/lib/libgd.so'

Creating your new ./install/doinst.sh...

This next step is optional - you can set the directories in your package
to some sane permissions. If any of the directories in your package have
special permissions, then DO NOT reset them here!

Would you like to reset all directory permissions to 755 (drwxr-xr-x) and
directory ownerships to root.root ([y]es, [n]o)? y
[画面出力を略]
tar-1.13: gd-2.0.23-i486-1.tar is the archive; not dumped

Gzipping gd-2.0.23-i486-1.tar...

Renaming gd-2.0.23-i486-1.tar.gz to gd-2.0.23-i486-1.tgz...

Package creation complete.
# ls
gd-2.0.23-i486-1.tgz  usr
あとは、このパッケージのパーミッションを755に変更して、パッケージをインストールすればOK♪
# chmod 755 gd-2.0.23-i486-1.tgz
# installpkg gd-2.0.23-i486-1.tgz                                              
Enjoy your Slackware life!

Top Pageに戻る

Written by Yoichiro Takehora
E-mail:takehora@firstandfast.net