Open Source WEB

日本語フロントエンドプロセッサ(FEP)のkinput2から漢字を入力させる方法を 探さねばならない。バイナリ版ではできていたのだから、 バイナリ版がどのようなオプションでコンパイルされているか調べるのが早道だろう。

bin/mysqlbugを見ると、configureオプションが分かる。

以下がファイルの先頭部分であるが、見やすくするため、 適当に改行を加えてある。

#!/bin/sh
# Create a bug report and mail it to the mysql mailing list
# Based on glibc bug reporting script.
 
echo "Finding system information for a MySQL bug report"
 
VERSION="5.0.10-beta-standard"
COMPILATION_COMMENT="MySQL Community Edition - Standard (GPL)"
BUGmysql="mysql@lists.mysql.com"
# This is set by configure
COMP_ENV_INFO="CC='ccache gcc'  CFLAGS='-O2 -mcpu=pentiumpro'  CXX='ccache gcc'
CXXFLAGS='-O2 -mcpu=pentiumpro -felide-constructors'  LDFLAGS=''  ASFLAGS=''"
CONFIGURE_LINE="./configure '--prefix=/usr/local/mysql'
'--localstatedir=/usr/local/mysql/data' '--libexecdir=/usr/local/mysql/bin'
'--with-comment=MySQL Community Edition - Standard (GPL)'
'--with-extra-charsets=complex' '--with-server-suffix=-standard'
'--enable-thread-safe-client' '--enable-local-infile' '--enable-assembler'
'--disable-shared' '--with-client-ldflags=-all-static' '--with-big-tables'
'--with-mysqld-ldflags=-all-static' '--with-readline'
'--with-archive-storage-engine' '--with-innodb' 'CC=ccache gcc' 'CFLAGS=-O2
-mcpu=pentiumpro' 'CPPFLAGS=-DDEFAULT_THREAD_STACK=126976' 'CXXFLAGS=-O2
-mcpu=pentiumpro -felide-constructors' 'CXX=ccache gcc'"

あまりにもごちゃごちゃして、よく分からない。 じっくり見ていると、頭が混乱してくるばかりである。 コンパイルオプションで説明したときより、かなり増えている。

分からないときには、またソースのディレクトリに戻って、

configureのヘルプ  ./configure --help

を実行してみよう。

shell$ ./configure --help
`configure' configures this package to adapt to many kinds of systems.
 
Usage: ./configure [OPTION]... [VAR=VALUE]...
 
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.
 
Defaults for the options are specified in brackets.
 
Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

‥‥‥‥‥‥‥‥‥‥‥‥延々と続く

結局、よけい分らなくなってしまうのである。

仕方がないので、またバイナリ版のオプションを見直すことにしよう。 入力に関係ありそうなオプションを探そう。

すると、 --with-readline ではないかと推察できる。 他は、入力とは関係なさそうだ。


--with-readline を追加して、configue, make

shell$ ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex \
> --with-readline --with-debug
shell$ make

インストールについては、前回のデバッグオプション付でコンパイル と同じなので省略する。


漢字入力テスト

gnome-terminal + kinput2 での動作は以下のようになった。

mysql> SELECT '漢字';
+------+
| 漢字 |
+------+
| 漢字 |
+------+
1 row in set (0.04 sec)
 
mysql>

漢字が入れば、後は デバッガである gdb を起動して調べられる段階になった。


--with-readline オプション

ところでこのオプションだが、 ./configure --help で出される ヘルプメッセージ中には存在しなかった。

代わりに、

  --without-readline      Use system readline instead of bundled copy.

というのが見つかった。どっか、ちょっぴり変だけれど、 こっちのやりたい事は実現できたからよしとしよう。


戻る:デバッグオプション付でコンパイル

次へ:gdbからmysqlクライアントを起動してみよう


フィードバック:

Name:
Comment:

There is no comment.

このサイトは、 IPA の「平成15年度オープンソフトウエア活用基盤整備事業」 の委託事業として開発されたKahuaで試験的に運用しております。

Copyright (c) 2004-2007 株式会社タイムインターメディア About Us