From bcf6ff15a41c21cc9ee0fc241a897e1c11e81c2d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Fri, 20 Mar 2015 01:26:48 +0300 Subject: [PATCH] modules/rpm: add example Signed-off-by: Igor Gnatenko --- manual tests/4 rpm/lib.c | 6 ++++++ manual tests/4 rpm/lib.h | 1 + manual tests/4 rpm/main.c | 8 ++++++++ manual tests/4 rpm/meson.build | 13 +++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 manual tests/4 rpm/lib.c create mode 100644 manual tests/4 rpm/lib.h create mode 100644 manual tests/4 rpm/main.c create mode 100644 manual tests/4 rpm/meson.build diff --git a/manual tests/4 rpm/lib.c b/manual tests/4 rpm/lib.c new file mode 100644 index 000000000..efc230aab --- /dev/null +++ b/manual tests/4 rpm/lib.c @@ -0,0 +1,6 @@ +#include"lib.h" + +char *meson_print(void) +{ + return "Hello, world!"; +} diff --git a/manual tests/4 rpm/lib.h b/manual tests/4 rpm/lib.h new file mode 100644 index 000000000..08fc9611c --- /dev/null +++ b/manual tests/4 rpm/lib.h @@ -0,0 +1 @@ +char *meson_print(void); diff --git a/manual tests/4 rpm/main.c b/manual tests/4 rpm/main.c new file mode 100644 index 000000000..5c4672192 --- /dev/null +++ b/manual tests/4 rpm/main.c @@ -0,0 +1,8 @@ +#include +#include +int main(int argc, char **argv) +{ + char *t = meson_print(); + printf("%s", t); + return 0; +} diff --git a/manual tests/4 rpm/meson.build b/manual tests/4 rpm/meson.build new file mode 100644 index 000000000..bb8991689 --- /dev/null +++ b/manual tests/4 rpm/meson.build @@ -0,0 +1,13 @@ +project('test spec', 'c') + +rpm = import('rpm') +dependency('zlib') + +lib = shared_library('mesontest_shared', ['lib.c', 'lib.h'], + version : '0.1', soversion : '0', + install : true) +executable('mesontest-bin', 'main.c', + link_with : lib, + install : true) + +rpm.generate_spec()