2012-05-16 17:54:26 -05:00
|
|
|
|
2012-06-04 03:36:37 -05:00
|
|
|
noinst_LTLIBRARIES += libcommon.la
|
|
|
|
libcommon_la_CFLAGS = $(AM_CFLAGS)
|
|
|
|
libcommon_la_SOURCES = \
|
|
|
|
lib/blkdev.c \
|
|
|
|
lib/canonicalize.c \
|
|
|
|
lib/crc32.c \
|
2017-11-15 23:01:38 -06:00
|
|
|
lib/crc32c.c \
|
2012-06-04 03:36:37 -05:00
|
|
|
lib/env.c \
|
2015-11-27 06:56:01 -06:00
|
|
|
lib/idcache.c \
|
2020-02-25 05:00:27 -06:00
|
|
|
lib/encode.c \
|
2012-06-04 03:36:37 -05:00
|
|
|
lib/fileutils.c \
|
|
|
|
lib/ismounted.c \
|
2015-07-24 05:57:46 -05:00
|
|
|
lib/color-names.c \
|
2012-06-04 03:36:37 -05:00
|
|
|
lib/mangle.c \
|
|
|
|
lib/match.c \
|
|
|
|
lib/mbsalign.c \
|
2017-02-16 06:04:26 -06:00
|
|
|
lib/mbsedit.c\
|
2012-06-04 03:36:37 -05:00
|
|
|
lib/md5.c \
|
|
|
|
lib/pager.c \
|
2016-10-14 06:21:17 -05:00
|
|
|
lib/pwdutils.c \
|
2012-06-04 03:36:37 -05:00
|
|
|
lib/randutils.c \
|
|
|
|
lib/setproctitle.c \
|
|
|
|
lib/strutils.c \
|
2013-09-10 06:11:02 -05:00
|
|
|
lib/timeutils.c \
|
2012-11-22 07:26:41 -06:00
|
|
|
lib/ttyutils.c \
|
2014-04-07 11:24:19 -05:00
|
|
|
lib/exec_shell.c \
|
2017-09-05 04:19:26 -05:00
|
|
|
lib/strv.c \
|
2017-10-13 21:31:12 -05:00
|
|
|
lib/sha1.c \
|
|
|
|
lib/signames.c
|
2012-06-04 03:36:37 -05:00
|
|
|
|
|
|
|
if LINUX
|
2012-08-08 10:19:43 -05:00
|
|
|
libcommon_la_SOURCES += \
|
2019-01-17 16:16:54 -06:00
|
|
|
lib/caputils.c \
|
2012-08-08 10:19:43 -05:00
|
|
|
lib/linux_version.c \
|
|
|
|
lib/loopdev.c
|
2012-06-04 03:36:37 -05:00
|
|
|
endif
|
|
|
|
|
2016-05-26 08:05:14 -05:00
|
|
|
if USE_PLYMOUTH_SUPPORT
|
|
|
|
libcommon_la_SOURCES += lib/plymouth-ctrl.c
|
|
|
|
endif
|
|
|
|
|
2020-02-22 14:19:26 -06:00
|
|
|
if !HAVE_LANGINFO_H
|
2012-06-04 03:36:37 -05:00
|
|
|
libcommon_la_SOURCES += lib/langinfo.c
|
|
|
|
endif
|
|
|
|
|
2012-11-02 06:07:36 -05:00
|
|
|
if HAVE_CPU_SET_T
|
|
|
|
libcommon_la_SOURCES += lib/cpuset.c
|
|
|
|
endif
|
|
|
|
|
2016-02-29 10:45:46 -06:00
|
|
|
if HAVE_OPENAT
|
2018-10-24 07:32:29 -05:00
|
|
|
if HAVE_DIRFD
|
lib/path: new implementation
The goal is to avoid duplicate code in path.c and sysfs.c and make it
possible to define prefix for paths for all sysfs and procfs based
utils. Now we have /proc snapshots (for tests) for lscpu only. It
would be nice to have the same (for sysfs) for lsblk and another tools.
* very simple API to read numbers, strings and symlinks
* based on openat()
pc = ul_new_path("/sys/block/sda");
ul_path_read_u64(pc, &size, "size");
ul_path_read_u64(pc, &lsz, "queue/logical_block_size");
* printf-like API to generate paths, for example:
ul_path_readf_u64(pc, &num, "sda%d/size", partno)
* allow to define prefix to redirect hardcoded paths to another
location, for example:
pc = ul_new_path("/sys/block/sda");
ul_path_set_prefix(pc, "/my/regression/dump");
ul_path_read_u64(pc, &num, "size");
to read /my/regression/dump/sys/block/sda/size
* allow to extend the API by "dialects", for example for sysfs:
pc = ul_new_path(NULL);
sysfs_blkdev_init_path(pc, devno, NULL);
and use ul_path_* functions to read from @pc initialized by
sysfs_blkdev_init_path()
* add test_path binary
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-09 08:54:12 -05:00
|
|
|
libcommon_la_SOURCES += lib/path.c
|
2016-02-29 10:45:46 -06:00
|
|
|
libcommon_la_SOURCES += lib/procutils.c
|
|
|
|
libcommon_la_SOURCES += lib/sysfs.c
|
|
|
|
endif
|
2018-10-24 07:32:29 -05:00
|
|
|
endif
|
2015-02-27 06:57:34 -06:00
|
|
|
|
|
|
|
noinst_LTLIBRARIES += libtcolors.la
|
2017-05-30 10:10:40 -05:00
|
|
|
libtcolors_la_CFLAGS = $(AM_CFLAGS)
|
2015-07-24 05:57:46 -05:00
|
|
|
libtcolors_la_SOURCES = lib/colors.c lib/color-names.c include/colors.h include/color-names.h
|
2017-05-30 10:10:40 -05:00
|
|
|
libtcolors_la_LIBADD =
|
|
|
|
# tinfo or ncurses are optional
|
|
|
|
if HAVE_TINFO
|
|
|
|
libtcolors_la_LIBADD += $(TINFO_LIBS)
|
|
|
|
libtcolors_la_CFLAGS += $(TINFO_CFLAGS)
|
|
|
|
else
|
|
|
|
if HAVE_NCURSES
|
|
|
|
libtcolors_la_LIBADD += $(NCURSES_LIBS)
|
|
|
|
libtcolors_la_CFLAGS += $(NCURSES_CFLAGS)
|
|
|
|
endif
|
|
|
|
endif # !HAVE_TINFO
|
2015-02-27 06:57:34 -06:00
|
|
|
|
2014-03-11 04:05:32 -05:00
|
|
|
dist_man_MANS += lib/terminal-colors.d.5
|
|
|
|
|
2015-02-27 06:57:34 -06:00
|
|
|
|
2012-07-30 10:59:16 -05:00
|
|
|
check_PROGRAMS += \
|
2012-05-16 17:54:26 -05:00
|
|
|
test_blkdev \
|
|
|
|
test_canonicalize \
|
2013-05-06 12:07:23 -05:00
|
|
|
test_colors \
|
2012-05-16 17:54:26 -05:00
|
|
|
test_fileutils \
|
|
|
|
test_ismounted \
|
2016-10-14 06:21:17 -05:00
|
|
|
test_pwdutils \
|
2012-05-16 17:54:26 -05:00
|
|
|
test_mangle \
|
|
|
|
test_randutils \
|
|
|
|
test_strutils \
|
2016-05-11 08:31:02 -05:00
|
|
|
test_ttyutils \
|
|
|
|
test_timeutils
|
2012-05-16 17:54:26 -05:00
|
|
|
|
2015-02-27 06:57:34 -06:00
|
|
|
|
2012-05-16 17:54:26 -05:00
|
|
|
if LINUX
|
|
|
|
if HAVE_CPU_SET_T
|
2012-07-30 10:59:16 -05:00
|
|
|
check_PROGRAMS += test_cpuset
|
2012-05-16 17:54:26 -05:00
|
|
|
endif
|
2012-07-30 10:59:16 -05:00
|
|
|
check_PROGRAMS += \
|
2012-05-16 17:54:26 -05:00
|
|
|
test_sysfs \
|
2012-08-08 10:19:43 -05:00
|
|
|
test_pager
|
2012-05-16 17:54:26 -05:00
|
|
|
endif
|
|
|
|
|
2016-02-29 10:45:46 -06:00
|
|
|
if HAVE_OPENAT
|
2018-10-24 07:32:29 -05:00
|
|
|
if HAVE_DIRFD
|
2016-02-29 10:45:46 -06:00
|
|
|
check_PROGRAMS += test_procutils
|
lib/path: new implementation
The goal is to avoid duplicate code in path.c and sysfs.c and make it
possible to define prefix for paths for all sysfs and procfs based
utils. Now we have /proc snapshots (for tests) for lscpu only. It
would be nice to have the same (for sysfs) for lsblk and another tools.
* very simple API to read numbers, strings and symlinks
* based on openat()
pc = ul_new_path("/sys/block/sda");
ul_path_read_u64(pc, &size, "size");
ul_path_read_u64(pc, &lsz, "queue/logical_block_size");
* printf-like API to generate paths, for example:
ul_path_readf_u64(pc, &num, "sda%d/size", partno)
* allow to define prefix to redirect hardcoded paths to another
location, for example:
pc = ul_new_path("/sys/block/sda");
ul_path_set_prefix(pc, "/my/regression/dump");
ul_path_read_u64(pc, &num, "size");
to read /my/regression/dump/sys/block/sda/size
* allow to extend the API by "dialects", for example for sysfs:
pc = ul_new_path(NULL);
sysfs_blkdev_init_path(pc, devno, NULL);
and use ul_path_* functions to read from @pc initialized by
sysfs_blkdev_init_path()
* add test_path binary
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-09 08:54:12 -05:00
|
|
|
check_PROGRAMS += test_path
|
2016-02-29 10:45:46 -06:00
|
|
|
endif
|
2018-10-24 07:32:29 -05:00
|
|
|
endif
|
2016-02-29 10:45:46 -06:00
|
|
|
|
2012-11-22 07:32:21 -06:00
|
|
|
test_ttyutils_SOURCES = lib/ttyutils.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_ttyutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_TTYUTILS
|
2016-02-22 12:48:30 -06:00
|
|
|
test_ttyutils_LDADD = $(LDADD) libcommon.la
|
2012-11-22 07:32:21 -06:00
|
|
|
|
2012-05-16 17:54:26 -05:00
|
|
|
test_blkdev_SOURCES = lib/blkdev.c
|
2016-02-22 13:20:14 -06:00
|
|
|
test_blkdev_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_BLKDEV
|
2016-02-22 12:48:30 -06:00
|
|
|
test_blkdev_LDADD = $(LDADD) libcommon.la
|
2012-05-22 08:56:29 -05:00
|
|
|
|
2012-05-16 17:54:26 -05:00
|
|
|
test_ismounted_SOURCES = lib/ismounted.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_ismounted_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_ISMOUNTED
|
2017-05-31 14:02:12 -05:00
|
|
|
test_ismounted_LDADD = libcommon.la $(LDADD)
|
2012-05-22 08:56:29 -05:00
|
|
|
|
2012-05-16 17:54:26 -05:00
|
|
|
test_mangle_SOURCES = lib/mangle.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_mangle_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_MANGLE
|
2012-05-16 17:54:26 -05:00
|
|
|
|
|
|
|
test_strutils_SOURCES = lib/strutils.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_strutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_STRUTILS
|
2012-05-22 08:56:29 -05:00
|
|
|
|
2015-07-24 07:33:25 -05:00
|
|
|
test_colors_SOURCES = lib/colors.c lib/color-names.c
|
2017-05-30 18:29:25 -05:00
|
|
|
test_colors_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_COLORS
|
|
|
|
test_colors_LDADD = $(LDADD) libtcolors.la
|
2013-05-06 12:07:23 -05:00
|
|
|
|
2012-05-16 17:54:26 -05:00
|
|
|
test_randutils_SOURCES = lib/randutils.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_randutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_RANDUTILS
|
2012-05-22 08:56:29 -05:00
|
|
|
|
2016-02-29 10:45:46 -06:00
|
|
|
if HAVE_OPENAT
|
2018-10-24 07:32:29 -05:00
|
|
|
if HAVE_DIRFD
|
2016-02-29 05:49:13 -06:00
|
|
|
test_procutils_SOURCES = lib/procutils.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_procutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_PROCUTILS
|
2012-05-16 17:54:26 -05:00
|
|
|
|
lib/path: new implementation
The goal is to avoid duplicate code in path.c and sysfs.c and make it
possible to define prefix for paths for all sysfs and procfs based
utils. Now we have /proc snapshots (for tests) for lscpu only. It
would be nice to have the same (for sysfs) for lsblk and another tools.
* very simple API to read numbers, strings and symlinks
* based on openat()
pc = ul_new_path("/sys/block/sda");
ul_path_read_u64(pc, &size, "size");
ul_path_read_u64(pc, &lsz, "queue/logical_block_size");
* printf-like API to generate paths, for example:
ul_path_readf_u64(pc, &num, "sda%d/size", partno)
* allow to define prefix to redirect hardcoded paths to another
location, for example:
pc = ul_new_path("/sys/block/sda");
ul_path_set_prefix(pc, "/my/regression/dump");
ul_path_read_u64(pc, &num, "size");
to read /my/regression/dump/sys/block/sda/size
* allow to extend the API by "dialects", for example for sysfs:
pc = ul_new_path(NULL);
sysfs_blkdev_init_path(pc, devno, NULL);
and use ul_path_* functions to read from @pc initialized by
sysfs_blkdev_init_path()
* add test_path binary
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-09 08:54:12 -05:00
|
|
|
test_path_SOURCES = lib/path.c lib/fileutils.c
|
|
|
|
if HAVE_CPU_SET_T
|
|
|
|
test_path_SOURCES += lib/cpuset.c
|
|
|
|
endif
|
|
|
|
test_path_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_PATH
|
|
|
|
test_path_LDADD = $(LDADD)
|
|
|
|
endif
|
2018-10-24 07:32:29 -05:00
|
|
|
endif
|
lib/path: new implementation
The goal is to avoid duplicate code in path.c and sysfs.c and make it
possible to define prefix for paths for all sysfs and procfs based
utils. Now we have /proc snapshots (for tests) for lscpu only. It
would be nice to have the same (for sysfs) for lsblk and another tools.
* very simple API to read numbers, strings and symlinks
* based on openat()
pc = ul_new_path("/sys/block/sda");
ul_path_read_u64(pc, &size, "size");
ul_path_read_u64(pc, &lsz, "queue/logical_block_size");
* printf-like API to generate paths, for example:
ul_path_readf_u64(pc, &num, "sda%d/size", partno)
* allow to define prefix to redirect hardcoded paths to another
location, for example:
pc = ul_new_path("/sys/block/sda");
ul_path_set_prefix(pc, "/my/regression/dump");
ul_path_read_u64(pc, &num, "size");
to read /my/regression/dump/sys/block/sda/size
* allow to extend the API by "dialects", for example for sysfs:
pc = ul_new_path(NULL);
sysfs_blkdev_init_path(pc, devno, NULL);
and use ul_path_* functions to read from @pc initialized by
sysfs_blkdev_init_path()
* add test_path binary
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-05-09 08:54:12 -05:00
|
|
|
|
2019-07-04 04:57:11 -05:00
|
|
|
if HAVE_PTY
|
|
|
|
check_PROGRAMS += test_pty
|
|
|
|
test_pty_SOURCES = lib/pty-session.c \
|
2019-07-30 07:29:20 -05:00
|
|
|
include/pty-session.h \
|
|
|
|
lib/monotonic.c
|
2019-07-04 04:57:11 -05:00
|
|
|
test_pty_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_PTY
|
2019-10-10 01:57:30 -05:00
|
|
|
test_pty_LDADD = $(LDADD) libcommon.la $(MATH_LIBS) $(REALTIME_LIBS) -lutil
|
2019-07-04 04:57:11 -05:00
|
|
|
endif
|
|
|
|
|
2012-05-16 17:54:26 -05:00
|
|
|
if LINUX
|
|
|
|
test_cpuset_SOURCES = lib/cpuset.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_cpuset_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_CPUSET
|
2012-05-22 08:56:29 -05:00
|
|
|
|
2018-05-11 07:28:03 -05:00
|
|
|
test_sysfs_SOURCES = lib/sysfs.c lib/path.c lib/fileutils.c
|
|
|
|
if HAVE_CPU_SET_T
|
|
|
|
test_sysfs_SOURCES += lib/cpuset.c
|
|
|
|
endif
|
2016-02-22 13:20:14 -06:00
|
|
|
test_sysfs_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_SYSFS
|
2018-05-11 07:28:03 -05:00
|
|
|
test_sysfs_LDADD = $(LDADD)
|
2012-05-16 17:54:26 -05:00
|
|
|
|
2012-05-22 08:56:29 -05:00
|
|
|
test_pager_SOURCES = lib/pager.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_pager_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_PAGER
|
2017-01-02 04:36:53 -06:00
|
|
|
|
2017-01-04 08:44:51 -06:00
|
|
|
check_PROGRAMS += test_linux_version
|
2017-01-02 04:36:53 -06:00
|
|
|
test_linux_version_SOURCES = lib/linux_version.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_linux_version_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_LINUXVERSION
|
2012-05-16 17:54:26 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
test_fileutils_SOURCES = lib/fileutils.c
|
2017-01-04 04:44:37 -06:00
|
|
|
test_fileutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_FILEUTILS
|
2012-05-22 08:56:29 -05:00
|
|
|
|
2012-05-16 17:54:26 -05:00
|
|
|
test_canonicalize_SOURCES = lib/canonicalize.c
|
2016-02-22 13:20:14 -06:00
|
|
|
test_canonicalize_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_CANONICALIZE
|
2012-05-16 17:54:26 -05:00
|
|
|
|
2016-05-11 08:31:02 -05:00
|
|
|
test_timeutils_SOURCES = lib/timeutils.c lib/strutils.c
|
|
|
|
test_timeutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM_TIMEUTILS
|
2016-10-14 06:21:17 -05:00
|
|
|
|
|
|
|
test_pwdutils_SOURCES = lib/pwdutils.c
|
|
|
|
test_pwdutils_CFLAGS = $(AM_CFLAGS) -DTEST_PROGRAM
|