ITEEDU

2.12.5.5. Alpha-DEC-UNIX(Tru64)版注意事项

如果你在Digital Unix上使用egcs 1.1.2,应当升级到gcc 2.95.2,因为egcs在DEC上有一些严重缺陷!

当在Digital UNIX下编译线程程序时,文档推荐对于cc和cxx使用-pthread选项和-lmach -lexc库(除了-lpthread外)。你应该象下面这样运行configure:

CC="cc -pthread" CXX="cxx -pthread -O" \
./configure --with-named-thread-libs="-lpthread -lmach -lexc -lc"

当编译mysqld时,会看见下面的警告:

mysqld.cc: In function void handle_connections()':
mysqld.cc:626: passing long unsigned int *' as argument 3 of
accept(int,sockadddr *, int *)'

你可以放心地忽略这些警告,它们的发生是因为configure只能检测出错误,而不是警告。

如果直接从命令行启动服务器,当退出时,可能有死掉的问题。(当你退出时,重要进程收到一个SIGHUP信号),如果如此,试着象这样启动服务器:

nohup mysqld [options] &

nohup使得后面的命令忽视从终端发来的任何SIGHUP信号了。另外,通过运行safe_mysqld启动服务器,可以让nohup调用mysqld。请参见5.1.3节,“mysqld_safe:MySQL服务器启动脚本”

如果编译mysys/get_opt.c时遇到问题,只需要从启动文件删掉#define _NO_PROTO行。

如果使用Compaq的CC编译器,下面的configure行应当工作:

CC="cc -pthread"
CFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed all -arch host"
CXX="cxx -pthread"
CXXFLAGS="-O4 -ansi_alias -ansi_args -fast -inline speed all \
    -arch host -noexceptions -nortti"
export CC CFLAGS CXX CXXFLAGS
./configure \
    --prefix=/usr/local/mysql \
    --with-low-memory \
    --enable-large-files \
    --enable-shared=yes \
    --with-named-thread-libs="-lpthread -lmach -lexc -lc"
gnumake

如果用共享库编译时libtool出现问题,应当能够在链接mysql时通过下述命令解决该问题:

cd mysql
/bin/sh ../libtool --mode=link cxx -pthread  -O3 -DDBUG_OFF \
    -O4 -ansi_alias -ansi_args -fast -inline speed \
    -speculate all \ -arch host  -DUNDEF_HAVE_GETHOSTBYNAME_R \
    -o mysql  mysql.o readline.o sql_string.o completion_hash.o \
    ../readline/libreadline.a -lcurses \
    ../libmysql/.libs/libmysqlclient.so  -lm
cd ..
gnumake
gnumake install
scripts/mysql_install_db