summaryrefslogtreecommitdiff
path: root/libmysqlclient/README-DEV
diff options
context:
space:
mode:
Diffstat (limited to 'libmysqlclient/README-DEV')
-rw-r--r--libmysqlclient/README-DEV72
1 files changed, 64 insertions, 8 deletions
diff --git a/libmysqlclient/README-DEV b/libmysqlclient/README-DEV
index f83016d..e619bc5 100644
--- a/libmysqlclient/README-DEV
+++ b/libmysqlclient/README-DEV
@@ -6,17 +6,72 @@ Symlink the required upstream components and provide our own implementations
for auto-generated headers:
$ ln -s ../upstream/LICENSE
-
-$ ln -s ../../upstream/{strings,vio,sql-common,sql,mysys,mysys_ssl,libbinlogevents,libmysql} \
- mysql
-
-$ ln -s ../../upstream/include mysql/mysql
+#$ ln -s ../../upstream/{vio,sql,mysys,mysys_ssl,libbinlogevents,libmysql} mysql
+$ ln -s ../../upstream/{vio,sql,mysys_ssl,libbinlogevents,libmysql} mysql
+#$ ln -s ../../upstream/include mysql/mysql
+$ ln -s ../../upstream/include/mysql_version.h.in mysql/version.h.in
+
+Add support for building with MinGW GCC:
+
+$ mkdir -p mysql/mysql
+$ pushd mysql/mysql
+$ ln -s ../../../upstream/include/*.h .
+$ mv m_ctype.h m_ctype.h.orig
+$ cp m_ctype.h.orig m_ctype.h
+$ mv my_dir.h my_dir.h.orig
+$ cp my_dir.h.orig my_dir.h
+$ mkdir -p mysql/components/services
+$ cd mysql/components/services
+$ ln -s ../../../../../../upstream/include/mysql/components/services/*.h .
+$ mv my_io_bits.h my_io_bits.h.orig
+$ cp my_io_bits.h.orig my_io_bits.h
+$ cd ..
+$ ln -s ../../../../../upstream/include/mysql/components/*.h .
+$ cd ..
+$ ln -s ../../../../upstream/include/mysql/psi .
+$ ln -s ../../../../upstream/include/mysql/*.h .
+$ popd
+$ mkdir -p mysql/mysys
+$ pushd mysql/mysys
+$ ln -s ../../../upstream/mysys/*.{h,cc} .
+$ mv my_thr_init.cc my_thr_init.cc.orig
+$ cp my_thr_init.cc.orig my_thr_init.cc
+$ mv stacktrace.cc stacktrace.cc.orig
+$ cp stacktrace.cc.orig stacktrace.cc
+$ popd
+
+$ git apply mingw.patch
+
+Note that the above patches are produced by the following commands:
+
+$ git diff ><patch-path>
+
+Also make sure all source files are UTF-8-encoded:
+
+$ mkdir -p mysql/strings
+$ pushd mysql/strings
+$ ln -s ../../../upstream/strings/{README,*.{cc,h}} .
+$ mv ctype-czech.cc ctype-czech.cc.orig
+$ iconv -f ISO-8859-2 -t UTF-8 ctype-czech.cc.orig >ctype-czech.cc
+$ mv decimal.cc decimal.cc.orig
+$ iconv -f UTF-8 -t UTF-8 -c decimal.cc.orig >decimal.cc
+$ popd
+
+Also add missing <limits> include to sql-common/sql_string.cc:
+
+$ mkdir -p mysql/sql-common
+$ pushd mysql/sql-common
+$ ln -s ../../../upstream/sql-common/*.{cc,h} .
+$ mv sql_string.cc sql_string.cc.orig
+$ cp sql_string.cc.orig sql_string.cc
+# Edit sql_string.cc, adding missing <limits> include.
+$ popd
Note that we unable to generate mysql_version.h directly from the template as
it is included as "mysql_version.h" in upstream's source code, which makes
impossible using the header-generating machinery. That's why we create
mysql/mysql_version.h that includes <mysql/version.h> that we auto-generate
-from upstream's mysql/mysql_version.h.in.
+from upstream's mysql_version.h.in.
$ ln -s libbinlogevents/binlog_config.h.cmake mysql/binlog_config.h.cmake.orig
@@ -47,7 +102,8 @@ to, grepping for its usages, for example:
grep -e CPU_LEVEL1_DCACHE_LINESIZE `find -L . -name '*.c*' -o -name '*.h*'`
-And it may become obvious that the macro is not used in libmysqlclient.
+And it may become obvious that the macro is not used in libmysqlclient and
+mysql-client.
Re-creating mysql/my_config.h from scratch every time we upgrade to a new
upstream version would be a real pain. Instead we can only (un)define the
@@ -56,7 +112,7 @@ macro sets:
$ for m in `cat mysql/{config,binlog_config}.h.cmake.orig | \
sed -n 's/.*#\s*\(define\|cmakedefine\)\s\{1,\}\([_a-zA-Z0-9]\{1,\}\)\(\s.*\)\{0,1\}$/\2/p' | sort -u`; do
- if grep -q -e "\b$m\b" `find -L . -name '*.h' -a ! -name my_config.h -a ! -name config.h -o -name '*.c' -o -name '*.cc' -a ! -name mysqld.cc -o -name '*.cpp' -o -name '*.hpp'`; then
+ if grep -q -e "\b$m\b" `find -L . ../mysql-client -name '*.h' -a ! -name my_config.h -a ! -name config.h -o -name '*.c' -o -name '*.cc' -a ! -name mysqld.cc -o -name '*.cpp' -o -name '*.hpp'`; then
echo "$m"
fi
done >used-macros