[gdal] 02/11: Add patch backporting upstream changes to fix FTBFS with MySQL 5.6.

Sebastiaan Couwenberg sebastic at moszumanska.debian.org
Sun Jun 28 14:05:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

sebastic pushed a commit to branch master
in repository gdal.

commit e09cc79809ba1d426693eb1a2ee04643bef68899
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date:   Sun Jun 28 12:04:24 2015 +0200

    Add patch backporting upstream changes to fix FTBFS with MySQL 5.6.
---
 debian/changelog         |   1 +
 debian/patches/mysql-5.6 | 145 +++++++++++++++++++++++++++++++++++++++++++++++
 debian/patches/series    |   1 +
 3 files changed, 147 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7753fde..6b35a0a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,7 @@
 gdal (1.10.1+dfsg-9) UNRELEASED; urgency=medium
 
   * Update my email to use @debian.org address.
+  * Add patch backporting upstream changes to fix FTBFS with MySQL 5.6.
 
  -- Bas Couwenberg <sebastic at debian.org>  Sun, 28 Jun 2015 12:01:44 +0200
 
diff --git a/debian/patches/mysql-5.6 b/debian/patches/mysql-5.6
new file mode 100644
index 0000000..a3eb670
--- /dev/null
+++ b/debian/patches/mysql-5.6
@@ -0,0 +1,145 @@
+Description: Fix build with MySQL 5.6.
+Author: Even Rouault, <even dot rouault at spatialys dot com>
+Origin: https://trac.osgeo.org/gdal/changeset/26582
+        https://trac.osgeo.org/gdal/changeset/26583
+Bug: https://trac.osgeo.org/gdal/ticket/5284
+
+--- a/GDALmake.opt.in
++++ b/GDALmake.opt.in
+@@ -123,6 +123,7 @@ INGRES_INC = @INGRES_INC@
+ HAVE_MYSQL =	@HAVE_MYSQL@
+ MYSQL_LIB  =	@MYSQL_LIB@
+ MYSQL_INC  =	@MYSQL_INC@
++MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION  =    @MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION@
+ LIBS	   +=	$(MYSQL_LIB)
+ 
+ #
+--- a/configure
++++ b/configure
+@@ -700,6 +700,7 @@ INGRES_INC
+ INGRES_LIB
+ II_SYSTEM
+ HAVE_INGRES
++MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION
+ MYSQL_LIB
+ MYSQL_INC
+ HAVE_MYSQL
+@@ -23045,6 +23046,34 @@ $as_echo "no, mysql is pre-4.x" >&6; }
+       MYSQL_INC="`$MYSQL_CONFIG --include`"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
++
++      # Check if mysql headers declare load_defaults
++      { $as_echo "$as_me:${as_lineno-$LINENO}: checking load_defaults() in MySQL" >&5
++$as_echo_n "checking load_defaults() in MySQL... " >&6; }
++      rm -f testmysql.*
++      echo '#include "my_global.h"' > testmysql.cpp
++      echo '#include "my_sys.h"' >> testmysql.cpp
++      echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
++      if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then
++        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in my_sys.h" >&5
++$as_echo "yes, found in my_sys.h" >&6; }
++      else
++        echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp
++        echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
++        if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then
++            { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, found in library but not in header" >&5
++$as_echo "yes, found in library but not in header" >&6; }
++            MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes
++        else
++            HAVE_MYSQL=no
++            MYSQL_LIB=
++            MYSQL_INC=
++            as_fn_error $? "Cannot find load_defaults()" "$LINENO" 5
++        fi
++      fi
++      rm -f testmysql.*
++      rm -f testmysql
++
+ 	;;
+   esac
+ fi
+@@ -23055,6 +23084,8 @@ MYSQL_INC=$MYSQL_INC
+ 
+ MYSQL_LIB=$MYSQL_LIB
+ 
++MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION
++
+ 
+ 
+ 
+--- a/configure.in
++++ b/configure.in
+@@ -2294,6 +2294,31 @@ else
+       MYSQL_LIB="`$MYSQL_CONFIG --libs`"
+       MYSQL_INC="`$MYSQL_CONFIG --include`"
+       AC_MSG_RESULT([yes])
++
++      # Check if mysql headers declare load_defaults
++      AC_MSG_CHECKING([load_defaults() in MySQL])
++      rm -f testmysql.*
++      echo '#include "my_global.h"' > testmysql.cpp
++      echo '#include "my_sys.h"' >> testmysql.cpp
++      echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
++      if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then
++        AC_MSG_RESULT([yes, found in my_sys.h])
++      else
++        echo 'extern "C" void load_defaults(const char *conf_file, const char **groups, int *argc, char ***argv);' > testmysql.cpp
++        echo 'int main(int argc, char** argv) { load_defaults(0, 0, 0, 0); return 0; } ' >> testmysql.cpp
++        if test -z "`${CXX} ${CXXFLAGS} ${MYSQL_INC} -o testmysql testmysql.cpp ${MYSQL_LIB} 2>&1`" ; then
++            AC_MSG_RESULT([yes, found in library but not in header])
++            MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION=yes
++        else
++            HAVE_MYSQL=no
++            MYSQL_LIB=
++            MYSQL_INC=
++            AC_MSG_ERROR([Cannot find load_defaults()])
++        fi
++      fi
++      rm -f testmysql.*
++      rm -f testmysql
++
+ 	;;
+   esac
+ fi
+@@ -2301,6 +2326,7 @@ fi
+ AC_SUBST(HAVE_MYSQL,$HAVE_MYSQL)
+ AC_SUBST(MYSQL_INC,$MYSQL_INC)
+ AC_SUBST(MYSQL_LIB,$MYSQL_LIB)
++AC_SUBST(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION,$MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION)
+ 
+ dnl ---------------------------------------------------------------------------
+ dnl INGRES support.
+--- a/ogr/ogrsf_frmts/mysql/GNUmakefile
++++ b/ogr/ogrsf_frmts/mysql/GNUmakefile
+@@ -7,6 +7,11 @@ OBJ	=	ogrmysqldriver.o ogrmysqldatasourc
+ 
+ CPPFLAGS	:=	-I.. -I../.. $(GDAL_INCLUDE) $(MYSQL_INC) $(CPPFLAGS)
+ 
++ifeq ($(MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION),yes)
++CPPFLAGS +=   -DMYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION
++endif
++
++
+ default:	$(O_OBJ:.o=.$(OBJ_EXT))
+ 
+ clean:
+--- a/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp
++++ b/ogr/ogrsf_frmts/mysql/ogrmysqldatasource.cpp
+@@ -36,6 +36,16 @@
+ #include "cpl_conv.h"
+ #include "cpl_string.h"
+ 
++/* Recent versions of mysql no longer declare load_defaults() in my_sys.h */
++/* but they still have it in the lib. Very fragile... */
++#ifdef MYSQL_NEEDS_LOAD_DEFAULTS_DECLARATION
++extern "C" {
++int load_defaults(const char *conf_file, const char **groups,
++                  int *argc, char ***argv);
++void free_defaults(char **argv);
++}
++#endif
++
+ CPL_CVSID("$Id: ogrmysqldatasource.cpp 24947 2012-09-22 09:54:23Z rouault $");
+ /************************************************************************/
+ /*                         OGRMySQLDataSource()                         */
diff --git a/debian/patches/series b/debian/patches/series
index 33dca3a..c7dae39 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -30,3 +30,4 @@ doc-brief
 hardening
 hurd-i386-pathmax
 perl-vendor
+mysql-5.6

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/gdal.git



More information about the Pkg-grass-devel mailing list