diff options
author | Joerg Bruehe <joerg@mysql.com> | 2009-01-13 14:52:22 +0100 |
---|---|---|
committer | Joerg Bruehe <joerg@mysql.com> | 2009-01-13 14:52:22 +0100 |
commit | 1fc458230d18abd6145dec3ae89aefbd1f5e892a (patch) | |
tree | 1a837312a5473c5f85d10ed2d0b5c34a815bbf56 /bdb | |
parent | 4baf24267e50724dd08a1e8e52e1d2cd8805075c (diff) | |
download | mariadb-git-1fc458230d18abd6145dec3ae89aefbd1f5e892a.tar.gz |
Tool fix, needed for "compile-dist" to succeed on Solaris:
The default "awk" there cannot handle some of the scripts
which are used by BDB for configuration.
The fix:
1) Introduce a variable "AWK" in some of the BDB shell scripts,
2) search "gawk" and give it precedence over "awk"
when assigning a value to the "AWK" variable,
fail if neither is found,
3) use that variable when calling an "awk" program with one
of the critical scripts.
The perfect solution would be to use the "awk" program found
by "configure", but we cannot follow that approach because
BDB's configuration is handled as a special case before the
overall "configure" is run. Because of this,
1) the "configure" result isn't yet available,
2) "configure" will not handle these BDB files.
Searching "gawk" is a (not-so-nice) way out.
Note that all this need not be perfectly portable,
it is needed only when we create a source distribution tarball
from a develkopment tree.
bdb/dist/s_all:
Search "gawk" if available, give it precedence over "awk",
fail if neither is found.
bdb/dist/s_include:
Ensure we use a modern AWK, similar to GNU awk,
the default awk on Solaris cannot handle BDB's script.
bdb/dist/s_recover:
Ensure we use a modern AWK, similar to GNU awk,
the default awk on Solaris cannot handle BDB's script.
bdb/dist/s_rpc:
Ensure we use a modern AWK, similar to GNU awk,
the default awk on Solaris cannot handle BDB's script.
Diffstat (limited to 'bdb')
-rw-r--r-- | bdb/dist/s_all | 15 | ||||
-rwxr-xr-x | bdb/dist/s_include | 6 | ||||
-rwxr-xr-x | bdb/dist/s_recover | 2 | ||||
-rw-r--r-- | bdb/dist/s_rpc | 2 |
4 files changed, 20 insertions, 5 deletions
diff --git a/bdb/dist/s_all b/bdb/dist/s_all index 132017def3c..97ce572a4ae 100644 --- a/bdb/dist/s_all +++ b/bdb/dist/s_all @@ -1,6 +1,21 @@ #!/bin/sh - # $Id: s_all,v 1.10 2001/08/04 14:01:44 bostic Exp $ +# Search an AWK program, use GNU awk if available +for x in gawk awk ; do + if type $x; then + AWK=$x + break + fi +done + +if test -z "$AWK"; then + echo 'No AWK program found' + exit 1 +fi +export AWK +# end of AWK search + sh s_dir #sh s_perm # permissions. diff --git a/bdb/dist/s_include b/bdb/dist/s_include index 878b4a38af1..5cb3a666dc0 100755 --- a/bdb/dist/s_include +++ b/bdb/dist/s_include @@ -79,7 +79,7 @@ for i in db btree clib common dbreg env fileops hash hmac \ [ $i = os ] && f="$f ../os_win32/*.c" [ $i = rpc_server ] && f="../$i/c/*.c" [ $i = crypto ] && f="../$i/*.c ../$i/*/*.c" - awk -f gen_inc.awk \ + $AWK -f gen_inc.awk \ -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \ -v e_dfile=$e_dfile \ -v e_pfile=$e_pfile \ @@ -97,7 +97,7 @@ done # files. for i in dbm hsearch; do f="../$i/*.c" - awk -f gen_inc.awk \ + $AWK -f gen_inc.awk \ -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \ -v e_dfile=$e_dfile \ -v e_pfile=$e_pfile \ @@ -142,7 +142,7 @@ head space defonly _DB_EXT_185_DEF_IN_ > $e_dfile head space _DB_EXT_185_PROT_IN_ > $e_pfile f="../db185/*.c" -awk -f gen_inc.awk \ +$AWK -f gen_inc.awk \ -v db_version_unique_name=$DB_VERSION_UNIQUE_NAME \ -v e_dfile=$e_dfile \ -v e_pfile=$e_pfile \ diff --git a/bdb/dist/s_recover b/bdb/dist/s_recover index fc2e160c083..f6d2ad33e5a 100755 --- a/bdb/dist/s_recover +++ b/bdb/dist/s_recover @@ -45,7 +45,7 @@ cmp $loglist $f > /dev/null 2>&1 || for i in db dbreg btree fileops hash qam txn; do for f in ../$i/*.src; do subsystem=`basename $f .src` - awk -f gen_rec.awk \ + $AWK -f gen_rec.awk \ -v source_file=$source \ -v header_file=$header \ -v template_file=$template < $f diff --git a/bdb/dist/s_rpc b/bdb/dist/s_rpc index cdafa669d85..f9495ec121f 100644 --- a/bdb/dist/s_rpc +++ b/bdb/dist/s_rpc @@ -43,7 +43,7 @@ rm -f $client_file \ xidsize=\ `awk '/^#define/ { if ($2 == "DB_XIDDATASIZE") { print $3 }}' $dbinc_file` -awk -f gen_rpc.awk \ +$AWK -f gen_rpc.awk \ -v major=$DB_VERSION_MAJOR \ -v minor=$DB_VERSION_MINOR \ -v xidsize=$xidsize \ |