mirror of
https://github.com/MariaDB/server.git
synced 2025-01-23 23:34:34 +01:00
2b9a8afa50
BitKeeper/etc/logging_ok: auto-union Build-tools/mysql-copyright-2: Auto merged include/violite.h: Auto merged innobase/btr/btr0btr.c: Auto merged innobase/buf/buf0buf.c: Auto merged innobase/buf/buf0flu.c: Auto merged innobase/buf/buf0lru.c: Auto merged innobase/dict/dict0dict.c: Auto merged innobase/dict/dict0mem.c: Auto merged innobase/fsp/fsp0fsp.c: Auto merged innobase/fut/fut0lst.c: Auto merged innobase/ha/hash0hash.c: Auto merged innobase/include/buf0buf.ic: Auto merged innobase/include/buf0lru.h: Auto merged innobase/include/data0data.h: Auto merged innobase/include/dict0dict.h: Auto merged innobase/include/dict0mem.h: Auto merged innobase/include/fsp0fsp.h: Auto merged innobase/include/hash0hash.h: Auto merged innobase/include/lock0lock.h: Auto merged innobase/include/log0log.h: Auto merged innobase/include/log0log.ic: Auto merged innobase/include/mem0dbg.ic: Auto merged innobase/include/mem0pool.h: Auto merged innobase/include/mtr0mtr.h: Auto merged innobase/include/sync0rw.h: Auto merged innobase/include/sync0sync.h: Auto merged innobase/include/trx0roll.h: Auto merged innobase/include/trx0trx.h: Auto merged innobase/include/ut0mem.h: Auto merged innobase/lock/lock0lock.c: Auto merged innobase/log/log0log.c: Auto merged innobase/mem/mem0dbg.c: Auto merged innobase/mem/mem0pool.c: Auto merged innobase/mtr/mtr0mtr.c: Auto merged innobase/pars/lexyy.c: Auto merged innobase/pars/pars0opt.c: Auto merged innobase/que/que0que.c: Auto merged innobase/rem/rem0cmp.c: Auto merged innobase/row/row0ins.c: Auto merged innobase/row/row0mysql.c: Auto merged innobase/row/row0upd.c: Auto merged innobase/srv/srv0srv.c: Auto merged innobase/srv/srv0start.c: Auto merged innobase/sync/sync0rw.c: Auto merged innobase/sync/sync0sync.c: Auto merged innobase/thr/thr0loc.c: Auto merged innobase/trx/trx0purge.c: Auto merged innobase/trx/trx0roll.c: Auto merged innobase/trx/trx0sys.c: Auto merged innobase/trx/trx0trx.c: Auto merged innobase/usr/usr0sess.c: Auto merged innobase/ut/ut0mem.c: Auto merged mysql-test/r/func_if.result: Auto merged mysql-test/r/type_date.result: Auto merged mysql-test/t/type_date.test: Auto merged mysql-test/t/type_decimal.test: Auto merged mysys/mf_tempfile.c: Auto merged netware/BUILD/nwbootstrap: Auto merged netware/Makefile.am: Auto merged scripts/mysqld_safe.sh: Auto merged sql/item_cmpfunc.cc: Auto merged mysql-test/t/func_if.test: Auto merged sql/mysqld.cc: Auto merged sql/opt_range.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_parse.cc: Auto merged support-files/my-innodb-heavy-4G.cnf.sh: Auto merged Build-tools/Do-compile: Merge with 4.0 Build-tools/mysql-copyright: Merge with 4.0 client/mysqltest.c: Merge with 4.0 include/my_global.h: Merge with 4.0 innobase/buf/buf0rea.c: Merge with 4.0 innobase/data/data0type.c: Merge with 4.0 innobase/ibuf/ibuf0ibuf.c: Merge with 4.0 innobase/include/buf0buf.h: Merge with 4.0 innobase/include/data0type.h: Merge with 4.0 innobase/include/mem0mem.h: Merge with 4.0 innobase/include/mem0mem.ic: Merge with 4.0 innobase/log/log0recv.c: Merge with 4.0 libmysql/libmysql.c: Merge with 4.0 libmysqld/Makefile.am: Merge with 4.0 mysql-test/r/range.result: Merge with 4.0 mysql-test/r/type_decimal.result: Merge with 4.0 mysql-test/t/range.test: Merge with 4.0 netware/BUILD/mwenv: Merge with 4.0 netware/mysql_test_run.c: Merge with 4.0 scripts/mysql_install_db.sh: Merge with 4.0 sql/field.cc: Merge with 4.0 sql/field.h: Merge with 4.0 sql/item_cmpfunc.h: Merge with 4.0 support-files/my-huge.cnf.sh: Merge with 4.0 support-files/my-large.cnf.sh: Merge with 4.0 support-files/my-medium.cnf.sh: Merge with 4.0 support-files/my-small.cnf.sh: Merge with 4.0 support-files/mysql.spec.sh: Merge with 4.0
195 lines
5 KiB
Bash
Executable file
195 lines
5 KiB
Bash
Executable file
#! /bin/sh
|
|
|
|
# debug
|
|
#set -x
|
|
|
|
# stop on errors
|
|
set -e
|
|
|
|
path=`dirname $0`
|
|
|
|
# repository direcotry
|
|
repo_dir=`pwd`
|
|
|
|
# build directory
|
|
build_dir="$HOME/mydev"
|
|
wine_build_dir="F:/mydev"
|
|
|
|
# doc directory
|
|
doc_dir="$repo_dir/../mysqldoc"
|
|
|
|
# init
|
|
target_dir=""
|
|
temp_dir=""
|
|
revision=""
|
|
rev=""
|
|
build=""
|
|
suffix=""
|
|
mwenv=""
|
|
|
|
# show usage
|
|
show_usage()
|
|
{
|
|
cat << EOF
|
|
|
|
usage: nwbootstrap [options]
|
|
|
|
Exports a revision of the BitKeeper tree (nwbootstrap must be run inside a
|
|
directory of the BitKeeper tree to be used). Creates the ChangeLog file.
|
|
Adds the latest manual.texi from the mysqldoc BitKeeper tree. Builds the
|
|
Linux tools required for cross-platform builds. Optionally, builds the
|
|
binary distributions for NetWare.
|
|
|
|
options:
|
|
|
|
--build=<opt> Build the binary distributions for NetWare,
|
|
where <opt> is "standard", "debug", or "all"
|
|
(default is to not build a binary distribution)
|
|
|
|
--build-dir=<dir> Export the BitKeeper tree to the <dir> directroy
|
|
(default is "$build_dir")
|
|
|
|
--doc-dir=<dir> Use the mysqldoc BitKeeper tree located in the
|
|
<dir> directory
|
|
(default is parallel to current BitKeeper tree)
|
|
|
|
--help Show this help information
|
|
|
|
--revision=<rev> Export the BitKeeper tree as of revision <rev>
|
|
(default is the latest revision)
|
|
|
|
--wine-build-dir=<dir> Use the WINE directory <dir>, which should
|
|
correspond to the --build-dir directory
|
|
(default is "$wine_build_dir")
|
|
|
|
examples:
|
|
|
|
nwbootstrap
|
|
|
|
nwbootstrap --revision=1.1594 --build=all
|
|
|
|
nwbootstrap --build-dir=/home/jdoe/dev --wine-build-dir=F:/dev
|
|
|
|
|
|
EOF
|
|
exit 0;
|
|
}
|
|
|
|
# parse arguments
|
|
for arg do
|
|
case "$arg" in
|
|
--build-dir=*) build_dir=`echo "$arg" | sed -e "s;--build-dir=;;"` ;;
|
|
--wine-build-dir=*) wine_build_dir=`echo "$arg" | sed -e "s;--wine-build-dir=;;"` ;;
|
|
--revision=*) revision=`echo "$arg" | sed -e "s;--revision=;;"` ;;
|
|
--build=*) build=`echo "$arg" | sed -e "s;--build=;;"` ;;
|
|
--suffix=*) suffix=`echo "$arg" | sed -e "s;--suffix=;;"` ;;
|
|
--doc-dir=*) doc_dir=`echo "$arg" | sed -e "s;--doc-dir=;;"` ;;
|
|
*) show_usage ;;
|
|
esac
|
|
done
|
|
|
|
echo "starting build..."
|
|
|
|
# check for bk and repo_dir
|
|
bk help > /dev/null
|
|
repo_dir=`bk root $repo_dir`
|
|
cd $repo_dir
|
|
doc_dir="$repo_dir/../mysqldoc"
|
|
|
|
# build temporary directory
|
|
temp_dir="$build_dir/mysql-$$.tmp"
|
|
|
|
# export the bk tree
|
|
command="bk export";
|
|
if test $revision; then command="$command -r$revision"; fi
|
|
command="$command $temp_dir"
|
|
echo "exporting $repo_dir..."
|
|
$command
|
|
|
|
# determine version
|
|
version=`grep -e "AM_INIT_AUTOMAKE(mysql, .*)" < $temp_dir/configure.in | sed -e "s/AM_INIT_AUTOMAKE(mysql, \(.*\))/\1/"`
|
|
echo "version: $version"
|
|
|
|
# build target directory
|
|
target_dir="$build_dir/mysql-$version"
|
|
|
|
# add suffix
|
|
if test $suffix
|
|
then
|
|
target_dir="$target_dir-$suffix"
|
|
fi
|
|
|
|
# delete any old target
|
|
if test -d $target_dir.old; then rm -rf $target_dir.old; fi
|
|
|
|
# rename old target
|
|
if test -d $target_dir; then mv -f $target_dir $target_dir.old; fi
|
|
|
|
# rename directory to use version
|
|
mv $temp_dir $target_dir
|
|
|
|
# create ChangeLog
|
|
if test $revision
|
|
then
|
|
rev=`bk changes -r..$revision -t -d':REV:' -n | head -2 | tail -1`
|
|
else
|
|
rev=`bk changes -t -d':REV:' -n | head -1`
|
|
fi
|
|
|
|
echo "creating ChangeLog..."
|
|
bk changes -v -r$rev..$revision > $target_dir/ChangeLog
|
|
|
|
# add the latest manual
|
|
if test -d $doc_dir
|
|
then
|
|
echo "adding the latest manual..."
|
|
install -m 644 $doc_dir/Docs/{manual,reservedwords}.texi $target_dir/Docs/
|
|
fi
|
|
|
|
# make files writeable
|
|
echo "making files writable..."
|
|
cd $target_dir
|
|
chmod -R u+rw,g+rw .
|
|
|
|
# edit the mvenv file
|
|
echo "updating the mwenv environment file..."
|
|
mwenv="./netware/BUILD/mwenv"
|
|
mv -f $mwenv $mwenv.org
|
|
sed -e "s;WINE_BUILD_DIR;$wine_build_dir;g" \
|
|
-e "s;BUILD_DIR;$build_dir;g" \
|
|
-e "s;VERSION;$version;g" $mwenv.org > $mwenv
|
|
chmod +rwx $mwenv
|
|
|
|
# edit the def file versions
|
|
echo "updating *.def file versions..."
|
|
nlm_version=`echo "$version" | sed -e "s;\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*;\1, \2, \3;"`
|
|
|
|
for file in ./netware/*.def
|
|
do
|
|
mv -f $file $file.org
|
|
sed -e "s;VERSION.*;VERSION $nlm_version;g" $file.org > $file
|
|
rm $file.org
|
|
done
|
|
|
|
# create the libmysql.imp file in netware folder from libmysql/libmysql.def
|
|
# file
|
|
echo "generating llibmysql.imp file..."
|
|
awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
|
|
|
|
# create the libmysql.imp file in netware folder from libmysql/libmysql.def file
|
|
echo "generating llibmysql.imp file..."
|
|
awk 'BEGIN{x=0;} x==1 {print $1;next} /EXPORTS/{x=1}' libmysql/libmysql.def > netware/libmysql.imp
|
|
|
|
|
|
# build linux tools
|
|
echo "compiling linux tools..."
|
|
./netware/BUILD/compile-linux-tools
|
|
|
|
# compile
|
|
if test $build
|
|
then
|
|
echo "compiling $build..."
|
|
./netware/BUILD/compile-netware-$build
|
|
fi
|
|
|
|
echo "done"
|