diff --git a/components/cla/cla.c b/components/cla/cla.c index a7bb542..9db0a59 100644 --- a/components/cla/cla.c +++ b/components/cla/cla.c @@ -41,7 +41,9 @@ const struct available_cla_list_entry AVAILABLE_CLAS[] = { { "tcpclv3", &tcpclv3_create }, { "tcpspp", &tcpspp_create }, { "bibe", &bibe_create }, +#ifndef DISABLE_SQLITE_STORAGE { "sqlite", &sqlite_create }, +#endif // DISABLE_SQLITE_STORAGE }; diff --git a/config.mk.example b/config.mk.example index 199e6a0..7342f0d 100644 --- a/config.mk.example +++ b/config.mk.example @@ -46,6 +46,15 @@ #coverage ?= no #coverage ?= yes +############################### +# Dependency-related settings # +############################### + +# Some features can be disabled to reduce the number of dependencies. + +# The persistent storage implementation requires SQLite. +#DISABLE_SQLITE_STORAGE := 1 + ##################### # Toolchain options # ##################### diff --git a/include/agents/sqlite_agent.h b/include/agents/sqlite_agent.h index cf55495..f4b8a37 100644 --- a/include/agents/sqlite_agent.h +++ b/include/agents/sqlite_agent.h @@ -8,8 +8,6 @@ #include -#include - // Default Agent IDs. #ifndef AGENT_ID_SQLITE_DTN #define AGENT_ID_SQLITE_DTN "sqlite" @@ -21,7 +19,7 @@ struct sqlite_agent_params { char *sink_identifier; agent_no_t registered_agent_no; - sqlite3 *db; + struct sqlite3 *db; QueueIdentifier_t cla_queue; }; diff --git a/include/cla/storage/cla_sqlite.h b/include/cla/storage/cla_sqlite.h index 33bc243..da7603c 100644 --- a/include/cla/storage/cla_sqlite.h +++ b/include/cla/storage/cla_sqlite.h @@ -11,8 +11,6 @@ #include -#include - // Length of the SQLiteAgent queue. #ifndef CLA_SQLITE_AGENT_QUEUE_LENGTH #define CLA_SQLITE_AGENT_QUEUE_LENGTH 10 diff --git a/include/ud3tn/cmdline.h b/include/ud3tn/cmdline.h index 4c95bfc..2634b21 100644 --- a/include/ud3tn/cmdline.h +++ b/include/ud3tn/cmdline.h @@ -12,8 +12,13 @@ // Default options string provided to the CLA subsystem. #ifndef DEFAULT_CLA_OPTIONS +#ifndef DISABLE_SQLITE_STORAGE #define DEFAULT_CLA_OPTIONS \ "sqlite:file::memory:?cache=shared;tcpclv3:*,4556;smtcp:*,4222,false;mtcp:*,4224" +#else // DISABLE_SQLITE_STORAGE +#define DEFAULT_CLA_OPTIONS \ + "tcpclv3:*,4556;smtcp:*,4222,false;mtcp:*,4224" +#endif // DISABLE_SQLITE_STORAGE #endif // DEFAULT_CLA_OPTIONS // Default TCP IP/port used for the application agent interface. diff --git a/mk/posix.mk b/mk/posix.mk index 5bcea0d..91401de 100644 --- a/mk/posix.mk +++ b/mk/posix.mk @@ -40,6 +40,8 @@ LDFLAGS += -lpthread ifndef DISABLE_SQLITE_STORAGE LDFLAGS += -lsqlite3 +else + CPPFLAGS += -DDISABLE_SQLITE_STORAGE endif LDFLAGS_LIB += -shared