After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 314732 - libgda build fixes for Cygwin
libgda build fixes for Cygwin
Status: RESOLVED FIXED
Product: libgda
Classification: Other
Component: general
2.99.x
Other Cygwin
: Normal major
: ---
Assigned To: Rodrigo Moya
gnome-db Maintainers
Depends on:
Blocks: 321663
 
 
Reported: 2005-08-28 20:45 UTC by Yaakov Selkowitz
Modified: 2007-02-28 17:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Cygwin build patch (9.55 KB, patch)
2005-08-28 20:46 UTC, Yaakov Selkowitz
none Details | Review
libgda-1.2.3 Cygwin patch (11.22 KB, patch)
2005-10-31 20:27 UTC, Yaakov Selkowitz
none Details | Review
libgda-1.9.100 Cygwin patch (18.00 KB, patch)
2005-11-16 01:03 UTC, Yaakov Selkowitz
committed Details | Review
libgda-1.9.102 Cygwin patch #1 (33.58 KB, patch)
2006-05-09 03:39 UTC, Yaakov Selkowitz
none Details | Review
libgda-2.99.2 Cygwin patch (50.51 KB, patch)
2006-12-27 02:48 UTC, Yaakov Selkowitz
none Details | Review
libgda-2.99.5 Cygwin patch (4.46 KB, patch)
2007-02-26 03:22 UTC, Yaakov Selkowitz
committed Details | Review

Description Yaakov Selkowitz 2005-08-28 20:45:32 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!
Comment 1 Yaakov Selkowitz 2005-08-28 20:46:38 UTC
Created attachment 51477 [details] [review]
Cygwin build patch
Comment 2 Rodrigo Moya 2005-09-26 10:36:33 UTC
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*)?
Comment 3 Yaakov Selkowitz 2005-09-26 22:30:34 UTC
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.
Comment 4 Yaakov Selkowitz 2005-10-31 20:27:00 UTC
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.
Comment 5 Yaakov Selkowitz 2005-11-15 22:51:46 UTC
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.)

Comment 6 Yaakov Selkowitz 2005-11-16 01:03:46 UTC
Created attachment 54813 [details] [review]
libgda-1.9.100 Cygwin patch

Here's what I've got so far for libgda-1.9.100.
Comment 7 Rodrigo Moya 2005-11-16 15:18:44 UTC
Ok, committed to HEAD. Only one thing, does -no-undefined affect in some way the
UNIX build?
Comment 8 Yaakov Selkowitz 2005-11-16 20:28:10 UTC
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).
Comment 9 Rodrigo Moya 2005-11-21 11:31:23 UTC
I'd appreciate a patch that fixes that, if possible :)
Comment 10 Yaakov Selkowitz 2005-11-22 00:32:55 UTC
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.
Comment 11 Yaakov Selkowitz 2005-11-24 00:21:31 UTC
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?

Comment 12 Yaakov Selkowitz 2006-05-05 23:24:42 UTC
Any progress on comment 10 and comment 11?
Comment 13 Murray Cumming 2006-05-08 09:58:56 UTC
These parallel-install problems must be fixed before we wreck any more libgda 1.2 installations.
Comment 14 Yaakov Selkowitz 2006-05-08 16:19:57 UTC
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.
Comment 15 Yaakov Selkowitz 2006-05-09 03:36:09 UTC
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.
Comment 16 Yaakov Selkowitz 2006-05-09 03:39:07 UTC
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.
Comment 17 Yaakov Selkowitz 2006-12-27 02:25:39 UTC
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.
Comment 18 Yaakov Selkowitz 2006-12-27 02:48:53 UTC
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.
Comment 19 Murray Cumming 2006-12-27 17:12:16 UTC
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.
Comment 20 Murray Cumming 2007-01-17 10:42:16 UTC
What do you think? Does something more need to be done, or should I close this bug?
Comment 21 Yaakov Selkowitz 2007-01-18 05:52:36 UTC
Is 2.99.3 due soon?
Comment 22 Yaakov Selkowitz 2007-01-18 06:10:15 UTC
Sorry, there's still a problem with the ldap provider, see comment 17.
Comment 23 Murray Cumming 2007-01-19 12:17:05 UTC
> 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.
Comment 24 Yaakov Selkowitz 2007-02-26 03:19:15 UTC
Other providers also used this function.  I've made a new bug 411811 for it, since it is not Cygwin specific.
Comment 25 Yaakov Selkowitz 2007-02-26 03:22:21 UTC
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.
Comment 26 Murray Cumming 2007-02-28 17:31:04 UTC
Committed. Thanks.

Please don't forget to patch the ChangeLog next time.