[libgda] Cross compilation using docker: fixed Win32 and added Win64



commit d7ca3d0a0adc19705226c69903cd6390c81bc81d
Author: Vivien Malerba <malerba gnome-db org>
Date:   Tue Dec 2 23:31:24 2014 +0100

    Cross compilation using docker: fixed Win32 and added Win64

 docker-tools/mingw-32-cross-compil/README          |    2 +-
 docker-tools/mingw-32-cross-compil/build.sh        |    4 +-
 docker-tools/mingw-32-cross-compil/mingw-configure |   87 ++++++++++++++++++++
 .../mingw-32-cross-compil/run_configure.sh         |   21 +++++
 docker-tools/mingw-32-cross-compil/start.sh        |    2 +-
 docker-tools/mingw-64-cross-compil/.gitignore      |    1 +
 docker-tools/mingw-64-cross-compil/Dockerfile      |   29 +++++++
 docker-tools/mingw-64-cross-compil/README          |   18 ++++
 docker-tools/mingw-64-cross-compil/build.sh        |   36 ++++++++
 docker-tools/mingw-64-cross-compil/do_packages     |   32 +++++++
 docker-tools/mingw-64-cross-compil/install.sh      |    6 ++
 docker-tools/mingw-64-cross-compil/mingw-configure |   87 ++++++++++++++++++++
 .../mingw-64-cross-compil/run_configure.sh         |   21 +++++
 docker-tools/mingw-64-cross-compil/start.sh        |   71 ++++++++++++++++
 installers/Windows/make-zip-setup.sh               |    2 +-
 m4/mysql.m4                                        |   12 ++--
 16 files changed, 420 insertions(+), 11 deletions(-)
---
diff --git a/docker-tools/mingw-32-cross-compil/README b/docker-tools/mingw-32-cross-compil/README
index 88611ec..1279778 100644
--- a/docker-tools/mingw-32-cross-compil/README
+++ b/docker-tools/mingw-32-cross-compil/README
@@ -2,7 +2,7 @@ Use the scripts contained here to create a MinGW docker image from which you can
 cross compile Libgda. The source files are "mounted" into the container in /srv/libgda and the compiled files
 are installed (when running "make install") in the path provided as the 1st argument to the start.sh script.
 
-* build.sh builds the docker image (named "libgda-mingw"), and first checks and if necessary download the
+* build.sh builds the docker image (named "libgda-mingw32"), and first checks and if necessary download the
   missing binary files (Win32/). Run without any argument.
 
 * start.sh starts a docker container from the built image, the 1st argument being the installation directory 
