Skip to content

Commit 29d77b7

Browse files
committed
docs: 2.0.3 update: fix spelling errors, spacing etc.
1 parent 928ba12 commit 29d77b7

15 files changed

+613
-432
lines changed

doc/building.txt

Lines changed: 100 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Prerequisites
66
To build Connector/C++, the following tools and libraries are required:
77

88
- A C++ compiler that supports C++11. In case of gcc it must be at least
9-
version 4.8. These compilers have been tested: gcc 4.8.4, MS Visual Studio 2013,
10-
MS Visual Studio 2015.
9+
version 4.8. These compilers have been tested: gcc 4.8.4, clang 7.3.0,
10+
MS Visual Studio 2013, MS Visual Studio 2015.
1111

1212
- CMake 2.8.11 or later.
1313

@@ -16,26 +16,30 @@ To build Connector/C++, the following tools and libraries are required:
1616

1717
Build configuration
1818
-------------------
19-
Only out-of-source builds are supported. To configure build, execute
20-
`cmake` in a dedicated build location (not in the source directory)
21-
as usual:
19+
Only out-of-source builds are supported. To configure a build, execute
20+
`cmake` in a dedicated build location (not in the source directory):
2221

2322
~~~~~~~
2423
$ cmake <Connector/C++ source location>
2524
~~~~~~~
2625

27-
If `cmake` can not find correct Boost version, or if it is installed
28-
in a non-standard location, specify correct location using option:
26+
If `cmake` can not find the required Boost version, or if it is installed
27+
in a non-standard location, specify the correct location using the option:
2928

3029
- `-DWITH_BOOST=<Boost location>`
3130

32-
To specify installation location (see below), use option:
31+
To specify the installation location (see below), use the option:
3332

3433
- `-DCMAKE_INSTALL_PREFIX=<Install location>`
3534

3635
If not specified, the install location defaults to
37-
`/usr/local/mysql/connector-c++-2.0` (`<User home>/MySQL/"MySQL Connector C++ 2.0"`
38-
on Windows).
36+
`/usr/local/mysql/connector-c++-2.0`
37+
(`<User home>/MySQL/"MySQL Connector C++ 2.0"` on Windows).
38+
39+
By default a shared library is built. To build a static library, use the option:
40+
41+
- `-DBUILD_STATIC=yes`
42+
3943

4044
Building and testing
4145
--------------------
@@ -46,30 +50,43 @@ location:
4650
$ cmake --build . --config CCC
4751
~~~~~~~
4852

49-
where `CCC` is the build configuration to use, such as `Release`
50-
or `Debug`. It is also possible to ommit `--config CCC` option in which
51-
case the default `Debug` build configuration will be used.
53+
where `CCC` is the build configuration to use, such as `Release` or `Debug`.
54+
It is also possible to omit `--config CCC` option in which case the default
55+
`Debug` configuration will be used.
5256

5357
@note
5458
In what follows the same build configuration `CCC` must be used
5559
for all the steps such as installing the connector or building
5660
the test program.
5761

5862
After a successful build, the build location should contain
59-
the Connector/C++ static library `libmysqlcppconn2-static.a`
60-
(`CCC/mysqlcppconn2-static.lib` on Windows).
63+
the Connector/C++ shared library:
64+
65+
- `libmysqlcppconn2.so.1.0` on Unix,
66+
- `libmysqlcppconn2.1.0.dylib` on OS X,
67+
- `CCC/mysqlcppconn2-vsXX.dll` on Windows, where `-vs12` or `-vs14` prefix
68+
depends on the MSVC version used to build the connector.
69+
70+
On Unix and OS X also appropriate symbolic links are created. On Windows the
71+
import library for the DLL is created at `CCC/mysqlcppconn2.lib` (the `CCC/`
72+
subdirectory is named the same as the build configuration used).
73+
74+
In the case of a static library build, the output library names are:
75+
76+
- `libmysqlcppconn2-static.a` on Unix and OS X,
77+
- `CCC/mysqlcppconn2-static.lib` on Windows.
78+
6179

6280
### Testing
6381

64-
To perform basic testing of the functionality, build and run the
65-
test program included in the `test` subdirectory of the source location.
66-
A running MySQL 5.7 Server instance is needed to run the `cpptest`
67-
application (see below).
82+
To perform basic testing of the connector functionality, build and run one
83+
of the test programs included in the `testapp/` subdirectory of the source
84+
location.
6885

