From 8ce9e35e117455a0c4b3bbc9b890abb5fb01a2dc Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 17 Jul 2019 18:46:43 +0800 Subject: [PATCH] pybind: check "CEPH_LIBDIR" not "MAKEFLAGS" if the used cmake generator is not "make", these environmental variables won't be set, so let's just check for "CEPH_LIBDIR". it is set by cmake function of `distutils_add_cython_module()` and `distutils_install_cython_module()` Signed-off-by: Kefu Chai --- src/pybind/cephfs/setup.py | 3 +-- src/pybind/rados/setup.py | 3 +-- src/pybind/rbd/setup.py | 4 +--- src/pybind/rgw/setup.py | 4 +--- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/pybind/cephfs/setup.py b/src/pybind/cephfs/setup.py index a4374b1a486..3ba67a272c7 100755 --- a/src/pybind/cephfs/setup.py +++ b/src/pybind/cephfs/setup.py @@ -89,10 +89,9 @@ def check_sanity(): compiler = new_compiler() distutils.sysconfig.customize_compiler(compiler) - if {'MAKEFLAGS', 'MFLAGS', 'MAKELEVEL'}.issubset(set(os.environ.keys())): + if 'CEPH_LIBDIR' in os.environ: # The setup.py has been invoked by a top-level Ceph make. # Set the appropriate CFLAGS and LDFLAGS - compiler.set_library_dirs([os.environ.get('CEPH_LIBDIR')]) try: diff --git a/src/pybind/rados/setup.py b/src/pybind/rados/setup.py index 30d8718fa87..1a7db0091f1 100755 --- a/src/pybind/rados/setup.py +++ b/src/pybind/rados/setup.py @@ -88,10 +88,9 @@ def check_sanity(): compiler = new_compiler() distutils.sysconfig.customize_compiler(compiler) - if {'MAKEFLAGS', 'MAKELEVEL'}.issubset(set(os.environ.keys())): + if 'CEPH_LIBDIR' in os.environ: # The setup.py has been invoked by a top-level Ceph make. # Set the appropriate CFLAGS and LDFLAGS - compiler.set_include_dirs([os.path.join(CEPH_SRC_DIR, 'include')]) compiler.set_library_dirs([os.environ.get('CEPH_LIBDIR')]) diff --git a/src/pybind/rbd/setup.py b/src/pybind/rbd/setup.py index 6d88220e3c7..f48432f0cd4 100755 --- a/src/pybind/rbd/setup.py +++ b/src/pybind/rbd/setup.py @@ -88,13 +88,11 @@ def check_sanity(): compiler = new_compiler() distutils.sysconfig.customize_compiler(compiler) - if {'MAKEFLAGS', 'MFLAGS', 'MAKELEVEL'}.issubset(set(os.environ.keys())): + if 'CEPH_LIBDIR' in os.environ: # The setup.py has been invoked by a top-level Ceph make. # Set the appropriate CFLAGS and LDFLAGS - compiler.set_include_dirs([os.path.join(CEPH_SRC_DIR, 'include')]) compiler.set_library_dirs([os.environ.get('CEPH_LIBDIR')]) - try: compiler.define_macro('_FILE_OFFSET_BITS', '64') diff --git a/src/pybind/rgw/setup.py b/src/pybind/rgw/setup.py index 771345bd001..ab9f3a88e90 100755 --- a/src/pybind/rgw/setup.py +++ b/src/pybind/rgw/setup.py @@ -91,13 +91,11 @@ def check_sanity(): compiler = new_compiler() distutils.sysconfig.customize_compiler(compiler) - if {'MAKEFLAGS', 'MFLAGS', 'MAKELEVEL'}.issubset(set(os.environ.keys())): + if 'CEPH_LIBDIR' in os.environ: # The setup.py has been invoked by a top-level Ceph make. # Set the appropriate CFLAGS and LDFLAGS - compiler.set_include_dirs([os.path.join(CEPH_SRC_DIR, 'include')]) compiler.set_library_dirs([os.environ.get('CEPH_LIBDIR')]) - try: compiler.define_macro('_FILE_OFFSET_BITS', '64') -- 2.47.3