From: Theodore Ts'o <tytso@mit.edu>
To: linux-f2fs-devel@lists.sourceforge.net
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH 1/2] add configure option --with-root-libdir
Date: Sun, 19 Aug 2018 23:04:06 -0400 [thread overview]
Message-ID: <20180820030407.13225-1-tytso@mit.edu> (raw)
This allows the development link libraries to be installed in
/usr/lib, while the run-libraries are installed in /lib, which is
required by Debian policy. This can be done via:
configure --prefix=/ --libdir=/usr/lib --with-root-libdir=/lib
The technique of working around libtool's inflexibility is borrowed
from util-linux.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
---
configure.ac | 11 +++++++++++
lib/Makefile.am | 17 +++++++++++++++++
mkfs/Makefile.am | 15 +++++++++++++++
3 files changed, 43 insertions(+)
diff --git a/configure.ac b/configure.ac
index f04f281..62c18eb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -190,6 +190,17 @@ AM_CONDITIONAL([OSX], [test "$build_mac" = "yes"])
#AC_SUBST([sbindir], [/sbin])
#AC_SUBST([sysconfdir], [/etc])
#AC_SUBST([localstatedir], [/var])
+
+AC_ARG_WITH([root-libdir],
+[ --with-root-libdir=DIR override location for /lib/libf2fs.so],
+root_libdir=$withval,
+root_libdir=NONE)dnl
+
+if test "$root_libdir" = NONE ; then
+ root_libdir="$libdir"
+fi
+AC_SUBST(root_libdir)
+
AC_CONFIG_FILES([
Makefile
man/Makefile
diff --git a/lib/Makefile.am b/lib/Makefile.am
index b26b404..c1875a0 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -6,3 +6,20 @@ libf2fs_la_SOURCES = libf2fs.c libf2fs_io.c libf2fs_zoned.c
libf2fs_la_CFLAGS = -Wall
libf2fs_la_CPPFLAGS = -I$(top_srcdir)/include
libf2fs_la_LDFLAGS = -version-info $(LIBF2FS_CURRENT):$(LIBF2FS_REVISION):$(LIBF2FS_AGE)
+
+root_libdir=@root_libdir@
+
+install-exec-hook:
+ if test -n "$(root_libdir)" -a "$(libdir)" != "$(root_libdir)" -a \
+ -f "$(DESTDIR)$(libdir)/libf2fs.so"; then \
+ $(MKDIR_P) $(DESTDIR)$(root_libdir); \
+ mv $(DESTDIR)$(libdir)/libf2fs.so.* $(DESTDIR)$(root_libdir); \
+ so_img_name=$$(readlink $(DESTDIR)$(libdir)/libf2fs.so); \
+ so_img_rel_target=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
+ (cd $(DESTDIR)$(libdir) && \
+ rm -f libf2fs.so && \
+ $(LN_S) $$so_img_rel_target$(root_libdir)/$$so_img_name libf2fs.so); \
+ fi
+
+uninstall-hook:
+ rm -f $(DESTDIR)$(root_libdir)/libf2fs.so*
diff --git a/mkfs/Makefile.am b/mkfs/Makefile.am
index bbb4917..32996ba 100644
--- a/mkfs/Makefile.am
+++ b/mkfs/Makefile.am
@@ -14,3 +14,18 @@ libf2fs_format_la_CFLAGS = -DWITH_BLKDISCARD
libf2fs_format_la_CPPFLAGS = -I$(top_srcdir)/include
libf2fs_format_la_LDFLAGS = -luuid -L$(top_builddir)/lib -lf2fs \
-version-info $(FMT_CURRENT):$(FMT_REVISION):$(FMT_AGE)
+
+install-exec-hook:
+ if test -n "$(root_libdir)" -a "$(libdir)" != "$(root_libdir)" -a \
+ -f "$(DESTDIR)$(libdir)/libf2fs_format.so"; then \
+ $(MKDIR_P) $(DESTDIR)$(root_libdir); \
+ mv $(DESTDIR)$(libdir)/libf2fs_format.so.* $(DESTDIR)$(root_libdir); \
+ so_img_name=$$(readlink $(DESTDIR)$(libdir)/libf2fs_format.so); \
+ so_img_rel_target=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g'); \
+ (cd $(DESTDIR)$(libdir) && \
+ rm -f libf2fs_format.so && \
+ $(LN_S) $$so_img_rel_target$(root_libdir)/$$so_img_name libf2fs_format.so); \
+ fi
+
+uninstall-hook:
+ rm $(DESTDIR)$(root_libdir)/libf2fs_format.so*
--
2.18.0.rc0
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
next reply other threads:[~2018-08-20 3:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-20 3:04 Theodore Ts'o [this message]
2018-08-20 3:04 ` [PATCH 2/2] Ask git to ignore the generated sg_write_buffer executable Theodore Ts'o
2018-08-20 7:21 ` Chao Yu
2018-08-27 15:51 ` [PATCH 1/2] add configure option --with-root-libdir Theodore Y. Ts'o
2018-08-27 16:57 ` Jaegeuk Kim
2018-08-27 23:56 ` Theodore Y. Ts'o
2018-08-28 7:12 ` Jaegeuk Kim
2018-08-28 14:25 ` Theodore Y. Ts'o
2018-08-28 16:59 ` Jaegeuk Kim
2018-08-29 3:10 ` [PATCH 1/2] add cotnfigure " Theodore Y. Ts'o
2018-08-29 21:04 ` Jaegeuk Kim
2018-08-29 23:51 ` Theodore Y. Ts'o
2018-08-28 3:43 ` [PATCH 1/2] add configure " Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180820030407.13225-1-tytso@mit.edu \
--to=tytso@mit.edu \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).