{"id":4697,"date":"2013-11-18T22:34:27","date_gmt":"2013-11-18T14:34:27","guid":{"rendered":"http:\/\/www.orczhou.com\/?p=4697"},"modified":"2013-11-18T22:34:27","modified_gmt":"2013-11-18T14:34:27","slug":"autoconf-to-check-mysql-client-library","status":"publish","type":"post","link":"https:\/\/www.orczhou.com\/index.php\/2013\/11\/autoconf-to-check-mysql-client-library\/","title":{"rendered":"\u4f7f\u7528Autoconf\u68c0\u6d4bMySQL\u76f8\u5173\u7684\u8f6f\u4ef6\u5305"},"content":{"rendered":"<p>\u5728\u4f60\u7684\u7a0b\u5e8f(\u6216\u8005\u5de5\u7a0b)\u4e2d\uff0c\u5982\u679c\u7f16\u8bd1\u9636\u6bb5\u9700\u8981\u68c0\u6d4b\u5f53\u524d\u73af\u5883\u4e2d\u662f\u5426\u5b58\u5728MySQL\u5ba2\u6237\u7aef\u76f8\u5173\u7684\u5e93\u6587\u4ef6\u65f6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528<a href=\"http:\/\/www.gnu.org\/software\/autoconf\/\" target=\"_blank\">Autoconf<\/a>\u6765\u5e2e\u4f60\u5b8c\u6210\u8fd9\u4e2a\u5de5\u4f5c\uff0c\u8f7b\u76c8\u3001\u4f18\u96c5\u3001\u65e0\u75db\u3002\u9605\u8bfb\u672c\u6587\u9700\u8981\u4e86\u89e3\u7b80\u5355<a href=\"http:\/\/www.gnu.org\/software\/autoconf\/\" target=\"_blank\">GNU Autoconf<\/a>\u4f7f\u7528\u3002<\/p>\n\n<h3>1. \u672c\u6587\u7684\u76ee\u6807<\/h3>\n<p>\u76ee\u7684\uff1a\u7f16\u8bd1\u65f6\uff0c\u6839\u636econfigure\u53c2\u6570(\u5982\u679c\u6709&#8211;with-mysql)\uff0c\u9009\u62e9\u6027\u7f16\u8bd1\u5bf9\u5e94\u7684MySQL\u76f8\u5173\u7684\u529f\u80fd\u3002<\/p>\n<p>\u5b9e\u73b0\uff1a\u4f7f\u7528\u5df2\u7ecf\u5199\u597d\u7684m4\u811a\u672c\uff1a<a href=\"http:\/\/git.savannah.gnu.org\/gitweb\/?p=autoconf-archive.git;a=history;f=m4\/ax_lib_mysql.m4\" target=\"_blank\">ax_lib_mysql.m4<\/a><\/p>\n<h3>2. \u5982\u4f55\u5229\u7528Autoconf\u5b9e\u73b0<\/h3>\n<p>\u5927\u90e8\u5206\u4f60\u60f3\u5230\u7684\u4e8b\u60c5\u90fd\u5df2\u7ecf\u6709\u4eba\u505a\u8fc7\u5c1d\u8bd5\u4e86\u3002\u8fd9\u4ef6\u4e8b\u60c5\u4e5f\u4e0d\u4f8b\u5916\uff0cAutoconf\u4e2d\u6709\u5f88\u591a\u811a\u672c\u548c\u6307\u4ee4\u5e2e\u4f60\u505a\u4e8b\u60c5\u3002\u8fd9\u91cc\uff0c\u9700\u8981\u4f7f\u7528<a href=\"http:\/\/git.savannah.gnu.org\/gitweb\/?p=autoconf-archive.git;a=history;f=m4\/ax_lib_mysql.m4\" target=\"_blank\">ax_lib_mysql.m4<\/a>\u6765\u5e2e\u52a9\u6211\u4eec\u3002\u5148\u628a<a href=\"http:\/\/git.savannah.gnu.org\/gitweb\/?p=autoconf-archive.git;a=blob_plain;f=m4\/ax_lib_mysql.m4;hb=64514aefdfef4f4f25c67ea8e0df1c37c647c54a\" target=\"_blank\">\u8be5\u6587\u4ef6<\/a>\u653e\u5230\u7a0b\u5e8f\/\u5de5\u7a0b\u76ee\u5f55\u4e2d\uff0c\u5e76\u5728configure.ac\u4e2d\u65b0\u589e\u5982\u4e0b\u6307\u4ee4\u6765\u68c0\u6d4bMySQL\u5e93\u6587\u4ef6\u548c\u7248\u672c\uff1a<\/p>\n<div class=\"mycode\">m4_include(ax_lib_mysql.m4)<br \/>\nAX_LIB_MYSQL()<br \/>\nAM_CONDITIONAL(BUILD_MYSQL_SUPPORT, test x$MYSQL_VERSION != x)<\/div>\n<p>\u8bf4\u660e\uff1aAX_LIB_MYSQL()\u8bbe\u7f6e\u4e86\u4e09\u4e2a\u53d8\u91cf\uff0c\u53ef\u4ee5\u5728Makefile.am\u4e2d\u76f4\u63a5\u4f7f\u7528\uff0c\u5206\u522b\u662fMYSQL_CFLAGS\u3001MYSQL_LDFLAGS\u3001MYSQL_VERSION\uff0c\u53e6\u5916\u8fd8\u4f1a\u5728config.h\u4e2d\u9884\u5b9a\u4e49\u5b8fHAVE_MYSQL\uff1bAM_CONDITIONAL(&#8230;)\u5219\u4f1a\u6839\u636e\u662f\u5426\u9700\u8981\u5f00\u542fMySQL\u652f\u6301\uff0c\u6765\u8bbe\u7f6e\u53d8\u91cfBUILD_MYSQL_SUPPORT\uff0c\u8fd9\u4e2a\u53d8\u91cf\u53ef\u4ee5\u5728Makefile.am\u4e2d\u4f7f\u7528\u3002<\/p>\n<p>\u5728\u7a0b\u5e8f\u6e90\u4ee3\u7801\u4e2d\u4e00\u822c\u6709\u4e24\u79cd\u65b9\u5f0f\u53ef\u4ee5\u83b7\u53d6HAVE_MYSQL\u5b8f\u7684\u65b9\u5f0f\uff1a\u4e00\u4e2a\u662f\u76f4\u63a5\u5305\u542bconfig.h\uff1b\u53e6\u4e00\u4e2a\u662f\u5728\u4f60\u7a0b\u5e8f\u7684CFLAGS\u4e2d\u65b0\u589e-DHAVE_MYSQL\u3002(\u6ce8\u610f\uff1a\u6709\u7684\u53d8\u91cf\u662f\u53ef\u4ee5\u5728Makefile.am\u4e2d\u4f7f\u7528\uff0c\u6709\u7684\u5219\u662f\u53ef\u4ee5\u5728C\u6e90\u4ee3\u7801\u4e2d\u4f7f\u7528)<!--more--><\/p>\n<h4>\u65b9\u6cd5\u4e00\uff1a\u76f4\u63a5include config.h<\/h4>\n<p>Autoconf\u5de5\u5177\u4f1a\u5c06\u6240\u6709\u7684\u9884\u5b9a\u4e49\u5b8f\u5b58\u653e\u5728config.h(\u9ed8\u8ba4\u60c5\u51b5)\u4e2d\uff0c\u5e76\u5728\u7f16\u8bd1\u5668\u9009\u9879\u4e2d\u65b0\u589e-DHAVE_CONFIG_H(\u901a\u8fc7@DEFS@)\u3002\u56e0\u4e3a\u6587\u4ef6ax_lib_mysql.m4\u4e2d\uff0c\u5305\u542b\u4e86\u5982\u4e0b\u4ee3\u7801(\u5982\u679c\u52a0\u4e0a&#8211;with-mysql\u5e76\u4e14\u627e\u5230\u4e86\u5bf9\u5e94mysql_config\uff0c\u90a3\u4e48\u5982\u4e0b\u4ee3\u7801\u751f\u6548)\uff1a<\/p>\n<div class=\"mycode\">AC_DEFINE([HAVE_MYSQL], [1],<br \/>\n            [Define to 1 if MySQL libraries are available])<\/div>\n<p>\u6240\u4ee5\uff0cconfig.h\u4e2d\u4f1a\u6709\u5bf9\u5e94\u7684\u5b8f\u5b9a\u4e49\uff1a<\/p>\n<div class=\"mycode\">\/* Define to 1 if MySQL libraries are available *\/<br \/>\n#define HAVE_MYSQL 1<\/div>\n<p>\u5728\u4f60\u7684\u6e90\u4ee3\u7801\u4e2d(\u4e00\u822c\u662f\u5934\u6587\u4ef6)\uff0c\u65b0\u589e\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<div class=\"mycode\">#ifdef HAVE_CONFIG_H<br \/>\n#include &gt;config.h&lt;<br \/>\n#endif<\/div>\n<p>\u8fd9\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u5728\u4f60\u7684\u6e90\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528#ifdef HAVE_MYSQL &#8230; #endif\u8fd9\u6837\u7684\u5199\u6cd5\u4e86<\/p>\n<h4>\u65b9\u6cd5\u4e8c\uff1a\u7f16\u8bd1\u5668\u9009\u9879\u65b0\u589e-DHAVE_MYSQL<\/h4>\n<p>\u56e0\u4e3a\u6587\u4ef6<a href=\"http:\/\/git.savannah.gnu.org\/gitweb\/?p=autoconf-archive.git;a=history;f=m4\/ax_lib_mysql.m4\" target=\"_blank\">ax_lib_mysql.m4<\/a>\u5305\u542b\u4e86\u53d8\u91cf\u5b9a\u4e49MYSQL_CFLAGS\/MYSQL_LDFLAGS\/MYSQL_VERSION\uff0c\u6240\u4ee5\uff0c\u7b80\u5355\u7684\u53ef\u4ee5\u5728Makefile.am\u4e2d\uff0c\u76f4\u63a5\u6839\u636e\u8fd9\u4e9b\u53d8\u91cf\u6765\u65b0\u589egcc\u7f16\u8bd1\u53c2\u6570\u3002\u7c7b\u4f3c\u5982\u4e0b\u5199\u6cd5\uff1a<\/p>\n<div class=\"mycode\">if MYSQL_VERSION<br \/>\nXXX_CFLAGES= -DHAVE_MYSQL<br \/>\nendif<\/div>\n<p>\u8fd9\u4e4b\u540e\uff0c\u4e5f\u53ef\u4ee5\u5728\u4f60\u7684\u6e90\u4ee3\u7801\u4e2d\uff0c\u4f7f\u7528#ifdef HAVE_MYSQL &#8230; #endif\u8fd9\u6837\u7684\u5199\u6cd5\u4e86<\/p>\n<p>\u5c0f\u7ed3\uff1a\u4e0a\u9762\u4e24\u79cd\u65b9\u6cd5\u4e00\u4e2a\u9700\u8981\u4fee\u6539Makefile.am\u3001\u4e00\u4e2a\u9700\u8981\u4fee\u6539\u5934\u6587\u4ef6\uff0c\u53ef\u4ee5\u6839\u636e\u4e2a\u4eba\u559c\u597d\u6765\u51b3\u5b9a\u600e\u4e48\u505a\u3002<\/p>\n<h3>3. \u66f4\u591a\u5173\u4e8eax_lib_mysql.m4\u7684\u4f7f\u7528<\/h3>\n<h4>\u5e38\u89c1\u7684configure\u5199\u6cd5<\/h4>\n<p>\u6709\u4e86\u4e0a\u9762\u7684\u8bbe\u7f6e\uff0c\u7a0b\u5e8f\u5c31\u53ef\u4ee5\u901a\u8fc7\u5982\u4e0b\u7684\u65b9\u5f0f\u6765\u786e\u5b9a\u662f\u5426\u5c06MySQL\u5ba2\u6237\u7aef\u7684\u652f\u6301\u7f16\u8bd1\u5230\u6e90\u4ee3\u7801\u4e2d\uff1a<\/p>\n<div class=\"mycode\">.\/configure &#8211;with-mysql<br \/>\n&#8230;<br \/>\n.\/configure &#8211;with-mysql[=no|yes]<br \/>\n&#8230;<br \/>\n.\/configure &#8211;with-mysql[=\/YOUR_ENV_PATH\/mysql_config] #\u5982\u679cmysql_config\u4e0d\u5728\u5f53\u524d\u7684$PATH\u4e2d\uff0c\u5219\u9700\u8981\u663e\u793a\u6307\u5b9a\u3002<br \/>\n&#8230;<\/div>\n<h4>\u5982\u679c\u5bf9\u6700\u4f4e\u7248\u672c\u6709\u8981\u6c42<\/h4>\n<p>\u53e6\u5916\uff0c\u5982\u679c\u4f60\u5bf9MySQL\u7248\u672c\u6709\u8981\u6c42\uff0c\u4f8b\u5982\uff0c\u4f60\u5e0c\u671b\u53ea\u6709\u68c0\u6d4b\u52305.5\u4ee5\u4e0a\u7684MySQL\u5ba2\u6237\u7aef\uff0c\u624d\u7f16\u8bd1\u5bf9MySQL\u7684\u652f\u6301\uff0c\u5219\u53ef\u4ee5\u5728configure.ac\u4e2d\u8fd9\u6837\u4f7f\u7528AX_LIB_MYSQL\uff1a<\/p>\n<div class=\"mycode\">AX_LIB_MYSQL(5.5.18)<\/div>\n<h4>\u4fee\u6539&#8211;with-mysql\u7684\u9ed8\u8ba4\u884c\u4e3a<\/h4>\n<p>\u8fd9\u91cc\u610f\u601d\u662f\u8bf4\uff0c\u5982\u679c\u5728configure\u4e2d\u6ca1\u6709&#8211;with-mysql\u9009\u9879\u65f6\uff0c\u5219\u7f16\u8bd1\u65f6\u4e0d\u52a0\u4e0a\u5bf9MySQL\u7684\u652f\u6301(\u5982\u679c\u5199\u4e86)\uff0c\u4e5f\u5c31\u662f\u8bf4\u5982\u4e0b\u4e24\u79cd\u5199\u6cd5\u610f\u601d\u76f8\u540c\uff1a<\/p>\n<div class=\"mycode\">.\/configure &#8211;with-mysql=no<br \/>\n.\/configure<\/div>\n<p>ax_lib_mysql.m4\u7684\u9ed8\u8ba4\u884c\u4e3a\u5e76\u975e\u5982\u6b64\uff0c\u9700\u8981\u5bf9\u5176\u4ee3\u7801\u505a\u5c0f\u5c0f\u7684\u4fee\u6539\uff1a<\/p>\n<pre><div class=\"mycode\">@@ -61,7 +61,7 @@\r\n             MYSQL_CONFIG=\"$withval\"\r\n         fi\r\n         ],\r\n-        [want_mysql=\"yes\"]\r\n+        [want_mysql=\"no\"]\r\n     )\r\n     AC_ARG_VAR([MYSQL_CONFIG], [Full path to mysql_config program])<\/div><\/pre>\n<p>\u8fd9\u6837\u5c31\u5982\u613f\u4e86\u3002<\/p>\n<h3>4. \u66f4\u4e00\u822c\u7684DEBUG\u9009\u9879<\/h3>\n<p>\u5176\u5b9e\u4f7f\u7528Autoconf\u8fd9\u79cd\u7528\u6cd5\u66f4\u4e00\u822c\u7684\u662f\u5f00\u542f\u6216\u8005\u5173\u95edDEBUG\u9009\u9879\u3002\u8fd9\u4e2a\u5b9e\u73b0\u4f1a\u6bd4\u4e0a\u9762\u7b80\u5355\u5f88\u591a\u3002<\/p>\n<p>\u76ee\u6807\uff1a\u7f16\u8bd1\u65f6\uff0c\u6839\u636econfigure\u53c2\u6570(\u5982\u679c\u6709&#8211;enable-debug)\uff0c\u5219\u6267\u884c\u7a0b\u5e8f\u4e2d#ifdef DEBUG &#8230; #endif\u3002(\u7ecf\u5e38\u770b\u5230\u8fd9\u6837\u7684\u5199\u6cd5\u5427)<\/p>\n<p>\u76f8\u6bd4\u4e0a\u9762\u7684&#8211;with-mysql\u8fd9\u4e2a\u5c31\u7b80\u5355\u591a\u4e86(\u6ca1\u6709\u7248\u672c\u4fe1\u606f\u3001\u4e0d\u9700\u8981\u627emysql_config\u7b49)\uff0c\u6240\u4ee5\u5b9e\u73b0\u4e5f\u7b80\u5355\u591a\u4e86\uff0c\u53ea\u9700\u5728\u4f60\u7684configure.ac\u4e2d\u65b0\u589e\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre><div class=\"mycode\">AC_ARG_ENABLE(debug,\r\nAS_HELP_STRING([--enable-debug],\r\n               [enable debugging, default: no]),\r\n[case \"${enableval}\" in\r\n             yes) debug=true ;;\r\n             no)  debug=false ;;\r\n             *)   AC_MSG_ERROR([bad value ${enableval} for --enable-debug]) ;;\r\nesac],\r\n[debug=false])\r\nAM_CONDITIONAL(DEBUG, test x\"$debug\" = x\"true\")<\/div><\/pre>\n<p>\u5982\u679cconfigure\u65f6\uff0c\u5e26\u6709\u53c2\u6570&#8211;enable-debug\uff0c\u5219\u8bbe\u7f6e\u8c03\u7528AM_CONDITIONAL\u8bbe\u7f6e\u904d\u5386DEBUG\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728Makefile\u4e2d\u6839\u636e\u904d\u5386DEBUG\uff0c\u6765\u9009\u62e9\u6027\u7684\u65b0\u589e\u7f16\u8bd1\u53c2\u6570-DDEBUG\uff0c\u6240\u4ee5\u914d\u5957\u7684\u8fd8\u9700\u8981\u518dMakefile.am\u4e2d\u65b0\u589e\uff1a<\/p>\n<div class=\"mycode\">if DEBUG<br \/>\nXXX_CFALGS=&#8230; -DDEBUG<br \/>\nelse<br \/>\nXXX_CFALGS=&#8230;<br \/>\nfi<\/div>\n<p>\u8fd9\u65f6\uff0c\u4f60\u7684\u4ee3\u7801\u4e2d\u5c31\u53ef\u4ee5\u5199#ifdef DEBUG &#8230; #endif\u4e86\u3002<\/p>\n<p>\u53e6\u4e00\u79cd\u5305\u542bconfig.h\u7684\u65b9\u6cd5\u8ddf\u524d\u9762\u7c7b\u4f3c\uff0c\u53ea\u4e0d\u8fc7\u9700\u8981\u5c06AM_CONDITIONAL\u90a3\u91cc\u6362\u6210\uff1a<\/p>\n<div class=\"mycode\">if test x&#8221;$debug&#8221; = x&#8221;true&#8221;<br \/>\n  AC_DEFINE([HAVE_MYSQL], [1],<br \/>\n               [Define to 1 if MySQL libraries are available])<br \/>\nfi<\/div>\n<p>\u90a3\u4e48\u7a0b\u5e8f\u4ee3\u7801\u4e2dinclude &gt;config.h&lt;\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n<h3>\u53c2\u8003\u94fe\u63a5<\/h3>\n<p><a href=\"http:\/\/openbooks.sourceforge.net\/books\/wga\/creating-configuration.html\" target=\"_blank\">Creating Your Own Configuration<\/a><\/p>\n<p><a href=\"https:\/\/github.com\/zhangsen\/doc-autotools-in-practice\/blob\/master\/autotools.rst\" target=\"_blank\">Autotools \u5b9e\u4f8b\u5206\u6790<\/a><\/p>\n<p><a href=\"http:\/\/www.gnu.org\/software\/automake\/manual\/html_node\/Usage-of-Conditionals.html#Usage-of-Conditionals\" target=\"_blank\">Usage of AM_CONDITIONAL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u4f60\u7684\u7a0b\u5e8f(\u6216\u8005\u5de5\u7a0b)\u4e2d\uff0c\u5982\u679c\u7f16\u8bd1\u9636\u6bb5\u9700\u8981\u68c0\u6d4b\u5f53\u524d\u73af\u5883\u4e2d\u662f\u5426\u5b58\u5728MySQL\u5ba2\u6237\u7aef\u76f8\u5173\u7684\u5e93\u6587\u4ef6\u65f6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528Autoconf\u6765\u5e2e\u4f60\u5b8c\u6210\u8fd9\u4e2a\u5de5\u4f5c\uff0c\u8f7b\u76c8\u3001\u4f18\u96c5\u3001\u65e0\u75db\u3002\u9605\u8bfb\u672c\u6587\u9700\u8981\u4e86\u89e3\u7b80\u5355GNU Autoconf\u4f7f\u7528\u3002 1. \u672c\u6587\u7684\u76ee\u6807 \u76ee\u7684\uff1a\u7f16\u8bd1\u65f6\uff0c\u6839\u636econfigure\u53c2\u6570(\u5982\u679c\u6709&#8211;with-mysql)\uff0c\u9009\u62e9\u6027\u7f16\u8bd1\u5bf9\u5e94\u7684MySQL\u76f8\u5173\u7684\u529f\u80fd\u3002 \u5b9e\u73b0\uff1a\u4f7f\u7528\u5df2\u7ecf\u5199\u597d\u7684m4\u811a\u672c\uff1aax_lib_mysql.m4 2. \u5982\u4f55\u5229\u7528Autoconf\u5b9e\u73b0 \u5927\u90e8\u5206\u4f60\u60f3\u5230\u7684\u4e8b\u60c5\u90fd\u5df2\u7ecf\u6709\u4eba\u505a\u8fc7\u5c1d\u8bd5\u4e86\u3002\u8fd9\u4ef6\u4e8b\u60c5\u4e5f\u4e0d\u4f8b\u5916\uff0cAutoconf\u4e2d\u6709\u5f88\u591a\u811a\u672c\u548c\u6307\u4ee4\u5e2e\u4f60\u505a\u4e8b\u60c5\u3002\u8fd9\u91cc\uff0c\u9700\u8981\u4f7f\u7528ax_lib_mysql.m4\u6765\u5e2e\u52a9\u6211\u4eec\u3002\u5148\u628a\u8be5\u6587\u4ef6\u653e\u5230\u7a0b\u5e8f\/\u5de5\u7a0b\u76ee\u5f55\u4e2d\uff0c\u5e76\u5728configure.ac\u4e2d\u65b0\u589e\u5982\u4e0b\u6307\u4ee4\u6765\u68c0\u6d4bMySQL\u5e93\u6587\u4ef6\u548c\u7248\u672c\uff1a m4_include(ax_lib_mysql.m4) AX_LIB_MYSQL() AM_CONDITIONAL(BUILD_MYSQL_SUPPORT, test x$MYSQL_VERSION != x) \u8bf4\u660e\uff1aAX_LIB_MYSQL()\u8bbe\u7f6e\u4e86\u4e09\u4e2a\u53d8\u91cf\uff0c\u53ef\u4ee5\u5728Makefile.am\u4e2d\u76f4\u63a5\u4f7f\u7528\uff0c\u5206\u522b\u662fMYSQL_CFLAGS\u3001MYSQL_LDFLAGS\u3001MYSQL_VERSION\uff0c\u53e6\u5916\u8fd8\u4f1a\u5728config.h\u4e2d\u9884\u5b9a\u4e49\u5b8fHAVE_MYSQL\uff1bAM_CONDITIONAL(&#8230;)\u5219\u4f1a\u6839\u636e\u662f\u5426\u9700\u8981\u5f00\u542fMySQL\u652f\u6301\uff0c\u6765\u8bbe\u7f6e\u53d8\u91cfBUILD_MYSQL_SUPPORT\uff0c\u8fd9\u4e2a\u53d8\u91cf\u53ef\u4ee5\u5728Makefile.am\u4e2d\u4f7f\u7528\u3002 \u5728\u7a0b\u5e8f\u6e90\u4ee3\u7801\u4e2d\u4e00\u822c\u6709\u4e24\u79cd\u65b9\u5f0f\u53ef\u4ee5\u83b7\u53d6HAVE_MYSQL\u5b8f\u7684\u65b9\u5f0f\uff1a\u4e00\u4e2a\u662f\u76f4\u63a5\u5305\u542bconfig.h\uff1b\u53e6\u4e00\u4e2a\u662f\u5728\u4f60\u7a0b\u5e8f\u7684CFLAGS\u4e2d\u65b0\u589e-DHAVE_MYSQL\u3002(\u6ce8\u610f\uff1a\u6709\u7684\u53d8\u91cf\u662f\u53ef\u4ee5\u5728Makefile.am\u4e2d\u4f7f\u7528\uff0c\u6709\u7684\u5219\u662f\u53ef\u4ee5\u5728C\u6e90\u4ee3\u7801\u4e2d\u4f7f\u7528)<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_eb_attr":"","inline_featured_image":false,"_tocer_settings":[],"footnotes":""},"categories":[27,6],"tags":[],"class_list":["post-4697","post","type-post","status-publish","format-standard","hentry","category-linux","category-mysql"],"_links":{"self":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/4697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/comments?post=4697"}],"version-history":[{"count":17,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/4697\/revisions"}],"predecessor-version":[{"id":4714,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/posts\/4697\/revisions\/4714"}],"wp:attachment":[{"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/media?parent=4697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/categories?post=4697"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.orczhou.com\/index.php\/wp-json\/wp\/v2\/tags?post=4697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}