[use_asap=$enableval],
[use_asap=no])
+AC_ARG_ENABLE([mysql],
+ [AS_HELP_STRING([--disable-mysql],
+ [disable mysql])],
+ [use_mysql=$enableval],
+ [use_mysql=yes])
+
AC_ARG_ENABLE([webserver],
[AS_HELP_STRING([--disable-webserver],
[disable webserver])],
fi
# platform common libraries
-AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
-if test $MYSQL_CONFIG = "yes"; then
- INCLUDES="$INCLUDES `mysql_config --include`"
- MYSQL_LIBS=`mysql_config --libs`
- LIBS="$LIBS $MYSQL_LIBS"
- AC_SUBST(MYSQL_LIBS)
-else
- AC_MSG_ERROR($missing_program)
+if test "$use_mysql" = "yes"; then
+ AC_CHECK_PROG(MYSQL_CONFIG, mysql_config, "yes", "no")
+ if test $MYSQL_CONFIG = "yes"; then
+ AC_DEFINE([HAVE_MYSQL],[1],["Define to 1 if you have the `mysql' library (-lmysqlclient)."])
+ INCLUDES="$INCLUDES `mysql_config --include`"
+ MYSQL_LIBS=`mysql_config --libs`
+ LIBS="$LIBS $MYSQL_LIBS"
+ AC_SUBST(MYSQL_LIBS)
+ else
+ AC_MSG_ERROR($missing_program)
+ fi
fi
AC_CHECK_HEADER([ass/ass.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_HEADER([mpeg2dec/mpeg2.h],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([z], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([crypto], [main],, AC_MSG_ERROR($missing_library))
AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR($missing_library))
-AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
+if test "$use_mysql" = "yes"; then
+ AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR($missing_library))
+fi
AC_CHECK_LIB([ssh], [sftp_tell64],, AC_MSG_RESULT([Could not find suitable version of libssh]))
AC_CHECK_LIB([bluetooth], [hci_devid],, AC_MSG_RESULT([Could not find suitable version of libbluetooth]))
AC_CHECK_LIB([yajl], [main],, AC_MSG_ERROR($missing_library))
final_message="$final_message\n ASAP Codec:\tNo"
fi
+if test "$use_mysql" = "yes"; then
+ final_message="$final_message\n MySQL:\tYes"
+ USE_MYSQL=1
+else
+ final_message="$final_message\n MySQL:\tNo"
+ USE_MYSQL=0
+fi
if test "$use_webserver" = "yes"; then
final_message="$final_message\n Webserver:\tYes"
USE_WEB_SERVER=1
AC_SUBST(USE_LIBUDEV)
AC_SUBST(USE_LIBUSB)
AC_SUBST(USE_LIBCEC)
+AC_SUBST(USE_MYSQL)
AC_SUBST(USE_WEB_SERVER)
#include "utils/AutoPtrHandle.h"
#include "utils/log.h"
#include "utils/URIUtils.h"
-#include "mysqldataset.h"
#include "sqlitedataset.h"
#include "threads/SingleLock.h"
+#ifdef HAS_MYSQL
+#include "mysqldataset.h"
+#endif
using namespace AUTOPTR;
using namespace dbiplus;
m_sqlite = true;
+#ifdef HAS_MYSQL
if ( dbSettings.type.Equals("mysql") )
{
// check we have all information before we cancel the fallback
CLog::Log(LOGINFO, "Essential mysql database information is missing. Require at least host, user and pass defined.");
}
else
+#else
+ if ( dbSettings.type.Equals("mysql") )
+ CLog::Log(LOGERROR, "MySQL library requested but MySQL support is not compiled in. Falling back to sqlite3.");
+#endif
{
dbSettings.type = "sqlite3";
dbSettings.host = CSpecialProtocol::TranslatePath(g_settings.GetDatabaseFolder());
{
m_pDB.reset( new SqliteDatabase() ) ;
}
+#ifdef HAS_MYSQL
else if (dbSettings.type.Equals("mysql"))
{
m_pDB.reset( new MysqlDatabase() ) ;
}
+#endif
else
{
CLog::Log(LOGERROR, "Unable to determine database type: %s", dbSettings.type.c_str());