2003-04-07 17:34:50 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
2008-02-15 23:13:59 +00:00
|
|
|
# Copyright (C) 2003, 2006, 2008 Free Software Foundation
|
2003-04-07 17:34:50 +00:00
|
|
|
#
|
|
|
|
|
# This file is part of GUILE.
|
|
|
|
|
#
|
|
|
|
|
# This script is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
#
|
|
|
|
|
# This library is distributed in the hope that it will be useful,
|
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
# Lesser General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
# License along with this library; if not, write to the Free Software
|
2005-05-23 19:57:22 +00:00
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2003-04-07 17:34:50 +00:00
|
|
|
|
2009-03-27 14:03:03 -07:00
|
|
|
# NOTE: If you update this file, please update uninstalled.in as
|
2003-04-07 17:34:50 +00:00
|
|
|
# well, if appropriate.
|
|
|
|
|
|
2009-03-27 14:03:03 -07:00
|
|
|
# Usage: uninstalled-env [ARGS]
|
2003-04-07 17:34:50 +00:00
|
|
|
|
|
|
|
|
# This script arranges for the environment to support running Guile
|
|
|
|
|
# from the build tree. The following env vars are modified (but not
|
|
|
|
|
# clobbered): GUILE_LOAD_PATH, LTDL_LIBRARY_PATH, and PATH.
|
|
|
|
|
|
2009-03-27 14:03:03 -07:00
|
|
|
# Example: uninstalled-env guile -c '(display "hello\n")'
|
|
|
|
|
# Example: ../../uninstalled-env ./guile-test-foo
|
2003-04-07 17:34:50 +00:00
|
|
|
|
|
|
|
|
# config
|
2008-08-21 15:11:27 -07:00
|
|
|
subdirs_with_ltlibs="srfi guile-readline libguile" # maintain me
|
2003-04-07 17:34:50 +00:00
|
|
|
|
|
|
|
|
# env (set by configure)
|
|
|
|
|
top_srcdir="@top_srcdir_absolute@"
|
|
|
|
|
top_builddir="@top_builddir_absolute@"
|
|
|
|
|
|
|
|
|
|
[ x"$top_srcdir" = x -o ! -d "$top_srcdir" -o \
|
|
|
|
|
x"$top_builddir" = x -o ! -d "$top_builddir" ] && {
|
|
|
|
|
echo $0: bad environment
|
|
|
|
|
echo top_srcdir=$top_srcdir
|
|
|
|
|
echo top_builddir=$top_builddir
|
|
|
|
|
exit 1
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-16 17:13:27 +00:00
|
|
|
if [ x"$GUILE_LOAD_PATH" = x ]
|
|
|
|
|
then
|
2008-08-21 18:39:30 -07:00
|
|
|
if test "${top_srcdir}" != "${top_builddir}"; then
|
|
|
|
|
GUILE_LOAD_PATH="${top_builddir}/guile-readline:${top_srcdir}/guile-readline:${top_builddir}:${top_srcdir}:${top_builddir}/module:${top_srcdir}/module"
|
|
|
|
|
else
|
2009-03-16 23:39:29 +01:00
|
|
|
GUILE_LOAD_PATH="${top_srcdir}/guile-readline:${top_srcdir}:${top_srcdir}/module:${top_srcdir}/module"
|
2008-08-21 18:39:30 -07:00
|
|
|
fi
|
2003-04-07 17:34:50 +00:00
|
|
|
else
|
2008-08-21 18:39:30 -07:00
|
|
|
for d in "${top_srcdir}" "${top_srcdir}/guile-readline" \
|
|
|
|
|
"${top_srcdir}/module" "${top_builddir}/module"
|
2004-06-16 17:13:27 +00:00
|
|
|
do
|
2003-04-07 17:34:50 +00:00
|
|
|
# This hair prevents double inclusion.
|
|
|
|
|
# The ":" prevents prefix aliasing.
|
2004-06-16 17:13:27 +00:00
|
|
|
case x"$GUILE_LOAD_PATH" in
|
|
|
|
|
x*${d}:*) ;;
|
|
|
|
|
*) GUILE_LOAD_PATH="${d}:$GUILE_LOAD_PATH" ;;
|
2003-04-07 17:34:50 +00:00
|
|
|
esac
|
2004-06-16 17:13:27 +00:00
|
|
|
done
|
2003-04-07 17:34:50 +00:00
|
|
|
fi
|
|
|
|
|
export GUILE_LOAD_PATH
|
|
|
|
|
|
2008-09-18 23:04:58 +02:00
|
|
|
# Don't look in installed dirs for guile modules
|
|
|
|
|
if ( env | grep -v -q -E '^GUILE_SYSTEM_PATH=' ); then
|
|
|
|
|
export GUILE_SYSTEM_PATH=
|
|
|
|
|
fi
|
|
|
|
|
|
2003-04-07 17:34:50 +00:00
|
|
|
# handle LTDL_LIBRARY_PATH (no clobber)
|
|
|
|
|
ltdl_prefix=""
|
2008-01-30 22:59:12 +00:00
|
|
|
dyld_prefix=""
|
2003-04-07 17:34:50 +00:00
|
|
|
for dir in $subdirs_with_ltlibs ; do
|
|
|
|
|
ltdl_prefix="${top_builddir}/${dir}:${ltdl_prefix}"
|
2008-01-30 22:59:12 +00:00
|
|
|
dyld_prefix="${top_builddir}/${dir}/.libs:${dyld_prefix}"
|
2003-04-07 17:34:50 +00:00
|
|
|
done
|
|
|
|
|
LTDL_LIBRARY_PATH="${ltdl_prefix}$LTDL_LIBRARY_PATH"
|
|
|
|
|
export LTDL_LIBRARY_PATH
|
2009-04-20 17:23:40 +02:00
|
|
|
DYLD_LIBRARY_PATH="${dyld_prefix}$DYLD_LIBRARY_PATH"
|
2008-01-30 22:59:12 +00:00
|
|
|
export DYLD_LIBRARY_PATH
|
2003-04-07 17:34:50 +00:00
|
|
|
|
2009-03-27 14:03:03 -07:00
|
|
|
if [ x"$PKG_CONFIG_PATH" = x ]
|
|
|
|
|
then
|
2009-04-06 11:07:22 -07:00
|
|
|
PKG_CONFIG_PATH="${top_builddir}/meta"
|
2009-03-27 14:03:03 -07:00
|
|
|
else
|
2009-04-06 11:07:22 -07:00
|
|
|
PKG_CONFIG_PATH="${top_builddir}/meta:$PKG_CONFIG_PATH"
|
2009-03-27 14:03:03 -07:00
|
|
|
fi
|
|
|
|
|
export PKG_CONFIG_PATH
|
|
|
|
|
|
2003-04-07 17:34:50 +00:00
|
|
|
# handle PATH (no clobber)
|
|
|
|
|
PATH="${top_builddir}/libguile:${PATH}"
|
2009-03-27 14:03:03 -07:00
|
|
|
PATH="${top_builddir}/meta:${PATH}"
|
2003-04-07 17:34:50 +00:00
|
|
|
export PATH
|
|
|
|
|
|
|
|
|
|
exec "$@"
|