List:Commits« Previous MessageNext Message »
From:pharvey Date:February 14 2007 12:48am
Subject:Connector/ODBC 5 commit: r795 - trunk
View as plain text  
Added:
   trunk/BUILD.linux
   trunk/Build.sh
   trunk/BuildNightly.pl
Removed:
   trunk/Build_Nightly.pl
   trunk/build.sh
Modified:
   trunk/connector-odbc.vpj
Log:
- doc code
- improve build on UNIX/Linux
- enforce some name conventions



Added: trunk/BUILD.linux
===================================================================
--- trunk/BUILD.linux	2007-02-12 09:24:55 UTC (rev 794)
+++ trunk/BUILD.linux	2007-02-13 23:48:21 UTC (rev 795)
@@ -0,0 +1,137 @@
+MySQL Connector/ODBC
+BUILD
+======================================================
+
+DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT DRAFT 
+
+Here is what one dev (me) does to build on Linux.
+
+Environment
+-----------
+
+Dual xeon EMT64
+SuSE Enterprise Desktop 10.1
+gcc 4.1.0
+MySQL 5.0.27
+Qt 4.2.2
+unixODBC 2.2.13pre
+
+SuSE Enterprise Desktop
+-----------------------
+
+I purchased a copy of SuSE linux but one can use the OpenSuSE
+distro as well.
+
+I get all the latest updates. I have 32bit support but I am
+only interested in building 64bit solution for this example.
+
+See; www.suse.com
+
+MySQL
+-----
+
+C/ODBC uses the MySQL C API to communicate to the server.
+
+I can get the MySQL dev files (and the server if one wishs)
+from my Linux distro or from www.mysql.com. I choose to get
+latest stable v5 from www.mysql.com in binary form. I install
+it as per instructions included with that product.
+
+I mainly want the dev files but I install all - but I leave
+out the dynamic client lib (we just want the static one).
+
+See; www.mysql.com
+
+Qt
+--
+
+C/ODBC uses Qt for GUI and non-GUI bits.
+
+I use my Qt v4 commercial license. One can get Qt v4 (either 
+commercial or open source - depending upon your needs) from 
+your Linux distro or from www.trolltech.com.
+
+For this example we use a commercial licensed version
+from TrollTech and it comes as a source tar-ball.
+
+Build and install it as per TrollTech instructions. 
+
+See; www.trolltech.com
+
+unixODBC
+--------
+
+C/ODBC needs an ODBC SDK to build. This is primarly 
+unixODBC on UNIX/Linux but could also be another ODBC SDK.
+
+I usually test C/ODBC against a Driver Manager (such as
+the one which comes with unixODBC) and I usually want to 
+use the GUI bits - so I ensure that I have the complete 
+unixODBC built (with Qt4 support) and installed.
+
+unixODBC comes with my Linux distro but the version is too
+old. C/ODBC makes some calls to the wide char version of the
+installer API and they are not supported in unixODBC until
+version 2.2.12. 
+
+unixODBC v2.2.12 is sufficient if one does not desire the 
+Qt4 based GUI bits. For this example I want the Qt4 GUI
+bits so I work with the very latest unixODBC (from cvs source
+repo in fact).
+
+See; www.unixodbc.org
+
+C/ODBC
+------
+
+Get the source (you are probably looking at it). Then;
+
+1. config
+2. build
+3. install
+4. test
+
+CONFIG
+------
+
+1. Set environment variables;
+
+	MYSQL_DIR
+
+        This is used to tell the C/ODBC build where the MySQL
+        client lib and include files are. 
+
+2. Review qmake Project Files
+
+	View edit *.pro and *.pri files... particularly the 
+	ones in the source root.
+
+BUILD
+-----
+
+Execute the following script to generate the makefiles and then
+build the source;
+
+	Build.sh
+
+
+INSTALL
+-------
+
+Execute the following scripts to install and uninstall the 
+driver;
+
+	Install.sh
+	Uninstall.sh
+	Upgrade.sh
+
+TEST
+----
+
+Use the unixODBC 'isql' command-line utility to test the 
+driver.
+
+======================================================
+Enjoy!
+MySQL Connectors Team
+

