These pages are written by only Japanese.

Welcom to My Diary.com
最新の日記タイトル一覧カテゴリ別タイトル一覧トップへ戻る〜

おはようございます♪ 現在は5月4日(土)9時6分。 今日も頑張りましょう。


hns - 日記自動生成システム - Version 2.19.5 (色々 Fixed)

先月 2008年01月 来月
01 02 03 04 05
06 07 08 09 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 による簡易全文検索です。
詳細は 詳細指定/ヘルプをご参照下さい。
検索式:

2008年01月26日(土)

ming 導入

まずはコードを取得。current で。
cvs -z3 -d:pserver:anonymous@ming.cvs.sourceforge.net:/cvsroot/ming co -P ming
↑こちらを参考にインストール。

jpeg patch:

まずは、JPEG パッチ *1 を当てる。(flash lite 実行環境は画像フォーマットに好き嫌いがあるので、その対策らしい)
$ wget http://auicon.freeownhost.com/pc/dev/ming/jpeg.c.diff
$ patch -b jpeg.c jpeg.c.diff
patching file jpeg.c
Hunk #1 succeeded at 129 (offset 6 lines).
Hunk #3 succeeded at 310 (offset 11 lines).
ちなみに -b は backup オプション。
(2008/07/25 追記) パッチを公開していたサーバがアクセスできなくなっているので、↑代わり
ついでに JPEG に関するまとめ。↓

configure:

%  ./autogen.sh
Running aclocal -I macros
Running libtoolize --automake
./autogen.sh: line 15: libtoolize: command not found

  Something went wrong, bailing out!
むー。libtool 入ってなかったか…
yum install libtool
./configure
<略>
Config summary:
  C++ enabled
  Perl extension disabled
  PHP extension disabled
  Python extension disabled
  Tcl extension disabled
  ZLIB enabled (-lz)
  Freetype library enabled (/usr/bin/freetype-config)
  GIF library disabled
  PNG library enabled (-lpng)
色々負けてる…
# yum install giflib-devel
# exit
% ./configure --enable-perl --enable-php
<略>
Config summary:
  C++ enabled
  Perl extension enabled
  PHP extension enabled
  Python extension disabled
  Tcl extension disabled
  ZLIB enabled (-lz)
  Freetype library enabled (/usr/bin/freetype-config)
  GIF library enabled (-lungif)
  PNG library enabled (-lpng)
よし…
% make
	<略>
% su
Password:
# make install
	<略>

さて php で…:

によるとコンパイル手順は、
    mkdir <phpdir>/ext/ming
    cp php_ext/* <phpdir>/ext/ming
    cd <phpdir>
    ./buildconf 
    ./configure --with-ming <other config options>
なんだけど、php を yum で入れてるのでどうしよう…
php 自体もいい加減(5.1.6)古いので、これを機会に入れなおそうかとも思うけど、 yum upgrade 対象外になるのは後々、面倒そう。う~む…

php-5.1.6 ツリー上でコンパイル:

yum で入れた php に config オプションはあわせて、 php-5.1.6 のソースをコンパイルしてみた。
php -i | grep Configure
Configure Command =>  './configure' '--build=i686-redhat-linux-gnu'
<以下略>
php -i | grep Configure > ../php-config-option.txt
vi ../php-config-option.txt
sh ../php-config-option.txt
<略>

環境整備:

色々とヘッダが足りなくてエラーが…
checking for PCRE support... yes
configure: error: Could not find pcre.h in /usr
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution
checking for db4 major version... configure: error: Header contains different version
checking for GNU MP support... yes
configure: error: Unable to locate gmp.h
configure: error: Cannot find rfc822.h. Please check your c-client installation.
configure: error: Cannot find ldap.h
configure: error: Cannot find MySQL header files under /usr.
Note that the MySQL client library is not bundled anymore!
checking for ncurses support... yes, shared
checking for unixODBC support... configure: error: ODBC header file '/usr/include/sqlext.h' not found!
not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
checking for sqlite3 files in default path... not found
configure: error: Please reinstall the sqlite3 distribution
checking for PSPELL support... yes
configure: error: Cannot find pspell
configure: error: SNMP sanity check failed. Please check config.log for more information.
必要に応じて -devel パッケージをインストール
# yum install pcre-devel
# yum install bzip2-devel
# yum install db4-devel
# yum install gmp-devel
# yum install libc-client-devel
# yum install openldap-devel
# yum install mysql-devel
# yum install ncurses-devel
# yum install unixODBC-devel
# yum install postgresql-devel
# yum install sqlite-devel
# yum install aspell-devel
# yum install net-snmp-devel

configure (--with-ming で失敗):

さて、php-config.txt に --with-ming を付け足してと…
% sh ../php-config-option.txt
make
ming は php に入ってるのでそのまま。
/home/yoya/src/php-5.1.6/ext/ming/ming.c:2104: error: too many arguments to function 'newSWFMovie'
/home/yoya/src/php-5.1.6/ext/ming/ming.c:2106: error: too many arguments to function 'newSWFMovie'
/usr/local/ に current の ming が入っているので微妙か…
% cd ext/ming/ ext/ming.orig
% cp -r ~/src/flash/ming/php_ext/* ext/ming/.
% sh ../php-config-option.txt
% make
<略>
ext/ming/.libs/ming.o: In function `zif_ming_useSWFVersion':
/home/yoya/src/php-5.1.6/ext/ming/ming.c:121: multiple definition of `zif_ming_useSWFVersion'
ext/ming/.libs/ming.o:/home/yoya/src/php-5.1.6/ext/ming/ming.c:121: first defined here
ext/ming/.libs/ming.o:(.data.rel+0x0): multiple definition of `ming_module_entry'
ext/ming/.libs/ming.o:(.data.rel+0x0): first defined here
collect2: ld returned 1 exit status
駄目か…

configure (--enable-ming で成功):

sh ../php-config-option.txt (--with-ming を --enable-ming に変更)
make
<略>
Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).
やはり…

インストール:

% cd ext/ming;
% sh make_module.sh
% mv ext/ming/tmp/modules/ming.so /usr/lib/php/modules/.

動作確認:

<?php
dl('ming.so');
ming_useswfversion(4);
$swf = new SWFMovie();
$swf->setDimension(640, 480);
$swf->add(new SWFBitmap(fopen('/home/yoya/prog/flash/image1.jpg', 'rb')));
$swf->save('sample.swf');
?>
成功。
% cat > /etc/php.d/ming.ini
; Enable ming extension module
extension=ming.so
^d

。。。:

↓こっち参考にして作業すればよかった… (⊃д⊂)

*1: 詳細や JPEG パッチの cache はこちら。
http://pwiki.awm.jp/~yoya/?Flash/JPEG


これで、1 日分だよ〜。

タイトル一覧
カテゴリ分類
Database
JXTA
Java
XML
awm
bookmark
keyword
memo
news
research
Powered by hns-2.19.5, HyperNikkiSystem Project