2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-27 04:18:27 +00:00

30 Commits

Author SHA1 Message Date
Adrian Reber
222ad25bed Makefiles: auto-detect python version - prefer python2
This prepares CRIT for python2/python3 compatibility by auto-detecting
the installed python version. python2 is detected first and then the
variable PYTHON is set.

By setting the variable PYTHON to python2/python3 the user can override
the auto-detection.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2018-05-25 00:23:00 +03:00
Cyrill Gorcunov
0b6f9c7975 build: Reused .FORCE from nmk
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-23 20:23:14 +03:00
Kir Kolyshkin
4669d6330e crit: fix 'make install'
Apparently, setup.py from distutils interprets --root= option without
an argument as "--root=." and we end up with what is described
in https://github.com/xemul/criu/issues/309.

Fix is to prepend DESTDIR value (if any) to --prefix argument.

v2: fix uninstall as well
v3: same code, resent via gmail

Reported-by: Juraj Oršulić <juraj.orsulic@fer.hr>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-05-19 09:17:19 +03:00
Kir Kolyshkin
ab90777ca1 Makefiles: protect from % rules, don't rebuild
GNU make tries to rebuild any makefiles it uses. While in general it's
a good idea (and it is used e.g. in autoconf-based builds), in our case
it is not necessary, as all the makefiles are static.

More to say, as we have a few "match anything" rules for subdirectories,
Makefiles in these subdirs are also matching these rules, which leads to
excessive (re)building while a particular makefile is needed.

Protect such Makefiles with explicit (or pattern) rules, so make knows
it should do nothing to rebuild those.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:08 +03:00
Kir Kolyshkin
85b04c8bfd Makefiles: nuke $(SRC_DIR)
As all builds are done from top source dir, there is no need
to have SRC_DIR.

Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-15 09:36:08 +03:00
Kir Kolyshkin
2a9d9c6615 lib Makefiles: integrate
Our whole system of Makefiles are integrated from top to bottom,
meaning:

 1. The paths in sub-makefiles are relative to the top source dir.
 2. Sub-makefiles are executed via make $(build)=<SUBDIR> <TARGET>

For some reason, makefiles under lib/ are the exclusion. Let's fix it.

Side effect: you can now build any individual target under lib/,
for example, "make lib/c/libcriu.so" works.

[v2: use the .FORCE, thanks to dsafonov@]

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-03-06 20:44:07 +03:00
Cyrill Gorcunov
d647f47f20 criu: install -- Make INCLUDEDIR not carry criu directory
INCLUDEDIR gonna be used in compel.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-21 11:22:24 +03:00
Raghavendra Prabhu
af74019d66 Ensure the install process is PEP-394 compliant.
The installation needs to use python2, but it uses python in the
Makefile which fails later with syntax error
(since it is written for python2).

As per PEP-394 - https://www.python.org/dev/peps/pep-0394/ -,
'all distributions should ensure that python refers to the same target
as python2 .', hence this change.

Therefore, python2 is used by default in lib/Makefile, though
this can be overriden with PYTHON_BIN.

Tested with:

a) PYTHON_BIN=python2 make install
b) make install

c) export PYTHON_BIN=python2
   make test

Signed-off-by: Raghavendra Prabhu <me at rdprabhu dot com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-12-05 11:49:19 +03:00
Kir Kolyshkin
9e2ce61cac Makefile nitpicks
1. As __nmk_dir already ends with a slash, there's no need
   for an extra one.

2. No need to include macro.mk into criu/Makefile -- nothing it defines
   is used from there.

Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-10-05 13:11:26 +03:00
Ruslan Kuprieiev
8a7a360d6d uninstall: use --record with setup.py, v2
--record option allows us to keep track of files that are being
installed by writing them to specified file. We can than use that
file to do proper cleanup on uninstall.

v2, drop -r, as we shouldn't really care about dirs, because
    setup.py doesn't report them to us.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-05-06 14:38:29 +03:00
