gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] branch master updated: BUILD: Start experimental meson build


From: gnunet
Subject: [gnunet] branch master updated: BUILD: Start experimental meson build
Date: Wed, 20 Sep 2023 14:41:34 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 78bc6d9b5 BUILD: Start experimental meson build
78bc6d9b5 is described below

commit 78bc6d9b5356af42c1fe4899689a0cc84d6ae0a8
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Wed Sep 20 14:41:29 2023 +0200

    BUILD: Start experimental meson build
---
 meson.build                | 63 +++++++++++++++++++++++++++++++++++
 src/arm/meson.build        | 21 ++++++++++++
 src/block/meson.build      | 19 +++++++++++
 src/core/meson.build       | 12 +++++++
 src/curl/meson.build       | 14 ++++++++
 src/datacache/meson.build  | 22 +++++++++++++
 src/datastore/meson.build  | 25 ++++++++++++++
 src/hello/meson.build      | 23 +++++++++++++
 src/json/meson.build       | 17 ++++++++++
 src/meson.build            | 74 +++++++++++++++++++++++++++++++++++++++++
 src/nt/meson.build         | 13 ++++++++
 src/peerinfo/meson.build   | 24 ++++++++++++++
 src/rest/meson.build       | 20 +++++++++++
 src/sq/meson.build         | 17 ++++++++++
 src/statistics/meson.build | 20 +++++++++++
 src/util/meson.build       | 82 ++++++++++++++++++++++++++++++++++++++++++++++
 16 files changed, 466 insertions(+)

