Remove check for obsolete sqlite support. Check only for aqlite3

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/15/head
Michele Calgaro 1 month ago
parent 0d190c7566
commit d572a3f536
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -54,9 +54,6 @@
/* Define to 1 if you have the `snprintf' function. */ /* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF #undef HAVE_SNPRINTF
/* have SQLite */
#undef HAVE_SQLITE
/* have SQLite3 */ /* have SQLite3 */
#undef HAVE_SQLITE3 #undef HAVE_SQLITE3

@ -87,7 +87,7 @@ dnl PACKAGE set before
AC_C_BIGENDIAN AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN AC_CHECK_KDEMAXPATHLEN
AC_ARG_WITH(sqlite, AC_HELP_STRING([--without-sqlite], [Don't compile SQLite backend support]), , with_sqlite=yes) AC_ARG_WITH(sqlite3, AC_HELP_STRING([--without-sqlite3], [Don't compile SQLite3 backend support]), , with_sqlite3=yes)
AC_ARG_WITH(mysql, AC_HELP_STRING([--without-mysql], [Don't compile MySQL backend support]), , with_mysql=yes) AC_ARG_WITH(mysql, AC_HELP_STRING([--without-mysql], [Don't compile MySQL backend support]), , with_mysql=yes)
AC_ARG_WITH(postgresql, AC_HELP_STRING([--without-postgresql], [Don't compile PostgreSQL backend support]), , with_postgresql=yes) AC_ARG_WITH(postgresql, AC_HELP_STRING([--without-postgresql], [Don't compile PostgreSQL backend support]), , with_postgresql=yes)
@ -115,27 +115,12 @@ fi
dnl ------ Check for the SQLite headers ----- dnl ------ Check for the SQLite headers -----
AC_DEFUN([AC_HAVE_SQLITE],
[
AC_DEFINE(HAVE_SQLITE, 1, [have SQLite])
have_sqlite=true
SQLITE_LIB="-lsqlite"
AC_SUBST(SQLITE_LIB)
])
AC_DEFUN([AC_NO_SQLITE],
[
AC_DEFINE(HAVE_SQLITE, 0, [have SQLite])
have_sqlite=false
])
AC_DEFUN([AC_HAVE_SQLITE3], AC_DEFUN([AC_HAVE_SQLITE3],
[ [
AC_DEFINE(HAVE_SQLITE3, 1, [have SQLite3]) AC_DEFINE(HAVE_SQLITE3, 1, [have SQLite3])
have_sqlite3=true have_sqlite3=true
AC_NO_SQLITE SQLITE_LIB3="-lsqlite3"
SQLITE_LIB="-lsqlite3" AC_SUBST(SQLITE_LIB3)
AC_SUBST(SQLITE_LIB)
]) ])
AC_DEFUN([AC_NO_SQLITE3], AC_DEFUN([AC_NO_SQLITE3],
@ -144,32 +129,23 @@ AC_DEFUN([AC_NO_SQLITE3],
have_sqlite3=false have_sqlite3=false
]) ])
if test "x$with_sqlite" != "xno"; then if test "x$with_sqlite3" != "xno"; then
KDE_CHECK_HEADER(sqlite3.h, KDE_CHECK_HEADER(sqlite3.h,
AC_HAVE_SQLITE3, AC_HAVE_SQLITE3,
AC_NO_SQLITE3 AC_NO_SQLITE3
) )
if test "x$have_sqlite3" = "xfalse"; then
KDE_CHECK_HEADER(sqlite.h,
AC_HAVE_SQLITE,
AC_NO_SQLITE
)
fi
else else
AC_NO_SQLITE
AC_NO_SQLITE3 AC_NO_SQLITE3
fi fi
dnl ----------- Should I link or should I not link? --------- dnl ----------- Should I link or should I not link? ---------
AM_CONDITIONAL(link_lib_MYSQL, test x$have_mysql = xtrue) AM_CONDITIONAL(link_lib_MYSQL, test x$have_mysql = xtrue)
AM_CONDITIONAL(link_lib_POSTGRESQL, test x$have_postgresql = xtrue) AM_CONDITIONAL(link_lib_POSTGRESQL, test x$have_postgresql = xtrue)
AM_CONDITIONAL(link_lib_SQLITE, test x$have_sqlite = xtrue || test x$have_sqlite3 = xtrue) AM_CONDITIONAL(link_lib_SQLITE, test x$have_sqlite3 = xtrue)
dnl ----------- Should Krecipes be built at all? ------------ dnl ----------- Should Krecipes be built at all? ------------
if test "x$have_mysql" = "xfalse" && test "x$have_postgresql" = "xfalse"; then if test "x$have_mysql" = "xfalse" && test "x$have_postgresql" = "xfalse"; then
if test "x$have_sqlite" = "xfalse" && test "x$have_sqlite3" = "xfalse"; then if test "x$have_sqlite3" = "xfalse"; then
DO_NOT_COMPILE="$DO_NOT_COMPILE krecipes" DO_NOT_COMPILE="$DO_NOT_COMPILE krecipes"
will_not_build_krecipes=true will_not_build_krecipes=true
fi fi
@ -227,7 +203,7 @@ fi
echo "- -" echo "- -"
if test "x$have_sqlite" = "xtrue" || test "x$have_sqlite3" = "xtrue"; then if test "x$have_sqlite3" = "xtrue"; then
echo "- SQLite Found..................... YES -" echo "- SQLite Found..................... YES -"
else else
echo "- SQLite Found..................... NO -" echo "- SQLite Found..................... NO -"
@ -247,7 +223,7 @@ echo "You can get SQLite from: http://www.hwaci.com/sw/sqlite/"
echo "Or MySQL from: http://www.mysql.com" echo "Or MySQL from: http://www.mysql.com"
else if test "x$have_mysql" = "xtrue"; then else if test "x$have_mysql" = "xtrue"; then
if test "x$have_sqlite" = "xtrue" || test "x$have_sqlite3" = "xtrue"; then if test "x$have_sqlite3" = "xtrue"; then
echo "- -" echo "- -"
echo "- Fine, you can build Krecipes now -" echo "- Fine, you can build Krecipes now -"
echo "------------------------------------------------" echo "------------------------------------------------"

