This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=e66ff09adb22a42a859956a8da89785e2dbc3b52 The branch, master has been updated via e66ff09adb22a42a859956a8da89785e2dbc3b52 (commit) from 726788204f62e44a193fa84baf7dc8d012467413 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e66ff09adb22a42a859956a8da89785e2dbc3b52 Author: Ludovic Courtès <l...@gnu.org> Date: Sat Feb 12 12:25:18 2011 +0100 Make sure we don't override the user's extension search path. * libguile/dynl.c (augment_env): New function. (sysdep_dynl_init): Use it instead of `lt_dladdsearchdir'. * configure.ac: Define `SHARED_LIBRARY_PATH_VARIABLE'. ----------------------------------------------------------------------- Summary of changes: configure.ac | 4 ++++ libguile/dynl.c | 42 ++++++++++++++++++++++++++++++++++++++---- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 2cd8b4d..fd50672 100644 --- a/configure.ac +++ b/configure.ac @@ -78,6 +78,10 @@ AC_PROG_LIBTOOL AM_CONDITIONAL([HAVE_SHARED_LIBRARIES], [test "x$enable_shared" = "xyes"]) +AC_DEFINE_UNQUOTED([SHARED_LIBRARY_PATH_VARIABLE], ["$shlibpath_var"], + [Name of the environment variable that tells the dynamic linker where +to find shared libraries.]) + dnl Check for libltdl. AC_LIB_HAVE_LINKFLAGS([ltdl], [], [#include <ltdl.h>], [lt_dlopenext ("foo");]) diff --git a/libguile/dynl.c b/libguile/dynl.c index dd1e0d3..2484dda 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -1,7 +1,7 @@ /* dynl.c - dynamic linking * * Copyright (C) 1990, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002, - * 2003, 2008, 2009, 2010 Free Software Foundation, Inc. + * 2003, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -25,6 +25,8 @@ # include <config.h> #endif +#include <alloca.h> + /* "dynl.c" dynamically link&load object files. Author: Aubrey Jaffer Modified for libguile by Marius Vollmer */ @@ -44,6 +46,7 @@ maybe_drag_in_eprintf () } #endif +#include <stdlib.h> #include <stdio.h> #include <string.h> @@ -118,6 +121,30 @@ sysdep_dynl_value (const char *symb, void *handle, const char *subr) return fptr; } +/* Augment environment variable VARIABLE with VALUE, assuming VARIABLE + is a path kind of variable. */ +static void +augment_env (const char *variable, const char *value) +{ + const char *env; + + env = getenv (variable); + if (env != NULL) + { + char *new_value; + static const char path_sep[] = { LT_PATHSEP_CHAR, 0 }; + + new_value = alloca (strlen (env) + strlen (value) + 2); + strcpy (new_value, env); + strcat (new_value, path_sep); + strcat (new_value, value); + + setenv (variable, new_value, 1); + } + else + setenv (variable, value, 1); +} + static void sysdep_dynl_init () { @@ -129,15 +156,22 @@ sysdep_dynl_init () if (env && strcmp (env, "") == 0) /* special-case interpret system-ltdl-path=="" as meaning no system path, which is the case during the build */ - ; + ; else if (env) /* FIXME: should this be a colon-separated path? Or is the only point to allow the build system to turn off the installed extensions path? */ lt_dladdsearchdir (env); else { - lt_dladdsearchdir (SCM_LIB_DIR); - lt_dladdsearchdir (SCM_EXTENSIONS_DIR); + /* Add SCM_LIB_DIR and SCM_EXTENSIONS_DIR to the loader's search + path. `lt_dladdsearchdir' and $LTDL_LIBRARY_PATH can't be used + for that because they are searched before the system-dependent + search path, which is the one `libtool --mode=execute -dlopen' + fiddles with (info "(libtool) Libltdl Interface"). See + <http://lists.gnu.org/archive/html/guile-devel/2010-11/msg00095.html> + for details. */ + augment_env (SHARED_LIBRARY_PATH_VARIABLE, SCM_LIB_DIR); + augment_env (SHARED_LIBRARY_PATH_VARIABLE, SCM_EXTENSIONS_DIR); } } hooks/post-receive -- GNU Guile