Commit Graph

17 Commits

Author SHA1 Message Date
Karel Zak 4f9d999a97 build-sys: add -Wno-cast-function-type for python
libmount/python/pylibmount.c:158:19: warning: cast between incompatible function types
   from ‘PyObject * (*)(PyObject *)’ {aka ‘struct _object * (*)(struct _object *)’}
     to ‘PyObject * (*)(PyObject *, PyObject *)’ {aka ‘struct _object * (*)(struct _object *, struct _object *)’}
   [-Wcast-function-type]

This is generic problem in all Python C code and gcc v8. The another
possible (and probably more correct) way is to add unused argument to
all API functions. Unfortunately, this solution is pretty invasive. The
question is if gcc is not too paranoid in this case.

For more details see https://bugs.python.org/issue33012. It seems
Python guys also prefer CFLAGS modification for now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-18 10:23:51 +02:00
Ruediger Meier 38f75ebe1e build-sys: don't clean *.img files
Don't know why this was added in d78df0ac but it can't be right that
libmount/python removes these files in the toplevel builddir. Moreover
I've never seen such *.img files appearing during build at all.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-09 14:27:48 +01:00
Ruediger Meier a5b3be92c6 build-sys: pylibmount, mount context is Linux only
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-21 21:03:41 +01:00
Filipe Brandenburger d54eb46646 Revert "build-sys: Order pylibmount after usrlib on install"
This reverts commit e61f406913.
2016-02-05 10:08:50 -08:00
Filipe Brandenburger e61f406913 build-sys: Order pylibmount after usrlib on install
This fixes a failure of `make install DESTDIR=...` when trying to relink
pylibmount against libmount.la.

libtool will look for libmount.so under ${DESTDIR}/${libdir}, but if it
is not yet present, it will assume it is a system installed library and
use -lmount instead.

This makes the install order significant.

Automake lists the install entries in alphabetical order, and as
install-pylibmountexecLTLIBRARIES < install-usrlib_execLTLIBRARIES,
make will try to install pylibmount.so before libmount.so is present
in the DESTDIR, which will then cause libtool to fallback to -lmount
when relinking. This causes the error below:

  libtool: install: warning: relinking `pylibmount.la'
  libtool: install: (... libtool --mode=relink gcc -o pylibmount.la \
        -rpath /usr/lib/python2.7/dist-packages/libmount \
        libmount/python/*.lo libmount.la ... -lpython2.7 \
        -inst-prefix-dir /path/to/destdir)
  /usr/bin/ld: cannot find -lmount
  collect2: error: ld returned 1 exit status
  libtool: install: error: relink `pylibmount.la' ...
  make[3]: *** [install-pylibmountexecLTLIBRARIES] Error 1

Work around this issue by using a zz_ prefix for the pylibmount exec
dir, in order to install it last.

This does not work if parallel make is used for the install step, but
that should be a minor issue (parallel install is probably not that
useful for util-linux, which is not that large a package to actually
benefit from it.) The proper fix should be to introduce a make
dependency of target install-pylibmountexecLTLIBRARIES on target
install-usrlib_execLTLIBRARIES, but unfortunately there is no good way
to accomplish that in automake without overriding it completely.

This issue seems to be previously encountered in automake context, since
automake includes a hack to insert such a dependency rule to install all
libLTLIBRARIES before attempting to install binPROGRAMS, initially
introduced in the commit below:
http://git.savannah.gnu.org/cgit/automake.git/commit/?id=bd4a1d5ad1a72fa780a8b7fd6c365a5dad2e6220

Also, a related bug from Ubuntu tracker:
https://bugs.launchpad.net/ubuntu/+source/util-linux/+bug/1442076

Tested that `make install` starts working again after this commit, even
when libmount-dev is not installed on the system. Also confirmed that
`make distcheck` is now functional.

Confirmed that both __init__.py and the .so library are still installed
in the Python directory.

Tested that it still works without python-devel installed, also
inspected Makefile.in which looks correct.

Tested that `make install pylibmountexecdir=...` still works to override
destination directory at `make install` time.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2016-01-26 13:24:25 -08:00
Ruediger Meier 15b2606c4f tests: fix python tests for dist and out-of-tree builds
- add python helper scripts to the dist
- helper scripts are always in srcdir
- python libs are in builddir
- abort tests if helpers are missing

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-06-04 10:14:24 +02:00
Ruediger Meier 15cb27895d build-sys: use automake's PYTHON primary for __init__.py
Actually the initial reason for this commit was to remove execute
permission from installed __init__.py.

Now after discovering automake's _PYTHON suffix we slightly cleanup
Makemodule.am and we will install byte compiled .pyc and .pyo files.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-06-03 13:12:43 +02:00
Ruediger Meier a400c2ad0e build-sys: libmount/python/__init__.py is always a dist file
"make dist" and "make distcheck" should work after a bare
./configure to give us a full featured tar ball.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-03-13 17:48:09 +01:00
Karel Zak 34330d2bea pylibmount: remove unncessary subdirectory
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-01-14 17:40:47 +01:00
Karel Zak 6073251ca8 build-sys: one install dir for all pylibmount stuff
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-27 14:23:38 +02:00
Karel Zak e4d394fa36 build-sys: add pylibmount __init__.py EXTRA_DIST
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-26 14:02:40 +02:00
Karel Zak 808c876512 build-sys: install to the correct python dirs
It seems we have to call AM_PATH_PYTHON() monster to get
pyexec (shared libs) and python (scripts) directories.

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-26 12:55:30 +02:00
Karel Zak 8e5c467500 build-sys: support --with-python[={2,3}]
* we use pkg-config to get CGLAGS and LIBS, use package specific
   config (e.g. python-config) is non-sense.

 * default is to follow distribution and use pkg-config module name
   "python". This is probably symlink to python2.pc or python3.pc.

 * --with-python=2 forces to pkg-module "python2 >= 2"

 * --with-python=3 forces to pkg-module "python3 >= 3"

Signed-off-by: Karel Zak <kzak@redhat.com>
2013-09-20 12:42:45 +02:00
Karel Zak 15c2e011a7 build-sys: install pylibmount into
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-19 15:24:33 +02:00
Ondrej Oprala 90eb39874f pylibmount: add regression tests
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-19 15:11:06 +02:00
Ondrej Oprala 813683a352 pylibmount: basic code
[kzak@redhat.com: - split to more patches
                  - split to more .c files]

Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-19 15:00:15 +02:00
Karel Zak d78df0ac65 build-sys: add pylibmount
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-19 14:57:21 +02:00