[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r352 - in GNUnet: . src/applications/sqstore_mysql
From: |
durner |
Subject: |
[GNUnet-SVN] r352 - in GNUnet: . src/applications/sqstore_mysql |
Date: |
Wed, 2 Mar 2005 12:08:13 -0800 (PST) |
Author: durner
Date: 2005-03-02 12:08:12 -0800 (Wed, 02 Mar 2005)
New Revision: 352
Modified:
GNUnet/configure.ac
GNUnet/src/applications/sqstore_mysql/mysql.c
Log:
MySQL for Windows
Modified: GNUnet/configure.ac
===================================================================
--- GNUnet/configure.ac 2005-02-28 21:33:56 UTC (rev 351)
+++ GNUnet/configure.ac 2005-03-02 20:08:12 UTC (rev 352)
@@ -291,6 +291,10 @@
LIBS=$saveLIBS
AM_CONDITIONAL(HAVE_ZLIB, test x$zlib = x1)
+# mysql & windows
+AC_CHECK_TYPES([sigset_t, off_t], [], [], [#include <sys/types.h>])
+AC_CHECK_TYPES([size_t], [], [], [#include <stdio.h>])
+
# test for mysql
mysql=false
mysqlfail=false
@@ -305,7 +309,7 @@
AC_CHECK_HEADERS(mysql/mysql.h,
AC_CHECK_LIB(mysqlclient, mysql_init,
EXT_LIB_PATH="-L$with_mysql/lib -L$with_mysql/lib/mysql $EXT_LIB_PATH"
- mysql=true))
+ mysql=true), [], [#include <my_global.h>])
fi
],
[AC_MSG_RESULT([--with-mysql not specified])
@@ -314,14 +318,15 @@
[AC_CHECK_HEADERS(mysql/mysql.h,
EXT_LIB_PATH="-L/usr/lib/mysql $EXT_LIB_PATH"
mysql=true
- )])])
+ , [], [#include <my_global.h>])])])
# additional version check for mysql
if test "$mysql" = "true"
then
AC_MSG_CHECKING(mysql version)
AC_RUN_IFELSE([AC_LANG_PROGRAM(
- [[#include <mysql/mysql.h>]],
+ [[#include <mysql/my_global.h>
+ #include <mysql/mysql.h>]],
[[if (MYSQL_VERSION_ID < 40100)
return(-1);
else
Modified: GNUnet/src/applications/sqstore_mysql/mysql.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysql.c 2005-02-28 21:33:56 UTC
(rev 351)
+++ GNUnet/src/applications/sqstore_mysql/mysql.c 2005-03-02 20:08:12 UTC
(rev 352)
@@ -1168,18 +1168,28 @@
FILE * fp;
struct passwd * pw;
size_t nX;
+ char *home_dir;
/* verify that .my.cnf can be found */
+#ifndef WINDOWS
pw = getpwuid(getuid());
if(!pw)
DIE_STRERROR("getpwuid");
- nX = strlen(pw->pw_dir)+1024;
+ home_dir = pw->pw_dir;
+#else
+ home_dir = (char *) MALLOC(_MAX_PATH + 1);
+ conv_to_win_path("$HOME", home_dir);
+#endif
+ nX = strlen(home_dir)+1024;
cnffile = getConfigurationString("MYSQL",
"CONFIG");
if (cnffile == NULL) {
cnffile = MALLOC(nX);
- SNPRINTF(cnffile, nX, "%s/.my.cnf", pw->pw_dir);
+ SNPRINTF(cnffile, nX, "%s/.my.cnf", home_dir);
}
+#ifdef WINDOWS
+ FREE(home_dir);
+#endif
LOG(LOG_DEBUG,
_("Trying to use file '%s' for MySQL configuration.\n"),
cnffile);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r352 - in GNUnet: . src/applications/sqstore_mysql,
durner <=