summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2013-08-19 14:57:21 +0200
committerKarel Zak2013-08-19 14:57:21 +0200
commitd78df0ac6546bfe5500ca97f2bf05153d93e1eef (patch)
treeb8a3d6b9cbe97c945b487ab7ef9488d08ccb0bb5
parentbuild-sys: remove deprecated elvtune command (diff)
downloadkernel-qcow2-util-linux-d78df0ac6546bfe5500ca97f2bf05153d93e1eef.tar.gz
kernel-qcow2-util-linux-d78df0ac6546bfe5500ca97f2bf05153d93e1eef.tar.xz
kernel-qcow2-util-linux-d78df0ac6546bfe5500ca97f2bf05153d93e1eef.zip
build-sys: add pylibmount
Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--Makefile.am1
-rw-r--r--configure.ac21
-rw-r--r--libmount/Makemodule.am2
-rw-r--r--libmount/python/Makemodule.am21
4 files changed, 44 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index 17f4c339d..5c626a953 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -38,6 +38,7 @@ dist_man_MANS =
man_MANS =
pkgconfig_DATA =
usrlib_exec_LTLIBRARIES =
+pyexec_LTLIBRARIES =
bin_PROGRAMS =
sbin_PROGRAMS =
dist_usrbin_exec_SCRIPTS =
diff --git a/configure.ac b/configure.ac
index 443ad7215..982606eb6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1373,6 +1373,27 @@ AC_ARG_ENABLE([bash-completion],
AM_CONDITIONAL([BUILD_BASH_COMPLETION], [test "x$enable_bash_completion" = xyes])
+AC_ARG_WITH([python],
+ AS_HELP_STRING([--without-python], [do not generate python bindings]),
+ [], [with_python=yes]
+)
+have_python=no
+AS_IF([test "x$with_python" = xyes], [
+ AM_PATH_PYTHON([2.4])
+ AS_IF([test -x "$PYTHON-config"], [
+ have_python=yes
+ PYTHON_INCLUDES=$($PYTHON-config --includes)
+ AC_SUBST(PYTHON_INCLUDES)
+ ])
+])
+
+
+UL_BUILD_INIT([pylibmount], [check])
+UL_REQUIRES_HAVE([pylibmount], [python])
+UL_REQUIRES_BUILD([pylibmount], [libmount])
+AM_CONDITIONAL([BUILD_PYLIBMOUNT], [test "x$build_pylibmount" = "xyes"])
+
+
AC_ARG_ENABLE([pg-bell],
AS_HELP_STRING([--disable-pg-bell], [let pg not ring the bell on invalid keys]),
[], [enable_pg_bell=yes]
diff --git a/libmount/Makemodule.am b/libmount/Makemodule.am
index 81d550a47..8546c2f9b 100644
--- a/libmount/Makemodule.am
+++ b/libmount/Makemodule.am
@@ -1,6 +1,7 @@
if BUILD_LIBMOUNT
include libmount/src/Makemodule.am
+include libmount/python/Makemodule.am
if ENABLE_GTK_DOC
# Docs uses separate Makefiles
@@ -11,5 +12,4 @@ pkgconfig_DATA += libmount/mount.pc
PATHFILES += libmount/mount.pc
EXTRA_DIST += libmount/COPYING
-
endif # BUILD_LIBMOUNT
diff --git a/libmount/python/Makemodule.am b/libmount/python/Makemodule.am
new file mode 100644
index 000000000..30946d635
--- /dev/null
+++ b/libmount/python/Makemodule.am
@@ -0,0 +1,21 @@
+
+if BUILD_PYLIBMOUNT
+pyexec_LTLIBRARIES += pylibmount.la
+
+pylibmount_la_SOURCES =
+
+pylibmount_la_LIBADD = libmount.la -lpython$(PYTHON_VERSION)
+
+pylibmount_la_CFLAGS = \
+ $(AM_CFLAGS) \
+ $(PYTHON_INCLUDES) \
+ $(PYTHON_CFLAGS) \
+ -I$(ul_libmount_incdir) \
+ -fno-strict-aliasing #-ggdb3 -O0
+
+pylibmount_la_LDFLAGS = \
+ -avoid-version -module -shared -export-dynamic
+
+CLEANFILES += *.img
+
+endif # BUILD_PYLIBMOUNT