2015-02-04 10:53:04 +00:00
|
|
|
MYDDAS_VERSION=0.9.2
|
2014-02-16 13:03:09 +00:00
|
|
|
AC_DEFINE_UNQUOTED(MYDDAS_VERSION, $MYDDAS_VERSION, [myddas release])
|
|
|
|
|
2015-02-04 10:53:04 +00:00
|
|
|
OLD_LIBS="$LIBS"
|
|
|
|
OLD_CPPFLAGS="$CPPFLAGS"
|
|
|
|
MYDDAS_CPPFLAGS=""
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(myddas,
|
|
|
|
[ --enable-myddas[[=DIR]] with the MYDDAS library],
|
2014-10-25 16:46:13 +01:00
|
|
|
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
|
2015-02-04 10:53:04 +00:00
|
|
|
yap_cv_myddas=$withval
|
2013-11-04 08:16:52 +00:00
|
|
|
LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib "
|
2015-02-10 09:17:59 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include "
|
|
|
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_myddas}/include "
|
2015-02-04 10:53:04 +00:00
|
|
|
fi,
|
2013-11-04 08:16:52 +00:00
|
|
|
[yap_cv_myddas=/usr])
|
|
|
|
|
2015-02-04 10:53:04 +00:00
|
|
|
AC_ARG_WITH(mysql,
|
|
|
|
[ --with-mysql[[=DIR]] with the MYSQL library],
|
|
|
|
if test "$withval" = yes; then
|
|
|
|
yap_cv_mysql=/usr
|
|
|
|
elif test "$withval" = no; then
|
|
|
|
yap_cv_mysql=no
|
|
|
|
else
|
|
|
|
yap_cv_mysql=$withval
|
|
|
|
LDFLAGS="$LDFLAGS -L${yap_cv_mysql}/lib "
|
2015-02-10 09:17:59 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_mysql}/include "
|
2015-02-04 10:53:04 +00:00
|
|
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_mysql}/include "
|
|
|
|
fi,
|
|
|
|
[yap_cv_mysql=/usr])
|
|
|
|
|
|
|
|
AC_ARG_WITH(odbc,
|
|
|
|
[ --with-odbc[[=DIR]] with an ODBC library],
|
|
|
|
if test "$withval" = yes; then
|
|
|
|
yap_cv_odbc=/usr
|
|
|
|
elif test "$withval" = no; then
|
|
|
|
yap_cv_odbc=no
|
|
|
|
else
|
|
|
|
yap_cv_odbc=$withval
|
|
|
|
LDFLAGS="$LDFLAGS -L${yap_cv_odbc}/lib "
|
2015-02-10 09:17:59 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_odbc}/include "
|
2015-02-04 10:53:04 +00:00
|
|
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_odbc}/include "
|
|
|
|
fi,
|
|
|
|
[yap_cv_odbc=/usr])
|
|
|
|
|
|
|
|
AC_ARG_WITH(sqlite3,
|
|
|
|
[ --with-sqlite3[[=DIR]] with an SQLITE3 library],
|
|
|
|
if test "$withval" = yes; then
|
|
|
|
yap_cv_sqlite3=/usr
|
|
|
|
elif test "$withval" = no; then
|
|
|
|
yap_cv_sqlite3=no
|
|
|
|
else
|
|
|
|
yap_cv_sqlite3=$withval
|
|
|
|
LDFLAGS="$LDFLAGS -L${yap_cv_sqlite3}/lib "
|
2015-02-10 09:17:59 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_sqlite3}/include "
|
|
|
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_sqlite3}/include "
|
2015-02-04 10:53:04 +00:00
|
|
|
fi,
|
|
|
|
[yap_cv_sqlite3=/usr])
|
|
|
|
|
2015-02-16 11:44:37 +00:00
|
|
|
AC_ARG_WITH(postgres,
|
|
|
|
[ --with-postgres[[=DIR]] with an POSTGRES library],
|
|
|
|
if test "$withval" = yes; then
|
|
|
|
yap_cv_postgres=/usr
|
|
|
|
elif test "$withval" = no; then
|
|
|
|
yap_cv_postgres=no
|
|
|
|
else
|
|
|
|
yap_cv_postgres=$withval
|
|
|
|
LDFLAGS="$LDFLAGS -L${yap_cv_postgres}/lib "
|
|
|
|
CPPFLAGS="$CPPFLAGS -I${yap_cv_postgres}/include "
|
|
|
|
MYDDAS_CPPFLAGS="$MYDDAS_CPPFLAGS -I${yap_cv_postgres}/include "
|
|
|
|
fi,
|
|
|
|
[yap_cv_postgres=/usr])
|
|
|
|
|
2013-11-04 08:16:52 +00:00
|
|
|
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
|
|
|
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"])
|
2015-02-10 09:17:59 +00:00
|
|
|
if test "$yap_cv_mysql" = yes
|
2013-11-04 08:16:52 +00:00
|
|
|
then
|
2015-02-10 09:17:59 +00:00
|
|
|
use_myddas=true
|
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL"
|
2013-11-04 08:16:52 +00:00
|
|
|
fi
|
2015-02-10 09:17:59 +00:00
|
|
|
|
2013-11-04 08:16:52 +00:00
|
|
|
dnl check for odbc
|
|
|
|
case "$target_os" in
|
|
|
|
*darwin*)
|
|
|
|
LIBS="$LIBS -framework CoreFoundation"
|
|
|
|
;;
|
2015-02-10 09:17:59 +00:00
|
|
|
**)
|
2013-11-04 08:16:52 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
AC_SEARCH_LIBS(SQLAllocHandle, [odbc], [yap_cv_odbc="yes"], [yap_cv_odbc="no"])
|
2015-02-04 10:53:04 +00:00
|
|
|
if test "$yap_cv_odbc" != no
|
2013-11-04 08:16:52 +00:00
|
|
|
then
|
2015-02-04 10:53:04 +00:00
|
|
|
LIBS="$LIBS -lodbc"
|
2013-11-04 08:16:52 +00:00
|
|
|
else
|
|
|
|
AC_SEARCH_LIBS(SQLAllocHandle, [iodbc], [yap_cv_odbc="yes"], [yap_cv_odbc="no"])
|
2015-02-04 10:53:04 +00:00
|
|
|
if test "$yap_cv_odbc" != no
|
2013-11-04 08:16:52 +00:00
|
|
|
then
|
2015-02-04 10:53:04 +00:00
|
|
|
LIBS="$LIBS -liodbc"
|
2014-07-10 15:07:24 +01:00
|
|
|
else
|
|
|
|
AC_SEARCH_LIBS(SQLAllocHandle, [odbc32], [yap_cv_odbc="yes" ], [yap_cv_odbc="no"])
|
2015-02-04 10:53:04 +00:00
|
|
|
if test "$yap_cv_odbc" != no
|
2014-07-10 15:07:24 +01:00
|
|
|
then
|
2015-02-04 10:53:04 +00:00
|
|
|
LIBS="$LIBS -lodbc32"
|
2014-07-10 15:07:24 +01:00
|
|
|
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)
|
2015-02-04 10:53:04 +00:00
|
|
|
AC_CHECK_HEADERS(sql.h, [yap_cv_odbc="yes" ], [yap_cv_odbc="no"])
|
2015-02-10 09:17:59 +00:00
|
|
|
if test "$yap_cv_odbc" != no
|
2013-11-04 08:16:52 +00:00
|
|
|
then
|
2015-02-10 09:17:59 +00:00
|
|
|
use_myddas=true
|
2013-11-04 08:16:52 +00:00
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC"
|
|
|
|
fi
|
2015-02-10 09:17:59 +00:00
|
|
|
|
2015-02-03 02:37:25 +00:00
|
|
|
#from SWI PROSQLITE library.
|
2015-03-23 07:27:10 +00:00
|
|
|
havelib=no
|
2015-02-03 02:37:25 +00:00
|
|
|
AC_CHECK_LIB(sqlite3, sqlite3_open,
|
2015-02-04 10:53:04 +00:00
|
|
|
LIBS="-lsqlite3 $LIBS"
|
2015-02-03 02:37:25 +00:00
|
|
|
havelib=yes)
|
2015-03-23 07:27:10 +00:00
|
|
|
if test "$havelib" = no
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB(sqliteX, sqlite3_open, # android
|
|
|
|
LIBS="-lsqliteX $LIBS"
|
|
|
|
havelib=yes)
|
|
|
|
fi
|
|
|
|
if test "$havelib" = no
|
|
|
|
then
|
|
|
|
yap_cv_sqlite3=no
|
|
|
|
else
|
|
|
|
AC_CHECK_HEADERS(sqlite3.h, [], [yap_cv_sqlite3="no"])
|
|
|
|
fi
|
2015-02-10 09:17:59 +00:00
|
|
|
if test "$yap_cv_sqlite3" != no
|
2015-02-03 02:37:25 +00:00
|
|
|
then
|
2015-02-10 09:17:59 +00:00
|
|
|
use_myddas=true
|
2015-02-03 02:37:25 +00:00
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_SQLITE3"
|
|
|
|
fi
|
|
|
|
|
2015-03-23 07:27:10 +00:00
|
|
|
havelib=no
|
2015-02-16 11:44:37 +00:00
|
|
|
AC_CHECK_LIB(pq, PQconnectdbParams,
|
|
|
|
LIBS="-lpq $LIBS"
|
|
|
|
havelib=yes)
|
|
|
|
|
|
|
|
AC_CHECK_HEADERS(libpq-fe.h, [], [yap_cv_postgres="no"])
|
|
|
|
if test "$yap_cv_postgres" != no
|
|
|
|
then
|
|
|
|
use_myddas=true
|
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_POSTGRES"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2015-02-04 10:53:04 +00:00
|
|
|
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
|
|
|
|
|
2015-02-10 09:17:59 +00:00
|
|
|
if test "$use_myddas" = true; then
|
|
|
|
YAP_EXTRAS="$YAP_EXTRAS -DUSE_MYDDAS=1"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2015-02-04 10:53:04 +00:00
|
|
|
MYDDAS_LIBS="$LIBS"
|
2015-02-10 09:17:59 +00:00
|
|
|
LIBS="$OLD_LIBS"
|
|
|
|
CPPFLAGS="$OLD_CPPFLAGS"
|
2014-01-24 19:59:42 +00:00
|
|
|
else
|
2014-02-10 23:30:21 +00:00
|
|
|
ENABLE_MYDDAS=""
|
2015-02-10 09:17:59 +00:00
|
|
|
fi
|
2013-11-04 08:16:52 +00:00
|
|
|
|
2015-04-13 13:28:17 +01:00
|
|
|
OBJECTS_MYDDAS="#"
|
2015-03-23 07:27:10 +00:00
|
|
|
if test x"$ENABLE_MYDDAS" = x -a x"$STARTUP_ANDROID" = x
|
|
|
|
then
|
|
|
|
#in Android we have to actually include myddas in the binary
|
2015-04-15 11:21:15 +01:00
|
|
|
OBJECTS_MYDDAS="$ALL_MYDDAS_OBJECTS"
|
2015-03-23 07:27:10 +00:00
|
|
|
fi
|
|
|
|
|
2014-02-10 23:30:21 +00:00
|
|
|
AC_SUBST(PKG_MYDDAS)
|
2015-04-13 13:28:17 +01:00
|
|
|
AC_SUBST(OBJECTS_MYDDAS)
|
2015-02-04 10:53:04 +00:00
|
|
|
AC_SUBST(MYDDAS_CPPFLAGS)
|
2014-07-10 15:07:24 +01:00
|
|
|
AC_SUBST(MYDDAS_LIBS)
|