Bug #42805 Add ability to not require mysql_config or override compile options from it
Submitted: 12 Feb 2009 21:11 Modified: 7 Feb 2017 6:36
Reporter: Harrison Fisk Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / ODBC Severity:S4 (Feature request)
Version:3.51 OS:Solaris
Assigned to: CPU Architecture:Any

[12 Feb 2009 21:11] Harrison Fisk
Description:
The ./configure file uses mysql_config to find the flags necessary to compile with the MySQL client libraries.  This is good.   However, mysql_config doesn't always return usable flags.

An example of this is if you use a binary MySQL which we compile using the Sun C compiler, and then you try to compile Connector/ODBC using gcc.  Then mysql_config --cflags returns a lot of compiler specific flags which causes gcc to fail.

How to repeat:
Try to run configure using gcc on a MySQL compiled Solaris binary. 

1.  Download and install MySQL from mysql.com.
2.  Download source of Connector/ODBC.
3.  Run ./configure and no matter what it will fail.

Suggested fix:
Give ./configure options for --mysql-libs-flags or --mysql-cflags which can override mysql_config options.
[28 Sep 2009 13:33] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/84867
[28 Sep 2009 13:35] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/84869
[29 Sep 2009 22:41] Jim Winstead
That patch is using the wrong bug number.
[30 Sep 2009 8:14] Bugs System
Pushed into 5.1.37-ndb-7.0.9 (revid:jonas@mysql.com-20090930075942-1q6asjcp0gaeynmj) (version source revid:jonas@mysql.com-20090929132518-5mc0ay02ts6jz1zj) (merge vers: 5.1.37-ndb-7.0.9) (pib:11)
[30 Sep 2009 8:15] Bugs System
Pushed into 5.1.35-ndb-7.1.0 (revid:jonas@mysql.com-20090930080049-1c8a8cio9qgvhq35) (version source revid:magnus.blaudd@sun.com-20090928133401-p3a632m95xlxjr6p) (merge vers: 5.1.35-ndb-7.1.0) (pib:11)
[7 Feb 2017 6:36] Bogdan Degtyariov
Posted by developer:
 
Connector/ODBC 5.3.x does not need mysql_config to build.
Closing the bug.
[7 Feb 2017 6:41] Bogdan Degtyariov
Posted by developer:
 
For ODBC driver to build is enough to provide MYSQL_LIB_DIR and MYSQL_INCLUDE_DIR. In that case mysql_config could not be used.