summaryrefslogtreecommitdiff
path: root/mysql_config.sh
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-09-18 04:46:53 +0000
committerCoprDistGit <infra@openeuler.org>2024-09-18 04:46:53 +0000
commitc3de9ab107904ba953ac676727ebd6463a0695bd (patch)
tree805dce8f7c74f043752c4b6227429a96aa7eb189 /mysql_config.sh
parent686bf31012f5b3be774231664efbd1b352755e52 (diff)
Diffstat (limited to 'mysql_config.sh')
-rw-r--r--mysql_config.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql_config.sh b/mysql_config.sh
new file mode 100644
index 0000000..05007f7
--- /dev/null
+++ b/mysql_config.sh
@@ -0,0 +1,36 @@
+#! /bin/bash
+#
+# Wrapper script for mysql_config to support multilib
+#
+#
+
+# This command respects setarch, works on OL6/RHEL6 and later
+isa_bits=$(rpm --eval %__isa_bits)
+
+case $bits in
+ 32|64) bits=$isa_bits ;;
+ *) bits=unknown ;;
+esac
+
+# Try mapping by uname if rpm command failed
+if [ "$bits" = "unknown" ] ; then
+ arch=$(uname -m)
+ case $arch in
+ x86_64|ppc64) bits=64 ;;
+ i386|i486|i586|i686|pentium3|pentium4|athlon|ppc) bits=32 ;;
+ *) bits=unknown ;;
+ esac
+fi
+
+if [ "$bits" == "unknown" ] ; then
+ echo "$0: error: failed to determine isa bits on your arch."
+ exit 1
+fi
+
+if [ -x /usr/bin/mysql_config-$bits ] ; then
+ /usr/bin/mysql_config-$bits "$@"
+else
+ echo "$0: error: needed binary: /usr/bin/mysql_config-$bits is missing. Please check your MySQL installation."
+ exit 1
+fi
+