diff options
author | Martin Schanzenbach <schanzen@gnunet.org> | 2023-09-23 09:42:56 +0200 |
---|---|---|
committer | Martin Schanzenbach <schanzen@gnunet.org> | 2023-09-23 09:42:56 +0200 |
commit | 5a6ea6b45ff9c9398cf4d532b55889c3ffbaa1e7 (patch) | |
tree | 9397c4513e8bb23a6a489461e373e35b8a885357 | |
parent | f2488e5d6a67abcda5b7e8a5589e1fac54e385fb (diff) | |
download | gnunet-5a6ea6b45ff9c9398cf4d532b55889c3ffbaa1e7.tar.gz gnunet-5a6ea6b45ff9c9398cf4d532b55889c3ffbaa1e7.zip |
BUILD: Build pq plugins with meson
-rw-r--r-- | meson.build | 10 | ||||
-rw-r--r-- | src/datacache/meson.build | 12 | ||||
-rw-r--r-- | src/datastore/meson.build | 24 | ||||
-rw-r--r-- | src/meson.build | 5 | ||||
-rw-r--r-- | src/my/meson.build | 15 | ||||
-rw-r--r-- | src/mysql/meson.build | 13 | ||||
-rw-r--r-- | src/namecache/meson.build | 73 | ||||
-rw-r--r-- | src/namestore/meson.build | 82 | ||||
-rw-r--r-- | src/pq/meson.build | 20 |
9 files changed, 172 insertions, 82 deletions
diff --git a/meson.build b/meson.build index 62888727d..513a8da99 100644 --- a/meson.build +++ b/meson.build | |||
@@ -176,11 +176,13 @@ if ssh_bin.found() | |||
176 | endif | 176 | endif |
177 | 177 | ||
178 | # Optional dependencies | 178 | # Optional dependencies |
179 | mq_dep = dependency('libmysqlclient', required : false) | 179 | |
180 | if not mq_dep.found() | 180 | # FIXME: I think we wanted to retire mysql support |
181 | mq_dep = cc.find_library('mysqlclient', required : false) | 181 | my_dep = dependency('libmysqlclient', required : false) |
182 | if not my_dep.found() | ||
183 | my_dep = cc.find_library('mysqlclient', required : false) | ||
182 | endif | 184 | endif |
183 | if mq_dep.found() | 185 | if my_dep.found() |
184 | add_project_arguments('-DHAVE_MYSQL', language : 'c') | 186 | add_project_arguments('-DHAVE_MYSQL', language : 'c') |
185 | endif | 187 | endif |
186 | pq_dep = dependency('libpq', required : false) | 188 | pq_dep = dependency('libpq', required : false) |
diff --git a/src/datacache/meson.build b/src/datacache/meson.build index a0a439403..b61a5e2a7 100644 --- a/src/datacache/meson.build +++ b/src/datacache/meson.build | |||
@@ -1,7 +1,5 @@ | |||
1 | libgnunetdatacache_src = ['datacache.c'] | 1 | libgnunetdatacache_src = ['datacache.c'] |
2 | 2 | ||
3 | libgnunetplugindatacache_sqlite_src = ['plugin_datacache_sqlite.c'] | ||
4 | |||
5 | configure_file(input : 'datacache.conf', | 3 | configure_file(input : 'datacache.conf', |
6 | output : 'datacache.conf', | 4 | output : 'datacache.conf', |
7 | configuration : cdata, | 5 | configuration : cdata, |
@@ -25,10 +23,18 @@ libgnunetdatacache = library('gnunetdatacache', | |||
25 | libgnunetdatacache_dep = declare_dependency(link_with : libgnunetdatacache) | 23 | libgnunetdatacache_dep = declare_dependency(link_with : libgnunetdatacache) |
26 | pkg.generate(libgnunetdatacache, url: 'https://www.gnunet.org', | 24 | pkg.generate(libgnunetdatacache, url: 'https://www.gnunet.org', |
27 | description : 'Provides datacache API for temporary storage to disk') | 25 | description : 'Provides datacache API for temporary storage to disk') |
26 | |||
28 | shared_module('gnunet_plugin_datacache_sqlite', | 27 | shared_module('gnunet_plugin_datacache_sqlite', |
29 | libgnunetplugindatacache_sqlite_src, | 28 | ['plugin_datacache_sqlite.c'], |
30 | dependencies: [libgnunetutil_dep, | 29 | dependencies: [libgnunetutil_dep, |
31 | libgnunetdatacache_dep, | 30 | libgnunetdatacache_dep, |
32 | sqlite_dep, | 31 | sqlite_dep, |
33 | libgnunetsq_dep], | 32 | libgnunetsq_dep], |
34 | include_directories: [incdir, configuration_inc]) | 33 | include_directories: [incdir, configuration_inc]) |
34 | shared_module('gnunet_plugin_datacache_postgres', | ||
35 | ['plugin_datacache_postgres.c'], | ||
36 | dependencies: [libgnunetutil_dep, | ||
37 | libgnunetdatacache_dep, | ||
38 | pq_dep, | ||
39 | libgnunetpq_dep], | ||
40 | include_directories: [incdir, configuration_inc]) | ||
diff --git a/src/datastore/meson.build b/src/datastore/meson.build index 531d8fbdb..e54340f8c 100644 --- a/src/datastore/meson.build +++ b/src/datastore/meson.build | |||
@@ -27,6 +27,22 @@ libgnunetdatastore = library('gnunetdatastore', | |||
27 | libgnunetdatastore_dep = declare_dependency(link_with : libgnunetdatastore) | 27 | libgnunetdatastore_dep = declare_dependency(link_with : libgnunetdatastore) |
28 | pkg.generate(libgnunetdatastore, url: 'https://www.gnunet.org', | 28 | pkg.generate(libgnunetdatastore, url: 'https://www.gnunet.org', |
29 | description : 'Management API for the datastore for persistent storage to disk') | 29 | description : 'Management API for the datastore for persistent storage to disk') |
30 | |||
31 | shared_module('gnunet_plugin_datastore_sqlite', | ||
32 | ['plugin_datastore_sqlite.c'], | ||
33 | dependencies: [libgnunetutil_dep, | ||
34 | libgnunetdatastore_dep, | ||
35 | sqlite_dep, | ||
36 | libgnunetsq_dep], | ||
37 | include_directories: [incdir, configuration_inc]) | ||
38 | shared_module('gnunet_plugin_datastore_postgres', | ||
39 | ['plugin_datastore_postgres.c'], | ||
40 | dependencies: [libgnunetutil_dep, | ||
41 | libgnunetdatastore_dep, | ||
42 | pq_dep, | ||
43 | libgnunetpq_dep], | ||
44 | include_directories: [incdir, configuration_inc]) | ||
45 | |||
30 | executable ('gnunet-datastore', | 46 | executable ('gnunet-datastore', |
31 | ['gnunet-datastore.c'], | 47 | ['gnunet-datastore.c'], |
32 | dependencies: [libgnunetdatastore_dep, | 48 | dependencies: [libgnunetdatastore_dep, |
@@ -41,10 +57,4 @@ executable ('gnunet-service-datastore', | |||
41 | libgnunetstatistics_dep, | 57 | libgnunetstatistics_dep, |
42 | libgnunetdatacache_dep], | 58 | libgnunetdatacache_dep], |
43 | include_directories: [incdir, configuration_inc]) | 59 | include_directories: [incdir, configuration_inc]) |
44 | shared_module('gnunet_plugin_datastore_sqlite', | 60 | |
45 | ['plugin_datastore_sqlite.c'], | ||
46 | dependencies: [libgnunetutil_dep, | ||
47 | libgnunetdatastore_dep, | ||
48 | sqlite_dep, | ||
49 | libgnunetsq_dep], | ||
50 | include_directories: [incdir, configuration_inc]) | ||
diff --git a/src/meson.build b/src/meson.build index 389d08245..5db69ce3f 100644 --- a/src/meson.build +++ b/src/meson.build | |||
@@ -19,8 +19,9 @@ if get_option('monolith') == false | |||
19 | endif | 19 | endif |
20 | subdir('peerinfo') | 20 | subdir('peerinfo') |
21 | subdir('sq', if_found : [sqlite_dep]) | 21 | subdir('sq', if_found : [sqlite_dep]) |
22 | #subdir('$(MYSQL_DIR)') | 22 | subdir('mysql', if_found : [my_dep]) |
23 | #subdir('$(POSTGRES_DIR)') | 23 | subdir('my', if_found : [my_dep]) |
24 | subdir('pq', if_found : [pq_dep]) | ||
24 | subdir('datacache') | 25 | subdir('datacache') |
25 | subdir('datastore') | 26 | subdir('datastore') |
26 | #subdir('template') | 27 | #subdir('template') |
diff --git a/src/my/meson.build b/src/my/meson.build new file mode 100644 index 000000000..877e80560 --- /dev/null +++ b/src/my/meson.build | |||
@@ -0,0 +1,15 @@ | |||
1 | libgnunetmy_src = ['my.c', | ||
2 | 'my_query_helper.c', | ||
3 | 'my_result_helper.c'] | ||
4 | |||
5 | if get_option('monolith') == false | ||
6 | libgnunetmy = library('gnunetmy', | ||
7 | libgnunetmy_src, | ||
8 | dependencies: [libgnunetutil_dep, libgnunetmysq_dep, my_dep], | ||
9 | include_directories: [incdir, configuration_inc]) | ||
10 | libgnunetmy_dep = declare_dependency(link_with : libgnunetmy) | ||
11 | else | ||
12 | foreach p : libgnunetmy_src | ||
13 | gnunet_src += 'my/' + p | ||
14 | endforeach | ||
15 | endif | ||
diff --git a/src/mysql/meson.build b/src/mysql/meson.build new file mode 100644 index 000000000..1464fc45e --- /dev/null +++ b/src/mysql/meson.build | |||
@@ -0,0 +1,13 @@ | |||
1 | libgnunetmysq_src = ['mysql.c'] | ||
2 | |||
3 | if get_option('monolith') == false | ||
4 | libgnunetmysq = library('gnunetmysq', | ||
5 | libgnunetmysq_src, | ||
6 | dependencies: [libgnunetutil_dep, my_dep], | ||
7 | include_directories: [incdir, configuration_inc]) | ||
8 | libgnunetmysq_dep = declare_dependency(link_with : libgnunetmysq) | ||
9 | else | ||
10 | foreach p : libgnunetmysq_src | ||
11 | gnunet_src += 'mysql/' + p | ||
12 | endforeach | ||
13 | endif | ||
diff --git a/src/namecache/meson.build b/src/namecache/meson.build index f50d7e5d1..24c546c05 100644 --- a/src/namecache/meson.build +++ b/src/namecache/meson.build | |||
@@ -1,5 +1,4 @@ | |||
1 | libgnunetnamecache_src = ['namecache_api.c'] | 1 | libgnunetnamecache_src = ['namecache_api.c'] |
2 | libgnunetpluginnamecache_sqlite_src = ['plugin_namecache_sqlite.c'] | ||
3 | 2 | ||
4 | gnunetnamecache_src = ['gnunet-namecache.c'] | 3 | gnunetnamecache_src = ['gnunet-namecache.c'] |
5 | gnunetservicenamecache_src = ['gnunet-service-namecache.c'] | 4 | gnunetservicenamecache_src = ['gnunet-service-namecache.c'] |
@@ -11,37 +10,49 @@ configure_file(input : 'namecache.conf.in', | |||
11 | install_dir: pkgcfgdir) | 10 | install_dir: pkgcfgdir) |
12 | 11 | ||
13 | 12 | ||
14 | if get_option('monolith') == false | 13 | if get_option('monolith') |
15 | libgnunetnamecache = library('gnunetnamecache', | ||
16 | libgnunetnamecache_src, | ||
17 | dependencies: [libgnunetutil_dep, | ||
18 | libgnunetgnsrecord_dep], | ||
19 | include_directories: [incdir, configuration_inc]) | ||
20 | libgnunetnamecache_dep = declare_dependency(link_with : libgnunetnamecache) | ||
21 | libgnunetpluginnamecache_sqlite = library('gnunet_plugin_namecache_sqlite', | ||
22 | libgnunetpluginnamecache_sqlite_src, | ||
23 | dependencies: [libgnunetutil_dep, | ||
24 | libgnunetgnsrecord_dep, | ||
25 | sqlite_dep, | ||
26 | libgnunetsq_dep], | ||
27 | include_directories: [incdir, configuration_inc]) | ||
28 | libgnunetpluginnamecache_sqlite_dep = declare_dependency(link_with : libgnunetpluginnamecache_sqlite) | ||
29 | executable ('gnunet-namecache', | ||
30 | gnunetnamecache_src, | ||
31 | dependencies: [libgnunetnamecache_dep, | ||
32 | libgnunetutil_dep, | ||
33 | libgnunetgnsrecord_dep, | ||
34 | libgnunetidentity_dep], | ||
35 | include_directories: [incdir, configuration_inc]) | ||
36 | executable ('gnunet-service-namecache', | ||
37 | gnunetservicenamecache_src, | ||
38 | dependencies: [libgnunetnamecache_dep, | ||
39 | libgnunetutil_dep, | ||
40 | libgnunetgnsrecord_dep, | ||
41 | libgnunetstatistics_dep], | ||
42 | include_directories: [incdir, configuration_inc]) | ||
43 | else | ||
44 | foreach p : libgnunetnamecache_src + libgnunetpluginnamecache_sqlite_src + gnunetservicenamecache_src | 14 | foreach p : libgnunetnamecache_src + libgnunetpluginnamecache_sqlite_src + gnunetservicenamecache_src |
45 | gnunet_src += 'namecache/' + p | 15 | gnunet_src += 'namecache/' + p |
46 | endforeach | 16 | endforeach |
17 | subdir_done() | ||
47 | endif | 18 | endif |
19 | |||
20 | libgnunetnamecache = library('gnunetnamecache', | ||
21 | libgnunetnamecache_src, | ||
22 | soversion: '0.0.0', | ||
23 | dependencies: [libgnunetutil_dep, | ||
24 | libgnunetgnsrecord_dep], | ||
25 | include_directories: [incdir, configuration_inc]) | ||
26 | libgnunetnamecache_dep = declare_dependency(link_with : libgnunetnamecache) | ||
27 | pkg.generate(libgnunetnamecache, url: 'https://www.gnunet.org', | ||
28 | description : 'Provides API for storing GNS records to a cache') | ||
29 | |||
30 | shared_module('gnunet_plugin_namecache_sqlite', | ||
31 | ['plugin_namecache_sqlite.c'], | ||
32 | dependencies: [libgnunetutil_dep, | ||
33 | libgnunetgnsrecord_dep, | ||
34 | sqlite_dep, | ||
35 | libgnunetsq_dep], | ||
36 | include_directories: [incdir, configuration_inc]) | ||
37 | shared_module('gnunet_plugin_namecache_postgres', | ||
38 | ['plugin_namecache_postgres.c'], | ||
39 | dependencies: [libgnunetutil_dep, | ||
40 | libgnunetgnsrecord_dep, | ||
41 | pq_dep, | ||
42 | libgnunetpq_dep], | ||
43 | include_directories: [incdir, configuration_inc]) | ||
44 | |||
45 | executable ('gnunet-namecache', | ||
46 | gnunetnamecache_src, | ||
47 | dependencies: [libgnunetnamecache_dep, | ||
48 | libgnunetutil_dep, | ||
49 | libgnunetgnsrecord_dep, | ||
50 | libgnunetidentity_dep], | ||
51 | include_directories: [incdir, configuration_inc]) | ||
52 | executable ('gnunet-service-namecache', | ||
53 | gnunetservicenamecache_src, | ||
54 | dependencies: [libgnunetnamecache_dep, | ||
55 | libgnunetutil_dep, | ||
56 | libgnunetgnsrecord_dep, | ||
57 | libgnunetstatistics_dep], | ||
58 | include_directories: [incdir, configuration_inc]) | ||
diff --git a/src/namestore/meson.build b/src/namestore/meson.build index 010316df3..79396915e 100644 --- a/src/namestore/meson.build +++ b/src/namestore/meson.build | |||
@@ -11,42 +11,54 @@ configure_file(input : 'namestore.conf.in', | |||
11 | install_dir: pkgcfgdir) | 11 | install_dir: pkgcfgdir) |
12 | 12 | ||
13 | 13 | ||
14 | if get_option('monolith') == false | 14 | if get_option('monolith') |
15 | libgnunetnamestore = library('gnunetnamestore', | ||
16 | libgnunetnamestore_src, | ||
17 | dependencies: [libgnunetutil_dep, | ||
18 | libgnunetgnsrecord_dep, | ||
19 | libgnunetidentity_dep], | ||
20 | include_directories: [incdir, configuration_inc]) | ||
21 | libgnunetnamestore_dep = declare_dependency(link_with : libgnunetnamestore) | ||
22 | libgnunetpluginnamestore_sqlite = library('gnunet_plugin_namestore_sqlite', | ||
23 | libgnunetpluginnamestore_sqlite_src, | ||
24 | dependencies: [libgnunetutil_dep, | ||
25 | libgnunetgnsrecord_dep, | ||
26 | libgnunetidentity_dep, | ||
27 | libgnunetsq_dep, | ||
28 | libgnunetstatistics_dep, | ||
29 | sqlite_dep], | ||
30 | include_directories: [incdir, configuration_inc]) | ||
31 | libgnunetpluginnamestore_sqlite_dep = declare_dependency(link_with : libgnunetpluginnamestore_sqlite) | ||
32 | executable ('gnunet-namestore', | ||
33 | gnunetnamestore_src, | ||
34 | dependencies: [libgnunetnamestore_dep, | ||
35 | libgnunetutil_dep, | ||
36 | libgnunetgnsrecord_dep, | ||
37 | libgnunetidentity_dep], | ||
38 | include_directories: [incdir, configuration_inc]) | ||
39 | executable ('gnunet-service-namestore', | ||
40 | gnunetservicenamestore_src, | ||
41 | dependencies: [libgnunetnamestore_dep, | ||
42 | libgnunetutil_dep, | ||
43 | libgnunetnamecache_dep, | ||
44 | libgnunetgnsrecord_dep, | ||
45 | libgnunetidentity_dep, | ||
46 | libgnunetstatistics_dep], | ||
47 | include_directories: [incdir, configuration_inc]) | ||
48 | else | ||
49 | foreach p : libgnunetnamestore_src + libgnunetpluginnamestore_sqlite_src + gnunetservicenamestore_src | 15 | foreach p : libgnunetnamestore_src + libgnunetpluginnamestore_sqlite_src + gnunetservicenamestore_src |
50 | gnunet_src += 'namestore/' + p | 16 | gnunet_src += 'namestore/' + p |
51 | endforeach | 17 | endforeach |
18 | subdir_done() | ||
52 | endif | 19 | endif |
20 | libgnunetnamestore = library('gnunetnamestore', | ||
21 | libgnunetnamestore_src, | ||
22 | soversion: '0.1.0', | ||
23 | dependencies: [libgnunetutil_dep, | ||
24 | libgnunetgnsrecord_dep, | ||
25 | libgnunetidentity_dep], | ||
26 | include_directories: [incdir, configuration_inc]) | ||
27 | libgnunetnamestore_dep = declare_dependency(link_with : libgnunetnamestore) | ||
28 | pkg.generate(libgnunetnamestore, url: 'https://www.gnunet.org', | ||
29 | description : 'Provides API for storing GNS records to a database') | ||
30 | |||
31 | shared_module('gnunet_plugin_namestore_sqlite', | ||
32 | libgnunetpluginnamestore_sqlite_src, | ||
33 | dependencies: [libgnunetutil_dep, | ||
34 | libgnunetgnsrecord_dep, | ||
35 | libgnunetidentity_dep, | ||
36 | libgnunetsq_dep, | ||
37 | libgnunetstatistics_dep, | ||
38 | sqlite_dep], | ||
39 | include_directories: [incdir, configuration_inc]) | ||
40 | shared_module('gnunet_plugin_namestore_postgres', | ||
41 | ['plugin_namestore_postgres.c'], | ||
42 | dependencies: [libgnunetutil_dep, | ||
43 | libgnunetgnsrecord_dep, | ||
44 | libgnunetidentity_dep, | ||
45 | libgnunetpq_dep, | ||
46 | libgnunetstatistics_dep, | ||
47 | pq_dep], | ||
48 | include_directories: [incdir, configuration_inc]) | ||
49 | executable ('gnunet-namestore', | ||
50 | gnunetnamestore_src, | ||
51 | dependencies: [libgnunetnamestore_dep, | ||
52 | libgnunetutil_dep, | ||
53 | libgnunetgnsrecord_dep, | ||
54 | libgnunetidentity_dep], | ||
55 | include_directories: [incdir, configuration_inc]) | ||
56 | executable ('gnunet-service-namestore', | ||
57 | gnunetservicenamestore_src, | ||
58 | dependencies: [libgnunetnamestore_dep, | ||
59 | libgnunetutil_dep, | ||
60 | libgnunetnamecache_dep, | ||
61 | libgnunetgnsrecord_dep, | ||
62 | libgnunetidentity_dep, | ||
63 | libgnunetstatistics_dep], | ||
64 | include_directories: [incdir, configuration_inc]) | ||
diff --git a/src/pq/meson.build b/src/pq/meson.build new file mode 100644 index 000000000..273a0c0fb --- /dev/null +++ b/src/pq/meson.build | |||
@@ -0,0 +1,20 @@ | |||
1 | libgnunetpq_src = ['pq.c', | ||
2 | 'pq_connect.c', | ||
3 | 'pq_eval.c', | ||
4 | 'pq_event.c', | ||
5 | 'pq_exec.c', | ||
6 | 'pq_prepare.c', | ||
7 | 'pq_query_helper.c', | ||
8 | 'pq_result_helper.c'] | ||
9 | |||
10 | if get_option('monolith') == false | ||
11 | libgnunetpq = library('gnunetpq', | ||
12 | libgnunetpq_src, | ||
13 | dependencies: [libgnunetutil_dep, pq_dep], | ||
14 | include_directories: [incdir, configuration_inc]) | ||
15 | libgnunetpq_dep = declare_dependency(link_with : libgnunetpq) | ||
16 | else | ||
17 | foreach p : libgnunetpq_src | ||
18 | gnunet_src += 'pq/' + p | ||
19 | endforeach | ||
20 | endif | ||