今天换了一台装的红旗DC5.0SP2的机器,想编译nagios的rpm包,但是怎么编译都报错
[root@http2 nagios-2.10]# !rpmb rpmbuild -bb nagios.spec (%prep): /bin/sh -e /var/tmp/rpm-tmp.79882 + umask 022 + cd /usr/src/asianux/BUILD + LANG=C + export LANG + unset DISPLAY + cd /usr/src/asianux/BUILD + rm -rf nagios-2.10 + /bin/gzip -dc /usr/src/asianux/SOURCES/nagios-2.10.tar.gz + tar -xf - + STATUS=0 + '[' 0 -ne 0 ']' + cd nagios-2.10 ++ /usr/bin/id -u + '[' 0 = 0 ']' + /bin/chown -Rhf root . ++ /usr/bin/id -u + '[' 0 = 0 ']' + /bin/chgrp -Rhf root . + /bin/chmod -Rf a+rX,u+w,g-w,o-w . + exit 0 (%build): /bin/sh -e /var/tmp/rpm-tmp.79882 + umask 022 + cd /usr/src/asianux/BUILD + cd nagios-2.10 + LANG=C + export LANG + unset DISPLAY + export PATH=/usr/lib/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin: +PATH=/usr/lib/jdk/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin: + CFLAGS='-O2 -g -pipe -m32 -march=i386 -mtune=pentium4' + CXXFLAGS='-O2 -g -pipe -m32 -march=i386 -mtune=pentium4' + ./configure --with-init-dir=/etc/init.d --sysconfdir=/etc/nagios checking for a BSD-compatible install... /usr/bin/install -c checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for gcc... gcc checking for C compiler default output file name... configure: error: C compiler cannot create executables See `config.log' for more details. /var/tmp/rpm-tmp.79882 (%build)״ RPM /var/tmp/rpm-tmp.79882 (%build)
|
查看config.log文件,发现是有一个参数不识别
gcc version 3.2.3 20030502 (Asianux 1.0 3.2.3-47.3) configure:1807: $? = 0 configure:1809: gcc -V &5 gcc32: argument to `-V' is missing configure:1812: $? = 1 configure:1835: checking for C compiler default output file name
configure:1838: gcc -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 conftest.c >&5
cc1: invalid option `tune=pentium4' configure:1841: $? = 1
|
昨天我另一台红旗DC5.0SP2上面编译是没有问题的啊,查看昨天机器上的config.log文件中内容,发现有一些区别
gcc version 3.4.6 20060404 (Asianux 2.0 3.4.6-3.1)
configure:1807: $? = 0
configure:1809: gcc -V </dev/null >&5 gcc: `-V' option must have argument configure:1812: $? = 1 configure:1835: checking for C compiler default output file name configure:1838: gcc -O2 -g -pipe -m32 -march=i386 -mtune=pentium4 conftest.c >&5 configure:1841: $? = 0
|
看来原因就是我现在用的系统的gcc不接受tune参数,而两个系统的gcc版本不同。我立马想到,gcc版本不同可能是因为使用oracle安装领航员安装过oracle9i,安装之前做过chgcc,安装之后没有将gcc版本改回来。
原因找到了,改回gcc版本即可:
[root@http2 nagios-2.10]# chgcc.sh -v 346
The current gcc version is 2.96.
The current g++ version is 2.96.
The gcc and g++ were changed to each 3.4.6(original version).
When you want to change 2.96, run "/usr/sbin/chgcc.sh -v 296" command.
rm /usr/bin/gcc
rm /usr/bin/g++
mv /usr/bin/gcc346 /usr/bin/gcc
mv /usr/bin/g++346 /usr/bin/g++
[root@http2 nagios-2.10]#
|
这个问题只会出现在红旗的系统上面,因为只有红旗linux,为oracle的安装,特意开发了oracle安装领航员,另oracle在红旗linux上的安装变得异常简单。
阅读(1563) | 评论(0) | 转发(0) |