1 From 00d44940c2e83bf73101a05d2aa8f88c2e2fca58 Mon Sep 17 00:00:00 2001
2 From: Dengke Du <dengke.du@windriver.com>
3 Date: Tue, 23 Oct 2018 15:34:53 +0800
4 Subject: [PATCH] ceph: add pybind support in OE
6 1. add sysroot to CFLAGS when cross compiling pybind
7 2. change the pybind's INSTALL path to OE's INSTALL path
8 3. delete the check for header files, because the check method using
11 Signed-off-by: Dengke Du <dengke.du@windriver.com>
12 Upstream-Status: Inappropriate [oe specific]
14 cmake/modules/Distutils.cmake | 12 +++---------
15 src/pybind/cephfs/setup.py | 8 --------
16 src/pybind/rados/setup.py | 8 --------
17 src/pybind/rbd/setup.py | 8 --------
18 src/pybind/rgw/setup.py | 8 --------
19 5 files changed, 3 insertions(+), 41 deletions(-)
21 diff --git a/cmake/modules/Distutils.cmake b/cmake/modules/Distutils.cmake
22 index d6e9f38..3091d97 100644
23 --- a/cmake/modules/Distutils.cmake
24 +++ b/cmake/modules/Distutils.cmake
25 @@ -47,7 +47,7 @@ function(distutils_add_cython_module name src)
26 LDFLAGS=-L${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
27 CYTHON_BUILD_DIR=${CMAKE_CURRENT_BINARY_DIR}
28 CEPH_LIBDIR=${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
29 - CFLAGS=\"-iquote${CMAKE_SOURCE_DIR}/src/include -w\"
30 + CFLAGS=\"-iquote${CMAKE_SOURCE_DIR}/src/include -w --sysroot=${CMAKE_SYSROOT}\"
31 ${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
32 build --verbose --build-base ${CYTHON_MODULE_DIR}
33 --build-platlib ${CYTHON_MODULE_DIR}/lib.${PYTHON${PYTHON_VERSION}_VERSION_MAJOR}
34 @@ -69,14 +69,8 @@ function(distutils_install_cython_module name)
35 set(ENV{CEPH_LIBDIR} \"${CMAKE_LIBRARY_OUTPUT_DIRECTORY}\")
37 set(options --prefix=${CMAKE_INSTALL_PREFIX})
38 - if(DEFINED ENV{DESTDIR})
39 - if(EXISTS /etc/debian_version)
40 - list(APPEND options --install-layout=deb)
42 - list(APPEND options --root=\$ENV{DESTDIR})
44 - list(APPEND options --root=/)
46 + list(APPEND options --root=${CMAKE_DESTDIR})
47 + list(APPEND options --install-lib=${PYTHON_SITEPACKAGES_DIR})
50 ${PYTHON${PYTHON_VERSION}_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/setup.py
51 diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py
52 index 6533f41..1ee4a59 100755
53 --- a/src/pybind/cephfs/setup.py
54 +++ b/src/pybind/cephfs/setup.py
55 @@ -121,14 +121,6 @@ def check_sanity():
57 shutil.rmtree(tmp_dir)
60 -if 'BUILD_DOC' in os.environ.keys():
69 from Cython.Build import cythonize
70 diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py
71 index ef7c307..5204017 100755
72 --- a/src/pybind/rados/setup.py
73 +++ b/src/pybind/rados/setup.py
74 @@ -117,14 +117,6 @@ def check_sanity():
76 shutil.rmtree(tmp_dir)
79 -if 'BUILD_DOC' in os.environ.keys():
88 from Cython.Build import cythonize
89 diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py
90 index bcf96f2..d4cbbeb 100755
91 --- a/src/pybind/rbd/setup.py
92 +++ b/src/pybind/rbd/setup.py
93 @@ -120,14 +120,6 @@ def check_sanity():
95 shutil.rmtree(tmp_dir)
98 -if 'BUILD_DOC' in os.environ.keys():
100 -elif check_sanity():
107 from Cython.Build import cythonize
108 diff --git a/src/pybind/rgw/setup.py b/src/pybind/rgw/setup.py
109 index f14f30c..ee7570b 100755
110 --- a/src/pybind/rgw/setup.py
111 +++ b/src/pybind/rgw/setup.py
112 @@ -120,14 +120,6 @@ def check_sanity():
114 shutil.rmtree(tmp_dir)
117 -if 'BUILD_DOC' in os.environ.keys():
119 -elif check_sanity():
126 from Cython.Build import cythonize