check-pytests:: check-pytests-@HAVE_PYTHON@
-check-pytests-yes:
+check-pytests-yes: runenv.py
@pytests="$(PYTESTS)"; \
for t in $$pytests; do \
- echo "$(KRB5_RUN_ENV)" \
- PYTHONPATH=$(top_srcdir)/util VALGRIND="$(VALGRIND)" \
+ echo PYTHONPATH=`pwd`:$(top_srcdir)/util VALGRIND="$(VALGRIND)" \
$(PYTHON) $(srcdir)/$$t $(PYTESTFLAGS); \
- $(KRB5_RUN_ENV) \
- PYTHONPATH=$(top_srcdir)/util VALGRIND="$(VALGRIND)" \
+ PYTHONPATH=`pwd`:$(top_srcdir)/util VALGRIND="$(VALGRIND)" \
$(PYTHON) $(srcdir)/$$t $(PYTESTFLAGS) || exit 1; \
done
echo "+++ Skipping because Python not available: $(PYTESTS)"; \
fi
+pyrunenv.vals: Makefile
+ $(KRB5_RUN_ENV) \
+ for i in $(KRB5_RUN_VARS); do \
+ eval echo 'env['\\\'$$i\\\''] = '\\\'\$$$$i\\\'; \
+ done > $@
+
+runenv.py: pyrunenv.vals
+ echo 'env = {}' > $@
+ cat pyrunenv.vals >> $@
+
clean:: clean-$(WHAT)
clean-unix::
$(RM) $(OBJS) $(DEPTARGETS_CLEAN) $(EXTRA_FILES) et-[ch]-*.et et-[ch]-*.[ch]
-$(RM) -r $(top_srcdir)/autom4te.cache
+ $(RM) runenv.py pyrunenv.vals
clean-windows::
$(RM) *.$(OBJEXT)
# of searching for shared libs, since RPATHs take precedence over
# LD_LIBRARY_PATH.
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`$${LD_LIBRARY_PATH+:$$LD_LIBRARY_PATH}; export LD_LIBRARY_PATH; _RLD_ROOT=$(FAKEDEST):$${_RLD_ROOT+$$_RLD_ROOT}$${_RLD_ROOT-/}; export _RLD_ROOT;'
+ RUN_VARS='LD_LIBRARY_PATH _RLD_ROOT'
;;
# HPUX *seems* to work under 10.20.
CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) -Wl,+s $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='SHLIB_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export SHLIB_PATH;'
+ RUN_VARS='SHLIB_PATH'
SHLIB_EXPORT_FILE_DEP=hpux10.exports
# Do *not* set use_linker_init_option=yes here, because in the
# case where the library is specified at program link time, the
for i in N32 64 ''; do
RUN_ENV="${RUN_ENV+ $RUN_ENV}LD_LIBRARY${i}_PATH=$add\$\${LD_LIBRARY${i}_PATH+:\$\$LD_LIBRARY${i}_PATH}; export LD_LIBRARY${i}_PATH;"
RUN_ENV="${RUN_ENV} _RLD${i}_ROOT=\$(FAKEDEST):\$\${_RLD${i}_ROOT+\$\${_RLD${i}_ROOT}}\$\${_RLD${i}_ROOT-/}; export _RLD${i}_ROOT;"
+ RUN_VARS="$RUN_VARS LD_LIBRARY${i}_PATH _RLD${i}_ROOT"
done
;;
for i in N32 64 ''; do
RUN_ENV="${RUN_ENV+ $RUN_ENV}LD_LIBRARY${i}_PATH=$add\$\${LD_LIBRARY${i}_PATH+:\$\$LD_LIBRARY${i}_PATH}; export LD_LIBRARY${i}_PATH;"
RUN_ENV="${RUN_ENV} _RLD${i}_ROOT=\$(FAKEDEST):\$\${_RLD${i}_ROOT+\$\${_RLD${i}_ROOT}}\$\${_RLD${i}_ROOT-/}; export _RLD${i}_ROOT;"
+ RUN_VARS="$RUN_VARS LD_LIBRARY${i}_PATH _RLD${i}_ROOT"
done
;;
CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
+ RUN_VARS='LD_LIBRARY_PATH'
PROFFLAGS=-pg
;;
CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
+ RUN_VARS='LD_LIBRARY_PATH'
PROFFLAGS=-pg
;;
CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
+ RUN_VARS='LD_LIBRARY_PATH'
PROFFLAGS=-pg
;;
CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
+ RUN_VARS='LD_LIBRARY_PATH'
PROFFLAGS=-pg
;;
CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
+ RUN_VARS='LD_LIBRARY_PATH'
PROFFLAGS=-pg
;;
CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) -dynamic $(CXXFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='DYLD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export DYLD_LIBRARY_PATH;'
+ RUN_VARS='DYLD_LIBRARY_PATH'
;;
*-*-solaris*)
CXX_LINK_SHARED='$(PURE) $(CXX) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(PURE) $(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH;'
+ RUN_VARS='LD_LIBRARY_PATH'
;;
*-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu)
CXX_LINK_SHARED='$(CXX) $(PROG_LIBPATH) $(PROG_RPATH_FLAGS) $(CXXFLAGS) $(LDFLAGS)'
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export LD_LIBRARY_PATH; '
+ RUN_VARS='LD_LIBRARY_PATH'
## old version:
# Linux libc does weird stuff at shlib link time, must be
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH)'
RUN_ENV='LD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/
/:/g"`; export LD_LIBRARY_PATH;'
+ RUN_VARS='LD_LIBRARY_PATH'
PROFFLAGS=-pg
;;
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
# $(PROG_RPATH) is here to handle things like a shared tcl library
RUN_ENV='LIBPATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`:$(PROG_RPATH):/usr/lib:/usr/local/lib; export LIBPATH; '
+ RUN_VARS='LIBPATH'
;;
*-*-aix4.*)
CXX_LINK_STATIC='$(CXX) $(PROG_LIBPATH) $(CXXFLAGS) $(LDFLAGS)'
# $(PROG_RPATH) is here to handle things like a shared tcl library
RUN_ENV='LIBPATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`:$(PROG_RPATH):/usr/lib:/usr/local/lib; export LIBPATH; '
+ RUN_VARS='LIBPATH'
;;
esac
import subprocess
import sys
+# runenv.py is built in each directory where tests are run, providing
+# the environment variable settings needed for running programs in the
+# build tree. These can vary by platform.
+import runenv
+
# Used when most things go wrong (other than programming errors) so
# that the user sees an error message rather than a Python traceback,
# without help from the test script. The on-exit handler will display
# Return an environment suitable for running programs in the build
# tree. It is safe to modify the result.
def _build_env():
- libdir = os.path.join(buildtop, 'lib')
- env = os.environ.copy()
- ldlpath = env.get('LD_LIBRARY_PATH')
- if ldlpath:
- ldlpath = libdir + os.pathsep + ldlpath
- else:
- ldlpath = libdir
- env['LD_LIBRARY_PATH'] = ldlpath
- return env
-
+ return dict(runenv.env)
# Merge the nested dictionaries cfg1 and cfg2 into a new dictionary.
# cfg1 or cfg2 may be None, in which case the other is returned. If