mysql:853
From: ( T.P.S. 中川 ) <<yaemon@xxxxxxxxxx>>
Date: Mon, 3 May 1999 04:36:34 +0900 (JST)
Subject: [mysql 00853] Comile error in egcs-2.91.50
はじめまして。パイプ喫いの中川と申す者です。
FreeBSD 2.2.7 + egcs-2.91.50 の環境下で、mysql-3.22.21 の
コンパイルに失敗して強引な手段で回避したので報告いたします。
今回が初めてのmysql のコンパイルですので、もしも既に有名な
話でしたら、どうもすみません。
-----------------------------------------------------------------
1. 私の環境
egcs-2.91.50 は FreeBSD のパッケージからインストール
したもの
mysql-3.22.21.tar.gz は 4月5日のタイムスタンプ。
ftp://mirror.nucba.ac.jp/mirror/mysql/ より取得
3.22.22 を選ばなかったのは、こちらの方が安定版である、
という記述を http://www.softagency.co.jp/mysql/ で
拝見したからです。
2. 素直に回避したところ
何も考えずに
% ./configure && make
と入力すると、gcc と c++ を呼び出すため(と思われる)
コンパイルエラーが割に早く出て詰まる。
( c++ は gcc-2.7.2.1 )
% CCC=g++ ./congiure
で後述のコンパイルエラーにつかまる。
FreeBSD ports-stable から mysql322 を持ってくる。
ports用の環境を upgrade していないので直截には使えない。
portsのパッチをあて、ports のMakefile を参考に
% CCC=g++ ./configure --with-charset=ujis --with-mit-treads=yes
に変更。 同じコンパイルエラーにつかまる。
% CCC=g++ ./configure --with-charset=ujis --with-mit-treads=yes \
--without-readline --localstatedir=/var/db/mysql
でやはり同じコンパイルエラーにつかまる。
3. 強引に回避したところ
エラーメッセージは
HAREDIR="\"/usr/local/share/mysql\"" -DHAVE_CONFIG_H \
-I../mit-pthreads/include -I./../include -I./../regex \
-I. -I../include -I.. -I. -fno-implicit-templates -DDBUG_OFF \
-c mysqld.cc
mysqld.cc: In function `void * handle_connections_sockets(void *)':
mysqld.cc:1464: `select' undeclared (first use this function)
mysqld.cc:1464: (Each undeclared identifier is reported only once
mysqld.cc:1464: for each function it appears in.)
*** Error code 1
恥ずかしながら system call の select() であるというのに
しばらく気がつかず、小ハマリ。
sql/mysqld.cc に
44 #endif
45 #ifdef HAVE_SYS_SELECT_H
++ #include <unistd.h>
46 #include <sys/select.h>
47 #endif
と追加してみるが、やはり同じエラーが表示される。
unistd.h で
#ifndef _POSIX_SOURCE
としてあるブロックに select() が宣言されているので
一時的に #undef _POSIX_SOURCE してから #include <unistd.h>
するように書いてみるがやはり同じエラーが表示される。
錯綜した define 定義を追いかける気になれず、
結局 /usr/include/unistd.h から該当部分を抜きだし、強引に
44 #endif
45 #ifdef HAVE_SYS_SELECT_H
++ struct timeval; /* select(2) */
++ int select __P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
46 #include <sys/select.h>
47 #endif
としてコンパイルを通す。 make check は終了したが、正常に動くかどうか
はまだわからない。
-----------------------------------------------------------------
という次第です。回避が強引すぎて役立ち度が薄いレポートで
すみません。
------------------------------------------------------------
働いているようで働いていないのが、悪い技術者
働いていないようで働いているのが、良い技術者
働いているようで働いているのは、 良い営業
NAKAGAWA Tsuneo ( 中川 恒雄 ) mailto:yaemon@xxxxxxxxxx
-> 853 1999-05-03 04:36 [<yaemon@xxxxxxxxxx> ] Comile error in egcs-2.91.50 854 1999-05-03 07:51 ┗[<takeshi@xxxxxxxxxx>]