[oe-commits] [openembedded-core] 33/69: forktest: add

git at git.openembedded.org git at git.openembedded.org
Wed Mar 23 14:26:21 UTC 2016


rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit d0ecd065b06fc436dedae93616608a827cb70850
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Tue Mar 8 09:50:09 2016 +0000

    forktest: add
---
 meta/recipes-sato/forktest/files/forktest.c | 23 +++++++++++++++++++++++
 meta/recipes-sato/forktest/forktest.bb      | 21 +++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/meta/recipes-sato/forktest/files/forktest.c b/meta/recipes-sato/forktest/files/forktest.c
new file mode 100644
index 0000000..f7bec75
--- /dev/null
+++ b/meta/recipes-sato/forktest/files/forktest.c
@@ -0,0 +1,23 @@
+#include <glib.h>
+
+static void
+child_setup (gpointer user_data)
+{
+  g_print ("in child setup\n");
+}
+
+int
+main (int argc, char **argv)
+{
+  GError *error = NULL;
+  char *argp[] = { "touch", "/tmp/foo", NULL };
+
+  if (!g_spawn_sync (NULL, argp, NULL,
+                     G_SPAWN_SEARCH_PATH, child_setup, NULL,
+                     NULL, NULL, NULL, &error)) {
+    g_print ("Spawn failed: %s\n", error->message);
+  } else {
+    g_print ("Spawn worked\n");
+  }
+  return 0;
+}
diff --git a/meta/recipes-sato/forktest/forktest.bb b/meta/recipes-sato/forktest/forktest.bb
new file mode 100644
index 0000000..578d5cc
--- /dev/null
+++ b/meta/recipes-sato/forktest/forktest.bb
@@ -0,0 +1,21 @@
+SUMMARY = "forktest"
+LICENSE = "MIT"
+
+SRC_URI = "file://forktest.c"
+
+DEPENDS = "glib-2.0"
+
+inherit pkgconfig
+
+S = "${WORKDIR}"
+
+do_configure[noexec] = "1"
+
+do_compile() {
+             ${CC} `pkg-config --cflags --libs glib-2.0` ${CFLAGS} ${LDFLAGS} -o forktest forktest.c
+}
+
+do_install() {
+             mkdir --parents ${D}${bindir}
+             install forktest ${D}${bindir}
+}

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list