build-sys: convert libmount/ to module
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
f77a4d1087
commit
bc94024d08
12
Makefile.am
12
Makefile.am
|
@ -21,18 +21,10 @@ INSTALL_DATA_HOOKS =
|
|||
EXTRA_DIST =
|
||||
CLEANFILES =
|
||||
|
||||
|
||||
SHLIBS_DIRS =
|
||||
|
||||
if BUILD_LIBMOUNT
|
||||
SHLIBS_DIRS += libmount
|
||||
endif
|
||||
|
||||
MAN_DIRS = man/ru
|
||||
|
||||
SUBDIRS = \
|
||||
$(MAN_DIRS) \
|
||||
$(SHLIBS_DIRS) \
|
||||
disk-utils \
|
||||
fdisk \
|
||||
getopt \
|
||||
|
@ -74,9 +66,11 @@ EXTRA_DIST += \
|
|||
|
||||
include include/Makemodule.am
|
||||
include lib/Makemodule.am
|
||||
include schedutils/Makemodule.am
|
||||
include libuuid/Makemodule.am
|
||||
include libblkid/Makemodule.am
|
||||
include libmount/Makemodule.am
|
||||
|
||||
include schedutils/Makemodule.am
|
||||
|
||||
|
||||
# Arrange so that .tarball-version appears only in the distribution
|
||||
|
|
|
@ -16,9 +16,8 @@ dist_noinst_DATA = $(dist_man_MANS)
|
|||
# blkid
|
||||
ul_libblkid_srcdir = $(top_srcdir)/libblkid/src
|
||||
ul_libblkid_builddir = $(top_builddir)/libblkid/src
|
||||
ul_libblkid_la = libblkid.la
|
||||
# blkid.h is generated by ./configure script and stored in build directory
|
||||
ul_libblkid_incdir = $(ul_libblkid_builddir)
|
||||
ul_libblkid_la = libblkid.la
|
||||
|
||||
# uuid
|
||||
ul_libuuid_srcdir = $(top_srcdir)/libuuid/src
|
||||
|
@ -29,13 +28,8 @@ ul_libuuid_la = libuuid.la
|
|||
# mount
|
||||
ul_libmount_srcdir = $(top_srcdir)/libmount/src
|
||||
ul_libmount_builddir = $(top_builddir)/libmount/src
|
||||
ul_libmount_la = $(top_builddir)/libmount/src/libmount.la
|
||||
|
||||
# libmount.h is generated by ./configure script and stored in build directory
|
||||
ul_libmount_incdir = $(ul_libmount_builddir)
|
||||
|
||||
$(ul_libmount_la):
|
||||
$(MAKE) -C $(ul_libmount_builddir)
|
||||
ul_libmount_la = libmount.la
|
||||
|
||||
#
|
||||
# smatch scan -- smatch and cgcc are expected in $PATH
|
||||
|
|
|
@ -1308,11 +1308,9 @@ libblkid/blkid.pc
|
|||
libblkid/docs/Makefile
|
||||
libblkid/docs/version.xml
|
||||
libblkid/src/blkid.h
|
||||
libmount/Makefile
|
||||
libmount/docs/Makefile
|
||||
libmount/docs/version.xml
|
||||
libmount/mount.pc
|
||||
libmount/src/Makefile
|
||||
libmount/src/libmount.h
|
||||
libuuid/uuid.pc
|
||||
login-utils/Makefile
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
include $(top_srcdir)/config/include-Makefile.am
|
||||
|
||||
SUBDIRS = src
|
||||
|
||||
if ENABLE_GTK_DOC
|
||||
SUBDIRS += docs
|
||||
endif
|
||||
|
||||
# pkg-config stuff
|
||||
pkgconfigdir = $(usrlib_execdir)/pkgconfig
|
||||
pkgconfig_DATA = mount.pc
|
||||
|
||||
EXTRA_DIST = mount.pc.in
|
|
@ -0,0 +1,10 @@
|
|||
if BUILD_LIBMOUNT
|
||||
|
||||
include libmount/src/Makemodule.am
|
||||
|
||||
#include libmount/docs/Makemodule.am
|
||||
|
||||
pkgconfig_DATA += libmount/mount.pc
|
||||
EXTRA_DIST += libmount/mount.pc.in
|
||||
|
||||
endif # BUILD_LIBMOUNT
|
|
@ -1,98 +0,0 @@
|
|||
include $(top_srcdir)/config/include-Makefile.am
|
||||
|
||||
AM_CPPFLAGS += \
|
||||
-I$(ul_libblkid_incdir) \
|
||||
-I$(ul_libmount_incdir) \
|
||||
-I$(ul_libmount_srcdir)
|
||||
|
||||
# includes
|
||||
mountincdir = $(includedir)/libmount
|
||||
nodist_mountinc_HEADERS = libmount.h
|
||||
|
||||
usrlib_exec_LTLIBRARIES = libmount.la
|
||||
libmount_la_SOURCES = \
|
||||
cache.c \
|
||||
context.c \
|
||||
context_loopdev.c \
|
||||
context_mount.c \
|
||||
context_umount.c \
|
||||
fs.c \
|
||||
init.c \
|
||||
iter.c \
|
||||
lock.c \
|
||||
mountP.h \
|
||||
optmap.c \
|
||||
optstr.c \
|
||||
tab.c \
|
||||
tab_diff.c \
|
||||
tab_parse.c \
|
||||
tab_update.c \
|
||||
test.c \
|
||||
utils.c \
|
||||
version.c \
|
||||
$(mountinc_HEADERS) \
|
||||
$(top_srcdir)/include/list.h \
|
||||
$(top_srcdir)/lib/at.c \
|
||||
$(top_srcdir)/lib/canonicalize.c \
|
||||
$(top_srcdir)/lib/env.c \
|
||||
$(top_srcdir)/lib/linux_version.c \
|
||||
$(top_srcdir)/lib/loopdev.c \
|
||||
$(top_srcdir)/lib/mangle.c \
|
||||
$(top_srcdir)/lib/match.c \
|
||||
$(top_srcdir)/lib/strutils.c \
|
||||
$(top_srcdir)/lib/sysfs.c
|
||||
|
||||
nodist_libmount_la_SOURCES = mountP.h
|
||||
|
||||
libmount_la_LIBADD = $(ul_libblkid_la) $(SELINUX_LIBS)
|
||||
|
||||
libmount_la_DEPENDENCIES = \
|
||||
$(libmount_la_LIBADD) \
|
||||
libmount.sym \
|
||||
libmount.h.in
|
||||
|
||||
libmount_la_LDFLAGS = \
|
||||
-Wl,--version-script=$(ul_libmount_srcdir)/libmount.sym \
|
||||
-version-info $(LIBMOUNT_VERSION_INFO)
|
||||
|
||||
TESTS_LIBS = -luuid
|
||||
|
||||
if HAVE_SELINUX
|
||||
TESTS_LIBS += $(SELINUX_LIBS)
|
||||
endif
|
||||
|
||||
EXTRA_DIST = libmount.sym libmount.h.in
|
||||
CLEANFILES = $(tests)
|
||||
|
||||
# move lib from $(usrlib_execdir) to $(libdir) if needed
|
||||
install-exec-hook:
|
||||
if test "$(usrlib_execdir)" != "$(libdir)"; then \
|
||||
mkdir -p $(DESTDIR)$(libdir); \
|
||||
mv $(DESTDIR)$(usrlib_execdir)/libmount.so.* $(DESTDIR)$(libdir); \
|
||||
so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libmount.so); \
|
||||
so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
|
||||
(cd $(DESTDIR)$(usrlib_execdir) && \
|
||||
rm -f libmount.so && \
|
||||
$(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name libmount.so); \
|
||||
fi
|
||||
|
||||
uninstall-hook:
|
||||
rm -f $(DESTDIR)$(libdir)/libmount.so*
|
||||
|
||||
|
||||
tests = \
|
||||
test_cache \
|
||||
test_context \
|
||||
test_lock \
|
||||
test_optstr \
|
||||
test_tab \
|
||||
test_tab_diff \
|
||||
test_tab_update \
|
||||
test_utils \
|
||||
test_version
|
||||
|
||||
tests: all $(tests)
|
||||
test_%: %.c
|
||||
$(AM_V_CC)$(COMPILE) -DTEST_PROGRAM $< .libs/libmount.a \
|
||||
$(ul_libblkid_builddir)/.libs/libblkid.a -o $@ \
|
||||
$(TESTS_LIBS)
|
|
@ -0,0 +1,143 @@
|
|||
|
||||
# libmount.h is generated, so it's store in builddir!
|
||||
mountincdir = $(includedir)/libmount
|
||||
nodist_mountinc_HEADERS = $(top_builddir)/libmount/src/libmount.h
|
||||
|
||||
usrlib_exec_LTLIBRARIES += libmount.la
|
||||
libmount_la_SOURCES = \
|
||||
include/list.h \
|
||||
lib/at.c \
|
||||
lib/canonicalize.c \
|
||||
lib/env.c \
|
||||
lib/linux_version.c \
|
||||
lib/loopdev.c \
|
||||
lib/mangle.c \
|
||||
lib/match.c \
|
||||
lib/strutils.c \
|
||||
lib/sysfs.c \
|
||||
\
|
||||
libmount/src/cache.c \
|
||||
libmount/src/context.c \
|
||||
libmount/src/context_loopdev.c \
|
||||
libmount/src/context_mount.c \
|
||||
libmount/src/context_umount.c \
|
||||
libmount/src/fs.c \
|
||||
libmount/src/init.c \
|
||||
libmount/src/iter.c \
|
||||
libmount/src/lock.c \
|
||||
libmount/src/mountP.h \
|
||||
libmount/src/optmap.c \
|
||||
libmount/src/optstr.c \
|
||||
libmount/src/tab.c \
|
||||
libmount/src/tab_diff.c \
|
||||
libmount/src/tab_parse.c \
|
||||
libmount/src/tab_update.c \
|
||||
libmount/src/test.c \
|
||||
libmount/src/utils.c \
|
||||
libmount/src/version.c \
|
||||
$(mountinc_HEADERS)
|
||||
|
||||
nodist_libmount_la_SOURCES = libmount/src/mountP.h
|
||||
|
||||
libmount_la_LIBADD = libblkid.la $(SELINUX_LIBS)
|
||||
|
||||
libmount_la_CFLAGS = \
|
||||
-I$(ul_libblkid_incdir) \
|
||||
-I$(ul_libmount_incdir) \
|
||||
-I$(top_srcdir)/libmount/src
|
||||
|
||||
libmount_la_DEPENDENCIES = \
|
||||
$(libmount_la_LIBADD) \
|
||||
libmount/src/libmount.sym \
|
||||
libmount/src/libmount.h.in
|
||||
|
||||
libmount_la_LDFLAGS = \
|
||||
-Wl,--version-script=$(top_srcdir)/libmount/src/libmount.sym \
|
||||
-version-info $(LIBMOUNT_VERSION_INFO)
|
||||
|
||||
EXTRA_DIST += \
|
||||
libmount/src/libmount.sym \
|
||||
libmount/src/libmount.h.in
|
||||
|
||||
noinst_PROGRAMS += \
|
||||
test_mount_cache \
|
||||
test_mount_context \
|
||||
test_mount_lock \
|
||||
test_mount_optstr \
|
||||
test_mount_tab \
|
||||
test_mount_tab_diff \
|
||||
test_mount_tab_update \
|
||||
test_mount_utils \
|
||||
test_mount_version
|
||||
|
||||
libmount_tests_cflags = -DTEST_PROGRAM $(libmount_la_CFLAGS)
|
||||
libmount_tests_ldflags = libblkid.la -static
|
||||
libmount_tests_ldadd = libmount.la $(UUID_LIBS)
|
||||
|
||||
if HAVE_SELINUX
|
||||
libmount_tests_ldadd += $(SELINUX_LIBS)
|
||||
endif
|
||||
|
||||
test_mount_cache_SOURCES = libmount/src/cache.c
|
||||
test_mount_cache_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_cache_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_cache_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
test_mount_context_SOURCES = libmount/src/context.c
|
||||
test_mount_context_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_context_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_context_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
test_mount_lock_SOURCES = libmount/src/lock.c
|
||||
test_mount_lock_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_lock_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_lock_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
test_mount_optstr_SOURCES = libmount/src/optstr.c
|
||||
test_mount_optstr_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_optstr_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_optstr_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
test_mount_tab_SOURCES = libmount/src/tab.c
|
||||
test_mount_tab_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_tab_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_tab_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
test_mount_tab_diff_SOURCES = libmount/src/tab_diff.c
|
||||
test_mount_tab_diff_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_tab_diff_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_tab_diff_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
test_mount_tab_update_SOURCES = libmount/src/tab_update.c
|
||||
test_mount_tab_update_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_tab_update_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_tab_update_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
test_mount_utils_SOURCES = libmount/src/utils.c
|
||||
test_mount_utils_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_utils_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_utils_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
test_mount_version_SOURCES = libmount/src/version.c
|
||||
test_mount_version_CFLAGS = $(libmount_tests_cflags)
|
||||
test_mount_version_LDFLAGS = $(libmount_tests_ldflags)
|
||||
test_mount_version_LDADD = $(libmount_tests_ldadd)
|
||||
|
||||
|
||||
# move lib from $(usrlib_execdir) to $(libdir) if needed
|
||||
install-exec-hook-libmount:
|
||||
if test "$(usrlib_execdir)" != "$(libdir)"; then \
|
||||
mkdir -p $(DESTDIR)$(libdir); \
|
||||
mv $(DESTDIR)$(usrlib_execdir)/libmount.so.* $(DESTDIR)$(libdir); \
|
||||
so_img_name=$$(readlink $(DESTDIR)$(usrlib_execdir)/libmount.so); \
|
||||
so_img_rel_target=$$(echo $(usrlib_execdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
|
||||
(cd $(DESTDIR)$(usrlib_execdir) && \
|
||||
rm -f libmount.so && \
|
||||
$(LN_S) $$so_img_rel_target$(libdir)/$$so_img_name libmount.so); \
|
||||
fi
|
||||
|
||||
uninstall-hook-libmount:
|
||||
rm -f $(DESTDIR)$(libdir)/libmount.so*
|
||||
|
||||
INSTALL_EXEC_HOOKS += install-exec-hook-libmount
|
||||
UNINSTALL_HOOKS += uninstall-hook-libmount
|
Loading…
Reference in New Issue