List:Commits« Previous MessageNext Message »
From:paul.dubois Date:December 9 2010 5:35am
Subject:svn commit - mysqldoc@docsrva: r24344 - in trunk: . refman-5.5 refman-5.6
View as plain text  
Author: paul
Date: 2010-12-09 06:35:11 +0100 (Thu, 09 Dec 2010)
New Revision: 24344

Log:
 r36954@dhcp-215:  paul | 2010-12-08 19:54:55 -0500
 Update plugin-building instructions for CMake


Modified:
   trunk/refman-5.5/extending-mysql.xml
   trunk/refman-5.6/extending-mysql.xml

Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 07c7e7b4-24e3-4b51-89d0-6dc09fec6bec:/mysqldoc-local/mysqldoc/trunk:35498
07c7e7b4-24e3-4b51-89d0-6dc09fec6bec:/mysqldoc-local/trunk:45239
4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:43968
4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/trunk:44480
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:66486
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:39036
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/trunk:39546
ebeeeee4-b232-4669-a521-231442eced53:/mysqldoc-local/mysqldoc/trunk:36953
   + 07c7e7b4-24e3-4b51-89d0-6dc09fec6bec:/mysqldoc-local/mysqldoc/trunk:35498
07c7e7b4-24e3-4b51-89d0-6dc09fec6bec:/mysqldoc-local/trunk:45239
4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:43968
4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/trunk:44480
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:66486
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:39036
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/trunk:39546
ebeeeee4-b232-4669-a521-231442eced53:/mysqldoc-local/mysqldoc/trunk:36954


Modified: trunk/refman-5.5/extending-mysql.xml
===================================================================
--- trunk/refman-5.5/extending-mysql.xml	2010-12-09 05:35:03 UTC (rev 24343)
+++ trunk/refman-5.5/extending-mysql.xml	2010-12-09 05:35:11 UTC (rev 24344)
Changed blocks: 1, Lines Added: 34, Lines Deleted: 67; 6101 bytes

@@ -3225,98 +3225,65 @@
             it in the plugin directory.
           </para>
 
-          <note>
-            <para>
-              As mentioned earlier, be sure to specify
-              <literal>-DMYSQL_DYNAMIC_PLUGIN</literal> as part of the
-              compilation command when you build the plugin.
-            </para>
-          </note>
-
           <para>
             The procedure for compiling shared objects varies from
-            system to system. If you build your library using the GNU
-            autotools, <command>libtool</command> should be able to
-            generate the correct compilation commands for your system.
-            If the library is named <literal>mypluglib</literal>, you
-            should end up with a shared object file that has a name
-            something like <filename>libmypluglib.so</filename>. (The
-            file name might have a different extension on your system.)
+            system to system. If you build your library using
+            <literal>CMake</literal>, it should be able to generate the
+            correct compilation commands for your system. If the library
+            is named <literal>mypluglib</literal>, you should end up
+            with a shared object file that has a name something like
+            <filename>libmypluglib.so</filename>. (The file name might
+            have a different extension on your system.)
           </para>
 
           <para>
-            To use the autotools, you'll need to make a few changes to
-            the configuration files at this point to enable the plugin
-            to be compiled and installed. Assume that your MySQL
-            distribution is installed at a base directory of
-            <filename>/usr/local/mysql</filename> and that its header
-            files are located in the <filename>include</filename>
-            directory under the base directory.
+            To use <literal>CMake</literal>, you'll need to set up the
+            configuration files to enable the plugin to be compiled and
+            installed. Use the plugin examples under the
+            <filename>plugin</filename> directory of a MySQL source
+            distribution as a guide.
           </para>
 
           <para>
-            Edit <filename>Makefile.am</filename>, which should look
-            something like this:
+            Create <filename>CMakeLists.txt</filename>, which should
+            look something like this:
           </para>
 
 <programlisting>
