diff options
-rw-r--r-- | configure.ac | 34 | ||||
-rw-r--r-- | glusterfs.spec.in | 3 | ||||
-rw-r--r-- | xlators/features/glupy/src/Makefile.am | 4 | ||||
-rw-r--r-- | xlators/features/glupy/src/glupy.c | 11 |
4 files changed, 24 insertions, 28 deletions
diff --git a/configure.ac b/configure.ac index 02dd5552d..cc53b5258 100644 --- a/configure.ac +++ b/configure.ac @@ -122,6 +122,12 @@ AC_CONFIG_FILES([Makefile xlators/system/Makefile xlators/system/posix-acl/Makefile xlators/system/posix-acl/src/Makefile + xlators/nfs/Makefile + xlators/nfs/server/Makefile + xlators/nfs/server/src/Makefile + xlators/mgmt/Makefile + xlators/mgmt/glusterd/Makefile + xlators/mgmt/glusterd/src/Makefile cli/Makefile cli/src/Makefile doc/Makefile @@ -139,12 +145,6 @@ AC_CONFIG_FILES([Makefile extras/LinuxRPM/Makefile contrib/fuse-util/Makefile contrib/uuid/uuid_types.h - xlators/nfs/Makefile - xlators/nfs/server/Makefile - xlators/nfs/server/src/Makefile - xlators/mgmt/Makefile - xlators/mgmt/glusterd/Makefile - xlators/mgmt/glusterd/src/Makefile glusterfs-api.pc api/Makefile api/src/Makefile @@ -639,14 +639,22 @@ if test "x$LIBAIO" != "x"; then BUILD_LIBAIO=yes fi - -BUILD_GLUPY=no -AC_CHECK_LIB([python2.6],[PyImport_Import],[BUILD_GLUPY=yes]) - -if test "x$BUILD_GLUPY" = "xyes"; then - GLUPY_SUBDIR=glupy -fi +AM_PATH_PYTHON() + if echo $PYTHON_VERSION | grep ^2; then + BUILD_PYTHON_INC=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_inc()"` + BUILD_PYTHON_LIB=python$PYTHON_VERSION + GLUPY_SUBDIR=glupy + GLUPY_SUBDIR_MAKEFILE=xlators/features/glupy/Makefile + GLUPY_SUBDIR_SRC_MAKEFILE=xlators/features/glupy/src/Makefile + echo "building glupy with -isystem $BUILD_PYTHON_INC -l $BUILD_PYTHON_LIB" + else + AC_MSG_ERROR([only python 2.x is supported]) + fi +AC_SUBST(BUILD_PYTHON_INC) +AC_SUBST(BUILD_PYTHON_LIB) AC_SUBST(GLUPY_SUBDIR) +AC_SUBST(GLUPY_SUBDIR_MAKEFILE) +AC_SUBST(GLUPY_SUBDIR_SRC_MAKEFILE) AC_SUBST(GF_HOST_OS) AC_SUBST([GF_GLUSTERFS_LIBS]) diff --git a/glusterfs.spec.in b/glusterfs.spec.in index aa27e413b..0f300f694 100644 --- a/glusterfs.spec.in +++ b/glusterfs.spec.in @@ -107,11 +107,8 @@ BuildRequires: ncurses-devel readline-devel BuildRequires: libxml2-devel openssl-devel BuildRequires: libaio-devel #BuildRequires: systemtap-sdt-devel lvm2-devel # glusterfs-3.4.x -%if 0%{?suse_version} BuildRequires: python-devel -%else BuildRequires: python-ctypes -%endif Obsoletes: hekafs <= 0.7 Obsoletes: %{name}-libs <= 2.0.0 diff --git a/xlators/features/glupy/src/Makefile.am b/xlators/features/glupy/src/Makefile.am index 931e5b741..960862839 100644 --- a/xlators/features/glupy/src/Makefile.am +++ b/xlators/features/glupy/src/Makefile.am @@ -9,11 +9,11 @@ glupy_PYTHON = gluster.py negative.py helloworld.py debug-trace.py glupy_la_LDFLAGS = -module -avoid-version -shared -nostartfiles glupy_la_SOURCES = glupy.c glupy_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la \ - -lpthread -lpython2.6 + -lpthread -l$(BUILD_PYTHON_LIB) noinst_HEADERS = glupy.h -AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src +AM_CPPFLAGS = $(GF_CPPFLAGS) -I$(top_srcdir)/libglusterfs/src -isystem $(BUILD_PYTHON_INC) AM_CFLAGS = -Wall -fno-strict-aliasing -DGLUSTER_PYTHON_PATH=\"$(glupydir)\" $(GF_CFLAGS) diff --git a/xlators/features/glupy/src/glupy.c b/xlators/features/glupy/src/glupy.c index fafea817c..dc86c0071 100644 --- a/xlators/features/glupy/src/glupy.c +++ b/xlators/features/glupy/src/glupy.c @@ -19,7 +19,7 @@ #include <ctype.h> #include <sys/uio.h> -#include <python2.6/Python.h> +#include <Python.h> #ifndef _CONFIG_H #define _CONFIG_H @@ -2424,19 +2424,10 @@ err_return: void fini (xlator_t *this) { - int i = 0; glupy_private_t *priv = this->private; if (!priv) return; - for (i = 0; i < GLUPY_N_FUNCS; ++i) { - if (priv->fops[i]) { - Py_DECREF(priv->fops[i]); - } - if (priv->cbks[i]) { - Py_DECREF(priv->fops[i]); - } - } Py_DECREF(priv->py_xlator); Py_DECREF(priv->py_module); this->private = NULL; |