Skip to content

Commit

Permalink
libsystemd-daemon: support installation in --with-rootlibdir
Browse files Browse the repository at this point in the history
  • Loading branch information
kaysievers committed Jul 14, 2011
1 parent 673eab9 commit ae44676
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 8 deletions.
22 changes: 20 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) \
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 11 additions & 1 deletion autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
15 changes: 11 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -521,18 +521,23 @@ 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])
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}
Expand All @@ -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}
"
])

0 comments on commit ae44676

Please sign in to comment.