From: Karel Zak Date: Thu, 26 Nov 2009 16:11:12 +0000 (+0100) Subject: libmount: add basic dirs X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1cde479a3aa2659ffdee27e22d4a49a5cd9b0a5;p=util-linux libmount: add basic dirs Signed-off-by: Karel Zak --- diff --git a/config/include-Makefile.am b/config/include-Makefile.am index e13bb8ee..e7dbd34e 100644 --- a/config/include-Makefile.am +++ b/config/include-Makefile.am @@ -22,6 +22,7 @@ ul_libblkid_incdir = $(ul_libblkid_builddir) $(ul_libblkid_la): $(MAKE) -C $(ul_libblkid_builddir) + # uuid ul_libuuid_srcdir = $(top_srcdir)/shlibs/uuid/src ul_libuuid_builddir = $(top_builddir)/shlibs/uuid/src @@ -30,3 +31,14 @@ ul_libuuid_la = $(top_builddir)/shlibs/uuid/src/libuuid.la $(ul_libuuid_la): $(MAKE) -C $(ul_libuuid_builddir) + +# mount +ul_libmount_srcdir = $(top_srcdir)/shlibs/mount/src +ul_libmount_builddir = $(top_builddir)/shlibs/mount/src +ul_libmount_la = $(top_builddir)/shlibs/mount/src/libmount.la + +# mount.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) diff --git a/configure.ac b/configure.ac index fae8db14..286703b5 100644 --- a/configure.ac +++ b/configure.ac @@ -35,6 +35,13 @@ LIBUUID_LT_MINOR=3 LIBUUID_LT_MICRO=0 LIBUUID_VERSION_INFO=`expr $LIBUUID_LT_MAJOR + $LIBUUID_LT_MINOR`:$LIBUUID_LT_MICRO:$LIBUUID_LT_MINOR +dnl libmount version +LIBMOUNT_VERSION="$PACKAGE_VERSION_MAJOR.$PACKAGE_VERSION_MINOR.$PACKAGE_VERSION_RELEASE" +LIBMOUNT_LT_MAJOR=1 +LIBMOUNT_LT_MINOR=1 +LIBMOUNT_LT_MICRO=0 +LIBMOUNT_VERSION_INFO=`expr $LIBMOUNT_LT_MAJOR + $LIBMOUNT_LT_MINOR`:$LIBMOUNT_LT_MICRO:$LIBMOUNT_LT_MINOR + # Check whether exec_prefix=/usr: case $exec_prefix:$prefix in NONE:NONE | NONE:/usr | /usr:*) @@ -390,6 +397,16 @@ AM_CONDITIONAL(HAVE_BLKID, test "x$have_blkid" = xyes) AC_ARG_VAR([BLKID_LIBS_STATIC], [-l options for linking statically with blkid]) + +AC_ARG_ENABLE([libmount], + AS_HELP_STRING([--disable-libmount], [do not build libmount]), + [], enable_libmount=yes +) +AC_SUBST([LIBMOUNT_VERSION]) +AC_SUBST([LIBMOUNT_VERSION_INFO]) +AM_CONDITIONAL(BUILD_LIBMOUNT, test "x$enable_libmount" = xyes) + + UTIL_CHECK_LIB(util, openpty) UTIL_CHECK_LIB(termcap, tgetnum) @@ -1122,6 +1139,10 @@ shlibs/blkid/src/superblocks/Makefile shlibs/blkid/src/topology/Makefile shlibs/blkid/src/partitions/Makefile shlibs/blkid/samples/Makefile +shlibs/mount/mount.pc +shlibs/mount/Makefile +shlibs/mount/src/Makefile +shlibs/mount/src/mount.h shlibs/uuid/uuid.pc shlibs/uuid/Makefile shlibs/uuid/man/Makefile diff --git a/shlibs/Makefile.am b/shlibs/Makefile.am index 3e757885..84c0cefc 100644 --- a/shlibs/Makefile.am +++ b/shlibs/Makefile.am @@ -7,3 +7,7 @@ endif if BUILD_LIBBLKID SUBDIRS += blkid endif + +if BUILD_LIBMOUNT +SUBDIRS += mount +endif diff --git a/shlibs/mount/.gitignore b/shlibs/mount/.gitignore new file mode 100644 index 00000000..1c7879de --- /dev/null +++ b/shlibs/mount/.gitignore @@ -0,0 +1,2 @@ +test_* +mount.h diff --git a/shlibs/mount/Makefile.am b/shlibs/mount/Makefile.am new file mode 100644 index 00000000..f90eacc1 --- /dev/null +++ b/shlibs/mount/Makefile.am @@ -0,0 +1,9 @@ +include $(top_srcdir)/config/include-Makefile.am + +SUBDIRS = src + +# pkg-config stuff +pkgconfigdir = $(usrlib_execdir)/pkgconfig +pkgconfig_DATA = mount.pc + +EXTRA_DIST = mount.pc.in diff --git a/shlibs/mount/mount.pc.in b/shlibs/mount/mount.pc.in new file mode 100644 index 00000000..94051b8b --- /dev/null +++ b/shlibs/mount/mount.pc.in @@ -0,0 +1,11 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@usrlib_execdir@ +includedir=@includedir@ + +Name: mount +Description: mount library +Version: @LIBMOUNT_VERSION@ +Requires.private: blkid +Cflags: -I${includedir}/mount +Libs: -L${libdir} -lmount diff --git a/shlibs/mount/src/Makefile.am b/shlibs/mount/src/Makefile.am new file mode 100644 index 00000000..5d6c32df --- /dev/null +++ b/shlibs/mount/src/Makefile.am @@ -0,0 +1,46 @@ +include $(top_srcdir)/config/include-Makefile.am + +AM_CPPFLAGS += -I$(ul_libmount_incdir) \ + -I$(ul_libmount_srcdir) \ + -I$(ul_libblkid_incdir) + +# includes +mountincdir = $(includedir)/mount +nodist_mountinc_HEADERS = mount.h + +usrlib_exec_LTLIBRARIES = libmount.la +libmount_la_SOURCES = $(mountinc_HEADERS) + +nodist_libmount_la_SOURCES = mount.h + +libmount_la_LIBADD = $(ul_libblkid_la) + +libmount_la_DEPENDENCIES = $(libmount_la_LIBADD) mount.sym mount.h.in + +libmount_la_LDFLAGS = -Wl,--version-script=$(ul_libmount_srcdir)/mount.sym \ + -version-info $(LIBMOUNT_VERSION_INFO) + +tests = + +EXTRA_DIST = mount.sym mount.h.in +CLEANFILES = $(tests) + +tests: all $(tests) +test_%: %.c + $(COMPILE) -DTEST_PROGRAM $< .libs/libmount.a -o $@ $(BLKID_LIBS) + + +# 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* diff --git a/shlibs/mount/src/mount.h.in b/shlibs/mount/src/mount.h.in new file mode 100644 index 00000000..e9b0425c --- /dev/null +++ b/shlibs/mount/src/mount.h.in @@ -0,0 +1,34 @@ +/* + * mount.h - libmount API + * + * Copyright (C) 2008-2009 Karel Zak + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef _LIBMOUNT_MOUNT_H +#define _LIBMOUNT_MOUNT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#define LIBMOUNT_VERSION "@LIBMOUNT_VERSION@" + +#ifdef __cplusplus +} +#endif + +#endif /* _LIBMOUNT_MOUNT_H */ diff --git a/shlibs/mount/src/mount.sym b/shlibs/mount/src/mount.sym new file mode 100644 index 00000000..5922560b --- /dev/null +++ b/shlibs/mount/src/mount.sym @@ -0,0 +1,11 @@ +/* + * The symbol versioning ensures that a new application requiring symbol foo() + * can't run with old libblkid.so not providing foo() - the global SONAME + * version info can't enforce this since we never change the SONAME. + */ +MOUNT_2.18 { +global: + dummy; +local: + *; +};