1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
From 80c38519224635e9fe2a21542b7dbb14e4c16dcc Mon Sep 17 00:00:00 2001
From: Mark Asselstine <mark.asselstine@windriver.com>
Date: Tue, 12 Mar 2019 19:46:27 -0700
Subject: [PATCH] python: work around host and target python
In order to allow for the build system to make use of python but not
influence the installed software we create a split between PYTHON and
TARGET_PYTHON.
gsyncd.c is the only use of PYTHON on the insalled system so we can
restrict the introduction of TARGET_PYTHON to gsyncd.c and the
associated Makefile.
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
[Xulin: minor adjust the code to apply the patch]
Signed-off-by: Xulin Sun <xulin.sun@windriver.com>
[Yi: minor adjust the code to apply the patch on 3.11.1]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
[Hongzhi: minor adjust the code to apply on v5.4]
Signed-off-by: Hongzhi.Song <hongzhi.song@windriver.com>
---
configure.ac | 2 ++
geo-replication/src/Makefile.am | 3 ++-
geo-replication/src/gsyncd.c | 6 +++---
3 files changed, 7 insertions(+), 4 deletions(-)
Index: glusterfs-11.1/configure.ac
===================================================================
--- glusterfs-11.1.orig/configure.ac
+++ glusterfs-11.1/configure.ac
@@ -261,6 +261,8 @@
AC_PROG_CC
AC_DISABLE_STATIC
LT_INIT
+AC_SUBST(TARGET_PYTHON)
+
AC_SUBST([shrext_cmds])
AC_CHECK_PROG([RPCGEN], [rpcgen], [yes], [no])
Index: glusterfs-11.1/geo-replication/src/Makefile.am
===================================================================
--- glusterfs-11.1.orig/geo-replication/src/Makefile.am
+++ glusterfs-11.1/geo-replication/src/Makefile.am
@@ -22,7 +22,8 @@
AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src \
-I$(top_srcdir)/rpc/xdr/src -I$(top_builddir)/rpc/xdr/src \
-DGSYNCD_PREFIX=\"$(GLUSTERFS_LIBEXECDIR)\" -DUSE_LIBGLUSTERFS \
- -DSBIN_DIR=\"$(sbindir)\" -DPYTHON=\"$(PYTHON)\"
+ -DSBIN_DIR=\"$(sbindir)\" -DPYTHON=\"$(PYTHON)\"\
+ -DTARGET_PYTHON=\"$(TARGET_PYTHON)\"
AM_CFLAGS = -Wall $(GF_CFLAGS)
Index: glusterfs-11.1/geo-replication/src/gsyncd.c
===================================================================
--- glusterfs-11.1.orig/geo-replication/src/gsyncd.c
+++ glusterfs-11.1/geo-replication/src/gsyncd.c
@@ -115,9 +115,9 @@
goto error;
j = 0;
- python = getenv("PYTHON");
+ python = getenv("TARGET_PYTHON");
if (!python)
- python = PYTHON;
+ python = TARGET_PYTHON;
nargv[j++] = python;
nargv[j++] = GSYNCD_PREFIX "/python/syncdaemon/" GSYNCD_PY;
for (i = 1; i < argc; i++)
@@ -167,7 +167,7 @@
ret = 0;
switch (zeros) {
case 2:
- if ((strcmp(basename(buf), basename(PYTHON)) ||
+ if ((strcmp (basename (buf), basename (TARGET_PYTHON)) ||
strcmp(basename(buf + strlen(buf) + 1), GSYNCD_PY)) == 0) {
ret = 1;
break;
|