ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-for ac_prog in mariadb_config mysql_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
-
if test "x$MYSQL_CONFIG" != "x"; then
mysql_libs="$(${MYSQL_CONFIG} --libs_r)"
old_LIBS="$LIBS"
LIBS="$mysql_libs $LIBS"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient_r (using ${MYSQL_CONFIG})" >&5
-printf %s "checking for mysql_init in -lmysqlclient_r (using ${MYSQL_CONFIG})... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_get_socket in -lmysqlclient_r (using ${MYSQL_CONFIG})" >&5
+printf %s "checking for mysql_get_socket in -lmysqlclient_r (using ${MYSQL_CONFIG})... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __cplusplus
extern "C"
#endif
-char mysql_init (void);
+char mysql_get_socket (void);
int
main (void)
{
-return mysql_init ();
+return mysql_get_socket ();
;
return 0;
}
old_LIBS="$LIBS"
LIBS="$mysql_libs $LIBS"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient (using ${MYSQL_CONFIG})" >&5
-printf %s "checking for mysql_init in -lmysqlclient (using ${MYSQL_CONFIG})... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_get_socket in -lmysqlclient (using ${MYSQL_CONFIG})" >&5
+printf %s "checking for mysql_get_socket in -lmysqlclient (using ${MYSQL_CONFIG})... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __cplusplus
extern "C"
#endif
-char mysql_init (void);
+char mysql_get_socket (void);
int
main (void)
{
-return mysql_init ();
+return mysql_get_socket ();
;
return 0;
}
fi
fi
-if test "x$have_a_libmysqlclient" != "xyes"; then
- smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
-
-
-sm_lib_safe=`echo "mysqlclient_r" | sed 'y%./+-%__p_%'`
-sm_func_safe=`echo "mysql_init" | sed 'y%./+-%__p_%'`
-
-if test "xmysql-client" = "x"; then
- sm_pkg="${sm_lib_safe}"
-else
- sm_pkg="mysql-client"
-fi
-
-old_LIBS="$LIBS"
-old_CPPFLAGS="$CPPFLAGS"
-smart_lib=
-smart_ldflags=
-smart_lib_dir="/usr/local/lib /opt/lib /usr/local/${sm_pkg}/lib /opt/homebrew/lib /opt/homebrew/opt/${sm_pkg}/lib"
-
-if test "x$smart_try_dir" != "x"; then
-for try in $smart_try_dir; do
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient_r in $try" >&5
-printf %s "checking for mysql_init in -lmysqlclient_r in $try... " >&6; }
- LIBS="-lmysqlclient_r $old_LIBS"
- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-extern char mysql_init();
-int
-main (void)
-{
-mysql_init()
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
-
- smart_lib="-lmysqlclient_r"
- smart_ldflags="-L$try -Wl,-rpath,$try"
- smart_ld_found="$try"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
- break
-
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; } ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-done
-LIBS="$old_LIBS"
-CPPFLAGS="$old_CPPFLAGS"
-fi
-
-if test "x$smart_lib" = "x"; then
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient_r" >&5
-printf %s "checking for mysql_init in -lmysqlclient_r... " >&6; }
-LIBS="-lmysqlclient_r $old_LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-extern char mysql_init();
-int
-main (void)
-{
-mysql_init()
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
-
- smart_lib="-lmysqlclient_r"
- smart_ld_found=""
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
-
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; } ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS="$old_LIBS"
-fi
-
-if test "x$smart_lib" = "x"; then
-for try in $smart_lib_dir; do
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient_r in $try" >&5
-printf %s "checking for mysql_init in -lmysqlclient_r in $try... " >&6; }
- LIBS="-lmysqlclient_r $old_LIBS"
- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-extern char mysql_init();
-int
-main (void)
-{
-mysql_init()
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
-
- smart_lib="-lmysqlclient_r"
- smart_ldflags="-L$try -Wl,-rpath,$try"
- smart_ld_found="$try"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
- break
-
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; } ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-done
-LIBS="$old_LIBS"
-CPPFLAGS="$old_CPPFLAGS"
-fi
-
-if test "x$smart_lib" != "x"; then
-eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-LIBS="$smart_ldflags $smart_lib $old_LIBS"
-SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS"
-SMART_LD_FOUND="$smart_ld_found"
-fi
-
- if test "x$ac_cv_lib_mysqlclient_r_mysql_init" = "xyes"; then
- have_a_libmysqlclient='yes'
- fi
-fi
-
-if test "x$have_a_libmysqlclient" != "xyes"; then
- smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
-
-
-sm_lib_safe=`echo "mysqlclient" | sed 'y%./+-%__p_%'`
-sm_func_safe=`echo "mysql_init" | sed 'y%./+-%__p_%'`
-
-if test "xmysql-client" = "x"; then
- sm_pkg="${sm_lib_safe}"
-else
- sm_pkg="mysql-client"
-fi
-
-old_LIBS="$LIBS"
-old_CPPFLAGS="$CPPFLAGS"
-smart_lib=
-smart_ldflags=
-smart_lib_dir="/usr/local/lib /opt/lib /usr/local/${sm_pkg}/lib /opt/homebrew/lib /opt/homebrew/opt/${sm_pkg}/lib"
-
-if test "x$smart_try_dir" != "x"; then
-for try in $smart_try_dir; do
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient in $try" >&5
-printf %s "checking for mysql_init in -lmysqlclient in $try... " >&6; }
- LIBS="-lmysqlclient $old_LIBS"
- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-extern char mysql_init();
-int
-main (void)
-{
-mysql_init()
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
-
- smart_lib="-lmysqlclient"
- smart_ldflags="-L$try -Wl,-rpath,$try"
- smart_ld_found="$try"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
- break
-
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; } ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-done
-LIBS="$old_LIBS"
-CPPFLAGS="$old_CPPFLAGS"
-fi
-
-if test "x$smart_lib" = "x"; then
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient" >&5
-printf %s "checking for mysql_init in -lmysqlclient... " >&6; }
-LIBS="-lmysqlclient $old_LIBS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-extern char mysql_init();
-int
-main (void)
-{
-mysql_init()
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
-
- smart_lib="-lmysqlclient"
- smart_ld_found=""
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
-
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; } ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS="$old_LIBS"
-fi
-
-if test "x$smart_lib" = "x"; then
-for try in $smart_lib_dir; do
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmysqlclient in $try" >&5
-printf %s "checking for mysql_init in -lmysqlclient in $try... " >&6; }
- LIBS="-lmysqlclient $old_LIBS"
- CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-extern char mysql_init();
-int
-main (void)
-{
-mysql_init()
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
-
- smart_lib="-lmysqlclient"
- smart_ldflags="-L$try -Wl,-rpath,$try"
- smart_ld_found="$try"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-printf "%s\n" "yes" >&6; }
- break
-
-else case e in #(
- e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; } ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-done
-LIBS="$old_LIBS"
-CPPFLAGS="$old_CPPFLAGS"
-fi
-
-if test "x$smart_lib" != "x"; then
-eval "ac_cv_lib_${sm_lib_safe}_${sm_func_safe}=yes"
-LIBS="$smart_ldflags $smart_lib $old_LIBS"
-SMART_LIBS="$smart_ldflags $smart_lib $SMART_LIBS"
-SMART_LD_FOUND="$smart_ld_found"
-fi
-
- if test "x$ac_cv_lib_mysqlclient_mysql_init" = "xyes"; then
- have_a_libmysqlclient='yes'
- fi
-fi
-
if test "x$have_a_libmysqlclient" != "xyes"; then
smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mariadb /usr/local/lib/mariadb /usr/local/mariadb/lib/mariadb"
sm_lib_safe=`echo "mariadb" | sed 'y%./+-%__p_%'`
-sm_func_safe=`echo "mysql_init" | sed 'y%./+-%__p_%'`
+sm_func_safe=`echo "mysql_get_socket" | sed 'y%./+-%__p_%'`
if test "xmysql-client" = "x"; then
sm_pkg="${sm_lib_safe}"
if test "x$smart_try_dir" != "x"; then
for try in $smart_try_dir; do
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmariadb in $try" >&5
-printf %s "checking for mysql_init in -lmariadb in $try... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_get_socket in -lmariadb in $try" >&5
+printf %s "checking for mysql_get_socket in -lmariadb in $try... " >&6; }
LIBS="-lmariadb $old_LIBS"
CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-extern char mysql_init();
+extern char mysql_get_socket();
int
main (void)
{
-mysql_init()
+mysql_get_socket()
;
return 0;
}
fi
if test "x$smart_lib" = "x"; then
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmariadb" >&5
-printf %s "checking for mysql_init in -lmariadb... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_get_socket in -lmariadb" >&5
+printf %s "checking for mysql_get_socket in -lmariadb... " >&6; }
LIBS="-lmariadb $old_LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-extern char mysql_init();
+extern char mysql_get_socket();
int
main (void)
{
-mysql_init()
+mysql_get_socket()
;
return 0;
}
if test "x$smart_lib" = "x"; then
for try in $smart_lib_dir; do
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_init in -lmariadb in $try" >&5
-printf %s "checking for mysql_init in -lmariadb in $try... " >&6; }
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mysql_get_socket in -lmariadb in $try" >&5
+printf %s "checking for mysql_get_socket in -lmariadb in $try... " >&6; }
LIBS="-lmariadb $old_LIBS"
CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-extern char mysql_init();
+extern char mysql_get_socket();
int
main (void)
{
-mysql_init()
+mysql_get_socket()
;
return 0;
}
SMART_LD_FOUND="$smart_ld_found"
fi
- if test "x$ac_cv_lib_mysqlclient_mysql_init" = "xyes"; then
+ if test "x$ac_cv_lib_mysqlclient_mysql_get_socket" = "xyes"; then
have_a_libmysqlclient='yes'
fi
fi
if test "x$have_a_libmysqlclient" != "xyes"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: MySQL libraries not found. Use --with-mysql-lib-dir=<path>." >&5
-printf "%s\n" "$as_me: WARNING: MySQL libraries not found. Use --with-mysql-lib-dir=<path>." >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: MariaDB libraries not found. Use --with-mysql-lib-dir=<path>." >&5
+printf "%s\n" "$as_me: WARNING: MariaDB libraries not found. Use --with-mysql-lib-dir=<path>." >&2;}
-fail="$fail libmariadb || libmysqlclient || libmysqlclient_r"
+fail="$fail libmariadb"
fi
printf "%s\n" "#define HAVE_MYSQL_MYSQL_H /**/" >>confdefs.h
else
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: MySQL headers not found. Use --with-mysql-include-dir=<path>." >&5
-printf "%s\n" "$as_me: WARNING: MySQL headers not found. Use --with-mysql-include-dir=<path>." >&2;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: MariaDB headers not found. Use --with-mysql-include-dir=<path>." >&5
+printf "%s\n" "$as_me: WARNING: MariaDB headers not found. Use --with-mysql-include-dir=<path>." >&2;}
fail="$fail mysql.h"
dnl ############################################################
AC_PROG_CC
-AC_CHECK_PROGS(MYSQL_CONFIG, [ mariadb_config mysql_config ])
+AC_CHECK_PROGS(MYSQL_CONFIG, [ mariadb_config ])
dnl ############################################################
dnl # Check for libraries
dnl ############################################################
-dnl # Older versions of mysqlclient packages had two variants libmysqlclient
-dnl # and libmysqlclient_r. libmysqlclient_r is the threadsafe variant that
-dnl # is per-connection threadsafe. If that is available on the system it
-dnl # should be used in preference to libmysqlclient.
-dnl # More recent versions >~ 5.6 have stopped including libmyqlclient_r
-dnl # however (as libmysqlclient is now threadsafe), so we should fall back
-dnl # to libmysqlclient if it is the only one available on the system.
-
dnl # Use linker arguments from mysql_config if available, then fallback
dnl # to hunting around if we can't find the client library.
if test "x$MYSQL_CONFIG" != "x"; then
LIBS="$mysql_libs $LIBS"
dnl # First check for libmysqlclient_r
- AC_MSG_CHECKING([for mysql_init in -lmysqlclient_r (using ${MYSQL_CONFIG})])
- AC_TRY_LINK_FUNC([mysql_init], [have_libmysqlclient_r=yes])
+ AC_MSG_CHECKING([for mysql_get_socket in -lmysqlclient_r (using ${MYSQL_CONFIG})])
+ AC_TRY_LINK_FUNC([mysql_get_socket], [have_libmysqlclient_r=yes])
LIBS="$old_LIBS"
if test "x$have_libmysqlclient_r" = "xyes"; then
old_LIBS="$LIBS"
LIBS="$mysql_libs $LIBS"
- AC_MSG_CHECKING([for mysql_init in -lmysqlclient (using ${MYSQL_CONFIG})])
- AC_TRY_LINK_FUNC([mysql_init], [have_libmysqlclient=yes])
+ AC_MSG_CHECKING([for mysql_get_socket in -lmysqlclient (using ${MYSQL_CONFIG})])
+ AC_TRY_LINK_FUNC([mysql_get_socket], [have_libmysqlclient=yes])
LIBS="$old_LIBS"
if test "x$have_libmysqlclient" = "xyes"; then
fi
fi
-dnl # Check for libmysqlclient_r
-if test "x$have_a_libmysqlclient" != "xyes"; then
- smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
- FR_SMART_CHECK_LIB(mysqlclient_r, mysql_init, [mysql-client])
- if test "x$ac_cv_lib_mysqlclient_r_mysql_init" = "xyes"; then
- have_a_libmysqlclient='yes'
- fi
-fi
-
-dnl # Check for libmysqlclient
-if test "x$have_a_libmysqlclient" != "xyes"; then
- smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
- FR_SMART_CHECK_LIB(mysqlclient, mysql_init, [mysql-client])
- if test "x$ac_cv_lib_mysqlclient_mysql_init" = "xyes"; then
- have_a_libmysqlclient='yes'
- fi
-fi
-
dnl # Check for libmariadb
if test "x$have_a_libmysqlclient" != "xyes"; then
smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mariadb /usr/local/lib/mariadb /usr/local/mariadb/lib/mariadb"
- FR_SMART_CHECK_LIB(mariadb, mysql_init, [mysql-client])
- if test "x$ac_cv_lib_mysqlclient_mysql_init" = "xyes"; then
+ FR_SMART_CHECK_LIB(mariadb, mysql_get_socket, [mysql-client])
+ if test "x$ac_cv_lib_mysqlclient_mysql_get_socket" = "xyes"; then
have_a_libmysqlclient='yes'
fi
fi
if test "x$have_a_libmysqlclient" != "xyes"; then
- AC_MSG_WARN([MySQL libraries not found. Use --with-mysql-lib-dir=<path>.])
- FR_MODULE_FAIL([libmariadb || libmysqlclient || libmysqlclient_r])
+ AC_MSG_WARN([MariaDB libraries not found. Use --with-mysql-lib-dir=<path>.])
+ FR_MODULE_FAIL([libmariadb])
fi
dnl ############################################################
if test "x$ac_cv_header_mysql_mysql_h" = "xyes"; then
AC_DEFINE(HAVE_MYSQL_MYSQL_H, [], [Define if you have <mysql/mysql.h>])
else
- AC_MSG_WARN([MySQL headers not found. Use --with-mysql-include-dir=<path>.])
+ AC_MSG_WARN([MariaDB headers not found. Use --with-mysql-include-dir=<path>.])
FR_MODULE_FAIL([mysql.h])
fi
fi