proglog

主にプログラミングに関する断片的メモ

(続)CygwinでGaucheのtrunkをビルドしてみる、と、http-post

結論からいうと、うまくいった!
というか、シンプルにいけるものだったんだ。

trunkのリビジョンは7112

現在使っている、リリースのGauche 0.9がそのままシステムにある状態でビルド作業をしている。

いろいろとあった紆余曲折は、結局リビジョン7111とリビジョン7112の境目にぶち当たったことから来たものだったみたい。
最初7111でやってて、どうにもおかしなことになって7112に更新した。
でもこの更新後の処理が適切でなかったということらしい。

そこで ここ教えてもらったように、

make maintainer-clean
./DIST gen
configure
make

の手順で、全くエラーなくmake完了。
実はdocでinfo作る時もseg faultしてたけど、これもなくなった。

そのあとメッセージが出るので、ash上で

rebaseall -v -T dlls.txt

make testは、

Testing gauche.process ...                                       failed.
discrepancies found.  Errors are:
test call-with-process-io: expects "test.o\n" => got "test.o\ntest.out\n"


Testing system ...                                               gosh: "error": string required, but got #<<read-error> "Read error at \"test.out\":line 2: read-line: encountered illegal byte sequence: #*\"drwxr-x---+ 1 someone \\x82\\xc8\\x82\\xb5 0 2010-04-27 22:14 test.dir\"">

というのが出る。
これはsjis-cygiwnの問題と、なんだろう、中間ファイルかと思ったら実行ファイルだった、みたいな感じ?

あんまり問題無さそうな感じなので、そのままmake install。
そしてようやく本題。

http-post

これの第3引き数bodyをname-valueのリストで使うケース。
ここで教えてもらったようにうまく受け取れた。
www.cgi側の問題だったらしい。

たただ、perlCGI.pmではうまく受け取れないが、これについてはまだよく分からない。

作業中のメモ

単なる記録

ソースを落としてくる
svn co https://gauche.svn.sourceforge.net/svnroot/gauche/Gauche/trunk gauche/trunk
大文字で始まるGaucheを間に挟まないとtrunkから取得できない。
リビジョン7111

autoconf
gauche-config --reconfigure | sh
make失敗
src/goshがないとか
ひょっとして前回のビルドの残りがあると言う前提か
ということで0.9のディレクトリにtrunkを丸ごと上書きコピー


=== configuring in gc (/home/someone/devel/cygwin/gauche/trunk/gc)
configure: WARNING: no configuration information is in gc

This Gauche has been configured with the following parameters:
version: 0.9.1_pre1
multibyte: utf8
slib: /usr/local/lib/slib
thread: pthreads
optional modules: odbm ndbm gdbm zlib

gc でautoconf
configure

=== configuring in libatomic_ops (/home/someone/devel/cygwin/gauche/trunk/gc/libatomic_ops)
configure: WARNING: no configuration information is in libatomic_ops

aclocal.m4:16: warning: this file was generated for autoconf 2.64.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.
VENUS:~/devel/cygwin/gauche/trunk/gc/libatomic_ops$ autoconf --version
autoconf (GNU Autoconf) 2.65

そのままconfigure


builtin-syms.hがない、というエラーがでる。
どうも、出来上がったgoshで生成してるっぽい。
そこで
Gauche:Bugs:log3
を参考にして

make GOSH=/c/scheme/Gauche/bin/gosh.exe

0.9のcygwin goshはさっき、強引にtrunk goshをインストールした時に上書きされちゃったから。

dll関係で、物凄い勢いでエラーが出る。
が、makeは終わった。
そのあと、

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! I M P O R T A N T !!
!! !!
!! You need to run "rebaseall" with the following command line in this !!
!! directory, before running "make install" or even "make check". !!
!! !!
!! $ /bin/rebaseall -v -T dlls.txt !!
!! !!
!! It must be run without running other Cygwin processes but ash. !!
!! (You must not even run bash. Close all cygwin windows, open Windows !!
!! command prompt, run \cygwin\bin\ash (the actual path may differ !!
!! depending on how you install cygwin), cd to your build directory, !!
!! then run the above command.) !!
!! See http://www.tishler.net/jason/software/rebase/rebase-2.4.2.README !!
!! for more details. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
というメッセージが出た。
dllの再配置をするらしい。
なんかヤバい雰囲気。
mingw goshを使ったからだろう。
と言う訳で、いったん中止して、リリースバージョンの0.9からやり直す。
make uninstall
make clean

Gauche 0.9を1からビルドする。
autoconf
configure --with-slib=/usr/local/lib/slib
make

あ、結局rebase必要なんだ
全域にわたって再配置した模様

make test
Total: 9962 tests, 9961 passed, 1 failed, 1 aborted.
Testing gauche.process ... failed.
よしとして
make install
wiliki.cgiを動かして、書き込めるかだけ確認した。
ok

そしてtrunkのビルドに移る。

念のため、configure
gcとlibatomic_opsはそのまんま。

This Gauche has been configured with the following parameters:
version: 0.9.1_pre1
multibyte: utf8
slib: /usr/local/lib/slib
thread: pthreads
optional modules: odbm ndbm gdbm zlib
make


途中からsrc/goshを使いだしてる
が、
/home/someone/devel/cygwin/gauche/trunk/ext/util
match.scm
/home/someone/devel/cygwin/gauche/trunk/ext/srfi
srfi-13.c
のエラーが出る。

結局
../src/gosh -q -I../src -I../lib -lgauche-init ./extract -en -o gauche-refe.texi gauche-ref.texi
make[1]: *** [gauche-refe.texi] Segmentation fault (core dumped)
make[1]: Leaving directory `/home/someone/devel/cygwin/gauche/trunk/doc'
make: *** [all] Error 2
でmakeが止まる

docのMakefileに空のターゲットを作って、終了させる


また、
$ /bin/rebaseall -v -T dlls.txt


make test
Total: 9625 tests, 9624 passed, 1 failed, 3 aborted.


Gauche 0.9 on OpenSolaris 2009.06、全テストパス! - そーり日誌を参考に。
make CC="gcc-4 -std=gnu99" CFLAGS="-march=pentium4 -msse2 -O2 -fschedule-insns2"



やはり同じ。

念の為に、リポジトリを見に行く。
U src/compile.scm
Updated to revision 7112.

これでもう一度
最適化オプションをいじる。
gccをgcc3から4に変えてみる。
いったんここまでにして、ブログに記録。