2007-02-13 22:11:55 +01:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_INIT(mysql-dbadm.c)
|
|
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
AM_INIT_AUTOMAKE(mysql-admutils, 0.1)
|
|
|
|
AM_SANITY_CHECK
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CPP
|
|
|
|
|
|
|
|
dnl Checks for libraries.
|
|
|
|
AC_CHECK_LIB(c, floor, [:], [
|
|
|
|
AC_CHECK_LIB(m, floor, [
|
|
|
|
LIBS="$LIBS -lm"
|
|
|
|
AC_DEFINE(HAVE_LIBM) ], []) ])
|
2016-08-02 08:10:45 +02:00
|
|
|
AC_CHECK_LIB(mysqlclient, mysql_real_connect, [
|
2007-02-13 22:11:55 +01:00
|
|
|
LIBS="$LIBS -lmysqlclient" ], [])
|
|
|
|
AC_CHECK_LIB(c, gethostbyaddr, [:], [
|
|
|
|
AC_CHECK_LIB(nsl, gethostbyaddr, [
|
|
|
|
LIBS="$LIBS -lnsl"
|
|
|
|
AC_DEFINE(HAVE_LIBNSL) ], []) ])
|
|
|
|
AC_CHECK_LIB(c, socket, [:], [
|
|
|
|
AC_CHECK_LIB(socket, socket, [
|
|
|
|
LIBS="$LIBS -lsocket"
|
|
|
|
AC_DEFINE(HAVE_LIBSOCKET) ], []) ])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for MySQL support)
|
|
|
|
AC_ARG_WITH(mysql,
|
|
|
|
[ --with-mysql[=DIR] Include MySQL support. DIR is the MySQL base
|
2016-08-02 08:10:45 +02:00
|
|
|
install directory, defaults to /usr.],
|
2007-02-13 22:11:55 +01:00
|
|
|
[
|
|
|
|
if test "$withval" != "no"; then
|
|
|
|
if test "$withval" = "yes"; then
|
2016-08-02 08:10:45 +02:00
|
|
|
MYSQL_INCDIR=/usr/include/mysql
|
|
|
|
MYSQL_LIBDIR=/usr/lib/mysql
|
2007-02-13 22:11:55 +01:00
|
|
|
else
|
|
|
|
if test -f $withval/include/mysql/mysql.h; then
|
|
|
|
MYSQL_INCDIR=$withval/include/mysql
|
|
|
|
MYSQL_LIBDIR=$withval/lib/mysql
|
|
|
|
elif test -f $withval/include/mysql.h; then
|
|
|
|
MYSQL_INCDIR=$withval/include
|
|
|
|
MYSQL_LIBDIR=$withval/lib
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_ERROR(Invalid MySQL directory - unable to find mysql.h under $withval)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
MYSQL_INCLUDE=-I$MYSQL_INCDIR
|
|
|
|
MYSQL_LFLAGS=-L$MYSQL_LIBDIR
|
|
|
|
MYSQL_LIBS=-lmysqlclient
|
|
|
|
|
|
|
|
AC_DEFINE(HAVE_MYSQL)
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
|
|
|
|
dnl check for errmsg.h, which isn't installed by some versions of 3.21
|
|
|
|
old_CPPFLAGS="$CPPFLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $MYSQL_INCLUDE"
|
|
|
|
AC_CHECK_HEADERS(errmsg.h)
|
|
|
|
CPPFLAGS="$old_CPPFLAGS"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
fi
|
|
|
|
],[
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
AC_MSG_RESULT("Giving up - You need to install MySQL somewhere"); exit
|
|
|
|
])
|
|
|
|
AC_SUBST(MYSQL_LIBS)
|
|
|
|
AC_SUBST(MYSQL_LFLAGS)
|
|
|
|
AC_SUBST(MYSQL_INCLUDE)
|
|
|
|
|
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_CHECK_HEADERS(unistd.h)
|
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
|
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_FUNC_VPRINTF
|
|
|
|
|
|
|
|
AC_OUTPUT(Makefile, [date > stamp-h])
|