refs #6492 Added necessary cmake changes to MariaDB.  Builds community edition just fine.  :)

git-svn-id: file:///svn/mysql.com/mariadb-5.5.30@55288 c7de825b-a66e-492c-adef-691d508d4ae1
Fixes #6492.  Port the patches from mysql-5.5.30 for backup.
{{{
svn merge -c 55276 https://svn.tokutek.com/tokudb/mysql.com/mysql-5.5.30
svn merge -c 55284 https://svn.tokutek.com/tokudb/mysql.com/mysql-5.5.30
}}}

git-svn-id: file:///svn/mysql.com/mariadb-5.5.30@55292 c7de825b-a66e-492c-adef-691d508d4ae1