aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--main.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index fe01fb6..1ad882e 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,10 @@ LDFLAGS := -ldl
CFLAGS += $(shell pkg-config --cflags sqlite3 libsodium)
LDFLAGS += $(shell pkg-config --libs sqlite3 libsodium)
+ifneq ($(NO_FIREBASE),)
+ CFLAGS += -DNO_FIREBASE
+endif
+
TARGETS := tomsg_server
TEST_TARGET := test/main
diff --git a/main.c b/main.c
index 145a614..a2ea8fc 100644
--- a/main.c
+++ b/main.c
@@ -173,13 +173,17 @@ int main(int argc,char **argv){
if(argc<=1)printf("Loaded no plugins\n");
db_init();
+#ifndef NO_FIREBASE
firebase_init();
+#endif
int sock=create_server_socket();
printf("Listening on port %d\n",PORT);
runloop_set_timeout(60*1000000,timeout_callback);
runloop_add_fd(sock,server_socket_callback,false);
runloop_run();
printf("Shutting down because runloop stopped\n");
+#ifndef NO_FIREBASE
firebase_stop();
+#endif
db_close();
}