kmod/kmod-2-with-rootlibdir.patch
2011-12-23 02:12:52 -05:00

107 lines
3.3 KiB
Diff

diff -urNp kmod-2_orig/configure kmod-2/configure
--- kmod-2_orig/configure 2011-12-20 20:48:00.170160687 -0500
+++ kmod-2/configure 2011-12-22 19:39:11.899001373 -0500
@@ -621,6 +621,7 @@ required_private_libs
zlib_libs
BUILD_TOOLS_FALSE
BUILD_TOOLS_TRUE
+rootlibdir
rootprefix
OTOOL64
OTOOL
@@ -745,6 +746,7 @@ with_gnu_ld
with_sysroot
enable_libtool_lock
with_rootprefix
+with_rootlibdir
enable_tools
enable_logging
enable_zlib
@@ -1405,6 +1407,7 @@ Optional Packages:
(or the compiler's sysroot if not specified).
--with-rootprefix=DIR rootfs directory prefix for config files and kernel
modules
+ --with-rootlibdir=DIR rootfs directory to install shared libraries
Some influential environment variables:
CC C compiler command
@@ -13233,6 +13236,17 @@ fi
rootprefix=$with_rootprefix
+
+# Check whether --with-rootlibdir was given.
+if test "${with_rootlibdir+set}" = set; then :
+ withval=$with_rootlibdir;
+else
+ with_rootlibdir=$libdir
+fi
+
+rootlibdir=$with_rootlibdir
+
+
# Check whether --enable-tools was given.
if test "${enable_tools+set}" = set; then :
enableval=$enable_tools;
@@ -15828,6 +15842,7 @@ fi
rootprefix: ${rootprefix}
sysconfdir: ${sysconfdir}
libdir: ${libdir}
+ rootlibdir: ${rootlibdir}
includedir: ${includedir}
bindir: ${bindir}
@@ -15848,6 +15863,7 @@ $as_echo "
rootprefix: ${rootprefix}
sysconfdir: ${sysconfdir}
libdir: ${libdir}
+ rootlibdir: ${rootlibdir}
includedir: ${includedir}
bindir: ${bindir}
diff -urNp kmod-2_orig/configure.ac kmod-2/configure.ac
--- kmod-2_orig/configure.ac 2011-12-20 20:36:37.036701029 -0500
+++ kmod-2/configure.ac 2011-12-22 19:39:11.980007591 -0500
@@ -32,6 +32,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)
@@ -134,6 +139,7 @@ AC_MSG_RESULT([
rootprefix: ${rootprefix}
sysconfdir: ${sysconfdir}
libdir: ${libdir}
+ rootlibdir: ${rootlibdir}
includedir: ${includedir}
bindir: ${bindir}
diff -urNp kmod-2_orig/Makefile.am kmod-2/Makefile.am
--- kmod-2_orig/Makefile.am 2011-12-20 20:36:21.337897292 -0500
+++ kmod-2/Makefile.am 2011-12-22 19:39:11.980007591 -0500
@@ -53,6 +53,18 @@ libkmod_libkmod_la_LIBADD = @zlib_libs@
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = 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