Copied: trunk/Build.sh (from rev 794, trunk/build.sh)
===================================================================
--- trunk/build.sh	2007-02-12 09:24:55 UTC (rev 794)
+++ trunk/Build.sh	2007-02-13 23:48:21 UTC (rev 795)
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+###################################################################
+#
+# \brief    Build script for unix.
+#
+#           Execute this on UNIX/Linux/OSX platforms to build the
+#           source code.
+#
+#           This is provided as convenient way to do the following;
+#   
+#           1. qmake
+#           2. make
+#
+#           This script has the following advantages over the above;
+#
+#           1. explicitly does a qmake (to create makefiles) 
+#              for case where qmake may not recurse properly
+#           2. forces relink (which normal 'make' does not do)
+#
+#           One may still need to create env. vars and/or edit *.pri
+#           files because we do not, yet, have a 'configure' script.
+#           See root.pro and *.pri files for details.
+#
+#           On some Linux distributions you may have two versions of Qt
+#           installed. Qt 4 is required so if qmake defaults to Qt 3, try:
+#
+#           $ QMAKE=qmake-qt4 ./Build.sh
+#
+# \sa       README.linux
+#           *.pro
+#           *.pri
+#
+###################################################################
+
+#
+# Allow specific qmake to be provided by env var. This is to handle
+# case where more than one ver of Qt dev. is installed (qt3 and qt4 
+# for example).
+#
+if test "x$QMAKE" = "x"
+then
+	QMAKE=qmake
+fi
+
+#
+# Force relink.
+#
+rm -rf SDK/lib SDK/bin Driver/lib Driver/bin Tools/bin
+
+#
+# Tell qmake to create makefiles. This will recurse by default.
+#
+"$QMAKE"
+
+#
+# Explicitly do recursive qmake. This is not normally required since
+# qmake alone in root dir will recurse.
+#
+for d in SDK/C/Library SDK/C/Tests SDK/Dbg/Library SDK/Dbg/Tests \
+	SDK/Tst/Library SDK/Installer/Library SDK/Installer/Tests \
+	SDK/MYSQLPlus/Library SDK/MYSQLPlus/Tests \
+	Driver/Driver/Library Driver/Driver/Tests \
+	Driver/Setup/Library Driver/Setup/Tests \
+	Tools/dltest Tools/Installer Tools/Shell
+do
+	cd "$d"
+	"$QMAKE"
+	cd -
+done
+
+#
+# Finally - lets build the source!
+#
+make
+

Copied: trunk/BuildNightly.pl (from rev 794, trunk/Build_Nightly.pl)

