# rpmbuild --rebuild php-5.1.6-3.src.rpm
...
checking for C compiler default output file name...
configure: error: C compiler cannot create executables
See `config.log' for more details.
error: Bad exit status from /var/tmp/rpm-tmp.37368 (%build)
All my googlings gave me the only way to shoot the trouble: upgrade gcc to 4. Yes, software upgrade is always good :) but for RHEL (without a purchased repository account) takes much time and efforts. So I was looking for another way and ... got it.
The only thing which was needed by PHP5 from new gcc version (4) to build RPM was a warning flag -Wno-pointer-sign (which is not defined in gcc 3.4.5). Here we go.
# rpm -ihv php-5.1.6-3.src.rpm
# vim /usr/src/redhat/SPECS/php.spec
Find in the spec file the following line
CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-pointer-sign"
Remove -Wno-pointer-sign from the line and save file.
Build RPM:
# rpmbuild -bb /usr/src/redhat/SPECS/php.spec
For me it worked OK. Just install RPMs and enjoy ;)
# rpm -Uhv /usr/src/redhat/RPMS/x86_64/php*
1 comment:
Great job!
Post a Comment