Bug #25576 configure succeeds even if c++ is not fully installed, make then fails
Submitted: 12 Jan 2007 11:15 Modified: 16 Mar 2009 11:39
Reporter: Philip Stoev Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.0.34-BK, 5.0.33 OS:Linux (Linux Fedora Core 4)
Assigned to: Kent Boortz CPU Architecture:Any
Tags: qc

[12 Jan 2007 11:15] Philip Stoev
Description:
Hello,

If the gcc-c++ RPM package is missing, the configure script will detect that in passing:

checking for c++... no
./configure: line 5165: g++: command not found
checking "C++ compiler version"... "g++ ./configure: line 5168: g++: command not found"

however the script will continue and upon running make, one will get:

../depcomp: line 512: exec: g++: not found

It is preferable for configure to fail in such cases in order to avoid incomplete builds.

If one installs gcc-c++ and runs make again, the following error occurs:

../include/my_global.h:911: error: redeclaration of C++ built-in type 'bool'

How to repeat:
1. Install a RPM-based distribution.

2. Uninstall the gcc-c++ package via rpm -e

3. run ./configure and it will succeed

4. run make and it will fail

5. Install gcc-c++

6. run make again and it will fail differently

Suggested fix:
http://www.kitchenlab.org/www/bmah/Software/pchar/pchar-1.5.tar.gz

This program handles this better in its ./configure script:

checking for c++... no
checking for g++... no
checking for gcc... gcc
checking whether the C++ compiler (gcc  ) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.
[12 Jan 2007 12:40] Valeriy Kravchuk
Thank you for a problem report and a patch. Please, check with a newer version, 5.0.33, and inform about the results.
[12 Jan 2007 12:41] Valeriy Kravchuk
Sorry, not patch but general idea how to create it... Check with 5.0.33 anyway, please.
[12 Jan 2007 12:55] Philip Stoev
The situation is the same with 5.0.33
[12 Jan 2007 13:38] Valeriy Kravchuk
Verified just as described (one will need just to execute mv /usr/bin/g++ /usr/bin/gg++ to repeat - no need to remove entire RPM), also - with latest 5.0.34-BK on Linux.
[6 May 2008 4:08] John Xu
run make and has error

../depcomp: line 512: exec: g++: not found

mysql version: mysql-5.0.51b
[6 May 2008 4:11] John Xu
I was installing mysql mysql-5.0.51b on centOS 5.1
[16 Mar 2009 11:39] Daniel Fischer
This is not a bug in the MySQL Server.

The AC_PROG_CXX macro of autoconf seems to be easily confused by setting the CXX environment variable to a name that doesn't refer to an existing binary.