On Thu, 17 Apr 2008, Behdad Esfahbod wrote:

If running uninstalled build is not a goal, why bother about
LD_LIBRARY_PATH'ing the uninstalled library path at all?

I feel your pain. As a workaround, for my own software I add a small script which exports environment variables prior to running each test. This is an extra shim layer that should not have to exist. The script (attached) has substitutions applied to it prior to use. In the future, I might include similar replicated code in each test script so that the tests are completely stand-alone and run a bit faster.

An unfortunate thing is that not all software is configured the same. For example, my own software supports independent configuration for the location of different types of files. A single top "prefix" environment variable would not directly work with my application while it might work for others. A single top prefix would require that the application know the structure of the build tree, which is likely a bad thing since it may not match the install tree.

It seems to me that the proper place to fix this is at the Automake level since Automake's weak support for tests is the true cause of the problem.

Bob
======================================
Bob Friesenhahn
[EMAIL PROTECTED], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
# !/bin/sh
# Copyright (C) 2003, 2004 GraphicsMagick Group
#
# This program is covered by multiple licenses, which are described in
# Copyright.txt. You should have received a copy of Copyright.txt with this
# package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.
#
# Execute a program with the environment required to execute it using
# files from the source and build directory.  This helps avoid needing to
# install GraphicsMagick before testing it.
#
# Written by Bob Friesenhahn <[EMAIL PROTECTED]> December 2003
#

top_srcdir='@abs_top_srcdir@'
top_builddir='@abs_top_builddir@'

MAGICK_CODER_MODULE_PATH='@MAGICK_CODER_MODULE_PATH@'
MAGICK_CONFIGURE_SRC_PATH='@MAGICK_CONFIGURE_SRC_PATH@'
MAGICK_CONFIGURE_BUILD_PATH='@MAGICK_CONFIGURE_BUILD_PATH@'
MAGICK_FILTER_MODULE_PATH='@MAGICK_FILTER_MODULE_PATH@'
DIRSEP='@DIRSEP@'

PATH="${top_builddir}/utilities:${PATH}"

if test -n "$VERBOSE"
then
  echo "$@"
fi
env \
  LD_LIBRARY_PATH="${top_builddir}/magick/.libs:${LD_LIBRARY_PATH}" \
  MAGICK_CODER_MODULE_PATH="${MAGICK_CODER_MODULE_PATH}" \
  
MAGICK_CONFIGURE_PATH="${MAGICK_CONFIGURE_BUILD_PATH}${DIRSEP}${MAGICK_CONFIGURE_SRC_PATH}"
 \
  MAGICK_FILTER_MODULE_PATH="${MAGICK_FILTER_MODULE_PATH}" \
  PATH="${PATH}" \
  "$@"

Reply via email to