]> err.no Git - util-linux/commitdiff
libmount: add basic dirs
authorKarel Zak <kzak@redhat.com>
Thu, 26 Nov 2009 16:11:12 +0000 (17:11 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 3 Jun 2010 13:20:10 +0000 (15:20 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
config/include-Makefile.am
configure.ac
shlibs/Makefile.am
shlibs/mount/.gitignore [new file with mode: 0644]
shlibs/mount/Makefile.am [new file with mode: 0644]
shlibs/mount/mount.pc.in [new file with mode: 0644]
shlibs/mount/src/Makefile.am [new file with mode: 0644]
shlibs/mount/src/mount.h.in [new file with mode: 0644]
shlibs/mount/src/mount.sym [new file with mode: 0644]

index e13bb8ee375484790eeafce3fe10ed4e6a12e8c7..e7dbd34e4ad7226d808103822cdf284cb2e37073 100644 (file)
@@ -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)
index fae8db145d175cfb9798e80b969328b2af33a7d0..286703b5eedb97c42041de89f82a8a72161d17fa 100644 (file)
@@ -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
index 3e757885bb1a09e976685e08545b16103bf586c8..84c0cefc82de0cddfcfca7bf40eb39bbd3651d00 100644 (file)
@@ -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 (file)
index 0000000..1c7879d
--- /dev/null
@@ -0,0 +1,2 @@
+test_*
+mount.h
diff --git a/shlibs/mount/Makefile.am b/shlibs/mount/Makefile.am
new file mode 100644 (file)
index 0000000..f90eacc
--- /dev/null
@@ -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 (file)
index 0000000..94051b8
--- /dev/null
@@ -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 (file)
index 0000000..5d6c32d
--- /dev/null
@@ -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 (file)
index 0000000..e9b0425
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * mount.h - libmount API
+ *
+ * Copyright (C) 2008-2009 Karel Zak <kzak@redhat.com>
+ *
+ * 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 (file)
index 0000000..5922560
--- /dev/null
@@ -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:
+       *;
+};