svn rev #23905: trunk/src/ config/ tests/dejagnu/ util/
tlyu@MIT.EDU
tlyu at MIT.EDU
Fri Apr 16 17:45:22 EDT 2010
http://src.mit.edu/fisheye/changelog/krb5/?cs=23905
Commit By: tlyu
Log Message:
Build runenv.py, holding environment variable settings required for
running programs out of the build tree during python-based tests.
Also updates shilb.conf to set RUN_VARS to make it easier to generate
this sort of thing.
Changed Files:
U trunk/src/aclocal.m4
U trunk/src/config/post.in
U trunk/src/config/pre.in
U trunk/src/config/shlib.conf
U trunk/src/tests/dejagnu/Makefile.in
U trunk/src/util/k5test.py
Modified: trunk/src/aclocal.m4
===================================================================
--- trunk/src/aclocal.m4 2010-04-14 20:25:02 UTC (rev 23904)
+++ trunk/src/aclocal.m4 2010-04-16 21:45:22 UTC (rev 23905)
@@ -1131,7 +1131,9 @@
AC_DEFUN(KRB5_RUN_FLAGS,
[AC_REQUIRE([KRB5_LIB_AUX])dnl
KRB5_RUN_ENV="$RUN_ENV"
-AC_SUBST(KRB5_RUN_ENV)])
+KRB5_RUN_VARS="$RUN_VARS"
+AC_SUBST(KRB5_RUN_ENV)
+AC_SUBST(KRB5_RUN_VARS)])
dnl
dnl KRB5_LIB_AUX
Modified: trunk/src/config/post.in
===================================================================
--- trunk/src/config/post.in 2010-04-14 20:25:02 UTC (rev 23904)
+++ trunk/src/config/post.in 2010-04-16 21:45:22 UTC (rev 23905)
@@ -136,14 +136,12 @@
check-pytests:: check-pytests- at 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
@@ -152,11 +150,22 @@
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)
Modified: trunk/src/config/pre.in
===================================================================
--- trunk/src/config/pre.in 2010-04-14 20:25:02 UTC (rev 23904)
+++ trunk/src/config/pre.in 2010-04-16 21:45:22 UTC (rev 23905)
@@ -398,6 +398,7 @@
# So test programs can find their libraries without "make install", etc.
KRB5_RUN_ENV=@KRB5_RUN_ENV@
+KRB5_RUN_VARS=@KRB5_RUN_VARS@
#
# variables for --with-tcl=
Modified: trunk/src/config/shlib.conf
===================================================================
--- trunk/src/config/shlib.conf 2010-04-14 20:25:02 UTC (rev 23904)
+++ trunk/src/config/shlib.conf 2010-04-16 21:45:22 UTC (rev 23905)
@@ -98,6 +98,7 @@
# 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.
@@ -141,6 +142,7 @@
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
@@ -188,6 +190,7 @@
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
;;
@@ -236,6 +239,7 @@
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
;;
@@ -260,6 +264,7 @@
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
;;
@@ -278,6 +283,7 @@
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
;;
@@ -295,6 +301,7 @@
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
;;
@@ -322,6 +329,7 @@
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
;;
@@ -339,6 +347,7 @@
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
;;
@@ -364,6 +373,7 @@
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*)
@@ -399,6 +409,7 @@
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)
@@ -424,6 +435,7 @@
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
@@ -451,6 +463,7 @@
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
;;
@@ -482,6 +495,7 @@
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.*)
@@ -519,6 +533,7 @@
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
Modified: trunk/src/tests/dejagnu/Makefile.in
===================================================================
--- trunk/src/tests/dejagnu/Makefile.in 2010-04-14 20:25:02 UTC (rev 23904)
+++ trunk/src/tests/dejagnu/Makefile.in 2010-04-16 21:45:22 UTC (rev 23905)
@@ -33,12 +33,8 @@
clean-unix::
$(RM) -rf tmpdir dbg.log krb.log krb.sum
-runenv.vars: Makefile
- echo '$(KRB5_RUN_ENV)' | tr ';' '\012' | \
- sed -ne 's% *\([^=]*\)=.*%\1%p' > runenv.vars
-
-runenv.vals: runenv.vars
- $(KRB5_RUN_ENV) for i in `cat runenv.vars`; do \
+runenv.vals: Makefile
+ $(KRB5_RUN_ENV) for i in $(KRB5_RUN_VARS); do \
eval echo "{$$i=\$$$$i}"; done > runenv.vals
site.exp: runenv.vals Makefile
Modified: trunk/src/util/k5test.py
===================================================================
--- trunk/src/util/k5test.py 2010-04-14 20:25:02 UTC (rev 23904)
+++ trunk/src/util/k5test.py 2010-04-16 21:45:22 UTC (rev 23905)
@@ -304,6 +304,11 @@
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
@@ -462,17 +467,8 @@
# 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
# cfg2 contains keys mapped to None, the corresponding keys will be
More information about the cvs-krb5
mailing list