summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authormonty@hundin.mysql.fi <>2001-12-05 23:56:56 +0200
committermonty@hundin.mysql.fi <>2001-12-05 23:56:56 +0200
commit0f71e337b32c3388070f96160234df86eae964f8 (patch)
tree5a0aaea63377fc914c0392cf7adeadcac0391b3a /scripts
parent81ea1a6e1ab6332faa948612c6f6577223bfd723 (diff)
downloadmariadb-git-0f71e337b32c3388070f96160234df86eae964f8.tar.gz
Small changes to mysql_config.sh
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_config.sh28
1 files changed, 20 insertions, 8 deletions
diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh
index 05cc8632363..af11957576b 100644
--- a/scripts/mysql_config.sh
+++ b/scripts/mysql_config.sh
@@ -37,20 +37,32 @@ which ()
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 ()
{
- eval path=\$"$1"
- if [ ! -f "$path" ] ;
- then
- eval "$1"=$basedir/$2
- fi
+ 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 mysql_config`
+ me=`which $0`
fi
basedir=`echo $me | sed -e 's;/bin/mysql_config;;'`
@@ -59,9 +71,9 @@ ldata='@localstatedir@'
execdir='@libexecdir@'
bindir='@bindir@'
pkglibdir='@pkglibdir@'
-fix_path pkglibdir lib/mysql
+fix_path pkglibdir lib/mysql lib
pkgincludedir='@pkgincludedir@'
-fix_path pkgincludedir include/mysql
+fix_path pkgincludedir include/mysql include
version='@VERSION@'
socket='@MYSQL_UNIX_ADDR@'
port='@MYSQL_TCP_PORT@'