diff options
author | monty@hundin.mysql.fi <> | 2001-12-06 01:16:28 +0200 |
---|---|---|
committer | monty@hundin.mysql.fi <> | 2001-12-06 01:16:28 +0200 |
commit | 5c94a164225593586ae0fe5229917a0e8a283250 (patch) | |
tree | 72b6ce45de206772ff694d62b41d9fc5a16edbe8 /scripts/mysql_config.sh | |
parent | 4c17825acd56ccbbf7e6649e7ebe98c34f992c84 (diff) | |
parent | 0f71e337b32c3388070f96160234df86eae964f8 (diff) | |
download | mariadb-git-5c94a164225593586ae0fe5229917a0e8a283250.tar.gz |
merge with 3.23.47
Diffstat (limited to 'scripts/mysql_config.sh')
-rw-r--r-- | scripts/mysql_config.sh | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index b2a09173760..31e3ed42e0a 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -18,11 +18,62 @@ # This script reports various configuration settings that may be needed # when using the MySQL client library. +which () +{ + IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' + for file + do + for dir in $PATH + do + if test -f $dir/$file + then + echo "$dir/$file" + continue 2 + fi + done + echo "which: no $file in ($PATH)" + exit 1 + done + IFS="$save_ifs" +} + +# +# If we can find the given directory relatively to where mysql_config is +# we should use this instead of the incompiled one. +# This is to ensure that this script also works with the binary MySQL +# version + +fix_path () +{ + var=$1 + shift + for filename + do + path=$basedir/$filename + if [ -d "$path" ] ; + then + eval "$var"=$path + return + fi + done +} + +abs_path=`expr \( substr $0 1 1 \) = '/'` +if [ "x$abs_path" = "x1" ] ; then + me=$0 +else + me=`which $0` +fi + +basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` + ldata='@localstatedir@' execdir='@libexecdir@' bindir='@bindir@' pkglibdir='@pkglibdir@' +fix_path pkglibdir lib/mysql lib pkgincludedir='@pkgincludedir@' +fix_path pkgincludedir include/mysql include version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' |