summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_install_db.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh
index 0afbca87c20..1479ffc0443 100644
--- a/scripts/mysql_install_db.sh
+++ b/scripts/mysql_install_db.sh
@@ -273,9 +273,16 @@ then
fi
if test -n "$srcdir"
then
+ # In an out-of-source build, builddir is not srcdir. Try to guess where
+ # builddir is by looking for my_print_defaults.
if test -z "$builddir"
then
- builddir="$srcdir"
+ if test -x "$dirname0/extra/my_print_defaults"
+ then
+ builddir="$dirname0"
+ else
+ builddir="$srcdir"
+ fi
fi
print_defaults="$builddir/extra/my_print_defaults"
elif test -n "$basedir"