diff --git a/meson.build b/meson.build
new file mode 100644
index 000000000..c77833905
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,63 @@
+## EXPERIMENTAL --- WORK IN PROGRESS --- USE AT YOUR OWN PERIL --- ##
+project('gnunet', 'c', license: 'AGPLv3', version: '0.21.0')
+compiler = meson.get_compiler('c')
+incdir = include_directories('src/include')
+cdata = configuration_data()
+
+# TODO: Set to true to build a single libgnunet
+gnunet_monolith = false
+
+message('Building on ' + host_machine.system())
+
+# TODO:
+#  - Go through configure.ac and convert all defines/detections
+#  - Compile all libs into a single libgnunet
+
+# FIXME lots still missing
+cdata.set_quoted('PACKAGE_VERSION', '0.21.0')
+cdata.set_quoted('GNUNET_DEFAULT_INTERFACE', 'en0')
+cdata.set_quoted('VCS_VERSION', 'mesonbuild')
+add_project_arguments('-DHAVE_CONFIG_H', language : 'c')
+
+
+# FIXME: Not all dependencies here yet
+ltdl_dep = compiler.find_library('ltdl', required : true)
+unistr_dep = compiler.find_library('unistring', required : true)
+sqlite_dep = compiler.find_library('sqlite3', required : true)
+curl_dep = dependency('libcurl')
+zlib_dep = dependency('zlib')
+mhd_dep = dependency('libmicrohttpd')
+json_dep = compiler.find_library('jansson', required : true)
+gnunetdeps = [mhd_dep,
+              dependency('libgcrypt'),
+              dependency('libsodium'),
+              curl_dep,
+              json_dep,
+              zlib_dep,
+              unistr_dep, #dependency('libunistring'),
+              ltdl_dep, #dependency('ltdl'),
+              dependency('libidn2')]
+
+add_project_arguments('-DNEED_LIBGCRYPT_VERSION="1.6.0"', language : 'c')
+
+if compiler.has_header('sys/time.h')
+  add_project_arguments('-DHAVE_SYS_TIME_H', language : 'c')
+endif
+
+if compiler.has_header('idn2.h')
+  add_project_arguments('-DHAVE_LIBIDN2', language : 'c')
+  add_project_arguments('-DHAVE_IDN2_H', language : 'c')
+endif
+
+
+if compiler.has_function('strnlen', prefix : '#include <string.h>')
+  # function exists, do whatever is required.
+  add_project_arguments('-DHAVE_STRNLEN', language : 'c')
+endif
+
+configure_file(#input: 'gnunet_private_config.h.in',
+               output : 'gnunet_private_config.h',
+               configuration : cdata)
+configuration_inc = include_directories('.')
+
+subdir('src')
diff --git a/src/arm/meson.build b/src/arm/meson.build
new file mode 100644
index 000000000..305dd3963
--- /dev/null
+++ b/src/arm/meson.build
@@ -0,0 +1,21 @@
+libgnunetarm_src = ['arm_api.c',
+                    'arm_monitor_api.c']
+
+gnunetservicearm_src = ['gnunet-service-arm.c']
+
+
+if gnunet_monolith == false
+  libgnunetarm = library('gnunetarm',
+          libgnunetarm_src,
+          dependencies: libgnunetutil_dep,
+          include_directories: [incdir, configuration_inc])
+  libgnunetarm_dep = declare_dependency(link_with : libgnunetarm)
+  executable ('gnunet-service-arm',
+              gnunetservicearm_src,
+              dependencies: [libgnunetarm_dep, libgnunetutil_dep],
+              include_directories: [incdir, configuration_inc])
+else
+  foreach p : libgnunetarm_src + gnunetservicearm_src
+    gnunet_src += 'arm/' + p
+  endforeach
+endif
diff --git a/src/block/meson.build b/src/block/meson.build
new file mode 100644
index 000000000..bccddb259
--- /dev/null
+++ b/src/block/meson.build
@@ -0,0 +1,19 @@
+libgnunetblock_src = ['block.c']
+libgnunetblockgroup_src = ['bg_bf.c']
+
+if gnunet_monolith == false
+  libgnunetblock = library('gnunetblock',
+          libgnunetblock_src,
+          dependencies: libgnunetutil_dep,
+          include_directories: [incdir, configuration_inc])
+  libgnunetblock_dep = declare_dependency(link_with : libgnunetblock)
+  libgnunetblockgroup = library('gnunetblockgroup',
+          libgnunetblockgroup_src,
+          dependencies: [libgnunetutil_dep, libgnunetblock_dep],
+          include_directories: [incdir, configuration_inc])
+  libgnunetblockgroup_dep = declare_dependency(link_with : libgnunetblockgroup)
+else
+  foreach p : libgnunetblock_src + gnunetserviceblock_src
+    gnunet_src += 'block/' + p
+  endforeach
+endif
diff --git a/src/core/meson.build b/src/core/meson.build
new file mode 100644
index 000000000..3644f7f2b
--- /dev/null
+++ b/src/core/meson.build
@@ -0,0 +1,12 @@
+coresrc = ['core_api.c',
+           'core_api_monitor_peers.c',
+           'gnunet-service-core.c',
+           'gnunet-service-core_kx.c',
+           'gnunet-service-core_sessions.c',
+           'gnunet-service-core_typemap.c'
+                ]
+
+library('gnunetcore',
+        coresrc,
+        dependencies: gnunetutil_dep,
+        include_directories: [incdir, configuration_inc])
diff --git a/src/curl/meson.build b/src/curl/meson.build
new file mode 100644
index 000000000..791118ecd
--- /dev/null
+++ b/src/curl/meson.build
@@ -0,0 +1,14 @@
+libgnunetcurl_src = ['curl.c',
+                    'curl_reschedule.c']
+
+if gnunet_monolith == false
+  libgnunetcurl = library('gnunetcurl',
+          libgnunetcurl_src,
+          dependencies: [libgnunetutil_dep, curl_dep, json_dep],
+          include_directories: [incdir, configuration_inc])
+  libgnunetcurl_dep = declare_dependency(link_with : libgnunetcurl)
+else
+  foreach p : libgnunetcurl_src + gnunetservicecurl_src
+    gnunet_src += 'curl/' + p
+  endforeach
+endif
diff --git a/src/datacache/meson.build b/src/datacache/meson.build
new file mode 100644
index 000000000..2f8305f42
--- /dev/null
+++ b/src/datacache/meson.build
@@ -0,0 +1,22 @@
+libgnunetdatacache_src = ['datacache.c']
+
+libgnunetplugindatacache_sqlite_src = ['plugin_datacache_sqlite.c']
+
+if gnunet_monolith == false
+  libgnunetdatacache = library('gnunetdatacache',
+          libgnunetdatacache_src,
+          dependencies: [libgnunetutil_dep, libgnunetstatistics_dep],
+          include_directories: [incdir, configuration_inc])
+  libgnunetdatacache_dep = declare_dependency(link_with : libgnunetdatacache)
+  libgnunetplugindatacache_sqlite = library('gnunet_plugin_datacache_sqlite',
+          libgnunetplugindatacache_sqlite_src,
+          dependencies: [libgnunetutil_dep,
+                         libgnunetdatacache_dep,
+                         sqlite_dep,
+                         libgnunetsq_dep],
+          include_directories: [incdir, configuration_inc])
+else
+  foreach p : libgnunetdatacache_src
+    gnunet_src += 'datacache/' + p
+  endforeach
+endif
diff --git a/src/datastore/meson.build b/src/datastore/meson.build
new file mode 100644
index 000000000..e98e58dcf
--- /dev/null
+++ b/src/datastore/meson.build
@@ -0,0 +1,25 @@
+libgnunetdatastore_src = ['datastore_api.c']
+
+gnunetservicedatastore_src = ['gnunet-service-datastore.c']
+
+
+if gnunet_monolith == false
+  libgnunetdatastore = library('gnunetdatastore',
+          libgnunetdatastore_src,
+          dependencies: [libgnunetutil_dep,
+                         libgnunetstatistics_dep,
+                         libgnunetdatacache_dep],
+          include_directories: [incdir, configuration_inc])
+  libgnunetdatastore_dep = declare_dependency(link_with : libgnunetdatastore)
+  executable ('gnunet-service-datastore',
+              gnunetservicedatastore_src,
+              dependencies: [libgnunetdatastore_dep,
+                             libgnunetutil_dep,
+                             libgnunetstatistics_dep,
+                             libgnunetdatacache_dep],
+              include_directories: [incdir, configuration_inc])
+else
+  foreach p : libgnunetdatastore_src + gnunetservicedatastore_src
+    gnunet_src += 'datastore/' + p
+  endforeach
+endif
diff --git a/src/hello/meson.build b/src/hello/meson.build
new file mode 100644
index 000000000..1e5fc4ff6
--- /dev/null
+++ b/src/hello/meson.build
@@ -0,0 +1,23 @@
+libgnunethello_src = ['hello.c',
+                      'address.c',
+                      'hello-ng.c',
+                      'hello-uri.c']
+
+gnunethello_src = ['gnunet-hello.c']
+
+
+if gnunet_monolith == false
+  libgnunethello = library('gnunethello',
+          libgnunethello_src,
+          dependencies: libgnunetutil_dep,
+          include_directories: [incdir, configuration_inc])
+  libgnunethello_dep = declare_dependency(link_with : libgnunethello)
+  executable ('gnunet-hello',
+              gnunethello_src,
+              dependencies: [libgnunethello_dep, libgnunetutil_dep],
+              include_directories: [incdir, configuration_inc])
+else
+  foreach p : libgnunethello_src + gnunethello_src
+    gnunet_src += 'hello/' + p
+  endforeach
+endif
diff --git a/src/json/meson.build b/src/json/meson.build
new file mode 100644
index 000000000..cbb826a66
--- /dev/null
+++ b/src/json/meson.build
@@ -0,0 +1,17 @@
+libgnunetjson_src = ['json.c',
+                    'json_generator.c',
+                    'json_helper.c',
+                    'json_mhd.c',
+                    'json_pack.c']
+
+if gnunet_monolith == false
+  libgnunetjson = library('gnunetjson',
+          libgnunetjson_src,
+          dependencies: [libgnunetutil_dep, json_dep, mhd_dep, zlib_dep],
+          include_directories: [incdir, configuration_inc])
+  libgnunetjson_dep = declare_dependency(link_with : libgnunetjson)
+else
+  foreach p : libgnunetjson_src + gnunetservicejson_src
+    gnunet_src += 'json/' + p
+  endforeach
+endif
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 000000000..09dc00f4d
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,74 @@
+if gnunet_monolith == true
+  gnunet_src = []
+endif
+
+subdir('util')
+subdir('nt')
+subdir('hello')
+subdir('block')
+subdir('arm')
+subdir('statistics')
+#$(TESTING)')
+if json_dep.found()
+ subdir('json')
+endif
+if curl_dep.found()
+  subdir('curl')
+endif
+subdir('rest')
+subdir('peerinfo')
+if sqlite_dep.found()
+  subdir('sq')
+endif
+#subdir('$(MYSQL_DIR)')
+#subdir('$(POSTGRES_DIR)')
+subdir('datacache')
+subdir('datastore')
+#subdir('template')
+#subdir('peerstore')
+#subdir('ats')
+#subdir('nat')
+#subdir('nat-auto')
+#subdir('fragmentation')
+#subdir('transport')
+#subdir('ats-tool')
+#subdir('core')
+##subdir('$(TESTBED)')
+#subdir('nse')
+#subdir('dhtu')
+#subdir('dht')
+#subdir('hostlist')
+#subdir('topology')
+#subdir('regex')
+#subdir('dns')
+#subdir('identity')
+#subdir('gnsrecord')
+#subdir('namecache')
+#subdir('namestore')
+#subdir('peerinfo-tool')
+#subdir('cadet')
+#subdir('set')
+#subdir('seti')
+#subdir('setu')
+#subdir('consensus')
+#subdir('scalarproduct')
+#subdir('revocation')
+#subdir('vpn')
+#subdir('gns')
+#subdir('zonemaster')
+##subdir('$(CONVERSATION_DIR)')
+#subdir('fs')
+#subdir('exit')
+#subdir('pt')
+#subdir('secretsharing')
+#subdir('reclaim')
+#subdir('messenger')
+##subdir('$(EXP_DIR)')
+#subdir('integration-tests')
+
+if gnunet_monolith == true
+  libgnunet = library('gnunet',
+                      gnunet_src,
+                      dependencies: gnunetdeps,
+                      include_directories: [incdir, configuration_inc])
+endif
diff --git a/src/nt/meson.build b/src/nt/meson.build
new file mode 100644
index 000000000..cd0b757ac
--- /dev/null
+++ b/src/nt/meson.build
@@ -0,0 +1,13 @@
+libgnunetnt_src = ['nt.c']
+
+if gnunet_monolith == false
+  libgnunetnt = library('gnunetnt',
+          libgnunetnt_src,
+          dependencies: libgnunetutil_dep,
+          include_directories: [incdir, configuration_inc])
+  libgnunetnt_dep = declare_dependency(link_with : libgnunetnt)
+else
+  foreach p : libgnunetnt_src + gnunetservicent_src
+    gnunet_src += 'nt/' + p
+  endforeach
+endif
diff --git a/src/peerinfo/meson.build b/src/peerinfo/meson.build
new file mode 100644
index 000000000..2760023f7
--- /dev/null
+++ b/src/peerinfo/meson.build
@@ -0,0 +1,24 @@
+libgnunetpeerinfo_src = ['peerinfo_api.c',
+                         'peerinfo_api_notify.c']
+
+gnunetservicepeerinfo_src = ['gnunet-service-peerinfo.c']
+
+
+if gnunet_monolith == false
+  libgnunetpeerinfo = library('gnunetpeerinfo',
+          libgnunetpeerinfo_src,
+          dependencies: [libgnunetutil_dep, libgnunethello_dep],
+          include_directories: [incdir, configuration_inc])
+  libgnunetpeerinfo_dep = declare_dependency(link_with : libgnunetpeerinfo)
+  executable ('gnunet-service-peerinfo',
+              gnunetservicepeerinfo_src,
+              dependencies: [libgnunetpeerinfo_dep,
+                             libgnunetutil_dep,
+                             libgnunetstatistics_dep,
+                             libgnunethello_dep],
+              include_directories: [incdir, configuration_inc])
+else
+  foreach p : libgnunetpeerinfo_src + gnunetservicepeerinfo_src
+    gnunet_src += 'peerinfo/' + p
+  endforeach
+endif
diff --git a/src/rest/meson.build b/src/rest/meson.build
new file mode 100644
index 000000000..f994e0a3e
--- /dev/null
+++ b/src/rest/meson.build
@@ -0,0 +1,20 @@
+libgnunetrest_src = ['rest.c']
+
+gnunetservicerest_src = ['gnunet-rest-server.c']
+
+
+if gnunet_monolith == false
+  libgnunetrest = library('gnunetrest',
+          libgnunetrest_src,
+          dependencies: [libgnunetutil_dep, mhd_dep],
+          include_directories: [incdir, configuration_inc])
+  libgnunetrest_dep = declare_dependency(link_with : libgnunetrest)
+  executable ('gnunet-rest-server',
+              gnunetservicerest_src,
+              dependencies: [libgnunetrest_dep, libgnunetutil_dep, mhd_dep],
+              include_directories: [incdir, configuration_inc])
+else
+  foreach p : libgnunetrest_src + gnunetservicerest_src
+    gnunet_src += 'rest/' + p
+  endforeach
+endif
diff --git a/src/sq/meson.build b/src/sq/meson.build
new file mode 100644
index 000000000..083ce9fbe
--- /dev/null
+++ b/src/sq/meson.build
@@ -0,0 +1,17 @@
+libgnunetsq_src = ['sq.c',
+                   'sq_exec.c',
+                   'sq_prepare.c',
+                   'sq_query_helper.c',
+                   'sq_result_helper.c']
+
+if gnunet_monolith == false
+  libgnunetsq = library('gnunetsq',
+          libgnunetsq_src,
+          dependencies: [libgnunetutil_dep, sqlite_dep],
+          include_directories: [incdir, configuration_inc])
+  libgnunetsq_dep = declare_dependency(link_with : libgnunetsq)
+else
+  foreach p : libgnunetsq_src + gnunetservicesq_src
+    gnunet_src += 'sq/' + p
+  endforeach
+endif
diff --git a/src/statistics/meson.build b/src/statistics/meson.build
new file mode 100644
index 000000000..78d8c1e3e
--- /dev/null
+++ b/src/statistics/meson.build
@@ -0,0 +1,20 @@
+libgnunetstatistics_src = ['statistics_api.c']
+
+gnunetservicestatistics_src = ['gnunet-service-statistics.c']
+
+
+if gnunet_monolith == false
+  libgnunetstatistics = library('gnunetstatistics',
+          libgnunetstatistics_src,
+          dependencies: libgnunetutil_dep,
+          include_directories: [incdir, configuration_inc])
+  libgnunetstatistics_dep = declare_dependency(link_with : libgnunetstatistics)
+  executable ('gnunet-service-statistics',
+              gnunetservicestatistics_src,
+              dependencies: [libgnunetstatistics_dep, libgnunetutil_dep],
+              include_directories: [incdir, configuration_inc])
+else
+  foreach p : libgnunetstatistics_src + gnunetservicestatistics_src
+    gnunet_src += 'statistics/' + p
+  endforeach
+endif
diff --git a/src/util/meson.build b/src/util/meson.build
new file mode 100644
index 000000000..4d677a7b2
--- /dev/null
+++ b/src/util/meson.build
@@ -0,0 +1,82 @@
+libgnunetutil_src = ['bandwidth.c',
+       # $(BENCHMARK)',
+       'bio.c',
+       'buffer.c',
+       'child_management.c',
+       'client.c',
+       'common_allocation.c',
+       'common_endian.c',
+       'common_logging.c',
+       'compress.c',
+       'configuration.c',
+       'configuration_helper.c',
+       'consttime_memcmp.c',
+       'container_bloomfilter.c',
+       'container_heap.c',
+       'container_multihashmap.c',
+       'container_multishortmap.c',
+       'container_multiuuidmap.c',
+       'container_multipeermap.c',
+       'container_multihashmap32.c',
+       'crypto_symmetric.c',
+       'crypto_crc.c',
+       'crypto_cs.c',
+       'crypto_ecc.c',
+       'crypto_ecc_gnsrecord.c',
+       #'$(DLOG)',
+       'crypto_ecc_setup.c',
+       'crypto_edx25519.c',
+       'crypto_hash.c',
+       'crypto_hash_file.c',
+       'crypto_hkdf.c',
+       'crypto_kdf.c',
+       'crypto_mpi.c',
+       'crypto_paillier.c',
+       'crypto_pow.c',
+       'crypto_random.c',
+       'crypto_rsa.c',
+       'disk.c',
+       'disk.h',
+       'dnsparser.c',
+       'dnsstub.c',
+       'getopt.c',
+       'getopt_helpers.c',
+       'helper.c',
+       'load.c',
+       'mst.c',
+       'mq.c',
+       'nc.c',
+       'network.c',
+       'op.c',
+       'os_installation.c',
+       'os_network.c',
+       'os_priority.c',
+       'peer.c',
+       'plugin.c',
+       'program.c',
+       'regex.c',
+       'resolver_api.c',
+       'resolver.h',
+       'scheduler.c',
+       'service.c',
+       'signal.c',
+       'strings.c',
+       'time.c',
+       'tun.c',
+       'uri.c',
+       'speedup.c',
+       'speedup.h',
+       'proc_compat.c',
+            'gnunet_error_codes.c']
+
+if gnunet_monolith == false
+  libgnunetutil = library('gnunetutil',
+          libgnunetutil_src,
+          dependencies: gnunetdeps,
+          include_directories: [incdir, configuration_inc])
+  libgnunetutil_dep = declare_dependency(link_with : libgnunetutil)
+else
+  foreach p : libgnunetutil_src
+    gnunet_src += 'util/' + p
+  endforeach
+endif

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]