From 283297238713bfa261e100bc3dc8fb6fd842d55e Mon Sep 17 00:00:00 2001 From: Trumeet Date: Wed, 27 Jul 2022 15:29:27 -0700 Subject: build(acronc): switch to Meson --- client/acronc/helpers.c | 2 +- client/acronc/helpers.h | 2 +- client/acronc/meson.build | 37 +++++++++++++++++++++++++++++++++++ client/acronc/subprojects/json-c.wrap | 2 ++ client/acronc/subprojects/libacron | 1 + client/acronc/subprojects/libuv.wrap | 12 ++++++++++++ 6 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 client/acronc/meson.build create mode 100644 client/acronc/subprojects/json-c.wrap create mode 120000 client/acronc/subprojects/libacron create mode 100644 client/acronc/subprojects/libuv.wrap 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 #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #include 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 -#ifdef WIN32 +#ifdef _WIN32 #include #include 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 -- cgit v1.2.3