summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-02-22 16:22:31 +0300
committerAlexander Nozdrin <alik@sun.com>2010-02-22 16:22:31 +0300
commit0ceeeafe85316e594d8ba42a6d0c3c29201944bf (patch)
tree1d77daf398f43cbe5998ff4f0676165e6808927c /client
parent7a9f2e57e3325a56434704e9ba9fc4f424678a0b (diff)
parent4836199d701af05a9c89563b642c51ee5640e804 (diff)
downloadmariadb-git-0ceeeafe85316e594d8ba42a6d0c3c29201944bf.tar.gz
Manual merge from mysql-next-mr.
Conflicts: - mysql-test/r/mysqld--help-notwin.result - mysql-test/r/mysqld--help-win.result
Diffstat (limited to 'client')
-rwxr-xr-xclient/CMakeLists.txt69
-rw-r--r--client/mysqltest.cc21
2 files changed, 47 insertions, 43 deletions
diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
index 28e4c354a69..f4e223c9c72 100755
--- a/client/CMakeLists.txt
+++ b/client/CMakeLists.txt
@@ -12,67 +12,60 @@
# 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("${PROJECT_SOURCE_DIR}/win/mysql_manifest.cmake")
-INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
- ${CMAKE_SOURCE_DIR}/zlib
- ${CMAKE_SOURCE_DIR}/extra/yassl/include
- ${CMAKE_SOURCE_DIR}/libmysql
- ${CMAKE_SOURCE_DIR}/regex
- ${CMAKE_SOURCE_DIR}/sql
- ${CMAKE_SOURCE_DIR}/strings)
+INCLUDE_DIRECTORIES(
+ ${CMAKE_SOURCE_DIR}/include
+ ${ZLIB_INCLUDE_DIR}
+ ${SSL_INCLUDE_DIRS}
+ ${CMAKE_SOURCE_DIR}/libmysql
+ ${CMAKE_SOURCE_DIR}/regex
+ ${CMAKE_SOURCE_DIR}/sql
+ ${CMAKE_SOURCE_DIR}/strings
+ ${READLINE_INCLUDE_DIR}
+ ${CMAKE_CURRENT_BINARY_DIR}
+)
-ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc ../mysys/my_conio.c)
+ADD_DEFINITIONS(${READLINE_DEFINES})
+ADD_DEFINITIONS(${SSL_DEFINES})
+MYSQL_ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc)
TARGET_LINK_LIBRARIES(mysql mysqlclient)
+IF(UNIX)
+ TARGET_LINK_LIBRARIES(mysql ${READLINE_LIBRARY})
+ENDIF(UNIX)
-ADD_EXECUTABLE(mysqltest mysqltest.cc)
+MYSQL_ADD_EXECUTABLE(mysqltest mysqltest.cc)
SET_SOURCE_FILES_PROPERTIES(mysqltest.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
-TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys regex dbug)
+TARGET_LINK_LIBRARIES(mysqltest mysqlclient regex)
-ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
+
+MYSQL_ADD_EXECUTABLE(mysqlcheck mysqlcheck.c)
TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient)
-ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c ../mysys/mf_getdate.c)
+MYSQL_ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c)
TARGET_LINK_LIBRARIES(mysqldump mysqlclient)
-ADD_EXECUTABLE(mysqlimport mysqlimport.c)
+MYSQL_ADD_EXECUTABLE(mysqlimport mysqlimport.c)
TARGET_LINK_LIBRARIES(mysqlimport mysqlclient)
-ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c ../mysys/my_getpagesize.c)
+MYSQL_ADD_EXECUTABLE(mysql_upgrade mysql_upgrade.c)
TARGET_LINK_LIBRARIES(mysql_upgrade mysqlclient)
ADD_DEPENDENCIES(mysql_upgrade GenFixPrivs)
-ADD_EXECUTABLE(mysqlshow mysqlshow.c)
+MYSQL_ADD_EXECUTABLE(mysqlshow mysqlshow.c)
TARGET_LINK_LIBRARIES(mysqlshow mysqlclient)
-ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc
- ../mysys/mf_tempdir.c
- ../mysys/my_new.cc
- ../mysys/my_bit.c
- ../mysys/my_bitmap.c
- ../mysys/my_vle.c
- ../mysys/base64.c)
+MYSQL_ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc)
TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient)
-ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
+MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
TARGET_LINK_LIBRARIES(mysqladmin mysqlclient)
-ADD_EXECUTABLE(mysqlslap mysqlslap.c)
+MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
-TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys zlib dbug)
+TARGET_LINK_LIBRARIES(mysqlslap mysqlclient)
ADD_EXECUTABLE(echo echo.c)
-IF(EMBED_MANIFESTS)
- MYSQL_EMBED_MANIFEST("mysql" "asInvoker")
- MYSQL_EMBED_MANIFEST("mysqltest" "asInvoker")
- MYSQL_EMBED_MANIFEST("mysqlcheck" "asInvoker")
- MYSQL_EMBED_MANIFEST("mysqldump" "asInvoker")
- MYSQL_EMBED_MANIFEST("mysqlimport" "asInvoker")
- MYSQL_EMBED_MANIFEST("mysql_upgrade" "asInvoker")
- MYSQL_EMBED_MANIFEST("mysqlshow" "asInvoker")
- MYSQL_EMBED_MANIFEST("mysqlbinlog" "asInvoker")
- MYSQL_EMBED_MANIFEST("mysqladmin" "asInvoker")
- MYSQL_EMBED_MANIFEST("echo" "asInvoker")
-ENDIF(EMBED_MANIFESTS)
+SET_TARGET_PROPERTIES (mysqlcheck mysqldump mysqlimport mysql_upgrade mysqlshow mysqlslap
+PROPERTIES HAS_CXX TRUE)
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 2ba3182fb65..9281d40bd60 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -74,7 +74,7 @@
#define QUERY_REAP_FLAG 2
#ifndef HAVE_SETENV
-#error implement our portable setenv replacement in mysys
+static int setenv(const char *name, const char *value, int overwrite);
#endif
enum {
@@ -87,9 +87,7 @@ enum {
static int record= 0, opt_sleep= -1;
static char *opt_db= 0, *opt_pass= 0;
const char *opt_user= 0, *opt_host= 0, *unix_sock= 0, *opt_basedir= "./";
-#ifdef HAVE_SMEM
static char *shared_memory_base_name=0;
-#endif
const char *opt_logdir= "";
const char *opt_include= 0, *opt_charsets_dir;
static int opt_port= 0;
@@ -5953,12 +5951,10 @@ static struct my_option my_long_options[] =
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
{"server-file", 'F', "Read embedded server arguments from file.",
0, 0, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
-#ifdef HAVE_SMEM
{"shared-memory-base-name", OPT_SHARED_MEMORY_BASE_NAME,
"Base name of shared memory.", (uchar**) &shared_memory_base_name,
(uchar**) &shared_memory_base_name, 0, GET_STR, REQUIRED_ARG, 0, 0, 0,
0, 0, 0},
-#endif
{"silent", 's', "Suppress all normal output. Synonym for --quiet.",
(uchar**) &silent, (uchar**) &silent, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"skip-safemalloc", OPT_SKIP_SAFEMALLOC,
@@ -9845,3 +9841,18 @@ void dynstr_append_sorted(DYNAMIC_STRING* ds, DYNAMIC_STRING *ds_input)
delete_dynamic(&lines);
DBUG_VOID_RETURN;
}
+
+#ifndef HAVE_SETENV
+static int setenv(const char *name, const char *value, int overwrite)
+{
+ size_t buflen= strlen(name) + strlen(value) + 2;
+ char *envvar= (char *)malloc(buflen);
+ if(!envvar)
+ return ENOMEM;
+ strcpy(envvar, name);
+ strcat(envvar, "=");
+ strcat(envvar, value);
+ putenv(envvar);
+ return 0;
+}
+#endif