Namazu-users-ja(旧)


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make error on Mac OS X



甲斐です。

On 2003.6.8, at 01:54 Asia/Tokyo, Tadamasa Teranishi wrote:

> 寺西です。
---
> Yasuaki KAI wrote:
>>
>> [namazu-users-ja:01643] NAMAZU on Darwin (MAC OS X) に書かれ
>> ている現象と酷似しているので、スレッドを参考に nmz/Makefile
>> の 165行目「LIBS = -lm 」を「LIBS = 」として make してみまし
>> たが、結果は全く変化ありませんでした。
>> 以後の対処の仕方が分かりません。
>
> http://www.namazu.org/ml/namazu-users-ja/msg01653.html
> にもありますが、どうやら、libm のシンボルと衝突しているようですね。
---
>> ld: multiple definitions of symbol _getopt
>> /usr/lib/libc.dylib(getopt.So) definition of _getopt
>> ../lib/libnmzut.a(getopt.o) definition of _getopt in section
>> (__TEXT,__text)
>> ld: multiple definitions of symbol _opterr
>> /usr/lib/libc.dylib(getopt.So) definition of _opterr
>> ../lib/libnmzut.a(getopt.o) definition of _opterr in section
>> (__DATA,__data)
>
> とりあえず、lib/Makefile, nmz/Makefile, src/Makefile の
> 「LIBS = -lm 」を「LIBS = 」として、make clean ; make
> してみてはいかがでしょう。
>
> # しかし、nmz/hlist.c, nmz/score.c で math.h をインクルードして
> # いるのに -lm を外していいのだろうか!?

寺西さん、早速のアドバイス有り難うございます。即刻やってみました。
makeの結果は下記のようで、どうもこれではうまく行かないようです。

gcc -g -O2 -Wall -pedantic -o namazu form.o namazu.o output.o rcfile.o
result.o usage.o namazu-cmd.o /usr/local/lib/libintl.dylib -L/usr/local/lib
-lc /usr/local/lib/libiconv.dylib ../nmz/.libs/libnmz.a ../lib/libnmzut.a
ld: multiple definitions of symbol _getopt
/usr/lib/libc.dylib(getopt.So) definition of _getopt
../lib/libnmzut.a(getopt.o) definition of _getopt in section (__TEXT,__text)
ld: multiple definitions of symbol _opterr
/usr/lib/libc.dylib(getopt.So) definition of _opterr
../lib/libnmzut.a(getopt.o) definition of _opterr in section (__DATA,__data)
ld: multiple definitions of symbol _optind
/usr/lib/libc.dylib(getopt.So) definition of _optind
../lib/libnmzut.a(getopt.o) definition of _optind in section (__DATA,__data)
ld: multiple definitions of symbol _optopt
/usr/lib/libc.dylib(getopt.So) definition of _optopt
../lib/libnmzut.a(getopt.o) definition of _optopt in section (__DATA,__data)
ld: warning multiple definitions of symbol _locale_charset
/usr/local/lib/libintl.dylib(localcharset.lo) definition of _locale_charset
/usr/local/lib/libiconv.dylib(localcharset.lo) definition of _locale_charset
make[2]: *** [namazu] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive-am] Error 2

http://hp.vector.co.jp/authors/VA010318/intro/ama02/021026.html
に以下の記述がありましたので試してみました。
------------------------------------------------------------
 これでいよいよ、Namazuのビルド(の前にconfigure)ができる。
% cd ..
./configure

ここで、kakasiが分かち書きのプロセッサとして認識されているかど
うかを確認しておく。
 また、このままmakeすると2重定義のエラーが発生してしまうため、
lib/getopt.cとlib/getopt.hを一部編集する。具体的には、これらの
ソース内で使用されているoptget、opterr、optind、optoptをそれぞれ
別の名前に変更する(optget_tとか)。あるいは、これらの定義を
削除するという方法もあると思う。それができたら、ビルドし、インストール。
% make
% sudo make install
------------------------------------------------------------

lib/getopt.c, lib/getopt.h, lib/getopt1.cの3ファイルの4変数 getopt,
opterr, optind, optopt をそれぞれ getopt_t, opterr_t, optind_t,
optopt_t に変更して ./configure; make としてみると、とりあえずエラー
はでずに終了しました。make check とやってみるとmknmz, gcnmz, idxiff,
namazu-cgi, ja-mknmz, ja-namazu-cgiはPASSでしたが、namazu-1〜namazu-9,
namazu-11はFAILとなっていました。namazuのビルドには問題が残っていそう
です。

FAIL: namazu-1
FAIL: namazu-2
FAIL: namazu-3
FAIL: namazu-4
FAIL: namazu-5
cmp: EOF on /Users/kai/pkgf/namazu-2.0.12/tests/tmp
FAIL: namazu-6
FAIL: namazu-7
FAIL: namazu-8
FAIL: namazu-9
PASS: namazu-10
FAIL: namazu-11
PASS: namazu-12
PASS: namazu-cgi-1
PASS: namazu-cgi-2
PASS: namazu-cgi-3
PASS: namazu-cgi-4
PASS: namazu-cgi-5
PASS: namazu-cgi-6
PASS: namazu-cgi-7
PASS: namazu-cgi-8
PASS: namazu-cgi-9
PASS: namazu-cgi-10
PASS: ja-mknmz-1
PASS: ja-namazu-cgi-1
=====================
10 of 45 tests failed
=====================
make[3]: *** [check-TESTS] Error 1
make[2]: *** [check-am] Error 2
make[1]: *** [check-recursive] Error 1
make: *** [check-recursive] Error 1

その後、make installしてTerminal上で使用する分には使えているようですが、
大いに不安な状態ではあります。

------------------------------------------------------------------------ -------
甲斐 康朗 (Yasuaki KAI) kai@xxxxxxxxxxxxxx