From 0ccd18bc83c5e6eff77940a61cc9b31a88dd1851 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Mon, 22 Jun 2009 15:33:41 -0400 Subject: [PATCH] =?utf8?q?Bug=20586675=20=E2=80=93=20Runtime=20library=20l?= =?utf8?q?ocation?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Introduce an option to specify the runtime location for libraries via a relative path to libdir. Signed-off-by: David Zeuthen --- configure.in | 11 +++++++++++ docs/reference/glib/building.sgml | 21 +++++++++++++++++++++ docs/reference/glib/tmpl/fileutils.sgml | 17 +++++++++++++++++ gio/Makefile.am | 9 +++++++++ glib/Makefile.am | 9 +++++++++ gmodule/Makefile.am | 9 +++++++++ gobject/Makefile.am | 9 +++++++++ gthread/Makefile.am | 8 ++++++++ 8 files changed, 93 insertions(+) diff --git a/configure.in b/configure.in index 1e070d8..73e9482 100644 --- a/configure.in +++ b/configure.in @@ -245,6 +245,17 @@ else AC_MSG_RESULT([yes]) fi +dnl location to install runtime libraries, e.g. ../../lib to install +dnl to /lib if libdir is /usr/lib +AC_ARG_WITH(runtime-libdir, + [AC_HELP_STRING([--with-runtime-libdir=RELPATH], + [Install runtime libraries relative to libdir])], + [], + [with_runtime_libdir=""]) +GLIB_RUNTIME_LIBDIR=$with_runtime_libdir +AC_SUBST(GLIB_RUNTIME_LIBDIR) +AM_CONDITIONAL(HAVE_GLIB_RUNTIME_LIBDIR, [test "x$with_runtime_libdir" != "x"]) + dnl Checks for programs. AC_PROG_CC AC_PROG_CPP diff --git a/docs/reference/glib/building.sgml b/docs/reference/glib/building.sgml index 0274f3d..72c82b3 100644 --- a/docs/reference/glib/building.sgml +++ b/docs/reference/glib/building.sgml @@ -234,6 +234,9 @@ How to compile GLib itself --disable-selinux --enable-selinux + + --with-runtime-libdir=RELPATH + @@ -555,6 +558,24 @@ How to compile GLib itself be included. + + + <systemitem>--with-runtime-libdir=RELPATH</systemitem> + + + Allows specifying a relative path to where to install the runtime + libraries (meaning library files used for running, not developing, + GLib applications). This can be used in operating system setups where + programs using GLib needs to run before e.g. /usr + is mounted. + For example, if LIBDIR is /usr/lib and + ../../lib is passed to + --with-runtime-libdir then the + runtime libraries are installed into /lib rather + than /usr/lib. + + + diff --git a/docs/reference/glib/tmpl/fileutils.sgml b/docs/reference/glib/tmpl/fileutils.sgml index 0b9ef6c..eeef84c 100644 --- a/docs/reference/glib/tmpl/fileutils.sgml +++ b/docs/reference/glib/tmpl/fileutils.sgml @@ -294,6 +294,23 @@ not be accessed directly. @Returns: + + + + + +@file: +@Returns: + + + + + + + +@file: + + diff --git a/gio/Makefile.am b/gio/Makefile.am index 3f8f180..1376443 100644 --- a/gio/Makefile.am +++ b/gio/Makefile.am @@ -424,3 +424,12 @@ gioenumtypes.c: $(gio_headers) gioenumtypes.c.template gio-2.0.lib: libgio-2.0.la gio.def lib -machine:@LIB_EXE_MACHINE_FLAG@ -name:libgio-2.0-$(LT_CURRENT_MINUS_AGE).dll -def:gio.def -out:$@ + +if HAVE_GLIB_RUNTIME_LIBDIR +install-data-hook: + mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libgio-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libgio-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + rm -f $(DESTDIR)$(libdir)/libgio-2.0.so + ln -s $(GLIB_RUNTIME_LIBDIR)/libgio-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/libgio-2.0.so +endif diff --git a/glib/Makefile.am b/glib/Makefile.am index eb220e6..af07716 100644 --- a/glib/Makefile.am +++ b/glib/Makefile.am @@ -364,3 +364,12 @@ dist-hook: $(BUILT_EXTRA_DIST) for f in $$files; do \ if test -f $$f; then d=.; else d=$(srcdir); fi; \ cp $$d/$$f $(distdir) || exit 1; done + +if HAVE_GLIB_RUNTIME_LIBDIR +install-data-hook: + mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libglib-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libglib-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + rm -f $(DESTDIR)$(libdir)/libglib-2.0.so + ln -s $(GLIB_RUNTIME_LIBDIR)/libglib-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/libglib-2.0.so +endif diff --git a/gmodule/Makefile.am b/gmodule/Makefile.am index 80a5605..f0e63d1 100644 --- a/gmodule/Makefile.am +++ b/gmodule/Makefile.am @@ -116,3 +116,12 @@ dist-hook: $(BUILT_EXTRA_DIST) install-data-local: install-ms-lib install-def-file uninstall-local: uninstall-ms-lib uninstall-def-file + +if HAVE_GLIB_RUNTIME_LIBDIR +install-data-hook: + mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libgmodule-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libgmodule-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + rm -f $(DESTDIR)$(libdir)/libgmodule-2.0.so + ln -s $(GLIB_RUNTIME_LIBDIR)/libgmodule-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/libgmodule-2.0.so +endif diff --git a/gobject/Makefile.am b/gobject/Makefile.am index f8a7de4..ec27aa1 100644 --- a/gobject/Makefile.am +++ b/gobject/Makefile.am @@ -260,3 +260,12 @@ distclean-local: if test $(srcdir) = .; then :; else \ rm -f $(BUILT_EXTRA_DIST); \ fi + +if HAVE_GLIB_RUNTIME_LIBDIR +install-data-hook: + mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libgobject-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + rm -f $(DESTDIR)$(libdir)/libgobject-2.0.so + ln -s $(GLIB_RUNTIME_LIBDIR)/libgobject-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/libgobject-2.0.so +endif diff --git a/gthread/Makefile.am b/gthread/Makefile.am index a7b53cf..a65c15f 100644 --- a/gthread/Makefile.am +++ b/gthread/Makefile.am @@ -92,3 +92,11 @@ install-data-local: install-ms-lib install-def-file uninstall-local: uninstall-ms-lib uninstall-def-file +if HAVE_GLIB_RUNTIME_LIBDIR +install-data-hook: + mkdir -p $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libgthread-2.0.so.0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + mv $(DESTDIR)$(libdir)/libgthread-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/$(GLIB_RUNTIME_LIBDIR) + rm -f $(DESTDIR)$(libdir)/libgthread-2.0.so + ln -s $(GLIB_RUNTIME_LIBDIR)/libgthread-2.0.so.0.$(LT_CURRENT).0 $(DESTDIR)$(libdir)/libgthread-2.0.so +endif -- 2.7.4