2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-22 09:58:09 +00:00

crit: enable python2 or python3 based crit

With this last commit of the crit with python3 series it is possible to
either use python2 or python3 with CRIU.

Now the basic build system functionality (make and make install) are
python2/python3 aware. zdtm.py and criu-coredump are still python2, but
as they are not part of 'make install' those parts have not yet been
ported from python2 to python3.

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Adrian Reber 2018-05-16 06:20:24 +00:00 committed by Pavel Emelyanov
parent 1a0ad1ae87
commit 4feb07020d
6 changed files with 39 additions and 5 deletions

1
.gitignore vendored
View File

@ -24,6 +24,7 @@ images/google/protobuf/*.c
images/google/protobuf/*.h
.gitid
criu/criu
crit/crit
criu/arch/*/sys-exec-tbl*.c
# x86 syscalls-table is not generated
!criu/arch/x86/sys-exec-tbl.c

View File

@ -127,7 +127,7 @@ HOSTCFLAGS += $(WARNINGS) $(DEFINES) -iquote include/
export CFLAGS USERCLFAGS HOSTCFLAGS
# Default target
all: criu lib
all: criu lib crit
.PHONY: all
#
@ -228,14 +228,22 @@ criu: $(criu-deps)
$(Q) $(MAKE) $(build)=criu all
.PHONY: criu
crit/Makefile: ;
crit/%: criu .FORCE
$(Q) $(MAKE) $(build)=crit $@
crit: criu
$(Q) $(MAKE) $(build)=crit all
.PHONY: crit
#
# Libraries next once criu it ready
# Libraries next once crit it ready
# (we might generate headers and such
# when building criu itself).
lib/Makefile: ;
lib/%: criu .FORCE
lib/%: crit .FORCE
$(Q) $(MAKE) $(build)=lib $@
lib: criu
lib: crit
$(Q) $(MAKE) $(build)=lib all
.PHONY: lib
@ -247,6 +255,7 @@ clean mrproper:
$(Q) $(MAKE) $(build)=compel $@
$(Q) $(MAKE) $(build)=compel/plugins $@
$(Q) $(MAKE) $(build)=lib $@
$(Q) $(MAKE) $(build)=crit $@
.PHONY: clean mrproper
clean-top:

13
crit/Makefile Normal file
View File

@ -0,0 +1,13 @@
all-y += crit
crit/crit: crit/crit-$(PYTHON)
$(Q) cp $^ $@
crit: crit/crit
.PHONY: crit
clean-crit:
$(Q) $(RM) crit/crit
.PHONY: clean-crit
clean: clean-crit
mrproper: clean

6
crit/crit-python2 Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env python2
from pycriu import cli
if __name__ == '__main__':
cli.main()

6
crit/crit-python3 Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env python3
from pycriu import cli
if __name__ == '__main__':
cli.main()

View File

@ -1,4 +1,3 @@
#!/usr/bin/env python2
from __future__ import print_function
import argparse
import sys