Commit Graph

134 Commits

Author SHA1 Message Date
Karel Zak 4f79d3032e build-sys: split man pages and man page links
The symlinks are generated by asciidoctor and current dist_man_MANS
depends on order (nan page before man link). This solutions is useless
when execute "make -j". The real solution is to keep man pages in
separate variable and use only this variable evaluate what we need to
generate.

Signed-off-by: Karel Zak <kzak@redhat.com>
2021-03-26 11:49:59 +01:00
Mario Blättermann d9a67eb510 Add missing backslash to Makefile.am 2021-03-24 20:28:08 +01:00
Mario Blättermann 34455501de Asciidoc: Adapt Makefiles to new asciidoc man pages 2021-03-16 19:34:59 +01:00
Evgeny Vereshchagin 75196cd8be build-sys: add support for --enable-fuzzing-engine
Signed-off-by: Evgeny Vereshchagin <evvers@ya.ru>
2020-08-06 12:33:11 +00:00
Luca Boccassi 488fd4c3df cryptsetup: add option to use via dlopen in libmount
Enabling libcrypsetup in libmount had several unintended side
effects.
First of all, it increases the Debian minimal image size by
~2.5% (5.6MB worth of new libraries).
Then, due to libcryptsetup linkage to OpenSSL and libjson-c,
it causes incompatibilities with external programs linking
against both libmount and a private, static, old version of
OpenSSL, or external programs linking against libjansson or
json-glib, which have one symbol in common with libjson-c.

If ./configure is ran with --with-crypsetup=dlopen,
instead of linking to libcrypsetup, use dlopen to resolve
the symbols at runtime only when the verity feature is
used, thus avoiding clashes and keeping images size down.

Fixes #1081

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
2020-07-07 16:43:55 +01:00
Evgeny Vereshchagin e6a4d8cc06 build-sys: add --enable-ubsan to make it possible to build util-linux with UBSan
mostly to prepare for https://github.com/karelzak/util-linux/pull/1068
but it's useful even without fuzzing.

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-07-03 11:17:53 +02:00
Karel Zak fee9910661 build-sys: cleanup $vendordir use
- use --with-vendordir= (rather than --enable) to be compatible with
  another package stuuf

- add USE_VENDORDIR automake condition

- add vendordir to global AM_CPPFLAGS to avoid binary specific cflags
  modifications

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-25 13:44:22 +02:00
Chris Hofstaedtler 595e901b5c build-sys: Fix autogenerated URL in ChangeLog
Fixes: b3a3b7eb1a
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
2020-05-22 10:26:21 +02:00
Sami Kerola 44702f12f7
getopt: use examples installation directory in man page
Addresses: https://bugs.debian.org/913049
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-02-15 15:24:01 +00:00
Luca Boccassi e6a498877c libmount: add support for verity devices via libcryptsetup
The following new options are added:

verity.hashdevice
verity.roothash
verity.hashoffset

The source path will be used as a dm-verity object, and will be
opened using libcryptsetup APIs.

A new --with-cryptsetup build-time option is added, which adds a
dependency on libcryptsetup. To ease bootstrapping, given libcryptsetup
build-depends on util-linux for libuuid, if --with-cryptsetup=yes but
libcryptsetup is not installed only a warning will be printed at
configure time rather than an error. This way stage0/first stage/ring0
builds can use the same configure options but avoid installing
cryptsetup to get a working base set, and then rebuild util-linux in
the next step of the boostrapping process.

If verity options are selected but cannot be fullfilled due to lack of
dependencies, mounting a volume will fail even if using a loop device
would work as a fallback, to avoid silently skipping integrity checks.
2019-12-05 10:39:21 +00:00
Karel Zak c2409b55a0 build-sys: introduce $sysconfstaticdir
The current situation is that distros differentiate between:

* host specific configuration -- usually /etc, maintained by admin

* distribution specific (static) configuration -- usually /usr/lib,
  maintained by ditro packages

Unfortunately autotools have clue about $sysconfdir (/etc) only. This
patch introduces $sysconfstaticdir (default $prefix/lib).

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-11-12 10:09:34 +01:00
Masami Hiramatsu 9ae113ca73 libmount: Add libselinux dependency to pkgconfig file
Add libselinux dependency to libmount if it is compiled
with selinux support.

Without this fix, 'pkg-config --libs --static mount' doesn't
show libselinux related options.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
2019-10-11 10:28:57 +02:00
Karel Zak 99f95a1ea9 build-sys: add --with-pkgconfigdir
It seems we need a way how to override the default pkg-config install directory.

default:
	$ ./configure
	$ grep 'pkgconfigdir ='  Makefile
	pkgconfigdir = ${usrlib_execdir}/pkgconfig

user-defined:
	$ ./configure --with-pkgconfigdir=/usr/share/pkgconfig
	$ grep 'pkgconfigdir ='  Makefile
	$ pkgconfigdir = /usr/share/pkgconfig

