« Build MySQL (4.0.18) from Source | Main | The Time has Come to (finally) get a Digital Camera »

February 19, 2004

mysql_config not Displaying Options Correctly

As indicated in my recent post about compiling MySQL I'm using a recommended set of C compiler flags:

-O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa
MySQL compiles and runs fine but when I attempted to compile DBD::mysql I get a complaint that the CFLAGS aren't right. A mysql_config --cflags shows (notice the missing -Wa):
-O3 -fno-omit-frame-pointer -mcpu=v8 ,-xarch=v8plusa
If I override the Makefile cflags (defaults to using mysql_config) and manually set the cflags DBD::mysql has no complaint.

So do I take the time to see what exactly is going on with mysql_config? Most likely not now . . . maybe the next time it comes up.

I couldn't resist, went poking around. mysql_config has the cflags stored correctly in a variable $cflags. However, before printing it the string is passed through a regex which cleans it up. According to the comments in mysql_config:

# Remove some options that a client doesn't have to care about
The guilty part of the regex looks like
Now what? I'm not sure I understand the purpose of the removal of options.

Submitted a bug to MySQL.

I'm impressed, less than 6 hours after filing the bug I got a confirmation that the fix has been committed and will be in the next release (4.0.19).

Posted by mike at February 19, 2004 9:17 PM