Skip to content

Instantly share code, notes, and snippets.

@yappo
Created April 13, 2009 08:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yappo/94339 to your computer and use it in GitHub Desktop.
Save yappo/94339 to your computer and use it in GitHub Desktop.
--- configure.in.orig 2009-04-13 16:38:51.000000000 +0900
+++ configure.in 2009-04-13 17:00:46.000000000 +0900
@@ -23,13 +23,15 @@
AC_SUBST(MYSQL_INC)
-# check if prefix points to mysql 5.1
-if test ! -e "${prefix}/include/mysql/plugin.h" -a ! -e "${prefix}/include/mysql.h"
-then
- echo "failed to lacate mysql 5.1 installation" >&2
- echo "Please specify mysql 5.1 directory with --prefix option." >&2
- exit 1
-fi
+AC_ARG_WITH(mysql_config,
+ [ --with-mysql_config=/usr/bin/mysql_config mysql_config bin path ],
+ [
+ mysql_include=`${with_mysql_config} --include | sed s/-I//`
+ libdir=`${with_mysql_config} --plugindir`
+ MYSQL_LIBDIR=`${with_mysql_config} --plugindir | sed "s/\/plugin//"`
+ ],
+ [
+ mysql_include="${prefix}/include"
# change libdir to prefix/lib/mysql unless otherwise specified
MYSQL_LIBDIR="${prefix}/lib"
@@ -44,6 +46,18 @@
libdir="${libdir}/plugin"
fi
fi
+ ]
+)
+
+
+# check if prefix points to mysql 5.1
+if test ! -e "${mysql_include}/mysql/plugin.h" -a ! -e "${mysql_include}/mysql.h"
+then
+ echo "failed to lacate mysql 5.1 installation" >&2
+ echo "Please specify mysql 5.1 directory with --prefix option." >&2
+ exit 1
+fi
+
AC_SUBST(MYSQL_LIBDIR)
# We only support GCC and Sun's forte at the moment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment