From: Kay Sievers Date: Thu, 14 Jul 2011 23:31:06 +0000 (+0200) Subject: libsystemd-daemon: support installation in --with-rootlibdir X-Git-Tag: v31~43 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=ae446765eb0605d2451bb4dd7c336672bcc7ab0c libsystemd-daemon: support installation in --with-rootlibdir --- diff --git a/Makefile.am b/Makefile.am index fc59b57c0..54f414a75 100644 --- a/Makefile.am +++ b/Makefile.am @@ -194,10 +194,11 @@ endif lib_LTLIBRARIES = \ libsystemd-daemon.la \ - libsystemd-login.la + libsystemd-login.la pkginclude_HEADERS = \ - src/sd-login.h + src/sd-daemon.h \ + src/sd-login.h noinst_PROGRAMS = \ test-engine \ @@ -1380,6 +1381,19 @@ libsystemd_daemon_la_LDFLAGS = \ -version-info $(LIBSYSTEMD_DAEMON_CURRENT):$(LIBSYSTEMD_DAEMON_REVISION):$(LIBSYSTEMD_DAEMON_AGE) \ -Wl,--version-script=$(top_srcdir)/src/libsystemd-daemon.sym +# move lib from $(libdir) to $(rootlibdir) and update devel link, if needed +libsystemd-daemon-install-hook: + if test "$(libdir)" != "$(rootlibdir)"; then \ + mkdir -p $(DESTDIR)$(rootlibdir) && \ + so_img_name=$$(readlink $(DESTDIR)$(libdir)/libsystemd-daemon.so) && \ + so_img_rel_target_prefix=$$(echo $(libdir) | sed 's,\(^/\|\)[^/][^/]*,..,g') && \ + ln -sf $$so_img_rel_target_prefix$(rootlibdir)/$$so_img_name $(DESTDIR)$(libdir)/libsystemd-daemon.so && \ + mv $(DESTDIR)$(libdir)/libsystemd-daemon.so.* $(DESTDIR)$(rootlibdir); \ + fi + +libsystemd-daemon-uninstall-hook: + rm -f $(DESTDIR)$(rootlibdir)/libsystemd-daemon.so* + libsystemd_login_la_SOURCES = \ src/sd-login.c \ src/cgroup-util.c @@ -1808,6 +1822,10 @@ if HAVE_SYSV_COMPAT $(LN_S) ../var-lock.mount var-lock.mount ) endif +install-exec-hook: libsystemd-daemon-install-hook + +uninstall-hook: libsystemd-daemon-uninstall-hook + DISTCHECK_CONFIGURE_FLAGS = \ --with-dbuspolicydir=$$dc_install_base/$(dbuspolicydir) \ --with-dbussessionservicedir=$$dc_install_base/$(dbussessionservicedir) \ diff --git a/README b/README index c58fbcbcf..b7b0db763 100644 --- a/README +++ b/README @@ -31,7 +31,7 @@ LICENSE: REQUIREMENTS: Linux kernel >= 2.6.30 (with devtmpfs, cgroups; optional but strongly recommended: autofs4, ipv6) - libudev >= 163 + libudev >= 172 dbus >= 1.4.0 libcap gtk+ >= 2.20 (optional) diff --git a/autogen.sh b/autogen.sh index 55a115d4e..b2b680a85 100755 --- a/autogen.sh +++ b/autogen.sh @@ -52,6 +52,10 @@ if type -p colorgcc > /dev/null ; then export CC=colorgcc fi +libdir() { + echo $(cd $1/$(gcc -print-multi-os-directory); pwd) +} + if [ "x$1" = "xam" ] ; then run_versioned automake "$AM_VERSION" -a -c --foreign ./config.status @@ -67,7 +71,13 @@ else run_versioned automake "$AM_VERSION" --copy --foreign --add-missing if [ "x$1" != "xac" ]; then - CFLAGS="$CFLAGS -g -O0" ./configure --sysconfdir=/etc --localstatedir=/var --with-rootdir= --libexecdir=/usr/lib "$@" + CFLAGS="$CFLAGS -g -O0" ./configure \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --libexecdir=/usr/lib \ + --libdir=$(libdir /usr/local/lib) \ + --with-rootdir= \ + "$@" make clean fi fi diff --git a/configure.ac b/configure.ac index 3b41dbc3a..198a6395a 100644 --- a/configure.ac +++ b/configure.ac @@ -521,6 +521,11 @@ AC_ARG_WITH([rootdir], [], [with_rootdir=${ac_default_prefix}]) +AC_ARG_WITH([rootlibdir], + AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]), + [], + [with_rootlibdir=${libdir}]) + AC_SUBST([dbuspolicydir], [$with_dbuspolicydir]) AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir]) AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir]) @@ -528,11 +533,11 @@ AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir]) AC_SUBST([udevrulesdir], [$with_udevrulesdir]) AC_SUBST([pamlibdir], [$with_pamlibdir]) AC_SUBST([rootdir], [$with_rootdir]) +AC_SUBST([rootlibdir], [$with_rootlibdir]) AC_CONFIG_FILES([Makefile po/Makefile.in]) AC_OUTPUT - -echo " +AC_MSG_RESULT([ $PACKAGE_NAME $VERSION Distribution: ${with_distro} @@ -550,10 +555,12 @@ echo " plymouth: ${have_plymouth} prefix: ${prefix} root dir: ${with_rootdir} - udev rules dir: ${with_udevrulesdir} + lib dir: ${libdir} + rootlib dir: ${with_rootlibdir} pam modules dir: ${with_pamlibdir} + udev rules dir: ${with_udevrulesdir} dbus policy dir: ${with_dbuspolicydir} dbus session dir: ${with_dbussessionservicedir} dbus system dir: ${with_dbussystemservicedir} dbus interfaces dir: ${with_dbusinterfacedir} -" +])