diff --git a/modules/database/database_backends/db_init.h b/modules/database/database_backends/db_init.h deleted file mode 100644 index c5cbd8c8d..000000000 --- a/modules/database/database_backends/db_init.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef DB_INIT_H -#define DB_INIT_H - -#if MYSQL_PRESENT -#include "mysql/mysql_database.h" -#endif - -#if PGSQL_PRESENT -#include "postgres/pgsql_database.h" -#endif - -#if SQLITE_PRESENT -#include "sqlite/sqlite3_database.h" -#endif - -void initialize_database_backends() { -#if MYSQL_PRESENT - MysqlDatabase::_register(); -#endif - -#if PGSQL_PRESENT - PGSQLDatabase::_register(); -#endif - -#if SQLITE_PRESENT - SQLite3Database::_register(); -#endif -} - -#endif \ No newline at end of file diff --git a/modules/database/database_backends/mysql/SCsub b/modules/database/database_backends/mysql/SCsub deleted file mode 100644 index 8d4b0902e..000000000 --- a/modules/database/database_backends/mysql/SCsub +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python - -Import("env_db") -Import("env") - -env_db.core_sources = [] - -env_db.add_source_files(env_db.core_sources, "*.cpp") - -# Build it all as a library -lib = env_db.add_library("database_mysql", env_db.core_sources) -env.Prepend(LIBS=[lib]) diff --git a/modules/database/database_backends/postgres/SCsub b/modules/database/database_backends/postgres/SCsub deleted file mode 100644 index 66c4b86b3..000000000 --- a/modules/database/database_backends/postgres/SCsub +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env python - -Import("env_db") -Import("env") - -env_db.core_sources = [] - -env_db.add_source_files(env_db.core_sources, "*.cpp") - -# Build it all as a library -lib = env_db.add_library("database_pgsql", env_db.core_sources) -env.Prepend(LIBS=[lib]) diff --git a/modules/database/database_backends/sqlite/SCsub b/modules/database/database_backends/sqlite/SCsub deleted file mode 100644 index 116f5f6aa..000000000 --- a/modules/database/database_backends/sqlite/SCsub +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env python - -Import("env_db") -Import("env") - -env_db.core_sources = [] - -env_db.add_source_files(env_db.core_sources, "*.cpp") -env_db.core_sources.append("./sqlite/sqlite3.c") - -# Build it all as a library -lib = env_db.add_library("database_sqlite", env_db.core_sources) -env.Prepend(LIBS=[lib]) diff --git a/modules/database_mysql/SCsub b/modules/database_mysql/SCsub new file mode 100644 index 000000000..d3e797aa8 --- /dev/null +++ b/modules/database_mysql/SCsub @@ -0,0 +1,36 @@ +#import os +#import version + +#Import('env') + +#module_env = env.Clone() + +#sources = [ + #"register_types.cpp", +#] + +#if ARGUMENTS.get('custom_modules_shared', 'no') == 'yes': + # Shared lib compilation +# module_env.Append(CCFLAGS=['-fPIC']) +# module_env['LIBS'] = [] +# shared_lib = module_env.SharedLibrary(target='#bin/database', source=sources) +# shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0] +# env.Append(LIBS=[shared_lib_shim]) +# env.Append(LIBPATH=['#bin']) +#else: + # Static compilation +# module_env.add_source_files(env.modules_sources, sources) + + +#Import("env_db") +#Import("env") + +#env_db.core_sources = [] + +#env_db.add_source_files(env_db.core_sources, "*.cpp") + +# Build it all as a library +#lib = env_db.add_library("database_mysql", env_db.core_sources) +#env.Prepend(LIBS=[lib]) + + diff --git a/modules/database/database_backends/mysql/detect.py b/modules/database_mysql/config.py similarity index 80% rename from modules/database/database_backends/mysql/detect.py rename to modules/database_mysql/config.py index 980519f4a..25f758969 100644 --- a/modules/database/database_backends/mysql/detect.py +++ b/modules/database_mysql/config.py @@ -1,18 +1,9 @@ import os -import platform -import sys +def can_build(env, platform): + return False -def is_active(): - return True - - -def get_name(): - return "mysql" - - -def can_build(): - +def _can_build(): if os.name == "posix" or sys.platform == "darwin": x11_error = os.system("pkg-config --version > /dev/null") if x11_error: @@ -39,20 +30,10 @@ def can_build(): return False -def get_opts(): - from SCons.Variables import BoolVariable, EnumVariable - - return [ - EnumVariable("debug_symbols", "Add debugging symbols to release/release_debug builds", "yes", ("yes", "no")), - ] - - -def get_flags(): - - return [] - - def configure(env): + pass + +def _configure(env): mariadb_error = os.system("pkg-config mariadb --modversion --silence-errors > /dev/null ") mysql_error = os.system("pkg-config mysql --modversion --silence-errors > /dev/null ") @@ -69,3 +50,12 @@ def configure(env): # Link those statically for portability #if env["use_static_cpp"]: #env.Append(LINKFLAGS=["-static-libgcc", "-static-libstdc++"]) + + +def get_doc_classes(): + return [ + ] + +def get_doc_path(): + return "doc_classes" + diff --git a/modules/database/database_backends/mysql/mysql_database.cpp b/modules/database_mysql/mysql_database.cpp similarity index 100% rename from modules/database/database_backends/mysql/mysql_database.cpp rename to modules/database_mysql/mysql_database.cpp diff --git a/modules/database/database_backends/mysql/mysql_database.h b/modules/database_mysql/mysql_database.h similarity index 100% rename from modules/database/database_backends/mysql/mysql_database.h rename to modules/database_mysql/mysql_database.h diff --git a/modules/database/database_backends/mysql/mysql_query_builder.cpp b/modules/database_mysql/mysql_query_builder.cpp similarity index 100% rename from modules/database/database_backends/mysql/mysql_query_builder.cpp rename to modules/database_mysql/mysql_query_builder.cpp diff --git a/modules/database/database_backends/mysql/mysql_query_builder.h b/modules/database_mysql/mysql_query_builder.h similarity index 100% rename from modules/database/database_backends/mysql/mysql_query_builder.h rename to modules/database_mysql/mysql_query_builder.h diff --git a/modules/database/database_backends/mysql/mysql_query_result.cpp b/modules/database_mysql/mysql_query_result.cpp similarity index 100% rename from modules/database/database_backends/mysql/mysql_query_result.cpp rename to modules/database_mysql/mysql_query_result.cpp diff --git a/modules/database/database_backends/mysql/mysql_query_result.h b/modules/database_mysql/mysql_query_result.h similarity index 100% rename from modules/database/database_backends/mysql/mysql_query_result.h rename to modules/database_mysql/mysql_query_result.h diff --git a/modules/database/database_backends/mysql/mysql_table_builder.cpp b/modules/database_mysql/mysql_table_builder.cpp similarity index 100% rename from modules/database/database_backends/mysql/mysql_table_builder.cpp rename to modules/database_mysql/mysql_table_builder.cpp diff --git a/modules/database/database_backends/mysql/mysql_table_builder.h b/modules/database_mysql/mysql_table_builder.h similarity index 100% rename from modules/database/database_backends/mysql/mysql_table_builder.h rename to modules/database_mysql/mysql_table_builder.h diff --git a/modules/database_postgres/SCsub b/modules/database_postgres/SCsub new file mode 100644 index 000000000..3e592abc0 --- /dev/null +++ b/modules/database_postgres/SCsub @@ -0,0 +1,11 @@ + +#Import("env_db") +#Import("env") + +#env_db.core_sources = [] + +#env_db.add_source_files(env_db.core_sources, "*.cpp") + +# Build it all as a library +#lib = env_db.add_library("database_pgsql", env_db.core_sources) +#env.Prepend(LIBS=[lib]) diff --git a/modules/database/database_backends/postgres/detect.py b/modules/database_postgres/config.py similarity index 69% rename from modules/database/database_backends/postgres/detect.py rename to modules/database_postgres/config.py index 939ba73bd..8e0aa357b 100644 --- a/modules/database/database_backends/postgres/detect.py +++ b/modules/database_postgres/config.py @@ -3,16 +3,10 @@ import platform import sys -def is_active(): - return True - - -def get_name(): - return "pgsql" - - -def can_build(): +def can_build(env, platform): + return False +def _can_build(): if os.name == "posix" or sys.platform == "darwin": x11_error = os.system("pkg-config --version > /dev/null") if x11_error: @@ -31,21 +25,10 @@ def can_build(): #todo return False - -def get_opts(): - from SCons.Variables import BoolVariable, EnumVariable - - return [ - EnumVariable("debug_symbols", "Add debugging symbols to release/release_debug builds", "yes", ("yes", "no")), - ] - - -def get_flags(): - - return [] - - def configure(env): + pass + +def _configure(env): env.ParseConfig("pkg-config libpq --cflags --libs") env.Append(CPPDEFINES=["PGSQL_PRESENT"]) diff --git a/modules/database/database_backends/postgres/pgsql_database.cpp b/modules/database_postgres/pgsql_database.cpp similarity index 100% rename from modules/database/database_backends/postgres/pgsql_database.cpp rename to modules/database_postgres/pgsql_database.cpp diff --git a/modules/database/database_backends/postgres/pgsql_database.h b/modules/database_postgres/pgsql_database.h similarity index 100% rename from modules/database/database_backends/postgres/pgsql_database.h rename to modules/database_postgres/pgsql_database.h diff --git a/modules/database_sqlite/SCsub b/modules/database_sqlite/SCsub new file mode 100644 index 000000000..916157642 --- /dev/null +++ b/modules/database_sqlite/SCsub @@ -0,0 +1,12 @@ + +#Import("env_db") +#Import("env") + +#env_db.core_sources = [] + +#env_db.add_source_files(env_db.core_sources, "*.cpp") +#env_db.core_sources.append("./sqlite/sqlite3.c") + +# Build it all as a library +#lib = env_db.add_library("database_sqlite", env_db.core_sources) +#env.Prepend(LIBS=[lib]) diff --git a/modules/database/database_backends/sqlite/detect.py b/modules/database_sqlite/config.py similarity index 69% rename from modules/database/database_backends/sqlite/detect.py rename to modules/database_sqlite/config.py index fddd6c2a0..73ca17780 100644 --- a/modules/database/database_backends/sqlite/detect.py +++ b/modules/database_sqlite/config.py @@ -3,15 +3,10 @@ import platform import sys -def is_active(): - return True +def can_build(env, platform): + return False - -def get_name(): - return "sqlite3" - - -def can_build(): +def _can_build(): # if os.name == "posix" or sys.platform == "darwin": # x11_error = os.system("pkg-config --version > /dev/null") @@ -31,24 +26,15 @@ def can_build(): # #todo # return False - print("sqlite3 built in!") + #print("sqlite3 built in!") return True -def get_opts(): - from SCons.Variables import BoolVariable, EnumVariable - - return [ - # EnumVariable("debug_symbols", "Add debugging symbols to release/release_debug builds", "yes", ("yes", "no")), - ] - - -def get_flags(): - - return [] - def configure(env): + pass + +def _configure(env): #env.ParseConfig("pkg-config sqlite3 --cflags --libs") env.Append(CPPDEFINES=["SQLITE_PRESENT"]) diff --git a/modules/database/database_backends/sqlite/sqlite/shell.c b/modules/database_sqlite/sqlite/shell.c similarity index 100% rename from modules/database/database_backends/sqlite/sqlite/shell.c rename to modules/database_sqlite/sqlite/shell.c diff --git a/modules/database/database_backends/sqlite/sqlite/sqlite3.c b/modules/database_sqlite/sqlite/sqlite3.c similarity index 100% rename from modules/database/database_backends/sqlite/sqlite/sqlite3.c rename to modules/database_sqlite/sqlite/sqlite3.c diff --git a/modules/database/database_backends/sqlite/sqlite/sqlite3.def b/modules/database_sqlite/sqlite/sqlite3.def similarity index 100% rename from modules/database/database_backends/sqlite/sqlite/sqlite3.def rename to modules/database_sqlite/sqlite/sqlite3.def diff --git a/modules/database/database_backends/sqlite/sqlite/sqlite3.h b/modules/database_sqlite/sqlite/sqlite3.h similarity index 100% rename from modules/database/database_backends/sqlite/sqlite/sqlite3.h rename to modules/database_sqlite/sqlite/sqlite3.h diff --git a/modules/database/database_backends/sqlite/sqlite/sqlite3ext.h b/modules/database_sqlite/sqlite/sqlite3ext.h similarity index 100% rename from modules/database/database_backends/sqlite/sqlite/sqlite3ext.h rename to modules/database_sqlite/sqlite/sqlite3ext.h diff --git a/modules/database/database_backends/sqlite/sqlite3_database.cpp b/modules/database_sqlite/sqlite3_database.cpp similarity index 100% rename from modules/database/database_backends/sqlite/sqlite3_database.cpp rename to modules/database_sqlite/sqlite3_database.cpp diff --git a/modules/database/database_backends/sqlite/sqlite3_database.h b/modules/database_sqlite/sqlite3_database.h similarity index 100% rename from modules/database/database_backends/sqlite/sqlite3_database.h rename to modules/database_sqlite/sqlite3_database.h diff --git a/modules/database/database_backends/sqlite/sqlite3_query_builder.cpp b/modules/database_sqlite/sqlite3_query_builder.cpp similarity index 100% rename from modules/database/database_backends/sqlite/sqlite3_query_builder.cpp rename to modules/database_sqlite/sqlite3_query_builder.cpp diff --git a/modules/database/database_backends/sqlite/sqlite3_query_builder.h b/modules/database_sqlite/sqlite3_query_builder.h similarity index 100% rename from modules/database/database_backends/sqlite/sqlite3_query_builder.h rename to modules/database_sqlite/sqlite3_query_builder.h diff --git a/modules/database/database_backends/sqlite/sqlite3_query_result.cpp b/modules/database_sqlite/sqlite3_query_result.cpp similarity index 100% rename from modules/database/database_backends/sqlite/sqlite3_query_result.cpp rename to modules/database_sqlite/sqlite3_query_result.cpp diff --git a/modules/database/database_backends/sqlite/sqlite3_query_result.h b/modules/database_sqlite/sqlite3_query_result.h similarity index 100% rename from modules/database/database_backends/sqlite/sqlite3_query_result.h rename to modules/database_sqlite/sqlite3_query_result.h diff --git a/modules/database/database_backends/sqlite/sqlite3_table_builder.cpp b/modules/database_sqlite/sqlite3_table_builder.cpp similarity index 100% rename from modules/database/database_backends/sqlite/sqlite3_table_builder.cpp rename to modules/database_sqlite/sqlite3_table_builder.cpp diff --git a/modules/database/database_backends/sqlite/sqlite3_table_builder.h b/modules/database_sqlite/sqlite3_table_builder.h similarity index 100% rename from modules/database/database_backends/sqlite/sqlite3_table_builder.h rename to modules/database_sqlite/sqlite3_table_builder.h