---------- Forwarded message ----------
From: Duncan McQueen <[EMAIL PROTECTED]>
Date: Aug 28, 2007 8:20 PM
Subject: Re: [libdbi-devel] Compilation of MySQL driver under MingW
To: Markus Hoenicka <[EMAIL PROTECTED]>
Attached is my patch (let me know if it isn't quite correct - made it
using cvs diff).
I had to modify the Makefile.w32 to add sqlite3. However, I tested
this on a simple application and it worked. Therefore, we should have
support for sqlite3, mysql, postgres and possibly freetds (if I can
ever test it) native on Windows under MinGW. This is very exciting
(to me, at least).
On 8/28/07, Duncan McQueen <[EMAIL PROTECTED]> wrote:
> On 8/28/07, Markus Hoenicka <[EMAIL PROTECTED]> wrote:
> > Quoting Duncan McQueen <[EMAIL PROTECTED]>:
> >
> > > Part of the problem may be I am compiling using GCC 4.2.1 - and
> > > excessive warning messages seem to be the norm there. My dbd.h is
> > > from CVS as of two days ago.
> > >
> >
> > In that case it might help to manually cast the int variable to const
> > int, like this:
> >
> > _dbd_internal_error_handler(conn, "could not open database", (const
> > int) sqlite3_errcode);
> >
> > Does your GCC like this better?
> >
> >
>
> I will check tonight on both of these.
>
> > > I will look on the POSIX_PATH_MATH and try to add it. I know I have
> > > seen other source where it was defined as you mentioned.
> > >
> > >> ifndef _POSIX_PATH_MAX
> > >> #define _POSIX_PATH_MAX 512
> > >> endif
> > >>
> >
> > This should of course read:
> >
> > #ifndef _POSIX_PATH_MAX
> > #define _POSIX_PATH_MAX 512
> > #endif
> >
> > regards,
> > Markus
> >
> > --
> > Markus Hoenicka
> > [EMAIL PROTECTED]
> > (Spam-protected email: replace the quadrupeds with "mhoenicka")
> > http://www.mhoenicka.de
> >
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems? Stop.
> > Now Search log events and configuration files using AJAX and a browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > libdbi-devel mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/libdbi-devel
> >
>
Index: Makefile.w32
===================================================================
RCS file: /cvsroot/libdbi-drivers/libdbi-drivers/Makefile.w32,v
retrieving revision 1.8
diff -u -w -b -i -p -r1.8 Makefile.w32
--- Makefile.w32 21 Nov 2005 21:18:15 -0000 1.8
+++ Makefile.w32 29 Aug 2007 01:57:01 -0000
@@ -39,19 +39,22 @@ MSQL_LIBS = -L /usr/local/lib -L /usr/lo
MYSQL_LIBS = -L /usr/local/lib -ldbi -lmysqlclient -liberty -lz
PGSQL_LIBS = -L /usr/local/lib -ldbi -ldbi -lpq -liberty
SQLITE_LIBS = -L /usr/local/lib -ldbi -ldbi -lsqlite -liberty
+SQLITE3_LIBS = -L /usr/local/lib -ldbi -ldbi -lsqlite3 -liberty
driverdir = ${exec_prefix}/lib/dbd
LIBMSQL_DLL_NAME = libdbdmsql.dll
LIBMYSQL_DLL_NAME = libdbdmysql.dll
LIBPGSQL_DLL_NAME = libdbdpgsql.dll
LIBSQLITE_DLL_NAME = libdbdsqlite.dll
+LIBSQLITE3_DLL_NAME = libdbdsqlite3.dll
LIBMSQL_DLL_EXP_LIB = libdbdmsql.dll.a
LIBMYSQL_DLL_EXP_LIB = libdbdmysql.dll.a
LIBPGSQL_DLL_EXP_LIB = libdbdpgsql.dll.a
LIBSQLITE_DLL_EXP_LIB = libdbdsqlite.dll.a
+LIBSQLITE3_DLL_EXP_LIB = libdbdsqlite3.dll.a
-all: libmysql-dll libpgsql-dll libsqlite-dll libmsql-dll
+all: libmysql-dll libpgsql-dll libsqlite-dll libsqlite3-dll libmsql-dll
libmsql-dll: $(top_srcdir)/drivers/msql/dbd_msql.o
$(CC) -shared
-Wl,--out-implib=$(top_srcdir)/drivers/msql/.libs/$(LIBMSQL_DLL_EXP_LIB) -o
$(top_srcdir)/drivers/msql/.libs/$(LIBMSQL_DLL_NAME) -L$(top_srcdir)/src/.libs
$(LDFLAGS) $(top_srcdir)/drivers/msql/*.o $(MSQL_LIBS)
@@ -65,7 +68,10 @@ libpgsql-dll: $(top_srcdir)/drivers/pgsq
libsqlite-dll: $(top_srcdir)/drivers/sqlite/dbd_sqlite.o
$(CC) -shared
-Wl,--out-implib=$(top_srcdir)/drivers/sqlite/.libs/$(LIBSQLITE_DLL_EXP_LIB) -o
$(top_srcdir)/drivers/sqlite/.libs/$(LIBSQLITE_DLL_NAME) $(LDFLAGS)
$(top_srcdir)/drivers/sqlite/*.o $(SQLITE_LIBS)
-install: install-libmysql install-libpgsql install-libsqlite install-libmsql
+libsqlite3-dll: $(top_srcdir)/drivers/sqlite3/dbd_sqlite3.o
+ $(CC) -shared
-Wl,--out-implib=$(top_srcdir)/drivers/sqlite3/.libs/$(LIBSQLITE3_DLL_EXP_LIB)
-o $(top_srcdir)/drivers/sqlite3/.libs/$(LIBSQLITE3_DLL_NAME) $(LDFLAGS)
$(top_srcdir)/drivers/sqlite3/*.o $(SQLITE3_LIBS)
+
+install: install-libmysql install-libpgsql install-libsqlite
install-libsqlite3 install-libmsql
install-libmsql:
cp $(top_srcdir)/drivers/msql/.libs/$(LIBMSQL_DLL_NAME) $(driverdir) &&
\
@@ -83,8 +89,13 @@ install-libsqlite:
cp $(top_srcdir)/drivers/sqlite/.libs/$(LIBSQLITE_DLL_NAME)
$(driverdir) && \
cp $(top_srcdir)/drivers/sqlite/.libs/$(LIBSQLITE_DLL_EXP_LIB)
$(driverdir)
+install-libsqlite3:
+ cp $(top_srcdir)/drivers/sqlite3/.libs/$(LIBSQLITE3_DLL_NAME)
$(driverdir) && \
+ cp $(top_srcdir)/drivers/sqlite3/.libs/$(LIBSQLITE3_DLL_EXP_LIB)
$(driverdir)
+
+
-.PHONY: libdbdmysql.dll libdbdpgsql.dll libdbdsqlite.dll libdbdmsql.dll
install install-libmysql install-libpgsql install-libsqlite
+.PHONY: libdbdmysql.dll libdbdpgsql.dll libdbdsqlite.dll libdbdsqlite3.dll
libdbdmsql.dll install install-libmysql install-libpgsql install-libsqlite
install-libsqlite3
# Tell versions [3.59,3.63) of GNU make to not export all variables.
cvs diff: Diffing debian
cvs diff: Diffing doc
cvs diff: Diffing doc/include
cvs diff: Diffing drivers
cvs diff: Diffing drivers/firebird
cvs diff: Diffing drivers/freetds
cvs diff: Diffing drivers/ingres
cvs diff: Diffing drivers/msql
cvs diff: Diffing drivers/mysql
cvs diff: Diffing drivers/oracle
cvs diff: Diffing drivers/pgsql
cvs diff: Diffing drivers/sqlite
cvs diff: Diffing drivers/sqlite3
Index: drivers/sqlite3/dbd_sqlite3.c
===================================================================
RCS file: /cvsroot/libdbi-drivers/libdbi-drivers/drivers/sqlite3/dbd_sqlite3.c,v
retrieving revision 1.15
diff -u -w -b -i -p -r1.15 dbd_sqlite3.c
--- drivers/sqlite3/dbd_sqlite3.c 20 Feb 2007 00:00:25 -0000 1.15
+++ drivers/sqlite3/dbd_sqlite3.c 29 Aug 2007 01:41:51 -0000
@@ -204,11 +204,11 @@ int _real_dbd_connect(dbi_conn_t *conn,
access rights or an existing database is corrupted or created
with an incompatible version */
if (sq_errmsg) {
- _dbd_internal_error_handler(conn, sq_errmsg, sqlite3_errcode);
+ _dbd_internal_error_handler(conn, sq_errmsg, (const int)
sqlite3_errcode);
free(sq_errmsg);
}
else {
- _dbd_internal_error_handler(conn, "could not open database",
sqlite3_errcode);
+ _dbd_internal_error_handler(conn, "could not open database", (const int)
sqlite3_errcode);
}
return -1;
}
@@ -408,7 +408,7 @@ dbi_result_t *dbd_list_dbs(dbi_conn_t *c
}
if (sq_errmsg) {
- _dbd_internal_error_handler(conn, sq_errmsg, retval);
+ _dbd_internal_error_handler(conn, sq_errmsg, (const int) retval);
free(sq_errmsg);
break;
}
Index: drivers/sqlite3/dbd_sqlite3.h
===================================================================
RCS file: /cvsroot/libdbi-drivers/libdbi-drivers/drivers/sqlite3/dbd_sqlite3.h,v
retrieving revision 1.1
diff -u -w -b -i -p -r1.1 dbd_sqlite3.h
--- drivers/sqlite3/dbd_sqlite3.h 29 Apr 2005 20:42:39 -0000 1.1
+++ drivers/sqlite3/dbd_sqlite3.h 29 Aug 2007 01:39:41 -0000
@@ -33,6 +33,10 @@ enum enum_field_types { FIELD_TYPE_DECIM
other systems use limits like 32 (PostgreSQL) and 64 (MySQL) */
#define MAX_IDENT_LENGTH 128
+#ifndef _POSIX_PATH_MAX
+#define _POSIX_PATH_MAX 512
+#endif
+
#define SQLITE3_RESERVED_WORDS { \
"ACTION", \
"ADD", \-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
libdbi-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libdbi-devel