Cyrill Gorcunov
3276406d65 build: Add uninstall action
While most are handled from the scratch there is a significant
problem with python setup. So I added some preliminaty solution,
probably someohe with good knowledge of how setup.py works
improve it later.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-04-27 14:13:35 +03:00
Tycho Andersen
70afb3bde2 build: clean up various other bits
.gitid, and some of the build directories from setup.py need to be cleaned
on 'clean'.

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-03-16 16:16:08 +03:00
Cyrill Gorcunov
029650bfed build: Unify phony forms usage
Explicit .PHONY is preferred for style unification sake.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-03-16 16:16:08 +03:00
Cyrill Gorcunov
d469c5f865 build: lib-py -- Fix building missing rpc module
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-20 13:39:10 +03:00
Cyrill Gorcunov
b95bc0d1eb build: pycriu -- Move into lib/py
As was intended from the scratch.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-19 14:32:19 +03:00
Cyrill Gorcunov
8e506041ef build: Bring install back to life
Fixes #114

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-19 14:31:42 +03:00
Cyrill Gorcunov
c1f31142f8 build: lib -- Fix building for C library
- drop unneeded @built-in.o rule
- use proper @CRIU_SO for -soname option
- add dep on version change

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-18 14:15:12 +03:00
Cyrill Gorcunov
4854940d6f build: Move versions definitions on top level
- define all versions in Makefile.versions toplevel file
 - rename CRTOOLSVERSION to CRIU_VERSION (and add CRIU_ prefixes)
 - rename versions for C librabry

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-18 14:15:09 +03:00
Tycho Andersen
d45116ff8b build: crit -- Fix install target
Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:53 +03:00
Cyrill Gorcunov
db6cb69394 build: Move everything criu related into criu directory
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:45 +03:00
Cyrill Gorcunov
da0eb1483b build: Move C and Python libraries into lib
Both CRIU library and CRIT python data are moved into
lib/c and lib/py.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2016-02-15 15:32:39 +03:00
Christopher Covington
89bb170a26 Always use ARCH_DIR
The top-level makefile defines an ARCH_DIR variable. Always use
it rather than referencing ARCH directly, since ARCH may be set
by the user on the command line and that raw input may not be
what needs to be used internally.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:33:11 +04:00
Christopher Covington
f287d29ebe Fix library build
A user may have necessary linker directories specified in CFLAGS.
Make sure to include them.

Change-Id: I76c2a7bd6e34cc282bfcd5f83cc69ae7fa2c8cc2

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-10 14:31:53 +04:00
Adrian Reber
b0e6ebc1c7 Makefile: add soname to libcriu.so
Using a soname makes it easy for applications to
detect if the ABI of libcriu.so has changed.
It still creates libcriu.so as before in lib. During
'make install' additional links are created:

 libcriu.so -> libcriu.so.1.0
 libcriu.so.1 -> libcriu.so.1.0

Signed-off-by: Adrian Reber <adrian@lisas.de>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2014-02-07 15:35:20 +04:00
Ruslan Kuprieiev
ba18a5e16c make: lib -- use ldflags-so and obj-ext-src-y
We need ldflags-so to link libcriu with -lprotobuf-c
and rpc.pb-c.o to use RPC.

Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-12-18 14:26:08 +04:00
Pavel Emelyanov
60af777286 lib: Don't compile-in util-fd.c
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-11-07 16:08:29 +04:00
Cyrill Gorcunov
46eff20bd2 make: libcriu -- Use `obj-ext-src-y' target for pie/util-fd.c recompilation
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-04 16:16:51 +04:00
Cyrill Gorcunov
1056365970 lib: libcriu -- Use `lib-so' facility
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-09-02 16:17:13 +04:00
Cyrill Gorcunov
dfdac2cf3a make: Use generic build engine for libcriu.so
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-08-29 14:48:13 +04:00
Ruslan Kupreev Руслан
27f9b0335d v2 criu: Initial skeleton for criu library
Add target lib to Makefile for criu library.
Created directory lib and add there Makefile and criu.c - skelettons for criu library.

Signed-off-by: Ruslan Kupreev <kupruser@gmail.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
2013-07-18 21:47:11 +04:00