@ -15,7 +15,7 @@ krecipes_LDFLAGS = $(KDE_RPATH) $(LIB_TDEPARTS) $(LIB_TDECORE) $(LIB_TDEUI) $(LI
# Check for optional libs # Check for optional libs
if link_lib_SQLITE if link_lib_SQLITE
qsqlite_libadds = backends/SQLite/libkrecsqlite.la $(SQLITE_LIB) qsqlite_libadds = backends/SQLite/libkrecsqlite.la $(SQLITE_LIB3)
endif endif
if link_lib_MYSQL if link_lib_MYSQL

@ -27,8 +27,6 @@
#if HAVE_SQLITE3 #if HAVE_SQLITE3
#include <sqlite3.h> #include <sqlite3.h>
#elif HAVE_SQLITE
#include <sqlite.h>
#endif #endif
//keep these two around for porting old databases //keep these two around for porting old databases
@ -63,9 +61,7 @@ int LiteRecipeDB::lastInsertID()
TQStringList LiteRecipeDB::backupCommand() const TQStringList LiteRecipeDB::backupCommand() const
{ {
#if HAVE_SQLITE #if HAVE_SQLITE3
TQString binary = "sqlite";
#elif HAVE_SQLITE3
TQString binary = "sqlite3"; TQString binary = "sqlite3";
#endif #endif
@ -80,9 +76,7 @@ TQStringList LiteRecipeDB::backupCommand() const
TQStringList LiteRecipeDB::restoreCommand() const TQStringList LiteRecipeDB::restoreCommand() const
{ {
#if HAVE_SQLITE #if HAVE_SQLITE3
TQString binary = "sqlite";
#elif HAVE_SQLITE3
TQString binary = "sqlite3"; TQString binary = "sqlite3";
#endif #endif
@ -1014,15 +1008,11 @@ TQString escape( const TQString &s )
if ( !s_escaped.isEmpty() ) { //###: sqlite_mprintf() seems to fill an empty string with garbage if ( !s_escaped.isEmpty() ) { //###: sqlite_mprintf() seems to fill an empty string with garbage
// Escape using SQLite's function // Escape using SQLite's function
#if HAVE_SQLITE #if HAVE_SQLITE3
char * escaped = sqlite_mprintf( "%q", s.latin1() ); // Escape the string(allocates memory)
#elif HAVE_SQLITE3
char * escaped = sqlite3_mprintf( "%q", s.latin1() ); // Escape the string(allocates memory) char * escaped = sqlite3_mprintf( "%q", s.latin1() ); // Escape the string(allocates memory)
#endif #endif
s_escaped = escaped; s_escaped = escaped;
#if HAVE_SQLITE #if HAVE_SQLITE3
sqlite_freemem( escaped ); // free allocated memory
#elif HAVE_SQLITE3
sqlite3_free( escaped ); // free allocated memory sqlite3_free( escaped ); // free allocated memory
#endif #endif
} }

@ -23,8 +23,6 @@
#ifdef HAVE_SQLITE3 #ifdef HAVE_SQLITE3
#define SQLITE_DRIVER "TQSQLITE3" #define SQLITE_DRIVER "TQSQLITE3"
#elif HAVE_SQLITE
#define SQLITE_DRIVER "TQSQLITE"
#endif #endif
class LiteRecipeDB : public TQSqlRecipeDB class LiteRecipeDB : public TQSqlRecipeDB

@ -46,7 +46,7 @@
#include "MySQL/mysqlrecipedb.h" #include "MySQL/mysqlrecipedb.h"
#endif #endif
#if HAVE_SQLITE || HAVE_SQLITE3 #if HAVE_SQLITE3
#include "SQLite/literecipedb.h" #include "SQLite/literecipedb.h"
#endif #endif
@ -119,18 +119,18 @@ RecipeDB* RecipeDB::createDatabase( const TQString &dbType, const TQString &host
if ( 0 ) if ( 0 )
; //we need some condition here ; //we need some condition here
#if HAVE_SQLITE || HAVE_SQLITE3 #if HAVE_SQLITE3
else if ( dbType == "SQLite" ) { else if ( dbType == "SQLite" ) {
database = new LiteRecipeDB( file ); database = new LiteRecipeDB( file );
} }
#endif //HAVE_SQLITE || HAVE_SQLITE3 #endif // HAVE_SQLITE3
#if HAVE_MYSQL #if HAVE_MYSQL
else if ( dbType == "MySQL" ) { else if ( dbType == "MySQL" ) {
database = new MySQLRecipeDB( host, user, pass, dbname, port ); database = new MySQLRecipeDB( host, user, pass, dbname, port );
} }
#endif //HAVE_MYSQL #endif //HAVE_MYSQL
#if HAVE_POSTGRESQL #if HAVE_POSTGRESQL
else if ( dbType == "PostgreSQL" ) { else if ( dbType == "PostgreSQL" ) {
database = new PSqlRecipeDB( host, user, pass, dbname, port ); database = new PSqlRecipeDB( host, user, pass, dbname, port );
} }

@ -19,7 +19,7 @@ fi
echo "- -" echo "- -"
if test "x$have_sqlite" = "xtrue" || test "x$have_sqlite3" = "xtrue"; then if test "x$have_sqlite3" = "xtrue"; then
echo "- SQLite Found..................... YES -" echo "- SQLite Found..................... YES -"
else else
echo "- SQLite Found..................... NO -" echo "- SQLite Found..................... NO -"
@ -39,7 +39,7 @@ echo "You can get SQLite from: http://www.hwaci.com/sw/sqlite/"
echo "Or MySQL from: http://www.mysql.com" echo "Or MySQL from: http://www.mysql.com"
else if test "x$have_mysql" = "xtrue"; then else if test "x$have_mysql" = "xtrue"; then
if test "x$have_sqlite" = "xtrue" || test "x$have_sqlite3" = "xtrue"; then if test "x$have_sqlite3" = "xtrue"; then
echo "- -" echo "- -"
echo "- Fine, you can build Krecipes now -" echo "- Fine, you can build Krecipes now -"
echo "------------------------------------------------" echo "------------------------------------------------"

@ -7,7 +7,7 @@ AM_INIT_AUTOMAKE(krecipes, 0.8)
AC_C_BIGENDIAN AC_C_BIGENDIAN
AC_CHECK_KDEMAXPATHLEN AC_CHECK_KDEMAXPATHLEN
AC_ARG_WITH(sqlite, AC_HELP_STRING([--without-sqlite], [Don't compile SQLite backend support]), , with_sqlite=yes) AC_ARG_WITH(sqlite3, AC_HELP_STRING([--without-sqlite3], [Don't compile SQLite3 backend support]), , with_sqlite3=yes)
AC_ARG_WITH(mysql, AC_HELP_STRING([--without-mysql], [Don't compile MySQL backend support]), , with_mysql=yes) AC_ARG_WITH(mysql, AC_HELP_STRING([--without-mysql], [Don't compile MySQL backend support]), , with_mysql=yes)
AC_ARG_WITH(postgresql, AC_HELP_STRING([--without-postgresql], [Don't compile PostgreSQL backend support]), , with_postgresql=yes) AC_ARG_WITH(postgresql, AC_HELP_STRING([--without-postgresql], [Don't compile PostgreSQL backend support]), , with_postgresql=yes)
@ -35,27 +35,12 @@ fi
dnl ------ Check for the SQLite headers ----- dnl ------ Check for the SQLite headers -----
AC_DEFUN([AC_HAVE_SQLITE],
[
AC_DEFINE(HAVE_SQLITE, 1, [have SQLite])
have_sqlite=true
SQLITE_LIB="-lsqlite"
AC_SUBST(SQLITE_LIB)
])
AC_DEFUN([AC_NO_SQLITE],
[
AC_DEFINE(HAVE_SQLITE, 0, [have SQLite])
have_sqlite=false
])
AC_DEFUN([AC_HAVE_SQLITE3], AC_DEFUN([AC_HAVE_SQLITE3],
[ [
AC_DEFINE(HAVE_SQLITE3, 1, [have SQLite3]) AC_DEFINE(HAVE_SQLITE3, 1, [have SQLite3])
have_sqlite3=true have_sqlite3=true
AC_NO_SQLITE SQLITE_LIB3="-lsqlite3"
SQLITE_LIB="-lsqlite3" AC_SUBST(SQLITE_LIB3)
AC_SUBST(SQLITE_LIB)
]) ])
AC_DEFUN([AC_NO_SQLITE3], AC_DEFUN([AC_NO_SQLITE3],
@ -64,32 +49,23 @@ AC_DEFUN([AC_NO_SQLITE3],
have_sqlite3=false have_sqlite3=false
]) ])
if test "x$with_sqlite" != "xno"; then if test "x$with_sqlite3" != "xno"; then
KDE_CHECK_HEADER(sqlite3.h, KDE_CHECK_HEADER(sqlite3.h,
AC_HAVE_SQLITE3, AC_HAVE_SQLITE3,
AC_NO_SQLITE3 AC_NO_SQLITE3
) )
if test "x$have_sqlite3" = "xfalse"; then
KDE_CHECK_HEADER(sqlite.h,
AC_HAVE_SQLITE,
AC_NO_SQLITE
)
fi
else else
AC_NO_SQLITE
AC_NO_SQLITE3 AC_NO_SQLITE3
fi fi
dnl ----------- Should I link or should I not link? --------- dnl ----------- Should I link or should I not link? ---------
AM_CONDITIONAL(link_lib_MYSQL, test x$have_mysql = xtrue) AM_CONDITIONAL(link_lib_MYSQL, test x$have_mysql = xtrue)
AM_CONDITIONAL(link_lib_POSTGRESQL, test x$have_postgresql = xtrue) AM_CONDITIONAL(link_lib_POSTGRESQL, test x$have_postgresql = xtrue)
AM_CONDITIONAL(link_lib_SQLITE, test x$have_sqlite = xtrue || test x$have_sqlite3 = xtrue) AM_CONDITIONAL(link_lib_SQLITE, test x$have_sqlite3 = xtrue)
dnl ----------- Should Krecipes be built at all? ------------ dnl ----------- Should Krecipes be built at all? ------------
if test "x$have_mysql" = "xfalse" && test "x$have_postgresql" = "xfalse"; then if test "x$have_mysql" = "xfalse" && test "x$have_postgresql" = "xfalse"; then
if test "x$have_sqlite" = "xfalse" && test "x$have_sqlite3" = "xfalse"; then if test "x$have_sqlite3" = "xfalse"; then
DO_NOT_COMPILE="$DO_NOT_COMPILE krecipes" DO_NOT_COMPILE="$DO_NOT_COMPILE krecipes"
will_not_build_krecipes=true will_not_build_krecipes=true
fi fi

@ -127,7 +127,7 @@ DBImportDialog::DBImportDialog( TQWidget *parent, const char *name )
psqlRadioButton->setEnabled( false ); psqlRadioButton->setEnabled( false );
#endif #endif
#if (!(HAVE_SQLITE || HAVE_SQLITE3)) #if (!HAVE_SQLITE3)
liteRadioButton->setEnabled( false ); liteRadioButton->setEnabled( false );
#if (HAVE_MYSQL) #if (HAVE_MYSQL)

@ -364,8 +364,6 @@ SQLiteServerPrefs::SQLiteServerPrefs( TQWidget *parent ) : TQWidget( parent )
TQString sqliteBinary; TQString sqliteBinary;
#if HAVE_SQLITE3 #if HAVE_SQLITE3
sqliteBinary = "sqlite3"; sqliteBinary = "sqlite3";
#elif HAVE_SQLITE
sqliteBinary = "sqlite";
#endif #endif
// Backup options // Backup options

@ -62,7 +62,7 @@ SetupWizard::SetupWizard( TQWidget *parent, const char *name, bool modal, WFlags
setFinishEnabled( savePage, true ); // Enable finish button setFinishEnabled( savePage, true ); // Enable finish button
setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding ); setSizePolicy( TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding );
#if (!(HAVE_SQLITE || HAVE_SQLITE3)) #if (!HAVE_SQLITE3)
#if (HAVE_MYSQL) #if (HAVE_MYSQL)
showPages( MySQL ); showPages( MySQL );
#else #else
@ -793,7 +793,7 @@ DBTypeSetupPage::DBTypeSetupPage( TQWidget *parent ) : TQWidget( parent )
psqlCheckBox->setEnabled( false ); psqlCheckBox->setEnabled( false );
#endif #endif
#if (!(HAVE_SQLITE || HAVE_SQLITE3)) #if (!HAVE_SQLITE3)
liteCheckBox->setEnabled( false ); liteCheckBox->setEnabled( false );
#if (HAVE_MYSQL) #if (HAVE_MYSQL)

Loading…
Cancel
Save