Addresses: https://github.com/karelzak/util-linux/issues/793
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-05-14 13:50:59 +02:00
Karel Zak 58354269eb build-sys: add 'make checklibdoc'
Let's to be sure that all libs API symbols are documented.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-24 18:02:39 +02:00
Karel Zak ef61c093d3 build-sys: add ASAN_LDFLAGS
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-04-15 13:01:21 +02:00
Karel Zak 884019e2ea build-sys: add check-programs make target
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-03-05 11:38:44 +01:00
Andreas Henriksson 8df545592d build: use --runstatedir instead of --localstatedir
The util-linux code was previously aligned to use @localstatedir@ and
the util-linux build system was set to override the default to use /run.

Current GNU Coding Standards introduced the @runstatedir@ variable
for this purpose. Lets use that instead.

The GNU default for @runstatedir@ is ${localstatedir}/run so util-linux
still override the default to be /run to preserve the status quo from
before. The only difference is that you'll now pass --runstatedir to
override the location on the command line instead of --localstatedir.

(FWIW, Debhelper in compat 11 will automatically start passing
--runstatedir=/run to all autotools configured builds. It already
passes --localstatedir=/var (to avoid it ending up with the GNU default
/usr/local/var) which breaks the util-linux build system code that
tries to default it to /run. This change will thus allow util-linux
and debhelper to work better together and avoid the need for a
package-specific override.)

Relevant historic commits:
 * commit 07a16b9d1e
   "build-sys: change --localstatedir to /run"
 * commit 80c51185d5
   "uuidd: use run configured state directory"
 * commit 01c5b78794
   "agetty: use configured run state directory"

[kzak@redhat.com: - add $runstatedir fallback for autoconf < 2.70
                  - check for unmodified $localstatedir]

CC: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-07-31 15:24:46 +02:00
Ruediger Meier 22174021f8 build-sys: fix chown mistake, add checkusage.sh to the dist
Sorry, don't know why I reverted fad561b0.

But for travis we need it only in check_nonroot().
check_root() *can* do chown and the check_dist() is handled
by Makefile.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-26 21:00:09 +02:00
Ruediger Meier a3c29314f1 tools: add checkusage.sh
Just some simple generic tests for our UL commands, regarding
options --help, --version and --unknownopt.

The script looks still a bit weired but could be polished to
be used in tests/. It would be the first time testing at least
"something" for *all* built binaries (currently 109! commands).

For the record here are the current candidates with possible
problems:

$ make checkusage
agetty: --unknownopt, stderr too long: 45
blockdev: --unknownopt, stderr too long: 28
flock: --help, no stdout
flock: --help, non-empty stderr
getopt: --help, returns error
kill: --unknownopt, stderr too short: 1
lsipc: --unknownopt, stderr too long: 77
pg: --unknownopt, stderr too long: 23
renice: --unknownopt, stderr too long: 18
rtcwake: --unknownopt, non-empty stdout
rtcwake: --unknownopt, stderr too long: 21
sulogin: --unknownopt, stderr too long: 17
write: --unknownopt, stderr too long: 12

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2017-06-26 14:38:24 +02:00
Karel Zak fad561b0e4 build-sys: update DISTCHECK_CONFIGURE_FLAGS
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-06-21 15:41:21 +02:00
Karel Zak 702b6b5f7f build-sys: add tools/Makemodule.am
We have "make" targets which depends on tools/check*.sh scripts. It's
ugly to exclude these scripts from the release tar balls (as generated
by "make distcheck").

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-05-25 15:59:15 +02:00
Karel Zak 64a3c227e2 tools: add checkcompletion.sh
The command "make checkcompletion" prints missing completion scripts.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-17 14:05:27 +01:00
Ruediger Meier 18336d16d9 build-sys: use AC_PROG_MKDIR_P and remove a few gnuisms
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-03-13 21:48:09 +01:00
Filipe Brandenburger 324330aca6 build-sys: Properly order install dependencies of pylibmount
Introduce a dependency so that libmount.so is installed before
pylibmount.so, so that when libtool tries to relink it, it can find
libmount.so in the destdir.

We introduce this additional make rule through an AC_SUBST variable, to
prevent automake from trying to interpret that.  This trick has been
suggested in http://stackoverflow.com/a/8643550.

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} in that case, but if it is not yet present there,
libtool assumes it is a system installed library and use -lmount
instead, which causes the following failure if libmount is not installed
on the base system yet:

  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

This seems to be a previously encountered issue, 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 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 the all the files expected in the Python directory (both
__init__.py and pylibmount.so) are present after an install.

Tested that parallel install works, the dependency is always respected
since it's explicit.

Inspected the generated Makefile and confirmed that the definition of
install-pylibmountexecLTLIBRARIES (generated by automake) and the
explicit dependency we introduced are both present.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
2016-02-05 11:03:09 -08:00
Ruediger Meier 24147585f0 tests: skip automake's empty "Testsuite summary"
We have no automake TESTS. Let's run check-local only.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2015-12-10 19:05:11 +01:00
Karel Zak f63faced16 Revert "build-sys: remove static builds from make-check"
The problem should be fixed now.

