diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/mysql.m4 | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/m4/mysql.m4 b/m4/mysql.m4 new file mode 100644 index 0000000..78de056 --- /dev/null +++ b/m4/mysql.m4 @@ -0,0 +1,53 @@ +# Configure paths for mysql +# Nicolas Noble 2002-12-06 +# stolen from Sam Lantinga +# stolen from Manish Singh +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_SDL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) +dnl Test for mysql, and define MYSQL_CFLAGS and MYSQL_LIBS +dnl +AC_DEFUN(AM_PATH_MYSQL, +[dnl +dnl Get the cflags and libraries from the mysql-config script +dnl +AC_ARG_WITH(mysql-prefix,[ --with-mysql-prefix=PFX Prefix where mysql is installed (optional)], + mysql_prefix="$withval", mysql_prefix="") +AC_ARG_WITH(mysql-exec-prefix,[ --with-mysql-exec-prefix=PFX Exec prefix where mysql is installed (optional)], + mysql_exec_prefix="$withval", mysql_exec_prefix="") + + if test x$mysql_exec_prefix != x ; then + mysql_args="$mysql_args --exec-prefix=$mysql_exec_prefix" + if test x${MYSQL_CONFIG+set} != xset ; then + MYSQL_CONFIG=$mysql_exec_prefix/bin/mysql_config + fi + fi + if test x$mysql_prefix != x ; then + mysql_args="$mysql_args --prefix=$mysql_prefix" + if test x${MYSQL_CONFIG+set} != xset ; then + MYSQL_CONFIG=$mysql_prefix/bin/mysql_config + fi + fi + + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + AC_PATH_PROG(MYSQL_CONFIG, mysql_config, no, [$PATH]) + no_mysql="" + if test "$MYSQL_CONFIG" = "no" ; then + no_mysql=yes + else + MYSQL_CFLAGS=`$MYSQL_CONFIG $mysqlconf_args --cflags` + MYSQL_LIBS=`$MYSQL_CONFIG $mysqlconf_args --libs` + fi + + if test "x$no_mysql" = x ; then + ifelse([$1], , :, [$1]) + else + MYSQL_CFLAGS="" + MYSQL_LIBS="" + ifelse([$2], , :, [$2]) + fi + AC_SUBST(MYSQL_CFLAGS) + AC_SUBST(MYSQL_LIBS) +]) |