Fedra6にwebalizer-2.01-10をインストールした顛末です。
You must have a V1.85 compatable DB libraryっていわれる
ホスト名を逆引きしたいので
./configure --with-language=japanese --enable-dns
とすると
[root@vesalius webalizer-2.01-10]# ./configure --with-language=japanese --e
nable-dns
loading cache ./config.cache
checking for gcc... (cached) gcc
checking whether the C compiler (gcc ) works... yes
checking whether the C compiler (gcc ) is a cross-compiler... no
checking whether we are using GNU C... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking whether ln -s works... (cached) yes
checking for a BSD compatible install... (cached) /usr/bin/install -c
checking how to run the C preprocessor... (cached) gcc -E
checking whether char is unsigned... (cached) no
checking for dbopen... (cached) no
checking for library containing dbopen... (cached) no
configure: warning: You must have a V1.85 compatable DB library!
configure: warning: DNS lookup code will be disabled...
checking for socket... (cached) yes
checking for sys/socket.h... (cached) yes
checking for main in -lnsl... (cached) yes
checking for main in -l44bsd... (cached) no
checking for main in -lm... (cached) yes
checking for main in -lz... (cached) yes
checking for gzrewind in -lz... (cached) yes
checking for main in -lpng... (cached) yes
checking for gdImagePng in -lgd... (cached) yes
checking for gd.h... (cached) /usr/include
checking for getopt.h... (cached) yes
checking for math.h... (cached) yes
checking default config dir... (cached) /etc
checking for language file... yes - japanese
creating ./config.status
creating Makefile
linking ./lang/webalizer_lang.japanese to webalizer_lang.h
[root@vesalius webalizer-2.01-10]#
ってなる。コンパイルもでき、実行もできるのだけど、DNSCacheとDNSChildrenの設定をしてあると
Warning: Invalid keyword 'DNSCache' (/etc/webalizer.conf)
Warning: Invalid keyword 'DNSChildren' (/etc/webalizer.conf)
っていわれてしまい、逆引きもできていない。configure時の
configure: warning: You must have a V1.85 compatable DB library!
configure: warning: DNS lookup code will be disabled...
の警告に起因しているみたいだ。Berkeley DBの1.85を用意せよとおっしゃる。なので、rpmから
- db4-devel-4.3.29-9.fc6
- db4-4.3.29-9.fc6
を入れておく
Berkeley DBを使ってコンパイル
rpmから入れたBerkeleyDBを使うように
./configure --with-language=japanese --enable-dns --with-dblib=/usr/lib -with-db=/usr/include
とすると、configure時の警告は消えるが、今後は、コンパイルが通らない
dns_resolv.c: In function `resolve_dns':
dns_resolv.c:149: warning: passing arg 2 of pointer to function from incompatible pointer type
dns_resolv.c:149: error: too few arguments to function
dns_resolv.c: In function `dns_resolver':
dns_resolv.c:218: warning: implicit declaration of function `dbopen'
dns_resolv.c:218: warning: assignment makes pointer from integer without a cast
dns_resolv.c:228: error: too few arguments to function
dns_resolv.c:235: error: too few arguments to function
dns_resolv.c:275: warning: passing arg 2 of pointer to function from incompatible pointer type
dns_resolv.c:275: error: too few arguments to function
dns_resolv.c:329: error: too few arguments to function
dns_resolv.c:359: error: too few arguments to function
dns_resolv.c: In function `db_put':
dns_resolv.c:745: warning: passing arg 2 of pointer to function from incompatible pointer type
dns_resolv.c:745: error: too few arguments to function
dns_resolv.c: In function `open_cache':
dns_resolv.c:793: warning: assignment makes pointer from integer without a cast
dns_resolv.c:801: error: too few arguments to function
dns_resolv.c:807: error: too few arguments to function
dns_resolv.c: In function `close_cache':
dns_resolv.c:829: error: too few arguments to function
make: *** [dns_resolv.o] Error 1
引数の数が違うとな。/usr/include/db.hとdns_resolv.cを見比べるとやっぱり、引数数が合わない。むむむと、dns_resolv.cと睨めっこしていると
ifdef HAVE_DB_185_H
#include <db_185.h> /* on my RH6.0 system ?!? */
#else
#include <db.h> /* DB header ****************/
#endif /* HAVE_DB_185_H */
という記述を発見。db_185.hがあるとな。最初の警告にあるV1.85と符合する。db_185.hを探すと/usr/include/db4/にヘッダファイルを発見。これを読ませればいいんだな。ということで、
CFLAGS='-DHAVE_DB_185_H' ./configure --with-language=japanese --enable-dns --with-dblib=/usr/lib --with-db=/usr/include
としてコンパイル。これでコンパイル時の問題と実行時の問題が無事解決です。