69-
Before building the `cpptest` program, Connector/C++ must be installed
70-
first. To instal Connector/C++ to the default location or to the one specified
71-
with `CMAKE_INSTALL_PREFIX` option during the configuration process,
72-
execute the following command in the build location:
86+
Before building test programs, Connector/C++ must be installed first. To install
87+
Connector/C++ to the default location (which could be set during the build
88+
configuration using `CMAKE_INSTALL_PREFIX` option), execute the following
89+
command in the build location:
7390

7491
~~~~~~~
7592
$ cmake --build . --target install --config CCC
@@ -83,56 +100,70 @@ $ cmake --build . --target install --config CCC
83100
$ cmake -DCMAKE_INSTALL_PREFIX=<new location> .
84101
~~~~~~~
85102

86-
To build the `cpptest` program, pick a build location for it and issue the following
103+
To build test programs, pick a build location and issue the following
87104
commands there:
88105

89106
~~~~~~~
90-
$ cmake -DWITH_CONCPP=<Connector/C++ install location> <source location>/test
91-
$ cmake --build . --target cpptest --config CCC
107+
$ cmake -DWITH_CONCPP=<Connector/C++ install location> <source location>/testapp
108+
$ cmake --build . --config CCC
92109
~~~~~~~
93110

94-
This should create the `cpptest` executable in the build location (on Windows,
95-
in the `CCC` subdirectory).
111+
This should create the `devapi_test` and `xapi_test` executables in the `run/`
112+
subdirectory of the build location.
96113

97114
@note
98-
On Windows, if the connector was built with the static runtime
99-
by specifying `-DSTATC_MSVCRT=yes` configuration option (see below),
100-
the same option must be added to the `cpptest` build configuration.
115+
On Windows, if the connector was built with the static runtime by specifying
116+
`-DSTATC_MSVCRT=yes` configuration option (see below), the same option must
117+
be added to the build configuration of test programs.
101118

102119
@note
103120
The 32/64-bit Windows `cmake` generator (`"Visual Studio 12 2013 Win64"` vs
104-
`"Visual Studio 12 2013"`) used to build the test application must match
121+
`"Visual Studio 12 2013"`) used to build test applications must match
105122
the one used to build the connector.
106123

107-
Before running `cpptest`, ensure that a MySQL Server instance
108-
is running with X Plugin loaded into it. The easiest way of
109-
arranging this is to use `mysql-test-run.pl` script from MySQL Server
110-
distribution. In the `mysql-test` subdirectory of that distribution,
111-
invoke this command:
124+
Before running test programs, ensure that a MySQL Server instance is running
125+
with X Plugin loaded into it. The easiest way of arranging this is to use
126+
the `mysql-test-run.pl` script from the MySQL Server distribution. In the
127+
`mysql-test/` subdirectory of that distribution, invoke this command:
112128

113129
~~~~~~~
114130
$ perl mysql-test-run.pl --start-and-exit --mysqld=--plugin-load=mysqlx
115131
~~~~~~~
116132

117-
This should start a test server instance with X plugin loaded
118-
into it. When started like this, the plugin will listen on port 13009
119-
instead of the standard 33060 one.
133+
This should start a test server instance with X plugin loaded into it. This can
134+
be confirmed by looking at messages output by the server to the `mysqld.1.err`
135+
file found in `mysql-test/var/log/` subdirectory. The log file should contain
136+
a note from the X plugin informing about it being ready to serve connections:
120137

121-
Now one can start the `cpptest` program and see the output similar to the
122-
one presented below. The program accepts port number as the first argument,
123-
with the default value 33060. Thus, if the server was started as described
124-
above, run the test program as follows:
138+
~~~~~~~
139+
Plugin mysqlx reported: 'X plugin tcp connection enable at port 13009.'
140+
~~~~~~~
141+
142+
When started like this, the plugin will listen on port 13009 instead of
143+
the standard 33060 one.
144+
145+
Now one can start one of the test programs and see the output similar to the
146+
one presented below. The `devapi_test` program accepts port number as the first
147+
argument, with the default value 33060. Thus, if the server was started
148+
as described above, run the test program as follows:
125149

126150
~~~~~~~
127-
$ ./cpptest 13009
151+
$ run/devapi_test 13009
128152
~~~~~~~
129153

