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 576417 - mysql_config is not to be trusted on OpenSolaris
mysql_config is not to be trusted on OpenSolaris
Status: RESOLVED OBSOLETE
Product: libgda
Classification: Other
Component: MySQL provider
3.99.x
Other opensolaris
: Normal normal
: ---
Assigned To: malerba
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-03-23 14:22 UTC by David Adam
Modified: 2011-11-21 11:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch to override MYSQL_CFLAGS (463 bytes, patch)
2009-03-23 15:54 UTC, malerba
none Details | Review

Description David Adam 2009-03-23 14:22:37 UTC
See also: http://bugs.mysql.com/bug.php?id=22430#c85587

libgda version: 3.99.11

mysql_config reports the CFLAGS used to compile MySQL, but on OpenSolaris these values cannot be trusted. The system MySQL is not built using gcc, and uses parameters for Sun's cc like "-xstrconst". When these are passed as CFLAGS to gcc, the build fails in MySQl.

A workaround might be to allow MYSQL_CFLAGS to be set as an environment variable.

Example error:
libtool: compile:  gcc "-DPACKAGE_NAME=\"GNU Data Access\"" -DPACKAGE_TARNAME=\"libgda\" -DPACKAGE_VERSION=\"3.99.11\" "-DPACKAGE_STRING=\"GNU Data Access 3.99.11\"" -DPACKAGE_BUGREPORT=\"gnome-db-list@gnome.org\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG_INT=4 -DBONOBO_EXPLICIT_TRANSLATION_DOMAIN=\"libgda-4.0\" -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DGETTEXT_PACKAGE=\"libgda-4.0\" -DHAVE_LOCALE_H=1 -DHAVE_LC_MESSAGES=1 -DHAVE_BIND_TEXTDOMAIN_CODESET=1 -DHAVE_GETTEXT=1 -DHAVE_DCGETTEXT=1 -DENABLE_NLS=1 -DHAVE_MYSQL=1 -DHAVE_POSTGRES=1 -DHAVE_LDAP=1 -DHAVE_JAVA=1 -I. -I. -I../.. -I../../libgda -I../.. -D_REENTRANT -D_PTHREADS -I/space/buildbot/prefix/include/glib-2.0 -I/space/buildbot/prefix/lib/glib-2.0/include -I/space/buildbot/prefix/include/libxml2 -DLIBGDA_ABI_NAME=\"libgda-4.0\" -I/usr/sfw/include/mysql -xstrconst -mt -g -O2 -MT libmain.lo -MD -MP -MF .deps/libmain.Tpo -c libmain.c  -fPIC -DPIC -o .libs/libmain.o 
gcc: language strconst not recognized
gcc: libmain.c: linker input file unused because linking not done

Platform: SunOS manduba 5.11 snv_101 sun4u sparc SUNW,Ultra-Enterprise Solaris
Comment 1 malerba 2009-03-23 15:54:14 UTC
Created attachment 131191 [details] [review]
Proposed patch to override MYSQL_CFLAGS

Can you try with this patch? Basically if MYSQL_CFLAGS is already defined, it does not redefine it. I assume there is no linking problem (in MYSQL_LIBS).
Comment 2 David Adam 2009-03-28 09:35:05 UTC
After messing around with conflicting versions of libtool (ugh) and discovering that "make -j4" produces some interesting errors, this appears to work although I'm now running into a problem with the actual MySQL headers.

gda-mysql.h:47: error: syntax error before "MYSQL_STMT"
gda-mysql.h:47: warning: no semicolon at end of struct or union
gda-mysql.h:53: error: syntax error before '}' token
gda-mysql.h:53: warning: data definition has no type or storage class
make[2]: *** [gda-mysql-blob-op.lo] Error 1
Comment 3 malerba 2009-03-28 10:15:36 UTC
Which version are you using (in the V4 version, there is no more any MYSQL_STMT pointer in the mentionnned structure)? If it's not any 4.0.x or svn trunk, can you make sure you use one of those versions?
Comment 4 David Adam 2009-03-28 10:53:48 UTC
This is 3.99.11 (see comment #1) - the version pulled in by jhbuild for 2.26. The patch certainly does what it says on the tin, and I will try to build svn trunk.
Comment 5 malerba 2009-03-28 13:17:40 UTC
Sorry, I missed that point (anyway, jhbuild now points to version 4.0.0).
Comment 6 malerba 2009-08-26 08:36:03 UTC
Regarding comment #2, (In reply to comment #2)
> After messing around with conflicting versions of libtool (ugh) and discovering
> that "make -j4" produces some interesting errors, this appears to work although
> I'm now running into a problem with the actual MySQL headers.
> 
> gda-mysql.h:47: error: syntax error before "MYSQL_STMT"
> gda-mysql.h:47: warning: no semicolon at end of struct or union
> gda-mysql.h:53: error: syntax error before '}' token
> gda-mysql.h:53: warning: data definition has no type or storage class
> make[2]: *** [gda-mysql-blob-op.lo] Error 1

The MYSQL (line 46 in gda-mysql.h) and MYSQL_STMT structures are, in my case, both defined in the same mysql.h file. Maybe on your platform this is not the case...

Anyway, I'd apreciate if you could try with a released 4.0.x version (4.0.3 would be the best) as the MYSQL_STMT pointer has been removed (the proposed patch has already been applied there).

Also I'm interrested to have some details about the "make -j4" errors.
Comment 7 Murray Cumming 2011-11-03 21:46:09 UTC
David, please respond.
Comment 8 Murray Cumming 2011-11-21 11:40:57 UTC
Please reopen if this is still a problem.