aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrumeet <yuuta@yuuta.moe>2022-07-27 15:29:27 -0700
committerTrumeet <yuuta@yuuta.moe>2022-07-27 15:29:27 -0700
commit283297238713bfa261e100bc3dc8fb6fd842d55e (patch)
tree82ba64337e9d8c69a0f8f2e0430747481a4f1b6f
parent4a4238917aed458d25da752ef8019fd97fa88724 (diff)
downloadacron-283297238713bfa261e100bc3dc8fb6fd842d55e.tar
acron-283297238713bfa261e100bc3dc8fb6fd842d55e.tar.gz
acron-283297238713bfa261e100bc3dc8fb6fd842d55e.tar.bz2
acron-283297238713bfa261e100bc3dc8fb6fd842d55e.zip
build(acronc): switch to Meson
-rw-r--r--client/acronc/helpers.c2
-rw-r--r--client/acronc/helpers.h2
-rw-r--r--client/acronc/meson.build37
-rw-r--r--client/acronc/subprojects/json-c.wrap2
l---------client/acronc/subprojects/libacron1
-rw-r--r--client/acronc/subprojects/libuv.wrap12
6 files changed, 54 insertions, 2 deletions
diff --git a/client/acronc/helpers.c b/client/acronc/helpers.c
index 9e141d4..40f7df3 100644
--- a/client/acronc/helpers.c
+++ b/client/acronc/helpers.c
@@ -8,7 +8,7 @@
#include <string.h>
#include <errno.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#include <ws2ipdef.h>
diff --git a/client/acronc/helpers.h b/client/acronc/helpers.h
index e983439..95b3ad2 100644
--- a/client/acronc/helpers.h
+++ b/client/acronc/helpers.h
@@ -7,7 +7,7 @@
#include <libac.h>
-#ifdef WIN32
+#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
diff --git a/client/acronc/meson.build b/client/acronc/meson.build
new file mode 100644
index 0000000..a143905
--- /dev/null
+++ b/client/acronc/meson.build
@@ -0,0 +1,37 @@
+project('acronc', 'c',
+ version : '1.0',
+ license : 'GPL-2.0-only')
+
+xtra_link_args = []
+xtra_c_args = [ '-D_POSIX_C_SOURCE=200809L' ]
+if get_option('debug') == true
+ xtra_c_args += '-DDEBUG'
+endif
+
+libac_dep = dependency('libac',
+ fallback : ['libacron', 'libac_dep'],
+ default_options: [ 'default_library=static' ]
+)
+libuv_dep = dependency('libuv',
+ fallback : ['libuv', 'libuv_dep'],
+ default_options: [ 'default_library=static' ]
+)
+
+acronc_sources = [
+ 'async_dns.c',
+ 'client.c',
+ 'config.c',
+ 'handler_signal.c',
+ 'handler_socket.c',
+ 'handler_stdin.c',
+ 'helpers.c',
+ 'log.c',
+ 'main.c'
+]
+
+executable('acronc', acronc_sources,
+ dependencies : [ libac_dep, libuv_dep ],
+ link_args : xtra_link_args,
+ c_args : xtra_c_args,
+ install : true
+)
diff --git a/client/acronc/subprojects/json-c.wrap b/client/acronc/subprojects/json-c.wrap
new file mode 100644
index 0000000..3b53361
--- /dev/null
+++ b/client/acronc/subprojects/json-c.wrap
@@ -0,0 +1,2 @@
+[wrap-redirect]
+filename = libacron/subprojects/json-c.wrap
diff --git a/client/acronc/subprojects/libacron b/client/acronc/subprojects/libacron
new file mode 120000
index 0000000..7af75e9
--- /dev/null
+++ b/client/acronc/subprojects/libacron
@@ -0,0 +1 @@
+../../libacron \ No newline at end of file
diff --git a/client/acronc/subprojects/libuv.wrap b/client/acronc/subprojects/libuv.wrap
new file mode 100644
index 0000000..6bd828d
--- /dev/null
+++ b/client/acronc/subprojects/libuv.wrap
@@ -0,0 +1,12 @@
+[wrap-file]
+directory = libuv-v1.44.2
+source_url = https://dist.libuv.org/dist/v1.44.2/libuv-v1.44.2.tar.gz
+source_filename = libuv-v1.44.2.tar.gz
+source_hash = ccfcdc968c55673c6526d8270a9c8655a806ea92468afcbcabc2b16040f03cb4
+patch_filename = libuv_1.44.2-1_patch.zip
+patch_url = https://wrapdb.mesonbuild.com/v2/libuv_1.44.2-1/get_patch
+patch_hash = c77f6104cffd53f697c3030fccbfd5cc684b59772e8f24529b01908ee27bd751
+wrapdb_version = 1.44.2-1
+
+[provide]
+libuv = libuv_dep