Merge branch 'master' of ssh://gnunet.org/gnunet
[oweals/gnunet.git] / src / psycstore / Makefile.am
index d87cd25f075cc97041f25e7b19c92f6fd3c3d454..a342c06e6c7ca7a19f40b5bafa2b79e5713466ad 100644 (file)
@@ -1,3 +1,4 @@
+# This Makefile.am is in the public domain
 AM_CPPFLAGS = -I$(top_srcdir)/src/include
 
 plugindir = $(libdir)/gnunet
@@ -19,6 +20,20 @@ if USE_COVERAGE
   XLIB = -lgcov
 endif
 
+if HAVE_MYSQL
+MYSQL_PLUGIN = libgnunet_plugin_psycstore_mysql.la
+if HAVE_TESTING
+MYSQL_TESTS = test_plugin_psycstore_mysql
+endif
+endif
+
+if HAVE_POSTGRESQL
+POSTGRES_PLUGIN = libgnunet_plugin_psycstore_postgres.la
+if HAVE_TESTING
+POSTGRES_TESTS = test_plugin_psycstore_postgres
+endif
+endif
+
 if HAVE_SQLITE
 SQLITE_PLUGIN = libgnunet_plugin_psycstore_sqlite.la
 if HAVE_TESTING
@@ -37,8 +52,6 @@ libgnunetpsycstore_la_LIBADD = \
 libgnunetpsycstore_la_LDFLAGS = \
   $(GN_LIB_LDFLAGS)  $(WINFLAGS) \
   -version-info 0:0:0
-libgnunetpsycstore_la_DEPENDENCIES = \
-  $(top_builddir)/src/util/libgnunetutil.la
 
 bin_PROGRAMS =
 
@@ -50,38 +63,65 @@ gnunet_service_psycstore_SOURCES = \
 gnunet_service_psycstore_LDADD = \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/util/libgnunetutil.la \
+  $(top_builddir)/src/psycutil/libgnunetpsycutil.la \
   $(GN_LIBINTL)
-gnunet_service_psycstore_DEPENDENCIES = \
+
+plugin_LTLIBRARIES = \
+  $(SQLITE_PLUGIN) \
+  $(MYSQL_PLUGIN) \
+  $(POSTGRES_PLUGIN)
+
+
+libgnunet_plugin_psycstore_mysql_la_SOURCES = \
+  plugin_psycstore_mysql.c
+libgnunet_plugin_psycstore_mysql_la_LIBADD = \
+  libgnunetpsycstore.la  \
+  $(top_builddir)/src/my/libgnunetmy.la \
+  $(top_builddir)/src/mysql/libgnunetmysql.la \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
-  $(top_builddir)/src/util/libgnunetutil.la
+  $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) \
+  $(LTLIBINTL)
+libgnunet_plugin_psycstore_mysql_la_LDFLAGS = \
+ $(GN_PLUGIN_LDFLAGS)
 
+libgnunet_plugin_psycstore_postgres_la_SOURCES = \
+  plugin_psycstore_postgres.c
+libgnunet_plugin_psycstore_postgres_la_LIBADD = \
+  libgnunetpsycstore.la  \
+  $(top_builddir)/src/postgres/libgnunetpostgres.la  \
+  $(top_builddir)/src/pq/libgnunetpq.la  \
+  $(top_builddir)/src/statistics/libgnunetstatistics.la \
+  $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lpq \
+  $(LTLIBINTL)
+libgnunet_plugin_psycstore_postgres_la_LDFLAGS = \
+  $(GN_PLUGIN_LDFLAGS) $(POSTGRESQL_LDFLAGS)
+libgnunet_plugin_psycstore_postgres_la_CPPFLAGS = \
+  $(POSTGRESQL_CPPFLAGS) $(AM_CPPFLAGS)
 
-plugin_LTLIBRARIES = \
-  $(SQLITE_PLUGIN)
 
 libgnunet_plugin_psycstore_sqlite_la_SOURCES = \
   plugin_psycstore_sqlite.c
 libgnunet_plugin_psycstore_sqlite_la_LIBADD = \
-  $(top_builddir)/src/psycstore/libgnunetpsycstore.la  \
+  libgnunetpsycstore.la  \
   $(top_builddir)/src/statistics/libgnunetstatistics.la \
   $(top_builddir)/src/util/libgnunetutil.la $(XLIBS) -lsqlite3 \
   $(LTLIBINTL)
 libgnunet_plugin_psycstore_sqlite_la_LDFLAGS = \
  $(GN_PLUGIN_LDFLAGS)
-libgnunet_plugin_psycstore_sqlite_la_DEPENDENCIES = \
-  $(top_builddir)/src/statistics/libgnunetstatistics.la \
-  $(top_builddir)/src/util/libgnunetutil.la \
-  libgnunetpsycstore.la
 
 
+if HAVE_SQLITE
 if HAVE_TESTING
 check_PROGRAMS = \
  $(SQLITE_TESTS) \
+ $(MYSQL_TESTS) \
+ $(POSTGRES_TESTS) \
  test_psycstore
 endif
+endif
 
 if ENABLE_TEST_RUN
-TESTS_ENVIRONMENT=export GNUNET_PREFIX=@libdir@;export PATH=@prefix@/bin:$$PATH;
+AM_TESTS_ENVIRONMENT=export GNUNET_PREFIX=$${GNUNET_PREFIX:-@libdir@};export PATH=$${GNUNET_PREFIX:-@prefix@}/bin:$$PATH;unset XDG_DATA_HOME;unset XDG_CONFIG_HOME;
 TESTS = $(check_PROGRAMS)
 endif
 
@@ -91,10 +131,6 @@ test_psycstore_LDADD = \
   libgnunetpsycstore.la \
   $(top_builddir)/src/testing/libgnunettesting.la \
   $(top_builddir)/src/util/libgnunetutil.la
-test_psycstore_DEPENDENCIES = \
-  libgnunetpsycstore.la \
-  $(top_builddir)/src/testing/libgnunettesting.la \
-  $(top_builddir)/src/util/libgnunetutil.la
 
 EXTRA_DIST = \
   test_psycstore.conf
@@ -103,5 +139,18 @@ EXTRA_DIST = \
 test_plugin_psycstore_sqlite_SOURCES = \
  test_plugin_psycstore.c
 test_plugin_psycstore_sqlite_LDADD = \
+  $(top_builddir)/src/testing/libgnunettesting.la \
+  $(top_builddir)/src/util/libgnunetutil.la
+
+test_plugin_psycstore_mysql_SOURCES = \
+ test_plugin_psycstore.c
+test_plugin_psycstore_mysql_LDADD = \
+  $(top_builddir)/src/testing/libgnunettesting.la \
+  $(top_builddir)/src/util/libgnunetutil.la
+
+test_plugin_psycstore_postgres_SOURCES = \
+ test_plugin_psycstore.c
+test_plugin_psycstore_postgres_LDADD = \
  $(top_builddir)/src/testing/libgnunettesting.la \
- $(top_builddir)/src/util/libgnunetutil.la  
+ $(top_builddir)/src/util/libgnunetutil.la
+