diff options
Diffstat (limited to 'libmysqld/examples')
-rw-r--r-- | libmysqld/examples/CMakeLists.txt | 41 | ||||
-rw-r--r-- | libmysqld/examples/Makefile.am | 21 | ||||
-rw-r--r-- | libmysqld/examples/builder-sample/emb_samples.cpp | 2 |
3 files changed, 54 insertions, 10 deletions
diff --git a/libmysqld/examples/CMakeLists.txt b/libmysqld/examples/CMakeLists.txt new file mode 100644 index 00000000000..5194836a728 --- /dev/null +++ b/libmysqld/examples/CMakeLists.txt @@ -0,0 +1,41 @@ +# Copyright (C) 2006 MySQL AB +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include + ${CMAKE_SOURCE_DIR}/libmysqld/include + ${CMAKE_SOURCE_DIR}/regex + ${CMAKE_SOURCE_DIR}/zlib + ${CMAKE_SOURCE_DIR}/extra/yassl/include) + +# Currently does not work with DBUG, there are missing symbols reported. +IF(WIN32) + ADD_DEFINITIONS(-DUSE_TLS) +ENDIF(WIN32) + +ADD_DEFINITIONS(-DEMBEDDED_LIBRARY) + +ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc + ../../client/mysql.cc ../../client/readline.cc + ../../client/sql_string.cc) +TARGET_LINK_LIBRARIES(mysql_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32) +TARGET_LINK_LIBRARIES(mysql_embedded libmysqld) + +ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc) +TARGET_LINK_LIBRARIES(mysqltest_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32) +TARGET_LINK_LIBRARIES(mysqltest_embedded libmysqld) + +ADD_EXECUTABLE(mysql_client_test_embedded ../../tests/mysql_client_test.c) +TARGET_LINK_LIBRARIES(mysql_client_test_embedded debug dbug strings mysys vio yassl taocrypt regex ws2_32) +TARGET_LINK_LIBRARIES(mysql_client_test_embedded libmysqld) diff --git a/libmysqld/examples/Makefile.am b/libmysqld/examples/Makefile.am index e0dd8491688..fd37f362960 100644 --- a/libmysqld/examples/Makefile.am +++ b/libmysqld/examples/Makefile.am @@ -15,12 +15,13 @@ noinst_PROGRAMS = mysql bin_PROGRAMS = mysqltest_embedded mysql_client_test_embedded -client_sources = $(mysqltest_embedded_SOURCES) $(mysql_SOURCES) -tests_sources = $(mysql_client_test_embedded_SOURCES) -CLEANFILES = $(client_sources) $(tests_sources) +client_sources = $(nodist_mysqltest_embedded_SOURCES) $(nodist_mysql_SOURCES) +tests_sources = $(nodist_mysql_client_test_embedded_SOURCES) +BUILT_SOURCES = link_sources +CLEANFILES = $(client_sources) $(tests_sources) $(BUILT_SOURCES) +EXTRA_DIST = CMakeLists.txt link_sources: - set -x; \ for f in $(client_sources); do \ rm -f $$f; \ @LN_CP_F@ $(top_srcdir)/client/$$f $$f; \ @@ -29,25 +30,27 @@ link_sources: rm -f $$f; \ @LN_CP_F@ $(top_srcdir)/tests/$$f $$f; \ done + echo timestamp > link_sources DEFS = -DEMBEDDED_LIBRARY INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I$(srcdir) \ -I$(top_srcdir) -I$(top_srcdir)/client -I$(top_srcdir)/regex \ $(openssl_includes) LIBS = @LIBS@ @WRAPLIBS@ @CLIENT_LIBS@ $(yassl_libs) -LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @innodb_system_libs@ @LIBDL@ $(CXXLDFLAGS) \ +LDADD = @CLIENT_EXTRA_LDFLAGS@ ../libmysqld.a @LIBDL@ $(CXXLDFLAGS) \ @NDB_SCI_LIBS@ mysqltest_embedded_LINK = $(CXXLINK) -mysqltest_embedded_SOURCES = mysqltest.c -mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a +nodist_mysqltest_embedded_SOURCES = mysqltest.cc +mysqltest_embedded_LDADD = $(LDADD) $(top_builddir)/regex/libregex.a \ + @MYSQLD_EXTRA_LDFLAGS@ -mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ +nodist_mysql_SOURCES = mysql.cc readline.cc completion_hash.cc \ my_readline.h sql_string.h completion_hash.h mysql_LDADD = @readline_link@ @TERMCAP_LIB@ $(LDADD) mysql_client_test_embedded_LINK = $(CXXLINK) -mysql_client_test_embedded_SOURCES = mysql_client_test.c +nodist_mysql_client_test_embedded_SOURCES = mysql_client_test.c # Don't update the files from bitkeeper %::SCCS/s.% diff --git a/libmysqld/examples/builder-sample/emb_samples.cpp b/libmysqld/examples/builder-sample/emb_samples.cpp index 411de26149b..be3f1931af5 100644 --- a/libmysqld/examples/builder-sample/emb_samples.cpp +++ b/libmysqld/examples/builder-sample/emb_samples.cpp @@ -3,7 +3,7 @@ #pragma hdrstop #include "emb_samples.h" -#include <winsock.h> +#include <winsock2.h> #include <mysql.h> #include <stdarg.h> #include <stdio.h> |