|
| 1 | +From 9d14b28d5c5748abd3d073fbf65dd4cb6b50fdec Mon Sep 17 00:00:00 2001 |
| 2 | +From: Michal Pogoda <michalpogoda@hotmail.com> |
| 3 | +Date: Tue, 17 Mar 2020 16:55:20 +0100 |
| 4 | +Subject: [PATCH 1/2] Preparing for library build |
| 5 | + |
| 6 | +--- |
| 7 | + Makefile.am | 19 +++++++++++++++++++ |
| 8 | + configure.ac | 5 ++++- |
| 9 | + libcrun.pc.in | 11 +++++++++++ |
| 10 | + libocispec/Makefile.am | 13 +++---------- |
| 11 | + src/libcrun/container.c | 2 +- |
| 12 | + 5 files changed, 38 insertions(+), 12 deletions(-) |
| 13 | + create mode 100644 libcrun.pc.in |
| 14 | + |
| 15 | +diff --git a/Makefile.am b/Makefile.am |
| 16 | +index 8f96a4f..5e86199 100644 |
| 17 | +--- a/Makefile.am |
| 18 | ++++ b/Makefile.am |
| 19 | +@@ -38,6 +38,25 @@ libcrun_la_SOURCES = src/libcrun/utils.c \ |
| 20 | + libcrun_la_CFLAGS = -I $(abs_top_builddir)/libocispec/src -I $(abs_top_srcdir)/libocispec/src |
| 21 | + libcrun_la_LIBADD = libocispec/libocispec.la |
| 22 | + |
| 23 | ++pkginclude_HEADERS = src/libcrun/container.h \ |
| 24 | ++ config.h \ |
| 25 | ++ src/libcrun/error.h \ |
| 26 | ++ src/libcrun/status.h \ |
| 27 | ++ src/libcrun/utils.h \ |
| 28 | ++ libocispec/src/runtime_spec_schema_config_schema.h \ |
| 29 | ++ libocispec/src/runtime_spec_schema_config_linux.h \ |
| 30 | ++ libocispec/src/runtime_spec_schema_config_solaris.h \ |
| 31 | ++ libocispec/src/runtime_spec_schema_config_windows.h \ |
| 32 | ++ libocispec/src/runtime_spec_schema_config_vm.h \ |
| 33 | ++ libocispec/src/runtime_spec_schema_defs.h \ |
| 34 | ++ libocispec/src/runtime_spec_schema_defs_linux.h \ |
| 35 | ++ libocispec/src/runtime_spec_schema_defs_windows.h \ |
| 36 | ++ libocispec/src/runtime_spec_schema_defs_vm.h \ |
| 37 | ++ libocispec/src/json_common.h |
| 38 | ++ |
| 39 | ++pkgconfigdir = @pkgconfigdir@ |
| 40 | ++pkgconfig_DATA = libcrun.pc |
| 41 | ++ |
| 42 | + if PYTHON_BINDINGS |
| 43 | + pyexec_LTLIBRARIES = python_crun.la |
| 44 | + python_crun_la_SOURCES = python/crun_python.c |
| 45 | +diff --git a/configure.ac b/configure.ac |
| 46 | +index ea6ed11..cab11ec 100644 |
| 47 | +--- a/configure.ac |
| 48 | ++++ b/configure.ac |
| 49 | +@@ -123,7 +123,10 @@ AC_SEARCH_LIBS([argp_parse], [argp], [], [AC_MSG_ERROR([*** argp functions not f |
| 50 | + AM_CONDITIONAL([PYTHON_BINDINGS], [test "x$with_python_bindings" = "xyes"]) |
| 51 | + AM_CONDITIONAL([CRIU_SUPPORT], [test "x$have_criu" = "xyes"]) |
| 52 | + |
| 53 | +-AC_CONFIG_FILES([Makefile rpm/crun.spec]) |
| 54 | ++PKG_INSTALLDIR |
| 55 | ++AC_SUBST(pkgconfigdir) |
| 56 | ++ |
| 57 | ++AC_CONFIG_FILES([Makefile rpm/crun.spec libcrun.pc]) |
| 58 | + |
| 59 | + AC_CONFIG_SUBDIRS([libocispec]) |
| 60 | + AC_OUTPUT |
| 61 | +diff --git a/libcrun.pc.in b/libcrun.pc.in |
| 62 | +new file mode 100644 |
| 63 | +index 0000000..54ee2eb |
| 64 | +--- /dev/null |
| 65 | ++++ b/libcrun.pc.in |
| 66 | +@@ -0,0 +1,11 @@ |
| 67 | ++prefix=@prefix@ |
| 68 | ++exec_prefix=@exec_prefix@ |
| 69 | ++libdir=@libdir@ |
| 70 | ++includedir=@includedir@ |
| 71 | ++ |
| 72 | ++Name: LibCRun |
| 73 | ++Description: Library for running the OCI containers |
| 74 | ++Version: 0.1.13 |
| 75 | ++Requires: libseccomp libcap yajl |
| 76 | ++Cflags: -I${includedir}/crun -I${includedir} |
| 77 | ++Libs: -L${libdir} -lseccomp -lcap -lyajl -lcrun |
| 78 | +\ No newline at end of file |
| 79 | +diff --git a/libocispec/Makefile.am b/libocispec/Makefile.am |
| 80 | +index 65bed45..53a8b32 100644 |
| 81 | +--- a/libocispec/Makefile.am |
| 82 | ++++ b/libocispec/Makefile.am |
| 83 | +@@ -4,8 +4,7 @@ AM_CFLAGS = $(WARN_CFLAGS) -I$(top_srcdir)/src -I$(top_builddir)/src |
| 84 | + |
| 85 | + GITIGNOREFILES = build-aux/ gtk-doc.make config.h.in aclocal.m4 |
| 86 | + |
| 87 | +-noinst_LTLIBRARIES = libocispec.la |
| 88 | +-noinst_LIBRARIES = libocispec.a |
| 89 | ++lib_LTLIBRARIES = libocispec.la |
| 90 | + |
| 91 | + SOURCE_FILES = src/json_common.c \ |
| 92 | + src/image_spec_schema_config_schema.c \ |
| 93 | +@@ -25,9 +24,8 @@ SOURCE_FILES = src/json_common.c \ |
| 94 | + src/runtime_spec_schema_defs_vm.c \ |
| 95 | + src/runtime_spec_schema_defs_windows.c \ |
| 96 | + src/runtime_spec_schema_state_schema.c \ |
| 97 | +- src/image_manifest_items_image_manifest_items_schema.c \ |
| 98 | +- src/json_common.c |
| 99 | +- |
| 100 | ++ src/image_manifest_items_image_manifest_items_schema.c |
| 101 | ++ |
| 102 | + HEADER_FILES = $(SOURCE_FILES:.c=.h) |
| 103 | + |
| 104 | + src/json_common.h src/json_common.c: |
| 105 | +@@ -61,15 +59,10 @@ BUILT_SOURCES = $(HEADER_FILES) $(SOURCE_FILES) |
| 106 | + libocispec_la_SOURCES = $(SOURCE_FILES) \ |
| 107 | + src/read-file.c |
| 108 | + |
| 109 | +-libocispec_a_SOURCES = |
| 110 | +- |
| 111 | + CLEANFILES += $(HEADER_FILES) $(SOURCE_FILES) |
| 112 | + |
| 113 | + TESTS_LDADD = libocispec.la $(SELINUX_LIBS) $(YAJL_LIBS) |
| 114 | + |
| 115 | +-libocispec.a: libocispec.la |
| 116 | +- $(LIBTOOL) --mode=link $(GCC) libocispec.la -o libocispec.a |
| 117 | +- |
| 118 | + tests_test_1_SOURCES = tests/test-1.c |
| 119 | + tests_test_1_LDADD = $(TESTS_LDADD) |
| 120 | + |
| 121 | +diff --git a/src/libcrun/container.c b/src/libcrun/container.c |
| 122 | +index 22cb41f..7f7dafc 100644 |
| 123 | +--- a/src/libcrun/container.c |
| 124 | ++++ b/src/libcrun/container.c |
| 125 | +@@ -1778,7 +1778,7 @@ libcrun_container_run (libcrun_context_t *context, libcrun_container_t *containe |
| 126 | + crun_set_output_handler (log_write_to_stderr, NULL, false); |
| 127 | + libcrun_fail_with_error ((*err)->status, "%s", (*err)->msg); |
| 128 | + } |
| 129 | +- exit (ret); |
| 130 | ++ _exit (ret); |
| 131 | + } |
| 132 | + |
| 133 | + int |
| 134 | +-- |
| 135 | +2.20.1 |
| 136 | + |
0 commit comments