[patches] link
Nirgal <[email protected]> Sat, 27 Aug 2011 05:47:18 +0000
| Newsgroups | gmane.comp.db.mdb-tools.devel |
|---|---|
| Message-ID | <[email protected]> |
Attached are 2 patches: asneeded.diff add -as-need option to linker. This prevents the libraries to try to load uneeded libraries. Example warning before: libbonobo-activation.so.4 could be avoided if "/usr/bin/gmdb2" were not uselessly linked against it (they use none of its symbols). odbclink.diff stops embeding libmdb and libmdbsql inside libmdbodbc I have the feeling mdb and mdbsql libraries run time code should not be included in mdbodbc. mdbodbc should just call the existing functions in the correct libraries. This patch does that. ------------------------------------------------------------------------------ EMC VNX: the world's simplest storage, starting under $10K The only unified storage solution that offers unified management Up to 160% more powerful than alternatives and 25% more efficient. Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev _______________________________________________ mdbtools-dev mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mdbtools-dev
asneeded.diff
(text/x-patch, 507 B)
Description: adds --as-needed to link flags. Example warning: libbonobo-activation.so.4 could be avoided if "/usr/bin/gmdb2" were not uselessly linked against it (they use none of its symbols). Index: mdbtools-0.6pre1/configure.in =================================================================== --- mdbtools-0.6pre1.orig/configure.in +++ mdbtools-0.6pre1/configure.in @@ -61,6 +61,8 @@ AC_SUBST(SQL) AC_SUBST(LFLAGS) +LDFLAGS="$LDFLAGS -Wl,--as-needed" + dnl check for iODBC AC_ARG_WITH(iodbc,
odbclink.diff
(text/x-patch, 1.4 KB)
Index: mdbtools-0.6pre1/src/odbc/Makefile.am
===================================================================
--- mdbtools-0.6pre1.orig/src/odbc/Makefile.am
+++ mdbtools-0.6pre1/src/odbc/Makefile.am
@@ -11,11 +11,7 @@
lib_LTLIBRARIES = libmdbodbc.la
AM_CPPFLAGS = -I$(top_srcdir)/include $(GLIB_CFLAGS) $(ODBC_CFLAGS)
libmdbodbc_la_SOURCES= odbc.c connectparams.c
-libmdbodbc_la_LIBADD= $(patsubst %, $(SQLDIR)/%, \
- $(patsubst %.c, %.lo, $(SQLSOURCES))) \
- $(patsubst %, $(MDBDIR)/%, \
- $(patsubst %.c, %.lo, $(MDBSOURCES))) \
- ../libmdb/libmdb.la
+libmdbodbc_la_LIBADD= ../libmdb/libmdb.la ../sql/libmdbsql.la
libmdbodbc_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libmdbodbc.map
LIBS = @LEXLIB@ $(GLIB_LIBS) $(ODBC_LIBS)
unittest_LDADD = libmdbodbc.la ../libmdb/libmdb.la ../sql/libmdbsql.la
Index: mdbtools-0.6pre1/src/odbc/odbc.c
===================================================================
--- mdbtools-0.6pre1.orig/src/odbc/odbc.c
+++ mdbtools-0.6pre1/src/odbc/odbc.c
@@ -960,13 +960,8 @@
mdb_sql_reset(env->sql);
- /* calls to yyparse would need to be serialized for thread safety */
-
- /* begin unsafe */
- g_input_ptr = stmt->query;
- _mdb_sql(env->sql);
- if (yyparse()) {
- /* end unsafe */
+ mdb_sql_run_query(env->sql, stmt->query);
+ if (mdb_sql_has_error(env->sql)) {
LogError("Couldn't parse SQL\n");
mdb_sql_reset(env->sql);
return SQL_ERROR;