Deleted: trunk/Build_Nightly.pl
===================================================================
--- trunk/Build_Nightly.pl	2007-02-12 09:24:55 UTC (rev 794)
+++ trunk/Build_Nightly.pl	2007-02-13 23:48:21 UTC (rev 795)
@@ -1,98 +0,0 @@
-#!perl
-#============================================================================
-#
-#         FILE:  Build_Nightly.pl
-#
-#        USAGE:  ./Build_Nightly.pl 
-#
-#     SYNOPSIS:  
-#
-#  DESCRIPTION:  Nightly build script for MySQL Connector/ODBC v5.
-#  					This will svn update, build, zip, scp, etc.
-#      OPTIONS:  ---
-# REQUIREMENTS:  1. A working svn+ssh setup for 'svn update'
-# 				 2. Putty installed for 'pscp'
-# 				 3. 7zip for compressing
-# 				 4. All utils must be in the path
-#         BUGS:  Lots of variables still needs to be parameterized.
-#        NOTES:  ---
-#       AUTHOR:  Jess Balint
-#      COMPANY:  MySQL
-#      VERSION:  1.0
-#      CREATED:  11/9/2006 1:06:32 PM Central Standard Time
-#     REVISION:  $Id: perl-file-header,v 1.2 2005/04/15 22:48:02 jbalint Exp $
-#============================================================================
-
-use strict;
-use warnings;
-
-use Cwd;
-use POSIX;
-use Mail::Sender;
-
-# where the final build will go
-my $scpdest = "jbalint\@production.mysql.com:public_html/c-odbc5-nightly";
-
-# other vars for the program
-my $date = strftime("%Y%m%d", localtime());
-my $startdir = cwd();
-my $outfile = "mysql-connector-odbc-5.0-win32-nightly-$date.zip";
-my $fulloutfile = "$startdir/builds/$outfile";
-
-# setup the log file to grab all output
-close(STDOUT);
-close(STDERR);
-open(STDOUT, ">logs/nightly-$date.txt") or die("open STDOUT: $!\n");
-open(STDERR, ">&STDOUT") or die("open STDERR: $!\n");
-select(STDERR); $|++;
-select(STDOUT); $|++;
-
-print "NIGHTLY BUILD for $date\n";
-
-# SVN update and build
-runcmd("svn update");
-system("nmake distclean");
-runcmd("Build.bat");
-runcmd("Upgrade.bat 0");
-runcmd("PostBuildTest.bat");
-
-# create the dist and push it out
-system(qq[rm "$fulloutfile"]);
-runcmd(qq[7z a -r "$fulloutfile" . -xr!logs -xr!builds]);
-runcmd(qq[pscp -q "$fulloutfile" "$scpdest"]);
-
-# TODO allow changing this easier for other people to run
-runcmd(qq[plink -2 mysqldev\@production.mysql.com "scp
/users/jbalint/public_html/c-odbc5-nightly/$outfile
autobuild\@production.mysql.com:~autobuild/autobuild/autobuilds/mysql-connector-odbc-5.0"]);
-
-print "Build completed successfully\n";
-
-######################################
-# Run a given shell command, exit
-# with a failure email if the command
-# is not successful
-######################################
-sub runcmd
-{
-	my $cmd = shift;
-	print "Executing: $cmd\n";
-	my $rc = system($cmd);
-	if($rc)
-	{
-		print "*************** COMMAND FAILED ******************\n";
-
-		my $mail = Mail::Sender->new({
-				smtp => "stephenw",
-				from => "jbalint\@mysql.com" });
-		die("Failed to send: " . $Mail::Sender::Error)
-			if($mail < 0);
-		$mail->MailFile({
-				to => "jbalint\@gmail.com",
-				subject => "Nightly Build $date Failed",
-				msg => "Build failed, see attached log file",
-				file => "logs/nightly-$date.txt" })
-			or die("Failed to send: " . $Mail::Sender::Error);
-		print "Failure email sent\n";
-		exit(1);
-	}
-}
-

Deleted: trunk/build.sh
===================================================================
--- trunk/build.sh	2007-02-12 09:24:55 UTC (rev 794)
+++ trunk/build.sh	2007-02-13 23:48:21 UTC (rev 795)
@@ -1,35 +0,0 @@
-#!/bin/sh
-
-###################################################################
-# MySQL Connector/ODBC v5
-# Build script for unix
-#
-# On some Linux distributions you may have two versions of Qt
-# installed. Qt 4 is required so if qmake defaults to Qt 3, try:
-#
-# $ QMAKE=qmake-qt4 ./build.sh
-###################################################################
-
-if test "x$QMAKE" = "x"
-then
-	QMAKE=qmake
-fi
-
-rm -rf SDK/lib SDK/bin Driver/lib Driver/bin Tools/bin
-
-"$QMAKE"
-
-for d in SDK/C/Library SDK/C/Tests SDK/Dbg/Library SDK/Dbg/Tests \
-	SDK/Tst/Library SDK/Installer/Library SDK/Installer/Tests \
-	SDK/MYSQLPlus/Library SDK/MYSQLPlus/Tests \
-	Driver/Driver/Library Driver/Driver/Tests \
-	Driver/Setup/Library Driver/Setup/Tests \
-	Tools/dltest Tools/Installer Tools/Shell
-do
-	cd "$d"
-	"$QMAKE"
-	cd -
-done
-
-make
-

Modified: trunk/connector-odbc.vpj
===================================================================
--- trunk/connector-odbc.vpj	2007-02-12 09:24:55 UTC (rev 794)
+++ trunk/connector-odbc.vpj	2007-02-13 23:48:21 UTC (rev 795)
@@ -52,12 +52,14 @@
 		<Folder
 			Name="Source Files"
 			Filters="*.c;*.C;*.cc;*.cpp;*.cp;*.cxx;*.prg;*.pas;*.dpr;*.asm;*.s;*.bas;*.java;*.cs;*.sc;*.e;*.cob;*.html;*.rc;*.tcl;*.py;*.pl">
+			<F N="BuildNightly.pl"/>
 			<F N="doc/Header.html"/>
 			<F N="License.html"/>
 		</Folder>
 		<Folder
 			Name="Header Files"
 			Filters="*.h;*.H;*.hh;*.hpp;*.hxx;*.inc;*.sh;*.cpy;*.if">
+			<F N="Build.sh"/>
 			<F N="VersionInfo.h"/>
 		</Folder>
 		<Folder
@@ -70,6 +72,7 @@
 			Name="Other Files"
 			Filters="">
 			<F N="Build.bat"/>
+			<F N="BUILD.linux"/>
 			<F N="BUILD.win"/>
 			<F N="ChangeLog"/>
 			<F N="CMakeLists.txt"/>

Thread
Connector/ODBC 5 commit: r795 - trunkpharvey14 Feb