List:Commits« Previous MessageNext Message »
From:Daniel Fischer Date:October 20 2008 11:25am
Subject:bzr commit into mysql-5.0 branch (df:2658)
View as plain text  
#At file:///shared/home/df/mysql/bazaar/mysql-5.0-preconfigure/

 2658 Daniel Fischer	2008-10-20
      implement PreconfigureDesign
added:
  BUILD/preconfigure
modified:
  BUILD/Makefile.am

=== modified file 'BUILD/Makefile.am'
--- a/BUILD/Makefile.am	2008-05-13 13:46:38 +0000
+++ b/BUILD/Makefile.am	2008-10-20 11:24:57 +0000
@@ -22,6 +22,7 @@ EXTRA_DIST =		FINISH.sh \
 			autorun.sh \
 			check-cpu \
 			cleanup \
+			preconfigure \
 			compile-alpha \
 			compile-alpha-ccc \
 			compile-alpha-cxx \

=== added file 'BUILD/preconfigure'
--- a/BUILD/preconfigure	1970-01-01 00:00:00 +0000
+++ b/BUILD/preconfigure	2008-10-20 11:24:57 +0000
@@ -0,0 +1,1249 @@
+#!/usr/bin/env perl
+# 
+# MySQL preconfigure, Copyright (c)2008 Sun Microsystems
+#
+# This script knows how to configure this MySQL 5.0 source
+# tree in order to build various flavours of MySQL Server
+# products on many platforms.
+#
+# Command-line usage:
+# ------------------
+# The script has to be executed with the current working
+# directory being the top level directory of the source tree.
+# In order to build a default binary for a given platform,
+# use this command:
+# $ BUILD/preconfigure --platform <platform-id> --configure
+# This will run configure with appropriate environment 
+# settings and configure options for a default build.
+#
+# In order to see the available platforms, do this:
+# $ BUILD/preconfigure --list-platforms
+#
+# To build a different flavour than the default, specify
+# the --product option, followed by a product identifier.
+#
+# To see the available products:
+# $ BUILD/preconfigure --list-products
+#
+# In case you don't want to run configure, but only see 
+# which settings preconfigure would use, you can use the
+# --print option:
+# $ BUILD/preconfigure --platform <platform-id> --print
+#
+# Fur the purpose of logging, it might also be helpful
+# to specify both --print and --configure.
+#
+# Usage from perl:
+# ---------------
+# The script is written so that it can be used as a module
+# from perl code, if @ARGV is empty at the time when it is
+# included.
+#
+# Example:
+# $ perl -e 'require "preconfigure"; $cfg = {}; \
+#            aggregate($cfg, $default); print_config($cfg)'
+#
+
+use strict;
+
+##############################################################################
+# DEFAULT SETTINGS                                                           #
+##############################################################################
+our $default = {
+    'env' => {
+        'CC' =>       'gcc',
+        'CXX' =>      'gcc',
+        'CFLAGS' =>   '-g',
+        'CXXFLAGS' => '-g',
+        'LDFLAGS' =>  '',
+    },
+    'opt' => {
+        '--enable-local-infile' => undef,
+        '--enable-thread-safe-client' => undef,
+        '--libexecdir' => '/usr/local/mysql/bin',
+        '--localstatedir' => '/usr/local/mysql/data',
+        '--prefix' => '/usr/local/mysql',
+        '--with-big-tables' => undef,
+        '--with-pic' => undef,        
+        '--with-archive-storage-engine' => undef,
+        '--with-blackhole-storage-engine' => undef,
+        '--with-csv-storage-engine' => undef,
+        '--with-federated-storage-engine' => undef,
+        '--with-innodb' => undef,
+        '--with-ndbcluster' => undef,
+        '--with-readline' => undef,
+        '--with-extra-charsets' => 'complex',
+        '--with-yassl' => undef,
+        '--with-client-ldflags' => '-static',
+        '--with-mysqld-ldflags' => '-static',
+    },
+    'win' => {
+        'WITH_HEAP_STORAGE_ENGINE' => undef,
+        'WITH_MYISAM_STORAGE_ENGINE' => undef,
+        'WITH_MYISAMMRG_STORAGE_ENGINE' => undef,
+        'WITH_ARCHIVE_STORAGE_ENGINE' => undef,
+        'WITH_BLACKHOLE_STORAGE_ENGINE' => undef,
+        'WITH_FEDERATED_STORAGE_ENGINE' => undef,
+        'WITH_INNOBASE_STORAGE_ENGINE' => undef,
+        '__NT__' => undef,
+    },
+};
+
+##############################################################################
+# DEBUG SETTINGS                                                             #
+##############################################################################
+our $debug = {
+    'env' => {
+        '-CFLAGS' =>   '-O2 -O3 -Os -xO3 -xO2 -xOs +O3 +O2 +Os',
+        '-CXXFLAGS' => '-O2 -O3 -Os -xO3 -xO2 -xOs +O3 +O2 +Os',
+    },
+    'opt' => {
+        '--with-debug' => undef,
+        '--without-ndb-debug' => undef,
+    },
+    'win' => {
+    },
+};
+
+##############################################################################
+# PRODUCT DEFINITIONS                                                        #
+##############################################################################
+
+our $products = {
+    # community uses the default set of engines
+    'community' => {
+        'opt' => {
+            '--with-extra-charsets' => 'all',
+        },
+        'win' => {
+        },
+    },
+    # classic
+    'classic' => {
+        'opt' => {
+            '--without-ndbcluster' => undef,
+            '--without-innodb' => undef,
+            '--with-libedit' => undef,
+        },
+        'win' => {
+            '-WITH_INNOBASE_STORAGE_ENGINE' => undef,
+        }
+    },
+    # enterprise
+    'enterprise' => {
+        'opt' => {
+            '--without-ndbcluster' => undef,
+            '--with-libedit' => undef,
+        },
+        'win' => {
+        },
+    },
+    # enterprise-gpl
+    'enterprise-gpl' => {
+        'opt' => {
+            '--without-ndbcluster' => undef,
+        },
+        'win' => {
+        },
+    },
+    # cluster
+    'cluster' => {
+        'opt' => {
+            '--without-innodb' => undef,
+            '--with-extra-charsets' => 'all',
+            '--with-libedit' => undef,
+        },
+        'win' => {
+        },
+    },
+};
+
+##############################################################################
+# PLATFORM DEFINITIONS                                                       #
+##############################################################################
+our $platforms = {
+##############################################################################
+# solaris10-x86_64
+#
+    'solaris10-x86_64' => {
+        'env' => {
+            'CXX' =>          'CC',
+            'CC' =>           'cc',
+            'CFLAGS' =>       '-g -m64  -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic',
+            'LDFLAGS' =>      '-m64',
+            'CXXFLAGS' =>     '-g -m64  -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic',
+            'LIBRARY_PATH' => '/usr/local/lib/amd64',
+        },
+        'opt' => {
+            '--with-mysqld-libs' => '-lmtmalloc',
+            '--build' => 'x86_64-pc-solaris2.10',
+            '--with-named-curses' => '-lcurses',
+        },
+    },
+
+##############################################################################
+# qnx6.2.1-x86
+#
+    'qnx6.2.1-x86' => {
+        'env' => {
+            'CFLAGS' => '-g -O1 -D_FILE_OFFSET_BITS=64 -Wl,-E',
+            'CC' => 'qcc',
+            'CONFIG_SHELL' => '/usr/bin/bash',
+            'CXXFLAGS' => '-g -O1 -D_FILE_OFFSET_BITS=64 -Wl,-E',
+            'CXX' => 'qcc',
+        },
+        'opt' => {
+            '--without-csv-storage-engine' => undef,
+        },
+    },
+
+##############################################################################
+# aix5.3-powerpc-64bit
+#
+    'aix5.3-powerpc-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g -q64 -ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192',
+            'CC' => 'xlc_r',
+            'LDFLAGS' => '-Wl,-brtl',
+            'CXXFLAGS' => '-g -q64 -ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192',
+            'CXX' => 'xlC_r',
+            'AR' => 'ar -Xany',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# solaris10-sparc-64bit
+#
+    'solaris10-sparc-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -Xa -xstrconst -mt -D_FORTEC_ -xarch=v9 -xc99=none',
+            'CC' => 'cc-5.0',
+            'LDFLAGS' => '-xarch=v9',
+            'CXXFLAGS' => '-g -xO3 -noex -mt -D_FORTEC_ -xarch=v9',
+            'CXX' => 'CC',
+            'ASFLAGS' => '-xarch=v9',
+        },
+        'opt' => {
+            '--with-mysqld-libs' => '-lmtmalloc',
+            '--with-named-z-libs' => 'no',
+        },
+    },
+
+##############################################################################
+# linux-x86-icc
+#
+    'linux-x86-icc' => {
+        'env' => {
+            'CFLAGS' => '-g -O3 -mp -restrict',
+            'CC' => 'icc  -static-intel -static-libgcc',
+            'CXXFLAGS' => '-g -O3 -mp -restrict',
+            'CXX' => 'icpc -static-intel -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+            '--enable-assembler' => undef,
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# linux-s390x
+#
+    'linux-s390x' => {
+        'env' => {
+            'CFLAGS' => '-g -O2',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -O2 -felide-constructors',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+        },
+    },
+
+##############################################################################
+# osx10.5-x86
+#
+    'osx10.5-x86' => {
+        'env' => {
+            'CFLAGS' => '-g -Os -arch i386 -fno-common',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -Os -arch i386 -felide-constructors -fno-common',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+        },
+    },
+
+##############################################################################
+# osx10.3-powerpc-32bit
+#
+    'osx10.3-powerpc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -O3 -fno-common',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -O3 -fno-common',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+        },
+    },
+
+##############################################################################
+# i5os-power-64bit
+#
+    'i5os-power-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g -q64 -ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192',
+            'NM' => 'nm -X64',
+            'CC' => 'xlc_r',
+            'LDFLAGS' => '-Wl,-brtl',
+            'CXXFLAGS' => '-g -q64 -ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192',
+            'CXX' => 'xlC_r',
+            'AR' => 'ar -X64',
+        },
+        'opt' => {
+            '--with-machine-type' => 'power',
+            '--with-named-z-libs' => 'no',
+            '--build' => 'powerpc-ibm-aix5.3.0.0',
+            '--with-system-type' => 'ibm-i5os',
+            '--host' => 'powerpc-ibm-aix5.3.0.0',
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# linux-x86-static
+#
+    'linux-x86-static' => {
+        'env' => {
+            'CFLAGS' => '-g -O2 -mcpu=pentiumpro',
+            'CC' => 'gcc',
+            'CPPFLAGS' => '-I/usr/local/include -DDEFAULT_THREAD_STACK=126976',
+            'LDFLAGS' => '-L/usr/local/lib',
+            'CXXFLAGS' => '-g -O2 -mcpu=pentiumpro -felide-constructors',
+            'CXX' => 'gcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+            '--enable-assembler' => undef,
+            '--with-client-ldflags' => '-all-static',
+            '--with-mysqld-ldflags' => '-all-static',
+            '---with-zlib-dir' => undef,
+        },
+    },
+
+##############################################################################
+# osx10.4-powerpc-64bit
+#
+    'osx10.4-powerpc-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g -Os -arch ppc64 -fno-common',
+            'CC' => 'gcc -static-libgcc',
+            'LDFLAGS' => '-arch ppc64',
+            'CXXFLAGS' => '-g -Os -arch ppc64 -felide-constructors -fno-common',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-named-curses-libs' => '/Users/mysqldev/local/lib/libncurses.a',
+        },
+    },
+
+##############################################################################
+# aix5.3-powerpc-32bit
+#
+    'aix5.3-powerpc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -ma -qstrict -qoptimize=0 -qmaxmem=8192',
+            'CC' => 'xlc_r',
+            'LDFLAGS' => '-Wl,-brtl',
+            'CXXFLAGS' => '-g -ma -qstrict -qoptimize=0 -qmaxmem=8192',
+            'CXX' => 'xlC_r',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '---with-yassl' => undef,
+        },
+    },
+
+
+##############################################################################
+# osx10.4-x86
+#
+    'osx10.4-x86' => {
+        'env' => {
+            'CFLAGS' => '-g -Os -arch i386 -fno-common',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -Os -arch i386 -felide-constructors -fno-common',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+        },
+    },
+
+##############################################################################
+# solaris8-sparc-64bit
+#
+    'solaris8-sparc-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -Xa -xstrconst -mt -D_FORTEC_ -xarch=v9',
+            'CC' => 'cc-5.0',
+            'LDFLAGS' => '-xarch=v9',
+            'CXXFLAGS' => '-g -xO3 -noex -mt -D_FORTEC_ -xarch=v9',
+            'CXX' => 'CC',
+            'ASFLAGS' => '-xarch=v9',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '--with-named-curses-libs' => '-lcurses',
+        },
+    },
+
+##############################################################################
+# aix5.2-powerpc-64bit
+#
+    'aix5.2-powerpc-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g -q64 -ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192',
+            'CC' => 'xlc_r',
+            'LDFLAGS' => '-Wl,-brtl',
+            'CXXFLAGS' => '-g -q64 -ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192',
+            'CXX' => 'xlC_r',
+            'AR' => 'ar -Xany',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# freebsd6.0-x86
+#
+    'freebsd6.0-x86' => {
+        'env' => {
+            'CFLAGS' => '-g -O3',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -O3',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--enable-assembler' => undef,
+        },
+    },
+
+##############################################################################
+# solaris8-x86
+#
+    'solaris8-x86' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic',
+            'CC' => 'cc',
+            'CXXFLAGS' => '-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic',
+            'CXX' => 'CC',
+        },
+        'opt' => {
+        },
+    },
+
+##############################################################################
+# linux-x86_64
+#
+    'linux-x86_64' => {
+        'env' => {
+            'CFLAGS' => '-g -O3',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -O3',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+        },
+    },
+
+##############################################################################
+# solaris10-sparc-64bit-gcc
+#
+    'solaris10-sparc-64bit-gcc' => {
+        'env' => {
+            'CFLAGS' => '-g -O3 -m64',
+            'CC' => 'gcc -static-libgcc',
+            'AS' => '/opt/gnu/bin/as',
+            'LD' => '/opt/gnu/bin/ld',
+            'CXXFLAGS' => '-g -O3 -felide-constructors -fno-exceptions -fno-rtti -m64',
+            'CXX' => 'gcc -static-libgcc',
+            'CXXLD' => 'g++ -static-libgcc',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+        },
+    },
+
+##############################################################################
+# openserver6-x86
+#
+    'openserver6-x86' => {
+        'env' => {
+            'CFLAGS' => '-D_FILE_OFFSET_BITS=64 optO -DDBUG_OFF -Kalloca',
+            'CC' => 'cc',
+            'CXXFLAGS' => '-D_FILE_OFFSET_BITS=64 optO3 -DDBUG_OFF -Kalloca -Kalloca -Tno_implicit',
+            'CXX' => 'CC',
+        },
+        'opt' => {
+            '--build' => 'i686-unknown-sysv5SCO_SV6.0.0',
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# linux-ia64
+#
+    'linux-ia64' => {
+        'env' => {
+            'CC' => 'gcc -static-libgcc',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+        },
+    },
+
+##############################################################################
+# osx10.4-powerpc-32bit
+#
+    'osx10.4-powerpc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -Os -arch ppc -fno-common',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -Os -arch ppc -felide-constructors -fno-common',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+        },
+    },
+
+##############################################################################
+# hpux11.00-hppa-32bit
+#
+    'hpux11.00-hppa-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g +O2 +DAportable',
+            'CC' => 'cc',
+            'CPPFLAGS' => '-DDEFAULT_THREAD_STACK=262144',
+            'CXXFLAGS' => '-g +O2 +DAportable -Aa',
+            'CXX' => 'aCC',
+        },
+        'opt' => {
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# hpux11.31-hppa-32bit
+#
+    'hpux11.31-hppa-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g +O1 +DAportable',
+            'CC' => 'cc',
+            'CPPFLAGS' => '-DDEFAULT_THREAD_STACK=262144',
+            'CXXFLAGS' => '-g +O1 +DAportable -Aa',
+            'CXX' => 'aCC',
+            'INSTALL' => '/usr/local/bin/install',
+        },
+        'opt' => {
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# linux-sles9-x86_64
+#
+    'linux-sles9-x86_64' => {
+        'env' => {
+            'CC' => 'gcc -static-libgcc',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+        },
+    },
+
+##############################################################################
+# solaris9-x86
+#
+    'solaris9-x86' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic',
+            'CC' => 'cc',
+            'CXXFLAGS' => '-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic',
+            'CXX' => 'CC',
+        },
+        'opt' => {
+            '--with-named-curses' => '-lcurses',
+        },
+    },
+
+##############################################################################
+# solaris8-sparc-32bit
+#
+    'solaris8-sparc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -Xa -xstrconst -mt -D_FORTEC_ -xarch=v8',
+            'CC' => 'cc-5.0',
+            'CXXFLAGS' => '-g -xO3 -noex -mt -D_FORTEC_ -xarch=v8',
+            'CXX' => 'CC',
+            'ASFLAGS' => '-xarch=v8',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '--enable-assembler' => undef,
+            '--with-named-curses-libs' => '-lcurses',
+        },
+    },
+
+##############################################################################
+# linux-powerpc
+#
+    'linux-powerpc' => {
+        'env' => {
+            'CFLAGS' => '-g -O3 -mpowerpc -mcpu=powerpc',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -O3 -mpowerpc -mcpu=powerpc',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+        },
+    },
+
+##############################################################################
+# hpux11.11-hppa-32bit
+#
+    'hpux11.11-hppa-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g +O1 +DAportable',
+            'CC' => 'cc',
+            'CPPFLAGS' => '-DDEFAULT_THREAD_STACK=262144',
+            'CXXFLAGS' => '-g +O1 +DAportable -Aa',
+            'CXX' => 'aCC',
+            'INSTALL' => '/usr/local/bin/install',
+        },
+        'opt' => {
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# osx10.5-x86_64
+#
+    'osx10.5-x86_64' => {
+        'env' => {
+            'CFLAGS' => '-g -Os -arch x86_64 -fno-common',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -Os -arch x86_64 -felide-constructors -fno-common',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+        },
+    },
+
+##############################################################################
+# solaris10-x86
+#
+    'solaris10-x86' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -xlibmil -xlibmopt -xtarget=generic',
+            'CC' => 'cc',
+            'CXXFLAGS' => '-g -xO3 -mt -fsimple=1 -ftrap=%none -nofstore -xbuiltin=%all -features=no%except -xlibmil -xlibmopt -xtarget=generic',
+            'CXX' => 'CC',
+        },
+        'opt' => {
+            '--with-mysqld-libs' => '-lmtmalloc',
+            '--with-named-curses' => '-lcurses',
+        },
+    },
+
+##############################################################################
+# hpux11.31-hppa-64bit
+#
+    'hpux11.31-hppa-64bit' => {
+        'env' => {
+            'CFLAGS' => '+O2 +DD64',
+            'CC' => 'cc',
+            'LDFLAGS' => '+DD64',
+            'CXXFLAGS' => '+O2 +DD64 -Aa',
+            'CXX' => 'aCC',
+            'INSTALL' => '/usr/local/bin/install',
+        },
+        'opt' => {
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# osx10.5-powerpc-32bit
+#
+    'osx10.5-powerpc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -Os -arch ppc -fno-common',
+            'CC' => 'gcc -static-libgcc',
+            'LDFLAGS' => '-arch ppc',
+            'CXXFLAGS' => '-g -Os -arch ppc -felide-constructors -fno-common',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+        },
+    },
+
+##############################################################################
+# solaris9-sparc-32bit
+#
+    'solaris9-sparc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -Xa -xstrconst -mt -D_FORTEC_ -xarch=v8',
+            'CC' => 'cc-5.0',
+            'LDFLAGS' => '-xarch=v8',
+            'CXXFLAGS' => '-g -xO3 -noex -mt -D_FORTEC_ -xarch=v8',
+            'CXX' => 'CC',
+            'ASFLAGS' => '-xarch=v8',
+        },
+        'opt' => {
+            '--enable-assembler' => undef,
+            '--with-named-curses-libs' => '-lcurses',
+        },
+    },
+
+##############################################################################
+# solaris9-sparc-64bit
+#
+    'solaris9-sparc-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -Xa -xstrconst -mt -D_FORTEC_ -xarch=v9',
+            'CC' => 'cc-5.0',
+            'LDFLAGS' => '-xarch=v9',
+            'CXXFLAGS' => '-g -xO3 -noex -mt -D_FORTEC_ -xarch=v9',
+            'CXX' => 'CC',
+            'ASFLAGS' => '-xarch=v9',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+        },
+    },
+
+##############################################################################
+# linux-x86_64-icc
+#
+    'linux-x86_64-icc' => {
+        'env' => {
+            'CFLAGS' => '-g -O3 -mp -restrict',
+            'CC' => 'icc  -static-intel -static-libgcc',
+            'CXXFLAGS' => '-g -O3 -mp -restrict',
+            'CXX' => 'icpc -static-intel -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# hpux11.00-hppa-64bit
+#
+    'hpux11.00-hppa-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g +O2 +DD64',
+            'CC' => 'cc',
+            'LDFLAGS' => '+DD64',
+            'CXXFLAGS' => '-g +O2 +DD64 -Aa',
+            'CXX' => 'aCC',
+        },
+        'opt' => {
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# aix4.3-powerpc-32bit
+#
+    'aix4.3-powerpc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192',
+            'CC' => 'xlc_r',
+            'CXXFLAGS' => '-g -ma -O2 -qstrict -qoptimize=2 -qmaxmem=8192',
+            'CXX' => 'xlC_r',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# solaris8-sparc-32bit-gcc
+#
+    'solaris8-sparc-32bit-gcc' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -DHAVE_MYSYS_NEW',
+            'CC' => 'gcc',
+            'CXXFLAGS' => '-g -xO3 -DHAVE_MYSYS_NEW',
+            'CXX' => 'gcc',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '--enable-assembler' => undef,
+            '--with-named-curses-libs' => '-lcurses',
+        },
+    },
+
+##############################################################################
+# hpux11.23-ia64
+#
+    'hpux11.23-ia64' => {
+        'env' => {
+            'CFLAGS' => '-g +O2 +DD64 +DSitanium2 -mt -AC99 -DPTHREAD_COMPAT_MODE -O1',
+            'CC' => 'cc',
+            'LDFLAGS' => '+DD64',
+            'CXXFLAGS' => '-g +O2 +DD64 +DSitanium2 -mt -DPTHREAD_COMPAT_MODE -O1 -Aa',
+            'CXX' => 'aCC',
+        },
+        'opt' => {
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# linux-ia64-icc
+#
+    'linux-ia64-icc' => {
+        'env' => {
+            'CFLAGS' => '-g -O3 -mp -restrict -no-ftz',
+            'CC' => 'icc  -static-intel -static-libgcc',
+            'CXXFLAGS' => '-g -O3 -mp -restrict -no-ftz',
+            'CXX' => 'icpc -static-intel -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# linux-x86
+#
+    'linux-x86' => {
+        'env' => {
+            'CFLAGS' => '-g -O3',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -O3',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+            '--enable-assembler' => undef,
+        },
+    },
+
+##############################################################################
+# solaris8-sparc-64bit-gcc
+#
+    'solaris8-sparc-64bit-gcc' => {
+        'env' => {
+            'CFLAGS' => '-g -O -m64',
+            'CC' => 'gcc -static-libgcc',
+            'LDFLAGS' => '-m64',
+            'CXXFLAGS' => '-g -O3 -DHAVE_MYSYS_NEW -m64',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '--with-named-curses-libs' => '-lcurses',
+        },
+    },
+
+##############################################################################
+# freebsd6.0-x86_64
+#
+    'freebsd6.0-x86_64' => {
+        'env' => {
+            'CFLAGS' => '-g -O3',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-g -O3',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-machine-type' => 'x86_64',
+            '--enable-assembler' => undef,
+        },
+    },
+
+##############################################################################
+# hpux11.11-hppa-64bit
+#
+    'hpux11.11-hppa-64bit' => {
+        'env' => {
+            'CFLAGS' => '+O2 +DD64',
+            'CC' => 'cc',
+            'LDFLAGS' => '+DD64',
+            'CXXFLAGS' => '+O2 +DD64 -Aa',
+            'CXX' => 'aCC',
+            'INSTALL' => '/usr/local/bin/install',
+        },
+        'opt' => {
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# i5os-power-32bit
+#
+    'i5os-power-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -ma -qstrict -qoptimize=0 -qmaxmem=8192',
+            'CC' => 'xlc_r',
+            'LDFLAGS' => '-Wl,-brtl',
+            'CXXFLAGS' => '-g -ma -qstrict -qoptimize=0 -qmaxmem=8192',
+            'CXX' => 'xlC_r',
+        },
+        'opt' => {
+            '--with-machine-type' => 'power',
+            '--with-named-z-libs' => 'no',
+            '--build' => 'powerpc-ibm-aix5.3.0.0',
+            '--with-system-type' => 'ibm-i5os',
+            '--host' => 'powerpc-ibm-aix5.3.0.0',
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# solaris10-sparc-32bit
+#
+    'solaris10-sparc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -xO3 -Xa -xstrconst -mt -D_FORTEC_ -xarch=v8 -xc99=none',
+            'CC' => 'cc-5.0',
+            'LDFLAGS' => '-xarch=v8',
+            'CXXFLAGS' => '-g -xO3 -noex -mt -D_FORTEC_ -xarch=v8',
+            'CXX' => 'CC',
+            'ASFLAGS' => '-xarch=v8',
+        },
+        'opt' => {
+            '--with-mysqld-libs' => '-lmtmalloc',
+            '--with-named-z-libs' => 'no',
+        },
+    },
+
+##############################################################################
+# osx10.5-powerpc-64bit
+#
+    'osx10.5-powerpc-64bit' => {
+        'env' => {
+            'CFLAGS' => '-g -Os -arch ppc64 -fno-common',
+            'CC' => 'gcc -static-libgcc',
+            'LDFLAGS' => '-arch ppc64',
+            'CXXFLAGS' => '-g -Os -arch ppc64 -felide-constructors -fno-common',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+        },
+    },
+
+##############################################################################
+# linux-x86-valgrind
+#
+    'linux-x86-valgrind' => {
+        'env' => {
+            'CFLAGS' => '-O3 -g -fno-omit-frame-pointers -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify',
+            'CC' => 'gcc -static-libgcc',
+            'CXXFLAGS' => '-O3 -g -fno-omit-frame-pointers -USAFEMALLOC -UFORCE_INIT_OF_VARS -DHAVE_purify',
+            'CXX' => 'gcc -static-libgcc',
+        },
+        'opt' => {
+            '--with-fast-mutexes' => undef,
+        },
+    },
+
+##############################################################################
+# aix5.2-powerpc-32bit
+#
+    'aix5.2-powerpc-32bit' => {
+        'env' => {
+            'CFLAGS' => '-g -ma -qstrict -qoptimize=0 -qmaxmem=8192',
+            'CC' => 'xlc_r',
+            'LDFLAGS' => '-Wl,-brtl',
+            'CXXFLAGS' => '-g -ma -qstrict -qoptimize=0 -qmaxmem=8192',
+            'CXX' => 'xlC_r',
+        },
+        'opt' => {
+            '--with-named-z-libs' => 'no',
+            '---with-yassl' => undef,
+        },
+    },
+
+##############################################################################
+# windows-x86
+#
+    'windows-x86' => {
+	'env' => {
+        },
+        'opt' => {
+        },
+        'win' => {
+        },
+    },
+
+##############################################################################
+# windows-x86_64
+#
+    'windows-x86_64' => {
+	'env' => {
+        },
+        'opt' => {
+        },
+        'win' => {
+        },
+    },
+};
+
+##############################################################################
+# No configuration below this line.                                          #
+##############################################################################
+
+sub aggregate {
+    my ($config, $mod) = @_;
+    $config->{"env"} = {} unless defined $config->{"env"};
+    for my $key (keys %{$mod->{"env"}}) {
+        my $p = $mod->{"env"}->{$key};
+        my $parts = [];
+        if(ref($p)) {
+            $parts = $p;
+        } else {
+            $parts = [ split / +/, $p ];
+        }
+        my $mode = "replace";
+        if($key =~ /^\+/) {
+            $mode = "add";
+            $key = substr($key, 1);
+        } elsif($key =~ /^-/) {
+            $mode = "sub";
+            $key = substr($key, 1);
+        }
+        if($mode eq "replace") {
+            $config->{"env"}->{$key} = $parts;
+        } else {
+            if(!defined $config->{"env"}->{$key}) {
+                $config->{"env"}->{$key} = [];
+            }
+            my %tmp = ();
+            @tmp{@{$config->{"env"}->{$key}}} = ();
+            for my $val (@$parts) {
+                delete $tmp{$val};
+            }
+            $config->{"env"}->{$key} = [ sort keys %tmp ];
+            if($mode eq "add") {
+                for my $val (@$parts) {
+                    push @{$config->{"env"}->{$key}}, $val;
+                }
+            } 
+        }
+    }
+    $config->{"opt"} = {} unless defined $config->{"opt"};
+    for my $key (keys %{$mod->{"opt"}}) {
+        my $val = $mod->{"opt"}->{$key};
+        if($key =~ /^---/) {
+          delete $config->{"opt"}->{substr($key,1)};
+          next;
+        } elsif($key =~ /^--with-(.*)$/) {
+            delete $config->{"opt"}->{"--without-$1"};
+        } elsif($key =~ /^--without-(.*)$/) {
+            delete $config->{"opt"}->{"--with-$1"};
+        }
+        $config->{"opt"}->{$key} = $val;
+    }
+    $config->{"win"} = {} unless defined $config->{"win"};
+    for my $key (keys %{$mod->{"win"}}) {
+        my $val = $mod->{"win"}->{$key};
+        if($key =~ /^-/) {
+          delete $config->{"win"}->{substr($key,1)};
+          next;
+        }
+        $config->{"win"}->{$key} = $val;
+    }
+}
+
+sub create_configure_line {
+    my ($config, $vars) = @_;
+    my $ln = "";
+    if($vars->{"windows"}) {
+        $ln .= "cscript win/configure.js";
+        for my $win (sort keys %{$config->{"win"}}) {
+            $ln .= " ";
+            if(defined $config->{"win"}->{$win}) {
+                my $val = $config->{"win"}->{$win};
+                $ln .= "$win='$val'";
+            } else {
+                $ln .= "$win";
+            }
+        }
+        return $ln;
+    }
+    for my $var (sort keys %{$config->{"env"}}) {
+        $ln .= " " unless $ln eq "";
+        my $val = join " ", @{$config->{"env"}->{$var}};
+        $ln .= "$var='$val'";
+    }
+    $ln .= " " unless $ln eq "";
+    $ln .= "./configure";
+    for my $opt (sort keys %{$config->{"opt"}}) {
+        $ln .= " ";
+        if(defined $config->{"opt"}->{$opt}) {
+            my $val = $config->{"opt"}->{$opt};
+            $ln .= "$opt='$val'";
+        } else {
+            $ln .= "$opt";
+        }
+    }
+    return $ln;
+}
+
+sub print_config {
+    my ($config, $vars) = @_;
+    print "#\n# configuring for " . $config->{"platform"};
+    if($config->{"debug"}) {
+        print " (debug)";
+    }
+    print "\n#\n";
+    if($vars->{"windows"}) {
+        for my $win (sort keys %{$config->{"win"}}) {
+            if(defined $config->{"win"}->{$win}) {
+                my $val = $config->{"win"}->{$win};
+                print "# $win='$val'\n";
+            } else {
+                print "# $win\n";
+            }
+        }
+    } else {
+        for my $var (sort keys %{$config->{"env"}}) {
+            my $val = join " ", @{$config->{"env"}->{$var}};
+            print "# $var='$val'\n";
+        }
+        print "#\n";
+        for my $opt (sort keys %{$config->{"opt"}}) {
+            if(defined $config->{"opt"}->{$opt}) {
+                my $val = $config->{"opt"}->{$opt};
+                print "# $opt='$val'\n";
+            } else {
+                print "# $opt\n";
+            }
+        }
+    }
+    print "#\n";
+    print create_configure_line($config, $vars) . "\n";
+}
+
+##############################################################################
+
+return 1 unless @ARGV;
+
+my $vars = {
+    'debug' =>          0,
+    'ccache' =>         0,
+    'windows' =>        0,
+    'print' =>          0,
+    'configure' =>      0,
+    'list-platforms' => 0,
+    'platform' =>       "",
+    'list-products' =>  0,
+    'product' =>        "community",
+};
+
+while(@ARGV) {
+    my $arg = shift;
+    if($arg =~ /^--/) {
+        last if $arg eq "--";
+        my $var = substr($arg, 2);
+        if(defined $vars->{$var}) {
+            if($vars->{$var} =~ /^[0-9]+$/) {
+                $vars->{$var} += 1;
+            } else {
+                $vars->{$var} = shift;
+            }
+        } else {
+            print STDERR "unrecognized option: $arg\n";
+            exit 1;
+        }
+    }
+}
+
+if($vars->{"platform"} =~ /^windows-/) {
+    $vars->{"windows"} = 1;
+}
+
+my $pass_on = { "opt" => {}, "win" => {} };
+while(@ARGV) {
+    my $arg = shift;
+    my $val = undef;
+    if($arg =~ /^([-a-zA-Z-0-9_]+)=(.*)$/) {
+        $arg = $1;
+        $val = $2;
+    }
+    if($vars->{"windows"}) {
+        $pass_on->{"win"}->{$arg} = $val;
+    } else {
+        $pass_on->{"opt"}->{$arg} = $val;
+    }
+}
+
+if($vars->{"list-platforms"}) {
+    for my $name (sort keys %$platforms) {
+        print "$name\n";
+    }
+}
+if($vars->{"list-products"}) {
+    for my $name (sort keys %$products) {
+        print "$name\n";
+    }
+}
+
+if(!defined $platforms->{$vars->{"platform"}}) {
+    print STDERR "requested platform is unknown; please use --list-platforms to see available choices\n";
+    exit 1;
+}
+
+if(!defined $products->{$vars->{"product"}}) {
+    print STDERR "requested product is unknown; please use --list-products to see available choices\n";
+    exit 1;
+}
+
+my $config = $vars;
+aggregate($config, $default);
+aggregate($config, $products->{$vars->{"product"}});
+aggregate($config, $platforms->{$vars->{"platform"}});
+if($vars->{"debug"}) {
+    aggregate($config, $debug);
+}
+aggregate($config, $pass_on);
+if($vars->{"ccache"}) {
+    unshift @{$config->{"env"}->{"CC"}}, "ccache"; 
+    unshift @{$config->{"env"}->{"CXX"}}, "ccache"; 
+}
+
+if($vars->{"print"}) {
+    if($vars->{"platform"} eq "") {
+        print STDERR "please use --platform <platform name>\n";
+        exit 1;
+    }
+    print_config($config, $vars);
+}
+
+if($vars->{"configure"}) {
+    if($vars->{"platform"} eq "") {
+        print STDERR "please use --platform <platform name>\n";
+        exit 1;
+    }
+    system(create_configure_line($config, $vars));
+}
+

Thread
bzr commit into mysql-5.0 branch (df:2658) Daniel Fischer20 Oct