今天换了一台装的红旗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/g346 /usr/bin/g
[root@http2 nagios-2.10]#
|
这个问题只会出现在红旗的系统上面,因为只有红旗linux,为oracle的安装,特意开发了oracle安装领航员,另oracle在红旗linux上的安装变得异常简单。
阅读(1450) | 评论(0) | 转发(0) |