aboutsummaryrefslogtreecommitdiffstats
path: root/Frameworks/SPMySQLFramework/build-mysql-client.sh
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2012-03-17 15:32:00 +0000
committerrowanbeentje <rowan@beent.je>2012-03-17 15:32:00 +0000
commitac8ebfe4bba6d7da6edad87c75b174156d919621 (patch)
tree08a3c2843d3c520090f40e6341b26043a7ccf014 /Frameworks/SPMySQLFramework/build-mysql-client.sh
parent8886d935e933c6239aa9b35e900d96f7d07527c7 (diff)
parenteab6df4de773259f90dd5a1d25e44ca4d2765bbf (diff)
downloadsequelpro-ac8ebfe4bba6d7da6edad87c75b174156d919621.tar.gz
sequelpro-ac8ebfe4bba6d7da6edad87c75b174156d919621.tar.bz2
sequelpro-ac8ebfe4bba6d7da6edad87c75b174156d919621.zip
Merge in the SPMySQL Framework. This new framework should provide much of the functionality required from MCPKit and is based around its interface for relatively easy integration.
Externally visible changes as a result of this merge: - Speed improvements, particularly when loading large data sets - Stability improvements, particularly related to connection state after the connection is dropped (eg Issue #1256) - Improved support for new MySQL data types, which should address Issue #1052. - Database structure retrieval and query cancellation now use a single persistent helper connection instead of lots of connections on-demand. This should help Issue #1097. - More internal commands now use queries instead of MySQL functions; for example USE queries are now used to trigger database selection, improving transcripts. This addresses Issue #1247. - Improved internal encoding work; while this needs support within the UI, it lays the foundation for issues like Issue #1280. Code improvements: - Much improved class layouts including extensive category usage - Improved documentation across framework methods - Support for fast enumeration across result objects - Rewrite fixes use of a number of deprecate functions - Much less code duplication across result set types - Improved encapsultation within the framework, limiting the number of methods exposed, and also not exposing all the MySQL headers From the Readme file: The SPMySQL Framework is intended to provide a stable MySQL connection framework, with the ability to run text-based queries and rapidly retrieve result sets with conversion from MySQL data types to Cocoa objects. SPMySQL.framework has an interface loosely based around that provided by MCPKit by Serge Cohen and Bertrand Mansion (http://mysql-cocoa.sourceforge.net/), and in particular the heavily modified Sequel Pro version (http://www.sequelpro.com/). It is a full rewrite of the original framework, although it includes code from patches implementing the following Sequel Pro functionality, largely contributed by Hans-Jörg Bibiko, Stuart Connolly, Jakob Egger, and Rowan Beentje: - Connection locking (Jakob et al) - Ping & keepalive (Rowan et al) - Query cancellation (Rowan et al) - Delegate setup (Stuart et al) - SSL support (Rowan et al) - Connection checking (Rowan et al) - Version state (Stuart et al) - Maximum packet size control (Hans et al) - Result multithreading and streaming (Rowan et al) - Improved encoding support & switching (Rowan et al) - Database structure; moved to inside the app (Hans et al) - Query reattempts and error-handling approach (Rowan et al) - Geometry result class (Hans et al) - Connection proxy (Stuart et al)
Diffstat (limited to 'Frameworks/SPMySQLFramework/build-mysql-client.sh')
-rwxr-xr-xFrameworks/SPMySQLFramework/build-mysql-client.sh171
1 files changed, 171 insertions, 0 deletions
diff --git a/Frameworks/SPMySQLFramework/build-mysql-client.sh b/Frameworks/SPMySQLFramework/build-mysql-client.sh
new file mode 100755
index 00000000..45e3c465
--- /dev/null
+++ b/Frameworks/SPMySQLFramework/build-mysql-client.sh
@@ -0,0 +1,171 @@
+#! /bin/ksh
+
+#
+# $Id$
+#
+# build-mysql-client.sh
+# sequel-pro
+#
+# Created by Stuart Connolly (stuconnolly.com)
+# Copyright (c) 2009 Stuart Connolly. All rights reserved.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# More info at <http://code.google.com/p/sequel-pro/>
+
+# Builds the MySQL client libraries for distrubution in Sequel Pro's MySQL framework.
+#
+# Paramters: -s -- The path to the MySQL source directory.
+# -q -- Quiet. Don't output any compiler messages.
+# -c -- Clean the source after build completes.
+# -d -- Debug. Output the build statements.
+
+QUIET='NO'
+DEBUG='NO'
+CLEAN='NO'
+
+# C/C++ compiler flags
+export CFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -arch x86_64 -O3 -fno-omit-frame-pointer -fno-exceptions -mmacosx-version-min=10.5'
+export CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386 -arch x86_64 -O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -mmacosx-version-min=10.5'
+
+CONFIGURE_OPTIONS='--without-server --enable-thread-safe-client --disable-dependency-tracking --enable-local-infile --with-ssl --enable-assembler --with-mysqld-ldflags=-all-static'
+BINARY_DISTRIBUTION_SCRIPT='scripts/make_binary_distribution'
+
+usage()
+{
+ cat <<!EOF
+Usage: $(basename $0): -s <mysql_source_path> [-q -c -d]
+
+Where: -s -- Path to the MySQL source directory
+ -q -- Be quiet during the build. Suppress all compiler messages
+ -c -- Clean the source directory after the build completes
+ -d -- Debug. Output all the build commands
+!EOF
+}
+
+if [ $# -eq 0 ]
+then
+ echo "Invalid number of arguments. I need the path to the MySQL source directory."
+ echo ''
+ usage
+ exit 1
+fi
+
+echo ''
+echo "This script builds the MySQL client libraries for distribution in Sequel Pro's MySQL framework."
+echo 'They are all built as 3-way binaries (32 bit PPC, 32/64 bit i386).'
+echo ''
+echo -n 'This may take a while, are you sure you want to continue [y | n]: '
+
+read CONTINUE
+
+if [ "x${CONTINUE}" == 'xn' ]
+then
+ echo 'Aborting...'
+ exit 0
+fi
+
+while getopts ':s:qcd' OPTION
+do
+ case "$OPTION" in
+ s) MYSQL_SOURCE_DIR="$OPTARG";;
+ q) QUIET='YES';;
+ c) CLEAN='YES';;
+ d) DEBUG='YES';;
+ *) echo 'Unrecognised option'; usage; exit 1;;
+ esac
+done
+
+if [ ! -d "$MYSQL_SOURCE_DIR" ]
+then
+ echo "MySQL source directory does not exist at path '${MYSQL_SOURCE_DIR}'."
+ echo 'Exiting...'
+ exit 1
+fi
+
+# Change to source directory
+cd "$MYSQL_SOURCE_DIR"
+
+echo 'Configuring MySQL source...'
+
+if [ "x${DEBUG}" == 'xYES' ]
+then
+ echo "${MYSQL_SOURCE_DIR}/configure" "$CONFIGURE_OPTIONS"
+fi
+
+if [ "x${QUIET}" == 'xYES' ]
+then
+ ./configure $CONFIGURE_OPTIONS > /dev/null
+else
+ ./configure $CONFIGURE_OPTIONS
+fi
+
+if [ $? -eq 0 ]
+then
+ echo 'Configure successfully completed'
+else
+ echo 'Configure failed. Exiting...'
+ exit 1
+fi
+
+echo 'Building client libraries...'
+
+if [ "x${QUIET}" == 'xYES' ]
+then
+ make > /dev/null
+else
+ make
+fi
+
+if [ $? -eq 0 ]
+then
+ echo 'Building libraries successfully completed'
+else
+ echo 'Building libraries failed. Exiting...'
+ exit 1
+fi
+
+echo 'Building binary distribution...'
+
+if [ "x${QUIET}" == 'xYES' ]
+then
+ $BINARY_DISTRIBUTION_SCRIPT > /dev/null
+else
+ $BINARY_DISTRIBUTION_SCRIPT
+fi
+
+if [ $? -eq 0 ]
+then
+ echo 'Building binary distribution successfully completed'
+else
+ echo 'Building binary distribution failed. Exiting...'
+ exit 1
+fi
+
+if [ "x${CLEAN}" == 'xYES' ]
+then
+ echo 'Cleaning build...'
+
+ if [ "x${QUIET}" == 'xYES' ]
+ then
+ make clean > /dev/null
+ else
+ make clean
+ fi
+fi
+
+echo 'Building MySQL client libraries successfully completed.'
+
+exit 0