2014-02-16 13:03:09 +00:00
|
|
|
MYDDAS_VERSION=0.9.1
|
|
|
|
AC_DEFINE_UNQUOTED(MYDDAS_VERSION, $MYDDAS_VERSION, [myddas release])
|
|
|
|
|
2014-10-25 16:46:13 +01:00
|
|
|
AC_ARG_WITH(myddas,
|
|
|
|
[ --with-myddas[[=DIR]] with the MYDDAS library],
|
|
|
|
if test "$withval" = yes; then
|
2013-11-04 08:16:52 +00:00
|
|
|
yap_cv_myddas=/usr
|
2014-10-25 16:46:13 +01:00
|
|
|
elif test "$withval" = no; then
|
2013-11-04 08:16:52 +00:00
|
|
|
yap_cv_myddas=no
|
|
|
|
else
|
2014-10-25 16:46:13 +01:00
|
|
|
yap_cv_myddas=$with_myddas
|
2013-11-04 08:16:52 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib "
|
|
|
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include "
|
|
|
|
ODBC_LDFLAGS="-L${yap_cv_myddas}/lib "
|
|
|
|
ODBC_CFLAGS="-I${yap_cv_myddas}/include "
|
|
|
|
fi,
|
|
|
|
[yap_cv_myddas=/usr])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(myddas-stats,
|
|
|
|
[ --enable-myddas-stats enable the MYDDAS library statistics support],
|
|
|
|
if test "$yap_cv_myddas" = no; then
|
|
|
|
myddasstats=no
|
|
|
|
else
|
|
|
|
myddasstats="$enableval"
|
|
|
|
fi, myddasstats=no)
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(myddas-top-level,
|
|
|
|
[ --enable-myddas-top-level enable the MYDDAS top-level support to MySQL],
|
|
|
|
if test "$yap_cv_myddas" = no; then
|
|
|
|
myddastoplevel=no
|
|
|
|
else
|
|
|
|
myddastoplevel="$enableval"
|
|
|
|
fi, myddastoplevel=no)
|
|
|
|
|
|
|
|
if test "$yap_cv_myddas" != "no"
|
|
|
|
then
|
2014-02-10 23:30:21 +00:00
|
|
|
PKG_MYDDAS="packages/myddas"
|
2013-11-04 08:16:52 +00:00
|
|
|
dnl check for mysql
|
2014-07-10 15:07:24 +01:00
|
|
|
OLD_LIBS="$LIBS"
|
|
|
|
AC_SEARCH_LIBS(mysql_init, [mysqlclient], [yap_cv_mysql="yes" MYDDAS_LIBS="-lmysqlclient $MYDDAS_LIBS"], [yap_cv_mysql="no"])
|
2014-07-09 18:52:55 +01:00
|
|
|
AC_CHECK_HEADERS(mysql/mysql.h, [], [yap_cv_mysql="no"])
|
2013-11-04 08:16:52 +00:00
|
|
|
if test "$yap_cv_mysql" = yes
|
|
|
|
then
|
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL"
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl check for odbc
|
|
|
|
case "$target_os" in
|
|
|
|
*darwin*)
|
|
|
|
LIBS="$LIBS -framework CoreFoundation"
|
2014-07-10 15:07:24 +01:00
|
|
|
MYDDAS_LIBS="$MYDDAS_LIBS -framework CoreFoundation"
|
2013-11-04 08:16:52 +00:00
|
|
|
;;
|
|
|
|
**)
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SEARCH_LIBS(SQLAllocHandle, [odbc], [yap_cv_odbc="yes"], [yap_cv_odbc="no"])
|
|
|
|
if test "$yap_cv_odbc" = yes
|
|
|
|
then
|
2014-07-10 15:07:24 +01:00
|
|
|
MYDDAS_LIBS="$MYDDAS_LIBS -lodbc"
|
2013-11-04 08:16:52 +00:00
|
|
|
else
|
|
|
|
AC_SEARCH_LIBS(SQLAllocHandle, [iodbc], [yap_cv_odbc="yes"], [yap_cv_odbc="no"])
|
|
|
|
if test "$yap_cv_odbc" = yes
|
|
|
|
then
|
2014-07-10 15:07:24 +01:00
|
|
|
MYDDAS_LIBS="$MYDDAS_LIBS -liodbc"
|
|
|
|
else
|
|
|
|
AC_SEARCH_LIBS(SQLAllocHandle, [odbc32], [yap_cv_odbc="yes" ], [yap_cv_odbc="no"])
|
|
|
|
if test "$yap_cv_odbc" = yes
|
|
|
|
then
|
|
|
|
MYDDAS_LIBS="$MYDDAS_LIBS -lodbc32"
|
|
|
|
fi
|
2013-11-04 08:16:52 +00:00
|
|
|
fi
|
|
|
|
fi
|
2014-07-09 18:29:25 +01:00
|
|
|
#from SWI ODBC library.
|
|
|
|
AC_CHECK_HEADERS(windef.h)
|
2014-07-09 18:52:55 +01:00
|
|
|
AC_CHECK_HEADERS(sql.h, [ ], [yap_cv_odbc="no"])
|
2013-11-04 08:16:52 +00:00
|
|
|
if test "$yap_cv_odbc" = yes
|
|
|
|
then
|
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$myddasstats" = "yes"
|
|
|
|
then
|
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_STATS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "$myddastoplevel" = "yes"
|
|
|
|
then
|
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_TOP_LEVEL"
|
|
|
|
fi
|
2014-07-10 15:07:24 +01:00
|
|
|
LIBS="$OLD_LIBS"
|
2014-01-24 19:59:42 +00:00
|
|
|
else
|
2014-02-10 23:30:21 +00:00
|
|
|
ENABLE_MYDDAS=""
|
2013-11-04 08:16:52 +00:00
|
|
|
fi
|
|
|
|
|
2014-02-10 23:30:21 +00:00
|
|
|
AC_SUBST(PKG_MYDDAS)
|
2014-07-10 15:07:24 +01:00
|
|
|
AC_SUBST(MYDDAS_LIBS)
|
2014-01-24 19:59:42 +00:00
|
|
|
|
2013-11-04 08:16:52 +00:00
|
|
|
|