-pkgplugindir=$(pkglibdir)/plugin
-INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include
-#noinst_LTLIBRARIES= mypluglib.la
-pkgplugin_LTLIBRARIES= mypluglib.la
-mypluglib_la_SOURCES= plugin_example.c
-mypluglib_la_LDFLAGS= -module -rpath $(pkgplugindir) \
-        -L$(libdir)/mysql -lmysqlservices
-mypluglib_la_CFLAGS= -DMYSQL_DYNAMIC_PLUGIN
+MYSQL_ADD_PLUGIN(mypluglib mypluglib.c
+  MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib")
 </programlisting>
 
           <para>
-            The <literal>mypluglib_la_CFLAGS</literal> line takes care
-            of passing the <literal>-DMYSQL_DYNAMIC_PLUGIN</literal>
-            flag to the compilation command.
-          </para>
-
-          <para>
-            Adjust the <literal>INCLUDES</literal> line to specify the
-            path name to the installed MySQL header files. Edit it to
-            look like this:
-          </para>
-
-<programlisting>
-INCLUDES= -I/usr/local/mysql/include
-</programlisting>
-
-          <para>
-            Make sure that the <literal>noinst_LTLIBRARIES</literal>
-            line is commented out or remove it. Make sure that the
-            <literal>pkglib_LTLIBRARIES</literal> line is not commented
-            out; it enables the <command>make install</command> command.
-          </para>
-
-          <para>
-            The <literal>-lmysqlservices</literal> flag is needed to
-            link in any functions from services provided through the
-            plugin services interface. See
+            When <literal>CMake</literal> generates the
+            <filename>Makefile</filename>, it should take care of
+            passing to the compilation command the
+            <literal>-DMYSQL_DYNAMIC_PLUGIN</literal> flag, and passing
+            to the linker the <literal>-lmysqlservices</literal> flag,
+            which is needed to link in any functions from services
+            provided through the plugin services interface. See
             <xref linkend="plugin-services"/>.
           </para>
 
           <para>
-            Set up the files needed for the <command>configure</command>
-            command, invoke it, and run <command>make</command>:
+            Run <command>CMake</command>, then run
+            <command>make</command>:
           </para>
 
 <programlisting>
-shell&gt; <userinput>autoreconf --force --install --symlink</userinput>
-shell&gt; <userinput>./configure --prefix=/usr/local/mysql</userinput>
+shell&gt; <userinput>cmake .</userinput>
 shell&gt; <userinput>make</userinput>
 </programlisting>
 
           <para>
-            The <option role="configure">--prefix</option> option to
-            <command>configure</command> indicates the MySQL base
-            directory under which the plugin should be installed. You
-            can see what value to use for this option with
-            <literal role="stmt">SHOW VARIABLES</literal>:
+            If you need to specify configuration options to
+            <command>CMake</command>, see
+            <xref linkend="source-configuration-options"/>, for a list.
+            For example, you might want to specify
+            <option role="cmake">CMAKE_INSTALL_PREFIX</option> to
+            indicate the MySQL base directory under which the plugin
+            should be installed. You can see what value to use for this
+            option with <literal role="stmt">SHOW VARIABLES</literal>:
           </para>
 
 <programlisting>


Modified: trunk/refman-5.6/extending-mysql.xml
===================================================================
--- trunk/refman-5.6/extending-mysql.xml	2010-12-09 05:35:03 UTC (rev 24343)
+++ trunk/refman-5.6/extending-mysql.xml	2010-12-09 05:35:11 UTC (rev 24344)
Changed blocks: 1, Lines Added: 34, Lines Deleted: 67; 6101 bytes

@@ -3225,98 +3225,65 @@
             it in the plugin directory.
           </para>
 
-          <note>
-            <para>
-              As mentioned earlier, be sure to specify
-              <literal>-DMYSQL_DYNAMIC_PLUGIN</literal> as part of the
-              compilation command when you build the plugin.
-            </para>
-          </note>
-
           <para>
             The procedure for compiling shared objects varies from
-            system to system. If you build your library using the GNU
-            autotools, <command>libtool</command> should be able to
-            generate the correct compilation commands for your system.
-            If the library is named <literal>mypluglib</literal>, you
-            should end up with a shared object file that has a name
-            something like <filename>libmypluglib.so</filename>. (The
-            file name might have a different extension on your system.)
+            system to system. If you build your library using
+            <literal>CMake</literal>, it should be able to generate the
+            correct compilation commands for your system. If the library
+            is named <literal>mypluglib</literal>, you should end up
+            with a shared object file that has a name something like
+            <filename>libmypluglib.so</filename>. (The file name might
+            have a different extension on your system.)
           </para>
 
           <para>
-            To use the autotools, you'll need to make a few changes to
-            the configuration files at this point to enable the plugin
-            to be compiled and installed. Assume that your MySQL
-            distribution is installed at a base directory of
-            <filename>/usr/local/mysql</filename> and that its header
-            files are located in the <filename>include</filename>
-            directory under the base directory.
+            To use <literal>CMake</literal>, you'll need to set up the
+            configuration files to enable the plugin to be compiled and
+            installed. Use the plugin examples under the
+            <filename>plugin</filename> directory of a MySQL source
+            distribution as a guide.
           </para>
 
           <para>
-            Edit <filename>Makefile.am</filename>, which should look
-            something like this:
+            Create <filename>CMakeLists.txt</filename>, which should
+            look something like this:
           </para>
 
 <programlisting>
-pkgplugindir=$(pkglibdir)/plugin
-INCLUDES= -I$(top_builddir)/include -I$(top_srcdir)/include
-#noinst_LTLIBRARIES= mypluglib.la
-pkgplugin_LTLIBRARIES= mypluglib.la
-mypluglib_la_SOURCES= plugin_example.c
-mypluglib_la_LDFLAGS= -module -rpath $(pkgplugindir) \
-        -L$(libdir)/mysql -lmysqlservices
-mypluglib_la_CFLAGS= -DMYSQL_DYNAMIC_PLUGIN
+MYSQL_ADD_PLUGIN(mypluglib mypluglib.c
+  MODULE_ONLY MODULE_OUTPUT_NAME "mypluglib")
 </programlisting>
 
           <para>
-            The <literal>mypluglib_la_CFLAGS</literal> line takes care
-            of passing the <literal>-DMYSQL_DYNAMIC_PLUGIN</literal>
-            flag to the compilation command.
-          </para>
-
-          <para>
-            Adjust the <literal>INCLUDES</literal> line to specify the
-            path name to the installed MySQL header files. Edit it to
-            look like this:
-          </para>
-
-<programlisting>
-INCLUDES= -I/usr/local/mysql/include
-</programlisting>
-
-          <para>
-            Make sure that the <literal>noinst_LTLIBRARIES</literal>
-            line is commented out or remove it. Make sure that the
-            <literal>pkglib_LTLIBRARIES</literal> line is not commented
-            out; it enables the <command>make install</command> command.
-          </para>
-
-          <para>
-            The <literal>-lmysqlservices</literal> flag is needed to
-            link in any functions from services provided through the
-            plugin services interface. See
+            When <literal>CMake</literal> generates the
+            <filename>Makefile</filename>, it should take care of
+            passing to the compilation command the
+            <literal>-DMYSQL_DYNAMIC_PLUGIN</literal> flag, and passing
+            to the linker the <literal>-lmysqlservices</literal> flag,
+            which is needed to link in any functions from services
+            provided through the plugin services interface. See
             <xref linkend="plugin-services"/>.
           </para>
 
           <para>
-            Set up the files needed for the <command>configure</command>
-            command, invoke it, and run <command>make</command>:
+            Run <command>CMake</command>, then run
+            <command>make</command>:
           </para>
 
 <programlisting>
-shell&gt; <userinput>autoreconf --force --install --symlink</userinput>
-shell&gt; <userinput>./configure --prefix=/usr/local/mysql</userinput>
+shell&gt; <userinput>cmake .</userinput>
 shell&gt; <userinput>make</userinput>
 </programlisting>
 
           <para>
-            The <option role="configure">--prefix</option> option to
-            <command>configure</command> indicates the MySQL base
-            directory under which the plugin should be installed. You
-            can see what value to use for this option with
-            <literal role="stmt">SHOW VARIABLES</literal>:
+            If you need to specify configuration options to
+            <command>CMake</command>, see
+            <xref linkend="source-configuration-options"/>, for a list.
+            For example, you might want to specify
+            <option role="cmake">CMAKE_INSTALL_PREFIX</option> to
+            indicate the MySQL base directory under which the plugin
+            should be installed. You can see what value to use for this
+            option with <literal role="stmt">SHOW VARIABLES</literal>:
           </para>
 
 <programlisting>


Thread
svn commit - mysqldoc@docsrva: r24344 - in trunk: . refman-5.5 refman-5.6paul.dubois9 Dec