GNOME Bugzilla – Bug 314732
libgda build fixes for Cygwin
Last modified: 2007-02-28 17:31:04 UTC
Version details: 1.2.2 Distribution/Version: Cygwin Building libgda (1.2.2) on Cygwin proved to be something of a challenge. I'm attaching a patch which fixes the most portable of the problems. FYI, I got the following providers working as designed: bdb, ldap, mdb, postgres, sqlite, and xml. I made odbc work with Windows odbc32, so I'm not including that in the current patch. * configure.in: shared libraries are *.so only on *NIX; not so on Cygwin/MinGW. Test for the *.a instead, which is more universal. * libsql/Makefile.am: add -no-undefined to LDFLAGS, and move $(LIBGDA_LIBS) to LDADD. (On Cygwin, symbols are resolved in order, so this is important.) Also, sql-parser-test does depend on libgda-2.la (this broke a parallel build). * providers/*/Makefile.am, report/libgda-report/Makefile.am: add -no-undefined to LDFLAGS, and list libgda-2.la *before* $(LIBGDA_LIBS). * providers/sqlite/gda-sqlite-provider.c: s/sqlite_complete/sqlite3_complete/. AFAICS, this has been fixed in CVS HEAD but not in release-1-2-branch. Thanks for your work!
Created attachment 51477 [details] [review] Cygwin build patch
If you use .a for the libraries, it will stop working on some Linux systems. Could you instead use $(LIB_EXTENSION) (or however it's defined by auto*)?
I'm not sure about that. Could you go ahead with the rest of the patch (everything except configure.in), and I'll work on a better patch for configure.in (and perhaps including the obdc32 patch) later.
Created attachment 54156 [details] [review] libgda-1.2.3 Cygwin patch Here's an updated patch for libgda-1.2.3. I omitted the .so/.a changes in this patch; I'll work on making that part more portable later.
Working on 1.9.100 now, including portability fixes for configure.in provider tests, but there are problems building some of the providers: bdb) .libs/gda-bdb-recordset.o:gda-bdb-recordset.c:(.text+0x1fb): undefined reference to `_gda_data_model_hash_get_row' (This appears to be a *private* function in libgda/gda-data-model-hash.c.) freetds) This doesn't compile at all, but I have yet to determine where the fault is. ldap) .libs/gda-ldap-recordset.o:gda-ldap-recordset.c:(.text+0x62e): undefined reference to `_gda_row_free' (This appears to be removed from the libgda API.) postgres) .libs/utils.o:utils.c:(.text+0x3b9): undefined reference to `_GDA_POSTRES_BLOB' (This is a typo in providers/postgres/utils.c; after I fixed this, it linked successfully.) xbase) .libs/gda-xbase-provider.o:gda-xbase-provider.c:(.text+0x490): undefined referen ce to `_gda_xbase_database_get_name' (This function must have been removed from providers/xbase/gda-xbase-database.cpp.)
Created attachment 54813 [details] [review] libgda-1.9.100 Cygwin patch Here's what I've got so far for libgda-1.9.100.
Ok, committed to HEAD. Only one thing, does -no-undefined affect in some way the UNIX build?
AFAIK it doesn't, but the problems with the above providers in my comment #5 really need to be fixed as well (except for postgres, which I included in the patch).
I'd appreciate a patch that fixes that, if possible :)
Unfortunately I'm not up on my libgda-2.0 API. I know that the bdb and ldap providers worked in 1.2.3, so those are due to the change in API for 2.0. The undefined symbol in gda-xbase-provider.c appears to *never* have been defined (from looking at CVS); I just found it now because I only recently built xbase itself. And the freetds provider is just a mess at this point; it'll take me some more time to iron it out. If we're unable to fix any of these providers for Cygwin, then we'll need to back out the specific '-no-undefined' LDFLAGS, since it's untrue.
Sigh, I found another couple problems. 1) libgdasql is not parallel installable with 1.x (should be libgdasql-3?); 2) As libgda-3 depends on libgdasql, should '-lgdasql(-3)' be added to Libs in libgda-2.0.pc.in? (For example, libgnomedb-3 needs to link against libgdasql.) How can we handle this?
Any progress on comment 10 and comment 11?
These parallel-install problems must be fixed before we wreck any more libgda 1.2 installations.
I'm working on a patch for libgda-1.9.102 to fix the Cygwin build (again) and solve the parallel-install problem as well; should have it done by today or tomorrow.
Still working on it, but there are lots of problems with the providers in 1.9.102. Can someone who knows the API help me out with these (see also comment 10): bdb) .libs/gda-bdb-recordset.o:gda-bdb-recordset.c:(.text+0x23f): undefined reference to `_gda_data_model_hash_get_row' freetds) Broken includes; where is "gda-freetds-deps.h"? ldap) .libs/gda-ldap-recordset.o:gda-ldap-recordset.c:(.text+0x255): undefined reference to `_gda_data_model_get_command_text' mdb) providers/mdb/gda-mdb-provider.c:234: error: `MDB_WRITABLE' undeclared (first use in this function) [This is with mdbtools-0.5] odbc) .libs/gda-odbc-provider.o:gda-odbc-provider.c:(.text+0x1a76): undefined reference to `_gda_parameter_list_find' xbase) .libs/gda-xbase-provider.o:gda-xbase-provider.c:(.text+0x4f0): undefined reference to `_gda_xbase_database_get_name' I did get sqlite and postgres to link with minor patches, the rest aren't available on Cygwin, so someone else will have to work on them.
Created attachment 65062 [details] [review] libgda-1.9.102 Cygwin patch #1 Here's what I have so far. This allows libgda*-3 libs to compile on Cygwin/Win32, moves libgdasql to libgdasql-3, adds -lgdasql-3 to libgda-2.0.pc.in, and fixes two of the providers. The rest still need help, see previous comment.
Here's what I've got for 2.99.2, patch to follow. Still unresolved is a problem with the ldap provider: gda-ldap-recordset.c: undefined reference to `_gda_data_model_get_command_text This is a *private* API and is not exported by libgda.
Created attachment 78932 [details] [review] libgda-2.99.2 Cygwin patch This is my patch for libgda-2.99.2. Bootstrapping is same as before; here's a summary of the new parts: - Fix gda-sharp.dll.config on Cygwin (yes, mono and Gtk# do work on Cygwin, but I haven't pushed the patches upstream yet). - Rename libsqltransaction.la to libgda_sql_transaction-3.0.la. Add it to libgda-3.0.pc.in. Build it and libgda_sql_delimiter-3.0 before libgda-3.0, since the former are not interdependent with the latter. - Rename libgdasql.la to libgdasql-3.0.la. Add it to libgda-3.0.pc.in. - Fix provider dependencies (for the Cygwin-supported databases). - Fix mdb provider for mdbtools-0.6pre1 (which is already required for MDB_WRITABLE). - Port odbc provider to 3.0 API (PLEASE VERIFY). - Fix xbase provider for non-existant provider API (PLEASE VERIFY). Providers compiled on Cygwin: bdb freetds mdb mysql odbc postgres sqlite xbase Some more issues to fix: - $(datadir)/libgda and $(sysconfdir)/libgda should be rename libgda-3.0 for parallel installation with 1.2. - gtk-docs should be parallel installable; requires changing DOC_MODULE in doc/C/Makefile.am to libgda-3.0 and renaming some of the files in same directory. - gda-sharp should be sn'd and installed with gacutil like the rest of Gtk# (requires adjusting gda-sharp-3.0.pc.in as well). - Should the apps be parallel installable as well? Will proceed with libgnomedb (bug 321663) in the meantime.
I have committed the patch. In future, please do patch the ChangeLog, so I don't have to write a ChangeLog entry for you. > - $(datadir)/libgda and $(sysconfdir)/libgda should be rename libgda-3.0 for parallel installation with 1.2. I have done this. I'm not sure what exactly needs to be done for the rest. A patch would be welcome. This probably belongs in a different bug though.
What do you think? Does something more need to be done, or should I close this bug?
Is 2.99.3 due soon?
Sorry, there's still a problem with the ldap provider, see comment 17.
> Still unresolved is a problem with the ldap provider: > gda-ldap-recordset.c: undefined reference to `_gda_data_model_get_command_text > This is a *private* API and is not exported by libgda. Could you take a look? Maybe the other providers do something different. If necessary, maybe we need to export this function, just documenting it as private. We'd probably need to remove the _ prefix to do that.
Other providers also used this function. I've made a new bug 411811 for it, since it is not Cygwin specific.
Created attachment 83349 [details] [review] libgda-2.99.5 Cygwin patch * win32/dummy.la: Was imported into CVS empty, causing several compaints from Win32 users. Fixed. * win32/libgda_graph-3.0.def * win32/libgda_handlers-3.0.def: Updated to 2.99.5 API.
Committed. Thanks. Please don't forget to patch the ChangeLog next time.