(where
diff --git a/docker-tools/mingw-32-cross-compil/build.sh b/docker-tools/mingw-32-cross-compil/build.sh
index d818dc6..86cb747 100755
--- a/docker-tools/mingw-32-cross-compil/build.sh
+++ b/docker-tools/mingw-32-cross-compil/build.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-image_name="libgda-mingw"
+image_name="libgda-mingw32"
 
 # test docker install
 docker version > /dev/null 2>&1 || {
@@ -12,7 +12,7 @@ docker version > /dev/null 2>&1 || {
 if [ ! -d Win32 ]
 then
     echo "Missing Win32/ directory, downloading archive (about 3Mb)..."
-    tarball="https://people.gnome.org/~vivien/Win32_docker_01.txz";
+    tarball="https://people.gnome.org/~vivien/Win32_docker_02.txz";
     wget -q $tarball > /dev/null 2>&1 || {
        echo "Unable to get $tarball, check with Libgda's maintainer!"
        exit 1
diff --git a/docker-tools/mingw-32-cross-compil/mingw-configure 
b/docker-tools/mingw-32-cross-compil/mingw-configure
new file mode 100755
index 0000000..2a2eafe
--- /dev/null
+++ b/docker-tools/mingw-32-cross-compil/mingw-configure
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+# Prefix of mingw tools. prefix + tool should make up full path
+# to the tool, e.g. prefix is '/usr/bin/i686-mingw32msvc-' on Debian
+# or '/usr/local/mingw32/bin/' on FreeBSD.
+MINGW_TOOL_PREFIX=/usr/bin/i686-w64-mingw32-
+
+# These python variables are medit-only
+if [ "x$1" = "x--with-python=2.5" -o "x$2" = "x--with-python=2.5" ]; then
+  export PYTHON_PREFIX=${PYTHON_PREFIX:-/usr/local/win/Python25}
+  export PYTHON25_HOME=$PYTHON_PREFIX
+else
+  export PYTHON_PREFIX=${PYTHON_PREFIX:-/usr/local/win/Python24}
+  export PYTHON24_HOME=$PYTHON_PREFIX
+fi
+export PYTHON_HOME=$PYTHON_PREFIX
+export PYTHON24_HOME=${PYTHON24_HOME:-/usr/local/win/Python24}
+export PYTHON25_HOME=${PYTHON25_HOME:-/usr/local/win/Python25}
+
+# Find configure script to run
+if [ x$CONFIGURE = x ]; then
+    CONFIGURE="configure"
+    if [ ! -e $CONFIGURE ]; then
+        CONFIGURE=`dirname $0`/../configure
+    fi
+    if [ ! -e $CONFIGURE ]; then
+        echo "Can't find configure script"
+        exit 1
+    fi
+    configure_dir=`dirname "$CONFIGURE"`
+    configure_dir=`cd "$configure_dir" && pwd`
+    CONFIGURE="$configure_dir"/configure
+    CONFIG_GUESS="$configure_dir"/config.guess
+fi
+
+# autoconf is not intelligent enough to guess that
+# i686-pc-mingw32msvc target has anything to do with
+# debian /usr/bin/i686-mingw32msvc-gcc or freebsd
+# /usr/local/mingw32/bin/gcc, hence these variables
+export ADDR2LINE="${MINGW_TOOL_PREFIX}addr2line"
+export AS="${MINGW_TOOL_PREFIX}as"
+export CC="${MINGW_TOOL_PREFIX}gcc"
+export CPP="${MINGW_TOOL_PREFIX}cpp"
+export CPPFILT="${MINGW_TOOL_PREFIX}c++filt"
+export CXX="${MINGW_TOOL_PREFIX}g++"
+export DLLTOOL="${MINGW_TOOL_PREFIX}dlltool"
+export DLLWRAP="${MINGW_TOOL_PREFIX}dllwrap"
+export GCOV="${MINGW_TOOL_PREFIX}gcov"
+export LD="${MINGW_TOOL_PREFIX}ld"
+export NM="${MINGW_TOOL_PREFIX}nm"
+export OBJCOPY="${MINGW_TOOL_PREFIX}objcopy"
+export OBJDUMP="${MINGW_TOOL_PREFIX}objdump"
+export READELF="${MINGW_TOOL_PREFIX}readelf"
+export SIZE="${MINGW_TOOL_PREFIX}size"
+export STRINGS="${MINGW_TOOL_PREFIX}strings"
+export WINDRES="${MINGW_TOOL_PREFIX}windres"
+export AR="${MINGW_TOOL_PREFIX}ar"
+export RANLIB="${MINGW_TOOL_PREFIX}ranlib"
+export STRIP="${MINGW_TOOL_PREFIX}strip"
+
+export LDFLAGS="-L$GTK_PREFIX/lib $LDFLAGS"
+export CPPFLAGS="-I$GTK_PREFIX/include $CPPFLAGS"
+export MMSFLAGS="-mms-bitfields"
+export MMSFLAGS=
+export CFLAGS="-I$GTK_PREFIX/include $MMSFLAGS -march=i686 ${CFLAGS:-"-g"}"
+export CXXFLAGS="-I$GTK_PREFIX/include $MMSFLAGS -march=i686 ${CFLAGS:-"-g"}"
+
+TARGET=i686-pc-mingw32msvc
+export PKG_CONFIG_PATH=/usr/i686-w64-mingw32/sys-root/mingw/lib/pkgconfig
+
+# Now actually run configure. FOO=foo arguments *must* be there if you
+# want automatic re-configuring (which happens if you modify configure.ac and
+# run make) work.
+# NOTE: --build *must* be here, it's autoconf bug (aka 'feature'), confirmed and
+# *documented*.
+echo sh $CONFIGURE --build=`$CONFIG_GUESS` --host=$TARGET --target=$TARGET \
+GTK_PREFIX="$GTK_PREFIX" \
+PYTHON_PREFIX="$PYTHON_PREFIX" PYTHON_HOME="$PYTHON_HOME" \
+PYTHON24_HOME="$PYTHON24_HOME" PYTHON25_HOME="$PYTHON25_HOME" \
+AR="$AR" RANLIB="$RANLIB" STRIP="$STRIP" AS="$AS" DLLTOOL="$DLLTOOL" \
+OBJDUMP="$OBJDUMP" NM="$NM" WINDRES="$WINDRES" $@
+exec sh $CONFIGURE --build=`$CONFIG_GUESS` --host=$TARGET --target=$TARGET \
+GTK_PREFIX="$GTK_PREFIX" \
+PYTHON_PREFIX="$PYTHON_PREFIX" PYTHON_HOME="$PYTHON_HOME" \
+PYTHON24_HOME="$PYTHON24_HOME" PYTHON25_HOME="$PYTHON25_HOME" \
+AR="$AR" RANLIB="$RANLIB" STRIP="$STRIP" AS="$AS" DLLTOOL="$DLLTOOL" \
+OBJDUMP="$OBJDUMP" NM="$NM" WINDRES="$WINDRES" $@
diff --git a/docker-tools/mingw-32-cross-compil/run_configure.sh 
b/docker-tools/mingw-32-cross-compil/run_configure.sh
new file mode 100755
index 0000000..73ae0f7
--- /dev/null
+++ b/docker-tools/mingw-32-cross-compil/run_configure.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# the SRC, PREFIX and DEPEND variables are defined when building the Docker image
+
+version="32"
+src=$SRC/libgda
+dest=$PREFIX/libgda
+depend=$DEPEND
+
+export CONFIGURE=$src/configure
+
+if test "x$version" = "x32"
+then
+    echo "Windows 32 Build"
+    ./.mingw-configure --enable-debug --prefix=$dest --with-mysql=$depend/mysql --with-bdb=$depend/bdb 
--with-mdb=yes --enable-system-mdbtools=no --with-oracle=$depend/oracle --with-firebird=no 
--with-postgres=/usr/i686-w64-mingw32/sys-root/mingw --with-java=no  --with-ldap=$depend/ldap 
--enable-vala=no --enable-vala-extensions=no
+else
+    echo "Not yet implemented!"
+fi
+
+rm -rf $dest/*
+cp -R -L /src/libgda/installers/Windows /compilation/libgda/Packager 
diff --git a/docker-tools/mingw-32-cross-compil/start.sh b/docker-tools/mingw-32-cross-compil/start.sh
index e0a3718..8a3dcdf 100755
--- a/docker-tools/mingw-32-cross-compil/start.sh
+++ b/docker-tools/mingw-32-cross-compil/start.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-image_name="libgda-mingw"
+image_name="libgda-mingw32"
 
 # test docker install
 docker version > /dev/null 2>&1 || {
diff --git a/docker-tools/mingw-64-cross-compil/.gitignore b/docker-tools/mingw-64-cross-compil/.gitignore
new file mode 100644
index 0000000..023331c
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/.gitignore
@@ -0,0 +1 @@
+Win64
diff --git a/docker-tools/mingw-64-cross-compil/Dockerfile b/docker-tools/mingw-64-cross-compil/Dockerfile
new file mode 100644
index 0000000..eb927b7
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/Dockerfile
@@ -0,0 +1,29 @@
+FROM fedora:20
+
+MAINTAINER Vivien Malerba "vmalerba gmail com"
+ENV REFRESHED_AT 2014-11-30
+
+COPY install.sh /
+RUN /install.sh
+RUN rm -f /install.sh
+
+# sources files dir
+ENV SRC /src
+
+# files installed outside of YUM
+ENV DEPEND /dependencies
+COPY Win64 /dependencies/
+
+# destination of the compiled files
+RUN mkdir /install
+ENV PREFIX /install
+
+# working dir
+RUN mkdir -p /compilation/libgda
+WORKDIR /compilation/libgda
+
+COPY run_configure.sh /compilation/libgda/configure
+COPY mingw-configure /compilation/libgda/.mingw-configure
+COPY do_packages /compilation/libgda/
+
+CMD [ "/bin/bash" ]
\ No newline at end of file
diff --git a/docker-tools/mingw-64-cross-compil/README b/docker-tools/mingw-64-cross-compil/README
new file mode 100644
index 0000000..d9b6c0b
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/README
@@ -0,0 +1,18 @@
+Use the scripts contained here to create a MinGW docker image from which you can
+cross compile Libgda. The source files are "mounted" into the container in /srv/libgda and the compiled files
+are installed (when running "make install") in the path provided as the 1st argument to the start.sh script.
+
+* build.sh builds the docker image (named "libgda-mingw64"), and first checks and if necessary download the
+  missing binary files (Win64/). Run without any argument.
+
+* start.sh starts a docker container from the built image, the 1st argument being the installation directory 
(where
+  the files are copied when running "make install"). It opens a shell where you
+  can run (as root inside the container):
+  # ./configure
+  # make
+  # make install
+  # ./do_packages
+
+WARNING: if you get a "permission denied" while running the configure script, or while runnin "make install",
+        then you probably need to change the SELinux context of Libgda's source directory or of the 
installation
+        directory (from the host and not the docker container) using: chcon -Rt svirt_sandbox_file_t 
<dirname>
diff --git a/docker-tools/mingw-64-cross-compil/build.sh b/docker-tools/mingw-64-cross-compil/build.sh
new file mode 100755
index 0000000..9eca2b6
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/build.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+image_name="libgda-mingw64"
+
+# test docker install
+docker version > /dev/null 2>&1 || {
+    echo "Can't find or execute docker"
+    exit 1
+}
+
+# download Win64 binaries if necessary
+if [ ! -d Win64 ]
+then
+    echo "Missing Win64/ directory, downloading archive (about 1Mb)..."
+    tarball="https://people.gnome.org/~vivien/Win64_docker_02.txz";
+    wget -q $tarball > /dev/null 2>&1 || {
+       echo "Unable to get $tarball, check with Libgda's maintainer!"
+       exit 1
+    }
+    echo "Download complete"
+    file=`basename $tarball`
+    tar xJf $file > /dev/null 2>&1 || {
+       echo "Unable to uncompress $file."
+       exit 1
+    }
+    rm -f $file
+fi
+
+# build image
+echo "Now building Docker image, this will take a few minutes (or maybe half an hour, depending on you 
setup)..."
+docker build --force-rm -q -t "$image_name" . || {
+    echo "Failed to build image."
+    exit 1
+}
+echo "Image '$image_name' is now ready, you can use the start.sh script"
+
diff --git a/docker-tools/mingw-64-cross-compil/do_packages b/docker-tools/mingw-64-cross-compil/do_packages
new file mode 100755
index 0000000..94aa66e
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/do_packages
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+pushd Packager > /dev/null 2>&1 || {
+    echo "Can't change to the 'Packager' directory"
+    exit 1
+}
+
+./make-zip-setup.sh 64 || {
+    echo "Error!"
+    popd > /dev/null 2>&1
+    exit 1
+}
+
+makensis -V0 gda-browser.nsi || {
+    echo "Can't generate Setup EXE file"
+    popd > /dev/null 2>&1
+    exit 1
+}
+
+cp libgda*.zip GdaBrowserSetup*.exe /install/libgda/ || {
+    echo "Could not copy ZIP and EXE files to installation directory!"
+    popd > /dev/null 2>&1
+    exit 1
+}
+
+popd > /dev/null 2>&1 || {
+    echo "Can't get back to initial working directory, now in `pwd`"
+}
+
+chown -R $UID:$GID /install/libgda || {
+    echo "Installed files will remain owned by root:root, could not change them to $UID:$GID"
+}
diff --git a/docker-tools/mingw-64-cross-compil/install.sh b/docker-tools/mingw-64-cross-compil/install.sh
new file mode 100755
index 0000000..4b8d29c
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/install.sh
@@ -0,0 +1,6 @@
+echo "Running Upgrade..."
+yum -y -q upgrade
+echo "Installing packages..."
+yum -y install gcc make intltool itstool glib2-devel mingw64-gcc mingw64-nsis mingw64-gtk3 mingw64-libxml2 
mingw64-postgresql mingw64-libsoup mingw64-goocanvas2 mingw64-gtksourceview3 mingw64-libxslt iso-codes-devel 
mingw64-readline zip
+echo "Cleaning..."
+yum clean all
diff --git a/docker-tools/mingw-64-cross-compil/mingw-configure 
b/docker-tools/mingw-64-cross-compil/mingw-configure
new file mode 100755
index 0000000..9f41905
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/mingw-configure
@@ -0,0 +1,87 @@
+#!/bin/sh
+
+# Prefix of mingw tools. prefix + tool should make up full path
+# to the tool, e.g. prefix is '/usr/bin/i686-mingw32msvc-' on Debian
+# or '/usr/local/mingw32/bin/' on FreeBSD.
+MINGW_TOOL_PREFIX=/usr/bin/x86_64-w64-mingw32-
+
+# These python variables are medit-only
+if [ "x$1" = "x--with-python=2.5" -o "x$2" = "x--with-python=2.5" ]; then
+  export PYTHON_PREFIX=${PYTHON_PREFIX:-/usr/local/win/Python25}
+  export PYTHON25_HOME=$PYTHON_PREFIX
+else
+  export PYTHON_PREFIX=${PYTHON_PREFIX:-/usr/local/win/Python24}
+  export PYTHON24_HOME=$PYTHON_PREFIX
+fi
+export PYTHON_HOME=$PYTHON_PREFIX
+export PYTHON24_HOME=${PYTHON24_HOME:-/usr/local/win/Python24}
+export PYTHON25_HOME=${PYTHON25_HOME:-/usr/local/win/Python25}
+
+# Find configure script to run
+if [ x$CONFIGURE = x ]; then
+    CONFIGURE="configure"
+    if [ ! -e $CONFIGURE ]; then
+        CONFIGURE=`dirname $0`/../configure
+    fi
+    if [ ! -e $CONFIGURE ]; then
+        echo "Can't find configure script"
+        exit 1
+    fi
+    configure_dir=`dirname "$CONFIGURE"`
+    configure_dir=`cd "$configure_dir" && pwd`
+    CONFIGURE="$configure_dir"/configure
+    CONFIG_GUESS="$configure_dir"/config.guess
+fi
+
+# autoconf is not intelligent enough to guess that
+# i686-pc-mingw32msvc target has anything to do with
+# debian /usr/bin/i686-mingw32msvc-gcc or freebsd
+# /usr/local/mingw32/bin/gcc, hence these variables
+export ADDR2LINE="${MINGW_TOOL_PREFIX}addr2line"
+export AS="${MINGW_TOOL_PREFIX}as"
+export CC="${MINGW_TOOL_PREFIX}gcc"
+export CPP="${MINGW_TOOL_PREFIX}cpp"
+export CPPFILT="${MINGW_TOOL_PREFIX}c++filt"
+export CXX="${MINGW_TOOL_PREFIX}g++"
+export DLLTOOL="${MINGW_TOOL_PREFIX}dlltool"
+export DLLWRAP="${MINGW_TOOL_PREFIX}dllwrap"
+export GCOV="${MINGW_TOOL_PREFIX}gcov"
+export LD="${MINGW_TOOL_PREFIX}ld"
+export NM="${MINGW_TOOL_PREFIX}nm"
+export OBJCOPY="${MINGW_TOOL_PREFIX}objcopy"
+export OBJDUMP="${MINGW_TOOL_PREFIX}objdump"
+export READELF="${MINGW_TOOL_PREFIX}readelf"
+export SIZE="${MINGW_TOOL_PREFIX}size"
+export STRINGS="${MINGW_TOOL_PREFIX}strings"
+export WINDRES="${MINGW_TOOL_PREFIX}windres"
+export AR="${MINGW_TOOL_PREFIX}ar"
+export RANLIB="${MINGW_TOOL_PREFIX}ranlib"
+export STRIP="${MINGW_TOOL_PREFIX}strip"
+
+export LDFLAGS="-L$GTK_PREFIX/lib $LDFLAGS"
+export CPPFLAGS="-I$GTK_PREFIX/include $CPPFLAGS"
+export MMSFLAGS="-mms-bitfields"
+export MMSFLAGS=
+export CFLAGS="-I$GTK_PREFIX/include $MMSFLAGS -march=x86-64 ${CFLAGS:-"-g"}"
+export CXXFLAGS="-I$GTK_PREFIX/include $MMSFLAGS -march=x86-64 ${CFLAGS:-"-g"}"
+
+TARGET=x86_64-w64-mingw32
+export PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig
+
+# Now actually run configure. FOO=foo arguments *must* be there if you
+# want automatic re-configuring (which happens if you modify configure.ac and
+# run make) work.
+# NOTE: --build *must* be here, it's autoconf bug (aka 'feature'), confirmed and
+# *documented*.
+echo sh $CONFIGURE --build=`$CONFIG_GUESS` --host=$TARGET --target=$TARGET \
+GTK_PREFIX="$GTK_PREFIX" \
+PYTHON_PREFIX="$PYTHON_PREFIX" PYTHON_HOME="$PYTHON_HOME" \
+PYTHON24_HOME="$PYTHON24_HOME" PYTHON25_HOME="$PYTHON25_HOME" \
+AR="$AR" RANLIB="$RANLIB" STRIP="$STRIP" AS="$AS" DLLTOOL="$DLLTOOL" \
+OBJDUMP="$OBJDUMP" NM="$NM" WINDRES="$WINDRES" $@
+exec sh $CONFIGURE --build=`$CONFIG_GUESS` --host=$TARGET --target=$TARGET \
+GTK_PREFIX="$GTK_PREFIX" \
+PYTHON_PREFIX="$PYTHON_PREFIX" PYTHON_HOME="$PYTHON_HOME" \
+PYTHON24_HOME="$PYTHON24_HOME" PYTHON25_HOME="$PYTHON25_HOME" \
+AR="$AR" RANLIB="$RANLIB" STRIP="$STRIP" AS="$AS" DLLTOOL="$DLLTOOL" \
+OBJDUMP="$OBJDUMP" NM="$NM" WINDRES="$WINDRES" $@
diff --git a/docker-tools/mingw-64-cross-compil/run_configure.sh 
b/docker-tools/mingw-64-cross-compil/run_configure.sh
new file mode 100755
index 0000000..dc7bb7a
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/run_configure.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+# the SRC, PREFIX and DEPEND variables are defined when building the Docker image
+
+version="64"
+src=$SRC/libgda
+dest=$PREFIX/libgda
+depend=$DEPEND
+
+export CONFIGURE=$src/configure
+
+if test "x$version" = "x64"
+then
+    echo "Windows 64 Build"
+    ./.mingw-configure --enable-debug --prefix=$dest --with-mysql=$depend/mysql --with-bdb=$depend/bdb 
--with-mdb=yes --enable-system-mdbtools=no --with-oracle=$depend/oracle --with-firebird=no 
--with-postgres=/usr/x86_64-w64-mingw32/sys-root/mingw --with-java=no  --with-ldap=$depend/ldap 
--enable-vala=no --enable-vala-extensions=no
+else
+    echo "Not yet implemented!"
+fi
+
+rm -rf $dest/*
+cp -R -L /src/libgda/installers/Windows /compilation/libgda/Packager 
diff --git a/docker-tools/mingw-64-cross-compil/start.sh b/docker-tools/mingw-64-cross-compil/start.sh
new file mode 100755
index 0000000..5db8e83
--- /dev/null
+++ b/docker-tools/mingw-64-cross-compil/start.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+image_name="libgda-mingw64"
+
+# test docker install
+docker version > /dev/null 2>&1 || {
+    echo "Can't find or execute docker"
+    exit 1
+}
+
+# test docker image 
+img=`docker images -q "$image_name"`
+if test "x$img" == "x"
+then
+    echo "The docker image '$image_name' is not present, use the ./build.sh script first"
+    exit 1
+fi
+
+# determine destination DIR
+if test "$#" -eq 1
+then
+    destdir=$1
+else
+    destdir=/home/vivien/Devel/VMShared/bin-win64
+fi
+if [ ! -e $destdir ]
+then
+    echo "Destination directory '$destdir' does not exist"
+    exit 1
+fi
+pushd $destdir > /dev/null 2>& 1 || {
+    echo "Can't go to directory $destdir"
+    exit 1
+}
+destdir=`pwd`
+popd > /dev/null 2>& 1 || {
+    echo "Can't get back to working directory!"
+    exit 1
+}
+echo "Destination files will be in $destdir/libgda"
+
+# get Libgda's sources dir
+pushd ../.. > /dev/null 2>& 1 || {
+    echo "Can't go to directory ../.."
+    exit 1
+}
+gda_src=`pwd`
+popd > /dev/null 2>& 1 || {
+    echo "Can't get back to working directory!"
+    exit 1
+}
+
+# get user and group ID
+if test "x$SUDO_UID" == "x"
+then
+    uid=`id -u`
+    gid=`id -g`
+else
+    uid=$SUDO_UID
+    gid=$SUDO_GID
+fi
+
+echo "Using libgda's source files in:  ${gda_src}"
+echo "Win64 compiled files will be in: ${destdir}"
+echo "Once in the container, run:"
+echo "# ./configure"
+echo "# make"
+echo "# make install"
+echo "# ./do_packages"
+echo ""
+docker run -t -i -v ${gda_src}:/src/libgda:ro -v ${destdir}:/install -e UID=$uid -e GID=$gid --rm 
"$image_name"
diff --git a/installers/Windows/make-zip-setup.sh b/installers/Windows/make-zip-setup.sh
index a33e4e8..6243a13 100755
--- a/installers/Windows/make-zip-setup.sh
+++ b/installers/Windows/make-zip-setup.sh
@@ -350,7 +350,7 @@ files=(libdb51.dll)
 add_files_to_zip $archive_ext "${depend_path}" bin $files
 add_found_files_to_nsh prov_bdb bin
 
-files=(libmySQL.dll)
+files=(libmysql.dll)
 add_files_to_zip $archive_ext "${depend_path}" bin $files
 add_found_files_to_nsh prov_mysql bin
 
diff --git a/m4/mysql.m4 b/m4/mysql.m4
index c3a1631..aeee88e 100644
--- a/m4/mysql.m4
+++ b/m4/mysql.m4
@@ -66,7 +66,7 @@ m4_define([_MYSQL_CHECK_INTERNAL],
     then
         if test "x$platform_win32" = xyes
        then
-           mysql_loclibdir=lib/opt
+           mysql_loclibdir=bin
        else
            mysql_loclibdir=lib
        fi
@@ -81,7 +81,7 @@ m4_define([_MYSQL_CHECK_INTERNAL],
     mysql_test_dir=""
     AC_ARG_WITH(mysql,
               AS_HELP_STRING([--with-mysql[=@<:@yes/no/<directory>@:>@]],
-                             [Locate Mysql files]),[
+                             [Locate MySQL files]),[
                             if test $withval = no
                             then
                                 try_mysql=false
@@ -91,7 +91,7 @@ m4_define([_MYSQL_CHECK_INTERNAL],
                             fi])
     AC_ARG_WITH(mysql-libdir-name,
               AS_HELP_STRING([--with-mysql-libdir-name[=@<:@<dir. name>@:>@]],
-                             [Locate Mysql library file, related to the MYSQL prefix specified from 
--with-mysql]),
+                             [Locate MySQL library file, related to the prefix specified from --with-mysql]),
                             [mysql_loclibdir=$withval])
 
     # try with the default available mysql_config
@@ -117,13 +117,13 @@ m4_define([_MYSQL_CHECK_INTERNAL],
            then
                mysql_libext=".so"
            else
-               mysql_libext=".lib"
+               mysql_libext=".dll"
            fi
            if test $platform_win32 = yes
            then
                for d in $mysql_test_dir
                do
-                   AC_MSG_CHECKING([checking for mysql files in $d])
+                   AC_MSG_CHECKING([checking for MySQL files in $d])
                    if test -a $d/include/mysql.h -a -f $d/$mysql_loclibdir/libmysql$mysql_libext
                    then
                        save_CFLAGS="$CFLAGS"
@@ -168,7 +168,7 @@ int main() {
                done
            fi
        else
-           AC_MSG_CHECKING([checking for Mysql headers])
+           AC_MSG_CHECKING([checking for MySQL headers])
            save_CFLAGS="$CFLAGS"
            CFLAGS="$CFLAGS $MYSQL_CFLAGS"
             save_LIBS="$LIBS"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]