diff options
author | sasha@mysql.sashanet.com <> | 2001-12-01 19:37:30 -0700 |
---|---|---|
committer | sasha@mysql.sashanet.com <> | 2001-12-01 19:37:30 -0700 |
commit | 2f91f2360aba9ad0911af22de3a807837973d31c (patch) | |
tree | 84224b4256ca5cb7122155b30b6023bcd11658fe /scripts | |
parent | e57311045f772588ebac2ff313047506c94623f1 (diff) | |
download | mariadb-git-2f91f2360aba9ad0911af22de3a807837973d31c.tar.gz |
get correct paths in mysql_config even if the user moves basedir
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mysql_config.sh | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index ed344f4b1e3..05cc8632363 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -18,11 +18,50 @@ # 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" +} + +fix_path () +{ + eval path=\$"$1" + if [ ! -f "$path" ] ; + then + eval "$1"=$basedir/$2 + fi +} + +abs_path=`expr \( substr $0 1 1 \) = '/'` +if [ "x$abs_path" = "x1" ] ; then + me=$0 +else + me=`which mysql_config` +fi + +basedir=`echo $me | sed -e 's;/bin/mysql_config;;'` + ldata='@localstatedir@' execdir='@libexecdir@' bindir='@bindir@' pkglibdir='@pkglibdir@' +fix_path pkglibdir lib/mysql pkgincludedir='@pkgincludedir@' +fix_path pkgincludedir include/mysql version='@VERSION@' socket='@MYSQL_UNIX_ADDR@' port='@MYSQL_TCP_PORT@' |