← Back to team overview

maria-developers team mailing list archive

Re: Compile for 64 bit

 

Den 02-07-2010 15:38, Kristian Nielsen skrev:
Bo Thorsen<bo@xxxxxxxxxxxx>  writes:

The attached patch adds a -64 keyword to the script
make_mariadb_win_dist. With this patch, the script produces both 32
bit zip files (without any arguments) and 64 bit zip files (with
-64). I also expanded it so it's possible to run it with "-nobuild
-64" and a help text.

Functionality hasn't changed, still the same patch idea.

@@ -16,10 +22,18 @@

  set -x

-if [ "x_$1" != "x_-nobuild" ]; then
+if [ "x_$1" == "x_-64" -o "x_$2" == "x_-64" ]; then
+  CMAKE_GENERATOR="Visual Studio 9 2008 Win64"
+  ARCH="win64"
+else
+  CMAKE_GENERATOR="Visual Studio 9 2008"
+  ARCH="win32"
+fi
+
+if [ "x_$1" != "x_-nobuild" -a "x_$2" != "x_-nobuild" ]; then

No, this is not a nice way to do it ;-)

Let's do it properly, for example like in parse_options() in BUILD/SETUP.sh

Done, please see the attached patch.

Ok to push this to 5.1?

Kristian, when this patch is pushed, you can add a new buildbot slave
based on the one that builds the 32 bit zip file and installer. Adding
the -64 argument on the call to this script is the only thing
necessary for buildbot to produce 64 bit binaries. The result files
are named -win64 instead of -win32.

Ok. So what you are saying is that we can use a 32-bit VM to build the 64-bit
binaries?

But in any case, won't we need a 64-bit Windows installation to *test* the
64-bit binaries?

I had to reinstall my Linux on the laptop to a 64 bit environment. This is almost done, but the new environment isn't ready yet. I'll ping you on IRC when it is.

Bo Thorsen.
Monty Program AB.

--

MariaDB: MySQL replacement
Community developed. Feature enhanced. Backward compatible.
=== modified file 'win/make_mariadb_win_dist'
--- win/make_mariadb_win_dist	2010-05-26 08:40:01 +0000
+++ win/make_mariadb_win_dist	2010-07-07 11:10:54 +0000
@@ -7,6 +7,55 @@
 
 set -e
 
+usage()
+{
+cat <<EOF 
+Usage: $0 [-h] [-64] [-nobuild]
+  -h, --help              Show this help message.
+  -64                     Build a 64 bit distribution.
+  -nobuild                Don't run cmake and devenv, only do the packaging.
+
+The default is to the builds and create 32 bit packages.
+EOF
+}
+
+# The default settings
+CMAKE_GENERATOR="Visual Studio 9 2008"
+ARCH="win32"
+RUNBUILD="yes"
+
+parse_options()
+{
+  while test $# -gt 0
+  do
+    case "$1" in
+    -64)
+      CMAKE_GENERATOR="Visual Studio 9 2008 Win64"
+      ARCH="win64"
+      ;;
+    -nobuild)
+      RUNBUILD="no"
+      ;;
+    -h | --help)
+      usage
+      exit 0;;
+    *)
+      echo "Unknown option '$1'"
+      usage
+      exit 1;;
+    esac
+    shift
+  done
+}
+
+########################################################################
+
+if test ! -f sql/mysqld.cc
+then
+  echo "You must run this script from the MySQL top-level directory"
+  exit 1
+fi
+
 if [ ! -d win/data ] ; then
   echo This doesnt seem to be source tarball. 
   echo This script should be run from the top directory of the source tarball 
@@ -14,12 +63,14 @@
   exit 1;
 fi
 
+parse_options "$@"
+
 set -x
 
-if [ "x_$1" != "x_-nobuild" ]; then
+if [ "$RUNBUILD" == "yes" ]; then
   sh win/configure-mariadb.sh
 
-  cmake -G "Visual Studio 9 2008"
+  cmake -G "$CMAKE_GENERATOR"
 
   devenv.com MySQL.sln /build RelWithDebInfo
   devenv.com MySQL.sln /build Debug
@@ -35,12 +86,12 @@
 
 # We want the final zip to be named like this:
 #  mariadb-noinstall-5.1.38-win32.zip
-ZIPNAME=mariadb-noinstall-$VER_NO_MARIA-win32
+ZIPNAME=mariadb-noinstall-$VER_NO_MARIA-$ARCH
 ZIPFILE=$ZIPNAME.zip
 
 # The top directory inside the zip should be called like this:
-#  mariadb-5.1-38-win32
-ZIPCONTENT=mariadb-$VER_NO_MARIA-win32
+#  mariadb-5.1-38-$ARCH
+ZIPCONTENT=mariadb-$VER_NO_MARIA-$ARCH
 
 # This will make $ZIPCONTENT.zip
 sh -x scripts/make_win_bin_dist $ZIPCONTENT


Follow ups

References