introduce --with-rootlibdir=DIR

Support the installation of the shared library in the rootfs --rootlibdir=,
while the development symlink stays in --libdir=.
This commit is contained in:
Kay Sievers 2011-12-22 15:40:24 +01:00 committed by Lucas De Marchi
parent 759214fad0
commit e79bf83b06
2 changed files with 18 additions and 0 deletions

View File

@ -68,6 +68,18 @@ pkgconfig_DATA = libkmod/libkmod.pc
EXTRA_DIST += libkmod/libkmod.pc.in
CLEANFILES += libkmod/libkmod.pc
install-exec-hook:
if test "$(libdir)" != "$(rootlibdir)"; then \
mkdir -p $(DESTDIR)$(rootlibdir) && \
so_img_name=$$(readlink $(DESTDIR)$(libdir)/libkmod.so) && \
so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \
ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libkmod.so && \
mv $(DESTDIR)$(libdir)/libkmod.so.* $(DESTDIR)$(rootlibdir); \
fi
uninstall-hook:
rm -f $(DESTDIR)$(rootlibdir)/libkmod.so*
if BUILD_TOOLS
bin_PROGRAMS = tools/kmod-insmod tools/kmod-rmmod tools/kmod-lsmod \
tools/kmod-modprobe tools/kmod-modinfo

View File

@ -35,6 +35,11 @@ AC_ARG_WITH([rootprefix],
[], [with_rootprefix=""])
AC_SUBST([rootprefix], [$with_rootprefix])
AC_ARG_WITH([rootlibdir],
AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
[], [with_rootlibdir=$libdir])
AC_SUBST([rootlibdir], [$with_rootlibdir])
AC_ARG_ENABLE([tools],
AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
[], enable_tools=yes)
@ -135,6 +140,7 @@ AC_MSG_RESULT([
rootprefix: ${rootprefix}
sysconfdir: ${sysconfdir}
libdir: ${libdir}
rootlibdir: ${rootlibdir}
includedir: ${includedir}
bindir: ${bindir}