130154
The program uses the `root` user account without any password and assumes
131155
that there is a `test` schema in the server (these assumptions hold for
132-
a server started using `mysql-test-run.pl`). Different user credentials
133-
can be passed as the second and the third argument of `cpptest` invocation.
156+
a server started using `mysql-test-run.pl`). Different user credentials can
157+
be passed as the second and the third argument of `devapi_test` invocation.
158+
159+
For the `xapi_test` program, connection details can be given in form of an URL,
160+
as shown below:
161+
162+
~~~~~~~
163+
$ run/xapi_test mysqlx://[email protected]:13009
164+
~~~~~~~
134165

135-
If everything goes well, `cpptest` should produce output similar to this:
166+
If everything goes well, `devapi_test` should produce output similar to this:
136167

137168
~~~~~~~
138169
Creating session on localhost, port 13009 ...
@@ -174,42 +205,41 @@ Windows Notes
174205
Connector/C++ uses C++11 language and for that reason it is not possible
175206
to build it with Microsoft Visual Studio 2010 or earlier.
176207

177-
On Windows one can request that Connector/C++ uses the static runtime
178-
library (The `/MT*` compiler option) by setting:
208+
On Windows one can request that Connector/C++ uses the static runtime library
209+
(The `/MT*` compiler option) by setting:
179210

180211
- `-DSTATIC_MSVCRT=yes`
181212

182-
This might be necessary if code which uses Connector/C++ also uses
183-
the static runtime.
213+
This might be necessary if code which uses Connector/C++ also uses the static
214+
runtime.
184215

185-
Selecting cmake generator such as `"Visual Studio 12 2013 Win64"` vs
216+
Selecting a cmake generator such as `"Visual Studio 12 2013 Win64"` vs
186217
`"Visual Studio 12 2013"` selects the 64 or 32 bit platform for which
187218
the connector is built. An application which uses Connector/C++ must
188219
be built for the same platform as the connector.
189220

190221
Note that application which is built using 'Debug', 'Release' or other MSVC
191222
build configuration needs to link against Connector/C++ library built
192-
with the same configuration (cmake option `--config=CCC` described
193-
above). Linker leaves library built using configuration `CCC` in `CCC/`
194-
subfolder of the build location. Thus, when building application that
195-
uses the connector library, one has to point linker at the location
196-
containing compatible build of the connector.
223+
with the same configuration (as determined by the cmake option `--config=CCC`
224+
described above). Linker leaves library built using configuration `CCC` in
225+
a `CCC/` subfolder of the build location. Thus, when building an application
226+
that uses the connector library, one has to point linker at the location
227+
containing a compatible build of the connector.
197228

198229
OS X Notes
199230
----------
200231
On OS X, Connector/C++ is built using the `clang` compiler with the `libc++`
201-
C++ runtime library. The same runtime library should be used by
202-
applications that link against Connector/C++. To arrange this,
203-
pass `-stdlib=libc++` to compiler and linker invocations. Another option is
204-
to set the required deployment target and then compiler defaults
205-
are changed accordingly. To define the deployment target, set the nevironment
206-
variable `MACOSX_DEPLOYMENT_TARGET` to the requested OS X version.
207-
Binary distributions of Connector/C++ are built with `MACOSX_DEPLOYMENT_TARGET`
208-
set to `10.9`.
209-
210-
Building Connector/C++ with `gcc` or its `libstdc++` runtime
211-
implementation has not been tested and there is no support in the build
212-
system for using an alternative C++ runtime library.
232+
C++ runtime library. The same runtime library should be used by applications
233+
that link against Connector/C++. To arrange this, pass `-stdlib=libc++` to
234+
the compiler and the linker invocations. Another option is to set the required
235+
deployment target and then the compiler defaults are changed accordingly.
236+
To define the deployment target, set the environment variable
237+
`MACOSX_DEPLOYMENT_TARGET` to the requested OS X version. Binary distributions
238+
of Connector/C++ are built with `MACOSX_DEPLOYMENT_TARGET` set to `10.9`.
239+
240+
Building Connector/C++ with `gcc` or its `libstdc++` runtime has not been
241+
tested and there is no support in the build system for using an alternative C++
242+
runtime library.
213243

214244

215245
<!--

0 commit comments

Comments
 (0)