GNOME Bugzilla – Bug 576417
mysql_config is not to be trusted on OpenSolaris
Last modified: 2011-11-21 11:40:57 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
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).
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
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?
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.
Sorry, I missed that point (anyway, jhbuild now points to version 4.0.0).
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.
David, please respond.
Please reopen if this is still a problem.