switched ax_lib_mysql.m4 to ax_lib_mariadb.m4 and made it mariadb specific

This commit is contained in:
2020-11-04 07:46:07 +00:00
parent debe2f8939
commit 088ea05e7b
11 changed files with 301 additions and 330 deletions

186
mio/configure vendored
View File

@ -644,11 +644,11 @@ PACKAGE_VERSION_PATCH
PACKAGE_VERSION_MINOR
PACKAGE_VERSION_MAJOR
QUADMATH_LIBS
MYSQL_LIBS
MYSQL_LDFLAGS
MYSQL_CFLAGS
MYSQL_VERSION
MYSQL_CONFIG
MARIADB_LIBS
MARIADB_LDFLAGS
MARIADB_CFLAGS
MARIADB_VERSION
MARIADB_CONFIG
UNWIND_LIBS
ENABLE_MARIADB_FALSE
ENABLE_MARIADB_TRUE
@ -797,7 +797,7 @@ enable_libtool_lock
enable_largefile
enable_ssl
enable_mariadb
with_mysql
with_mariadb
enable_debug
enable_wide_char
enable_libunwind
@ -1463,8 +1463,8 @@ Optional Packages:
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot[=DIR] Search for dependent libraries within DIR (or the
compiler's sysroot if not specified).
--with-mysql[=ARG] use MySQL client library [default=no], optionally
specify path to mysql_config
--with-mariadb-config[=PATH]
specify path to the mariadb_config utility
Some influential environment variables:
CC C compiler command
@ -15741,47 +15741,36 @@ fi
fi
MYSQL_CONFIG="no"
MARIADB_CONFIG=""
# Check whether --with-mysql was given.
if test "${with_mysql+set}" = set; then :
withval=$with_mysql;
if test "$withval" = "no"; then
want_mysql="no"
elif test "$withval" = "yes"; then
want_mysql="yes"
else
want_mysql="yes"
MYSQL_CONFIG="$withval"
fi
# Check whether --with-mariadb was given.
if test "${with_mariadb+set}" = set; then :
withval=$with_mariadb; MARIADB_CONFIG="$withval"
else
want_mysql="no"
MARIADB_CONFIG=""
fi
MYSQL_CFLAGS=""
MYSQL_LDFLAGS=""
MYSQL_LIBS=""
MYSQL_VERSION=""
MARIADB_CFLAGS=""
MARIADB_LDFLAGS=""
MARIADB_LIBS=""
MARIADB_VERSION=""
if test "$want_mysql" = "yes"; then
for ac_prog in mysql_config mariadb_config
for ac_prog in mariadb_config
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_MYSQL_CONFIG+:} false; then :
if ${ac_cv_path_MARIADB_CONFIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $MYSQL_CONFIG in
case $MARIADB_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_MYSQL_CONFIG="$MYSQL_CONFIG" # Let the user override the test with a path.
ac_cv_path_MARIADB_CONFIG="$MARIADB_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@ -15791,7 +15780,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_MYSQL_CONFIG="$as_dir/$ac_word$ac_exec_ext"
ac_cv_path_MARIADB_CONFIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@ -15802,35 +15791,35 @@ IFS=$as_save_IFS
;;
esac
fi
MYSQL_CONFIG=$ac_cv_path_MYSQL_CONFIG
if test -n "$MYSQL_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MYSQL_CONFIG" >&5
$as_echo "$MYSQL_CONFIG" >&6; }
MARIADB_CONFIG=$ac_cv_path_MARIADB_CONFIG
if test -n "$MARIADB_CONFIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MARIADB_CONFIG" >&5
$as_echo "$MARIADB_CONFIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$MYSQL_CONFIG" && break
test -n "$MARIADB_CONFIG" && break
done
if test -x "$MYSQL_CONFIG"; then
MYSQL_CFLAGS="`$MYSQL_CONFIG --cflags`"
_full_libmysql_libs="`$MYSQL_CONFIG --libs`"
if test -x "$MARIADB_CONFIG"; then
MARIADB_CFLAGS="`$MARIADB_CONFIG --cflags`"
_full_libmariadb_libs="`$MARIADB_CONFIG --libs`"
_save_mysql_ldflags="${LDFLAGS}"
_save_mysql_cflags="${CFLAGS}"
LDFLAGS="${LDFLAGS} ${_full_libmysql_libs}"
CFLAGS="${CFLAGS} ${MYSQL_CFLAGS}"
_save_mariadb_ldflags="${LDFLAGS}"
_save_mariadb_cflags="${CFLAGS}"
LDFLAGS="${LDFLAGS} ${_full_libmariadb_libs}"
CFLAGS="${CFLAGS} ${MARIADB_CFLAGS}"
for i in $_full_libmysql_libs; do
case $i in
-lmysqlclient|-lperconaserverclient|-lmariadbclient|-lmariadb)
for i in $_full_libmariadb_libs; do
case $i in
-lmariadb|-lperconaserverclient)
_lib_name="`echo "$i" | cut -b3-`"
as_ac_Lib=`$as_echo "ac_cv_lib_$_lib_name''_main" | $as_tr_sh`
_lib_name="`echo "$i" | cut -b3-`"
as_ac_Lib=`$as_echo "ac_cv_lib_$_lib_name''_main" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$_lib_name" >&5
$as_echo_n "checking for main in -l$_lib_name... " >&6; }
if eval \${$as_ac_Lib+:} false; then :
@ -15864,27 +15853,27 @@ eval ac_res=\$$as_ac_Lib
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
MYSQL_LIBS="-l${_lib_name} ${MYSQL_LIBS}"
MARIADB_LIBS="-l${_lib_name} ${MARIADB_LIBS}"
else
as_fn_error $? "Not found $_lib_name library" "$LINENO" 5
as_fn_error $? "Not found $_lib_name library" "$LINENO" 5
fi
;;
-L*)
;;
-L*)
MYSQL_LDFLAGS="${MYSQL_LDFLAGS} $i"
;;
-R*)
MARIADB_LDFLAGS="${MARIADB_LDFLAGS} $i"
;;
-R*)
MYSQL_LDFLAGS="${MYSQL_LDFLAGS} -Wl,$i"
;;
-l*)
MARIADB_LDFLAGS="${MARIADB_LDFLAGS} -Wl,$i"
;;
-l*)
_lib_name="`echo "$i" | cut -b3-`"
as_ac_Lib=`$as_echo "ac_cv_lib_$_lib_name''_main" | $as_tr_sh`
_lib_name="`echo "$i" | cut -b3-`"
as_ac_Lib=`$as_echo "ac_cv_lib_$_lib_name''_main" | $as_tr_sh`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -l$_lib_name" >&5
$as_echo_n "checking for main in -l$_lib_name... " >&6; }
if eval \${$as_ac_Lib+:} false; then :
@ -15918,67 +15907,66 @@ eval ac_res=\$$as_ac_Lib
$as_echo "$ac_res" >&6; }
if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then :
MYSQL_LIBS="${MYSQL_LIBS} ${i}"
MARIADB_LIBS="${MARIADB_LIBS} ${i}"
else
as_fn_error $? "Not found $i library" "$LINENO" 5
as_fn_error $? "Not found $i library" "$LINENO" 5
fi
;;
esac
done
;;
esac
done
LDFLAGS="${_save_mysql_ldflags}"
CFLAGS="${_save_mysql_cflags}"
unset _save_mysql_ldflags
unset _save_mysql_cflags
LDFLAGS="${_save_mariadb_ldflags}"
CFLAGS="${_save_mariadb_cflags}"
unset _save_mariadb_ldflags
unset _save_mariadb_cflags
MYSQL_VERSION=`$MYSQL_CONFIG --version`
MARIADB_VERSION=`$MARIADB_CONFIG --version`
$as_echo "#define HAVE_MYSQL 1" >>confdefs.h
$as_echo "#define HAVE_MARIADB 1" >>confdefs.h
found_mysql="yes"
else
found_mysql="no"
fi
found_mariadb="yes"
else
found_mariadb="no"
fi
mysql_version_req=
mariadb_version_req=
if test "$found_mysql" = "yes" -a -n "$mysql_version_req"; then
if test "$found_mariadb" = "yes" -a -n "$mariadb_version_req"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if MySQL version is >= $mysql_version_req" >&5
$as_echo_n "checking if MySQL version is >= $mysql_version_req... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if MariaDB version is >= $mariadb_version_req" >&5
$as_echo_n "checking if MariaDB version is >= $mariadb_version_req... " >&6; }
mysql_version_req_major=`expr $mysql_version_req : '\([0-9]*\)'`
mysql_version_req_minor=`expr $mysql_version_req : '[0-9]*\.\([0-9]*\)'`
mysql_version_req_micro=`expr $mysql_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
if test "x$mysql_version_req_micro" = "x"; then
mysql_version_req_micro="0"
mariadb_version_req_major=`expr $mariadb_version_req : '\([0-9]*\)'`
mariadb_version_req_minor=`expr $mariadb_version_req : '[0-9]*\.\([0-9]*\)'`
mariadb_version_req_micro=`expr $mariadb_version_req : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
if test "x$mariadb_version_req_micro" = "x"; then
mariadb_version_req_micro="0"
fi
mysql_version_req_number=`expr $mysql_version_req_major \* 1000000 \
\+ $mysql_version_req_minor \* 1000 \
\+ $mysql_version_req_micro`
mariadb_version_req_number=`expr $mariadb_version_req_major \* 1000000 \
\+ $mariadb_version_req_minor \* 1000 \
\+ $mariadb_version_req_micro`
mysql_version_major=`expr $MYSQL_VERSION : '\([0-9]*\)'`
mysql_version_minor=`expr $MYSQL_VERSION : '[0-9]*\.\([0-9]*\)'`
mysql_version_micro=`expr $MYSQL_VERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
if test "x$mysql_version_micro" = "x"; then
mysql_version_micro="0"
mariadb_version_major=`expr $MARIADB_VERSION : '\([0-9]*\)'`
mariadb_version_minor=`expr $MARIADB_VERSION : '[0-9]*\.\([0-9]*\)'`
mariadb_version_micro=`expr $MARIADB_VERSION : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
if test "x$mariadb_version_micro" = "x"; then
mariadb_version_micro="0"
fi
mysql_version_number=`expr $mysql_version_major \* 1000000 \
\+ $mysql_version_minor \* 1000 \
\+ $mysql_version_micro`
mariadb_version_number=`expr $mariadb_version_major \* 1000000 \
\+ $mariadb_version_minor \* 1000 \
\+ $mariadb_version_micro`
mysql_version_check=`expr $mysql_version_number \>\= $mysql_version_req_number`
if test "$mysql_version_check" = "1"; then
mariadb_version_check=`expr $mariadb_version_number \>\= $mariadb_version_req_number`
if test "$mariadb_version_check" = "1"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else