This reverts commit 948b87581e.
2015-03-06 14:23:57 +01:00
Karel Zak 948b87581e build-sys: remove static builds from make-check
.. temporary, the final solution has to cleanup timer_* functions
usage. The function are unnecessary for libmount, but we use
lib/monotme.c in the library and it probably requires -lrt and *also*
-lpthread for static builds.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-05 15:34:42 +01:00
Karel Zak 791da22d0e libfdisk: add version.c
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-01-13 13:46:31 +01:00
Karel Zak ed79557e1d build-sys: add fdisk.pc
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-26 13:20:16 +01:00
Karel Zak 0bb4c979c6 build-sys: create a regular shared libfdisk.so
- symbols versioning
- SONAME from configure.ac
- library version to header file
- modify build-sys to compile and install shared lib

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-26 12:45:24 +01:00
Søren Holm 10e1d2e5f7 libmount: provide version as int for better compiletime test
Signed-off-by: Søren Holm <sgh@sgh.dk>
2014-10-14 12:03:54 +02:00
Michael Marineau cb52ac9847 build-sys: create parent directory for $(PATHFILES)
When building outside the source tree there is nothing to guarantee the
target directory exists before writing to it. Most of the time this just
happens to work because something else creates the directory but not
always. For example:

    $ mkdir build
    $ cd build
    $ ../configure --disable-dependency-tracking
    $ make libuuid/uuid.pc
      GEN      libuuid/uuid.pc
    /bin/sh: line 2: libuuid/uuid.pc.tmp: No such file or directory
    make: *** [libuuid/uuid.pc] Error 1
2014-09-03 09:50:24 +02:00
Karel Zak 2ad2196349 build-sys: support ./configure ADJTIME_PATH=
.. to override the default /etc/adjtime path.

Reported-by: Bruce Dubbs <bruce.dubbs@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-19 10:30:56 +02:00
Karel Zak 1469736053 build-sys: fix smartcols.pc
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-06-16 15:18:20 +02: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 f339d2a5c2 build-sys: restore make distcheck's configure flags
They got lost with --enable-most-builds in 08b1c219.

Note additionally we add --enable-gtk-doc but don't add
--with-systemd because there are still many systems where systemd
is not available.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-06-03 17:00:26 +02:00
Karel Zak ac6a37c863 build-sys: cleanup bash-completion/
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 14:29:42 +02:00
Ondrej Oprala baa3b270ec Use libsmartcols in libfdisk and cfdisk
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:18 +02:00
Ondrej Oprala 1a4d989e22 libsmartcols: add basic files
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:15 +02:00
Karel Zak 4ddd86d5d9 build-sys: ove fdisks to disk-utils
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-11 11:35:15 +01:00
Karel Zak 65acdc8734 build-sys: remove deprecated-mount/
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-05 13:19:19 +01: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
Karel Zak d78df0ac65 build-sys: add pylibmount
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-08-19 14:57:21 +02:00
Karel Zak 20da58084a bash-completion: rename shell-completion -> bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-05 14:58:07 +02:00
Sami Kerola 9cc36e9fdf bash-completion: add bash completetion configure option
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2013-03-30 10:17:49 +00:00
Karel Zak d56a7c2330 libfdisk: add basic library files
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-11 11:20:40 +01:00
Sami Kerola 4cf02b6510 ddate: remove from util-linux
See RedHat bug for reasons why the ddate is cleaned up.  The reference is
where to get the command in future.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=823156
References: https://github.com/bo0ts/ddate
Acked-by: Petr Uzel <petr.uzel@suse.cz>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-15 16:41:49 +02:00
Karel Zak 78dd43cadc build-sys: remove --enable-gtk-doc from make check
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-10 14:10:30 +02:00
Karel Zak d4baf92e50 build-sys: expand paths at make time
autoconf docs about *dir variables (e.g bindir):

 ... A corollary is that you should not use these variables except in
 makefiles...

 ...you should not rely on AC_CONFIG_FILES to replace bindir and friends
 in your shell scripts and other files; instead, let make manage their
 replacement.

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-15 02:06:53 +02:00
Karel Zak 1b03e2cd33 tests: make compatible with autotools
The command 'make check' is called from 'make distcheck' (which is
used to generate official util-linux tarballs).

It means that tests/ stuff has to be compatible with autotools and
differentiate between source and build directories.

 * remove run-nonroot.sh (merged into run.sh
 * remove commands.sh.in
 * all tests and top level run.sh accept --builddir and --srcdir
   command line options
 * functions.sh modified to use $top_builddir/tests for output files

Signed-off-by: Karel Zak <kzak@redhat.com>
2012-08-03 21:24:51 +02:00